diff --git a/Makefile b/Makefile index 06a9f6a4451e..c87a9c56babb 100644 --- a/Makefile +++ b/Makefile @@ -283,6 +283,18 @@ generate-go-conversions-core: $(CONVERSION_GEN) --extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha3 \ --output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \ --go-header-file=./hack/boilerplate/boilerplate.generatego.txt + $(MAKE) clean-generated-conversions SRC_DIRS="./api/v1alpha4,./$(EXP_DIR)/api/v1alpha4,./$(EXP_DIR)/addons/api/v1alpha4" + $(CONVERSION_GEN) \ + --input-dirs=./api/v1alpha4 \ + --build-tag=ignore_autogenerated_core_v1alpha4 \ + --output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \ + --go-header-file=./hack/boilerplate/boilerplate.generatego.txt + $(CONVERSION_GEN) \ + --input-dirs=./$(EXP_DIR)/api/v1alpha4 \ + --input-dirs=./$(EXP_DIR)/addons/api/v1alpha4 \ + --extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha4 \ + --output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \ + --go-header-file=./hack/boilerplate/boilerplate.generatego.txt .PHONY: generate-go-cabpk generate-go-cabpk: $(CONTROLLER_GEN) diff --git a/PROJECT b/PROJECT index a63e02d51e26..6cff7382a4b6 100644 --- a/PROJECT +++ b/PROJECT @@ -1,6 +1,7 @@ domain: x-k8s.io repo: sigs.k8s.io/cluster-api resources: +# v1alpha3 types - group: cluster kind: Cluster version: v1alpha3 @@ -13,6 +14,7 @@ resources: - group: cluster kind: MachineDeployment version: v1alpha3 +# v1alpha4 types - group: cluster kind: ClusterClass version: v1alpha4 @@ -28,4 +30,20 @@ resources: - group: cluster kind: MachineDeployment version: v1alpha4 +# v1beta1 types +- group: cluster + kind: ClusterClass + version: v1beta1 +- group: cluster + kind: Cluster + version: v1beta1 +- group: cluster + kind: Machine + version: v1beta1 +- group: cluster + kind: MachineSet + version: v1beta1 +- group: cluster + kind: MachineDeployment + version: v1beta1 version: "2" diff --git a/api/v1alpha3/conversion.go b/api/v1alpha3/conversion.go index df45394b2b49..a59bdc181958 100644 --- a/api/v1alpha3/conversion.go +++ b/api/v1alpha3/conversion.go @@ -18,16 +18,16 @@ package v1alpha3 import ( apiconversion "k8s.io/apimachinery/pkg/conversion" - "sigs.k8s.io/cluster-api/api/v1alpha4" + "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/controller-runtime/pkg/conversion" ) func (src *Cluster) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.Cluster) + dst := dstRaw.(*v1beta1.Cluster) - if err := Convert_v1alpha3_Cluster_To_v1alpha4_Cluster(src, dst, nil); err != nil { + if err := Convert_v1alpha3_Cluster_To_v1beta1_Cluster(src, dst, nil); err != nil { return err } @@ -35,11 +35,11 @@ func (src *Cluster) ConvertTo(dstRaw conversion.Hub) error { // will be "now". See https://github.com/kubernetes-sigs/cluster-api/issues/3798#issuecomment-708619826 for more // discussion. if src.Status.ControlPlaneInitialized { - conditions.MarkTrue(dst, v1alpha4.ControlPlaneInitializedCondition) + conditions.MarkTrue(dst, v1beta1.ControlPlaneInitializedCondition) } // Manually restore data. - restored := &v1alpha4.Cluster{} + restored := &v1beta1.Cluster{} if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { return err } @@ -52,14 +52,14 @@ func (src *Cluster) ConvertTo(dstRaw conversion.Hub) error { } func (dst *Cluster) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.Cluster) + src := srcRaw.(*v1beta1.Cluster) - if err := Convert_v1alpha4_Cluster_To_v1alpha3_Cluster(src, dst, nil); err != nil { + if err := Convert_v1beta1_Cluster_To_v1alpha3_Cluster(src, dst, nil); err != nil { return err } - // Set the v1alpha3 boolean status field if the v1alpha4 condition was true - if conditions.IsTrue(src, v1alpha4.ControlPlaneInitializedCondition) { + // Set the v1alpha3 boolean status field if the v1beta1 condition was true + if conditions.IsTrue(src, v1beta1.ControlPlaneInitializedCondition) { dst.Status.ControlPlaneInitialized = true } @@ -72,26 +72,26 @@ func (dst *Cluster) ConvertFrom(srcRaw conversion.Hub) error { } func (src *ClusterList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.ClusterList) + dst := dstRaw.(*v1beta1.ClusterList) - return Convert_v1alpha3_ClusterList_To_v1alpha4_ClusterList(src, dst, nil) + return Convert_v1alpha3_ClusterList_To_v1beta1_ClusterList(src, dst, nil) } func (dst *ClusterList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.ClusterList) + src := srcRaw.(*v1beta1.ClusterList) - return Convert_v1alpha4_ClusterList_To_v1alpha3_ClusterList(src, dst, nil) + return Convert_v1beta1_ClusterList_To_v1alpha3_ClusterList(src, dst, nil) } func (src *Machine) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.Machine) + dst := dstRaw.(*v1beta1.Machine) - if err := Convert_v1alpha3_Machine_To_v1alpha4_Machine(src, dst, nil); err != nil { + if err := Convert_v1alpha3_Machine_To_v1beta1_Machine(src, dst, nil); err != nil { return err } // Manually restore data. - restored := &v1alpha4.Machine{} + restored := &v1beta1.Machine{} if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { return err } @@ -101,9 +101,9 @@ func (src *Machine) ConvertTo(dstRaw conversion.Hub) error { } func (dst *Machine) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.Machine) + src := srcRaw.(*v1beta1.Machine) - if err := Convert_v1alpha4_Machine_To_v1alpha3_Machine(src, dst, nil); err != nil { + if err := Convert_v1beta1_Machine_To_v1alpha3_Machine(src, dst, nil); err != nil { return err } @@ -116,60 +116,60 @@ func (dst *Machine) ConvertFrom(srcRaw conversion.Hub) error { } func (src *MachineList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.MachineList) + dst := dstRaw.(*v1beta1.MachineList) - return Convert_v1alpha3_MachineList_To_v1alpha4_MachineList(src, dst, nil) + return Convert_v1alpha3_MachineList_To_v1beta1_MachineList(src, dst, nil) } func (dst *MachineList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.MachineList) + src := srcRaw.(*v1beta1.MachineList) - return Convert_v1alpha4_MachineList_To_v1alpha3_MachineList(src, dst, nil) + return Convert_v1beta1_MachineList_To_v1alpha3_MachineList(src, dst, nil) } func (src *MachineSet) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.MachineSet) + dst := dstRaw.(*v1beta1.MachineSet) - return Convert_v1alpha3_MachineSet_To_v1alpha4_MachineSet(src, dst, nil) + return Convert_v1alpha3_MachineSet_To_v1beta1_MachineSet(src, dst, nil) } func (dst *MachineSet) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.MachineSet) + src := srcRaw.(*v1beta1.MachineSet) - return Convert_v1alpha4_MachineSet_To_v1alpha3_MachineSet(src, dst, nil) + return Convert_v1beta1_MachineSet_To_v1alpha3_MachineSet(src, dst, nil) } func (src *MachineSetList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.MachineSetList) + dst := dstRaw.(*v1beta1.MachineSetList) - return Convert_v1alpha3_MachineSetList_To_v1alpha4_MachineSetList(src, dst, nil) + return Convert_v1alpha3_MachineSetList_To_v1beta1_MachineSetList(src, dst, nil) } func (dst *MachineSetList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.MachineSetList) + src := srcRaw.(*v1beta1.MachineSetList) - return Convert_v1alpha4_MachineSetList_To_v1alpha3_MachineSetList(src, dst, nil) + return Convert_v1beta1_MachineSetList_To_v1alpha3_MachineSetList(src, dst, nil) } func (src *MachineDeployment) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.MachineDeployment) + dst := dstRaw.(*v1beta1.MachineDeployment) - if err := Convert_v1alpha3_MachineDeployment_To_v1alpha4_MachineDeployment(src, dst, nil); err != nil { + if err := Convert_v1alpha3_MachineDeployment_To_v1beta1_MachineDeployment(src, dst, nil); err != nil { return err } // Manually restore data. - restored := &v1alpha4.MachineDeployment{} + restored := &v1beta1.MachineDeployment{} if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { return err } if restored.Spec.Strategy != nil && restored.Spec.Strategy.RollingUpdate != nil { if dst.Spec.Strategy == nil { - dst.Spec.Strategy = &v1alpha4.MachineDeploymentStrategy{} + dst.Spec.Strategy = &v1beta1.MachineDeploymentStrategy{} } if dst.Spec.Strategy.RollingUpdate == nil { - dst.Spec.Strategy.RollingUpdate = &v1alpha4.MachineRollingUpdateDeployment{} + dst.Spec.Strategy.RollingUpdate = &v1beta1.MachineRollingUpdateDeployment{} } dst.Spec.Strategy.RollingUpdate.DeletePolicy = restored.Spec.Strategy.RollingUpdate.DeletePolicy } @@ -179,9 +179,9 @@ func (src *MachineDeployment) ConvertTo(dstRaw conversion.Hub) error { } func (dst *MachineDeployment) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.MachineDeployment) + src := srcRaw.(*v1beta1.MachineDeployment) - if err := Convert_v1alpha4_MachineDeployment_To_v1alpha3_MachineDeployment(src, dst, nil); err != nil { + if err := Convert_v1beta1_MachineDeployment_To_v1alpha3_MachineDeployment(src, dst, nil); err != nil { return err } @@ -193,32 +193,32 @@ func (dst *MachineDeployment) ConvertFrom(srcRaw conversion.Hub) error { return nil } -// Status.Conditions was introduced in v1alpha4, thus requiring a custom conversion function; the values is going to be preserved in an annotation thus allowing roundtrip without loosing informations -func Convert_v1alpha4_MachineDeploymentStatus_To_v1alpha3_MachineDeploymentStatus(in *v1alpha4.MachineDeploymentStatus, out *MachineDeploymentStatus, s apiconversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentStatus_To_v1alpha3_MachineDeploymentStatus(in, out, s) +// Status.Conditions was introduced in v1beta1, thus requiring a custom conversion function; the values is going to be preserved in an annotation thus allowing roundtrip without loosing informations +func Convert_v1beta1_MachineDeploymentStatus_To_v1alpha3_MachineDeploymentStatus(in *v1beta1.MachineDeploymentStatus, out *MachineDeploymentStatus, s apiconversion.Scope) error { + return autoConvert_v1beta1_MachineDeploymentStatus_To_v1alpha3_MachineDeploymentStatus(in, out, s) } func (src *MachineDeploymentList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.MachineDeploymentList) + dst := dstRaw.(*v1beta1.MachineDeploymentList) - return Convert_v1alpha3_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(src, dst, nil) + return Convert_v1alpha3_MachineDeploymentList_To_v1beta1_MachineDeploymentList(src, dst, nil) } func (dst *MachineDeploymentList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.MachineDeploymentList) + src := srcRaw.(*v1beta1.MachineDeploymentList) - return Convert_v1alpha4_MachineDeploymentList_To_v1alpha3_MachineDeploymentList(src, dst, nil) + return Convert_v1beta1_MachineDeploymentList_To_v1alpha3_MachineDeploymentList(src, dst, nil) } func (src *MachineHealthCheck) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.MachineHealthCheck) + dst := dstRaw.(*v1beta1.MachineHealthCheck) - if err := Convert_v1alpha3_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(src, dst, nil); err != nil { + if err := Convert_v1alpha3_MachineHealthCheck_To_v1beta1_MachineHealthCheck(src, dst, nil); err != nil { return err } // Manually restore data. - restored := &v1alpha4.MachineHealthCheck{} + restored := &v1beta1.MachineHealthCheck{} if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { return err } @@ -231,9 +231,9 @@ func (src *MachineHealthCheck) ConvertTo(dstRaw conversion.Hub) error { } func (dst *MachineHealthCheck) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.MachineHealthCheck) + src := srcRaw.(*v1beta1.MachineHealthCheck) - if err := Convert_v1alpha4_MachineHealthCheck_To_v1alpha3_MachineHealthCheck(src, dst, nil); err != nil { + if err := Convert_v1beta1_MachineHealthCheck_To_v1alpha3_MachineHealthCheck(src, dst, nil); err != nil { return err } @@ -246,42 +246,42 @@ func (dst *MachineHealthCheck) ConvertFrom(srcRaw conversion.Hub) error { } func (src *MachineHealthCheckList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.MachineHealthCheckList) + dst := dstRaw.(*v1beta1.MachineHealthCheckList) - return Convert_v1alpha3_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(src, dst, nil) + return Convert_v1alpha3_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(src, dst, nil) } func (dst *MachineHealthCheckList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.MachineHealthCheckList) + src := srcRaw.(*v1beta1.MachineHealthCheckList) - return Convert_v1alpha4_MachineHealthCheckList_To_v1alpha3_MachineHealthCheckList(src, dst, nil) + return Convert_v1beta1_MachineHealthCheckList_To_v1alpha3_MachineHealthCheckList(src, dst, nil) } -func Convert_v1alpha4_ClusterSpec_To_v1alpha3_ClusterSpec(in *v1alpha4.ClusterSpec, out *ClusterSpec, s apiconversion.Scope) error { +func Convert_v1beta1_ClusterSpec_To_v1alpha3_ClusterSpec(in *v1beta1.ClusterSpec, out *ClusterSpec, s apiconversion.Scope) error { // NOTE: custom conversion func is required because spec.Topology does not exists in v1alpha3 - return autoConvert_v1alpha4_ClusterSpec_To_v1alpha3_ClusterSpec(in, out, s) + return autoConvert_v1beta1_ClusterSpec_To_v1alpha3_ClusterSpec(in, out, s) } -func Convert_v1alpha3_Bootstrap_To_v1alpha4_Bootstrap(in *Bootstrap, out *v1alpha4.Bootstrap, s apiconversion.Scope) error { - return autoConvert_v1alpha3_Bootstrap_To_v1alpha4_Bootstrap(in, out, s) +func Convert_v1alpha3_Bootstrap_To_v1beta1_Bootstrap(in *Bootstrap, out *v1beta1.Bootstrap, s apiconversion.Scope) error { + return autoConvert_v1alpha3_Bootstrap_To_v1beta1_Bootstrap(in, out, s) } -func Convert_v1alpha4_MachineRollingUpdateDeployment_To_v1alpha3_MachineRollingUpdateDeployment(in *v1alpha4.MachineRollingUpdateDeployment, out *MachineRollingUpdateDeployment, s apiconversion.Scope) error { - return autoConvert_v1alpha4_MachineRollingUpdateDeployment_To_v1alpha3_MachineRollingUpdateDeployment(in, out, s) +func Convert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha3_MachineRollingUpdateDeployment(in *v1beta1.MachineRollingUpdateDeployment, out *MachineRollingUpdateDeployment, s apiconversion.Scope) error { + return autoConvert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha3_MachineRollingUpdateDeployment(in, out, s) } -func Convert_v1alpha4_MachineHealthCheckSpec_To_v1alpha3_MachineHealthCheckSpec(in *v1alpha4.MachineHealthCheckSpec, out *MachineHealthCheckSpec, s apiconversion.Scope) error { - return autoConvert_v1alpha4_MachineHealthCheckSpec_To_v1alpha3_MachineHealthCheckSpec(in, out, s) +func Convert_v1beta1_MachineHealthCheckSpec_To_v1alpha3_MachineHealthCheckSpec(in *v1beta1.MachineHealthCheckSpec, out *MachineHealthCheckSpec, s apiconversion.Scope) error { + return autoConvert_v1beta1_MachineHealthCheckSpec_To_v1alpha3_MachineHealthCheckSpec(in, out, s) } -func Convert_v1alpha3_ClusterStatus_To_v1alpha4_ClusterStatus(in *ClusterStatus, out *v1alpha4.ClusterStatus, s apiconversion.Scope) error { - return autoConvert_v1alpha3_ClusterStatus_To_v1alpha4_ClusterStatus(in, out, s) +func Convert_v1alpha3_ClusterStatus_To_v1beta1_ClusterStatus(in *ClusterStatus, out *v1beta1.ClusterStatus, s apiconversion.Scope) error { + return autoConvert_v1alpha3_ClusterStatus_To_v1beta1_ClusterStatus(in, out, s) } -func Convert_v1alpha3_ObjectMeta_To_v1alpha4_ObjectMeta(in *ObjectMeta, out *v1alpha4.ObjectMeta, s apiconversion.Scope) error { - return autoConvert_v1alpha3_ObjectMeta_To_v1alpha4_ObjectMeta(in, out, s) +func Convert_v1alpha3_ObjectMeta_To_v1beta1_ObjectMeta(in *ObjectMeta, out *v1beta1.ObjectMeta, s apiconversion.Scope) error { + return autoConvert_v1alpha3_ObjectMeta_To_v1beta1_ObjectMeta(in, out, s) } -func Convert_v1alpha4_MachineStatus_To_v1alpha3_MachineStatus(in *v1alpha4.MachineStatus, out *MachineStatus, s apiconversion.Scope) error { - return autoConvert_v1alpha4_MachineStatus_To_v1alpha3_MachineStatus(in, out, s) +func Convert_v1beta1_MachineStatus_To_v1alpha3_MachineStatus(in *v1beta1.MachineStatus, out *MachineStatus, s apiconversion.Scope) error { + return autoConvert_v1beta1_MachineStatus_To_v1alpha3_MachineStatus(in, out, s) } diff --git a/api/v1alpha3/conversion_test.go b/api/v1alpha3/conversion_test.go index 4c2c07951479..7c3adb0e783c 100644 --- a/api/v1alpha3/conversion_test.go +++ b/api/v1alpha3/conversion_test.go @@ -22,38 +22,38 @@ import ( fuzz "github.com/google/gofuzz" "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" - "sigs.k8s.io/cluster-api/api/v1alpha4" + "sigs.k8s.io/cluster-api/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/controller-runtime/pkg/conversion" ) func TestFuzzyConversion(t *testing.T) { t.Run("for Cluster", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &v1alpha4.Cluster{}, + Hub: &v1beta1.Cluster{}, Spoke: &Cluster{}, SpokeAfterMutation: clusterSpokeAfterMutation, })) t.Run("for Machine", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &v1alpha4.Machine{}, + Hub: &v1beta1.Machine{}, Spoke: &Machine{}, FuzzerFuncs: []fuzzer.FuzzerFuncs{BootstrapFuzzFuncs}, })) t.Run("for MachineSet", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &v1alpha4.MachineSet{}, + Hub: &v1beta1.MachineSet{}, Spoke: &MachineSet{}, FuzzerFuncs: []fuzzer.FuzzerFuncs{BootstrapFuzzFuncs, CustomObjectMetaFuzzFunc}, })) t.Run("for MachineDeployment", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &v1alpha4.MachineDeployment{}, + Hub: &v1beta1.MachineDeployment{}, Spoke: &MachineDeployment{}, FuzzerFuncs: []fuzzer.FuzzerFuncs{BootstrapFuzzFuncs, CustomObjectMetaFuzzFunc}, })) t.Run("for MachineHealthCheckSpec", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &v1alpha4.MachineHealthCheck{}, + Hub: &v1beta1.MachineHealthCheck{}, Spoke: &MachineHealthCheck{}, })) } @@ -67,7 +67,7 @@ func CustomObjectMetaFuzzFunc(_ runtimeserializer.CodecFactory) []interface{} { func CustomObjectMetaFuzzer(in *ObjectMeta, c fuzz.Continue) { c.FuzzNoCustom(in) - // These fields have been removed in v1alpha4 + // These fields have been removed in v1beta1 // data is going to be lost, so we're forcing zero values here. in.Name = "" in.GenerateName = "" @@ -84,7 +84,7 @@ func BootstrapFuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} { func BootstrapFuzzer(obj *Bootstrap, c fuzz.Continue) { c.FuzzNoCustom(obj) - // Bootstrap.Data has been removed in v1alpha4, so setting it to nil in order to avoid v1alpha3 --> v1alpha4 --> v1alpha3 round trip errors. + // Bootstrap.Data has been removed in v1beta1, so setting it to nil in order to avoid v1alpha3 --> v1beta1 --> v1alpha3 round trip errors. obj.Data = nil } @@ -101,7 +101,7 @@ func clusterSpokeAfterMutation(c conversion.Convertible) { condition := cluster.Status.Conditions[i] // Keep everything that is not ControlPlaneInitializedCondition - if condition.Type != ConditionType(v1alpha4.ControlPlaneInitializedCondition) { + if condition.Type != ConditionType(v1beta1.ControlPlaneInitializedCondition) { tmp = append(tmp, condition) } } diff --git a/api/v1alpha3/doc.go b/api/v1alpha3/doc.go index ccbb4ca7e57d..2682381adf91 100644 --- a/api/v1alpha3/doc.go +++ b/api/v1alpha3/doc.go @@ -15,5 +15,5 @@ limitations under the License. */ // Package v1alpha3 contains the v1alpha3 API implementation. -// +k8s:conversion-gen=sigs.k8s.io/cluster-api/api/v1alpha4 +// +k8s:conversion-gen=sigs.k8s.io/cluster-api/api/v1beta1 package v1alpha3 diff --git a/api/v1alpha3/zz_generated.conversion.go b/api/v1alpha3/zz_generated.conversion.go index 7087056a0e2b..e3a9bd22dfe0 100644 --- a/api/v1alpha3/zz_generated.conversion.go +++ b/api/v1alpha3/zz_generated.conversion.go @@ -28,7 +28,7 @@ import ( conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" intstr "k8s.io/apimachinery/pkg/util/intstr" - v1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + v1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" errors "sigs.k8s.io/cluster-api/errors" ) @@ -39,408 +39,408 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*APIEndpoint)(nil), (*v1alpha4.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(a.(*APIEndpoint), b.(*v1alpha4.APIEndpoint), scope) + if err := s.AddGeneratedConversionFunc((*APIEndpoint)(nil), (*v1beta1.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(a.(*APIEndpoint), b.(*v1beta1.APIEndpoint), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.APIEndpoint)(nil), (*APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(a.(*v1alpha4.APIEndpoint), b.(*APIEndpoint), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.APIEndpoint)(nil), (*APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(a.(*v1beta1.APIEndpoint), b.(*APIEndpoint), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.Bootstrap)(nil), (*Bootstrap)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Bootstrap_To_v1alpha3_Bootstrap(a.(*v1alpha4.Bootstrap), b.(*Bootstrap), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.Bootstrap)(nil), (*Bootstrap)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Bootstrap_To_v1alpha3_Bootstrap(a.(*v1beta1.Bootstrap), b.(*Bootstrap), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Cluster)(nil), (*v1alpha4.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Cluster_To_v1alpha4_Cluster(a.(*Cluster), b.(*v1alpha4.Cluster), scope) + if err := s.AddGeneratedConversionFunc((*Cluster)(nil), (*v1beta1.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Cluster_To_v1beta1_Cluster(a.(*Cluster), b.(*v1beta1.Cluster), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.Cluster)(nil), (*Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Cluster_To_v1alpha3_Cluster(a.(*v1alpha4.Cluster), b.(*Cluster), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.Cluster)(nil), (*Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Cluster_To_v1alpha3_Cluster(a.(*v1beta1.Cluster), b.(*Cluster), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ClusterList)(nil), (*v1alpha4.ClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ClusterList_To_v1alpha4_ClusterList(a.(*ClusterList), b.(*v1alpha4.ClusterList), scope) + if err := s.AddGeneratedConversionFunc((*ClusterList)(nil), (*v1beta1.ClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClusterList_To_v1beta1_ClusterList(a.(*ClusterList), b.(*v1beta1.ClusterList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ClusterList)(nil), (*ClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterList_To_v1alpha3_ClusterList(a.(*v1alpha4.ClusterList), b.(*ClusterList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterList)(nil), (*ClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterList_To_v1alpha3_ClusterList(a.(*v1beta1.ClusterList), b.(*ClusterList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ClusterNetwork)(nil), (*v1alpha4.ClusterNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ClusterNetwork_To_v1alpha4_ClusterNetwork(a.(*ClusterNetwork), b.(*v1alpha4.ClusterNetwork), scope) + if err := s.AddGeneratedConversionFunc((*ClusterNetwork)(nil), (*v1beta1.ClusterNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClusterNetwork_To_v1beta1_ClusterNetwork(a.(*ClusterNetwork), b.(*v1beta1.ClusterNetwork), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ClusterNetwork)(nil), (*ClusterNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterNetwork_To_v1alpha3_ClusterNetwork(a.(*v1alpha4.ClusterNetwork), b.(*ClusterNetwork), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterNetwork)(nil), (*ClusterNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterNetwork_To_v1alpha3_ClusterNetwork(a.(*v1beta1.ClusterNetwork), b.(*ClusterNetwork), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ClusterSpec)(nil), (*v1alpha4.ClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ClusterSpec_To_v1alpha4_ClusterSpec(a.(*ClusterSpec), b.(*v1alpha4.ClusterSpec), scope) + if err := s.AddGeneratedConversionFunc((*ClusterSpec)(nil), (*v1beta1.ClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClusterSpec_To_v1beta1_ClusterSpec(a.(*ClusterSpec), b.(*v1beta1.ClusterSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ClusterStatus)(nil), (*ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterStatus_To_v1alpha3_ClusterStatus(a.(*v1alpha4.ClusterStatus), b.(*ClusterStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterStatus)(nil), (*ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterStatus_To_v1alpha3_ClusterStatus(a.(*v1beta1.ClusterStatus), b.(*ClusterStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Condition)(nil), (*v1alpha4.Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Condition_To_v1alpha4_Condition(a.(*Condition), b.(*v1alpha4.Condition), scope) + if err := s.AddGeneratedConversionFunc((*Condition)(nil), (*v1beta1.Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Condition_To_v1beta1_Condition(a.(*Condition), b.(*v1beta1.Condition), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.Condition)(nil), (*Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Condition_To_v1alpha3_Condition(a.(*v1alpha4.Condition), b.(*Condition), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.Condition)(nil), (*Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Condition_To_v1alpha3_Condition(a.(*v1beta1.Condition), b.(*Condition), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*FailureDomainSpec)(nil), (*v1alpha4.FailureDomainSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(a.(*FailureDomainSpec), b.(*v1alpha4.FailureDomainSpec), scope) + if err := s.AddGeneratedConversionFunc((*FailureDomainSpec)(nil), (*v1beta1.FailureDomainSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_FailureDomainSpec_To_v1beta1_FailureDomainSpec(a.(*FailureDomainSpec), b.(*v1beta1.FailureDomainSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.FailureDomainSpec)(nil), (*FailureDomainSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_FailureDomainSpec_To_v1alpha3_FailureDomainSpec(a.(*v1alpha4.FailureDomainSpec), b.(*FailureDomainSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.FailureDomainSpec)(nil), (*FailureDomainSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_FailureDomainSpec_To_v1alpha3_FailureDomainSpec(a.(*v1beta1.FailureDomainSpec), b.(*FailureDomainSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Machine)(nil), (*v1alpha4.Machine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Machine_To_v1alpha4_Machine(a.(*Machine), b.(*v1alpha4.Machine), scope) + if err := s.AddGeneratedConversionFunc((*Machine)(nil), (*v1beta1.Machine)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Machine_To_v1beta1_Machine(a.(*Machine), b.(*v1beta1.Machine), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.Machine)(nil), (*Machine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Machine_To_v1alpha3_Machine(a.(*v1alpha4.Machine), b.(*Machine), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.Machine)(nil), (*Machine)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Machine_To_v1alpha3_Machine(a.(*v1beta1.Machine), b.(*Machine), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineAddress)(nil), (*v1alpha4.MachineAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineAddress_To_v1alpha4_MachineAddress(a.(*MachineAddress), b.(*v1alpha4.MachineAddress), scope) + if err := s.AddGeneratedConversionFunc((*MachineAddress)(nil), (*v1beta1.MachineAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineAddress_To_v1beta1_MachineAddress(a.(*MachineAddress), b.(*v1beta1.MachineAddress), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachineAddress)(nil), (*MachineAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineAddress_To_v1alpha3_MachineAddress(a.(*v1alpha4.MachineAddress), b.(*MachineAddress), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineAddress)(nil), (*MachineAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineAddress_To_v1alpha3_MachineAddress(a.(*v1beta1.MachineAddress), b.(*MachineAddress), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineDeployment)(nil), (*v1alpha4.MachineDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineDeployment_To_v1alpha4_MachineDeployment(a.(*MachineDeployment), b.(*v1alpha4.MachineDeployment), scope) + if err := s.AddGeneratedConversionFunc((*MachineDeployment)(nil), (*v1beta1.MachineDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineDeployment_To_v1beta1_MachineDeployment(a.(*MachineDeployment), b.(*v1beta1.MachineDeployment), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachineDeployment)(nil), (*MachineDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeployment_To_v1alpha3_MachineDeployment(a.(*v1alpha4.MachineDeployment), b.(*MachineDeployment), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeployment)(nil), (*MachineDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeployment_To_v1alpha3_MachineDeployment(a.(*v1beta1.MachineDeployment), b.(*MachineDeployment), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentList)(nil), (*v1alpha4.MachineDeploymentList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(a.(*MachineDeploymentList), b.(*v1alpha4.MachineDeploymentList), scope) + if err := s.AddGeneratedConversionFunc((*MachineDeploymentList)(nil), (*v1beta1.MachineDeploymentList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineDeploymentList_To_v1beta1_MachineDeploymentList(a.(*MachineDeploymentList), b.(*v1beta1.MachineDeploymentList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachineDeploymentList)(nil), (*MachineDeploymentList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentList_To_v1alpha3_MachineDeploymentList(a.(*v1alpha4.MachineDeploymentList), b.(*MachineDeploymentList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentList)(nil), (*MachineDeploymentList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeploymentList_To_v1alpha3_MachineDeploymentList(a.(*v1beta1.MachineDeploymentList), b.(*MachineDeploymentList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentSpec)(nil), (*v1alpha4.MachineDeploymentSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(a.(*MachineDeploymentSpec), b.(*v1alpha4.MachineDeploymentSpec), scope) + if err := s.AddGeneratedConversionFunc((*MachineDeploymentSpec)(nil), (*v1beta1.MachineDeploymentSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(a.(*MachineDeploymentSpec), b.(*v1beta1.MachineDeploymentSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachineDeploymentSpec)(nil), (*MachineDeploymentSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentSpec_To_v1alpha3_MachineDeploymentSpec(a.(*v1alpha4.MachineDeploymentSpec), b.(*MachineDeploymentSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentSpec)(nil), (*MachineDeploymentSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeploymentSpec_To_v1alpha3_MachineDeploymentSpec(a.(*v1beta1.MachineDeploymentSpec), b.(*MachineDeploymentSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentStatus)(nil), (*v1alpha4.MachineDeploymentStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(a.(*MachineDeploymentStatus), b.(*v1alpha4.MachineDeploymentStatus), scope) + if err := s.AddGeneratedConversionFunc((*MachineDeploymentStatus)(nil), (*v1beta1.MachineDeploymentStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(a.(*MachineDeploymentStatus), b.(*v1beta1.MachineDeploymentStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentStrategy)(nil), (*v1alpha4.MachineDeploymentStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy(a.(*MachineDeploymentStrategy), b.(*v1alpha4.MachineDeploymentStrategy), scope) + if err := s.AddGeneratedConversionFunc((*MachineDeploymentStrategy)(nil), (*v1beta1.MachineDeploymentStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy(a.(*MachineDeploymentStrategy), b.(*v1beta1.MachineDeploymentStrategy), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachineDeploymentStrategy)(nil), (*MachineDeploymentStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentStrategy_To_v1alpha3_MachineDeploymentStrategy(a.(*v1alpha4.MachineDeploymentStrategy), b.(*MachineDeploymentStrategy), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentStrategy)(nil), (*MachineDeploymentStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeploymentStrategy_To_v1alpha3_MachineDeploymentStrategy(a.(*v1beta1.MachineDeploymentStrategy), b.(*MachineDeploymentStrategy), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineHealthCheck)(nil), (*v1alpha4.MachineHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(a.(*MachineHealthCheck), b.(*v1alpha4.MachineHealthCheck), scope) + if err := s.AddGeneratedConversionFunc((*MachineHealthCheck)(nil), (*v1beta1.MachineHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineHealthCheck_To_v1beta1_MachineHealthCheck(a.(*MachineHealthCheck), b.(*v1beta1.MachineHealthCheck), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachineHealthCheck)(nil), (*MachineHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineHealthCheck_To_v1alpha3_MachineHealthCheck(a.(*v1alpha4.MachineHealthCheck), b.(*MachineHealthCheck), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineHealthCheck)(nil), (*MachineHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineHealthCheck_To_v1alpha3_MachineHealthCheck(a.(*v1beta1.MachineHealthCheck), b.(*MachineHealthCheck), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineHealthCheckList)(nil), (*v1alpha4.MachineHealthCheckList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(a.(*MachineHealthCheckList), b.(*v1alpha4.MachineHealthCheckList), scope) + if err := s.AddGeneratedConversionFunc((*MachineHealthCheckList)(nil), (*v1beta1.MachineHealthCheckList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(a.(*MachineHealthCheckList), b.(*v1beta1.MachineHealthCheckList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachineHealthCheckList)(nil), (*MachineHealthCheckList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineHealthCheckList_To_v1alpha3_MachineHealthCheckList(a.(*v1alpha4.MachineHealthCheckList), b.(*MachineHealthCheckList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineHealthCheckList)(nil), (*MachineHealthCheckList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineHealthCheckList_To_v1alpha3_MachineHealthCheckList(a.(*v1beta1.MachineHealthCheckList), b.(*MachineHealthCheckList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineHealthCheckSpec)(nil), (*v1alpha4.MachineHealthCheckSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(a.(*MachineHealthCheckSpec), b.(*v1alpha4.MachineHealthCheckSpec), scope) + if err := s.AddGeneratedConversionFunc((*MachineHealthCheckSpec)(nil), (*v1beta1.MachineHealthCheckSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(a.(*MachineHealthCheckSpec), b.(*v1beta1.MachineHealthCheckSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineHealthCheckStatus)(nil), (*v1alpha4.MachineHealthCheckStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(a.(*MachineHealthCheckStatus), b.(*v1alpha4.MachineHealthCheckStatus), scope) + if err := s.AddGeneratedConversionFunc((*MachineHealthCheckStatus)(nil), (*v1beta1.MachineHealthCheckStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(a.(*MachineHealthCheckStatus), b.(*v1beta1.MachineHealthCheckStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachineHealthCheckStatus)(nil), (*MachineHealthCheckStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineHealthCheckStatus_To_v1alpha3_MachineHealthCheckStatus(a.(*v1alpha4.MachineHealthCheckStatus), b.(*MachineHealthCheckStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineHealthCheckStatus)(nil), (*MachineHealthCheckStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineHealthCheckStatus_To_v1alpha3_MachineHealthCheckStatus(a.(*v1beta1.MachineHealthCheckStatus), b.(*MachineHealthCheckStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineList)(nil), (*v1alpha4.MachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineList_To_v1alpha4_MachineList(a.(*MachineList), b.(*v1alpha4.MachineList), scope) + if err := s.AddGeneratedConversionFunc((*MachineList)(nil), (*v1beta1.MachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineList_To_v1beta1_MachineList(a.(*MachineList), b.(*v1beta1.MachineList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachineList)(nil), (*MachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineList_To_v1alpha3_MachineList(a.(*v1alpha4.MachineList), b.(*MachineList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineList)(nil), (*MachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineList_To_v1alpha3_MachineList(a.(*v1beta1.MachineList), b.(*MachineList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineRollingUpdateDeployment)(nil), (*v1alpha4.MachineRollingUpdateDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(a.(*MachineRollingUpdateDeployment), b.(*v1alpha4.MachineRollingUpdateDeployment), scope) + if err := s.AddGeneratedConversionFunc((*MachineRollingUpdateDeployment)(nil), (*v1beta1.MachineRollingUpdateDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(a.(*MachineRollingUpdateDeployment), b.(*v1beta1.MachineRollingUpdateDeployment), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineSet)(nil), (*v1alpha4.MachineSet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineSet_To_v1alpha4_MachineSet(a.(*MachineSet), b.(*v1alpha4.MachineSet), scope) + if err := s.AddGeneratedConversionFunc((*MachineSet)(nil), (*v1beta1.MachineSet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineSet_To_v1beta1_MachineSet(a.(*MachineSet), b.(*v1beta1.MachineSet), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachineSet)(nil), (*MachineSet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineSet_To_v1alpha3_MachineSet(a.(*v1alpha4.MachineSet), b.(*MachineSet), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSet)(nil), (*MachineSet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineSet_To_v1alpha3_MachineSet(a.(*v1beta1.MachineSet), b.(*MachineSet), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineSetList)(nil), (*v1alpha4.MachineSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineSetList_To_v1alpha4_MachineSetList(a.(*MachineSetList), b.(*v1alpha4.MachineSetList), scope) + if err := s.AddGeneratedConversionFunc((*MachineSetList)(nil), (*v1beta1.MachineSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineSetList_To_v1beta1_MachineSetList(a.(*MachineSetList), b.(*v1beta1.MachineSetList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachineSetList)(nil), (*MachineSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineSetList_To_v1alpha3_MachineSetList(a.(*v1alpha4.MachineSetList), b.(*MachineSetList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSetList)(nil), (*MachineSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineSetList_To_v1alpha3_MachineSetList(a.(*v1beta1.MachineSetList), b.(*MachineSetList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineSetSpec)(nil), (*v1alpha4.MachineSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineSetSpec_To_v1alpha4_MachineSetSpec(a.(*MachineSetSpec), b.(*v1alpha4.MachineSetSpec), scope) + if err := s.AddGeneratedConversionFunc((*MachineSetSpec)(nil), (*v1beta1.MachineSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineSetSpec_To_v1beta1_MachineSetSpec(a.(*MachineSetSpec), b.(*v1beta1.MachineSetSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachineSetSpec)(nil), (*MachineSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineSetSpec_To_v1alpha3_MachineSetSpec(a.(*v1alpha4.MachineSetSpec), b.(*MachineSetSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSetSpec)(nil), (*MachineSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineSetSpec_To_v1alpha3_MachineSetSpec(a.(*v1beta1.MachineSetSpec), b.(*MachineSetSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineSetStatus)(nil), (*v1alpha4.MachineSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineSetStatus_To_v1alpha4_MachineSetStatus(a.(*MachineSetStatus), b.(*v1alpha4.MachineSetStatus), scope) + if err := s.AddGeneratedConversionFunc((*MachineSetStatus)(nil), (*v1beta1.MachineSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineSetStatus_To_v1beta1_MachineSetStatus(a.(*MachineSetStatus), b.(*v1beta1.MachineSetStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachineSetStatus)(nil), (*MachineSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineSetStatus_To_v1alpha3_MachineSetStatus(a.(*v1alpha4.MachineSetStatus), b.(*MachineSetStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSetStatus)(nil), (*MachineSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineSetStatus_To_v1alpha3_MachineSetStatus(a.(*v1beta1.MachineSetStatus), b.(*MachineSetStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineSpec)(nil), (*v1alpha4.MachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineSpec_To_v1alpha4_MachineSpec(a.(*MachineSpec), b.(*v1alpha4.MachineSpec), scope) + if err := s.AddGeneratedConversionFunc((*MachineSpec)(nil), (*v1beta1.MachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineSpec_To_v1beta1_MachineSpec(a.(*MachineSpec), b.(*v1beta1.MachineSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachineSpec)(nil), (*MachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineSpec_To_v1alpha3_MachineSpec(a.(*v1alpha4.MachineSpec), b.(*MachineSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSpec)(nil), (*MachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineSpec_To_v1alpha3_MachineSpec(a.(*v1beta1.MachineSpec), b.(*MachineSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineStatus)(nil), (*v1alpha4.MachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineStatus_To_v1alpha4_MachineStatus(a.(*MachineStatus), b.(*v1alpha4.MachineStatus), scope) + if err := s.AddGeneratedConversionFunc((*MachineStatus)(nil), (*v1beta1.MachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineStatus_To_v1beta1_MachineStatus(a.(*MachineStatus), b.(*v1beta1.MachineStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachineTemplateSpec)(nil), (*v1alpha4.MachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(a.(*MachineTemplateSpec), b.(*v1alpha4.MachineTemplateSpec), scope) + if err := s.AddGeneratedConversionFunc((*MachineTemplateSpec)(nil), (*v1beta1.MachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(a.(*MachineTemplateSpec), b.(*v1beta1.MachineTemplateSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachineTemplateSpec)(nil), (*MachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineTemplateSpec_To_v1alpha3_MachineTemplateSpec(a.(*v1alpha4.MachineTemplateSpec), b.(*MachineTemplateSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineTemplateSpec)(nil), (*MachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineTemplateSpec_To_v1alpha3_MachineTemplateSpec(a.(*v1beta1.MachineTemplateSpec), b.(*MachineTemplateSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*NetworkRanges)(nil), (*v1alpha4.NetworkRanges)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_NetworkRanges_To_v1alpha4_NetworkRanges(a.(*NetworkRanges), b.(*v1alpha4.NetworkRanges), scope) + if err := s.AddGeneratedConversionFunc((*NetworkRanges)(nil), (*v1beta1.NetworkRanges)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_NetworkRanges_To_v1beta1_NetworkRanges(a.(*NetworkRanges), b.(*v1beta1.NetworkRanges), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.NetworkRanges)(nil), (*NetworkRanges)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NetworkRanges_To_v1alpha3_NetworkRanges(a.(*v1alpha4.NetworkRanges), b.(*NetworkRanges), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.NetworkRanges)(nil), (*NetworkRanges)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_NetworkRanges_To_v1alpha3_NetworkRanges(a.(*v1beta1.NetworkRanges), b.(*NetworkRanges), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ObjectMeta)(nil), (*ObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ObjectMeta_To_v1alpha3_ObjectMeta(a.(*v1alpha4.ObjectMeta), b.(*ObjectMeta), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ObjectMeta)(nil), (*ObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ObjectMeta_To_v1alpha3_ObjectMeta(a.(*v1beta1.ObjectMeta), b.(*ObjectMeta), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*UnhealthyCondition)(nil), (*v1alpha4.UnhealthyCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_UnhealthyCondition_To_v1alpha4_UnhealthyCondition(a.(*UnhealthyCondition), b.(*v1alpha4.UnhealthyCondition), scope) + if err := s.AddGeneratedConversionFunc((*UnhealthyCondition)(nil), (*v1beta1.UnhealthyCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_UnhealthyCondition_To_v1beta1_UnhealthyCondition(a.(*UnhealthyCondition), b.(*v1beta1.UnhealthyCondition), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.UnhealthyCondition)(nil), (*UnhealthyCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_UnhealthyCondition_To_v1alpha3_UnhealthyCondition(a.(*v1alpha4.UnhealthyCondition), b.(*UnhealthyCondition), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.UnhealthyCondition)(nil), (*UnhealthyCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_UnhealthyCondition_To_v1alpha3_UnhealthyCondition(a.(*v1beta1.UnhealthyCondition), b.(*UnhealthyCondition), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*Bootstrap)(nil), (*v1alpha4.Bootstrap)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Bootstrap_To_v1alpha4_Bootstrap(a.(*Bootstrap), b.(*v1alpha4.Bootstrap), scope) + if err := s.AddConversionFunc((*Bootstrap)(nil), (*v1beta1.Bootstrap)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Bootstrap_To_v1beta1_Bootstrap(a.(*Bootstrap), b.(*v1beta1.Bootstrap), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*ClusterStatus)(nil), (*v1alpha4.ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ClusterStatus_To_v1alpha4_ClusterStatus(a.(*ClusterStatus), b.(*v1alpha4.ClusterStatus), scope) + if err := s.AddConversionFunc((*ClusterStatus)(nil), (*v1beta1.ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClusterStatus_To_v1beta1_ClusterStatus(a.(*ClusterStatus), b.(*v1beta1.ClusterStatus), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*ObjectMeta)(nil), (*v1alpha4.ObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ObjectMeta_To_v1alpha4_ObjectMeta(a.(*ObjectMeta), b.(*v1alpha4.ObjectMeta), scope) + if err := s.AddConversionFunc((*ObjectMeta)(nil), (*v1beta1.ObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ObjectMeta_To_v1beta1_ObjectMeta(a.(*ObjectMeta), b.(*v1beta1.ObjectMeta), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha4.ClusterSpec)(nil), (*ClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterSpec_To_v1alpha3_ClusterSpec(a.(*v1alpha4.ClusterSpec), b.(*ClusterSpec), scope) + if err := s.AddConversionFunc((*v1beta1.ClusterSpec)(nil), (*ClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterSpec_To_v1alpha3_ClusterSpec(a.(*v1beta1.ClusterSpec), b.(*ClusterSpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha4.MachineDeploymentStatus)(nil), (*MachineDeploymentStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentStatus_To_v1alpha3_MachineDeploymentStatus(a.(*v1alpha4.MachineDeploymentStatus), b.(*MachineDeploymentStatus), scope) + if err := s.AddConversionFunc((*v1beta1.MachineDeploymentStatus)(nil), (*MachineDeploymentStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeploymentStatus_To_v1alpha3_MachineDeploymentStatus(a.(*v1beta1.MachineDeploymentStatus), b.(*MachineDeploymentStatus), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha4.MachineHealthCheckSpec)(nil), (*MachineHealthCheckSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineHealthCheckSpec_To_v1alpha3_MachineHealthCheckSpec(a.(*v1alpha4.MachineHealthCheckSpec), b.(*MachineHealthCheckSpec), scope) + if err := s.AddConversionFunc((*v1beta1.MachineHealthCheckSpec)(nil), (*MachineHealthCheckSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineHealthCheckSpec_To_v1alpha3_MachineHealthCheckSpec(a.(*v1beta1.MachineHealthCheckSpec), b.(*MachineHealthCheckSpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha4.MachineRollingUpdateDeployment)(nil), (*MachineRollingUpdateDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineRollingUpdateDeployment_To_v1alpha3_MachineRollingUpdateDeployment(a.(*v1alpha4.MachineRollingUpdateDeployment), b.(*MachineRollingUpdateDeployment), scope) + if err := s.AddConversionFunc((*v1beta1.MachineRollingUpdateDeployment)(nil), (*MachineRollingUpdateDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha3_MachineRollingUpdateDeployment(a.(*v1beta1.MachineRollingUpdateDeployment), b.(*MachineRollingUpdateDeployment), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha4.MachineStatus)(nil), (*MachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineStatus_To_v1alpha3_MachineStatus(a.(*v1alpha4.MachineStatus), b.(*MachineStatus), scope) + if err := s.AddConversionFunc((*v1beta1.MachineStatus)(nil), (*MachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineStatus_To_v1alpha3_MachineStatus(a.(*v1beta1.MachineStatus), b.(*MachineStatus), scope) }); err != nil { return err } return nil } -func autoConvert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(in *APIEndpoint, out *v1alpha4.APIEndpoint, s conversion.Scope) error { +func autoConvert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(in *APIEndpoint, out *v1beta1.APIEndpoint, s conversion.Scope) error { out.Host = in.Host out.Port = in.Port return nil } -// Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint is an autogenerated conversion function. -func Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(in *APIEndpoint, out *v1alpha4.APIEndpoint, s conversion.Scope) error { - return autoConvert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(in, out, s) +// Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint is an autogenerated conversion function. +func Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(in *APIEndpoint, out *v1beta1.APIEndpoint, s conversion.Scope) error { + return autoConvert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(in, out, s) } -func autoConvert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(in *v1alpha4.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { +func autoConvert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(in *v1beta1.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { out.Host = in.Host out.Port = in.Port return nil } -// Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint is an autogenerated conversion function. -func Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(in *v1alpha4.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { - return autoConvert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(in, out, s) +// Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint is an autogenerated conversion function. +func Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(in *v1beta1.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { + return autoConvert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(in, out, s) } -func autoConvert_v1alpha3_Bootstrap_To_v1alpha4_Bootstrap(in *Bootstrap, out *v1alpha4.Bootstrap, s conversion.Scope) error { +func autoConvert_v1alpha3_Bootstrap_To_v1beta1_Bootstrap(in *Bootstrap, out *v1beta1.Bootstrap, s conversion.Scope) error { out.ConfigRef = (*v1.ObjectReference)(unsafe.Pointer(in.ConfigRef)) // WARNING: in.Data requires manual conversion: does not exist in peer-type out.DataSecretName = (*string)(unsafe.Pointer(in.DataSecretName)) return nil } -func autoConvert_v1alpha4_Bootstrap_To_v1alpha3_Bootstrap(in *v1alpha4.Bootstrap, out *Bootstrap, s conversion.Scope) error { +func autoConvert_v1beta1_Bootstrap_To_v1alpha3_Bootstrap(in *v1beta1.Bootstrap, out *Bootstrap, s conversion.Scope) error { out.ConfigRef = (*v1.ObjectReference)(unsafe.Pointer(in.ConfigRef)) out.DataSecretName = (*string)(unsafe.Pointer(in.DataSecretName)) return nil } -// Convert_v1alpha4_Bootstrap_To_v1alpha3_Bootstrap is an autogenerated conversion function. -func Convert_v1alpha4_Bootstrap_To_v1alpha3_Bootstrap(in *v1alpha4.Bootstrap, out *Bootstrap, s conversion.Scope) error { - return autoConvert_v1alpha4_Bootstrap_To_v1alpha3_Bootstrap(in, out, s) +// Convert_v1beta1_Bootstrap_To_v1alpha3_Bootstrap is an autogenerated conversion function. +func Convert_v1beta1_Bootstrap_To_v1alpha3_Bootstrap(in *v1beta1.Bootstrap, out *Bootstrap, s conversion.Scope) error { + return autoConvert_v1beta1_Bootstrap_To_v1alpha3_Bootstrap(in, out, s) } -func autoConvert_v1alpha3_Cluster_To_v1alpha4_Cluster(in *Cluster, out *v1alpha4.Cluster, s conversion.Scope) error { +func autoConvert_v1alpha3_Cluster_To_v1beta1_Cluster(in *Cluster, out *v1beta1.Cluster, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_ClusterSpec_To_v1alpha4_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_ClusterSpec_To_v1beta1_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha3_ClusterStatus_To_v1alpha4_ClusterStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_ClusterStatus_To_v1beta1_ClusterStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha3_Cluster_To_v1alpha4_Cluster is an autogenerated conversion function. -func Convert_v1alpha3_Cluster_To_v1alpha4_Cluster(in *Cluster, out *v1alpha4.Cluster, s conversion.Scope) error { - return autoConvert_v1alpha3_Cluster_To_v1alpha4_Cluster(in, out, s) +// Convert_v1alpha3_Cluster_To_v1beta1_Cluster is an autogenerated conversion function. +func Convert_v1alpha3_Cluster_To_v1beta1_Cluster(in *Cluster, out *v1beta1.Cluster, s conversion.Scope) error { + return autoConvert_v1alpha3_Cluster_To_v1beta1_Cluster(in, out, s) } -func autoConvert_v1alpha4_Cluster_To_v1alpha3_Cluster(in *v1alpha4.Cluster, out *Cluster, s conversion.Scope) error { +func autoConvert_v1beta1_Cluster_To_v1alpha3_Cluster(in *v1beta1.Cluster, out *Cluster, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_ClusterSpec_To_v1alpha3_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_ClusterSpec_To_v1alpha3_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha4_ClusterStatus_To_v1alpha3_ClusterStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_ClusterStatus_To_v1alpha3_ClusterStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha4_Cluster_To_v1alpha3_Cluster is an autogenerated conversion function. -func Convert_v1alpha4_Cluster_To_v1alpha3_Cluster(in *v1alpha4.Cluster, out *Cluster, s conversion.Scope) error { - return autoConvert_v1alpha4_Cluster_To_v1alpha3_Cluster(in, out, s) +// Convert_v1beta1_Cluster_To_v1alpha3_Cluster is an autogenerated conversion function. +func Convert_v1beta1_Cluster_To_v1alpha3_Cluster(in *v1beta1.Cluster, out *Cluster, s conversion.Scope) error { + return autoConvert_v1beta1_Cluster_To_v1alpha3_Cluster(in, out, s) } -func autoConvert_v1alpha3_ClusterList_To_v1alpha4_ClusterList(in *ClusterList, out *v1alpha4.ClusterList, s conversion.Scope) error { +func autoConvert_v1alpha3_ClusterList_To_v1beta1_ClusterList(in *ClusterList, out *v1beta1.ClusterList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha4.Cluster, len(*in)) + *out = make([]v1beta1.Cluster, len(*in)) for i := range *in { - if err := Convert_v1alpha3_Cluster_To_v1alpha4_Cluster(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_Cluster_To_v1beta1_Cluster(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -450,18 +450,18 @@ func autoConvert_v1alpha3_ClusterList_To_v1alpha4_ClusterList(in *ClusterList, o return nil } -// Convert_v1alpha3_ClusterList_To_v1alpha4_ClusterList is an autogenerated conversion function. -func Convert_v1alpha3_ClusterList_To_v1alpha4_ClusterList(in *ClusterList, out *v1alpha4.ClusterList, s conversion.Scope) error { - return autoConvert_v1alpha3_ClusterList_To_v1alpha4_ClusterList(in, out, s) +// Convert_v1alpha3_ClusterList_To_v1beta1_ClusterList is an autogenerated conversion function. +func Convert_v1alpha3_ClusterList_To_v1beta1_ClusterList(in *ClusterList, out *v1beta1.ClusterList, s conversion.Scope) error { + return autoConvert_v1alpha3_ClusterList_To_v1beta1_ClusterList(in, out, s) } -func autoConvert_v1alpha4_ClusterList_To_v1alpha3_ClusterList(in *v1alpha4.ClusterList, out *ClusterList, s conversion.Scope) error { +func autoConvert_v1beta1_ClusterList_To_v1alpha3_ClusterList(in *v1beta1.ClusterList, out *ClusterList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]Cluster, len(*in)) for i := range *in { - if err := Convert_v1alpha4_Cluster_To_v1alpha3_Cluster(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_Cluster_To_v1alpha3_Cluster(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -471,25 +471,25 @@ func autoConvert_v1alpha4_ClusterList_To_v1alpha3_ClusterList(in *v1alpha4.Clust return nil } -// Convert_v1alpha4_ClusterList_To_v1alpha3_ClusterList is an autogenerated conversion function. -func Convert_v1alpha4_ClusterList_To_v1alpha3_ClusterList(in *v1alpha4.ClusterList, out *ClusterList, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterList_To_v1alpha3_ClusterList(in, out, s) +// Convert_v1beta1_ClusterList_To_v1alpha3_ClusterList is an autogenerated conversion function. +func Convert_v1beta1_ClusterList_To_v1alpha3_ClusterList(in *v1beta1.ClusterList, out *ClusterList, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterList_To_v1alpha3_ClusterList(in, out, s) } -func autoConvert_v1alpha3_ClusterNetwork_To_v1alpha4_ClusterNetwork(in *ClusterNetwork, out *v1alpha4.ClusterNetwork, s conversion.Scope) error { +func autoConvert_v1alpha3_ClusterNetwork_To_v1beta1_ClusterNetwork(in *ClusterNetwork, out *v1beta1.ClusterNetwork, s conversion.Scope) error { out.APIServerPort = (*int32)(unsafe.Pointer(in.APIServerPort)) - out.Services = (*v1alpha4.NetworkRanges)(unsafe.Pointer(in.Services)) - out.Pods = (*v1alpha4.NetworkRanges)(unsafe.Pointer(in.Pods)) + out.Services = (*v1beta1.NetworkRanges)(unsafe.Pointer(in.Services)) + out.Pods = (*v1beta1.NetworkRanges)(unsafe.Pointer(in.Pods)) out.ServiceDomain = in.ServiceDomain return nil } -// Convert_v1alpha3_ClusterNetwork_To_v1alpha4_ClusterNetwork is an autogenerated conversion function. -func Convert_v1alpha3_ClusterNetwork_To_v1alpha4_ClusterNetwork(in *ClusterNetwork, out *v1alpha4.ClusterNetwork, s conversion.Scope) error { - return autoConvert_v1alpha3_ClusterNetwork_To_v1alpha4_ClusterNetwork(in, out, s) +// Convert_v1alpha3_ClusterNetwork_To_v1beta1_ClusterNetwork is an autogenerated conversion function. +func Convert_v1alpha3_ClusterNetwork_To_v1beta1_ClusterNetwork(in *ClusterNetwork, out *v1beta1.ClusterNetwork, s conversion.Scope) error { + return autoConvert_v1alpha3_ClusterNetwork_To_v1beta1_ClusterNetwork(in, out, s) } -func autoConvert_v1alpha4_ClusterNetwork_To_v1alpha3_ClusterNetwork(in *v1alpha4.ClusterNetwork, out *ClusterNetwork, s conversion.Scope) error { +func autoConvert_v1beta1_ClusterNetwork_To_v1alpha3_ClusterNetwork(in *v1beta1.ClusterNetwork, out *ClusterNetwork, s conversion.Scope) error { out.APIServerPort = (*int32)(unsafe.Pointer(in.APIServerPort)) out.Services = (*NetworkRanges)(unsafe.Pointer(in.Services)) out.Pods = (*NetworkRanges)(unsafe.Pointer(in.Pods)) @@ -497,15 +497,15 @@ func autoConvert_v1alpha4_ClusterNetwork_To_v1alpha3_ClusterNetwork(in *v1alpha4 return nil } -// Convert_v1alpha4_ClusterNetwork_To_v1alpha3_ClusterNetwork is an autogenerated conversion function. -func Convert_v1alpha4_ClusterNetwork_To_v1alpha3_ClusterNetwork(in *v1alpha4.ClusterNetwork, out *ClusterNetwork, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterNetwork_To_v1alpha3_ClusterNetwork(in, out, s) +// Convert_v1beta1_ClusterNetwork_To_v1alpha3_ClusterNetwork is an autogenerated conversion function. +func Convert_v1beta1_ClusterNetwork_To_v1alpha3_ClusterNetwork(in *v1beta1.ClusterNetwork, out *ClusterNetwork, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterNetwork_To_v1alpha3_ClusterNetwork(in, out, s) } -func autoConvert_v1alpha3_ClusterSpec_To_v1alpha4_ClusterSpec(in *ClusterSpec, out *v1alpha4.ClusterSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_ClusterSpec_To_v1beta1_ClusterSpec(in *ClusterSpec, out *v1beta1.ClusterSpec, s conversion.Scope) error { out.Paused = in.Paused - out.ClusterNetwork = (*v1alpha4.ClusterNetwork)(unsafe.Pointer(in.ClusterNetwork)) - if err := Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + out.ClusterNetwork = (*v1beta1.ClusterNetwork)(unsafe.Pointer(in.ClusterNetwork)) + if err := Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { return err } out.ControlPlaneRef = (*v1.ObjectReference)(unsafe.Pointer(in.ControlPlaneRef)) @@ -513,15 +513,15 @@ func autoConvert_v1alpha3_ClusterSpec_To_v1alpha4_ClusterSpec(in *ClusterSpec, o return nil } -// Convert_v1alpha3_ClusterSpec_To_v1alpha4_ClusterSpec is an autogenerated conversion function. -func Convert_v1alpha3_ClusterSpec_To_v1alpha4_ClusterSpec(in *ClusterSpec, out *v1alpha4.ClusterSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_ClusterSpec_To_v1alpha4_ClusterSpec(in, out, s) +// Convert_v1alpha3_ClusterSpec_To_v1beta1_ClusterSpec is an autogenerated conversion function. +func Convert_v1alpha3_ClusterSpec_To_v1beta1_ClusterSpec(in *ClusterSpec, out *v1beta1.ClusterSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_ClusterSpec_To_v1beta1_ClusterSpec(in, out, s) } -func autoConvert_v1alpha4_ClusterSpec_To_v1alpha3_ClusterSpec(in *v1alpha4.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { +func autoConvert_v1beta1_ClusterSpec_To_v1alpha3_ClusterSpec(in *v1beta1.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { out.Paused = in.Paused out.ClusterNetwork = (*ClusterNetwork)(unsafe.Pointer(in.ClusterNetwork)) - if err := Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + if err := Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { return err } out.ControlPlaneRef = (*v1.ObjectReference)(unsafe.Pointer(in.ControlPlaneRef)) @@ -530,20 +530,20 @@ func autoConvert_v1alpha4_ClusterSpec_To_v1alpha3_ClusterSpec(in *v1alpha4.Clust return nil } -func autoConvert_v1alpha3_ClusterStatus_To_v1alpha4_ClusterStatus(in *ClusterStatus, out *v1alpha4.ClusterStatus, s conversion.Scope) error { - out.FailureDomains = *(*v1alpha4.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) +func autoConvert_v1alpha3_ClusterStatus_To_v1beta1_ClusterStatus(in *ClusterStatus, out *v1beta1.ClusterStatus, s conversion.Scope) error { + out.FailureDomains = *(*v1beta1.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) out.FailureReason = (*errors.ClusterStatusError)(unsafe.Pointer(in.FailureReason)) out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) out.Phase = in.Phase out.InfrastructureReady = in.InfrastructureReady // WARNING: in.ControlPlaneInitialized requires manual conversion: does not exist in peer-type out.ControlPlaneReady = in.ControlPlaneReady - out.Conditions = *(*v1alpha4.Conditions)(unsafe.Pointer(&in.Conditions)) + out.Conditions = *(*v1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) out.ObservedGeneration = in.ObservedGeneration return nil } -func autoConvert_v1alpha4_ClusterStatus_To_v1alpha3_ClusterStatus(in *v1alpha4.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { +func autoConvert_v1beta1_ClusterStatus_To_v1alpha3_ClusterStatus(in *v1beta1.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { out.FailureDomains = *(*FailureDomains)(unsafe.Pointer(&in.FailureDomains)) out.FailureReason = (*errors.ClusterStatusError)(unsafe.Pointer(in.FailureReason)) out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) @@ -555,27 +555,27 @@ func autoConvert_v1alpha4_ClusterStatus_To_v1alpha3_ClusterStatus(in *v1alpha4.C return nil } -// Convert_v1alpha4_ClusterStatus_To_v1alpha3_ClusterStatus is an autogenerated conversion function. -func Convert_v1alpha4_ClusterStatus_To_v1alpha3_ClusterStatus(in *v1alpha4.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterStatus_To_v1alpha3_ClusterStatus(in, out, s) +// Convert_v1beta1_ClusterStatus_To_v1alpha3_ClusterStatus is an autogenerated conversion function. +func Convert_v1beta1_ClusterStatus_To_v1alpha3_ClusterStatus(in *v1beta1.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterStatus_To_v1alpha3_ClusterStatus(in, out, s) } -func autoConvert_v1alpha3_Condition_To_v1alpha4_Condition(in *Condition, out *v1alpha4.Condition, s conversion.Scope) error { - out.Type = v1alpha4.ConditionType(in.Type) +func autoConvert_v1alpha3_Condition_To_v1beta1_Condition(in *Condition, out *v1beta1.Condition, s conversion.Scope) error { + out.Type = v1beta1.ConditionType(in.Type) out.Status = v1.ConditionStatus(in.Status) - out.Severity = v1alpha4.ConditionSeverity(in.Severity) + out.Severity = v1beta1.ConditionSeverity(in.Severity) out.LastTransitionTime = in.LastTransitionTime out.Reason = in.Reason out.Message = in.Message return nil } -// Convert_v1alpha3_Condition_To_v1alpha4_Condition is an autogenerated conversion function. -func Convert_v1alpha3_Condition_To_v1alpha4_Condition(in *Condition, out *v1alpha4.Condition, s conversion.Scope) error { - return autoConvert_v1alpha3_Condition_To_v1alpha4_Condition(in, out, s) +// Convert_v1alpha3_Condition_To_v1beta1_Condition is an autogenerated conversion function. +func Convert_v1alpha3_Condition_To_v1beta1_Condition(in *Condition, out *v1beta1.Condition, s conversion.Scope) error { + return autoConvert_v1alpha3_Condition_To_v1beta1_Condition(in, out, s) } -func autoConvert_v1alpha4_Condition_To_v1alpha3_Condition(in *v1alpha4.Condition, out *Condition, s conversion.Scope) error { +func autoConvert_v1beta1_Condition_To_v1alpha3_Condition(in *v1beta1.Condition, out *Condition, s conversion.Scope) error { out.Type = ConditionType(in.Type) out.Status = v1.ConditionStatus(in.Status) out.Severity = ConditionSeverity(in.Severity) @@ -585,126 +585,126 @@ func autoConvert_v1alpha4_Condition_To_v1alpha3_Condition(in *v1alpha4.Condition return nil } -// Convert_v1alpha4_Condition_To_v1alpha3_Condition is an autogenerated conversion function. -func Convert_v1alpha4_Condition_To_v1alpha3_Condition(in *v1alpha4.Condition, out *Condition, s conversion.Scope) error { - return autoConvert_v1alpha4_Condition_To_v1alpha3_Condition(in, out, s) +// Convert_v1beta1_Condition_To_v1alpha3_Condition is an autogenerated conversion function. +func Convert_v1beta1_Condition_To_v1alpha3_Condition(in *v1beta1.Condition, out *Condition, s conversion.Scope) error { + return autoConvert_v1beta1_Condition_To_v1alpha3_Condition(in, out, s) } -func autoConvert_v1alpha3_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(in *FailureDomainSpec, out *v1alpha4.FailureDomainSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_FailureDomainSpec_To_v1beta1_FailureDomainSpec(in *FailureDomainSpec, out *v1beta1.FailureDomainSpec, s conversion.Scope) error { out.ControlPlane = in.ControlPlane out.Attributes = *(*map[string]string)(unsafe.Pointer(&in.Attributes)) return nil } -// Convert_v1alpha3_FailureDomainSpec_To_v1alpha4_FailureDomainSpec is an autogenerated conversion function. -func Convert_v1alpha3_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(in *FailureDomainSpec, out *v1alpha4.FailureDomainSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(in, out, s) +// Convert_v1alpha3_FailureDomainSpec_To_v1beta1_FailureDomainSpec is an autogenerated conversion function. +func Convert_v1alpha3_FailureDomainSpec_To_v1beta1_FailureDomainSpec(in *FailureDomainSpec, out *v1beta1.FailureDomainSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_FailureDomainSpec_To_v1beta1_FailureDomainSpec(in, out, s) } -func autoConvert_v1alpha4_FailureDomainSpec_To_v1alpha3_FailureDomainSpec(in *v1alpha4.FailureDomainSpec, out *FailureDomainSpec, s conversion.Scope) error { +func autoConvert_v1beta1_FailureDomainSpec_To_v1alpha3_FailureDomainSpec(in *v1beta1.FailureDomainSpec, out *FailureDomainSpec, s conversion.Scope) error { out.ControlPlane = in.ControlPlane out.Attributes = *(*map[string]string)(unsafe.Pointer(&in.Attributes)) return nil } -// Convert_v1alpha4_FailureDomainSpec_To_v1alpha3_FailureDomainSpec is an autogenerated conversion function. -func Convert_v1alpha4_FailureDomainSpec_To_v1alpha3_FailureDomainSpec(in *v1alpha4.FailureDomainSpec, out *FailureDomainSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_FailureDomainSpec_To_v1alpha3_FailureDomainSpec(in, out, s) +// Convert_v1beta1_FailureDomainSpec_To_v1alpha3_FailureDomainSpec is an autogenerated conversion function. +func Convert_v1beta1_FailureDomainSpec_To_v1alpha3_FailureDomainSpec(in *v1beta1.FailureDomainSpec, out *FailureDomainSpec, s conversion.Scope) error { + return autoConvert_v1beta1_FailureDomainSpec_To_v1alpha3_FailureDomainSpec(in, out, s) } -func autoConvert_v1alpha3_Machine_To_v1alpha4_Machine(in *Machine, out *v1alpha4.Machine, s conversion.Scope) error { +func autoConvert_v1alpha3_Machine_To_v1beta1_Machine(in *Machine, out *v1beta1.Machine, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_MachineSpec_To_v1alpha4_MachineSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_MachineSpec_To_v1beta1_MachineSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha3_MachineStatus_To_v1alpha4_MachineStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_MachineStatus_To_v1beta1_MachineStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha3_Machine_To_v1alpha4_Machine is an autogenerated conversion function. -func Convert_v1alpha3_Machine_To_v1alpha4_Machine(in *Machine, out *v1alpha4.Machine, s conversion.Scope) error { - return autoConvert_v1alpha3_Machine_To_v1alpha4_Machine(in, out, s) +// Convert_v1alpha3_Machine_To_v1beta1_Machine is an autogenerated conversion function. +func Convert_v1alpha3_Machine_To_v1beta1_Machine(in *Machine, out *v1beta1.Machine, s conversion.Scope) error { + return autoConvert_v1alpha3_Machine_To_v1beta1_Machine(in, out, s) } -func autoConvert_v1alpha4_Machine_To_v1alpha3_Machine(in *v1alpha4.Machine, out *Machine, s conversion.Scope) error { +func autoConvert_v1beta1_Machine_To_v1alpha3_Machine(in *v1beta1.Machine, out *Machine, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_MachineSpec_To_v1alpha3_MachineSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_MachineSpec_To_v1alpha3_MachineSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha4_MachineStatus_To_v1alpha3_MachineStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_MachineStatus_To_v1alpha3_MachineStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha4_Machine_To_v1alpha3_Machine is an autogenerated conversion function. -func Convert_v1alpha4_Machine_To_v1alpha3_Machine(in *v1alpha4.Machine, out *Machine, s conversion.Scope) error { - return autoConvert_v1alpha4_Machine_To_v1alpha3_Machine(in, out, s) +// Convert_v1beta1_Machine_To_v1alpha3_Machine is an autogenerated conversion function. +func Convert_v1beta1_Machine_To_v1alpha3_Machine(in *v1beta1.Machine, out *Machine, s conversion.Scope) error { + return autoConvert_v1beta1_Machine_To_v1alpha3_Machine(in, out, s) } -func autoConvert_v1alpha3_MachineAddress_To_v1alpha4_MachineAddress(in *MachineAddress, out *v1alpha4.MachineAddress, s conversion.Scope) error { - out.Type = v1alpha4.MachineAddressType(in.Type) +func autoConvert_v1alpha3_MachineAddress_To_v1beta1_MachineAddress(in *MachineAddress, out *v1beta1.MachineAddress, s conversion.Scope) error { + out.Type = v1beta1.MachineAddressType(in.Type) out.Address = in.Address return nil } -// Convert_v1alpha3_MachineAddress_To_v1alpha4_MachineAddress is an autogenerated conversion function. -func Convert_v1alpha3_MachineAddress_To_v1alpha4_MachineAddress(in *MachineAddress, out *v1alpha4.MachineAddress, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineAddress_To_v1alpha4_MachineAddress(in, out, s) +// Convert_v1alpha3_MachineAddress_To_v1beta1_MachineAddress is an autogenerated conversion function. +func Convert_v1alpha3_MachineAddress_To_v1beta1_MachineAddress(in *MachineAddress, out *v1beta1.MachineAddress, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineAddress_To_v1beta1_MachineAddress(in, out, s) } -func autoConvert_v1alpha4_MachineAddress_To_v1alpha3_MachineAddress(in *v1alpha4.MachineAddress, out *MachineAddress, s conversion.Scope) error { +func autoConvert_v1beta1_MachineAddress_To_v1alpha3_MachineAddress(in *v1beta1.MachineAddress, out *MachineAddress, s conversion.Scope) error { out.Type = MachineAddressType(in.Type) out.Address = in.Address return nil } -// Convert_v1alpha4_MachineAddress_To_v1alpha3_MachineAddress is an autogenerated conversion function. -func Convert_v1alpha4_MachineAddress_To_v1alpha3_MachineAddress(in *v1alpha4.MachineAddress, out *MachineAddress, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineAddress_To_v1alpha3_MachineAddress(in, out, s) +// Convert_v1beta1_MachineAddress_To_v1alpha3_MachineAddress is an autogenerated conversion function. +func Convert_v1beta1_MachineAddress_To_v1alpha3_MachineAddress(in *v1beta1.MachineAddress, out *MachineAddress, s conversion.Scope) error { + return autoConvert_v1beta1_MachineAddress_To_v1alpha3_MachineAddress(in, out, s) } -func autoConvert_v1alpha3_MachineDeployment_To_v1alpha4_MachineDeployment(in *MachineDeployment, out *v1alpha4.MachineDeployment, s conversion.Scope) error { +func autoConvert_v1alpha3_MachineDeployment_To_v1beta1_MachineDeployment(in *MachineDeployment, out *v1beta1.MachineDeployment, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha3_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha3_MachineDeployment_To_v1alpha4_MachineDeployment is an autogenerated conversion function. -func Convert_v1alpha3_MachineDeployment_To_v1alpha4_MachineDeployment(in *MachineDeployment, out *v1alpha4.MachineDeployment, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineDeployment_To_v1alpha4_MachineDeployment(in, out, s) +// Convert_v1alpha3_MachineDeployment_To_v1beta1_MachineDeployment is an autogenerated conversion function. +func Convert_v1alpha3_MachineDeployment_To_v1beta1_MachineDeployment(in *MachineDeployment, out *v1beta1.MachineDeployment, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineDeployment_To_v1beta1_MachineDeployment(in, out, s) } -func autoConvert_v1alpha4_MachineDeployment_To_v1alpha3_MachineDeployment(in *v1alpha4.MachineDeployment, out *MachineDeployment, s conversion.Scope) error { +func autoConvert_v1beta1_MachineDeployment_To_v1alpha3_MachineDeployment(in *v1beta1.MachineDeployment, out *MachineDeployment, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_MachineDeploymentSpec_To_v1alpha3_MachineDeploymentSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_MachineDeploymentSpec_To_v1alpha3_MachineDeploymentSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha4_MachineDeploymentStatus_To_v1alpha3_MachineDeploymentStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_MachineDeploymentStatus_To_v1alpha3_MachineDeploymentStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha4_MachineDeployment_To_v1alpha3_MachineDeployment is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeployment_To_v1alpha3_MachineDeployment(in *v1alpha4.MachineDeployment, out *MachineDeployment, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeployment_To_v1alpha3_MachineDeployment(in, out, s) +// Convert_v1beta1_MachineDeployment_To_v1alpha3_MachineDeployment is an autogenerated conversion function. +func Convert_v1beta1_MachineDeployment_To_v1alpha3_MachineDeployment(in *v1beta1.MachineDeployment, out *MachineDeployment, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDeployment_To_v1alpha3_MachineDeployment(in, out, s) } -func autoConvert_v1alpha3_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(in *MachineDeploymentList, out *v1alpha4.MachineDeploymentList, s conversion.Scope) error { +func autoConvert_v1alpha3_MachineDeploymentList_To_v1beta1_MachineDeploymentList(in *MachineDeploymentList, out *v1beta1.MachineDeploymentList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha4.MachineDeployment, len(*in)) + *out = make([]v1beta1.MachineDeployment, len(*in)) for i := range *in { - if err := Convert_v1alpha3_MachineDeployment_To_v1alpha4_MachineDeployment(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_MachineDeployment_To_v1beta1_MachineDeployment(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -714,18 +714,18 @@ func autoConvert_v1alpha3_MachineDeploymentList_To_v1alpha4_MachineDeploymentLis return nil } -// Convert_v1alpha3_MachineDeploymentList_To_v1alpha4_MachineDeploymentList is an autogenerated conversion function. -func Convert_v1alpha3_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(in *MachineDeploymentList, out *v1alpha4.MachineDeploymentList, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(in, out, s) +// Convert_v1alpha3_MachineDeploymentList_To_v1beta1_MachineDeploymentList is an autogenerated conversion function. +func Convert_v1alpha3_MachineDeploymentList_To_v1beta1_MachineDeploymentList(in *MachineDeploymentList, out *v1beta1.MachineDeploymentList, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineDeploymentList_To_v1beta1_MachineDeploymentList(in, out, s) } -func autoConvert_v1alpha4_MachineDeploymentList_To_v1alpha3_MachineDeploymentList(in *v1alpha4.MachineDeploymentList, out *MachineDeploymentList, s conversion.Scope) error { +func autoConvert_v1beta1_MachineDeploymentList_To_v1alpha3_MachineDeploymentList(in *v1beta1.MachineDeploymentList, out *MachineDeploymentList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]MachineDeployment, len(*in)) for i := range *in { - if err := Convert_v1alpha4_MachineDeployment_To_v1alpha3_MachineDeployment(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_MachineDeployment_To_v1alpha3_MachineDeployment(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -735,22 +735,22 @@ func autoConvert_v1alpha4_MachineDeploymentList_To_v1alpha3_MachineDeploymentLis return nil } -// Convert_v1alpha4_MachineDeploymentList_To_v1alpha3_MachineDeploymentList is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeploymentList_To_v1alpha3_MachineDeploymentList(in *v1alpha4.MachineDeploymentList, out *MachineDeploymentList, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentList_To_v1alpha3_MachineDeploymentList(in, out, s) +// Convert_v1beta1_MachineDeploymentList_To_v1alpha3_MachineDeploymentList is an autogenerated conversion function. +func Convert_v1beta1_MachineDeploymentList_To_v1alpha3_MachineDeploymentList(in *v1beta1.MachineDeploymentList, out *MachineDeploymentList, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDeploymentList_To_v1alpha3_MachineDeploymentList(in, out, s) } -func autoConvert_v1alpha3_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(in *MachineDeploymentSpec, out *v1alpha4.MachineDeploymentSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(in *MachineDeploymentSpec, out *v1beta1.MachineDeploymentSpec, s conversion.Scope) error { out.ClusterName = in.ClusterName out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) out.Selector = in.Selector - if err := Convert_v1alpha3_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { + if err := Convert_v1alpha3_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } if in.Strategy != nil { in, out := &in.Strategy, &out.Strategy - *out = new(v1alpha4.MachineDeploymentStrategy) - if err := Convert_v1alpha3_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy(*in, *out, s); err != nil { + *out = new(v1beta1.MachineDeploymentStrategy) + if err := Convert_v1alpha3_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy(*in, *out, s); err != nil { return err } } else { @@ -763,22 +763,22 @@ func autoConvert_v1alpha3_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpe return nil } -// Convert_v1alpha3_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec is an autogenerated conversion function. -func Convert_v1alpha3_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(in *MachineDeploymentSpec, out *v1alpha4.MachineDeploymentSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(in, out, s) +// Convert_v1alpha3_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec is an autogenerated conversion function. +func Convert_v1alpha3_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(in *MachineDeploymentSpec, out *v1beta1.MachineDeploymentSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(in, out, s) } -func autoConvert_v1alpha4_MachineDeploymentSpec_To_v1alpha3_MachineDeploymentSpec(in *v1alpha4.MachineDeploymentSpec, out *MachineDeploymentSpec, s conversion.Scope) error { +func autoConvert_v1beta1_MachineDeploymentSpec_To_v1alpha3_MachineDeploymentSpec(in *v1beta1.MachineDeploymentSpec, out *MachineDeploymentSpec, s conversion.Scope) error { out.ClusterName = in.ClusterName out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) out.Selector = in.Selector - if err := Convert_v1alpha4_MachineTemplateSpec_To_v1alpha3_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { + if err := Convert_v1beta1_MachineTemplateSpec_To_v1alpha3_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } if in.Strategy != nil { in, out := &in.Strategy, &out.Strategy *out = new(MachineDeploymentStrategy) - if err := Convert_v1alpha4_MachineDeploymentStrategy_To_v1alpha3_MachineDeploymentStrategy(*in, *out, s); err != nil { + if err := Convert_v1beta1_MachineDeploymentStrategy_To_v1alpha3_MachineDeploymentStrategy(*in, *out, s); err != nil { return err } } else { @@ -791,12 +791,12 @@ func autoConvert_v1alpha4_MachineDeploymentSpec_To_v1alpha3_MachineDeploymentSpe return nil } -// Convert_v1alpha4_MachineDeploymentSpec_To_v1alpha3_MachineDeploymentSpec is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeploymentSpec_To_v1alpha3_MachineDeploymentSpec(in *v1alpha4.MachineDeploymentSpec, out *MachineDeploymentSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentSpec_To_v1alpha3_MachineDeploymentSpec(in, out, s) +// Convert_v1beta1_MachineDeploymentSpec_To_v1alpha3_MachineDeploymentSpec is an autogenerated conversion function. +func Convert_v1beta1_MachineDeploymentSpec_To_v1alpha3_MachineDeploymentSpec(in *v1beta1.MachineDeploymentSpec, out *MachineDeploymentSpec, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDeploymentSpec_To_v1alpha3_MachineDeploymentSpec(in, out, s) } -func autoConvert_v1alpha3_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(in *MachineDeploymentStatus, out *v1alpha4.MachineDeploymentStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(in *MachineDeploymentStatus, out *v1beta1.MachineDeploymentStatus, s conversion.Scope) error { out.ObservedGeneration = in.ObservedGeneration out.Selector = in.Selector out.Replicas = in.Replicas @@ -808,12 +808,12 @@ func autoConvert_v1alpha3_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentS return nil } -// Convert_v1alpha3_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus is an autogenerated conversion function. -func Convert_v1alpha3_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(in *MachineDeploymentStatus, out *v1alpha4.MachineDeploymentStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(in, out, s) +// Convert_v1alpha3_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus is an autogenerated conversion function. +func Convert_v1alpha3_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(in *MachineDeploymentStatus, out *v1beta1.MachineDeploymentStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(in, out, s) } -func autoConvert_v1alpha4_MachineDeploymentStatus_To_v1alpha3_MachineDeploymentStatus(in *v1alpha4.MachineDeploymentStatus, out *MachineDeploymentStatus, s conversion.Scope) error { +func autoConvert_v1beta1_MachineDeploymentStatus_To_v1alpha3_MachineDeploymentStatus(in *v1beta1.MachineDeploymentStatus, out *MachineDeploymentStatus, s conversion.Scope) error { out.ObservedGeneration = in.ObservedGeneration out.Selector = in.Selector out.Replicas = in.Replicas @@ -826,12 +826,12 @@ func autoConvert_v1alpha4_MachineDeploymentStatus_To_v1alpha3_MachineDeploymentS return nil } -func autoConvert_v1alpha3_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy(in *MachineDeploymentStrategy, out *v1alpha4.MachineDeploymentStrategy, s conversion.Scope) error { - out.Type = v1alpha4.MachineDeploymentStrategyType(in.Type) +func autoConvert_v1alpha3_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy(in *MachineDeploymentStrategy, out *v1beta1.MachineDeploymentStrategy, s conversion.Scope) error { + out.Type = v1beta1.MachineDeploymentStrategyType(in.Type) if in.RollingUpdate != nil { in, out := &in.RollingUpdate, &out.RollingUpdate - *out = new(v1alpha4.MachineRollingUpdateDeployment) - if err := Convert_v1alpha3_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(*in, *out, s); err != nil { + *out = new(v1beta1.MachineRollingUpdateDeployment) + if err := Convert_v1alpha3_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(*in, *out, s); err != nil { return err } } else { @@ -840,17 +840,17 @@ func autoConvert_v1alpha3_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymen return nil } -// Convert_v1alpha3_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy is an autogenerated conversion function. -func Convert_v1alpha3_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy(in *MachineDeploymentStrategy, out *v1alpha4.MachineDeploymentStrategy, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy(in, out, s) +// Convert_v1alpha3_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy is an autogenerated conversion function. +func Convert_v1alpha3_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy(in *MachineDeploymentStrategy, out *v1beta1.MachineDeploymentStrategy, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy(in, out, s) } -func autoConvert_v1alpha4_MachineDeploymentStrategy_To_v1alpha3_MachineDeploymentStrategy(in *v1alpha4.MachineDeploymentStrategy, out *MachineDeploymentStrategy, s conversion.Scope) error { +func autoConvert_v1beta1_MachineDeploymentStrategy_To_v1alpha3_MachineDeploymentStrategy(in *v1beta1.MachineDeploymentStrategy, out *MachineDeploymentStrategy, s conversion.Scope) error { out.Type = MachineDeploymentStrategyType(in.Type) if in.RollingUpdate != nil { in, out := &in.RollingUpdate, &out.RollingUpdate *out = new(MachineRollingUpdateDeployment) - if err := Convert_v1alpha4_MachineRollingUpdateDeployment_To_v1alpha3_MachineRollingUpdateDeployment(*in, *out, s); err != nil { + if err := Convert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha3_MachineRollingUpdateDeployment(*in, *out, s); err != nil { return err } } else { @@ -859,50 +859,50 @@ func autoConvert_v1alpha4_MachineDeploymentStrategy_To_v1alpha3_MachineDeploymen return nil } -// Convert_v1alpha4_MachineDeploymentStrategy_To_v1alpha3_MachineDeploymentStrategy is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeploymentStrategy_To_v1alpha3_MachineDeploymentStrategy(in *v1alpha4.MachineDeploymentStrategy, out *MachineDeploymentStrategy, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentStrategy_To_v1alpha3_MachineDeploymentStrategy(in, out, s) +// Convert_v1beta1_MachineDeploymentStrategy_To_v1alpha3_MachineDeploymentStrategy is an autogenerated conversion function. +func Convert_v1beta1_MachineDeploymentStrategy_To_v1alpha3_MachineDeploymentStrategy(in *v1beta1.MachineDeploymentStrategy, out *MachineDeploymentStrategy, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDeploymentStrategy_To_v1alpha3_MachineDeploymentStrategy(in, out, s) } -func autoConvert_v1alpha3_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(in *MachineHealthCheck, out *v1alpha4.MachineHealthCheck, s conversion.Scope) error { +func autoConvert_v1alpha3_MachineHealthCheck_To_v1beta1_MachineHealthCheck(in *MachineHealthCheck, out *v1beta1.MachineHealthCheck, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha3_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha3_MachineHealthCheck_To_v1alpha4_MachineHealthCheck is an autogenerated conversion function. -func Convert_v1alpha3_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(in *MachineHealthCheck, out *v1alpha4.MachineHealthCheck, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(in, out, s) +// Convert_v1alpha3_MachineHealthCheck_To_v1beta1_MachineHealthCheck is an autogenerated conversion function. +func Convert_v1alpha3_MachineHealthCheck_To_v1beta1_MachineHealthCheck(in *MachineHealthCheck, out *v1beta1.MachineHealthCheck, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineHealthCheck_To_v1beta1_MachineHealthCheck(in, out, s) } -func autoConvert_v1alpha4_MachineHealthCheck_To_v1alpha3_MachineHealthCheck(in *v1alpha4.MachineHealthCheck, out *MachineHealthCheck, s conversion.Scope) error { +func autoConvert_v1beta1_MachineHealthCheck_To_v1alpha3_MachineHealthCheck(in *v1beta1.MachineHealthCheck, out *MachineHealthCheck, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_MachineHealthCheckSpec_To_v1alpha3_MachineHealthCheckSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_MachineHealthCheckSpec_To_v1alpha3_MachineHealthCheckSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha4_MachineHealthCheckStatus_To_v1alpha3_MachineHealthCheckStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_MachineHealthCheckStatus_To_v1alpha3_MachineHealthCheckStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha4_MachineHealthCheck_To_v1alpha3_MachineHealthCheck is an autogenerated conversion function. -func Convert_v1alpha4_MachineHealthCheck_To_v1alpha3_MachineHealthCheck(in *v1alpha4.MachineHealthCheck, out *MachineHealthCheck, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineHealthCheck_To_v1alpha3_MachineHealthCheck(in, out, s) +// Convert_v1beta1_MachineHealthCheck_To_v1alpha3_MachineHealthCheck is an autogenerated conversion function. +func Convert_v1beta1_MachineHealthCheck_To_v1alpha3_MachineHealthCheck(in *v1beta1.MachineHealthCheck, out *MachineHealthCheck, s conversion.Scope) error { + return autoConvert_v1beta1_MachineHealthCheck_To_v1alpha3_MachineHealthCheck(in, out, s) } -func autoConvert_v1alpha3_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(in *MachineHealthCheckList, out *v1alpha4.MachineHealthCheckList, s conversion.Scope) error { +func autoConvert_v1alpha3_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(in *MachineHealthCheckList, out *v1beta1.MachineHealthCheckList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha4.MachineHealthCheck, len(*in)) + *out = make([]v1beta1.MachineHealthCheck, len(*in)) for i := range *in { - if err := Convert_v1alpha3_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_MachineHealthCheck_To_v1beta1_MachineHealthCheck(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -912,18 +912,18 @@ func autoConvert_v1alpha3_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckL return nil } -// Convert_v1alpha3_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList is an autogenerated conversion function. -func Convert_v1alpha3_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(in *MachineHealthCheckList, out *v1alpha4.MachineHealthCheckList, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(in, out, s) +// Convert_v1alpha3_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList is an autogenerated conversion function. +func Convert_v1alpha3_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(in *MachineHealthCheckList, out *v1beta1.MachineHealthCheckList, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(in, out, s) } -func autoConvert_v1alpha4_MachineHealthCheckList_To_v1alpha3_MachineHealthCheckList(in *v1alpha4.MachineHealthCheckList, out *MachineHealthCheckList, s conversion.Scope) error { +func autoConvert_v1beta1_MachineHealthCheckList_To_v1alpha3_MachineHealthCheckList(in *v1beta1.MachineHealthCheckList, out *MachineHealthCheckList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]MachineHealthCheck, len(*in)) for i := range *in { - if err := Convert_v1alpha4_MachineHealthCheck_To_v1alpha3_MachineHealthCheck(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_MachineHealthCheck_To_v1alpha3_MachineHealthCheck(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -933,27 +933,27 @@ func autoConvert_v1alpha4_MachineHealthCheckList_To_v1alpha3_MachineHealthCheckL return nil } -// Convert_v1alpha4_MachineHealthCheckList_To_v1alpha3_MachineHealthCheckList is an autogenerated conversion function. -func Convert_v1alpha4_MachineHealthCheckList_To_v1alpha3_MachineHealthCheckList(in *v1alpha4.MachineHealthCheckList, out *MachineHealthCheckList, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineHealthCheckList_To_v1alpha3_MachineHealthCheckList(in, out, s) +// Convert_v1beta1_MachineHealthCheckList_To_v1alpha3_MachineHealthCheckList is an autogenerated conversion function. +func Convert_v1beta1_MachineHealthCheckList_To_v1alpha3_MachineHealthCheckList(in *v1beta1.MachineHealthCheckList, out *MachineHealthCheckList, s conversion.Scope) error { + return autoConvert_v1beta1_MachineHealthCheckList_To_v1alpha3_MachineHealthCheckList(in, out, s) } -func autoConvert_v1alpha3_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(in *MachineHealthCheckSpec, out *v1alpha4.MachineHealthCheckSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in *MachineHealthCheckSpec, out *v1beta1.MachineHealthCheckSpec, s conversion.Scope) error { out.ClusterName = in.ClusterName out.Selector = in.Selector - out.UnhealthyConditions = *(*[]v1alpha4.UnhealthyCondition)(unsafe.Pointer(&in.UnhealthyConditions)) + out.UnhealthyConditions = *(*[]v1beta1.UnhealthyCondition)(unsafe.Pointer(&in.UnhealthyConditions)) out.MaxUnhealthy = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnhealthy)) out.NodeStartupTimeout = (*metav1.Duration)(unsafe.Pointer(in.NodeStartupTimeout)) out.RemediationTemplate = (*v1.ObjectReference)(unsafe.Pointer(in.RemediationTemplate)) return nil } -// Convert_v1alpha3_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec is an autogenerated conversion function. -func Convert_v1alpha3_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(in *MachineHealthCheckSpec, out *v1alpha4.MachineHealthCheckSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(in, out, s) +// Convert_v1alpha3_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec is an autogenerated conversion function. +func Convert_v1alpha3_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in *MachineHealthCheckSpec, out *v1beta1.MachineHealthCheckSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in, out, s) } -func autoConvert_v1alpha4_MachineHealthCheckSpec_To_v1alpha3_MachineHealthCheckSpec(in *v1alpha4.MachineHealthCheckSpec, out *MachineHealthCheckSpec, s conversion.Scope) error { +func autoConvert_v1beta1_MachineHealthCheckSpec_To_v1alpha3_MachineHealthCheckSpec(in *v1beta1.MachineHealthCheckSpec, out *MachineHealthCheckSpec, s conversion.Scope) error { out.ClusterName = in.ClusterName out.Selector = in.Selector out.UnhealthyConditions = *(*[]UnhealthyCondition)(unsafe.Pointer(&in.UnhealthyConditions)) @@ -964,22 +964,22 @@ func autoConvert_v1alpha4_MachineHealthCheckSpec_To_v1alpha3_MachineHealthCheckS return nil } -func autoConvert_v1alpha3_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(in *MachineHealthCheckStatus, out *v1alpha4.MachineHealthCheckStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in *MachineHealthCheckStatus, out *v1beta1.MachineHealthCheckStatus, s conversion.Scope) error { out.ExpectedMachines = in.ExpectedMachines out.CurrentHealthy = in.CurrentHealthy out.RemediationsAllowed = in.RemediationsAllowed out.ObservedGeneration = in.ObservedGeneration out.Targets = *(*[]string)(unsafe.Pointer(&in.Targets)) - out.Conditions = *(*v1alpha4.Conditions)(unsafe.Pointer(&in.Conditions)) + out.Conditions = *(*v1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) return nil } -// Convert_v1alpha3_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus is an autogenerated conversion function. -func Convert_v1alpha3_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(in *MachineHealthCheckStatus, out *v1alpha4.MachineHealthCheckStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(in, out, s) +// Convert_v1alpha3_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus is an autogenerated conversion function. +func Convert_v1alpha3_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in *MachineHealthCheckStatus, out *v1beta1.MachineHealthCheckStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in, out, s) } -func autoConvert_v1alpha4_MachineHealthCheckStatus_To_v1alpha3_MachineHealthCheckStatus(in *v1alpha4.MachineHealthCheckStatus, out *MachineHealthCheckStatus, s conversion.Scope) error { +func autoConvert_v1beta1_MachineHealthCheckStatus_To_v1alpha3_MachineHealthCheckStatus(in *v1beta1.MachineHealthCheckStatus, out *MachineHealthCheckStatus, s conversion.Scope) error { out.ExpectedMachines = in.ExpectedMachines out.CurrentHealthy = in.CurrentHealthy out.RemediationsAllowed = in.RemediationsAllowed @@ -989,18 +989,18 @@ func autoConvert_v1alpha4_MachineHealthCheckStatus_To_v1alpha3_MachineHealthChec return nil } -// Convert_v1alpha4_MachineHealthCheckStatus_To_v1alpha3_MachineHealthCheckStatus is an autogenerated conversion function. -func Convert_v1alpha4_MachineHealthCheckStatus_To_v1alpha3_MachineHealthCheckStatus(in *v1alpha4.MachineHealthCheckStatus, out *MachineHealthCheckStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineHealthCheckStatus_To_v1alpha3_MachineHealthCheckStatus(in, out, s) +// Convert_v1beta1_MachineHealthCheckStatus_To_v1alpha3_MachineHealthCheckStatus is an autogenerated conversion function. +func Convert_v1beta1_MachineHealthCheckStatus_To_v1alpha3_MachineHealthCheckStatus(in *v1beta1.MachineHealthCheckStatus, out *MachineHealthCheckStatus, s conversion.Scope) error { + return autoConvert_v1beta1_MachineHealthCheckStatus_To_v1alpha3_MachineHealthCheckStatus(in, out, s) } -func autoConvert_v1alpha3_MachineList_To_v1alpha4_MachineList(in *MachineList, out *v1alpha4.MachineList, s conversion.Scope) error { +func autoConvert_v1alpha3_MachineList_To_v1beta1_MachineList(in *MachineList, out *v1beta1.MachineList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha4.Machine, len(*in)) + *out = make([]v1beta1.Machine, len(*in)) for i := range *in { - if err := Convert_v1alpha3_Machine_To_v1alpha4_Machine(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_Machine_To_v1beta1_Machine(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1010,18 +1010,18 @@ func autoConvert_v1alpha3_MachineList_To_v1alpha4_MachineList(in *MachineList, o return nil } -// Convert_v1alpha3_MachineList_To_v1alpha4_MachineList is an autogenerated conversion function. -func Convert_v1alpha3_MachineList_To_v1alpha4_MachineList(in *MachineList, out *v1alpha4.MachineList, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineList_To_v1alpha4_MachineList(in, out, s) +// Convert_v1alpha3_MachineList_To_v1beta1_MachineList is an autogenerated conversion function. +func Convert_v1alpha3_MachineList_To_v1beta1_MachineList(in *MachineList, out *v1beta1.MachineList, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineList_To_v1beta1_MachineList(in, out, s) } -func autoConvert_v1alpha4_MachineList_To_v1alpha3_MachineList(in *v1alpha4.MachineList, out *MachineList, s conversion.Scope) error { +func autoConvert_v1beta1_MachineList_To_v1alpha3_MachineList(in *v1beta1.MachineList, out *MachineList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]Machine, len(*in)) for i := range *in { - if err := Convert_v1alpha4_Machine_To_v1alpha3_Machine(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_Machine_To_v1alpha3_Machine(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1031,68 +1031,68 @@ func autoConvert_v1alpha4_MachineList_To_v1alpha3_MachineList(in *v1alpha4.Machi return nil } -// Convert_v1alpha4_MachineList_To_v1alpha3_MachineList is an autogenerated conversion function. -func Convert_v1alpha4_MachineList_To_v1alpha3_MachineList(in *v1alpha4.MachineList, out *MachineList, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineList_To_v1alpha3_MachineList(in, out, s) +// Convert_v1beta1_MachineList_To_v1alpha3_MachineList is an autogenerated conversion function. +func Convert_v1beta1_MachineList_To_v1alpha3_MachineList(in *v1beta1.MachineList, out *MachineList, s conversion.Scope) error { + return autoConvert_v1beta1_MachineList_To_v1alpha3_MachineList(in, out, s) } -func autoConvert_v1alpha3_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(in *MachineRollingUpdateDeployment, out *v1alpha4.MachineRollingUpdateDeployment, s conversion.Scope) error { +func autoConvert_v1alpha3_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(in *MachineRollingUpdateDeployment, out *v1beta1.MachineRollingUpdateDeployment, s conversion.Scope) error { out.MaxUnavailable = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnavailable)) out.MaxSurge = (*intstr.IntOrString)(unsafe.Pointer(in.MaxSurge)) return nil } -// Convert_v1alpha3_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment is an autogenerated conversion function. -func Convert_v1alpha3_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(in *MachineRollingUpdateDeployment, out *v1alpha4.MachineRollingUpdateDeployment, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(in, out, s) +// Convert_v1alpha3_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment is an autogenerated conversion function. +func Convert_v1alpha3_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(in *MachineRollingUpdateDeployment, out *v1beta1.MachineRollingUpdateDeployment, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(in, out, s) } -func autoConvert_v1alpha4_MachineRollingUpdateDeployment_To_v1alpha3_MachineRollingUpdateDeployment(in *v1alpha4.MachineRollingUpdateDeployment, out *MachineRollingUpdateDeployment, s conversion.Scope) error { +func autoConvert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha3_MachineRollingUpdateDeployment(in *v1beta1.MachineRollingUpdateDeployment, out *MachineRollingUpdateDeployment, s conversion.Scope) error { out.MaxUnavailable = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnavailable)) out.MaxSurge = (*intstr.IntOrString)(unsafe.Pointer(in.MaxSurge)) // WARNING: in.DeletePolicy requires manual conversion: does not exist in peer-type return nil } -func autoConvert_v1alpha3_MachineSet_To_v1alpha4_MachineSet(in *MachineSet, out *v1alpha4.MachineSet, s conversion.Scope) error { +func autoConvert_v1alpha3_MachineSet_To_v1beta1_MachineSet(in *MachineSet, out *v1beta1.MachineSet, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_MachineSetSpec_To_v1alpha4_MachineSetSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_MachineSetSpec_To_v1beta1_MachineSetSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha3_MachineSetStatus_To_v1alpha4_MachineSetStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_MachineSetStatus_To_v1beta1_MachineSetStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha3_MachineSet_To_v1alpha4_MachineSet is an autogenerated conversion function. -func Convert_v1alpha3_MachineSet_To_v1alpha4_MachineSet(in *MachineSet, out *v1alpha4.MachineSet, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineSet_To_v1alpha4_MachineSet(in, out, s) +// Convert_v1alpha3_MachineSet_To_v1beta1_MachineSet is an autogenerated conversion function. +func Convert_v1alpha3_MachineSet_To_v1beta1_MachineSet(in *MachineSet, out *v1beta1.MachineSet, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineSet_To_v1beta1_MachineSet(in, out, s) } -func autoConvert_v1alpha4_MachineSet_To_v1alpha3_MachineSet(in *v1alpha4.MachineSet, out *MachineSet, s conversion.Scope) error { +func autoConvert_v1beta1_MachineSet_To_v1alpha3_MachineSet(in *v1beta1.MachineSet, out *MachineSet, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_MachineSetSpec_To_v1alpha3_MachineSetSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_MachineSetSpec_To_v1alpha3_MachineSetSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha4_MachineSetStatus_To_v1alpha3_MachineSetStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_MachineSetStatus_To_v1alpha3_MachineSetStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha4_MachineSet_To_v1alpha3_MachineSet is an autogenerated conversion function. -func Convert_v1alpha4_MachineSet_To_v1alpha3_MachineSet(in *v1alpha4.MachineSet, out *MachineSet, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineSet_To_v1alpha3_MachineSet(in, out, s) +// Convert_v1beta1_MachineSet_To_v1alpha3_MachineSet is an autogenerated conversion function. +func Convert_v1beta1_MachineSet_To_v1alpha3_MachineSet(in *v1beta1.MachineSet, out *MachineSet, s conversion.Scope) error { + return autoConvert_v1beta1_MachineSet_To_v1alpha3_MachineSet(in, out, s) } -func autoConvert_v1alpha3_MachineSetList_To_v1alpha4_MachineSetList(in *MachineSetList, out *v1alpha4.MachineSetList, s conversion.Scope) error { +func autoConvert_v1alpha3_MachineSetList_To_v1beta1_MachineSetList(in *MachineSetList, out *v1beta1.MachineSetList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha4.MachineSet, len(*in)) + *out = make([]v1beta1.MachineSet, len(*in)) for i := range *in { - if err := Convert_v1alpha3_MachineSet_To_v1alpha4_MachineSet(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_MachineSet_To_v1beta1_MachineSet(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1102,18 +1102,18 @@ func autoConvert_v1alpha3_MachineSetList_To_v1alpha4_MachineSetList(in *MachineS return nil } -// Convert_v1alpha3_MachineSetList_To_v1alpha4_MachineSetList is an autogenerated conversion function. -func Convert_v1alpha3_MachineSetList_To_v1alpha4_MachineSetList(in *MachineSetList, out *v1alpha4.MachineSetList, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineSetList_To_v1alpha4_MachineSetList(in, out, s) +// Convert_v1alpha3_MachineSetList_To_v1beta1_MachineSetList is an autogenerated conversion function. +func Convert_v1alpha3_MachineSetList_To_v1beta1_MachineSetList(in *MachineSetList, out *v1beta1.MachineSetList, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineSetList_To_v1beta1_MachineSetList(in, out, s) } -func autoConvert_v1alpha4_MachineSetList_To_v1alpha3_MachineSetList(in *v1alpha4.MachineSetList, out *MachineSetList, s conversion.Scope) error { +func autoConvert_v1beta1_MachineSetList_To_v1alpha3_MachineSetList(in *v1beta1.MachineSetList, out *MachineSetList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]MachineSet, len(*in)) for i := range *in { - if err := Convert_v1alpha4_MachineSet_To_v1alpha3_MachineSet(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_MachineSet_To_v1alpha3_MachineSet(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1123,46 +1123,46 @@ func autoConvert_v1alpha4_MachineSetList_To_v1alpha3_MachineSetList(in *v1alpha4 return nil } -// Convert_v1alpha4_MachineSetList_To_v1alpha3_MachineSetList is an autogenerated conversion function. -func Convert_v1alpha4_MachineSetList_To_v1alpha3_MachineSetList(in *v1alpha4.MachineSetList, out *MachineSetList, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineSetList_To_v1alpha3_MachineSetList(in, out, s) +// Convert_v1beta1_MachineSetList_To_v1alpha3_MachineSetList is an autogenerated conversion function. +func Convert_v1beta1_MachineSetList_To_v1alpha3_MachineSetList(in *v1beta1.MachineSetList, out *MachineSetList, s conversion.Scope) error { + return autoConvert_v1beta1_MachineSetList_To_v1alpha3_MachineSetList(in, out, s) } -func autoConvert_v1alpha3_MachineSetSpec_To_v1alpha4_MachineSetSpec(in *MachineSetSpec, out *v1alpha4.MachineSetSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_MachineSetSpec_To_v1beta1_MachineSetSpec(in *MachineSetSpec, out *v1beta1.MachineSetSpec, s conversion.Scope) error { out.ClusterName = in.ClusterName out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) out.MinReadySeconds = in.MinReadySeconds out.DeletePolicy = in.DeletePolicy out.Selector = in.Selector - if err := Convert_v1alpha3_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { + if err := Convert_v1alpha3_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } return nil } -// Convert_v1alpha3_MachineSetSpec_To_v1alpha4_MachineSetSpec is an autogenerated conversion function. -func Convert_v1alpha3_MachineSetSpec_To_v1alpha4_MachineSetSpec(in *MachineSetSpec, out *v1alpha4.MachineSetSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineSetSpec_To_v1alpha4_MachineSetSpec(in, out, s) +// Convert_v1alpha3_MachineSetSpec_To_v1beta1_MachineSetSpec is an autogenerated conversion function. +func Convert_v1alpha3_MachineSetSpec_To_v1beta1_MachineSetSpec(in *MachineSetSpec, out *v1beta1.MachineSetSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineSetSpec_To_v1beta1_MachineSetSpec(in, out, s) } -func autoConvert_v1alpha4_MachineSetSpec_To_v1alpha3_MachineSetSpec(in *v1alpha4.MachineSetSpec, out *MachineSetSpec, s conversion.Scope) error { +func autoConvert_v1beta1_MachineSetSpec_To_v1alpha3_MachineSetSpec(in *v1beta1.MachineSetSpec, out *MachineSetSpec, s conversion.Scope) error { out.ClusterName = in.ClusterName out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) out.MinReadySeconds = in.MinReadySeconds out.DeletePolicy = in.DeletePolicy out.Selector = in.Selector - if err := Convert_v1alpha4_MachineTemplateSpec_To_v1alpha3_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { + if err := Convert_v1beta1_MachineTemplateSpec_To_v1alpha3_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } return nil } -// Convert_v1alpha4_MachineSetSpec_To_v1alpha3_MachineSetSpec is an autogenerated conversion function. -func Convert_v1alpha4_MachineSetSpec_To_v1alpha3_MachineSetSpec(in *v1alpha4.MachineSetSpec, out *MachineSetSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineSetSpec_To_v1alpha3_MachineSetSpec(in, out, s) +// Convert_v1beta1_MachineSetSpec_To_v1alpha3_MachineSetSpec is an autogenerated conversion function. +func Convert_v1beta1_MachineSetSpec_To_v1alpha3_MachineSetSpec(in *v1beta1.MachineSetSpec, out *MachineSetSpec, s conversion.Scope) error { + return autoConvert_v1beta1_MachineSetSpec_To_v1alpha3_MachineSetSpec(in, out, s) } -func autoConvert_v1alpha3_MachineSetStatus_To_v1alpha4_MachineSetStatus(in *MachineSetStatus, out *v1alpha4.MachineSetStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_MachineSetStatus_To_v1beta1_MachineSetStatus(in *MachineSetStatus, out *v1beta1.MachineSetStatus, s conversion.Scope) error { out.Selector = in.Selector out.Replicas = in.Replicas out.FullyLabeledReplicas = in.FullyLabeledReplicas @@ -1174,12 +1174,12 @@ func autoConvert_v1alpha3_MachineSetStatus_To_v1alpha4_MachineSetStatus(in *Mach return nil } -// Convert_v1alpha3_MachineSetStatus_To_v1alpha4_MachineSetStatus is an autogenerated conversion function. -func Convert_v1alpha3_MachineSetStatus_To_v1alpha4_MachineSetStatus(in *MachineSetStatus, out *v1alpha4.MachineSetStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineSetStatus_To_v1alpha4_MachineSetStatus(in, out, s) +// Convert_v1alpha3_MachineSetStatus_To_v1beta1_MachineSetStatus is an autogenerated conversion function. +func Convert_v1alpha3_MachineSetStatus_To_v1beta1_MachineSetStatus(in *MachineSetStatus, out *v1beta1.MachineSetStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineSetStatus_To_v1beta1_MachineSetStatus(in, out, s) } -func autoConvert_v1alpha4_MachineSetStatus_To_v1alpha3_MachineSetStatus(in *v1alpha4.MachineSetStatus, out *MachineSetStatus, s conversion.Scope) error { +func autoConvert_v1beta1_MachineSetStatus_To_v1alpha3_MachineSetStatus(in *v1beta1.MachineSetStatus, out *MachineSetStatus, s conversion.Scope) error { out.Selector = in.Selector out.Replicas = in.Replicas out.FullyLabeledReplicas = in.FullyLabeledReplicas @@ -1191,14 +1191,14 @@ func autoConvert_v1alpha4_MachineSetStatus_To_v1alpha3_MachineSetStatus(in *v1al return nil } -// Convert_v1alpha4_MachineSetStatus_To_v1alpha3_MachineSetStatus is an autogenerated conversion function. -func Convert_v1alpha4_MachineSetStatus_To_v1alpha3_MachineSetStatus(in *v1alpha4.MachineSetStatus, out *MachineSetStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineSetStatus_To_v1alpha3_MachineSetStatus(in, out, s) +// Convert_v1beta1_MachineSetStatus_To_v1alpha3_MachineSetStatus is an autogenerated conversion function. +func Convert_v1beta1_MachineSetStatus_To_v1alpha3_MachineSetStatus(in *v1beta1.MachineSetStatus, out *MachineSetStatus, s conversion.Scope) error { + return autoConvert_v1beta1_MachineSetStatus_To_v1alpha3_MachineSetStatus(in, out, s) } -func autoConvert_v1alpha3_MachineSpec_To_v1alpha4_MachineSpec(in *MachineSpec, out *v1alpha4.MachineSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_MachineSpec_To_v1beta1_MachineSpec(in *MachineSpec, out *v1beta1.MachineSpec, s conversion.Scope) error { out.ClusterName = in.ClusterName - if err := Convert_v1alpha3_Bootstrap_To_v1alpha4_Bootstrap(&in.Bootstrap, &out.Bootstrap, s); err != nil { + if err := Convert_v1alpha3_Bootstrap_To_v1beta1_Bootstrap(&in.Bootstrap, &out.Bootstrap, s); err != nil { return err } out.InfrastructureRef = in.InfrastructureRef @@ -1209,14 +1209,14 @@ func autoConvert_v1alpha3_MachineSpec_To_v1alpha4_MachineSpec(in *MachineSpec, o return nil } -// Convert_v1alpha3_MachineSpec_To_v1alpha4_MachineSpec is an autogenerated conversion function. -func Convert_v1alpha3_MachineSpec_To_v1alpha4_MachineSpec(in *MachineSpec, out *v1alpha4.MachineSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineSpec_To_v1alpha4_MachineSpec(in, out, s) +// Convert_v1alpha3_MachineSpec_To_v1beta1_MachineSpec is an autogenerated conversion function. +func Convert_v1alpha3_MachineSpec_To_v1beta1_MachineSpec(in *MachineSpec, out *v1beta1.MachineSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineSpec_To_v1beta1_MachineSpec(in, out, s) } -func autoConvert_v1alpha4_MachineSpec_To_v1alpha3_MachineSpec(in *v1alpha4.MachineSpec, out *MachineSpec, s conversion.Scope) error { +func autoConvert_v1beta1_MachineSpec_To_v1alpha3_MachineSpec(in *v1beta1.MachineSpec, out *MachineSpec, s conversion.Scope) error { out.ClusterName = in.ClusterName - if err := Convert_v1alpha4_Bootstrap_To_v1alpha3_Bootstrap(&in.Bootstrap, &out.Bootstrap, s); err != nil { + if err := Convert_v1beta1_Bootstrap_To_v1alpha3_Bootstrap(&in.Bootstrap, &out.Bootstrap, s); err != nil { return err } out.InfrastructureRef = in.InfrastructureRef @@ -1227,32 +1227,32 @@ func autoConvert_v1alpha4_MachineSpec_To_v1alpha3_MachineSpec(in *v1alpha4.Machi return nil } -// Convert_v1alpha4_MachineSpec_To_v1alpha3_MachineSpec is an autogenerated conversion function. -func Convert_v1alpha4_MachineSpec_To_v1alpha3_MachineSpec(in *v1alpha4.MachineSpec, out *MachineSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineSpec_To_v1alpha3_MachineSpec(in, out, s) +// Convert_v1beta1_MachineSpec_To_v1alpha3_MachineSpec is an autogenerated conversion function. +func Convert_v1beta1_MachineSpec_To_v1alpha3_MachineSpec(in *v1beta1.MachineSpec, out *MachineSpec, s conversion.Scope) error { + return autoConvert_v1beta1_MachineSpec_To_v1alpha3_MachineSpec(in, out, s) } -func autoConvert_v1alpha3_MachineStatus_To_v1alpha4_MachineStatus(in *MachineStatus, out *v1alpha4.MachineStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_MachineStatus_To_v1beta1_MachineStatus(in *MachineStatus, out *v1beta1.MachineStatus, s conversion.Scope) error { out.NodeRef = (*v1.ObjectReference)(unsafe.Pointer(in.NodeRef)) out.LastUpdated = (*metav1.Time)(unsafe.Pointer(in.LastUpdated)) out.Version = (*string)(unsafe.Pointer(in.Version)) out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Addresses = *(*v1alpha4.MachineAddresses)(unsafe.Pointer(&in.Addresses)) + out.Addresses = *(*v1beta1.MachineAddresses)(unsafe.Pointer(&in.Addresses)) out.Phase = in.Phase out.BootstrapReady = in.BootstrapReady out.InfrastructureReady = in.InfrastructureReady out.ObservedGeneration = in.ObservedGeneration - out.Conditions = *(*v1alpha4.Conditions)(unsafe.Pointer(&in.Conditions)) + out.Conditions = *(*v1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) return nil } -// Convert_v1alpha3_MachineStatus_To_v1alpha4_MachineStatus is an autogenerated conversion function. -func Convert_v1alpha3_MachineStatus_To_v1alpha4_MachineStatus(in *MachineStatus, out *v1alpha4.MachineStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineStatus_To_v1alpha4_MachineStatus(in, out, s) +// Convert_v1alpha3_MachineStatus_To_v1beta1_MachineStatus is an autogenerated conversion function. +func Convert_v1alpha3_MachineStatus_To_v1beta1_MachineStatus(in *MachineStatus, out *v1beta1.MachineStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineStatus_To_v1beta1_MachineStatus(in, out, s) } -func autoConvert_v1alpha4_MachineStatus_To_v1alpha3_MachineStatus(in *v1alpha4.MachineStatus, out *MachineStatus, s conversion.Scope) error { +func autoConvert_v1beta1_MachineStatus_To_v1alpha3_MachineStatus(in *v1beta1.MachineStatus, out *MachineStatus, s conversion.Scope) error { out.NodeRef = (*v1.ObjectReference)(unsafe.Pointer(in.NodeRef)) // WARNING: in.NodeInfo requires manual conversion: does not exist in peer-type out.LastUpdated = (*metav1.Time)(unsafe.Pointer(in.LastUpdated)) @@ -1268,57 +1268,57 @@ func autoConvert_v1alpha4_MachineStatus_To_v1alpha3_MachineStatus(in *v1alpha4.M return nil } -func autoConvert_v1alpha3_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(in *MachineTemplateSpec, out *v1alpha4.MachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha3_ObjectMeta_To_v1alpha4_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { +func autoConvert_v1alpha3_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(in *MachineTemplateSpec, out *v1beta1.MachineTemplateSpec, s conversion.Scope) error { + if err := Convert_v1alpha3_ObjectMeta_To_v1beta1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { return err } - if err := Convert_v1alpha3_MachineSpec_To_v1alpha4_MachineSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_MachineSpec_To_v1beta1_MachineSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha3_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha3_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(in *MachineTemplateSpec, out *v1alpha4.MachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(in, out, s) +// Convert_v1alpha3_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec is an autogenerated conversion function. +func Convert_v1alpha3_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(in *MachineTemplateSpec, out *v1beta1.MachineTemplateSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(in, out, s) } -func autoConvert_v1alpha4_MachineTemplateSpec_To_v1alpha3_MachineTemplateSpec(in *v1alpha4.MachineTemplateSpec, out *MachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_ObjectMeta_To_v1alpha3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { +func autoConvert_v1beta1_MachineTemplateSpec_To_v1alpha3_MachineTemplateSpec(in *v1beta1.MachineTemplateSpec, out *MachineTemplateSpec, s conversion.Scope) error { + if err := Convert_v1beta1_ObjectMeta_To_v1alpha3_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { return err } - if err := Convert_v1alpha4_MachineSpec_To_v1alpha3_MachineSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_MachineSpec_To_v1alpha3_MachineSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha4_MachineTemplateSpec_To_v1alpha3_MachineTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha4_MachineTemplateSpec_To_v1alpha3_MachineTemplateSpec(in *v1alpha4.MachineTemplateSpec, out *MachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineTemplateSpec_To_v1alpha3_MachineTemplateSpec(in, out, s) +// Convert_v1beta1_MachineTemplateSpec_To_v1alpha3_MachineTemplateSpec is an autogenerated conversion function. +func Convert_v1beta1_MachineTemplateSpec_To_v1alpha3_MachineTemplateSpec(in *v1beta1.MachineTemplateSpec, out *MachineTemplateSpec, s conversion.Scope) error { + return autoConvert_v1beta1_MachineTemplateSpec_To_v1alpha3_MachineTemplateSpec(in, out, s) } -func autoConvert_v1alpha3_NetworkRanges_To_v1alpha4_NetworkRanges(in *NetworkRanges, out *v1alpha4.NetworkRanges, s conversion.Scope) error { +func autoConvert_v1alpha3_NetworkRanges_To_v1beta1_NetworkRanges(in *NetworkRanges, out *v1beta1.NetworkRanges, s conversion.Scope) error { out.CIDRBlocks = *(*[]string)(unsafe.Pointer(&in.CIDRBlocks)) return nil } -// Convert_v1alpha3_NetworkRanges_To_v1alpha4_NetworkRanges is an autogenerated conversion function. -func Convert_v1alpha3_NetworkRanges_To_v1alpha4_NetworkRanges(in *NetworkRanges, out *v1alpha4.NetworkRanges, s conversion.Scope) error { - return autoConvert_v1alpha3_NetworkRanges_To_v1alpha4_NetworkRanges(in, out, s) +// Convert_v1alpha3_NetworkRanges_To_v1beta1_NetworkRanges is an autogenerated conversion function. +func Convert_v1alpha3_NetworkRanges_To_v1beta1_NetworkRanges(in *NetworkRanges, out *v1beta1.NetworkRanges, s conversion.Scope) error { + return autoConvert_v1alpha3_NetworkRanges_To_v1beta1_NetworkRanges(in, out, s) } -func autoConvert_v1alpha4_NetworkRanges_To_v1alpha3_NetworkRanges(in *v1alpha4.NetworkRanges, out *NetworkRanges, s conversion.Scope) error { +func autoConvert_v1beta1_NetworkRanges_To_v1alpha3_NetworkRanges(in *v1beta1.NetworkRanges, out *NetworkRanges, s conversion.Scope) error { out.CIDRBlocks = *(*[]string)(unsafe.Pointer(&in.CIDRBlocks)) return nil } -// Convert_v1alpha4_NetworkRanges_To_v1alpha3_NetworkRanges is an autogenerated conversion function. -func Convert_v1alpha4_NetworkRanges_To_v1alpha3_NetworkRanges(in *v1alpha4.NetworkRanges, out *NetworkRanges, s conversion.Scope) error { - return autoConvert_v1alpha4_NetworkRanges_To_v1alpha3_NetworkRanges(in, out, s) +// Convert_v1beta1_NetworkRanges_To_v1alpha3_NetworkRanges is an autogenerated conversion function. +func Convert_v1beta1_NetworkRanges_To_v1alpha3_NetworkRanges(in *v1beta1.NetworkRanges, out *NetworkRanges, s conversion.Scope) error { + return autoConvert_v1beta1_NetworkRanges_To_v1alpha3_NetworkRanges(in, out, s) } -func autoConvert_v1alpha3_ObjectMeta_To_v1alpha4_ObjectMeta(in *ObjectMeta, out *v1alpha4.ObjectMeta, s conversion.Scope) error { +func autoConvert_v1alpha3_ObjectMeta_To_v1beta1_ObjectMeta(in *ObjectMeta, out *v1beta1.ObjectMeta, s conversion.Scope) error { // WARNING: in.Name requires manual conversion: does not exist in peer-type // WARNING: in.GenerateName requires manual conversion: does not exist in peer-type // WARNING: in.Namespace requires manual conversion: does not exist in peer-type @@ -1328,37 +1328,37 @@ func autoConvert_v1alpha3_ObjectMeta_To_v1alpha4_ObjectMeta(in *ObjectMeta, out return nil } -func autoConvert_v1alpha4_ObjectMeta_To_v1alpha3_ObjectMeta(in *v1alpha4.ObjectMeta, out *ObjectMeta, s conversion.Scope) error { +func autoConvert_v1beta1_ObjectMeta_To_v1alpha3_ObjectMeta(in *v1beta1.ObjectMeta, out *ObjectMeta, s conversion.Scope) error { out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations)) return nil } -// Convert_v1alpha4_ObjectMeta_To_v1alpha3_ObjectMeta is an autogenerated conversion function. -func Convert_v1alpha4_ObjectMeta_To_v1alpha3_ObjectMeta(in *v1alpha4.ObjectMeta, out *ObjectMeta, s conversion.Scope) error { - return autoConvert_v1alpha4_ObjectMeta_To_v1alpha3_ObjectMeta(in, out, s) +// Convert_v1beta1_ObjectMeta_To_v1alpha3_ObjectMeta is an autogenerated conversion function. +func Convert_v1beta1_ObjectMeta_To_v1alpha3_ObjectMeta(in *v1beta1.ObjectMeta, out *ObjectMeta, s conversion.Scope) error { + return autoConvert_v1beta1_ObjectMeta_To_v1alpha3_ObjectMeta(in, out, s) } -func autoConvert_v1alpha3_UnhealthyCondition_To_v1alpha4_UnhealthyCondition(in *UnhealthyCondition, out *v1alpha4.UnhealthyCondition, s conversion.Scope) error { +func autoConvert_v1alpha3_UnhealthyCondition_To_v1beta1_UnhealthyCondition(in *UnhealthyCondition, out *v1beta1.UnhealthyCondition, s conversion.Scope) error { out.Type = v1.NodeConditionType(in.Type) out.Status = v1.ConditionStatus(in.Status) out.Timeout = in.Timeout return nil } -// Convert_v1alpha3_UnhealthyCondition_To_v1alpha4_UnhealthyCondition is an autogenerated conversion function. -func Convert_v1alpha3_UnhealthyCondition_To_v1alpha4_UnhealthyCondition(in *UnhealthyCondition, out *v1alpha4.UnhealthyCondition, s conversion.Scope) error { - return autoConvert_v1alpha3_UnhealthyCondition_To_v1alpha4_UnhealthyCondition(in, out, s) +// Convert_v1alpha3_UnhealthyCondition_To_v1beta1_UnhealthyCondition is an autogenerated conversion function. +func Convert_v1alpha3_UnhealthyCondition_To_v1beta1_UnhealthyCondition(in *UnhealthyCondition, out *v1beta1.UnhealthyCondition, s conversion.Scope) error { + return autoConvert_v1alpha3_UnhealthyCondition_To_v1beta1_UnhealthyCondition(in, out, s) } -func autoConvert_v1alpha4_UnhealthyCondition_To_v1alpha3_UnhealthyCondition(in *v1alpha4.UnhealthyCondition, out *UnhealthyCondition, s conversion.Scope) error { +func autoConvert_v1beta1_UnhealthyCondition_To_v1alpha3_UnhealthyCondition(in *v1beta1.UnhealthyCondition, out *UnhealthyCondition, s conversion.Scope) error { out.Type = v1.NodeConditionType(in.Type) out.Status = v1.ConditionStatus(in.Status) out.Timeout = in.Timeout return nil } -// Convert_v1alpha4_UnhealthyCondition_To_v1alpha3_UnhealthyCondition is an autogenerated conversion function. -func Convert_v1alpha4_UnhealthyCondition_To_v1alpha3_UnhealthyCondition(in *v1alpha4.UnhealthyCondition, out *UnhealthyCondition, s conversion.Scope) error { - return autoConvert_v1alpha4_UnhealthyCondition_To_v1alpha3_UnhealthyCondition(in, out, s) +// Convert_v1beta1_UnhealthyCondition_To_v1alpha3_UnhealthyCondition is an autogenerated conversion function. +func Convert_v1beta1_UnhealthyCondition_To_v1alpha3_UnhealthyCondition(in *v1beta1.UnhealthyCondition, out *UnhealthyCondition, s conversion.Scope) error { + return autoConvert_v1beta1_UnhealthyCondition_To_v1alpha3_UnhealthyCondition(in, out, s) } diff --git a/api/v1alpha4/cluster_types.go b/api/v1alpha4/cluster_types.go index 04532bdbc694..794363ab61bd 100644 --- a/api/v1alpha4/cluster_types.go +++ b/api/v1alpha4/cluster_types.go @@ -277,7 +277,6 @@ func (v APIEndpoint) String() string { // +kubebuilder:object:root=true // +kubebuilder:resource:path=clusters,shortName=cl,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Cluster" // +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Cluster status such as Pending/Provisioning/Provisioned/Deleting/Failed" diff --git a/api/v1alpha4/clusterclass_types.go b/api/v1alpha4/clusterclass_types.go index a444bf4607f4..14ad43b15f7d 100644 --- a/api/v1alpha4/clusterclass_types.go +++ b/api/v1alpha4/clusterclass_types.go @@ -23,7 +23,6 @@ import ( // +kubebuilder:object:root=true // +kubebuilder:resource:path=clusterclasses,shortName=cc,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of ClusterClass" // ClusterClass is a template which can be used to create managed topologies. diff --git a/api/v1alpha4/conversion.go b/api/v1alpha4/conversion.go index edfdee99e242..cc94b268608c 100644 --- a/api/v1alpha4/conversion.go +++ b/api/v1alpha4/conversion.go @@ -16,13 +16,107 @@ limitations under the License. package v1alpha4 -func (*Cluster) Hub() {} -func (*ClusterList) Hub() {} -func (*Machine) Hub() {} -func (*MachineList) Hub() {} -func (*MachineSet) Hub() {} -func (*MachineSetList) Hub() {} -func (*MachineDeployment) Hub() {} -func (*MachineDeploymentList) Hub() {} -func (*MachineHealthCheck) Hub() {} -func (*MachineHealthCheckList) Hub() {} +import ( + "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/controller-runtime/pkg/conversion" +) + +func (src *Cluster) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.Cluster) + return Convert_v1alpha4_Cluster_To_v1beta1_Cluster(src, dst, nil) +} + +func (dst *Cluster) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.Cluster) + return autoConvert_v1beta1_Cluster_To_v1alpha4_Cluster(src, dst, nil) +} + +func (src *ClusterList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.ClusterList) + return Convert_v1alpha4_ClusterList_To_v1beta1_ClusterList(src, dst, nil) +} + +func (dst *ClusterList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.ClusterList) + return autoConvert_v1beta1_ClusterList_To_v1alpha4_ClusterList(src, dst, nil) +} + +func (src *Machine) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.Machine) + return Convert_v1alpha4_Machine_To_v1beta1_Machine(src, dst, nil) +} + +func (dst *Machine) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.Machine) + return autoConvert_v1beta1_Machine_To_v1alpha4_Machine(src, dst, nil) +} + +func (src *MachineList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.MachineList) + return Convert_v1alpha4_MachineList_To_v1beta1_MachineList(src, dst, nil) +} + +func (dst *MachineList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.MachineList) + return autoConvert_v1beta1_MachineList_To_v1alpha4_MachineList(src, dst, nil) +} + +func (src *MachineSet) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.MachineSet) + return Convert_v1alpha4_MachineSet_To_v1beta1_MachineSet(src, dst, nil) +} + +func (dst *MachineSet) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.MachineSet) + return autoConvert_v1beta1_MachineSet_To_v1alpha4_MachineSet(src, dst, nil) +} + +func (src *MachineSetList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.MachineSetList) + return Convert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList(src, dst, nil) +} + +func (dst *MachineSetList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.MachineSetList) + return autoConvert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList(src, dst, nil) +} + +func (src *MachineDeployment) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.MachineDeployment) + return Convert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment(src, dst, nil) +} + +func (dst *MachineDeployment) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.MachineDeployment) + return autoConvert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment(src, dst, nil) +} + +func (src *MachineDeploymentList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.MachineDeploymentList) + return Convert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList(src, dst, nil) +} + +func (dst *MachineDeploymentList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.MachineDeploymentList) + return autoConvert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(src, dst, nil) +} + +func (src *MachineHealthCheck) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.MachineHealthCheck) + return Convert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck(src, dst, nil) +} + +func (dst *MachineHealthCheck) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.MachineHealthCheck) + return autoConvert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(src, dst, nil) +} + +func (src *MachineHealthCheckList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.MachineHealthCheckList) + return Convert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(src, dst, nil) +} + +func (dst *MachineHealthCheckList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.MachineHealthCheckList) + return autoConvert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(src, dst, nil) +} diff --git a/api/v1alpha4/conversion_test.go b/api/v1alpha4/conversion_test.go new file mode 100644 index 000000000000..9333d6dd9727 --- /dev/null +++ b/api/v1alpha4/conversion_test.go @@ -0,0 +1,51 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha4 + +import ( + "testing" + + "sigs.k8s.io/cluster-api/api/v1beta1" + utilconversion "sigs.k8s.io/cluster-api/util/conversion" +) + +func TestFuzzyConversion(t *testing.T) { + t.Run("for Cluster", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Hub: &v1beta1.Cluster{}, + Spoke: &Cluster{}, + })) + + t.Run("for Machine", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Hub: &v1beta1.Machine{}, + Spoke: &Machine{}, + })) + + t.Run("for MachineSet", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Hub: &v1beta1.MachineSet{}, + Spoke: &MachineSet{}, + })) + + t.Run("for MachineDeployment", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Hub: &v1beta1.MachineDeployment{}, + Spoke: &MachineDeployment{}, + })) + + t.Run("for MachineHealthCheckSpec", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Hub: &v1beta1.MachineHealthCheck{}, + Spoke: &MachineHealthCheck{}, + })) +} diff --git a/api/v1alpha4/doc.go b/api/v1alpha4/doc.go index b0efd4cde559..ae33ed13fc39 100644 --- a/api/v1alpha4/doc.go +++ b/api/v1alpha4/doc.go @@ -14,4 +14,5 @@ See the License for the specific language governing permissions and limitations under the License. */ +// +k8s:conversion-gen=sigs.k8s.io/cluster-api/api/v1beta1 package v1alpha4 diff --git a/api/v1alpha4/groupversion_info.go b/api/v1alpha4/groupversion_info.go index bc83bb32ee45..382657c78967 100644 --- a/api/v1alpha4/groupversion_info.go +++ b/api/v1alpha4/groupversion_info.go @@ -33,4 +33,6 @@ var ( // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme + + localSchemeBuilder = SchemeBuilder.SchemeBuilder ) diff --git a/api/v1alpha4/machine_types.go b/api/v1alpha4/machine_types.go index 0dab8b9117be..fad4b798e553 100644 --- a/api/v1alpha4/machine_types.go +++ b/api/v1alpha4/machine_types.go @@ -235,7 +235,6 @@ type Bootstrap struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=machines,shortName=ma,scope=Namespaced,categories=cluster-api // +kubebuilder:subresource:status -// +kubebuilder:storageversion // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Machine" // +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="Provider ID" diff --git a/api/v1alpha4/machinedeployment_types.go b/api/v1alpha4/machinedeployment_types.go index 3389aa0b26eb..b3eae32d8d0b 100644 --- a/api/v1alpha4/machinedeployment_types.go +++ b/api/v1alpha4/machinedeployment_types.go @@ -267,7 +267,6 @@ func (md *MachineDeploymentStatus) GetTypedPhase() MachineDeploymentPhase { // +kubebuilder:object:root=true // +kubebuilder:resource:path=machinedeployments,shortName=md,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" diff --git a/api/v1alpha4/machinehealthcheck_types.go b/api/v1alpha4/machinehealthcheck_types.go index 86158cfe8e9b..ba5a47a41368 100644 --- a/api/v1alpha4/machinehealthcheck_types.go +++ b/api/v1alpha4/machinehealthcheck_types.go @@ -126,7 +126,6 @@ type MachineHealthCheckStatus struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=machinehealthchecks,shortName=mhc;mhcs,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachineHealthCheck" diff --git a/api/v1alpha4/machineset_types.go b/api/v1alpha4/machineset_types.go index e043a5e1a2f4..b8f8f3d0a1d4 100644 --- a/api/v1alpha4/machineset_types.go +++ b/api/v1alpha4/machineset_types.go @@ -192,7 +192,6 @@ func (m *MachineSet) Validate() field.ErrorList { // +kubebuilder:object:root=true // +kubebuilder:resource:path=machinesets,shortName=ms,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" diff --git a/api/v1alpha4/zz_generated.conversion.go b/api/v1alpha4/zz_generated.conversion.go new file mode 100644 index 000000000000..3d58bfc2bf3f --- /dev/null +++ b/api/v1alpha4/zz_generated.conversion.go @@ -0,0 +1,1717 @@ +// +build !ignore_autogenerated_core_v1alpha4 + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by conversion-gen. DO NOT EDIT. + +package v1alpha4 + +import ( + unsafe "unsafe" + + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" + intstr "k8s.io/apimachinery/pkg/util/intstr" + v1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" + errors "sigs.k8s.io/cluster-api/errors" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*APIEndpoint)(nil), (*v1beta1.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(a.(*APIEndpoint), b.(*v1beta1.APIEndpoint), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.APIEndpoint)(nil), (*APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(a.(*v1beta1.APIEndpoint), b.(*APIEndpoint), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Bootstrap)(nil), (*v1beta1.Bootstrap)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap(a.(*Bootstrap), b.(*v1beta1.Bootstrap), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.Bootstrap)(nil), (*Bootstrap)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap(a.(*v1beta1.Bootstrap), b.(*Bootstrap), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Cluster)(nil), (*v1beta1.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Cluster_To_v1beta1_Cluster(a.(*Cluster), b.(*v1beta1.Cluster), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.Cluster)(nil), (*Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Cluster_To_v1alpha4_Cluster(a.(*v1beta1.Cluster), b.(*Cluster), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClusterClass)(nil), (*v1beta1.ClusterClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass(a.(*ClusterClass), b.(*v1beta1.ClusterClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterClass)(nil), (*ClusterClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterClass_To_v1alpha4_ClusterClass(a.(*v1beta1.ClusterClass), b.(*ClusterClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClusterClassList)(nil), (*v1beta1.ClusterClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ClusterClassList_To_v1beta1_ClusterClassList(a.(*ClusterClassList), b.(*v1beta1.ClusterClassList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterClassList)(nil), (*ClusterClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterClassList_To_v1alpha4_ClusterClassList(a.(*v1beta1.ClusterClassList), b.(*ClusterClassList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClusterClassSpec)(nil), (*v1beta1.ClusterClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec(a.(*ClusterClassSpec), b.(*v1beta1.ClusterClassSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterClassSpec)(nil), (*ClusterClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterClassSpec_To_v1alpha4_ClusterClassSpec(a.(*v1beta1.ClusterClassSpec), b.(*ClusterClassSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClusterList)(nil), (*v1beta1.ClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ClusterList_To_v1beta1_ClusterList(a.(*ClusterList), b.(*v1beta1.ClusterList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterList)(nil), (*ClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterList_To_v1alpha4_ClusterList(a.(*v1beta1.ClusterList), b.(*ClusterList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClusterNetwork)(nil), (*v1beta1.ClusterNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ClusterNetwork_To_v1beta1_ClusterNetwork(a.(*ClusterNetwork), b.(*v1beta1.ClusterNetwork), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterNetwork)(nil), (*ClusterNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterNetwork_To_v1alpha4_ClusterNetwork(a.(*v1beta1.ClusterNetwork), b.(*ClusterNetwork), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClusterSpec)(nil), (*v1beta1.ClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec(a.(*ClusterSpec), b.(*v1beta1.ClusterSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterSpec)(nil), (*ClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec(a.(*v1beta1.ClusterSpec), b.(*ClusterSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClusterStatus)(nil), (*v1beta1.ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(a.(*ClusterStatus), b.(*v1beta1.ClusterStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterStatus)(nil), (*ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(a.(*v1beta1.ClusterStatus), b.(*ClusterStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Condition)(nil), (*v1beta1.Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Condition_To_v1beta1_Condition(a.(*Condition), b.(*v1beta1.Condition), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.Condition)(nil), (*Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Condition_To_v1alpha4_Condition(a.(*v1beta1.Condition), b.(*Condition), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ControlPlaneClass)(nil), (*v1beta1.ControlPlaneClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass(a.(*ControlPlaneClass), b.(*v1beta1.ControlPlaneClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ControlPlaneClass)(nil), (*ControlPlaneClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ControlPlaneClass_To_v1alpha4_ControlPlaneClass(a.(*v1beta1.ControlPlaneClass), b.(*ControlPlaneClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ControlPlaneTopology)(nil), (*v1beta1.ControlPlaneTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(a.(*ControlPlaneTopology), b.(*v1beta1.ControlPlaneTopology), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ControlPlaneTopology)(nil), (*ControlPlaneTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ControlPlaneTopology_To_v1alpha4_ControlPlaneTopology(a.(*v1beta1.ControlPlaneTopology), b.(*ControlPlaneTopology), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*FailureDomainSpec)(nil), (*v1beta1.FailureDomainSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec(a.(*FailureDomainSpec), b.(*v1beta1.FailureDomainSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.FailureDomainSpec)(nil), (*FailureDomainSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(a.(*v1beta1.FailureDomainSpec), b.(*FailureDomainSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*LocalObjectTemplate)(nil), (*v1beta1.LocalObjectTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(a.(*LocalObjectTemplate), b.(*v1beta1.LocalObjectTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.LocalObjectTemplate)(nil), (*LocalObjectTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(a.(*v1beta1.LocalObjectTemplate), b.(*LocalObjectTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Machine)(nil), (*v1beta1.Machine)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Machine_To_v1beta1_Machine(a.(*Machine), b.(*v1beta1.Machine), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.Machine)(nil), (*Machine)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Machine_To_v1alpha4_Machine(a.(*v1beta1.Machine), b.(*Machine), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineAddress)(nil), (*v1beta1.MachineAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineAddress_To_v1beta1_MachineAddress(a.(*MachineAddress), b.(*v1beta1.MachineAddress), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineAddress)(nil), (*MachineAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineAddress_To_v1alpha4_MachineAddress(a.(*v1beta1.MachineAddress), b.(*MachineAddress), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineDeployment)(nil), (*v1beta1.MachineDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment(a.(*MachineDeployment), b.(*v1beta1.MachineDeployment), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeployment)(nil), (*MachineDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment(a.(*v1beta1.MachineDeployment), b.(*MachineDeployment), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineDeploymentClass)(nil), (*v1beta1.MachineDeploymentClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(a.(*MachineDeploymentClass), b.(*v1beta1.MachineDeploymentClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentClass)(nil), (*MachineDeploymentClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeploymentClass_To_v1alpha4_MachineDeploymentClass(a.(*v1beta1.MachineDeploymentClass), b.(*MachineDeploymentClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineDeploymentClassTemplate)(nil), (*v1beta1.MachineDeploymentClassTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate(a.(*MachineDeploymentClassTemplate), b.(*v1beta1.MachineDeploymentClassTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentClassTemplate)(nil), (*MachineDeploymentClassTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate(a.(*v1beta1.MachineDeploymentClassTemplate), b.(*MachineDeploymentClassTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineDeploymentList)(nil), (*v1beta1.MachineDeploymentList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList(a.(*MachineDeploymentList), b.(*v1beta1.MachineDeploymentList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentList)(nil), (*MachineDeploymentList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(a.(*v1beta1.MachineDeploymentList), b.(*MachineDeploymentList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineDeploymentSpec)(nil), (*v1beta1.MachineDeploymentSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(a.(*MachineDeploymentSpec), b.(*v1beta1.MachineDeploymentSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentSpec)(nil), (*MachineDeploymentSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(a.(*v1beta1.MachineDeploymentSpec), b.(*MachineDeploymentSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineDeploymentStatus)(nil), (*v1beta1.MachineDeploymentStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(a.(*MachineDeploymentStatus), b.(*v1beta1.MachineDeploymentStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentStatus)(nil), (*MachineDeploymentStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(a.(*v1beta1.MachineDeploymentStatus), b.(*MachineDeploymentStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineDeploymentStrategy)(nil), (*v1beta1.MachineDeploymentStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy(a.(*MachineDeploymentStrategy), b.(*v1beta1.MachineDeploymentStrategy), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentStrategy)(nil), (*MachineDeploymentStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy(a.(*v1beta1.MachineDeploymentStrategy), b.(*MachineDeploymentStrategy), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineDeploymentTopology)(nil), (*v1beta1.MachineDeploymentTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(a.(*MachineDeploymentTopology), b.(*v1beta1.MachineDeploymentTopology), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentTopology)(nil), (*MachineDeploymentTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeploymentTopology_To_v1alpha4_MachineDeploymentTopology(a.(*v1beta1.MachineDeploymentTopology), b.(*MachineDeploymentTopology), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineHealthCheck)(nil), (*v1beta1.MachineHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck(a.(*MachineHealthCheck), b.(*v1beta1.MachineHealthCheck), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineHealthCheck)(nil), (*MachineHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(a.(*v1beta1.MachineHealthCheck), b.(*MachineHealthCheck), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineHealthCheckList)(nil), (*v1beta1.MachineHealthCheckList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(a.(*MachineHealthCheckList), b.(*v1beta1.MachineHealthCheckList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineHealthCheckList)(nil), (*MachineHealthCheckList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(a.(*v1beta1.MachineHealthCheckList), b.(*MachineHealthCheckList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineHealthCheckSpec)(nil), (*v1beta1.MachineHealthCheckSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(a.(*MachineHealthCheckSpec), b.(*v1beta1.MachineHealthCheckSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineHealthCheckSpec)(nil), (*MachineHealthCheckSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(a.(*v1beta1.MachineHealthCheckSpec), b.(*MachineHealthCheckSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineHealthCheckStatus)(nil), (*v1beta1.MachineHealthCheckStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(a.(*MachineHealthCheckStatus), b.(*v1beta1.MachineHealthCheckStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineHealthCheckStatus)(nil), (*MachineHealthCheckStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(a.(*v1beta1.MachineHealthCheckStatus), b.(*MachineHealthCheckStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineList)(nil), (*v1beta1.MachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineList_To_v1beta1_MachineList(a.(*MachineList), b.(*v1beta1.MachineList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineList)(nil), (*MachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineList_To_v1alpha4_MachineList(a.(*v1beta1.MachineList), b.(*MachineList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineRollingUpdateDeployment)(nil), (*v1beta1.MachineRollingUpdateDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(a.(*MachineRollingUpdateDeployment), b.(*v1beta1.MachineRollingUpdateDeployment), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineRollingUpdateDeployment)(nil), (*MachineRollingUpdateDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(a.(*v1beta1.MachineRollingUpdateDeployment), b.(*MachineRollingUpdateDeployment), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineSet)(nil), (*v1beta1.MachineSet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineSet_To_v1beta1_MachineSet(a.(*MachineSet), b.(*v1beta1.MachineSet), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSet)(nil), (*MachineSet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineSet_To_v1alpha4_MachineSet(a.(*v1beta1.MachineSet), b.(*MachineSet), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineSetList)(nil), (*v1beta1.MachineSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList(a.(*MachineSetList), b.(*v1beta1.MachineSetList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSetList)(nil), (*MachineSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList(a.(*v1beta1.MachineSetList), b.(*MachineSetList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineSetSpec)(nil), (*v1beta1.MachineSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec(a.(*MachineSetSpec), b.(*v1beta1.MachineSetSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSetSpec)(nil), (*MachineSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec(a.(*v1beta1.MachineSetSpec), b.(*MachineSetSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineSetStatus)(nil), (*v1beta1.MachineSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus(a.(*MachineSetStatus), b.(*v1beta1.MachineSetStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSetStatus)(nil), (*MachineSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus(a.(*v1beta1.MachineSetStatus), b.(*MachineSetStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineSpec)(nil), (*v1beta1.MachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec(a.(*MachineSpec), b.(*v1beta1.MachineSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSpec)(nil), (*MachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec(a.(*v1beta1.MachineSpec), b.(*MachineSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineStatus)(nil), (*v1beta1.MachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineStatus_To_v1beta1_MachineStatus(a.(*MachineStatus), b.(*v1beta1.MachineStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineStatus)(nil), (*MachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineStatus_To_v1alpha4_MachineStatus(a.(*v1beta1.MachineStatus), b.(*MachineStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineTemplateSpec)(nil), (*v1beta1.MachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(a.(*MachineTemplateSpec), b.(*v1beta1.MachineTemplateSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachineTemplateSpec)(nil), (*MachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(a.(*v1beta1.MachineTemplateSpec), b.(*MachineTemplateSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*NetworkRanges)(nil), (*v1beta1.NetworkRanges)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_NetworkRanges_To_v1beta1_NetworkRanges(a.(*NetworkRanges), b.(*v1beta1.NetworkRanges), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.NetworkRanges)(nil), (*NetworkRanges)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_NetworkRanges_To_v1alpha4_NetworkRanges(a.(*v1beta1.NetworkRanges), b.(*NetworkRanges), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ObjectMeta)(nil), (*v1beta1.ObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(a.(*ObjectMeta), b.(*v1beta1.ObjectMeta), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ObjectMeta)(nil), (*ObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(a.(*v1beta1.ObjectMeta), b.(*ObjectMeta), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Topology)(nil), (*v1beta1.Topology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Topology_To_v1beta1_Topology(a.(*Topology), b.(*v1beta1.Topology), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.Topology)(nil), (*Topology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Topology_To_v1alpha4_Topology(a.(*v1beta1.Topology), b.(*Topology), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*UnhealthyCondition)(nil), (*v1beta1.UnhealthyCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_UnhealthyCondition_To_v1beta1_UnhealthyCondition(a.(*UnhealthyCondition), b.(*v1beta1.UnhealthyCondition), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.UnhealthyCondition)(nil), (*UnhealthyCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_UnhealthyCondition_To_v1alpha4_UnhealthyCondition(a.(*v1beta1.UnhealthyCondition), b.(*UnhealthyCondition), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*WorkersClass)(nil), (*v1beta1.WorkersClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass(a.(*WorkersClass), b.(*v1beta1.WorkersClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.WorkersClass)(nil), (*WorkersClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_WorkersClass_To_v1alpha4_WorkersClass(a.(*v1beta1.WorkersClass), b.(*WorkersClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*WorkersTopology)(nil), (*v1beta1.WorkersTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_WorkersTopology_To_v1beta1_WorkersTopology(a.(*WorkersTopology), b.(*v1beta1.WorkersTopology), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.WorkersTopology)(nil), (*WorkersTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_WorkersTopology_To_v1alpha4_WorkersTopology(a.(*v1beta1.WorkersTopology), b.(*WorkersTopology), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in *APIEndpoint, out *v1beta1.APIEndpoint, s conversion.Scope) error { + out.Host = in.Host + out.Port = in.Port + return nil +} + +// Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint is an autogenerated conversion function. +func Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in *APIEndpoint, out *v1beta1.APIEndpoint, s conversion.Scope) error { + return autoConvert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in, out, s) +} + +func autoConvert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in *v1beta1.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { + out.Host = in.Host + out.Port = in.Port + return nil +} + +// Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint is an autogenerated conversion function. +func Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in *v1beta1.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { + return autoConvert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in, out, s) +} + +func autoConvert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap(in *Bootstrap, out *v1beta1.Bootstrap, s conversion.Scope) error { + out.ConfigRef = (*v1.ObjectReference)(unsafe.Pointer(in.ConfigRef)) + out.DataSecretName = (*string)(unsafe.Pointer(in.DataSecretName)) + return nil +} + +// Convert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap is an autogenerated conversion function. +func Convert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap(in *Bootstrap, out *v1beta1.Bootstrap, s conversion.Scope) error { + return autoConvert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap(in, out, s) +} + +func autoConvert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap(in *v1beta1.Bootstrap, out *Bootstrap, s conversion.Scope) error { + out.ConfigRef = (*v1.ObjectReference)(unsafe.Pointer(in.ConfigRef)) + out.DataSecretName = (*string)(unsafe.Pointer(in.DataSecretName)) + return nil +} + +// Convert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap is an autogenerated conversion function. +func Convert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap(in *v1beta1.Bootstrap, out *Bootstrap, s conversion.Scope) error { + return autoConvert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap(in, out, s) +} + +func autoConvert_v1alpha4_Cluster_To_v1beta1_Cluster(in *Cluster, out *v1beta1.Cluster, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_Cluster_To_v1beta1_Cluster is an autogenerated conversion function. +func Convert_v1alpha4_Cluster_To_v1beta1_Cluster(in *Cluster, out *v1beta1.Cluster, s conversion.Scope) error { + return autoConvert_v1alpha4_Cluster_To_v1beta1_Cluster(in, out, s) +} + +func autoConvert_v1beta1_Cluster_To_v1alpha4_Cluster(in *v1beta1.Cluster, out *Cluster, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_Cluster_To_v1alpha4_Cluster is an autogenerated conversion function. +func Convert_v1beta1_Cluster_To_v1alpha4_Cluster(in *v1beta1.Cluster, out *Cluster, s conversion.Scope) error { + return autoConvert_v1beta1_Cluster_To_v1alpha4_Cluster(in, out, s) +} + +func autoConvert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass(in *ClusterClass, out *v1beta1.ClusterClass, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass is an autogenerated conversion function. +func Convert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass(in *ClusterClass, out *v1beta1.ClusterClass, s conversion.Scope) error { + return autoConvert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass(in, out, s) +} + +func autoConvert_v1beta1_ClusterClass_To_v1alpha4_ClusterClass(in *v1beta1.ClusterClass, out *ClusterClass, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_ClusterClassSpec_To_v1alpha4_ClusterClassSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_ClusterClass_To_v1alpha4_ClusterClass is an autogenerated conversion function. +func Convert_v1beta1_ClusterClass_To_v1alpha4_ClusterClass(in *v1beta1.ClusterClass, out *ClusterClass, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterClass_To_v1alpha4_ClusterClass(in, out, s) +} + +func autoConvert_v1alpha4_ClusterClassList_To_v1beta1_ClusterClassList(in *ClusterClassList, out *v1beta1.ClusterClassList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1beta1.ClusterClass)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha4_ClusterClassList_To_v1beta1_ClusterClassList is an autogenerated conversion function. +func Convert_v1alpha4_ClusterClassList_To_v1beta1_ClusterClassList(in *ClusterClassList, out *v1beta1.ClusterClassList, s conversion.Scope) error { + return autoConvert_v1alpha4_ClusterClassList_To_v1beta1_ClusterClassList(in, out, s) +} + +func autoConvert_v1beta1_ClusterClassList_To_v1alpha4_ClusterClassList(in *v1beta1.ClusterClassList, out *ClusterClassList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]ClusterClass)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1beta1_ClusterClassList_To_v1alpha4_ClusterClassList is an autogenerated conversion function. +func Convert_v1beta1_ClusterClassList_To_v1alpha4_ClusterClassList(in *v1beta1.ClusterClassList, out *ClusterClassList, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterClassList_To_v1alpha4_ClusterClassList(in, out, s) +} + +func autoConvert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec(in *ClusterClassSpec, out *v1beta1.ClusterClassSpec, s conversion.Scope) error { + if err := Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(&in.Infrastructure, &out.Infrastructure, s); err != nil { + return err + } + if err := Convert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass(&in.ControlPlane, &out.ControlPlane, s); err != nil { + return err + } + if err := Convert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass(&in.Workers, &out.Workers, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec is an autogenerated conversion function. +func Convert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec(in *ClusterClassSpec, out *v1beta1.ClusterClassSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec(in, out, s) +} + +func autoConvert_v1beta1_ClusterClassSpec_To_v1alpha4_ClusterClassSpec(in *v1beta1.ClusterClassSpec, out *ClusterClassSpec, s conversion.Scope) error { + if err := Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(&in.Infrastructure, &out.Infrastructure, s); err != nil { + return err + } + if err := Convert_v1beta1_ControlPlaneClass_To_v1alpha4_ControlPlaneClass(&in.ControlPlane, &out.ControlPlane, s); err != nil { + return err + } + if err := Convert_v1beta1_WorkersClass_To_v1alpha4_WorkersClass(&in.Workers, &out.Workers, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_ClusterClassSpec_To_v1alpha4_ClusterClassSpec is an autogenerated conversion function. +func Convert_v1beta1_ClusterClassSpec_To_v1alpha4_ClusterClassSpec(in *v1beta1.ClusterClassSpec, out *ClusterClassSpec, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterClassSpec_To_v1alpha4_ClusterClassSpec(in, out, s) +} + +func autoConvert_v1alpha4_ClusterList_To_v1beta1_ClusterList(in *ClusterList, out *v1beta1.ClusterList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1beta1.Cluster)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha4_ClusterList_To_v1beta1_ClusterList is an autogenerated conversion function. +func Convert_v1alpha4_ClusterList_To_v1beta1_ClusterList(in *ClusterList, out *v1beta1.ClusterList, s conversion.Scope) error { + return autoConvert_v1alpha4_ClusterList_To_v1beta1_ClusterList(in, out, s) +} + +func autoConvert_v1beta1_ClusterList_To_v1alpha4_ClusterList(in *v1beta1.ClusterList, out *ClusterList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]Cluster)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1beta1_ClusterList_To_v1alpha4_ClusterList is an autogenerated conversion function. +func Convert_v1beta1_ClusterList_To_v1alpha4_ClusterList(in *v1beta1.ClusterList, out *ClusterList, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterList_To_v1alpha4_ClusterList(in, out, s) +} + +func autoConvert_v1alpha4_ClusterNetwork_To_v1beta1_ClusterNetwork(in *ClusterNetwork, out *v1beta1.ClusterNetwork, s conversion.Scope) error { + out.APIServerPort = (*int32)(unsafe.Pointer(in.APIServerPort)) + out.Services = (*v1beta1.NetworkRanges)(unsafe.Pointer(in.Services)) + out.Pods = (*v1beta1.NetworkRanges)(unsafe.Pointer(in.Pods)) + out.ServiceDomain = in.ServiceDomain + return nil +} + +// Convert_v1alpha4_ClusterNetwork_To_v1beta1_ClusterNetwork is an autogenerated conversion function. +func Convert_v1alpha4_ClusterNetwork_To_v1beta1_ClusterNetwork(in *ClusterNetwork, out *v1beta1.ClusterNetwork, s conversion.Scope) error { + return autoConvert_v1alpha4_ClusterNetwork_To_v1beta1_ClusterNetwork(in, out, s) +} + +func autoConvert_v1beta1_ClusterNetwork_To_v1alpha4_ClusterNetwork(in *v1beta1.ClusterNetwork, out *ClusterNetwork, s conversion.Scope) error { + out.APIServerPort = (*int32)(unsafe.Pointer(in.APIServerPort)) + out.Services = (*NetworkRanges)(unsafe.Pointer(in.Services)) + out.Pods = (*NetworkRanges)(unsafe.Pointer(in.Pods)) + out.ServiceDomain = in.ServiceDomain + return nil +} + +// Convert_v1beta1_ClusterNetwork_To_v1alpha4_ClusterNetwork is an autogenerated conversion function. +func Convert_v1beta1_ClusterNetwork_To_v1alpha4_ClusterNetwork(in *v1beta1.ClusterNetwork, out *ClusterNetwork, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterNetwork_To_v1alpha4_ClusterNetwork(in, out, s) +} + +func autoConvert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec(in *ClusterSpec, out *v1beta1.ClusterSpec, s conversion.Scope) error { + out.Paused = in.Paused + out.ClusterNetwork = (*v1beta1.ClusterNetwork)(unsafe.Pointer(in.ClusterNetwork)) + if err := Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + out.ControlPlaneRef = (*v1.ObjectReference)(unsafe.Pointer(in.ControlPlaneRef)) + out.InfrastructureRef = (*v1.ObjectReference)(unsafe.Pointer(in.InfrastructureRef)) + out.Topology = (*v1beta1.Topology)(unsafe.Pointer(in.Topology)) + return nil +} + +// Convert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec is an autogenerated conversion function. +func Convert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec(in *ClusterSpec, out *v1beta1.ClusterSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec(in, out, s) +} + +func autoConvert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec(in *v1beta1.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { + out.Paused = in.Paused + out.ClusterNetwork = (*ClusterNetwork)(unsafe.Pointer(in.ClusterNetwork)) + if err := Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + out.ControlPlaneRef = (*v1.ObjectReference)(unsafe.Pointer(in.ControlPlaneRef)) + out.InfrastructureRef = (*v1.ObjectReference)(unsafe.Pointer(in.InfrastructureRef)) + out.Topology = (*Topology)(unsafe.Pointer(in.Topology)) + return nil +} + +// Convert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec is an autogenerated conversion function. +func Convert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec(in *v1beta1.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec(in, out, s) +} + +func autoConvert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(in *ClusterStatus, out *v1beta1.ClusterStatus, s conversion.Scope) error { + out.FailureDomains = *(*v1beta1.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) + out.FailureReason = (*errors.ClusterStatusError)(unsafe.Pointer(in.FailureReason)) + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + out.Phase = in.Phase + out.InfrastructureReady = in.InfrastructureReady + out.ControlPlaneReady = in.ControlPlaneReady + out.Conditions = *(*v1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) + out.ObservedGeneration = in.ObservedGeneration + return nil +} + +// Convert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus is an autogenerated conversion function. +func Convert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(in *ClusterStatus, out *v1beta1.ClusterStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(in, out, s) +} + +func autoConvert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(in *v1beta1.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { + out.FailureDomains = *(*FailureDomains)(unsafe.Pointer(&in.FailureDomains)) + out.FailureReason = (*errors.ClusterStatusError)(unsafe.Pointer(in.FailureReason)) + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + out.Phase = in.Phase + out.InfrastructureReady = in.InfrastructureReady + out.ControlPlaneReady = in.ControlPlaneReady + out.Conditions = *(*Conditions)(unsafe.Pointer(&in.Conditions)) + out.ObservedGeneration = in.ObservedGeneration + return nil +} + +// Convert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus is an autogenerated conversion function. +func Convert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(in *v1beta1.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(in, out, s) +} + +func autoConvert_v1alpha4_Condition_To_v1beta1_Condition(in *Condition, out *v1beta1.Condition, s conversion.Scope) error { + out.Type = v1beta1.ConditionType(in.Type) + out.Status = v1.ConditionStatus(in.Status) + out.Severity = v1beta1.ConditionSeverity(in.Severity) + out.LastTransitionTime = in.LastTransitionTime + out.Reason = in.Reason + out.Message = in.Message + return nil +} + +// Convert_v1alpha4_Condition_To_v1beta1_Condition is an autogenerated conversion function. +func Convert_v1alpha4_Condition_To_v1beta1_Condition(in *Condition, out *v1beta1.Condition, s conversion.Scope) error { + return autoConvert_v1alpha4_Condition_To_v1beta1_Condition(in, out, s) +} + +func autoConvert_v1beta1_Condition_To_v1alpha4_Condition(in *v1beta1.Condition, out *Condition, s conversion.Scope) error { + out.Type = ConditionType(in.Type) + out.Status = v1.ConditionStatus(in.Status) + out.Severity = ConditionSeverity(in.Severity) + out.LastTransitionTime = in.LastTransitionTime + out.Reason = in.Reason + out.Message = in.Message + return nil +} + +// Convert_v1beta1_Condition_To_v1alpha4_Condition is an autogenerated conversion function. +func Convert_v1beta1_Condition_To_v1alpha4_Condition(in *v1beta1.Condition, out *Condition, s conversion.Scope) error { + return autoConvert_v1beta1_Condition_To_v1alpha4_Condition(in, out, s) +} + +func autoConvert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass(in *ControlPlaneClass, out *v1beta1.ControlPlaneClass, s conversion.Scope) error { + if err := Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { + return err + } + if err := Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(&in.LocalObjectTemplate, &out.LocalObjectTemplate, s); err != nil { + return err + } + out.MachineInfrastructure = (*v1beta1.LocalObjectTemplate)(unsafe.Pointer(in.MachineInfrastructure)) + return nil +} + +// Convert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass is an autogenerated conversion function. +func Convert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass(in *ControlPlaneClass, out *v1beta1.ControlPlaneClass, s conversion.Scope) error { + return autoConvert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass(in, out, s) +} + +func autoConvert_v1beta1_ControlPlaneClass_To_v1alpha4_ControlPlaneClass(in *v1beta1.ControlPlaneClass, out *ControlPlaneClass, s conversion.Scope) error { + if err := Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { + return err + } + if err := Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(&in.LocalObjectTemplate, &out.LocalObjectTemplate, s); err != nil { + return err + } + out.MachineInfrastructure = (*LocalObjectTemplate)(unsafe.Pointer(in.MachineInfrastructure)) + return nil +} + +// Convert_v1beta1_ControlPlaneClass_To_v1alpha4_ControlPlaneClass is an autogenerated conversion function. +func Convert_v1beta1_ControlPlaneClass_To_v1alpha4_ControlPlaneClass(in *v1beta1.ControlPlaneClass, out *ControlPlaneClass, s conversion.Scope) error { + return autoConvert_v1beta1_ControlPlaneClass_To_v1alpha4_ControlPlaneClass(in, out, s) +} + +func autoConvert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(in *ControlPlaneTopology, out *v1beta1.ControlPlaneTopology, s conversion.Scope) error { + if err := Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { + return err + } + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + return nil +} + +// Convert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology is an autogenerated conversion function. +func Convert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(in *ControlPlaneTopology, out *v1beta1.ControlPlaneTopology, s conversion.Scope) error { + return autoConvert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(in, out, s) +} + +func autoConvert_v1beta1_ControlPlaneTopology_To_v1alpha4_ControlPlaneTopology(in *v1beta1.ControlPlaneTopology, out *ControlPlaneTopology, s conversion.Scope) error { + if err := Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { + return err + } + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + return nil +} + +// Convert_v1beta1_ControlPlaneTopology_To_v1alpha4_ControlPlaneTopology is an autogenerated conversion function. +func Convert_v1beta1_ControlPlaneTopology_To_v1alpha4_ControlPlaneTopology(in *v1beta1.ControlPlaneTopology, out *ControlPlaneTopology, s conversion.Scope) error { + return autoConvert_v1beta1_ControlPlaneTopology_To_v1alpha4_ControlPlaneTopology(in, out, s) +} + +func autoConvert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec(in *FailureDomainSpec, out *v1beta1.FailureDomainSpec, s conversion.Scope) error { + out.ControlPlane = in.ControlPlane + out.Attributes = *(*map[string]string)(unsafe.Pointer(&in.Attributes)) + return nil +} + +// Convert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec is an autogenerated conversion function. +func Convert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec(in *FailureDomainSpec, out *v1beta1.FailureDomainSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec(in, out, s) +} + +func autoConvert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(in *v1beta1.FailureDomainSpec, out *FailureDomainSpec, s conversion.Scope) error { + out.ControlPlane = in.ControlPlane + out.Attributes = *(*map[string]string)(unsafe.Pointer(&in.Attributes)) + return nil +} + +// Convert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec is an autogenerated conversion function. +func Convert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(in *v1beta1.FailureDomainSpec, out *FailureDomainSpec, s conversion.Scope) error { + return autoConvert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(in, out, s) +} + +func autoConvert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(in *LocalObjectTemplate, out *v1beta1.LocalObjectTemplate, s conversion.Scope) error { + out.Ref = (*v1.ObjectReference)(unsafe.Pointer(in.Ref)) + return nil +} + +// Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate is an autogenerated conversion function. +func Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(in *LocalObjectTemplate, out *v1beta1.LocalObjectTemplate, s conversion.Scope) error { + return autoConvert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(in, out, s) +} + +func autoConvert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(in *v1beta1.LocalObjectTemplate, out *LocalObjectTemplate, s conversion.Scope) error { + out.Ref = (*v1.ObjectReference)(unsafe.Pointer(in.Ref)) + return nil +} + +// Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate is an autogenerated conversion function. +func Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(in *v1beta1.LocalObjectTemplate, out *LocalObjectTemplate, s conversion.Scope) error { + return autoConvert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(in, out, s) +} + +func autoConvert_v1alpha4_Machine_To_v1beta1_Machine(in *Machine, out *v1beta1.Machine, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_MachineStatus_To_v1beta1_MachineStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_Machine_To_v1beta1_Machine is an autogenerated conversion function. +func Convert_v1alpha4_Machine_To_v1beta1_Machine(in *Machine, out *v1beta1.Machine, s conversion.Scope) error { + return autoConvert_v1alpha4_Machine_To_v1beta1_Machine(in, out, s) +} + +func autoConvert_v1beta1_Machine_To_v1alpha4_Machine(in *v1beta1.Machine, out *Machine, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_MachineStatus_To_v1alpha4_MachineStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_Machine_To_v1alpha4_Machine is an autogenerated conversion function. +func Convert_v1beta1_Machine_To_v1alpha4_Machine(in *v1beta1.Machine, out *Machine, s conversion.Scope) error { + return autoConvert_v1beta1_Machine_To_v1alpha4_Machine(in, out, s) +} + +func autoConvert_v1alpha4_MachineAddress_To_v1beta1_MachineAddress(in *MachineAddress, out *v1beta1.MachineAddress, s conversion.Scope) error { + out.Type = v1beta1.MachineAddressType(in.Type) + out.Address = in.Address + return nil +} + +// Convert_v1alpha4_MachineAddress_To_v1beta1_MachineAddress is an autogenerated conversion function. +func Convert_v1alpha4_MachineAddress_To_v1beta1_MachineAddress(in *MachineAddress, out *v1beta1.MachineAddress, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineAddress_To_v1beta1_MachineAddress(in, out, s) +} + +func autoConvert_v1beta1_MachineAddress_To_v1alpha4_MachineAddress(in *v1beta1.MachineAddress, out *MachineAddress, s conversion.Scope) error { + out.Type = MachineAddressType(in.Type) + out.Address = in.Address + return nil +} + +// Convert_v1beta1_MachineAddress_To_v1alpha4_MachineAddress is an autogenerated conversion function. +func Convert_v1beta1_MachineAddress_To_v1alpha4_MachineAddress(in *v1beta1.MachineAddress, out *MachineAddress, s conversion.Scope) error { + return autoConvert_v1beta1_MachineAddress_To_v1alpha4_MachineAddress(in, out, s) +} + +func autoConvert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment(in *MachineDeployment, out *v1beta1.MachineDeployment, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment is an autogenerated conversion function. +func Convert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment(in *MachineDeployment, out *v1beta1.MachineDeployment, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment(in, out, s) +} + +func autoConvert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment(in *v1beta1.MachineDeployment, out *MachineDeployment, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment is an autogenerated conversion function. +func Convert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment(in *v1beta1.MachineDeployment, out *MachineDeployment, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment(in, out, s) +} + +func autoConvert_v1alpha4_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(in *MachineDeploymentClass, out *v1beta1.MachineDeploymentClass, s conversion.Scope) error { + out.Class = in.Class + if err := Convert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate(&in.Template, &out.Template, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass is an autogenerated conversion function. +func Convert_v1alpha4_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(in *MachineDeploymentClass, out *v1beta1.MachineDeploymentClass, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(in, out, s) +} + +func autoConvert_v1beta1_MachineDeploymentClass_To_v1alpha4_MachineDeploymentClass(in *v1beta1.MachineDeploymentClass, out *MachineDeploymentClass, s conversion.Scope) error { + out.Class = in.Class + if err := Convert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate(&in.Template, &out.Template, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_MachineDeploymentClass_To_v1alpha4_MachineDeploymentClass is an autogenerated conversion function. +func Convert_v1beta1_MachineDeploymentClass_To_v1alpha4_MachineDeploymentClass(in *v1beta1.MachineDeploymentClass, out *MachineDeploymentClass, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDeploymentClass_To_v1alpha4_MachineDeploymentClass(in, out, s) +} + +func autoConvert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate(in *MachineDeploymentClassTemplate, out *v1beta1.MachineDeploymentClassTemplate, s conversion.Scope) error { + if err := Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { + return err + } + if err := Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(&in.Bootstrap, &out.Bootstrap, s); err != nil { + return err + } + if err := Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(&in.Infrastructure, &out.Infrastructure, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate is an autogenerated conversion function. +func Convert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate(in *MachineDeploymentClassTemplate, out *v1beta1.MachineDeploymentClassTemplate, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate(in, out, s) +} + +func autoConvert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate(in *v1beta1.MachineDeploymentClassTemplate, out *MachineDeploymentClassTemplate, s conversion.Scope) error { + if err := Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { + return err + } + if err := Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(&in.Bootstrap, &out.Bootstrap, s); err != nil { + return err + } + if err := Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(&in.Infrastructure, &out.Infrastructure, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate is an autogenerated conversion function. +func Convert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate(in *v1beta1.MachineDeploymentClassTemplate, out *MachineDeploymentClassTemplate, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate(in, out, s) +} + +func autoConvert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList(in *MachineDeploymentList, out *v1beta1.MachineDeploymentList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1beta1.MachineDeployment)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList is an autogenerated conversion function. +func Convert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList(in *MachineDeploymentList, out *v1beta1.MachineDeploymentList, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList(in, out, s) +} + +func autoConvert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(in *v1beta1.MachineDeploymentList, out *MachineDeploymentList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]MachineDeployment)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList is an autogenerated conversion function. +func Convert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(in *v1beta1.MachineDeploymentList, out *MachineDeploymentList, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(in, out, s) +} + +func autoConvert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(in *MachineDeploymentSpec, out *v1beta1.MachineDeploymentSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + out.Selector = in.Selector + if err := Convert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { + return err + } + out.Strategy = (*v1beta1.MachineDeploymentStrategy)(unsafe.Pointer(in.Strategy)) + out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) + out.RevisionHistoryLimit = (*int32)(unsafe.Pointer(in.RevisionHistoryLimit)) + out.Paused = in.Paused + out.ProgressDeadlineSeconds = (*int32)(unsafe.Pointer(in.ProgressDeadlineSeconds)) + return nil +} + +// Convert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec is an autogenerated conversion function. +func Convert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(in *MachineDeploymentSpec, out *v1beta1.MachineDeploymentSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(in, out, s) +} + +func autoConvert_v1beta1_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(in *v1beta1.MachineDeploymentSpec, out *MachineDeploymentSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + out.Selector = in.Selector + if err := Convert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { + return err + } + out.Strategy = (*MachineDeploymentStrategy)(unsafe.Pointer(in.Strategy)) + out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) + out.RevisionHistoryLimit = (*int32)(unsafe.Pointer(in.RevisionHistoryLimit)) + out.Paused = in.Paused + out.ProgressDeadlineSeconds = (*int32)(unsafe.Pointer(in.ProgressDeadlineSeconds)) + return nil +} + +// Convert_v1beta1_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec is an autogenerated conversion function. +func Convert_v1beta1_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(in *v1beta1.MachineDeploymentSpec, out *MachineDeploymentSpec, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(in, out, s) +} + +func autoConvert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(in *MachineDeploymentStatus, out *v1beta1.MachineDeploymentStatus, s conversion.Scope) error { + out.ObservedGeneration = in.ObservedGeneration + out.Selector = in.Selector + out.Replicas = in.Replicas + out.UpdatedReplicas = in.UpdatedReplicas + out.ReadyReplicas = in.ReadyReplicas + out.AvailableReplicas = in.AvailableReplicas + out.UnavailableReplicas = in.UnavailableReplicas + out.Phase = in.Phase + out.Conditions = *(*v1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) + return nil +} + +// Convert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus is an autogenerated conversion function. +func Convert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(in *MachineDeploymentStatus, out *v1beta1.MachineDeploymentStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(in, out, s) +} + +func autoConvert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(in *v1beta1.MachineDeploymentStatus, out *MachineDeploymentStatus, s conversion.Scope) error { + out.ObservedGeneration = in.ObservedGeneration + out.Selector = in.Selector + out.Replicas = in.Replicas + out.UpdatedReplicas = in.UpdatedReplicas + out.ReadyReplicas = in.ReadyReplicas + out.AvailableReplicas = in.AvailableReplicas + out.UnavailableReplicas = in.UnavailableReplicas + out.Phase = in.Phase + out.Conditions = *(*Conditions)(unsafe.Pointer(&in.Conditions)) + return nil +} + +// Convert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus is an autogenerated conversion function. +func Convert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(in *v1beta1.MachineDeploymentStatus, out *MachineDeploymentStatus, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(in, out, s) +} + +func autoConvert_v1alpha4_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy(in *MachineDeploymentStrategy, out *v1beta1.MachineDeploymentStrategy, s conversion.Scope) error { + out.Type = v1beta1.MachineDeploymentStrategyType(in.Type) + out.RollingUpdate = (*v1beta1.MachineRollingUpdateDeployment)(unsafe.Pointer(in.RollingUpdate)) + return nil +} + +// Convert_v1alpha4_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy is an autogenerated conversion function. +func Convert_v1alpha4_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy(in *MachineDeploymentStrategy, out *v1beta1.MachineDeploymentStrategy, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy(in, out, s) +} + +func autoConvert_v1beta1_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy(in *v1beta1.MachineDeploymentStrategy, out *MachineDeploymentStrategy, s conversion.Scope) error { + out.Type = MachineDeploymentStrategyType(in.Type) + out.RollingUpdate = (*MachineRollingUpdateDeployment)(unsafe.Pointer(in.RollingUpdate)) + return nil +} + +// Convert_v1beta1_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy is an autogenerated conversion function. +func Convert_v1beta1_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy(in *v1beta1.MachineDeploymentStrategy, out *MachineDeploymentStrategy, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy(in, out, s) +} + +func autoConvert_v1alpha4_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(in *MachineDeploymentTopology, out *v1beta1.MachineDeploymentTopology, s conversion.Scope) error { + if err := Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { + return err + } + out.Class = in.Class + out.Name = in.Name + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + return nil +} + +// Convert_v1alpha4_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology is an autogenerated conversion function. +func Convert_v1alpha4_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(in *MachineDeploymentTopology, out *v1beta1.MachineDeploymentTopology, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(in, out, s) +} + +func autoConvert_v1beta1_MachineDeploymentTopology_To_v1alpha4_MachineDeploymentTopology(in *v1beta1.MachineDeploymentTopology, out *MachineDeploymentTopology, s conversion.Scope) error { + if err := Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { + return err + } + out.Class = in.Class + out.Name = in.Name + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + return nil +} + +// Convert_v1beta1_MachineDeploymentTopology_To_v1alpha4_MachineDeploymentTopology is an autogenerated conversion function. +func Convert_v1beta1_MachineDeploymentTopology_To_v1alpha4_MachineDeploymentTopology(in *v1beta1.MachineDeploymentTopology, out *MachineDeploymentTopology, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDeploymentTopology_To_v1alpha4_MachineDeploymentTopology(in, out, s) +} + +func autoConvert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck(in *MachineHealthCheck, out *v1beta1.MachineHealthCheck, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck is an autogenerated conversion function. +func Convert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck(in *MachineHealthCheck, out *v1beta1.MachineHealthCheck, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck(in, out, s) +} + +func autoConvert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(in *v1beta1.MachineHealthCheck, out *MachineHealthCheck, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck is an autogenerated conversion function. +func Convert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(in *v1beta1.MachineHealthCheck, out *MachineHealthCheck, s conversion.Scope) error { + return autoConvert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(in, out, s) +} + +func autoConvert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(in *MachineHealthCheckList, out *v1beta1.MachineHealthCheckList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1beta1.MachineHealthCheck)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList is an autogenerated conversion function. +func Convert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(in *MachineHealthCheckList, out *v1beta1.MachineHealthCheckList, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(in, out, s) +} + +func autoConvert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(in *v1beta1.MachineHealthCheckList, out *MachineHealthCheckList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]MachineHealthCheck)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList is an autogenerated conversion function. +func Convert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(in *v1beta1.MachineHealthCheckList, out *MachineHealthCheckList, s conversion.Scope) error { + return autoConvert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(in, out, s) +} + +func autoConvert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in *MachineHealthCheckSpec, out *v1beta1.MachineHealthCheckSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.Selector = in.Selector + out.UnhealthyConditions = *(*[]v1beta1.UnhealthyCondition)(unsafe.Pointer(&in.UnhealthyConditions)) + out.MaxUnhealthy = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnhealthy)) + out.UnhealthyRange = (*string)(unsafe.Pointer(in.UnhealthyRange)) + out.NodeStartupTimeout = (*metav1.Duration)(unsafe.Pointer(in.NodeStartupTimeout)) + out.RemediationTemplate = (*v1.ObjectReference)(unsafe.Pointer(in.RemediationTemplate)) + return nil +} + +// Convert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec is an autogenerated conversion function. +func Convert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in *MachineHealthCheckSpec, out *v1beta1.MachineHealthCheckSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in, out, s) +} + +func autoConvert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(in *v1beta1.MachineHealthCheckSpec, out *MachineHealthCheckSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.Selector = in.Selector + out.UnhealthyConditions = *(*[]UnhealthyCondition)(unsafe.Pointer(&in.UnhealthyConditions)) + out.MaxUnhealthy = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnhealthy)) + out.UnhealthyRange = (*string)(unsafe.Pointer(in.UnhealthyRange)) + out.NodeStartupTimeout = (*metav1.Duration)(unsafe.Pointer(in.NodeStartupTimeout)) + out.RemediationTemplate = (*v1.ObjectReference)(unsafe.Pointer(in.RemediationTemplate)) + return nil +} + +// Convert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec is an autogenerated conversion function. +func Convert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(in *v1beta1.MachineHealthCheckSpec, out *MachineHealthCheckSpec, s conversion.Scope) error { + return autoConvert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(in, out, s) +} + +func autoConvert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in *MachineHealthCheckStatus, out *v1beta1.MachineHealthCheckStatus, s conversion.Scope) error { + out.ExpectedMachines = in.ExpectedMachines + out.CurrentHealthy = in.CurrentHealthy + out.RemediationsAllowed = in.RemediationsAllowed + out.ObservedGeneration = in.ObservedGeneration + out.Targets = *(*[]string)(unsafe.Pointer(&in.Targets)) + out.Conditions = *(*v1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) + return nil +} + +// Convert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus is an autogenerated conversion function. +func Convert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in *MachineHealthCheckStatus, out *v1beta1.MachineHealthCheckStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in, out, s) +} + +func autoConvert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(in *v1beta1.MachineHealthCheckStatus, out *MachineHealthCheckStatus, s conversion.Scope) error { + out.ExpectedMachines = in.ExpectedMachines + out.CurrentHealthy = in.CurrentHealthy + out.RemediationsAllowed = in.RemediationsAllowed + out.ObservedGeneration = in.ObservedGeneration + out.Targets = *(*[]string)(unsafe.Pointer(&in.Targets)) + out.Conditions = *(*Conditions)(unsafe.Pointer(&in.Conditions)) + return nil +} + +// Convert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus is an autogenerated conversion function. +func Convert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(in *v1beta1.MachineHealthCheckStatus, out *MachineHealthCheckStatus, s conversion.Scope) error { + return autoConvert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(in, out, s) +} + +func autoConvert_v1alpha4_MachineList_To_v1beta1_MachineList(in *MachineList, out *v1beta1.MachineList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1beta1.Machine)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha4_MachineList_To_v1beta1_MachineList is an autogenerated conversion function. +func Convert_v1alpha4_MachineList_To_v1beta1_MachineList(in *MachineList, out *v1beta1.MachineList, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineList_To_v1beta1_MachineList(in, out, s) +} + +func autoConvert_v1beta1_MachineList_To_v1alpha4_MachineList(in *v1beta1.MachineList, out *MachineList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]Machine)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1beta1_MachineList_To_v1alpha4_MachineList is an autogenerated conversion function. +func Convert_v1beta1_MachineList_To_v1alpha4_MachineList(in *v1beta1.MachineList, out *MachineList, s conversion.Scope) error { + return autoConvert_v1beta1_MachineList_To_v1alpha4_MachineList(in, out, s) +} + +func autoConvert_v1alpha4_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(in *MachineRollingUpdateDeployment, out *v1beta1.MachineRollingUpdateDeployment, s conversion.Scope) error { + out.MaxUnavailable = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnavailable)) + out.MaxSurge = (*intstr.IntOrString)(unsafe.Pointer(in.MaxSurge)) + out.DeletePolicy = (*string)(unsafe.Pointer(in.DeletePolicy)) + return nil +} + +// Convert_v1alpha4_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment is an autogenerated conversion function. +func Convert_v1alpha4_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(in *MachineRollingUpdateDeployment, out *v1beta1.MachineRollingUpdateDeployment, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(in, out, s) +} + +func autoConvert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(in *v1beta1.MachineRollingUpdateDeployment, out *MachineRollingUpdateDeployment, s conversion.Scope) error { + out.MaxUnavailable = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnavailable)) + out.MaxSurge = (*intstr.IntOrString)(unsafe.Pointer(in.MaxSurge)) + out.DeletePolicy = (*string)(unsafe.Pointer(in.DeletePolicy)) + return nil +} + +// Convert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment is an autogenerated conversion function. +func Convert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(in *v1beta1.MachineRollingUpdateDeployment, out *MachineRollingUpdateDeployment, s conversion.Scope) error { + return autoConvert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(in, out, s) +} + +func autoConvert_v1alpha4_MachineSet_To_v1beta1_MachineSet(in *MachineSet, out *v1beta1.MachineSet, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_MachineSet_To_v1beta1_MachineSet is an autogenerated conversion function. +func Convert_v1alpha4_MachineSet_To_v1beta1_MachineSet(in *MachineSet, out *v1beta1.MachineSet, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineSet_To_v1beta1_MachineSet(in, out, s) +} + +func autoConvert_v1beta1_MachineSet_To_v1alpha4_MachineSet(in *v1beta1.MachineSet, out *MachineSet, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_MachineSet_To_v1alpha4_MachineSet is an autogenerated conversion function. +func Convert_v1beta1_MachineSet_To_v1alpha4_MachineSet(in *v1beta1.MachineSet, out *MachineSet, s conversion.Scope) error { + return autoConvert_v1beta1_MachineSet_To_v1alpha4_MachineSet(in, out, s) +} + +func autoConvert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList(in *MachineSetList, out *v1beta1.MachineSetList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1beta1.MachineSet)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList is an autogenerated conversion function. +func Convert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList(in *MachineSetList, out *v1beta1.MachineSetList, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList(in, out, s) +} + +func autoConvert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList(in *v1beta1.MachineSetList, out *MachineSetList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]MachineSet)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList is an autogenerated conversion function. +func Convert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList(in *v1beta1.MachineSetList, out *MachineSetList, s conversion.Scope) error { + return autoConvert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList(in, out, s) +} + +func autoConvert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec(in *MachineSetSpec, out *v1beta1.MachineSetSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + out.MinReadySeconds = in.MinReadySeconds + out.DeletePolicy = in.DeletePolicy + out.Selector = in.Selector + if err := Convert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec is an autogenerated conversion function. +func Convert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec(in *MachineSetSpec, out *v1beta1.MachineSetSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec(in, out, s) +} + +func autoConvert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec(in *v1beta1.MachineSetSpec, out *MachineSetSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + out.MinReadySeconds = in.MinReadySeconds + out.DeletePolicy = in.DeletePolicy + out.Selector = in.Selector + if err := Convert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec is an autogenerated conversion function. +func Convert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec(in *v1beta1.MachineSetSpec, out *MachineSetSpec, s conversion.Scope) error { + return autoConvert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec(in, out, s) +} + +func autoConvert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus(in *MachineSetStatus, out *v1beta1.MachineSetStatus, s conversion.Scope) error { + out.Selector = in.Selector + out.Replicas = in.Replicas + out.FullyLabeledReplicas = in.FullyLabeledReplicas + out.ReadyReplicas = in.ReadyReplicas + out.AvailableReplicas = in.AvailableReplicas + out.ObservedGeneration = in.ObservedGeneration + out.FailureReason = (*errors.MachineSetStatusError)(unsafe.Pointer(in.FailureReason)) + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + return nil +} + +// Convert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus is an autogenerated conversion function. +func Convert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus(in *MachineSetStatus, out *v1beta1.MachineSetStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus(in, out, s) +} + +func autoConvert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus(in *v1beta1.MachineSetStatus, out *MachineSetStatus, s conversion.Scope) error { + out.Selector = in.Selector + out.Replicas = in.Replicas + out.FullyLabeledReplicas = in.FullyLabeledReplicas + out.ReadyReplicas = in.ReadyReplicas + out.AvailableReplicas = in.AvailableReplicas + out.ObservedGeneration = in.ObservedGeneration + out.FailureReason = (*errors.MachineSetStatusError)(unsafe.Pointer(in.FailureReason)) + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + return nil +} + +// Convert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus is an autogenerated conversion function. +func Convert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus(in *v1beta1.MachineSetStatus, out *MachineSetStatus, s conversion.Scope) error { + return autoConvert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus(in, out, s) +} + +func autoConvert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec(in *MachineSpec, out *v1beta1.MachineSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + if err := Convert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap(&in.Bootstrap, &out.Bootstrap, s); err != nil { + return err + } + out.InfrastructureRef = in.InfrastructureRef + out.Version = (*string)(unsafe.Pointer(in.Version)) + out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) + out.FailureDomain = (*string)(unsafe.Pointer(in.FailureDomain)) + out.NodeDrainTimeout = (*metav1.Duration)(unsafe.Pointer(in.NodeDrainTimeout)) + return nil +} + +// Convert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec is an autogenerated conversion function. +func Convert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec(in *MachineSpec, out *v1beta1.MachineSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec(in, out, s) +} + +func autoConvert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec(in *v1beta1.MachineSpec, out *MachineSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + if err := Convert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap(&in.Bootstrap, &out.Bootstrap, s); err != nil { + return err + } + out.InfrastructureRef = in.InfrastructureRef + out.Version = (*string)(unsafe.Pointer(in.Version)) + out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) + out.FailureDomain = (*string)(unsafe.Pointer(in.FailureDomain)) + out.NodeDrainTimeout = (*metav1.Duration)(unsafe.Pointer(in.NodeDrainTimeout)) + return nil +} + +// Convert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec is an autogenerated conversion function. +func Convert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec(in *v1beta1.MachineSpec, out *MachineSpec, s conversion.Scope) error { + return autoConvert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec(in, out, s) +} + +func autoConvert_v1alpha4_MachineStatus_To_v1beta1_MachineStatus(in *MachineStatus, out *v1beta1.MachineStatus, s conversion.Scope) error { + out.NodeRef = (*v1.ObjectReference)(unsafe.Pointer(in.NodeRef)) + out.NodeInfo = (*v1.NodeSystemInfo)(unsafe.Pointer(in.NodeInfo)) + out.LastUpdated = (*metav1.Time)(unsafe.Pointer(in.LastUpdated)) + out.Version = (*string)(unsafe.Pointer(in.Version)) + out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + out.Addresses = *(*v1beta1.MachineAddresses)(unsafe.Pointer(&in.Addresses)) + out.Phase = in.Phase + out.BootstrapReady = in.BootstrapReady + out.InfrastructureReady = in.InfrastructureReady + out.ObservedGeneration = in.ObservedGeneration + out.Conditions = *(*v1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) + return nil +} + +// Convert_v1alpha4_MachineStatus_To_v1beta1_MachineStatus is an autogenerated conversion function. +func Convert_v1alpha4_MachineStatus_To_v1beta1_MachineStatus(in *MachineStatus, out *v1beta1.MachineStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineStatus_To_v1beta1_MachineStatus(in, out, s) +} + +func autoConvert_v1beta1_MachineStatus_To_v1alpha4_MachineStatus(in *v1beta1.MachineStatus, out *MachineStatus, s conversion.Scope) error { + out.NodeRef = (*v1.ObjectReference)(unsafe.Pointer(in.NodeRef)) + out.NodeInfo = (*v1.NodeSystemInfo)(unsafe.Pointer(in.NodeInfo)) + out.LastUpdated = (*metav1.Time)(unsafe.Pointer(in.LastUpdated)) + out.Version = (*string)(unsafe.Pointer(in.Version)) + out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + out.Addresses = *(*MachineAddresses)(unsafe.Pointer(&in.Addresses)) + out.Phase = in.Phase + out.BootstrapReady = in.BootstrapReady + out.InfrastructureReady = in.InfrastructureReady + out.ObservedGeneration = in.ObservedGeneration + out.Conditions = *(*Conditions)(unsafe.Pointer(&in.Conditions)) + return nil +} + +// Convert_v1beta1_MachineStatus_To_v1alpha4_MachineStatus is an autogenerated conversion function. +func Convert_v1beta1_MachineStatus_To_v1alpha4_MachineStatus(in *v1beta1.MachineStatus, out *MachineStatus, s conversion.Scope) error { + return autoConvert_v1beta1_MachineStatus_To_v1alpha4_MachineStatus(in, out, s) +} + +func autoConvert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(in *MachineTemplateSpec, out *v1beta1.MachineTemplateSpec, s conversion.Scope) error { + if err := Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { + return err + } + if err := Convert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec is an autogenerated conversion function. +func Convert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(in *MachineTemplateSpec, out *v1beta1.MachineTemplateSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(in, out, s) +} + +func autoConvert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(in *v1beta1.MachineTemplateSpec, out *MachineTemplateSpec, s conversion.Scope) error { + if err := Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { + return err + } + if err := Convert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec is an autogenerated conversion function. +func Convert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(in *v1beta1.MachineTemplateSpec, out *MachineTemplateSpec, s conversion.Scope) error { + return autoConvert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(in, out, s) +} + +func autoConvert_v1alpha4_NetworkRanges_To_v1beta1_NetworkRanges(in *NetworkRanges, out *v1beta1.NetworkRanges, s conversion.Scope) error { + out.CIDRBlocks = *(*[]string)(unsafe.Pointer(&in.CIDRBlocks)) + return nil +} + +// Convert_v1alpha4_NetworkRanges_To_v1beta1_NetworkRanges is an autogenerated conversion function. +func Convert_v1alpha4_NetworkRanges_To_v1beta1_NetworkRanges(in *NetworkRanges, out *v1beta1.NetworkRanges, s conversion.Scope) error { + return autoConvert_v1alpha4_NetworkRanges_To_v1beta1_NetworkRanges(in, out, s) +} + +func autoConvert_v1beta1_NetworkRanges_To_v1alpha4_NetworkRanges(in *v1beta1.NetworkRanges, out *NetworkRanges, s conversion.Scope) error { + out.CIDRBlocks = *(*[]string)(unsafe.Pointer(&in.CIDRBlocks)) + return nil +} + +// Convert_v1beta1_NetworkRanges_To_v1alpha4_NetworkRanges is an autogenerated conversion function. +func Convert_v1beta1_NetworkRanges_To_v1alpha4_NetworkRanges(in *v1beta1.NetworkRanges, out *NetworkRanges, s conversion.Scope) error { + return autoConvert_v1beta1_NetworkRanges_To_v1alpha4_NetworkRanges(in, out, s) +} + +func autoConvert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in *ObjectMeta, out *v1beta1.ObjectMeta, s conversion.Scope) error { + out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) + out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations)) + return nil +} + +// Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta is an autogenerated conversion function. +func Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in *ObjectMeta, out *v1beta1.ObjectMeta, s conversion.Scope) error { + return autoConvert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in, out, s) +} + +func autoConvert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in *v1beta1.ObjectMeta, out *ObjectMeta, s conversion.Scope) error { + out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) + out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations)) + return nil +} + +// Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta is an autogenerated conversion function. +func Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in *v1beta1.ObjectMeta, out *ObjectMeta, s conversion.Scope) error { + return autoConvert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in, out, s) +} + +func autoConvert_v1alpha4_Topology_To_v1beta1_Topology(in *Topology, out *v1beta1.Topology, s conversion.Scope) error { + out.Class = in.Class + out.Version = in.Version + out.RolloutAfter = (*metav1.Time)(unsafe.Pointer(in.RolloutAfter)) + if err := Convert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(&in.ControlPlane, &out.ControlPlane, s); err != nil { + return err + } + out.Workers = (*v1beta1.WorkersTopology)(unsafe.Pointer(in.Workers)) + return nil +} + +// Convert_v1alpha4_Topology_To_v1beta1_Topology is an autogenerated conversion function. +func Convert_v1alpha4_Topology_To_v1beta1_Topology(in *Topology, out *v1beta1.Topology, s conversion.Scope) error { + return autoConvert_v1alpha4_Topology_To_v1beta1_Topology(in, out, s) +} + +func autoConvert_v1beta1_Topology_To_v1alpha4_Topology(in *v1beta1.Topology, out *Topology, s conversion.Scope) error { + out.Class = in.Class + out.Version = in.Version + out.RolloutAfter = (*metav1.Time)(unsafe.Pointer(in.RolloutAfter)) + if err := Convert_v1beta1_ControlPlaneTopology_To_v1alpha4_ControlPlaneTopology(&in.ControlPlane, &out.ControlPlane, s); err != nil { + return err + } + out.Workers = (*WorkersTopology)(unsafe.Pointer(in.Workers)) + return nil +} + +// Convert_v1beta1_Topology_To_v1alpha4_Topology is an autogenerated conversion function. +func Convert_v1beta1_Topology_To_v1alpha4_Topology(in *v1beta1.Topology, out *Topology, s conversion.Scope) error { + return autoConvert_v1beta1_Topology_To_v1alpha4_Topology(in, out, s) +} + +func autoConvert_v1alpha4_UnhealthyCondition_To_v1beta1_UnhealthyCondition(in *UnhealthyCondition, out *v1beta1.UnhealthyCondition, s conversion.Scope) error { + out.Type = v1.NodeConditionType(in.Type) + out.Status = v1.ConditionStatus(in.Status) + out.Timeout = in.Timeout + return nil +} + +// Convert_v1alpha4_UnhealthyCondition_To_v1beta1_UnhealthyCondition is an autogenerated conversion function. +func Convert_v1alpha4_UnhealthyCondition_To_v1beta1_UnhealthyCondition(in *UnhealthyCondition, out *v1beta1.UnhealthyCondition, s conversion.Scope) error { + return autoConvert_v1alpha4_UnhealthyCondition_To_v1beta1_UnhealthyCondition(in, out, s) +} + +func autoConvert_v1beta1_UnhealthyCondition_To_v1alpha4_UnhealthyCondition(in *v1beta1.UnhealthyCondition, out *UnhealthyCondition, s conversion.Scope) error { + out.Type = v1.NodeConditionType(in.Type) + out.Status = v1.ConditionStatus(in.Status) + out.Timeout = in.Timeout + return nil +} + +// Convert_v1beta1_UnhealthyCondition_To_v1alpha4_UnhealthyCondition is an autogenerated conversion function. +func Convert_v1beta1_UnhealthyCondition_To_v1alpha4_UnhealthyCondition(in *v1beta1.UnhealthyCondition, out *UnhealthyCondition, s conversion.Scope) error { + return autoConvert_v1beta1_UnhealthyCondition_To_v1alpha4_UnhealthyCondition(in, out, s) +} + +func autoConvert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass(in *WorkersClass, out *v1beta1.WorkersClass, s conversion.Scope) error { + out.MachineDeployments = *(*[]v1beta1.MachineDeploymentClass)(unsafe.Pointer(&in.MachineDeployments)) + return nil +} + +// Convert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass is an autogenerated conversion function. +func Convert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass(in *WorkersClass, out *v1beta1.WorkersClass, s conversion.Scope) error { + return autoConvert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass(in, out, s) +} + +func autoConvert_v1beta1_WorkersClass_To_v1alpha4_WorkersClass(in *v1beta1.WorkersClass, out *WorkersClass, s conversion.Scope) error { + out.MachineDeployments = *(*[]MachineDeploymentClass)(unsafe.Pointer(&in.MachineDeployments)) + return nil +} + +// Convert_v1beta1_WorkersClass_To_v1alpha4_WorkersClass is an autogenerated conversion function. +func Convert_v1beta1_WorkersClass_To_v1alpha4_WorkersClass(in *v1beta1.WorkersClass, out *WorkersClass, s conversion.Scope) error { + return autoConvert_v1beta1_WorkersClass_To_v1alpha4_WorkersClass(in, out, s) +} + +func autoConvert_v1alpha4_WorkersTopology_To_v1beta1_WorkersTopology(in *WorkersTopology, out *v1beta1.WorkersTopology, s conversion.Scope) error { + out.MachineDeployments = *(*[]v1beta1.MachineDeploymentTopology)(unsafe.Pointer(&in.MachineDeployments)) + return nil +} + +// Convert_v1alpha4_WorkersTopology_To_v1beta1_WorkersTopology is an autogenerated conversion function. +func Convert_v1alpha4_WorkersTopology_To_v1beta1_WorkersTopology(in *WorkersTopology, out *v1beta1.WorkersTopology, s conversion.Scope) error { + return autoConvert_v1alpha4_WorkersTopology_To_v1beta1_WorkersTopology(in, out, s) +} + +func autoConvert_v1beta1_WorkersTopology_To_v1alpha4_WorkersTopology(in *v1beta1.WorkersTopology, out *WorkersTopology, s conversion.Scope) error { + out.MachineDeployments = *(*[]MachineDeploymentTopology)(unsafe.Pointer(&in.MachineDeployments)) + return nil +} + +// Convert_v1beta1_WorkersTopology_To_v1alpha4_WorkersTopology is an autogenerated conversion function. +func Convert_v1beta1_WorkersTopology_To_v1alpha4_WorkersTopology(in *v1beta1.WorkersTopology, out *WorkersTopology, s conversion.Scope) error { + return autoConvert_v1beta1_WorkersTopology_To_v1alpha4_WorkersTopology(in, out, s) +} diff --git a/api/v1beta1/cluster_phase_types.go b/api/v1beta1/cluster_phase_types.go new file mode 100644 index 000000000000..afcd872456d6 --- /dev/null +++ b/api/v1beta1/cluster_phase_types.go @@ -0,0 +1,55 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +// ClusterPhase is a string representation of a Cluster Phase. +// +// This type is a high-level indicator of the status of the Cluster as it is provisioned, +// from the API user’s perspective. +// +// The value should not be interpreted by any software components as a reliable indication +// of the actual state of the Cluster, and controllers should not use the Cluster Phase field +// value when making decisions about what action to take. +// +// Controllers should always look at the actual state of the Cluster’s fields to make those decisions. +type ClusterPhase string + +const ( + // ClusterPhasePending is the first state a Cluster is assigned by + // Cluster API Cluster controller after being created. + ClusterPhasePending = ClusterPhase("Pending") + + // ClusterPhaseProvisioning is the state when the Cluster has a provider infrastructure + // object associated and can start provisioning. + ClusterPhaseProvisioning = ClusterPhase("Provisioning") + + // ClusterPhaseProvisioned is the state when its + // infrastructure has been created and configured. + ClusterPhaseProvisioned = ClusterPhase("Provisioned") + + // ClusterPhaseDeleting is the Cluster state when a delete + // request has been sent to the API Server, + // but its infrastructure has not yet been fully deleted. + ClusterPhaseDeleting = ClusterPhase("Deleting") + + // ClusterPhaseFailed is the Cluster state when the system + // might require user intervention. + ClusterPhaseFailed = ClusterPhase("Failed") + + // ClusterPhaseUnknown is returned if the Cluster state cannot be determined. + ClusterPhaseUnknown = ClusterPhase("Unknown") +) diff --git a/api/v1beta1/cluster_types.go b/api/v1beta1/cluster_types.go new file mode 100644 index 000000000000..1279ed49bc7a --- /dev/null +++ b/api/v1beta1/cluster_types.go @@ -0,0 +1,435 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "fmt" + "net" + "strings" + + "github.com/pkg/errors" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/utils/pointer" + + capierrors "sigs.k8s.io/cluster-api/errors" +) + +const ( + // ClusterFinalizer is the finalizer used by the cluster controller to + // cleanup the cluster resources when a Cluster is being deleted. + ClusterFinalizer = "cluster.cluster.x-k8s.io" +) + +// ANCHOR: ClusterSpec + +// ClusterSpec defines the desired state of Cluster. +type ClusterSpec struct { + // Paused can be used to prevent controllers from processing the Cluster and all its associated objects. + // +optional + Paused bool `json:"paused,omitempty"` + + // Cluster network configuration. + // +optional + ClusterNetwork *ClusterNetwork `json:"clusterNetwork,omitempty"` + + // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. + // +optional + ControlPlaneEndpoint APIEndpoint `json:"controlPlaneEndpoint"` + + // ControlPlaneRef is an optional reference to a provider-specific resource that holds + // the details for provisioning the Control Plane for a Cluster. + // +optional + ControlPlaneRef *corev1.ObjectReference `json:"controlPlaneRef,omitempty"` + + // InfrastructureRef is a reference to a provider-specific resource that holds the details + // for provisioning infrastructure for a cluster in said provider. + // +optional + InfrastructureRef *corev1.ObjectReference `json:"infrastructureRef,omitempty"` + + // This encapsulates the topology for the cluster. + // NOTE: It is required to enable the ClusterTopology + // feature gate flag to activate managed topologies support; + // this feature is highly experimental, and parts of it might still be not implemented. + // +optional + Topology *Topology `json:"topology,omitempty"` +} + +// Topology encapsulates the information of the managed resources. +type Topology struct { + // The name of the ClusterClass object to create the topology. + Class string `json:"class"` + + // The Kubernetes version of the cluster. + Version string `json:"version"` + + // RolloutAfter performs a rollout of the entire cluster one component at a time, + // control plane first and then machine deployments. + // +optional + RolloutAfter *metav1.Time `json:"rolloutAfter,omitempty"` + + // ControlPlane describes the cluster control plane. + // +optional + ControlPlane ControlPlaneTopology `json:"controlPlane"` + + // Workers encapsulates the different constructs that form the worker nodes + // for the cluster. + // +optional + Workers *WorkersTopology `json:"workers,omitempty"` +} + +// ControlPlaneTopology specifies the parameters for the control plane nodes in the cluster. +type ControlPlaneTopology struct { + // Metadata is the metadata applied to the machines of the ControlPlane. + // At runtime this metadata is merged with the corresponding metadata from the ClusterClass. + // + // This field is supported if and only if the control plane provider template + // referenced in the ClusterClass is Machine based. + Metadata ObjectMeta `json:"metadata,omitempty"` + + // Replicas is the number of control plane nodes. + // If the value is nil, the ControlPlane object is created without the number of Replicas + // and it's assumed that the control plane controller does not implement support for this field. + // When specified against a control plane provider that lacks support for this field, this value will be ignored. + // +optional + Replicas *int32 `json:"replicas,omitempty"` +} + +// WorkersTopology represents the different sets of worker nodes in the cluster. +type WorkersTopology struct { + // MachineDeployments is a list of machine deployments in the cluster. + MachineDeployments []MachineDeploymentTopology `json:"machineDeployments,omitempty"` +} + +// MachineDeploymentTopology specifies the different parameters for a set of worker nodes in the topology. +// This set of nodes is managed by a MachineDeployment object whose lifecycle is managed by the Cluster controller. +type MachineDeploymentTopology struct { + // Metadata is the metadata applied to the machines of the MachineDeployment. + // At runtime this metadata is merged with the corresponding metadata from the ClusterClass. + Metadata ObjectMeta `json:"metadata,omitempty"` + + // Class is the name of the MachineDeploymentClass used to create the set of worker nodes. + // This should match one of the deployment classes defined in the ClusterClass object + // mentioned in the `Cluster.Spec.Class` field. + Class string `json:"class"` + + // Name is the unique identifier for this MachineDeploymentTopology. + // The value is used with other unique identifiers to create a MachineDeployment's Name + // (e.g. cluster's name, etc). In case the name is greater than the allowed maximum length, + // the values are hashed together. + Name string `json:"name"` + + // Replicas is the number of worker nodes belonging to this set. + // If the value is nil, the MachineDeployment is created without the number of Replicas (defaulting to zero) + // and it's assumed that an external entity (like cluster autoscaler) is responsible for the management + // of this value. + // +optional + Replicas *int32 `json:"replicas,omitempty"` +} + +// ANCHOR_END: ClusterSpec + +// ANCHOR: ClusterNetwork + +// ClusterNetwork specifies the different networking +// parameters for a cluster. +type ClusterNetwork struct { + // APIServerPort specifies the port the API Server should bind to. + // Defaults to 6443. + // +optional + APIServerPort *int32 `json:"apiServerPort,omitempty"` + + // The network ranges from which service VIPs are allocated. + // +optional + Services *NetworkRanges `json:"services,omitempty"` + + // The network ranges from which Pod networks are allocated. + // +optional + Pods *NetworkRanges `json:"pods,omitempty"` + + // Domain name for services. + // +optional + ServiceDomain string `json:"serviceDomain,omitempty"` +} + +// ANCHOR_END: ClusterNetwork + +// ANCHOR: NetworkRanges + +// NetworkRanges represents ranges of network addresses. +type NetworkRanges struct { + CIDRBlocks []string `json:"cidrBlocks"` +} + +func (n *NetworkRanges) String() string { + if n == nil { + return "" + } + return strings.Join(n.CIDRBlocks, ",") +} + +// ANCHOR_END: NetworkRanges + +// ANCHOR: ClusterStatus + +// ClusterStatus defines the observed state of Cluster. +type ClusterStatus struct { + // FailureDomains is a slice of failure domain objects synced from the infrastructure provider. + FailureDomains FailureDomains `json:"failureDomains,omitempty"` + + // FailureReason indicates that there is a fatal problem reconciling the + // state, and will be set to a token value suitable for + // programmatic interpretation. + // +optional + FailureReason *capierrors.ClusterStatusError `json:"failureReason,omitempty"` + + // FailureMessage indicates that there is a fatal problem reconciling the + // state, and will be set to a descriptive error message. + // +optional + FailureMessage *string `json:"failureMessage,omitempty"` + + // Phase represents the current phase of cluster actuation. + // E.g. Pending, Running, Terminating, Failed etc. + // +optional + Phase string `json:"phase,omitempty"` + + // InfrastructureReady is the state of the infrastructure provider. + // +optional + InfrastructureReady bool `json:"infrastructureReady"` + + // ControlPlaneReady defines if the control plane is ready. + // +optional + ControlPlaneReady bool `json:"controlPlaneReady,omitempty"` + + // Conditions defines current service state of the cluster. + // +optional + Conditions Conditions `json:"conditions,omitempty"` + + // ObservedGeneration is the latest generation observed by the controller. + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty"` +} + +// ANCHOR_END: ClusterStatus + +// SetTypedPhase sets the Phase field to the string representation of ClusterPhase. +func (c *ClusterStatus) SetTypedPhase(p ClusterPhase) { + c.Phase = string(p) +} + +// GetTypedPhase attempts to parse the Phase field and return +// the typed ClusterPhase representation as described in `machine_phase_types.go`. +func (c *ClusterStatus) GetTypedPhase() ClusterPhase { + switch phase := ClusterPhase(c.Phase); phase { + case + ClusterPhasePending, + ClusterPhaseProvisioning, + ClusterPhaseProvisioned, + ClusterPhaseDeleting, + ClusterPhaseFailed: + return phase + default: + return ClusterPhaseUnknown + } +} + +// ANCHOR: APIEndpoint + +// APIEndpoint represents a reachable Kubernetes API endpoint. +type APIEndpoint struct { + // The hostname on which the API server is serving. + Host string `json:"host"` + + // The port on which the API server is serving. + Port int32 `json:"port"` +} + +// IsZero returns true if both host and port are zero values. +func (v APIEndpoint) IsZero() bool { + return v.Host == "" && v.Port == 0 +} + +// IsValid returns true if both host and port are non-zero values. +func (v APIEndpoint) IsValid() bool { + return v.Host != "" && v.Port != 0 +} + +// String returns a formatted version HOST:PORT of this APIEndpoint. +func (v APIEndpoint) String() string { + return net.JoinHostPort(v.Host, fmt.Sprintf("%d", v.Port)) +} + +// ANCHOR_END: APIEndpoint + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=clusters,shortName=cl,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Cluster" +// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Cluster status such as Pending/Provisioning/Provisioned/Deleting/Failed" + +// Cluster is the Schema for the clusters API. +type Cluster struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec ClusterSpec `json:"spec,omitempty"` + Status ClusterStatus `json:"status,omitempty"` +} + +// GetConditions returns the set of conditions for this object. +func (c *Cluster) GetConditions() Conditions { + return c.Status.Conditions +} + +// SetConditions sets the conditions on this object. +func (c *Cluster) SetConditions(conditions Conditions) { + c.Status.Conditions = conditions +} + +// GetIPFamily returns a ClusterIPFamily from the configuration provided. +func (c *Cluster) GetIPFamily() (ClusterIPFamily, error) { + var podCIDRs, serviceCIDRs []string + if c.Spec.ClusterNetwork != nil { + if c.Spec.ClusterNetwork.Pods != nil { + podCIDRs = c.Spec.ClusterNetwork.Pods.CIDRBlocks + } + if c.Spec.ClusterNetwork.Services != nil { + serviceCIDRs = c.Spec.ClusterNetwork.Services.CIDRBlocks + } + } + if len(podCIDRs) == 0 && len(serviceCIDRs) == 0 { + return IPv4IPFamily, nil + } + + podsIPFamily, err := ipFamilyForCIDRStrings(podCIDRs) + if err != nil { + return InvalidIPFamily, fmt.Errorf("pods: %s", err) + } + if len(serviceCIDRs) == 0 { + return podsIPFamily, nil + } + + servicesIPFamily, err := ipFamilyForCIDRStrings(serviceCIDRs) + if err != nil { + return InvalidIPFamily, fmt.Errorf("services: %s", err) + } + if len(podCIDRs) == 0 { + return servicesIPFamily, nil + } + + if podsIPFamily == DualStackIPFamily { + return DualStackIPFamily, nil + } else if podsIPFamily != servicesIPFamily { + return InvalidIPFamily, errors.New("pods and services IP family mismatch") + } + + return podsIPFamily, nil +} + +func ipFamilyForCIDRStrings(cidrs []string) (ClusterIPFamily, error) { + if len(cidrs) > 2 { + return InvalidIPFamily, errors.New("too many CIDRs specified") + } + var foundIPv4 bool + var foundIPv6 bool + for _, cidr := range cidrs { + ip, _, err := net.ParseCIDR(cidr) + if err != nil { + return InvalidIPFamily, fmt.Errorf("could not parse CIDR: %s", err) + } + if ip.To4() != nil { + foundIPv4 = true + } else { + foundIPv6 = true + } + } + switch { + case foundIPv4 && foundIPv6: + return DualStackIPFamily, nil + case foundIPv4: + return IPv4IPFamily, nil + case foundIPv6: + return IPv6IPFamily, nil + default: + return InvalidIPFamily, nil + } +} + +// ClusterIPFamily defines the types of supported IP families. +type ClusterIPFamily int + +// Define the ClusterIPFamily constants. +const ( + InvalidIPFamily ClusterIPFamily = iota + IPv4IPFamily + IPv6IPFamily + DualStackIPFamily +) + +func (f ClusterIPFamily) String() string { + return [...]string{"InvalidIPFamily", "IPv4IPFamily", "IPv6IPFamily", "DualStackIPFamily"}[f] +} + +// +kubebuilder:object:root=true + +// ClusterList contains a list of Cluster. +type ClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Cluster `json:"items"` +} + +func init() { + SchemeBuilder.Register(&Cluster{}, &ClusterList{}) +} + +// FailureDomains is a slice of FailureDomains. +type FailureDomains map[string]FailureDomainSpec + +// FilterControlPlane returns a FailureDomain slice containing only the domains suitable to be used +// for control plane nodes. +func (in FailureDomains) FilterControlPlane() FailureDomains { + res := make(FailureDomains) + for id, spec := range in { + if spec.ControlPlane { + res[id] = spec + } + } + return res +} + +// GetIDs returns a slice containing the ids for failure domains. +func (in FailureDomains) GetIDs() []*string { + ids := make([]*string, 0, len(in)) + for id := range in { + ids = append(ids, pointer.StringPtr(id)) + } + return ids +} + +// FailureDomainSpec is the Schema for Cluster API failure domains. +// It allows controllers to understand how many failure domains a cluster can optionally span across. +type FailureDomainSpec struct { + // ControlPlane determines if this failure domain is suitable for use by control plane machines. + // +optional + ControlPlane bool `json:"controlPlane"` + + // Attributes is a free form map of attributes an infrastructure provider might use or require. + // +optional + Attributes map[string]string `json:"attributes,omitempty"` +} diff --git a/api/v1beta1/cluster_types_test.go b/api/v1beta1/cluster_types_test.go new file mode 100644 index 000000000000..e1893918f444 --- /dev/null +++ b/api/v1beta1/cluster_types_test.go @@ -0,0 +1,197 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "testing" + + . "github.com/onsi/gomega" +) + +func TestClusterIPFamily(t *testing.T) { + clusterWithNetwork := func(podCIDRs, serviceCIDRs []string) *Cluster { + return &Cluster{ + Spec: ClusterSpec{ + ClusterNetwork: &ClusterNetwork{ + Pods: &NetworkRanges{ + CIDRBlocks: podCIDRs, + }, + Services: &NetworkRanges{ + CIDRBlocks: serviceCIDRs, + }, + }, + }, + } + } + + validAndUnambiguous := []struct { + name string + expectRes ClusterIPFamily + c *Cluster + }{ + { + name: "pods: ipv4, services: ipv4", + expectRes: IPv4IPFamily, + c: clusterWithNetwork([]string{"192.168.0.0/16"}, []string{"10.128.0.0/12"}), + }, + { + name: "pods: ipv4, services: nil", + expectRes: IPv4IPFamily, + c: clusterWithNetwork([]string{"192.168.0.0/16"}, nil), + }, + { + name: "pods: ipv6, services: nil", + expectRes: IPv6IPFamily, + c: clusterWithNetwork([]string{"fd00:100:96::/48"}, nil), + }, + { + name: "pods: ipv6, services: ipv6", + expectRes: IPv6IPFamily, + c: clusterWithNetwork([]string{"fd00:100:96::/48"}, []string{"fd00:100:64::/108"}), + }, + { + name: "pods: dual-stack, services: nil", + expectRes: DualStackIPFamily, + c: clusterWithNetwork([]string{"192.168.0.0/16", "fd00:100:96::/48"}, nil), + }, + { + name: "pods: dual-stack, services: ipv4", + expectRes: DualStackIPFamily, + c: clusterWithNetwork([]string{"192.168.0.0/16", "fd00:100:96::/48"}, []string{"10.128.0.0/12"}), + }, + { + name: "pods: dual-stack, services: ipv6", + expectRes: DualStackIPFamily, + c: clusterWithNetwork([]string{"192.168.0.0/16", "fd00:100:96::/48"}, []string{"fd00:100:64::/108"}), + }, + { + name: "pods: dual-stack, services: dual-stack", + expectRes: DualStackIPFamily, + c: clusterWithNetwork([]string{"192.168.0.0/16", "fd00:100:96::/48"}, []string{"10.128.0.0/12", "fd00:100:64::/108"}), + }, + { + name: "pods: nil, services: dual-stack", + expectRes: DualStackIPFamily, + c: clusterWithNetwork(nil, []string{"10.128.0.0/12", "fd00:100:64::/108"}), + }, + } + + for _, tt := range validAndUnambiguous { + t.Run(tt.name, func(t *testing.T) { + g := NewWithT(t) + ipFamily, err := tt.c.GetIPFamily() + g.Expect(ipFamily).To(Equal(tt.expectRes)) + g.Expect(err).NotTo(HaveOccurred()) + }) + } + + validButAmbiguous := []struct { + name string + expectRes ClusterIPFamily + c *Cluster + }{ + { + name: "pods: nil, services: nil", + // this could be ipv4, ipv6, or dual-stack; assume ipv4 for now though + expectRes: IPv4IPFamily, + c: clusterWithNetwork(nil, nil), + }, + { + name: "pods: nil, services: ipv4", + // this could be a dual-stack; assume ipv4 for now though + expectRes: IPv4IPFamily, + c: clusterWithNetwork(nil, []string{"10.128.0.0/12"}), + }, + { + name: "pods: nil, services: ipv6", + // this could be dual-stack; assume ipv6 for now though + expectRes: IPv6IPFamily, + c: clusterWithNetwork(nil, []string{"fd00:100:64::/108"}), + }, + } + + for _, tt := range validButAmbiguous { + t.Run(tt.name, func(t *testing.T) { + g := NewWithT(t) + ipFamily, err := tt.c.GetIPFamily() + g.Expect(ipFamily).To(Equal(tt.expectRes)) + g.Expect(err).NotTo(HaveOccurred()) + }) + } + + invalid := []struct { + name string + expectErr string + c *Cluster + }{ + { + name: "pods: ipv4, services: ipv6", + expectErr: "pods and services IP family mismatch", + c: clusterWithNetwork([]string{"192.168.0.0/16"}, []string{"fd00:100:64::/108"}), + }, + { + name: "pods: ipv6, services: ipv4", + expectErr: "pods and services IP family mismatch", + c: clusterWithNetwork([]string{"fd00:100:96::/48"}, []string{"10.128.0.0/12"}), + }, + { + name: "pods: ipv6, services: dual-stack", + expectErr: "pods and services IP family mismatch", + c: clusterWithNetwork([]string{"fd00:100:96::/48"}, []string{"10.128.0.0/12", "fd00:100:64::/108"}), + }, + { + name: "pods: ipv4, services: dual-stack", + expectErr: "pods and services IP family mismatch", + c: clusterWithNetwork([]string{"192.168.0.0/16"}, []string{"10.128.0.0/12", "fd00:100:64::/108"}), + }, + { + name: "pods: ipv4, services: dual-stack", + expectErr: "pods and services IP family mismatch", + c: clusterWithNetwork([]string{"192.168.0.0/16"}, []string{"10.128.0.0/12", "fd00:100:64::/108"}), + }, + { + name: "pods: bad cidr", + expectErr: "pods: could not parse CIDR", + c: clusterWithNetwork([]string{"foo"}, nil), + }, + { + name: "services: bad cidr", + expectErr: "services: could not parse CIDR", + c: clusterWithNetwork([]string{"192.168.0.0/16"}, []string{"foo"}), + }, + { + name: "pods: too many cidrs", + expectErr: "pods: too many CIDRs specified", + c: clusterWithNetwork([]string{"192.168.0.0/16", "fd00:100:96::/48", "10.128.0.0/12"}, nil), + }, + { + name: "services: too many cidrs", + expectErr: "services: too many CIDRs specified", + c: clusterWithNetwork(nil, []string{"192.168.0.0/16", "fd00:100:96::/48", "10.128.0.0/12"}), + }, + } + + for _, tt := range invalid { + t.Run(tt.name, func(t *testing.T) { + g := NewWithT(t) + ipFamily, err := tt.c.GetIPFamily() + g.Expect(err).To(HaveOccurred()) + g.Expect(err).To(MatchError(ContainSubstring(tt.expectErr))) + g.Expect(ipFamily).To(Equal(InvalidIPFamily)) + }) + } +} diff --git a/api/v1alpha4/cluster_webhook.go b/api/v1beta1/cluster_webhook.go similarity index 92% rename from api/v1alpha4/cluster_webhook.go rename to api/v1beta1/cluster_webhook.go index ee76957dc3ac..240abe65eae5 100644 --- a/api/v1alpha4/cluster_webhook.go +++ b/api/v1beta1/cluster_webhook.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "fmt" @@ -37,8 +37,8 @@ func (c *Cluster) SetupWebhookWithManager(mgr ctrl.Manager) error { Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-cluster-x-k8s-io-v1alpha4-cluster,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=clusters,versions=v1alpha4,name=validation.cluster.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-cluster-x-k8s-io-v1alpha4-cluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=clusters,versions=v1alpha4,name=default.cluster.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-cluster-x-k8s-io-v1beta1-cluster,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=clusters,versions=v1beta1,name=validation.cluster.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-cluster-x-k8s-io-v1beta1-cluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=clusters,versions=v1beta1,name=default.cluster.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 var _ webhook.Defaulter = &Cluster{} var _ webhook.Validator = &Cluster{} diff --git a/api/v1alpha4/cluster_webhook_test.go b/api/v1beta1/cluster_webhook_test.go similarity index 99% rename from api/v1alpha4/cluster_webhook_test.go rename to api/v1beta1/cluster_webhook_test.go index 9f147b92e382..799041a82c4f 100644 --- a/api/v1alpha4/cluster_webhook_test.go +++ b/api/v1beta1/cluster_webhook_test.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "testing" diff --git a/api/v1beta1/clusterclass_types.go b/api/v1beta1/clusterclass_types.go new file mode 100644 index 000000000000..60b1b861cd4e --- /dev/null +++ b/api/v1beta1/clusterclass_types.go @@ -0,0 +1,133 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=clusterclasses,shortName=cc,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of ClusterClass" + +// ClusterClass is a template which can be used to create managed topologies. +type ClusterClass struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec ClusterClassSpec `json:"spec,omitempty"` +} + +// ClusterClassSpec describes the desired state of the ClusterClass. +type ClusterClassSpec struct { + // Infrastructure is a reference to a provider-specific template that holds + // the details for provisioning infrastructure specific cluster + // for the underlying provider. + // The underlying provider is responsible for the implementation + // of the template to an infrastructure cluster. + Infrastructure LocalObjectTemplate `json:"infrastructure,omitempty"` + + // ControlPlane is a reference to a local struct that holds the details + // for provisioning the Control Plane for the Cluster. + ControlPlane ControlPlaneClass `json:"controlPlane,omitempty"` + + // Workers describes the worker nodes for the cluster. + // It is a collection of node types which can be used to create + // the worker nodes of the cluster. + // +optional + Workers WorkersClass `json:"workers,omitempty"` +} + +// ControlPlaneClass defines the class for the control plane. +type ControlPlaneClass struct { + // Metadata is the metadata applied to the machines of the ControlPlane. + // At runtime this metadata is merged with the corresponding metadata from the topology. + // + // This field is supported if and only if the control plane provider template + // referenced is Machine based. + Metadata ObjectMeta `json:"metadata,omitempty"` + + // LocalObjectTemplate contains the reference to the control plane provider. + LocalObjectTemplate `json:",inline"` + + // MachineTemplate defines the metadata and infrastructure information + // for control plane machines. + // + // This field is supported if and only if the control plane provider template + // referenced above is Machine based and supports setting replicas. + // + // +optional + MachineInfrastructure *LocalObjectTemplate `json:"machineInfrastructure,omitempty"` +} + +// WorkersClass is a collection of deployment classes. +type WorkersClass struct { + // MachineDeployments is a list of machine deployment classes that can be used to create + // a set of worker nodes. + MachineDeployments []MachineDeploymentClass `json:"machineDeployments,omitempty"` +} + +// MachineDeploymentClass serves as a template to define a set of worker nodes of the cluster +// provisioned using the `ClusterClass`. +type MachineDeploymentClass struct { + // Class denotes a type of worker node present in the cluster, + // this name MUST be unique within a ClusterClass and can be referenced + // in the Cluster to create a managed MachineDeployment. + Class string `json:"class"` + + // Template is a local struct containing a collection of templates for creation of + // MachineDeployment objects representing a set of worker nodes. + Template MachineDeploymentClassTemplate `json:"template"` +} + +// MachineDeploymentClassTemplate defines how a MachineDeployment generated from a MachineDeploymentClass +// should look like. +type MachineDeploymentClassTemplate struct { + // Metadata is the metadata applied to the machines of the MachineDeployment. + // At runtime this metadata is merged with the corresponding metadata from the topology. + Metadata ObjectMeta `json:"metadata,omitempty"` + + // Bootstrap contains the bootstrap template reference to be used + // for the creation of worker Machines. + Bootstrap LocalObjectTemplate `json:"bootstrap"` + + // Infrastructure contains the infrastructure template reference to be used + // for the creation of worker Machines. + Infrastructure LocalObjectTemplate `json:"infrastructure"` +} + +// LocalObjectTemplate defines a template for a topology Class. +type LocalObjectTemplate struct { + // Ref is a required reference to a custom resource + // offered by a provider. + Ref *corev1.ObjectReference `json:"ref"` +} + +// +kubebuilder:object:root=true + +// ClusterClassList contains a list of Cluster. +type ClusterClassList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ClusterClass `json:"items"` +} + +func init() { + SchemeBuilder.Register(&ClusterClass{}, &ClusterClassList{}) +} diff --git a/api/v1alpha4/clusterclass_webhook.go b/api/v1beta1/clusterclass_webhook.go similarity index 95% rename from api/v1alpha4/clusterclass_webhook.go rename to api/v1beta1/clusterclass_webhook.go index 08f7ad7ffc64..9c4928c8dcd0 100644 --- a/api/v1alpha4/clusterclass_webhook.go +++ b/api/v1beta1/clusterclass_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "fmt" @@ -37,8 +37,8 @@ func (in *ClusterClass) SetupWebhookWithManager(mgr ctrl.Manager) error { Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-cluster-x-k8s-io-v1alpha4-clusterclass,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=clusterclasses,versions=v1alpha4,name=validation.clusterclass.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-cluster-x-k8s-io-v1alpha4-clusterclass,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=clusterclasses,versions=v1alpha4,name=default.clusterclass.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-cluster-x-k8s-io-v1beta1-clusterclass,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=clusterclasses,versions=v1beta1,name=validation.clusterclass.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-cluster-x-k8s-io-v1beta1-clusterclass,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=clusterclasses,versions=v1beta1,name=default.clusterclass.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 var _ webhook.Validator = &ClusterClass{} var _ webhook.Defaulter = &ClusterClass{} diff --git a/api/v1alpha4/clusterclass_webhook_test.go b/api/v1beta1/clusterclass_webhook_test.go similarity index 99% rename from api/v1alpha4/clusterclass_webhook_test.go rename to api/v1beta1/clusterclass_webhook_test.go index f81997463634..1cef05d83509 100644 --- a/api/v1alpha4/clusterclass_webhook_test.go +++ b/api/v1beta1/clusterclass_webhook_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "testing" diff --git a/api/v1beta1/common_types.go b/api/v1beta1/common_types.go new file mode 100644 index 000000000000..bb63c88a0518 --- /dev/null +++ b/api/v1beta1/common_types.go @@ -0,0 +1,188 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + // ClusterLabelName is the label set on machines linked to a cluster and + // external objects(bootstrap and infrastructure providers). + ClusterLabelName = "cluster.x-k8s.io/cluster-name" + + // ClusterTopologyLabelName is the label set on all the object which are managed as part of a ClusterTopology. + // Deprecated: use ClusterTopologyOwnedLabel instead. + ClusterTopologyLabelName = "cluster.x-k8s.io/topology" + + // ClusterTopologyOwnedLabel is the label set on all the object which are managed as part of a ClusterTopology. + ClusterTopologyOwnedLabel = "topology.cluster.x-k8s.io/owned" + + // ClusterTopologyMachineDeploymentLabelName is the label set on the generated MachineDeployment objects + // to track the name of the MachineDeployment topology it represents. + ClusterTopologyMachineDeploymentLabelName = "topology.cluster.x-k8s.io/deployment-name" + + // ProviderLabelName is the label set on components in the provider manifest. + // This label allows to easily identify all the components belonging to a provider; the clusterctl + // tool uses this label for implementing provider's lifecycle operations. + ProviderLabelName = "cluster.x-k8s.io/provider" + + // ClusterNameAnnotation is the annotation set on nodes identifying the name of the cluster the node belongs to. + ClusterNameAnnotation = "cluster.x-k8s.io/cluster-name" + + // ClusterNamespaceAnnotation is the annotation set on nodes identifying the namespace of the cluster the node belongs to. + ClusterNamespaceAnnotation = "cluster.x-k8s.io/cluster-namespace" + + // MachineAnnotation is the annotation set on nodes identifying the machine the node belongs to. + MachineAnnotation = "cluster.x-k8s.io/machine" + + // OwnerKindAnnotation is the annotation set on nodes identifying the owner kind. + OwnerKindAnnotation = "cluster.x-k8s.io/owner-kind" + + // OwnerNameAnnotation is the annotation set on nodes identifying the owner name. + OwnerNameAnnotation = "cluster.x-k8s.io/owner-name" + + // PausedAnnotation is an annotation that can be applied to any Cluster API + // object to prevent a controller from processing a resource. + // + // Controllers working with Cluster API objects must check the existence of this annotation + // on the reconciled object. + PausedAnnotation = "cluster.x-k8s.io/paused" + + // DisableMachineCreate is an annotation that can be used to signal a MachineSet to stop creating new machines. + // It is utilized in the OnDelete MachineDeploymentStrategy to allow the MachineDeployment controller to scale down + // older MachineSets when Machines are deleted and add the new replicas to the latest MachineSet. + DisableMachineCreate = "cluster.x-k8s.io/disable-machine-create" + + // WatchLabel is a label othat can be applied to any Cluster API object. + // + // Controllers which allow for selective reconciliation may check this label and proceed + // with reconciliation of the object only if this label and a configured value is present. + WatchLabel = "cluster.x-k8s.io/watch-filter" + + // DeleteMachineAnnotation marks control plane and worker nodes that will be given priority for deletion + // when KCP or a machineset scales down. This annotation is given top priority on all delete policies. + DeleteMachineAnnotation = "cluster.x-k8s.io/delete-machine" + + // TemplateClonedFromNameAnnotation is the infrastructure machine annotation that stores the name of the infrastructure template resource + // that was cloned for the machine. This annotation is set only during cloning a template. Older/adopted machines will not have this annotation. + TemplateClonedFromNameAnnotation = "cluster.x-k8s.io/cloned-from-name" + + // TemplateClonedFromGroupKindAnnotation is the infrastructure machine annotation that stores the group-kind of the infrastructure template resource + // that was cloned for the machine. This annotation is set only during cloning a template. Older/adopted machines will not have this annotation. + TemplateClonedFromGroupKindAnnotation = "cluster.x-k8s.io/cloned-from-groupkind" + + // MachineSkipRemediationAnnotation is the annotation used to mark the machines that should not be considered for remediation by MachineHealthCheck reconciler. + MachineSkipRemediationAnnotation = "cluster.x-k8s.io/skip-remediation" + + // ClusterSecretType defines the type of secret created by core components. + ClusterSecretType corev1.SecretType = "cluster.x-k8s.io/secret" //nolint:gosec + + // InterruptibleLabel is the label used to mark the nodes that run on interruptible instances. + InterruptibleLabel = "cluster.x-k8s.io/interruptible" + + // ManagedByAnnotation is an annotation that can be applied to InfraCluster resources to signify that + // some external system is managing the cluster infrastructure. + // + // Provider InfraCluster controllers will ignore resources with this annotation. + // An external controller must fulfill the contract of the InfraCluster resource. + // External infrastructure providers should ensure that the annotation, once set, cannot be removed. + ManagedByAnnotation = "cluster.x-k8s.io/managed-by" +) + +const ( + // TemplateSuffix is the object kind suffix used by template types. + TemplateSuffix = "Template" +) + +var ( + // ZeroDuration is a zero value of the metav1.Duration type. + ZeroDuration = metav1.Duration{} +) + +const ( + // MachineNodeNameIndex is used by the Machine Controller to index Machines by Node name, and add a watch on Nodes. + // Deprecated: Use api/v1beta1/index.MachineNodeNameField instead. + MachineNodeNameIndex = "status.nodeRef.name" + + // MachineProviderIDIndex is used to index Machines by ProviderID. It's useful to find Machines + // in a management cluster from Nodes in a workload cluster. + // Deprecated: Use api/v1beta1/index.MachineProviderIDField instead. + MachineProviderIDIndex = "spec.providerID" +) + +// MachineAddressType describes a valid MachineAddress type. +type MachineAddressType string + +// Define the MachineAddressType constants. +const ( + MachineHostName MachineAddressType = "Hostname" + MachineExternalIP MachineAddressType = "ExternalIP" + MachineInternalIP MachineAddressType = "InternalIP" + MachineExternalDNS MachineAddressType = "ExternalDNS" + MachineInternalDNS MachineAddressType = "InternalDNS" +) + +// MachineAddress contains information for the node's address. +type MachineAddress struct { + // Machine address type, one of Hostname, ExternalIP or InternalIP. + Type MachineAddressType `json:"type"` + + // The machine address. + Address string `json:"address"` +} + +// MachineAddresses is a slice of MachineAddress items to be used by infrastructure providers. +type MachineAddresses []MachineAddress + +// ObjectMeta is metadata that all persisted resources must have, which includes all objects +// users must create. This is a copy of customizable fields from metav1.ObjectMeta. +// +// ObjectMeta is embedded in `Machine.Spec`, `MachineDeployment.Template` and `MachineSet.Template`, +// which are not top-level Kubernetes objects. Given that metav1.ObjectMeta has lots of special cases +// and read-only fields which end up in the generated CRD validation, having it as a subset simplifies +// the API and some issues that can impact user experience. +// +// During the [upgrade to controller-tools@v2](https://github.com/kubernetes-sigs/cluster-api/pull/1054) +// for v1alpha2, we noticed a failure would occur running Cluster API test suite against the new CRDs, +// specifically `spec.metadata.creationTimestamp in body must be of type string: "null"`. +// The investigation showed that `controller-tools@v2` behaves differently than its previous version +// when handling types from [metav1](k8s.io/apimachinery/pkg/apis/meta/v1) package. +// +// In more details, we found that embedded (non-top level) types that embedded `metav1.ObjectMeta` +// had validation properties, including for `creationTimestamp` (metav1.Time). +// The `metav1.Time` type specifies a custom json marshaller that, when IsZero() is true, returns `null` +// which breaks validation because the field isn't marked as nullable. +// +// In future versions, controller-tools@v2 might allow overriding the type and validation for embedded +// types. When that happens, this hack should be revisited. +type ObjectMeta struct { + // Map of string keys and values that can be used to organize and categorize + // (scope and select) objects. May match selectors of replication controllers + // and services. + // More info: http://kubernetes.io/docs/user-guide/labels + // +optional + Labels map[string]string `json:"labels,omitempty"` + + // Annotations is an unstructured key value map stored with a resource that may be + // set by external tools to store and retrieve arbitrary metadata. They are not + // queryable and should be preserved when modifying objects. + // More info: http://kubernetes.io/docs/user-guide/annotations + // +optional + Annotations map[string]string `json:"annotations,omitempty"` +} diff --git a/api/v1beta1/condition_consts.go b/api/v1beta1/condition_consts.go new file mode 100644 index 000000000000..d4e6799c935d --- /dev/null +++ b/api/v1beta1/condition_consts.go @@ -0,0 +1,220 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +// ANCHOR: CommonConditions + +// Common ConditionTypes used by Cluster API objects. +const ( + // ReadyCondition defines the Ready condition type that summarizes the operational state of a Cluster API object. + ReadyCondition ConditionType = "Ready" +) + +// Common ConditionReason used by Cluster API objects. +const ( + // DeletingReason (Severity=Info) documents an condition not in Status=True because the underlying object it is currently being deleted. + DeletingReason = "Deleting" + + // DeletionFailedReason (Severity=Warning) documents an condition not in Status=True because the underlying object + // encountered problems during deletion. This is a warning because the reconciler will retry deletion. + DeletionFailedReason = "DeletionFailed" + + // DeletedReason (Severity=Info) documents an condition not in Status=True because the underlying object was deleted. + DeletedReason = "Deleted" + + // IncorrectExternalRefReason (Severity=Error) documents a CAPI object with an incorrect external object reference. + IncorrectExternalRefReason = "IncorrectExternalRef" +) + +const ( + // InfrastructureReadyCondition reports a summary of current status of the infrastructure object defined for this cluster/machine/machinepool. + // This condition is mirrored from the Ready condition in the infrastructure ref object, and + // the absence of this condition might signal problems in the reconcile external loops or the fact that + // the infrastructure provider does not implement the Ready condition yet. + InfrastructureReadyCondition ConditionType = "InfrastructureReady" + + // WaitingForInfrastructureFallbackReason (Severity=Info) documents a cluster/machine/machinepool waiting for the underlying infrastructure + // to be available. + // NOTE: This reason is used only as a fallback when the infrastructure object is not reporting its own ready condition. + WaitingForInfrastructureFallbackReason = "WaitingForInfrastructure" +) + +// ANCHOR_END: CommonConditions + +// Conditions and condition Reasons for the Cluster object + +const ( + // ControlPlaneInitializedCondition reports if the cluster's control plane has been initialized such that the + // cluster's apiserver is reachable and at least one control plane Machine has a node reference. Once this + // condition is marked true, its value is never changed. See the ControlPlaneReady condition for an indication of + // the current readiness of the cluster's control plane. + ControlPlaneInitializedCondition ConditionType = "ControlPlaneInitialized" + + // MissingNodeRefReason (Severity=Info) documents a cluster waiting for at least one control plane Machine to have + // its node reference populated. + MissingNodeRefReason = "MissingNodeRef" + + // WaitingForControlPlaneProviderInitializedReason (Severity=Info) documents a cluster waiting for the control plane + // provider to report successful control plane initialization. + WaitingForControlPlaneProviderInitializedReason = "WaitingForControlPlaneProviderInitialized" + + // ControlPlaneReadyCondition reports the ready condition from the control plane object defined for this cluster. + // This condition is mirrored from the Ready condition in the control plane ref object, and + // the absence of this condition might signal problems in the reconcile external loops or the fact that + // the control plane provider does not not implements the Ready condition yet. + ControlPlaneReadyCondition ConditionType = "ControlPlaneReady" + + // WaitingForControlPlaneFallbackReason (Severity=Info) documents a cluster waiting for the control plane + // to be available. + // NOTE: This reason is used only as a fallback when the control plane object is not reporting its own ready condition. + WaitingForControlPlaneFallbackReason = "WaitingForControlPlane" + + // WaitingForControlPlaneAvailableReason (Severity=Info) documents a Cluster API object + // waiting for the control plane machine to be available. + // + // NOTE: Having the control plane machine available is a pre-condition for joining additional control planes + // or workers nodes. + WaitingForControlPlaneAvailableReason = "WaitingForControlPlaneAvailable" +) + +// Conditions and condition Reasons for the Machine object + +const ( + // BootstrapReadyCondition reports a summary of current status of the bootstrap object defined for this machine. + // This condition is mirrored from the Ready condition in the bootstrap ref object, and + // the absence of this condition might signal problems in the reconcile external loops or the fact that + // the bootstrap provider does not implement the Ready condition yet. + BootstrapReadyCondition ConditionType = "BootstrapReady" + + // WaitingForDataSecretFallbackReason (Severity=Info) documents a machine waiting for the bootstrap data secret + // to be available. + // NOTE: This reason is used only as a fallback when the bootstrap object is not reporting its own ready condition. + WaitingForDataSecretFallbackReason = "WaitingForDataSecret" + + // DrainingSucceededCondition provide evidence of the status of the node drain operation which happens during the machine + // deletion process. + DrainingSucceededCondition ConditionType = "DrainingSucceeded" + + // DrainingReason (Severity=Info) documents a machine node being drained. + DrainingReason = "Draining" + + // DrainingFailedReason (Severity=Warning) documents a machine node drain operation failed. + DrainingFailedReason = "DrainingFailed" + + // PreDrainDeleteHookSucceededCondition reports a machine waiting for a PreDrainDeleteHook before being delete. + PreDrainDeleteHookSucceededCondition ConditionType = "PreDrainDeleteHookSucceeded" + + // PreTerminateDeleteHookSucceededCondition reports a machine waiting for a PreDrainDeleteHook before being delete. + PreTerminateDeleteHookSucceededCondition ConditionType = "PreTerminateDeleteHookSucceeded" + + // WaitingExternalHookReason (Severity=Info) provide evidence that we are waiting for an external hook to complete. + WaitingExternalHookReason = "WaitingExternalHook" + + // VolumeDetachSucceededCondition reports a machine waiting for volumes to be detached. + VolumeDetachSucceededCondition ConditionType = "VolumeDetachSucceeded" + + // WaitingForVolumeDetachReason (Severity=Info) provide evidence that a machine node waiting for volumes to be attached. + WaitingForVolumeDetachReason = "WaitingForVolumeDetach" +) + +const ( + // MachineHealthCheckSuccededCondition is set on machines that have passed a healthcheck by the MachineHealthCheck controller. + // In the event that the health check fails it will be set to False. + MachineHealthCheckSuccededCondition ConditionType = "HealthCheckSucceeded" + + // MachineHasFailureReason is the reason used when a machine has either a FailureReason or a FailureMessage set on its status. + MachineHasFailureReason = "MachineHasFailure" + + // NodeStartupTimeoutReason is the reason used when a machine's node does not appear within the specified timeout. + NodeStartupTimeoutReason = "NodeStartupTimeout" + + // UnhealthyNodeConditionReason is the reason used when a machine's node has one of the MachineHealthCheck's unhealthy conditions. + UnhealthyNodeConditionReason = "UnhealthyNode" +) + +const ( + // MachineOwnerRemediatedCondition is set on machines that have failed a healthcheck by the MachineHealthCheck controller. + // MachineOwnerRemediatedCondition is set to False after a health check fails, but should be changed to True by the owning controller after remediation succeeds. + MachineOwnerRemediatedCondition ConditionType = "OwnerRemediated" + + // WaitingForRemediationReason is the reason used when a machine fails a health check and remediation is needed. + WaitingForRemediationReason = "WaitingForRemediation" + + // RemediationFailedReason is the reason used when a remediation owner fails to remediate an unhealthy machine. + RemediationFailedReason = "RemediationFailed" + + // RemediationInProgressReason is the reason used when an unhealthy machine is being remediated by the remediation owner. + RemediationInProgressReason = "RemediationInProgress" + + // ExternalRemediationTemplateAvailable is set on machinehealthchecks when MachineHealthCheck controller uses external remediation. + // ExternalRemediationTemplateAvailable is set to false if external remediation template is not found. + ExternalRemediationTemplateAvailable ConditionType = "ExternalRemediationTemplateAvailable" + + // ExternalRemediationTemplateNotFound is the reason used when a machine health check fails to find external remediation template. + ExternalRemediationTemplateNotFound = "ExternalRemediationTemplateNotFound" + + // ExternalRemediationRequestAvailable is set on machinehealthchecks when MachineHealthCheck controller uses external remediation. + // ExternalRemediationRequestAvailable is set to false if creating external remediation request fails. + ExternalRemediationRequestAvailable ConditionType = "ExternalRemediationRequestAvailable" + + // ExternalRemediationRequestCreationFailed is the reason used when a machine health check fails to create external remediation request. + ExternalRemediationRequestCreationFailed = "ExternalRemediationRequestCreationFailed" +) + +// Conditions and condition Reasons for the Machine's Node object. +const ( + // MachineNodeHealthyCondition provides info about the operational state of the Kubernetes node hosted on the machine by summarizing node conditions. + // If the conditions defined in a Kubernetes node (i.e., NodeReady, NodeMemoryPressure, NodeDiskPressure, NodePIDPressure, and NodeNetworkUnavailable) are in a healthy state, it will be set to True. + MachineNodeHealthyCondition ConditionType = "NodeHealthy" + + // WaitingForNodeRefReason (Severity=Info) documents a machine.spec.providerId is not assigned yet. + WaitingForNodeRefReason = "WaitingForNodeRef" + + // NodeProvisioningReason (Severity=Info) documents machine in the process of provisioning a node. + // NB. provisioning --> NodeRef == "". + NodeProvisioningReason = "NodeProvisioning" + + // NodeNotFoundReason (Severity=Error) documents a machine's node has previously been observed but is now gone. + // NB. provisioned --> NodeRef != "". + NodeNotFoundReason = "NodeNotFound" + + // NodeConditionsFailedReason (Severity=Warning) documents a node is not in a healthy state due to the failed state of at least 1 Kubelet condition. + NodeConditionsFailedReason = "NodeConditionsFailed" +) + +// Conditions and condition Reasons for the MachineHealthCheck object + +const ( + // RemediationAllowedCondition is set on MachineHealthChecks to show the status of whether the MachineHealthCheck is + // allowed to remediate any Machines or whether it is blocked from remediating any further. + RemediationAllowedCondition ConditionType = "RemediationAllowed" + + // TooManyUnhealthyReason is the reason used when too many Machines are unhealthy and the MachineHealthCheck is blocked + // from making any further remediations. + TooManyUnhealthyReason = "TooManyUnhealthy" +) + +// Conditions and condition Reasons for MachineDeployments + +const ( + // MachineDeploymentAvailableCondition means the MachineDeployment is available, that is, at least the minimum available + // machines required (i.e. Spec.Replicas-MaxUnavailable when MachineDeploymentStrategyType = RollingUpdate) are up and running for at least minReadySeconds. + MachineDeploymentAvailableCondition ConditionType = "Available" + + // WaitingForAvailableMachinesReason (Severity=Warning) reflects the fact that the required minimum number of machines for a machinedeployment are not available. + WaitingForAvailableMachinesReason = "WaitingForAvailableMachines" +) diff --git a/api/v1beta1/condition_types.go b/api/v1beta1/condition_types.go new file mode 100644 index 000000000000..40f0660acae8 --- /dev/null +++ b/api/v1beta1/condition_types.go @@ -0,0 +1,97 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ANCHOR: ConditionSeverity + +// ConditionSeverity expresses the severity of a Condition Type failing. +type ConditionSeverity string + +const ( + // ConditionSeverityError specifies that a condition with `Status=False` is an error. + ConditionSeverityError ConditionSeverity = "Error" + + // ConditionSeverityWarning specifies that a condition with `Status=False` is a warning. + ConditionSeverityWarning ConditionSeverity = "Warning" + + // ConditionSeverityInfo specifies that a condition with `Status=False` is informative. + ConditionSeverityInfo ConditionSeverity = "Info" + + // ConditionSeverityNone should apply only to conditions with `Status=True`. + ConditionSeverityNone ConditionSeverity = "" +) + +// ANCHOR_END: ConditionSeverity + +// ANCHOR: ConditionType + +// ConditionType is a valid value for Condition.Type. +type ConditionType string + +// ANCHOR_END: ConditionType + +// ANCHOR: Condition + +// Condition defines an observation of a Cluster API resource operational state. +type Condition struct { + // Type of condition in CamelCase or in foo.example.com/CamelCase. + // Many .condition.type values are consistent across resources like Available, but because arbitrary conditions + // can be useful (see .node.status.conditions), the ability to deconflict is important. + // +required + Type ConditionType `json:"type"` + + // Status of the condition, one of True, False, Unknown. + // +required + Status corev1.ConditionStatus `json:"status"` + + // Severity provides an explicit classification of Reason code, so the users or machines can immediately + // understand the current situation and act accordingly. + // The Severity field MUST be set only when Status=False. + // +optional + Severity ConditionSeverity `json:"severity,omitempty"` + + // Last time the condition transitioned from one status to another. + // This should be when the underlying condition changed. If that is not known, then using the time when + // the API field changed is acceptable. + // +required + LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` + + // The reason for the condition's last transition in CamelCase. + // The specific API may choose whether or not this field is considered a guaranteed API. + // This field may not be empty. + // +optional + Reason string `json:"reason,omitempty"` + + // A human readable message indicating details about the transition. + // This field may be empty. + // +optional + Message string `json:"message,omitempty"` +} + +// ANCHOR_END: Condition + +// ANCHOR: Conditions + +// Conditions provide observations of the operational state of a Cluster API resource. +type Conditions []Condition + +// ANCHOR_END: Conditions diff --git a/api/v1beta1/conversion.go b/api/v1beta1/conversion.go new file mode 100644 index 000000000000..b305ca679e49 --- /dev/null +++ b/api/v1beta1/conversion.go @@ -0,0 +1,28 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +func (*Cluster) Hub() {} +func (*ClusterList) Hub() {} +func (*Machine) Hub() {} +func (*MachineList) Hub() {} +func (*MachineSet) Hub() {} +func (*MachineSetList) Hub() {} +func (*MachineDeployment) Hub() {} +func (*MachineDeploymentList) Hub() {} +func (*MachineHealthCheck) Hub() {} +func (*MachineHealthCheckList) Hub() {} diff --git a/api/v1beta1/doc.go b/api/v1beta1/doc.go new file mode 100644 index 000000000000..d55ab5609a7b --- /dev/null +++ b/api/v1beta1/doc.go @@ -0,0 +1,17 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 diff --git a/api/v1beta1/groupversion_info.go b/api/v1beta1/groupversion_info.go new file mode 100644 index 000000000000..d3d2a044cf09 --- /dev/null +++ b/api/v1beta1/groupversion_info.go @@ -0,0 +1,36 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// package v1beta1 contains API Schema definitions for the cluster v1beta1 API group +// +kubebuilder:object:generate=true +// +groupName=cluster.x-k8s.io +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects. + GroupVersion = schema.GroupVersion{Group: "cluster.x-k8s.io", Version: "v1beta1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/api/v1beta1/index/cluster.go b/api/v1beta1/index/cluster.go new file mode 100644 index 000000000000..61245a7798b5 --- /dev/null +++ b/api/v1beta1/index/cluster.go @@ -0,0 +1,55 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package index + +import ( + "context" + "fmt" + + "github.com/pkg/errors" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +const ( + // ClusterClassNameField is used by the Cluster controller to index Clusters by ClusterClass name. + ClusterClassNameField = "spec.topology.class" +) + +// ByClusterClassName adds the cluster class name index to the +// managers cache. +func ByClusterClassName(ctx context.Context, mgr ctrl.Manager) error { + if err := mgr.GetCache().IndexField(ctx, &clusterv1.Cluster{}, + ClusterClassNameField, + clusterByClassName, + ); err != nil { + return errors.Wrap(err, "error setting index field") + } + return nil +} + +func clusterByClassName(o client.Object) []string { + cluster, ok := o.(*clusterv1.Cluster) + if !ok { + panic(fmt.Sprintf("Expected Cluster but got a %T", o)) + } + if cluster.Spec.Topology != nil { + return []string{cluster.Spec.Topology.Class} + } + return nil +} diff --git a/api/v1beta1/index/cluster_test.go b/api/v1beta1/index/cluster_test.go new file mode 100644 index 000000000000..39f53fd016ba --- /dev/null +++ b/api/v1beta1/index/cluster_test.go @@ -0,0 +1,58 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package index + +import ( + "testing" + + . "github.com/onsi/gomega" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +func TestClusterByClassName(t *testing.T) { + testCases := []struct { + name string + object client.Object + expected []string + }{ + { + name: "when cluster has no Topology", + object: &clusterv1.Cluster{}, + expected: nil, + }, + { + name: "when cluster has a valid Topology", + object: &clusterv1.Cluster{ + Spec: clusterv1.ClusterSpec{ + Topology: &clusterv1.Topology{ + Class: "class1", + }, + }, + }, + expected: []string{"class1"}, + }, + } + + for _, test := range testCases { + t.Run(test.name, func(t *testing.T) { + g := NewWithT(t) + got := clusterByClassName(test.object) + g.Expect(got).To(Equal(test.expected)) + }) + } +} diff --git a/api/v1beta1/index/index.go b/api/v1beta1/index/index.go new file mode 100644 index 000000000000..fdbed5663d27 --- /dev/null +++ b/api/v1beta1/index/index.go @@ -0,0 +1,44 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package index provides indexes for the api +package index + +import ( + "context" + + "sigs.k8s.io/cluster-api/feature" + ctrl "sigs.k8s.io/controller-runtime" +) + +// AddDefaultIndexes registers the default list of indexes. +func AddDefaultIndexes(ctx context.Context, mgr ctrl.Manager) error { + if err := ByMachineNode(ctx, mgr); err != nil { + return err + } + + if err := ByMachineProviderID(ctx, mgr); err != nil { + return err + } + + if feature.Gates.Enabled(feature.ClusterTopology) { + if err := ByClusterClassName(ctx, mgr); err != nil { + return err + } + } + + return nil +} diff --git a/api/v1beta1/index/machine.go b/api/v1beta1/index/machine.go new file mode 100644 index 000000000000..40981ce0a84a --- /dev/null +++ b/api/v1beta1/index/machine.go @@ -0,0 +1,93 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package index + +import ( + "context" + "fmt" + + "github.com/pkg/errors" + "k8s.io/utils/pointer" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/controllers/noderefutil" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +const ( + // MachineNodeNameField is used by the Machine Controller to index Machines by Node name, and add a watch on Nodes. + MachineNodeNameField = "status.nodeRef.name" + + // MachineProviderIDField is used to index Machines by ProviderID. It's useful to find Machines + // in a management cluster from Nodes in a workload cluster. + MachineProviderIDField = "spec.providerID" +) + +// ByMachineNode adds the machine node name index to the +// managers cache. +func ByMachineNode(ctx context.Context, mgr ctrl.Manager) error { + if err := mgr.GetCache().IndexField(ctx, &clusterv1.Machine{}, + MachineNodeNameField, + machineByNodeName, + ); err != nil { + return errors.Wrap(err, "error setting index field") + } + + return nil +} + +func machineByNodeName(o client.Object) []string { + machine, ok := o.(*clusterv1.Machine) + if !ok { + panic(fmt.Sprintf("Expected a Machine but got a %T", o)) + } + if machine.Status.NodeRef != nil { + return []string{machine.Status.NodeRef.Name} + } + return nil +} + +// ByMachineProviderID adds the machine providerID index to the +// managers cache. +func ByMachineProviderID(ctx context.Context, mgr ctrl.Manager) error { + if err := mgr.GetCache().IndexField(ctx, &clusterv1.Machine{}, + MachineProviderIDField, + machineByProviderID, + ); err != nil { + return errors.Wrap(err, "error setting index field") + } + + return nil +} + +func machineByProviderID(o client.Object) []string { + machine, ok := o.(*clusterv1.Machine) + if !ok { + panic(fmt.Sprintf("Expected a Machine but got a %T", o)) + } + + if pointer.StringDeref(machine.Spec.ProviderID, "") == "" { + return nil + } + + providerID, err := noderefutil.NewProviderID(*machine.Spec.ProviderID) + if err != nil { + // Failed to create providerID, skipping. + return nil + } + return []string{providerID.IndexKey()} +} diff --git a/api/v1beta1/index/machine_test.go b/api/v1beta1/index/machine_test.go new file mode 100644 index 000000000000..b9f7228718f2 --- /dev/null +++ b/api/v1beta1/index/machine_test.go @@ -0,0 +1,105 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package index + +import ( + "testing" + + . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" + "k8s.io/utils/pointer" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/controllers/noderefutil" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +func TestIndexMachineByNodeName(t *testing.T) { + testCases := []struct { + name string + object client.Object + expected []string + }{ + { + name: "when the machine has no NodeRef", + object: &clusterv1.Machine{}, + expected: []string{}, + }, + { + name: "when the machine has valid a NodeRef", + object: &clusterv1.Machine{ + Status: clusterv1.MachineStatus{ + NodeRef: &corev1.ObjectReference{ + Name: "node1", + }, + }, + }, + expected: []string{"node1"}, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + g := NewWithT(t) + got := machineByNodeName(tc.object) + g.Expect(got).To(ConsistOf(tc.expected)) + }) + } +} + +func TestIndexMachineByProviderID(t *testing.T) { + validProviderID, err := noderefutil.NewProviderID("aws://region/zone/id") + g := NewWithT(t) + g.Expect(err).ToNot(HaveOccurred()) + + testCases := []struct { + name string + object client.Object + expected []string + }{ + { + name: "Machine has no providerID", + object: &clusterv1.Machine{}, + expected: nil, + }, + { + name: "Machine has invalid providerID", + object: &clusterv1.Machine{ + Spec: clusterv1.MachineSpec{ + ProviderID: pointer.String("invalid"), + }, + }, + expected: nil, + }, + { + name: "Machine has valid providerID", + object: &clusterv1.Machine{ + Spec: clusterv1.MachineSpec{ + ProviderID: pointer.String(validProviderID.String()), + }, + }, + expected: []string{validProviderID.IndexKey()}, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + g := NewWithT(t) + got := machineByProviderID(tc.object) + g.Expect(got).To(BeEquivalentTo(tc.expected)) + }) + } +} diff --git a/api/v1beta1/index/node.go b/api/v1beta1/index/node.go new file mode 100644 index 000000000000..63b4abe799f8 --- /dev/null +++ b/api/v1beta1/index/node.go @@ -0,0 +1,50 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package index + +import ( + "fmt" + + corev1 "k8s.io/api/core/v1" + "sigs.k8s.io/cluster-api/controllers/noderefutil" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +const ( + // NodeProviderIDField is used to index Nodes by ProviderID. Remote caches use this to find Nodes in a workload cluster + // out of management cluster machine.spec.providerID. + NodeProviderIDField = "spec.providerID" +) + +// NodeByProviderID contains the logic to index Nodes by ProviderID. +func NodeByProviderID(o client.Object) []string { + node, ok := o.(*corev1.Node) + if !ok { + panic(fmt.Sprintf("Expected a Node but got a %T", o)) + } + + if node.Spec.ProviderID == "" { + return nil + } + + providerID, err := noderefutil.NewProviderID(node.Spec.ProviderID) + if err != nil { + // Failed to create providerID, skipping. + return nil + } + return []string{providerID.IndexKey()} +} diff --git a/api/v1beta1/index/node_test.go b/api/v1beta1/index/node_test.go new file mode 100644 index 000000000000..e442c821881b --- /dev/null +++ b/api/v1beta1/index/node_test.go @@ -0,0 +1,70 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package index + +import ( + "testing" + + . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" + "sigs.k8s.io/cluster-api/controllers/noderefutil" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +func TestIndexNodeByProviderID(t *testing.T) { + validProviderID, err := noderefutil.NewProviderID("aws://region/zone/id") + g := NewWithT(t) + g.Expect(err).ToNot(HaveOccurred()) + + testCases := []struct { + name string + object client.Object + expected []string + }{ + { + name: "Node has no providerID", + object: &corev1.Node{}, + expected: nil, + }, + { + name: "Node has invalid providerID", + object: &corev1.Node{ + Spec: corev1.NodeSpec{ + ProviderID: "invalid", + }, + }, + expected: nil, + }, + { + name: "Node has valid providerID", + object: &corev1.Node{ + Spec: corev1.NodeSpec{ + ProviderID: validProviderID.String(), + }, + }, + expected: []string{validProviderID.IndexKey()}, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + g := NewWithT(t) + got := NodeByProviderID(tc.object) + g.Expect(got).To(BeEquivalentTo(tc.expected)) + }) + } +} diff --git a/api/v1beta1/machine_phase_types.go b/api/v1beta1/machine_phase_types.go new file mode 100644 index 000000000000..10e10e246db0 --- /dev/null +++ b/api/v1beta1/machine_phase_types.go @@ -0,0 +1,64 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +// MachinePhase is a string representation of a Machine Phase. +// +// This type is a high-level indicator of the status of the Machine as it is provisioned, +// from the API user’s perspective. +// +// The value should not be interpreted by any software components as a reliable indication +// of the actual state of the Machine, and controllers should not use the Machine Phase field +// value when making decisions about what action to take. +// +// Controllers should always look at the actual state of the Machine’s fields to make those decisions. +type MachinePhase string + +const ( + // MachinePhasePending is the first state a Machine is assigned by + // Cluster API Machine controller after being created. + MachinePhasePending = MachinePhase("Pending") + + // MachinePhaseProvisioning is the state when the + // Machine infrastructure is being created. + MachinePhaseProvisioning = MachinePhase("Provisioning") + + // MachinePhaseProvisioned is the state when its + // infrastructure has been created and configured. + MachinePhaseProvisioned = MachinePhase("Provisioned") + + // MachinePhaseRunning is the Machine state when it has + // become a Kubernetes Node in a Ready state. + MachinePhaseRunning = MachinePhase("Running") + + // MachinePhaseDeleting is the Machine state when a delete + // request has been sent to the API Server, + // but its infrastructure has not yet been fully deleted. + MachinePhaseDeleting = MachinePhase("Deleting") + + // MachinePhaseDeleted is the Machine state when the object + // and the related infrastructure is deleted and + // ready to be garbage collected by the API Server. + MachinePhaseDeleted = MachinePhase("Deleted") + + // MachinePhaseFailed is the Machine state when the system + // might require user intervention. + MachinePhaseFailed = MachinePhase("Failed") + + // MachinePhaseUnknown is returned if the Machine state cannot be determined. + MachinePhaseUnknown = MachinePhase("Unknown") +) diff --git a/api/v1beta1/machine_types.go b/api/v1beta1/machine_types.go new file mode 100644 index 000000000000..da5b06d31498 --- /dev/null +++ b/api/v1beta1/machine_types.go @@ -0,0 +1,276 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + capierrors "sigs.k8s.io/cluster-api/errors" +) + +const ( + // MachineFinalizer is set on PrepareForCreate callback. + MachineFinalizer = "machine.cluster.x-k8s.io" + + // MachineControlPlaneLabelName is the label set on machines or related objects that are part of a control plane. + MachineControlPlaneLabelName = "cluster.x-k8s.io/control-plane" + + // ExcludeNodeDrainingAnnotation annotation explicitly skips node draining if set. + ExcludeNodeDrainingAnnotation = "machine.cluster.x-k8s.io/exclude-node-draining" + + // MachineSetLabelName is the label set on machines if they're controlled by MachineSet. + MachineSetLabelName = "cluster.x-k8s.io/set-name" + + // MachineDeploymentLabelName is the label set on machines if they're controlled by MachineDeployment. + MachineDeploymentLabelName = "cluster.x-k8s.io/deployment-name" + + // PreDrainDeleteHookAnnotationPrefix annotation specifies the prefix we + // search each annotation for during the pre-drain.delete lifecycle hook + // to pause reconciliation of deletion. These hooks will prevent removal of + // draining the associated node until all are removed. + PreDrainDeleteHookAnnotationPrefix = "pre-drain.delete.hook.machine.cluster.x-k8s.io" + + // PreTerminateDeleteHookAnnotationPrefix annotation specifies the prefix we + // search each annotation for during the pre-terminate.delete lifecycle hook + // to pause reconciliation of deletion. These hooks will prevent removal of + // an instance from an infrastructure provider until all are removed. + PreTerminateDeleteHookAnnotationPrefix = "pre-terminate.delete.hook.machine.cluster.x-k8s.io" +) + +// ANCHOR: MachineSpec + +// MachineSpec defines the desired state of Machine. +type MachineSpec struct { + // ClusterName is the name of the Cluster this object belongs to. + // +kubebuilder:validation:MinLength=1 + ClusterName string `json:"clusterName"` + + // Bootstrap is a reference to a local struct which encapsulates + // fields to configure the Machine’s bootstrapping mechanism. + Bootstrap Bootstrap `json:"bootstrap"` + + // InfrastructureRef is a required reference to a custom resource + // offered by an infrastructure provider. + InfrastructureRef corev1.ObjectReference `json:"infrastructureRef"` + + // Version defines the desired Kubernetes version. + // This field is meant to be optionally used by bootstrap providers. + // +optional + Version *string `json:"version,omitempty"` + + // ProviderID is the identification ID of the machine provided by the provider. + // This field must match the provider ID as seen on the node object corresponding to this machine. + // This field is required by higher level consumers of cluster-api. Example use case is cluster autoscaler + // with cluster-api as provider. Clean-up logic in the autoscaler compares machines to nodes to find out + // machines at provider which could not get registered as Kubernetes nodes. With cluster-api as a + // generic out-of-tree provider for autoscaler, this field is required by autoscaler to be + // able to have a provider view of the list of machines. Another list of nodes is queried from the k8s apiserver + // and then a comparison is done to find out unregistered machines and are marked for delete. + // This field will be set by the actuators and consumed by higher level entities like autoscaler that will + // be interfacing with cluster-api as generic provider. + // +optional + ProviderID *string `json:"providerID,omitempty"` + + // FailureDomain is the failure domain the machine will be created in. + // Must match a key in the FailureDomains map stored on the cluster object. + // +optional + FailureDomain *string `json:"failureDomain,omitempty"` + + // NodeDrainTimeout is the total amount of time that the controller will spend on draining a node. + // The default value is 0, meaning that the node can be drained without any time limitations. + // NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` + // +optional + NodeDrainTimeout *metav1.Duration `json:"nodeDrainTimeout,omitempty"` +} + +// ANCHOR_END: MachineSpec + +// ANCHOR: MachineStatus + +// MachineStatus defines the observed state of Machine. +type MachineStatus struct { + // NodeRef will point to the corresponding Node if it exists. + // +optional + NodeRef *corev1.ObjectReference `json:"nodeRef,omitempty"` + + // NodeInfo is a set of ids/uuids to uniquely identify the node. + // More info: https://kubernetes.io/docs/concepts/nodes/node/#info + // +optional + NodeInfo *corev1.NodeSystemInfo `json:"nodeInfo,omitempty"` + + // LastUpdated identifies when the phase of the Machine last transitioned. + // +optional + LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` + + // Version specifies the current version of Kubernetes running + // on the corresponding Node. This is meant to be a means of bubbling + // up status from the Node to the Machine. + // It is entirely optional, but useful for end-user UX if it’s present. + // +optional + Version *string `json:"version,omitempty"` + + // FailureReason will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a succinct value suitable + // for machine interpretation. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // +optional + FailureReason *capierrors.MachineStatusError `json:"failureReason,omitempty"` + + // FailureMessage will be set in the event that there is a terminal problem + // reconciling the Machine and will contain a more verbose string suitable + // for logging and human consumption. + // + // This field should not be set for transitive errors that a controller + // faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the Machine's spec or the configuration of + // the controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the controller, or the + // responsible controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the Machine object and/or logged in the + // controller's output. + // +optional + FailureMessage *string `json:"failureMessage,omitempty"` + + // Addresses is a list of addresses assigned to the machine. + // This field is copied from the infrastructure provider reference. + // +optional + Addresses MachineAddresses `json:"addresses,omitempty"` + + // Phase represents the current phase of machine actuation. + // E.g. Pending, Running, Terminating, Failed etc. + // +optional + Phase string `json:"phase,omitempty"` + + // BootstrapReady is the state of the bootstrap provider. + // +optional + BootstrapReady bool `json:"bootstrapReady"` + + // InfrastructureReady is the state of the infrastructure provider. + // +optional + InfrastructureReady bool `json:"infrastructureReady"` + + // ObservedGeneration is the latest generation observed by the controller. + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // Conditions defines current service state of the Machine. + // +optional + Conditions Conditions `json:"conditions,omitempty"` +} + +// ANCHOR_END: MachineStatus + +// SetTypedPhase sets the Phase field to the string representation of MachinePhase. +func (m *MachineStatus) SetTypedPhase(p MachinePhase) { + m.Phase = string(p) +} + +// GetTypedPhase attempts to parse the Phase field and return +// the typed MachinePhase representation as described in `machine_phase_types.go`. +func (m *MachineStatus) GetTypedPhase() MachinePhase { + switch phase := MachinePhase(m.Phase); phase { + case + MachinePhasePending, + MachinePhaseProvisioning, + MachinePhaseProvisioned, + MachinePhaseRunning, + MachinePhaseDeleting, + MachinePhaseDeleted, + MachinePhaseFailed: + return phase + default: + return MachinePhaseUnknown + } +} + +// ANCHOR: Bootstrap + +// Bootstrap encapsulates fields to configure the Machine’s bootstrapping mechanism. +type Bootstrap struct { + // ConfigRef is a reference to a bootstrap provider-specific resource + // that holds configuration details. The reference is optional to + // allow users/operators to specify Bootstrap.DataSecretName without + // the need of a controller. + // +optional + ConfigRef *corev1.ObjectReference `json:"configRef,omitempty"` + + // DataSecretName is the name of the secret that stores the bootstrap data script. + // If nil, the Machine should remain in the Pending state. + // +optional + DataSecretName *string `json:"dataSecretName,omitempty"` +} + +// ANCHOR_END: Bootstrap + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=machines,shortName=ma,scope=Namespaced,categories=cluster-api +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Machine" +// +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="Provider ID" +// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Machine status such as Terminating/Pending/Running/Failed etc" +// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version",description="Kubernetes version associated with this Machine" +// +kubebuilder:printcolumn:name="NodeName",type="string",JSONPath=".status.nodeRef.name",description="Node name associated with this machine",priority=1 + +// Machine is the Schema for the machines API. +type Machine struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec MachineSpec `json:"spec,omitempty"` + Status MachineStatus `json:"status,omitempty"` +} + +// GetConditions returns the set of conditions for this object. +func (m *Machine) GetConditions() Conditions { + return m.Status.Conditions +} + +// SetConditions sets the conditions on this object. +func (m *Machine) SetConditions(conditions Conditions) { + m.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// MachineList contains a list of Machine. +type MachineList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []Machine `json:"items"` +} + +func init() { + SchemeBuilder.Register(&Machine{}, &MachineList{}) +} diff --git a/api/v1alpha4/machine_webhook.go b/api/v1beta1/machine_webhook.go similarity index 88% rename from api/v1alpha4/machine_webhook.go rename to api/v1beta1/machine_webhook.go index 9e2430029146..cce7981ea393 100644 --- a/api/v1alpha4/machine_webhook.go +++ b/api/v1beta1/machine_webhook.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "fmt" @@ -35,8 +35,8 @@ func (m *Machine) SetupWebhookWithManager(mgr ctrl.Manager) error { Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-cluster-x-k8s-io-v1alpha4-machine,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machines,versions=v1alpha4,name=validation.machine.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-cluster-x-k8s-io-v1alpha4-machine,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machines,versions=v1alpha4,name=default.machine.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-cluster-x-k8s-io-v1beta1-machine,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machines,versions=v1beta1,name=validation.machine.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-cluster-x-k8s-io-v1beta1-machine,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machines,versions=v1beta1,name=default.machine.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 var _ webhook.Validator = &Machine{} var _ webhook.Defaulter = &Machine{} diff --git a/api/v1alpha4/machine_webhook_test.go b/api/v1beta1/machine_webhook_test.go similarity index 99% rename from api/v1alpha4/machine_webhook_test.go rename to api/v1beta1/machine_webhook_test.go index ce18043f4a7a..fd18f564ea82 100644 --- a/api/v1alpha4/machine_webhook_test.go +++ b/api/v1beta1/machine_webhook_test.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "testing" diff --git a/api/v1beta1/machinedeployment_types.go b/api/v1beta1/machinedeployment_types.go new file mode 100644 index 000000000000..f43d2d4df5fc --- /dev/null +++ b/api/v1beta1/machinedeployment_types.go @@ -0,0 +1,311 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/intstr" +) + +const ( + // MachineDeploymentTopologyFinalizer is the finalizer used by the topology MachineDeployment controller to + // clean up referenced template resources if necessary when a MachineDeployment is being deleted. + MachineDeploymentTopologyFinalizer = "machinedeployment.topology.cluster.x-k8s.io" +) + +// MachineDeploymentStrategyType defines the type of MachineDeployment rollout strategies. +type MachineDeploymentStrategyType string + +const ( + // RollingUpdateMachineDeploymentStrategyType replaces the old MachineSet by new one using rolling update + // i.e. gradually scale down the old MachineSet and scale up the new one. + RollingUpdateMachineDeploymentStrategyType MachineDeploymentStrategyType = "RollingUpdate" + + // OnDeleteMachineDeploymentStrategyType replaces old MachineSets when the deletion of the associated machines are completed. + OnDeleteMachineDeploymentStrategyType MachineDeploymentStrategyType = "OnDelete" + + // RevisionAnnotation is the revision annotation of a machine deployment's machine sets which records its rollout sequence. + RevisionAnnotation = "machinedeployment.clusters.x-k8s.io/revision" + + // RevisionHistoryAnnotation maintains the history of all old revisions that a machine set has served for a machine deployment. + RevisionHistoryAnnotation = "machinedeployment.clusters.x-k8s.io/revision-history" + + // DesiredReplicasAnnotation is the desired replicas for a machine deployment recorded as an annotation + // in its machine sets. Helps in separating scaling events from the rollout process and for + // determining if the new machine set for a deployment is really saturated. + DesiredReplicasAnnotation = "machinedeployment.clusters.x-k8s.io/desired-replicas" + + // MaxReplicasAnnotation is the maximum replicas a deployment can have at a given point, which + // is machinedeployment.spec.replicas + maxSurge. Used by the underlying machine sets to estimate their + // proportions in case the deployment has surge replicas. + MaxReplicasAnnotation = "machinedeployment.clusters.x-k8s.io/max-replicas" +) + +// ANCHOR: MachineDeploymentSpec + +// MachineDeploymentSpec defines the desired state of MachineDeployment. +type MachineDeploymentSpec struct { + // ClusterName is the name of the Cluster this object belongs to. + // +kubebuilder:validation:MinLength=1 + ClusterName string `json:"clusterName"` + + // Number of desired machines. Defaults to 1. + // This is a pointer to distinguish between explicit zero and not specified. + // +optional + // +kubebuilder:default=1 + Replicas *int32 `json:"replicas,omitempty"` + + // Label selector for machines. Existing MachineSets whose machines are + // selected by this will be the ones affected by this deployment. + // It must match the machine template's labels. + Selector metav1.LabelSelector `json:"selector"` + + // Template describes the machines that will be created. + Template MachineTemplateSpec `json:"template"` + + // The deployment strategy to use to replace existing machines with + // new ones. + // +optional + Strategy *MachineDeploymentStrategy `json:"strategy,omitempty"` + + // Minimum number of seconds for which a newly created machine should + // be ready. + // Defaults to 0 (machine will be considered available as soon as it + // is ready) + // +optional + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` + + // The number of old MachineSets to retain to allow rollback. + // This is a pointer to distinguish between explicit zero and not specified. + // Defaults to 1. + // +optional + RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` + + // Indicates that the deployment is paused. + // +optional + Paused bool `json:"paused,omitempty"` + + // The maximum time in seconds for a deployment to make progress before it + // is considered to be failed. The deployment controller will continue to + // process failed deployments and a condition with a ProgressDeadlineExceeded + // reason will be surfaced in the deployment status. Note that progress will + // not be estimated during the time a deployment is paused. Defaults to 600s. + ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` +} + +// ANCHOR_END: MachineDeploymentSpec + +// ANCHOR: MachineDeploymentStrategy + +// MachineDeploymentStrategy describes how to replace existing machines +// with new ones. +type MachineDeploymentStrategy struct { + // Type of deployment. + // Default is RollingUpdate. + // +kubebuilder:validation:Enum=RollingUpdate;OnDelete + // +optional + Type MachineDeploymentStrategyType `json:"type,omitempty"` + + // Rolling update config params. Present only if + // MachineDeploymentStrategyType = RollingUpdate. + // +optional + RollingUpdate *MachineRollingUpdateDeployment `json:"rollingUpdate,omitempty"` +} + +// ANCHOR_END: MachineDeploymentStrategy + +// ANCHOR: MachineRollingUpdateDeployment + +// MachineRollingUpdateDeployment is used to control the desired behavior of rolling update. +type MachineRollingUpdateDeployment struct { + // The maximum number of machines that can be unavailable during the update. + // Value can be an absolute number (ex: 5) or a percentage of desired + // machines (ex: 10%). + // Absolute number is calculated from percentage by rounding down. + // This can not be 0 if MaxSurge is 0. + // Defaults to 0. + // Example: when this is set to 30%, the old MachineSet can be scaled + // down to 70% of desired machines immediately when the rolling update + // starts. Once new machines are ready, old MachineSet can be scaled + // down further, followed by scaling up the new MachineSet, ensuring + // that the total number of machines available at all times + // during the update is at least 70% of desired machines. + // +optional + MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` + + // The maximum number of machines that can be scheduled above the + // desired number of machines. + // Value can be an absolute number (ex: 5) or a percentage of + // desired machines (ex: 10%). + // This can not be 0 if MaxUnavailable is 0. + // Absolute number is calculated from percentage by rounding up. + // Defaults to 1. + // Example: when this is set to 30%, the new MachineSet can be scaled + // up immediately when the rolling update starts, such that the total + // number of old and new machines do not exceed 130% of desired + // machines. Once old machines have been killed, new MachineSet can + // be scaled up further, ensuring that total number of machines running + // at any time during the update is at most 130% of desired machines. + // +optional + MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` + + // DeletePolicy defines the policy used by the MachineDeployment to identify nodes to delete when downscaling. + // Valid values are "Random, "Newest", "Oldest" + // When no value is supplied, the default DeletePolicy of MachineSet is used + // +kubebuilder:validation:Enum=Random;Newest;Oldest + // +optional + DeletePolicy *string `json:"deletePolicy,omitempty"` +} + +// ANCHOR_END: MachineRollingUpdateDeployment + +// ANCHOR: MachineDeploymentStatus + +// MachineDeploymentStatus defines the observed state of MachineDeployment. +type MachineDeploymentStatus struct { + // The generation observed by the deployment controller. + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // Selector is the same as the label selector but in the string format to avoid introspection + // by clients. The string will be in the same format as the query-param syntax. + // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors + // +optional + Selector string `json:"selector,omitempty"` + + // Total number of non-terminated machines targeted by this deployment + // (their labels match the selector). + // +optional + Replicas int32 `json:"replicas,omitempty"` + + // Total number of non-terminated machines targeted by this deployment + // that have the desired template spec. + // +optional + UpdatedReplicas int32 `json:"updatedReplicas,omitempty"` + + // Total number of ready machines targeted by this deployment. + // +optional + ReadyReplicas int32 `json:"readyReplicas,omitempty"` + + // Total number of available machines (ready for at least minReadySeconds) + // targeted by this deployment. + // +optional + AvailableReplicas int32 `json:"availableReplicas,omitempty"` + + // Total number of unavailable machines targeted by this deployment. + // This is the total number of machines that are still required for + // the deployment to have 100% available capacity. They may either + // be machines that are running but not yet available or machines + // that still have not been created. + // +optional + UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"` + + // Phase represents the current phase of a MachineDeployment (ScalingUp, ScalingDown, Running, Failed, or Unknown). + // +optional + Phase string `json:"phase,omitempty"` + + // Conditions defines current service state of the MachineDeployment. + // +optional + Conditions Conditions `json:"conditions,omitempty"` +} + +// ANCHOR_END: MachineDeploymentStatus + +// MachineDeploymentPhase indicates the progress of the machine deployment. +type MachineDeploymentPhase string + +const ( + // MachineDeploymentPhaseScalingUp indicates the MachineDeployment is scaling up. + MachineDeploymentPhaseScalingUp = MachineDeploymentPhase("ScalingUp") + + // MachineDeploymentPhaseScalingDown indicates the MachineDeployment is scaling down. + MachineDeploymentPhaseScalingDown = MachineDeploymentPhase("ScalingDown") + + // MachineDeploymentPhaseRunning indicates scaling has completed and all Machines are running. + MachineDeploymentPhaseRunning = MachineDeploymentPhase("Running") + + // MachineDeploymentPhaseFailed indicates there was a problem scaling and user intervention might be required. + MachineDeploymentPhaseFailed = MachineDeploymentPhase("Failed") + + // MachineDeploymentPhaseUnknown indicates the state of the MachineDeployment cannot be determined. + MachineDeploymentPhaseUnknown = MachineDeploymentPhase("Unknown") +) + +// SetTypedPhase sets the Phase field to the string representation of MachineDeploymentPhase. +func (md *MachineDeploymentStatus) SetTypedPhase(p MachineDeploymentPhase) { + md.Phase = string(p) +} + +// GetTypedPhase attempts to parse the Phase field and return +// the typed MachineDeploymentPhase representation. +func (md *MachineDeploymentStatus) GetTypedPhase() MachineDeploymentPhase { + switch phase := MachineDeploymentPhase(md.Phase); phase { + case + MachineDeploymentPhaseScalingDown, + MachineDeploymentPhaseScalingUp, + MachineDeploymentPhaseRunning, + MachineDeploymentPhaseFailed: + return phase + default: + return MachineDeploymentPhaseUnknown + } +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=machinedeployments,shortName=md,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachineDeployment" +// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="MachineDeployment status such as ScalingUp/ScalingDown/Running/Failed/Unknown" +// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Total number of non-terminated machines targeted by this MachineDeployment" +// +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="Total number of ready machines targeted by this MachineDeployment" +// +kubebuilder:printcolumn:name="Updated",type=integer,JSONPath=".status.updatedReplicas",description="Total number of non-terminated machines targeted by this deployment that have the desired template spec" +// +kubebuilder:printcolumn:name="Unavailable",type=integer,JSONPath=".status.unavailableReplicas",description="Total number of unavailable machines targeted by this MachineDeployment" + +// MachineDeployment is the Schema for the machinedeployments API. +type MachineDeployment struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec MachineDeploymentSpec `json:"spec,omitempty"` + Status MachineDeploymentStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// MachineDeploymentList contains a list of MachineDeployment. +type MachineDeploymentList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []MachineDeployment `json:"items"` +} + +func init() { + SchemeBuilder.Register(&MachineDeployment{}, &MachineDeploymentList{}) +} + +// GetConditions returns the set of conditions for the machinedeployment. +func (m *MachineDeployment) GetConditions() Conditions { + return m.Status.Conditions +} + +// SetConditions updates the set of conditions on the machinedeployment. +func (m *MachineDeployment) SetConditions(conditions Conditions) { + m.Status.Conditions = conditions +} diff --git a/api/v1alpha4/machinedeployment_webhook.go b/api/v1beta1/machinedeployment_webhook.go similarity index 92% rename from api/v1alpha4/machinedeployment_webhook.go rename to api/v1beta1/machinedeployment_webhook.go index bec7c6d4a9d9..b9a688e59720 100644 --- a/api/v1alpha4/machinedeployment_webhook.go +++ b/api/v1beta1/machinedeployment_webhook.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "fmt" @@ -38,8 +38,8 @@ func (m *MachineDeployment) SetupWebhookWithManager(mgr ctrl.Manager) error { Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-cluster-x-k8s-io-v1alpha4-machinedeployment,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machinedeployments,versions=v1alpha4,name=validation.machinedeployment.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-cluster-x-k8s-io-v1alpha4-machinedeployment,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machinedeployments,versions=v1alpha4,name=default.machinedeployment.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-cluster-x-k8s-io-v1beta1-machinedeployment,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machinedeployments,versions=v1beta1,name=validation.machinedeployment.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-cluster-x-k8s-io-v1beta1-machinedeployment,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machinedeployments,versions=v1beta1,name=default.machinedeployment.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 var _ webhook.Defaulter = &MachineDeployment{} var _ webhook.Validator = &MachineDeployment{} diff --git a/api/v1alpha4/machinedeployment_webhook_test.go b/api/v1beta1/machinedeployment_webhook_test.go similarity index 99% rename from api/v1alpha4/machinedeployment_webhook_test.go rename to api/v1beta1/machinedeployment_webhook_test.go index 4fa91f8c032d..f997735252da 100644 --- a/api/v1alpha4/machinedeployment_webhook_test.go +++ b/api/v1beta1/machinedeployment_webhook_test.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "testing" diff --git a/api/v1beta1/machinehealthcheck_types.go b/api/v1beta1/machinehealthcheck_types.go new file mode 100644 index 000000000000..e730cd55072f --- /dev/null +++ b/api/v1beta1/machinehealthcheck_types.go @@ -0,0 +1,170 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/intstr" +) + +// ANCHOR: MachineHealthCheckSpec + +// MachineHealthCheckSpec defines the desired state of MachineHealthCheck. +type MachineHealthCheckSpec struct { + // ClusterName is the name of the Cluster this object belongs to. + // +kubebuilder:validation:MinLength=1 + ClusterName string `json:"clusterName"` + + // Label selector to match machines whose health will be exercised + Selector metav1.LabelSelector `json:"selector"` + + // UnhealthyConditions contains a list of the conditions that determine + // whether a node is considered unhealthy. The conditions are combined in a + // logical OR, i.e. if any of the conditions is met, the node is unhealthy. + // + // +kubebuilder:validation:MinItems=1 + UnhealthyConditions []UnhealthyCondition `json:"unhealthyConditions"` + + // Any further remediation is only allowed if at most "MaxUnhealthy" machines selected by + // "selector" are not healthy. + // +optional + MaxUnhealthy *intstr.IntOrString `json:"maxUnhealthy,omitempty"` + + // Any further remediation is only allowed if the number of machines selected by "selector" as not healthy + // is within the range of "UnhealthyRange". Takes precedence over MaxUnhealthy. + // Eg. "[3-5]" - This means that remediation will be allowed only when: + // (a) there are at least 3 unhealthy machines (and) + // (b) there are at most 5 unhealthy machines + // +optional + // +kubebuilder:validation:Pattern=^\[[0-9]+-[0-9]+\]$ + UnhealthyRange *string `json:"unhealthyRange,omitempty"` + + // Machines older than this duration without a node will be considered to have + // failed and will be remediated. + // If not set, this value is defaulted to 10 minutes. + // If you wish to disable this feature, set the value explicitly to 0. + // +optional + NodeStartupTimeout *metav1.Duration `json:"nodeStartupTimeout,omitempty"` + + // RemediationTemplate is a reference to a remediation template + // provided by an infrastructure provider. + // + // This field is completely optional, when filled, the MachineHealthCheck controller + // creates a new object from the template referenced and hands off remediation of the machine to + // a controller that lives outside of Cluster API. + // +optional + RemediationTemplate *corev1.ObjectReference `json:"remediationTemplate,omitempty"` +} + +// ANCHOR_END: MachineHealthCHeckSpec + +// ANCHOR: UnhealthyCondition + +// UnhealthyCondition represents a Node condition type and value with a timeout +// specified as a duration. When the named condition has been in the given +// status for at least the timeout value, a node is considered unhealthy. +type UnhealthyCondition struct { + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MinLength=1 + Type corev1.NodeConditionType `json:"type"` + + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MinLength=1 + Status corev1.ConditionStatus `json:"status"` + + Timeout metav1.Duration `json:"timeout"` +} + +// ANCHOR_END: UnhealthyCondition + +// ANCHOR: MachineHealthCheckStatus + +// MachineHealthCheckStatus defines the observed state of MachineHealthCheck. +type MachineHealthCheckStatus struct { + // total number of machines counted by this machine health check + // +kubebuilder:validation:Minimum=0 + ExpectedMachines int32 `json:"expectedMachines,omitempty"` + + // total number of healthy machines counted by this machine health check + // +kubebuilder:validation:Minimum=0 + CurrentHealthy int32 `json:"currentHealthy,omitempty"` + + // RemediationsAllowed is the number of further remediations allowed by this machine health check before + // maxUnhealthy short circuiting will be applied + // +kubebuilder:validation:Minimum=0 + RemediationsAllowed int32 `json:"remediationsAllowed,omitempty"` + + // ObservedGeneration is the latest generation observed by the controller. + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // Targets shows the current list of machines the machine health check is watching + // +optional + Targets []string `json:"targets,omitempty"` + + // Conditions defines current service state of the MachineHealthCheck. + // +optional + Conditions Conditions `json:"conditions,omitempty"` +} + +// ANCHOR_END: MachineHealthCheckStatus + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=machinehealthchecks,shortName=mhc;mhcs,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachineHealthCheck" +// +kubebuilder:printcolumn:name="MaxUnhealthy",type="string",JSONPath=".spec.maxUnhealthy",description="Maximum number of unhealthy machines allowed" +// +kubebuilder:printcolumn:name="ExpectedMachines",type="integer",JSONPath=".status.expectedMachines",description="Number of machines currently monitored" +// +kubebuilder:printcolumn:name="CurrentHealthy",type="integer",JSONPath=".status.currentHealthy",description="Current observed healthy machines" + +// MachineHealthCheck is the Schema for the machinehealthchecks API. +type MachineHealthCheck struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Specification of machine health check policy + Spec MachineHealthCheckSpec `json:"spec,omitempty"` + + // Most recently observed status of MachineHealthCheck resource + Status MachineHealthCheckStatus `json:"status,omitempty"` +} + +// GetConditions returns the set of conditions for this object. +func (m *MachineHealthCheck) GetConditions() Conditions { + return m.Status.Conditions +} + +// SetConditions sets the conditions on this object. +func (m *MachineHealthCheck) SetConditions(conditions Conditions) { + m.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// MachineHealthCheckList contains a list of MachineHealthCheck. +type MachineHealthCheckList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []MachineHealthCheck `json:"items"` +} + +func init() { + SchemeBuilder.Register(&MachineHealthCheck{}, &MachineHealthCheckList{}) +} diff --git a/api/v1alpha4/machinehealthcheck_webhook.go b/api/v1beta1/machinehealthcheck_webhook.go similarity index 90% rename from api/v1alpha4/machinehealthcheck_webhook.go rename to api/v1beta1/machinehealthcheck_webhook.go index b9cfbb2ca0f8..d8b88b5d1912 100644 --- a/api/v1alpha4/machinehealthcheck_webhook.go +++ b/api/v1beta1/machinehealthcheck_webhook.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "fmt" @@ -56,8 +56,8 @@ func (m *MachineHealthCheck) SetupWebhookWithManager(mgr ctrl.Manager) error { Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-cluster-x-k8s-io-v1alpha4-machinehealthcheck,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machinehealthchecks,versions=v1alpha4,name=validation.machinehealthcheck.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-cluster-x-k8s-io-v1alpha4-machinehealthcheck,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machinehealthchecks,versions=v1alpha4,name=default.machinehealthcheck.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-cluster-x-k8s-io-v1beta1-machinehealthcheck,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machinehealthchecks,versions=v1beta1,name=validation.machinehealthcheck.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-cluster-x-k8s-io-v1beta1-machinehealthcheck,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machinehealthchecks,versions=v1beta1,name=default.machinehealthcheck.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 var _ webhook.Defaulter = &MachineHealthCheck{} var _ webhook.Validator = &MachineHealthCheck{} diff --git a/api/v1alpha4/machinehealthcheck_webhook_test.go b/api/v1beta1/machinehealthcheck_webhook_test.go similarity index 99% rename from api/v1alpha4/machinehealthcheck_webhook_test.go rename to api/v1beta1/machinehealthcheck_webhook_test.go index 3eaa4a73e880..08e779cdd4c3 100644 --- a/api/v1alpha4/machinehealthcheck_webhook_test.go +++ b/api/v1beta1/machinehealthcheck_webhook_test.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "testing" diff --git a/api/v1beta1/machineset_types.go b/api/v1beta1/machineset_types.go new file mode 100644 index 000000000000..21572ef3a76e --- /dev/null +++ b/api/v1beta1/machineset_types.go @@ -0,0 +1,224 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/util/validation/field" + capierrors "sigs.k8s.io/cluster-api/errors" +) + +const ( + // MachineSetTopologyFinalizer is the finalizer used by the topology MachineDeployment controller to + // clean up referenced template resources if necessary when a MachineSet is being deleted. + MachineSetTopologyFinalizer = "machineset.topology.cluster.x-k8s.io" +) + +// ANCHOR: MachineSetSpec + +// MachineSetSpec defines the desired state of MachineSet. +type MachineSetSpec struct { + // ClusterName is the name of the Cluster this object belongs to. + // +kubebuilder:validation:MinLength=1 + ClusterName string `json:"clusterName"` + + // Replicas is the number of desired replicas. + // This is a pointer to distinguish between explicit zero and unspecified. + // Defaults to 1. + // +optional + // +kubebuilder:default=1 + Replicas *int32 `json:"replicas,omitempty"` + + // MinReadySeconds is the minimum number of seconds for which a newly created machine should be ready. + // Defaults to 0 (machine will be considered available as soon as it is ready) + // +optional + MinReadySeconds int32 `json:"minReadySeconds,omitempty"` + + // DeletePolicy defines the policy used to identify nodes to delete when downscaling. + // Defaults to "Random". Valid values are "Random, "Newest", "Oldest" + // +kubebuilder:validation:Enum=Random;Newest;Oldest + DeletePolicy string `json:"deletePolicy,omitempty"` + + // Selector is a label query over machines that should match the replica count. + // Label keys and values that must match in order to be controlled by this MachineSet. + // It must match the machine template's labels. + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors + Selector metav1.LabelSelector `json:"selector"` + + // Template is the object that describes the machine that will be created if + // insufficient replicas are detected. + // Object references to custom resources resources are treated as templates. + // +optional + Template MachineTemplateSpec `json:"template,omitempty"` +} + +// ANCHOR_END: MachineSetSpec + +// ANCHOR: MachineTemplateSpec + +// MachineTemplateSpec describes the data needed to create a Machine from a template. +type MachineTemplateSpec struct { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + ObjectMeta `json:"metadata,omitempty"` + + // Specification of the desired behavior of the machine. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + Spec MachineSpec `json:"spec,omitempty"` +} + +// ANCHOR_END: MachineTemplateSpec + +// MachineSetDeletePolicy defines how priority is assigned to nodes to delete when +// downscaling a MachineSet. Defaults to "Random". +type MachineSetDeletePolicy string + +const ( + // RandomMachineSetDeletePolicy prioritizes both Machines that have the annotation + // "cluster.x-k8s.io/delete-machine=yes" and Machines that are unhealthy + // (Status.FailureReason or Status.FailureMessage are set to a non-empty value). + // Finally, it picks Machines at random to delete. + RandomMachineSetDeletePolicy MachineSetDeletePolicy = "Random" + + // NewestMachineSetDeletePolicy prioritizes both Machines that have the annotation + // "cluster.x-k8s.io/delete-machine=yes" and Machines that are unhealthy + // (Status.FailureReason or Status.FailureMessage are set to a non-empty value). + // It then prioritizes the newest Machines for deletion based on the Machine's CreationTimestamp. + NewestMachineSetDeletePolicy MachineSetDeletePolicy = "Newest" + + // OldestMachineSetDeletePolicy prioritizes both Machines that have the annotation + // "cluster.x-k8s.io/delete-machine=yes" and Machines that are unhealthy + // (Status.FailureReason or Status.FailureMessage are set to a non-empty value). + // It then prioritizes the oldest Machines for deletion based on the Machine's CreationTimestamp. + OldestMachineSetDeletePolicy MachineSetDeletePolicy = "Oldest" +) + +// ANCHOR: MachineSetStatus + +// MachineSetStatus defines the observed state of MachineSet. +type MachineSetStatus struct { + // Selector is the same as the label selector but in the string format to avoid introspection + // by clients. The string will be in the same format as the query-param syntax. + // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors + // +optional + Selector string `json:"selector,omitempty"` + + // Replicas is the most recently observed number of replicas. + // +optional + Replicas int32 `json:"replicas,omitempty"` + + // The number of replicas that have labels matching the labels of the machine template of the MachineSet. + // +optional + FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty"` + + // The number of ready replicas for this MachineSet. A machine is considered ready when the node has been created and is "Ready". + // +optional + ReadyReplicas int32 `json:"readyReplicas,omitempty"` + + // The number of available replicas (ready for at least minReadySeconds) for this MachineSet. + // +optional + AvailableReplicas int32 `json:"availableReplicas,omitempty"` + + // ObservedGeneration reflects the generation of the most recently observed MachineSet. + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // In the event that there is a terminal problem reconciling the + // replicas, both FailureReason and FailureMessage will be set. FailureReason + // will be populated with a succinct value suitable for machine + // interpretation, while FailureMessage will contain a more verbose + // string suitable for logging and human consumption. + // + // These fields should not be set for transitive errors that a + // controller faces that are expected to be fixed automatically over + // time (like service outages), but instead indicate that something is + // fundamentally wrong with the MachineTemplate's spec or the configuration of + // the machine controller, and that manual intervention is required. Examples + // of terminal errors would be invalid combinations of settings in the + // spec, values that are unsupported by the machine controller, or the + // responsible machine controller itself being critically misconfigured. + // + // Any transient errors that occur during the reconciliation of Machines + // can be added as events to the MachineSet object and/or logged in the + // controller's output. + // +optional + FailureReason *capierrors.MachineSetStatusError `json:"failureReason,omitempty"` + // +optional + FailureMessage *string `json:"failureMessage,omitempty"` +} + +// ANCHOR_END: MachineSetStatus + +// Validate validates the MachineSet fields. +func (m *MachineSet) Validate() field.ErrorList { + errors := field.ErrorList{} + + // validate spec.selector and spec.template.labels + fldPath := field.NewPath("spec") + errors = append(errors, metav1validation.ValidateLabelSelector(&m.Spec.Selector, fldPath.Child("selector"))...) + if len(m.Spec.Selector.MatchLabels)+len(m.Spec.Selector.MatchExpressions) == 0 { + errors = append(errors, field.Invalid(fldPath.Child("selector"), m.Spec.Selector, "empty selector is not valid for MachineSet.")) + } + selector, err := metav1.LabelSelectorAsSelector(&m.Spec.Selector) + if err != nil { + errors = append(errors, field.Invalid(fldPath.Child("selector"), m.Spec.Selector, "invalid label selector.")) + } else { + labels := labels.Set(m.Spec.Template.Labels) + if !selector.Matches(labels) { + errors = append(errors, field.Invalid(fldPath.Child("template", "metadata", "labels"), m.Spec.Template.Labels, "`selector` does not match template `labels`")) + } + } + + return errors +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=machinesets,shortName=ms,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachineSet" +// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Total number of non-terminated machines targeted by this machineset" +// +kubebuilder:printcolumn:name="Available",type="integer",JSONPath=".status.availableReplicas",description="Total number of available machines (ready for at least minReadySeconds)" +// +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="Total number of ready machines targeted by this machineset." + +// MachineSet is the Schema for the machinesets API. +type MachineSet struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec MachineSetSpec `json:"spec,omitempty"` + Status MachineSetStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// MachineSetList contains a list of MachineSet. +type MachineSetList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []MachineSet `json:"items"` +} + +func init() { + SchemeBuilder.Register(&MachineSet{}, &MachineSetList{}) +} diff --git a/api/v1alpha4/machineset_webhook.go b/api/v1beta1/machineset_webhook.go similarity index 86% rename from api/v1alpha4/machineset_webhook.go rename to api/v1beta1/machineset_webhook.go index fc99c2996f94..5785ef2c55c5 100644 --- a/api/v1alpha4/machineset_webhook.go +++ b/api/v1beta1/machineset_webhook.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "fmt" @@ -34,8 +34,8 @@ func (m *MachineSet) SetupWebhookWithManager(mgr ctrl.Manager) error { Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-cluster-x-k8s-io-v1alpha4-machineset,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machinesets,versions=v1alpha4,name=validation.machineset.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-cluster-x-k8s-io-v1alpha4-machineset,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machinesets,versions=v1alpha4,name=default.machineset.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-cluster-x-k8s-io-v1beta1-machineset,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machinesets,versions=v1beta1,name=validation.machineset.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-cluster-x-k8s-io-v1beta1-machineset,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machinesets,versions=v1beta1,name=default.machineset.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 var _ webhook.Defaulter = &MachineSet{} var _ webhook.Validator = &MachineSet{} diff --git a/api/v1alpha4/machineset_webhook_test.go b/api/v1beta1/machineset_webhook_test.go similarity index 98% rename from api/v1alpha4/machineset_webhook_test.go rename to api/v1beta1/machineset_webhook_test.go index 84cd7b0aa1d6..28025e17bc14 100644 --- a/api/v1alpha4/machineset_webhook_test.go +++ b/api/v1beta1/machineset_webhook_test.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "testing" diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 000000000000..463e63722b80 --- /dev/null +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,1250 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/util/intstr" + "sigs.k8s.io/cluster-api/errors" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *APIEndpoint) DeepCopyInto(out *APIEndpoint) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIEndpoint. +func (in *APIEndpoint) DeepCopy() *APIEndpoint { + if in == nil { + return nil + } + out := new(APIEndpoint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Bootstrap) DeepCopyInto(out *Bootstrap) { + *out = *in + if in.ConfigRef != nil { + in, out := &in.ConfigRef, &out.ConfigRef + *out = new(v1.ObjectReference) + **out = **in + } + if in.DataSecretName != nil { + in, out := &in.DataSecretName, &out.DataSecretName + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Bootstrap. +func (in *Bootstrap) DeepCopy() *Bootstrap { + if in == nil { + return nil + } + out := new(Bootstrap) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Cluster) DeepCopyInto(out *Cluster) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. +func (in *Cluster) DeepCopy() *Cluster { + if in == nil { + return nil + } + out := new(Cluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Cluster) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterClass) DeepCopyInto(out *ClusterClass) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClass. +func (in *ClusterClass) DeepCopy() *ClusterClass { + if in == nil { + return nil + } + out := new(ClusterClass) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterClass) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterClassList) DeepCopyInto(out *ClusterClassList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterClass, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClassList. +func (in *ClusterClassList) DeepCopy() *ClusterClassList { + if in == nil { + return nil + } + out := new(ClusterClassList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterClassList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterClassSpec) DeepCopyInto(out *ClusterClassSpec) { + *out = *in + in.Infrastructure.DeepCopyInto(&out.Infrastructure) + in.ControlPlane.DeepCopyInto(&out.ControlPlane) + in.Workers.DeepCopyInto(&out.Workers) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClassSpec. +func (in *ClusterClassSpec) DeepCopy() *ClusterClassSpec { + if in == nil { + return nil + } + out := new(ClusterClassSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterList) DeepCopyInto(out *ClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Cluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. +func (in *ClusterList) DeepCopy() *ClusterList { + if in == nil { + return nil + } + out := new(ClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterNetwork) DeepCopyInto(out *ClusterNetwork) { + *out = *in + if in.APIServerPort != nil { + in, out := &in.APIServerPort, &out.APIServerPort + *out = new(int32) + **out = **in + } + if in.Services != nil { + in, out := &in.Services, &out.Services + *out = new(NetworkRanges) + (*in).DeepCopyInto(*out) + } + if in.Pods != nil { + in, out := &in.Pods, &out.Pods + *out = new(NetworkRanges) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterNetwork. +func (in *ClusterNetwork) DeepCopy() *ClusterNetwork { + if in == nil { + return nil + } + out := new(ClusterNetwork) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { + *out = *in + if in.ClusterNetwork != nil { + in, out := &in.ClusterNetwork, &out.ClusterNetwork + *out = new(ClusterNetwork) + (*in).DeepCopyInto(*out) + } + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint + if in.ControlPlaneRef != nil { + in, out := &in.ControlPlaneRef, &out.ControlPlaneRef + *out = new(v1.ObjectReference) + **out = **in + } + if in.InfrastructureRef != nil { + in, out := &in.InfrastructureRef, &out.InfrastructureRef + *out = new(v1.ObjectReference) + **out = **in + } + if in.Topology != nil { + in, out := &in.Topology, &out.Topology + *out = new(Topology) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec. +func (in *ClusterSpec) DeepCopy() *ClusterSpec { + if in == nil { + return nil + } + out := new(ClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { + *out = *in + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make(FailureDomains, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.FailureReason != nil { + in, out := &in.FailureReason, &out.FailureReason + *out = new(errors.ClusterStatusError) + **out = **in + } + if in.FailureMessage != nil { + in, out := &in.FailureMessage, &out.FailureMessage + *out = new(string) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus. +func (in *ClusterStatus) DeepCopy() *ClusterStatus { + if in == nil { + return nil + } + out := new(ClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Condition) DeepCopyInto(out *Condition) { + *out = *in + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. +func (in *Condition) DeepCopy() *Condition { + if in == nil { + return nil + } + out := new(Condition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Conditions) DeepCopyInto(out *Conditions) { + { + in := &in + *out = make(Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Conditions. +func (in Conditions) DeepCopy() Conditions { + if in == nil { + return nil + } + out := new(Conditions) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneClass) DeepCopyInto(out *ControlPlaneClass) { + *out = *in + in.Metadata.DeepCopyInto(&out.Metadata) + in.LocalObjectTemplate.DeepCopyInto(&out.LocalObjectTemplate) + if in.MachineInfrastructure != nil { + in, out := &in.MachineInfrastructure, &out.MachineInfrastructure + *out = new(LocalObjectTemplate) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneClass. +func (in *ControlPlaneClass) DeepCopy() *ControlPlaneClass { + if in == nil { + return nil + } + out := new(ControlPlaneClass) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneTopology) DeepCopyInto(out *ControlPlaneTopology) { + *out = *in + in.Metadata.DeepCopyInto(&out.Metadata) + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneTopology. +func (in *ControlPlaneTopology) DeepCopy() *ControlPlaneTopology { + if in == nil { + return nil + } + out := new(ControlPlaneTopology) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FailureDomainSpec) DeepCopyInto(out *FailureDomainSpec) { + *out = *in + if in.Attributes != nil { + in, out := &in.Attributes, &out.Attributes + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailureDomainSpec. +func (in *FailureDomainSpec) DeepCopy() *FailureDomainSpec { + if in == nil { + return nil + } + out := new(FailureDomainSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in FailureDomains) DeepCopyInto(out *FailureDomains) { + { + in := &in + *out = make(FailureDomains, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailureDomains. +func (in FailureDomains) DeepCopy() FailureDomains { + if in == nil { + return nil + } + out := new(FailureDomains) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *LocalObjectTemplate) DeepCopyInto(out *LocalObjectTemplate) { + *out = *in + if in.Ref != nil { + in, out := &in.Ref, &out.Ref + *out = new(v1.ObjectReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalObjectTemplate. +func (in *LocalObjectTemplate) DeepCopy() *LocalObjectTemplate { + if in == nil { + return nil + } + out := new(LocalObjectTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Machine) DeepCopyInto(out *Machine) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Machine. +func (in *Machine) DeepCopy() *Machine { + if in == nil { + return nil + } + out := new(Machine) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *Machine) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineAddress) DeepCopyInto(out *MachineAddress) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineAddress. +func (in *MachineAddress) DeepCopy() *MachineAddress { + if in == nil { + return nil + } + out := new(MachineAddress) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in MachineAddresses) DeepCopyInto(out *MachineAddresses) { + { + in := &in + *out = make(MachineAddresses, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineAddresses. +func (in MachineAddresses) DeepCopy() MachineAddresses { + if in == nil { + return nil + } + out := new(MachineAddresses) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeployment) DeepCopyInto(out *MachineDeployment) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeployment. +func (in *MachineDeployment) DeepCopy() *MachineDeployment { + if in == nil { + return nil + } + out := new(MachineDeployment) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineDeployment) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentClass) DeepCopyInto(out *MachineDeploymentClass) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClass. +func (in *MachineDeploymentClass) DeepCopy() *MachineDeploymentClass { + if in == nil { + return nil + } + out := new(MachineDeploymentClass) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentClassTemplate) DeepCopyInto(out *MachineDeploymentClassTemplate) { + *out = *in + in.Metadata.DeepCopyInto(&out.Metadata) + in.Bootstrap.DeepCopyInto(&out.Bootstrap) + in.Infrastructure.DeepCopyInto(&out.Infrastructure) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClassTemplate. +func (in *MachineDeploymentClassTemplate) DeepCopy() *MachineDeploymentClassTemplate { + if in == nil { + return nil + } + out := new(MachineDeploymentClassTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentList) DeepCopyInto(out *MachineDeploymentList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MachineDeployment, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentList. +func (in *MachineDeploymentList) DeepCopy() *MachineDeploymentList { + if in == nil { + return nil + } + out := new(MachineDeploymentList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineDeploymentList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentSpec) DeepCopyInto(out *MachineDeploymentSpec) { + *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + in.Selector.DeepCopyInto(&out.Selector) + in.Template.DeepCopyInto(&out.Template) + if in.Strategy != nil { + in, out := &in.Strategy, &out.Strategy + *out = new(MachineDeploymentStrategy) + (*in).DeepCopyInto(*out) + } + if in.MinReadySeconds != nil { + in, out := &in.MinReadySeconds, &out.MinReadySeconds + *out = new(int32) + **out = **in + } + if in.RevisionHistoryLimit != nil { + in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit + *out = new(int32) + **out = **in + } + if in.ProgressDeadlineSeconds != nil { + in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentSpec. +func (in *MachineDeploymentSpec) DeepCopy() *MachineDeploymentSpec { + if in == nil { + return nil + } + out := new(MachineDeploymentSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentStatus) DeepCopyInto(out *MachineDeploymentStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentStatus. +func (in *MachineDeploymentStatus) DeepCopy() *MachineDeploymentStatus { + if in == nil { + return nil + } + out := new(MachineDeploymentStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentStrategy) DeepCopyInto(out *MachineDeploymentStrategy) { + *out = *in + if in.RollingUpdate != nil { + in, out := &in.RollingUpdate, &out.RollingUpdate + *out = new(MachineRollingUpdateDeployment) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentStrategy. +func (in *MachineDeploymentStrategy) DeepCopy() *MachineDeploymentStrategy { + if in == nil { + return nil + } + out := new(MachineDeploymentStrategy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentTopology) DeepCopyInto(out *MachineDeploymentTopology) { + *out = *in + in.Metadata.DeepCopyInto(&out.Metadata) + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentTopology. +func (in *MachineDeploymentTopology) DeepCopy() *MachineDeploymentTopology { + if in == nil { + return nil + } + out := new(MachineDeploymentTopology) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineHealthCheck) DeepCopyInto(out *MachineHealthCheck) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheck. +func (in *MachineHealthCheck) DeepCopy() *MachineHealthCheck { + if in == nil { + return nil + } + out := new(MachineHealthCheck) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineHealthCheck) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineHealthCheckList) DeepCopyInto(out *MachineHealthCheckList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MachineHealthCheck, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckList. +func (in *MachineHealthCheckList) DeepCopy() *MachineHealthCheckList { + if in == nil { + return nil + } + out := new(MachineHealthCheckList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineHealthCheckList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineHealthCheckSpec) DeepCopyInto(out *MachineHealthCheckSpec) { + *out = *in + in.Selector.DeepCopyInto(&out.Selector) + if in.UnhealthyConditions != nil { + in, out := &in.UnhealthyConditions, &out.UnhealthyConditions + *out = make([]UnhealthyCondition, len(*in)) + copy(*out, *in) + } + if in.MaxUnhealthy != nil { + in, out := &in.MaxUnhealthy, &out.MaxUnhealthy + *out = new(intstr.IntOrString) + **out = **in + } + if in.UnhealthyRange != nil { + in, out := &in.UnhealthyRange, &out.UnhealthyRange + *out = new(string) + **out = **in + } + if in.NodeStartupTimeout != nil { + in, out := &in.NodeStartupTimeout, &out.NodeStartupTimeout + *out = new(metav1.Duration) + **out = **in + } + if in.RemediationTemplate != nil { + in, out := &in.RemediationTemplate, &out.RemediationTemplate + *out = new(v1.ObjectReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckSpec. +func (in *MachineHealthCheckSpec) DeepCopy() *MachineHealthCheckSpec { + if in == nil { + return nil + } + out := new(MachineHealthCheckSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineHealthCheckStatus) DeepCopyInto(out *MachineHealthCheckStatus) { + *out = *in + if in.Targets != nil { + in, out := &in.Targets, &out.Targets + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckStatus. +func (in *MachineHealthCheckStatus) DeepCopy() *MachineHealthCheckStatus { + if in == nil { + return nil + } + out := new(MachineHealthCheckStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineList) DeepCopyInto(out *MachineList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]Machine, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineList. +func (in *MachineList) DeepCopy() *MachineList { + if in == nil { + return nil + } + out := new(MachineList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineRollingUpdateDeployment) DeepCopyInto(out *MachineRollingUpdateDeployment) { + *out = *in + if in.MaxUnavailable != nil { + in, out := &in.MaxUnavailable, &out.MaxUnavailable + *out = new(intstr.IntOrString) + **out = **in + } + if in.MaxSurge != nil { + in, out := &in.MaxSurge, &out.MaxSurge + *out = new(intstr.IntOrString) + **out = **in + } + if in.DeletePolicy != nil { + in, out := &in.DeletePolicy, &out.DeletePolicy + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineRollingUpdateDeployment. +func (in *MachineRollingUpdateDeployment) DeepCopy() *MachineRollingUpdateDeployment { + if in == nil { + return nil + } + out := new(MachineRollingUpdateDeployment) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineSet) DeepCopyInto(out *MachineSet) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSet. +func (in *MachineSet) DeepCopy() *MachineSet { + if in == nil { + return nil + } + out := new(MachineSet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineSet) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineSetList) DeepCopyInto(out *MachineSetList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MachineSet, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetList. +func (in *MachineSetList) DeepCopy() *MachineSetList { + if in == nil { + return nil + } + out := new(MachineSetList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineSetList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineSetSpec) DeepCopyInto(out *MachineSetSpec) { + *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + in.Selector.DeepCopyInto(&out.Selector) + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetSpec. +func (in *MachineSetSpec) DeepCopy() *MachineSetSpec { + if in == nil { + return nil + } + out := new(MachineSetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineSetStatus) DeepCopyInto(out *MachineSetStatus) { + *out = *in + if in.FailureReason != nil { + in, out := &in.FailureReason, &out.FailureReason + *out = new(errors.MachineSetStatusError) + **out = **in + } + if in.FailureMessage != nil { + in, out := &in.FailureMessage, &out.FailureMessage + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetStatus. +func (in *MachineSetStatus) DeepCopy() *MachineSetStatus { + if in == nil { + return nil + } + out := new(MachineSetStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineSpec) DeepCopyInto(out *MachineSpec) { + *out = *in + in.Bootstrap.DeepCopyInto(&out.Bootstrap) + out.InfrastructureRef = in.InfrastructureRef + if in.Version != nil { + in, out := &in.Version, &out.Version + *out = new(string) + **out = **in + } + if in.ProviderID != nil { + in, out := &in.ProviderID, &out.ProviderID + *out = new(string) + **out = **in + } + if in.FailureDomain != nil { + in, out := &in.FailureDomain, &out.FailureDomain + *out = new(string) + **out = **in + } + if in.NodeDrainTimeout != nil { + in, out := &in.NodeDrainTimeout, &out.NodeDrainTimeout + *out = new(metav1.Duration) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSpec. +func (in *MachineSpec) DeepCopy() *MachineSpec { + if in == nil { + return nil + } + out := new(MachineSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineStatus) DeepCopyInto(out *MachineStatus) { + *out = *in + if in.NodeRef != nil { + in, out := &in.NodeRef, &out.NodeRef + *out = new(v1.ObjectReference) + **out = **in + } + if in.NodeInfo != nil { + in, out := &in.NodeInfo, &out.NodeInfo + *out = new(v1.NodeSystemInfo) + **out = **in + } + if in.LastUpdated != nil { + in, out := &in.LastUpdated, &out.LastUpdated + *out = (*in).DeepCopy() + } + if in.Version != nil { + in, out := &in.Version, &out.Version + *out = new(string) + **out = **in + } + if in.FailureReason != nil { + in, out := &in.FailureReason, &out.FailureReason + *out = new(errors.MachineStatusError) + **out = **in + } + if in.FailureMessage != nil { + in, out := &in.FailureMessage, &out.FailureMessage + *out = new(string) + **out = **in + } + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make(MachineAddresses, len(*in)) + copy(*out, *in) + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineStatus. +func (in *MachineStatus) DeepCopy() *MachineStatus { + if in == nil { + return nil + } + out := new(MachineStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineTemplateSpec) DeepCopyInto(out *MachineTemplateSpec) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineTemplateSpec. +func (in *MachineTemplateSpec) DeepCopy() *MachineTemplateSpec { + if in == nil { + return nil + } + out := new(MachineTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkRanges) DeepCopyInto(out *NetworkRanges) { + *out = *in + if in.CIDRBlocks != nil { + in, out := &in.CIDRBlocks, &out.CIDRBlocks + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkRanges. +func (in *NetworkRanges) DeepCopy() *NetworkRanges { + if in == nil { + return nil + } + out := new(NetworkRanges) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ObjectMeta) DeepCopyInto(out *ObjectMeta) { + *out = *in + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Annotations != nil { + in, out := &in.Annotations, &out.Annotations + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectMeta. +func (in *ObjectMeta) DeepCopy() *ObjectMeta { + if in == nil { + return nil + } + out := new(ObjectMeta) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Topology) DeepCopyInto(out *Topology) { + *out = *in + if in.RolloutAfter != nil { + in, out := &in.RolloutAfter, &out.RolloutAfter + *out = (*in).DeepCopy() + } + in.ControlPlane.DeepCopyInto(&out.ControlPlane) + if in.Workers != nil { + in, out := &in.Workers, &out.Workers + *out = new(WorkersTopology) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Topology. +func (in *Topology) DeepCopy() *Topology { + if in == nil { + return nil + } + out := new(Topology) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UnhealthyCondition) DeepCopyInto(out *UnhealthyCondition) { + *out = *in + out.Timeout = in.Timeout +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UnhealthyCondition. +func (in *UnhealthyCondition) DeepCopy() *UnhealthyCondition { + if in == nil { + return nil + } + out := new(UnhealthyCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkersClass) DeepCopyInto(out *WorkersClass) { + *out = *in + if in.MachineDeployments != nil { + in, out := &in.MachineDeployments, &out.MachineDeployments + *out = make([]MachineDeploymentClass, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkersClass. +func (in *WorkersClass) DeepCopy() *WorkersClass { + if in == nil { + return nil + } + out := new(WorkersClass) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkersTopology) DeepCopyInto(out *WorkersTopology) { + *out = *in + if in.MachineDeployments != nil { + in, out := &in.MachineDeployments, &out.MachineDeployments + *out = make([]MachineDeploymentTopology, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkersTopology. +func (in *WorkersTopology) DeepCopy() *WorkersTopology { + if in == nil { + return nil + } + out := new(WorkersTopology) + in.DeepCopyInto(out) + return out +} diff --git a/bootstrap/kubeadm/api/v1alpha4/condition_consts.go b/bootstrap/kubeadm/api/v1alpha4/condition_consts.go index 6ee694b4c966..ac8d18766ce9 100644 --- a/bootstrap/kubeadm/api/v1alpha4/condition_consts.go +++ b/bootstrap/kubeadm/api/v1alpha4/condition_consts.go @@ -16,7 +16,7 @@ limitations under the License. package v1alpha4 -import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" +import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" // Conditions and condition Reasons for the KubeadmConfig object diff --git a/bootstrap/kubeadm/api/v1alpha4/kubeadmconfig_types.go b/bootstrap/kubeadm/api/v1alpha4/kubeadmconfig_types.go index 297d0c7da836..70f020b29a02 100644 --- a/bootstrap/kubeadm/api/v1alpha4/kubeadmconfig_types.go +++ b/bootstrap/kubeadm/api/v1alpha4/kubeadmconfig_types.go @@ -18,7 +18,7 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // Format specifies the output format of the bootstrap data diff --git a/bootstrap/kubeadm/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/controllers/kubeadmconfig_controller.go index 9672f65317cd..10867d5393d8 100644 --- a/bootstrap/kubeadm/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/controllers/kubeadmconfig_controller.go @@ -32,14 +32,14 @@ import ( "k8s.io/apimachinery/pkg/types" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/internal/cloudinit" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/internal/locking" kubeadmtypes "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types" bsutil "sigs.k8s.io/cluster-api/bootstrap/util" "sigs.k8s.io/cluster-api/controllers/remote" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" diff --git a/bootstrap/kubeadm/controllers/kubeadmconfig_controller_test.go b/bootstrap/kubeadm/controllers/kubeadmconfig_controller_test.go index 2e56ac0081b8..19c500c56de9 100644 --- a/bootstrap/kubeadm/controllers/kubeadmconfig_controller_test.go +++ b/bootstrap/kubeadm/controllers/kubeadmconfig_controller_test.go @@ -35,10 +35,10 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/reconcile" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" fakeremote "sigs.k8s.io/cluster-api/controllers/remote/fake" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/bootstrap/kubeadm/internal/locking/control_plane_init_mutex.go b/bootstrap/kubeadm/internal/locking/control_plane_init_mutex.go index 55895b2543da..777e140556da 100644 --- a/bootstrap/kubeadm/internal/locking/control_plane_init_mutex.go +++ b/bootstrap/kubeadm/internal/locking/control_plane_init_mutex.go @@ -27,7 +27,7 @@ import ( corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/bootstrap/kubeadm/internal/locking/control_plane_init_mutex_test.go b/bootstrap/kubeadm/internal/locking/control_plane_init_mutex_test.go index 220041464171..53a30c04a25c 100644 --- a/bootstrap/kubeadm/internal/locking/control_plane_init_mutex_test.go +++ b/bootstrap/kubeadm/internal/locking/control_plane_init_mutex_test.go @@ -32,7 +32,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/bootstrap/kubeadm/main.go b/bootstrap/kubeadm/main.go index 45fe41ad8ee7..abbd197c11ab 100644 --- a/bootstrap/kubeadm/main.go +++ b/bootstrap/kubeadm/main.go @@ -33,12 +33,12 @@ import ( cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" kubeadmbootstrapv1old "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha3" kubeadmbootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" kubeadmbootstrapcontrollers "sigs.k8s.io/cluster-api/bootstrap/kubeadm/controllers" "sigs.k8s.io/cluster-api/controllers/remote" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/version" ctrl "sigs.k8s.io/controller-runtime" diff --git a/bootstrap/util/configowner.go b/bootstrap/util/configowner.go index ec524cdaf86f..2c2ec71274c3 100644 --- a/bootstrap/util/configowner.go +++ b/bootstrap/util/configowner.go @@ -25,9 +25,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/bootstrap/util/configowner_test.go b/bootstrap/util/configowner_test.go index e034df329310..26b71d474a4f 100644 --- a/bootstrap/util/configowner_test.go +++ b/bootstrap/util/configowner_test.go @@ -23,9 +23,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) diff --git a/cmd/clusterctl/client/alpha/machinedeployment.go b/cmd/clusterctl/client/alpha/machinedeployment.go index 5fadcce50231..15d6ad98a7b3 100644 --- a/cmd/clusterctl/client/alpha/machinedeployment.go +++ b/cmd/clusterctl/client/alpha/machinedeployment.go @@ -20,7 +20,7 @@ import ( "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" "sigs.k8s.io/cluster-api/controllers/mdutil" diff --git a/cmd/clusterctl/client/alpha/rollout_pauser_test.go b/cmd/clusterctl/client/alpha/rollout_pauser_test.go index 3fa8e29b44f4..7cccf749c445 100644 --- a/cmd/clusterctl/client/alpha/rollout_pauser_test.go +++ b/cmd/clusterctl/client/alpha/rollout_pauser_test.go @@ -23,7 +23,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/cmd/clusterctl/client/alpha/rollout_restarter_test.go b/cmd/clusterctl/client/alpha/rollout_restarter_test.go index 928dddb2c62d..eb4fa477b058 100644 --- a/cmd/clusterctl/client/alpha/rollout_restarter_test.go +++ b/cmd/clusterctl/client/alpha/rollout_restarter_test.go @@ -23,7 +23,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/cmd/clusterctl/client/alpha/rollout_resumer_test.go b/cmd/clusterctl/client/alpha/rollout_resumer_test.go index 603dc21495c8..e86b200a9ee3 100644 --- a/cmd/clusterctl/client/alpha/rollout_resumer_test.go +++ b/cmd/clusterctl/client/alpha/rollout_resumer_test.go @@ -23,7 +23,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/cmd/clusterctl/client/alpha/rollout_rollbacker.go b/cmd/clusterctl/client/alpha/rollout_rollbacker.go index 0f0b8a56f725..09fb382df545 100644 --- a/cmd/clusterctl/client/alpha/rollout_rollbacker.go +++ b/cmd/clusterctl/client/alpha/rollout_rollbacker.go @@ -19,7 +19,7 @@ package alpha import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" "sigs.k8s.io/cluster-api/controllers/mdutil" diff --git a/cmd/clusterctl/client/alpha/rollout_rollbacker_test.go b/cmd/clusterctl/client/alpha/rollout_rollbacker_test.go index 11a8a42026b7..96afd2667784 100644 --- a/cmd/clusterctl/client/alpha/rollout_rollbacker_test.go +++ b/cmd/clusterctl/client/alpha/rollout_rollbacker_test.go @@ -24,7 +24,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/cmd/clusterctl/client/cluster/components.go b/cmd/clusterctl/client/cluster/components.go index ce4788691372..2556c9ad2d01 100644 --- a/cmd/clusterctl/client/cluster/components.go +++ b/cmd/clusterctl/client/cluster/components.go @@ -27,7 +27,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/sets" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/util" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" diff --git a/cmd/clusterctl/client/cluster/components_test.go b/cmd/clusterctl/client/cluster/components_test.go index cda8af22c25a..f54ce836c350 100644 --- a/cmd/clusterctl/client/cluster/components_test.go +++ b/cmd/clusterctl/client/cluster/components_test.go @@ -26,7 +26,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/cmd/clusterctl/client/cluster/installer.go b/cmd/clusterctl/client/cluster/installer.go index d82ae87f1c0e..c15a55beb5cc 100644 --- a/cmd/clusterctl/client/cluster/installer.go +++ b/cmd/clusterctl/client/cluster/installer.go @@ -27,7 +27,7 @@ import ( "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/version" "k8s.io/apimachinery/pkg/util/wait" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository" diff --git a/cmd/clusterctl/client/cluster/inventory.go b/cmd/clusterctl/client/cluster/inventory.go index 95345f34b295..06525a0d2f86 100644 --- a/cmd/clusterctl/client/cluster/inventory.go +++ b/cmd/clusterctl/client/cluster/inventory.go @@ -27,7 +27,7 @@ import ( "k8s.io/apimachinery/pkg/types" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/sets" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/config" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" diff --git a/cmd/clusterctl/client/cluster/mover.go b/cmd/clusterctl/client/cluster/mover.go index 07330b0f6b76..682eff8e6be3 100644 --- a/cmd/clusterctl/client/cluster/mover.go +++ b/cmd/clusterctl/client/cluster/mover.go @@ -31,7 +31,7 @@ import ( kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/version" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/yaml" diff --git a/cmd/clusterctl/client/cluster/mover_test.go b/cmd/clusterctl/client/cluster/mover_test.go index 578c0e670fa7..8a7e2356a1b3 100644 --- a/cmd/clusterctl/client/cluster/mover_test.go +++ b/cmd/clusterctl/client/cluster/mover_test.go @@ -31,7 +31,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test/providers/infrastructure" diff --git a/cmd/clusterctl/client/cluster/objectgraph.go b/cmd/clusterctl/client/cluster/objectgraph.go index 39a052f4f5ca..0ea957e59478 100644 --- a/cmd/clusterctl/client/cluster/objectgraph.go +++ b/cmd/clusterctl/client/cluster/objectgraph.go @@ -27,10 +27,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" logf "sigs.k8s.io/cluster-api/cmd/clusterctl/log" - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" + addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" secretutil "sigs.k8s.io/cluster-api/util/secret" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/cmd/clusterctl/client/cluster/upgrader.go b/cmd/clusterctl/client/cluster/upgrader.go index 70ea9dac2753..9ccd1b0083bd 100644 --- a/cmd/clusterctl/client/cluster/upgrader.go +++ b/cmd/clusterctl/client/cluster/upgrader.go @@ -20,7 +20,7 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/version" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository" diff --git a/cmd/clusterctl/client/cluster/upgrader_info_test.go b/cmd/clusterctl/client/cluster/upgrader_info_test.go index dd290e1ea2d4..a8804366f8b4 100644 --- a/cmd/clusterctl/client/cluster/upgrader_info_test.go +++ b/cmd/clusterctl/client/cluster/upgrader_info_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/version" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/repository" diff --git a/cmd/clusterctl/client/cluster/workload_cluster_test.go b/cmd/clusterctl/client/cluster/workload_cluster_test.go index 82e20ac6e618..1bec2cdb5de2 100644 --- a/cmd/clusterctl/client/cluster/workload_cluster_test.go +++ b/cmd/clusterctl/client/cluster/workload_cluster_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" "sigs.k8s.io/cluster-api/util/secret" ) diff --git a/cmd/clusterctl/client/repository/components.go b/cmd/clusterctl/client/repository/components.go index 92efe7a9a1de..0e284256b626 100644 --- a/cmd/clusterctl/client/repository/components.go +++ b/cmd/clusterctl/client/repository/components.go @@ -28,7 +28,7 @@ import ( apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" yaml "sigs.k8s.io/cluster-api/cmd/clusterctl/client/yamlprocessor" diff --git a/cmd/clusterctl/client/repository/components_client_test.go b/cmd/clusterctl/client/repository/components_client_test.go index d5d3626ca8e6..4ac5ab34bfe4 100644 --- a/cmd/clusterctl/client/repository/components_client_test.go +++ b/cmd/clusterctl/client/repository/components_client_test.go @@ -23,7 +23,7 @@ import ( . "github.com/onsi/gomega" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" yaml "sigs.k8s.io/cluster-api/cmd/clusterctl/client/yamlprocessor" diff --git a/cmd/clusterctl/client/repository/components_test.go b/cmd/clusterctl/client/repository/components_test.go index 50fc48a5f716..a051ec2be8d0 100644 --- a/cmd/clusterctl/client/repository/components_test.go +++ b/cmd/clusterctl/client/repository/components_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" ) diff --git a/cmd/clusterctl/client/repository/repository_github.go b/cmd/clusterctl/client/repository/repository_github.go index 803712d4e618..441e92be3bb9 100644 --- a/cmd/clusterctl/client/repository/repository_github.go +++ b/cmd/clusterctl/client/repository/repository_github.go @@ -25,7 +25,7 @@ import ( "path/filepath" "strings" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "github.com/google/go-github/v33/github" "github.com/pkg/errors" diff --git a/cmd/clusterctl/client/repository/repository_local.go b/cmd/clusterctl/client/repository/repository_local.go index 6e353fd66db8..4dee68aedd4e 100644 --- a/cmd/clusterctl/client/repository/repository_local.go +++ b/cmd/clusterctl/client/repository/repository_local.go @@ -23,7 +23,7 @@ import ( "runtime" "strings" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/util/version" diff --git a/cmd/clusterctl/client/repository/repository_memory.go b/cmd/clusterctl/client/repository/repository_memory.go index 237ae7255a14..ac50e2d3cf43 100644 --- a/cmd/clusterctl/client/repository/repository_memory.go +++ b/cmd/clusterctl/client/repository/repository_memory.go @@ -22,7 +22,7 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/scheme" ) diff --git a/cmd/clusterctl/client/rollout_test.go b/cmd/clusterctl/client/rollout_test.go index 308de2c84c3a..806c912ea14f 100644 --- a/cmd/clusterctl/client/rollout_test.go +++ b/cmd/clusterctl/client/rollout_test.go @@ -21,7 +21,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" diff --git a/cmd/clusterctl/client/tree/discovery.go b/cmd/clusterctl/client/tree/discovery.go index 4e5b14e9e0a0..50d6638bb0fa 100644 --- a/cmd/clusterctl/client/tree/discovery.go +++ b/cmd/clusterctl/client/tree/discovery.go @@ -19,7 +19,7 @@ package tree import ( "context" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/cmd/clusterctl/client/tree/tree.go b/cmd/clusterctl/client/tree/tree.go index 3c75ecf903de..f6b8d66e329f 100644 --- a/cmd/clusterctl/client/tree/tree.go +++ b/cmd/clusterctl/client/tree/tree.go @@ -25,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/cmd/clusterctl/client/tree/tree_test.go b/cmd/clusterctl/client/tree/tree_test.go index ca043944f070..c76210a38b66 100644 --- a/cmd/clusterctl/client/tree/tree_test.go +++ b/cmd/clusterctl/client/tree/tree_test.go @@ -25,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" ) diff --git a/cmd/clusterctl/client/tree/util.go b/cmd/clusterctl/client/tree/util.go index 05d24b40bd5d..16a2c7dbe874 100644 --- a/cmd/clusterctl/client/tree/util.go +++ b/cmd/clusterctl/client/tree/util.go @@ -21,7 +21,7 @@ import ( "sort" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/cmd/clusterctl/client/upgrade.go b/cmd/clusterctl/client/upgrade.go index 784454b326c0..4f7d4134557d 100644 --- a/cmd/clusterctl/client/upgrade.go +++ b/cmd/clusterctl/client/upgrade.go @@ -22,7 +22,7 @@ import ( "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clusterv1old "sigs.k8s.io/cluster-api/api/v1alpha3" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" ) diff --git a/cmd/clusterctl/client/upgrade_test.go b/cmd/clusterctl/client/upgrade_test.go index 70c573cb8920..34f18b1230cf 100644 --- a/cmd/clusterctl/client/upgrade_test.go +++ b/cmd/clusterctl/client/upgrade_test.go @@ -24,7 +24,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" diff --git a/cmd/clusterctl/cmd/describe_cluster.go b/cmd/clusterctl/cmd/describe_cluster.go index 872a7b350620..f41669278c3c 100644 --- a/cmd/clusterctl/cmd/describe_cluster.go +++ b/cmd/clusterctl/cmd/describe_cluster.go @@ -28,7 +28,7 @@ import ( "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/duration" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/tree" ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/cmd/clusterctl/cmd/describe_cluster_test.go b/cmd/clusterctl/cmd/describe_cluster_test.go index 46f982fe62ff..0932c3c14ff3 100644 --- a/cmd/clusterctl/cmd/describe_cluster_test.go +++ b/cmd/clusterctl/cmd/describe_cluster_test.go @@ -28,7 +28,7 @@ import ( "github.com/fatih/color" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/tree" ctrlclient "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/cmd/clusterctl/cmd/upgrade_plan.go b/cmd/clusterctl/cmd/upgrade_plan.go index eb486778e5e5..0cc0173499b6 100644 --- a/cmd/clusterctl/cmd/upgrade_plan.go +++ b/cmd/clusterctl/cmd/upgrade_plan.go @@ -22,7 +22,7 @@ import ( "text/tabwriter" "github.com/spf13/cobra" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client" ) diff --git a/cmd/clusterctl/internal/scheme/scheme.go b/cmd/clusterctl/internal/scheme/scheme.go index af77caa20c07..3a6747e6f001 100644 --- a/cmd/clusterctl/internal/scheme/scheme.go +++ b/cmd/clusterctl/internal/scheme/scheme.go @@ -24,9 +24,9 @@ import ( apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" "k8s.io/apimachinery/pkg/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" + addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" ) var ( diff --git a/cmd/clusterctl/internal/test/contracts.go b/cmd/clusterctl/internal/test/contracts.go index b49b86bea07a..b3144a651ff9 100644 --- a/cmd/clusterctl/internal/test/contracts.go +++ b/cmd/clusterctl/internal/test/contracts.go @@ -18,7 +18,7 @@ package test import ( clusterv1old "sigs.k8s.io/cluster-api/api/v1alpha3" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // PreviousCAPIContractNotSupported define the previous Cluster API contract, not supported by this release of clusterctl. diff --git a/cmd/clusterctl/internal/test/fake_objects.go b/cmd/clusterctl/internal/test/fake_objects.go index 9f840f5855eb..bfd9500585a6 100644 --- a/cmd/clusterctl/internal/test/fake_objects.go +++ b/cmd/clusterctl/internal/test/fake_objects.go @@ -25,14 +25,14 @@ import ( "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" fakebootstrap "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test/providers/bootstrap" fakecontrolplane "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test/providers/controlplane" fakeexternal "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test/providers/external" fakeinfrastructure "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test/providers/infrastructure" - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/cmd/clusterctl/internal/test/fake_proxy.go b/cmd/clusterctl/internal/test/fake_proxy.go index 427d43d96b03..3d3384d2bcd2 100644 --- a/cmd/clusterctl/internal/test/fake_proxy.go +++ b/cmd/clusterctl/internal/test/fake_proxy.go @@ -23,14 +23,14 @@ import ( "k8s.io/apimachinery/pkg/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" fakebootstrap "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test/providers/bootstrap" fakecontrolplane "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test/providers/controlplane" fakeexternal "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test/providers/external" fakeinfrastructure "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test/providers/infrastructure" - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) diff --git a/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml b/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml index fd325dcc6d69..f34be0309e65 100644 --- a/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml +++ b/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml @@ -186,6 +186,94 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: Time duration since creation of ClusterResourceSetBinding + jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1beta1 + schema: + openAPIV3Schema: + description: ClusterResourceSetBinding lists all matching ClusterResourceSets + with the cluster it belongs to. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ClusterResourceSetBindingSpec defines the desired state of + ClusterResourceSetBinding. + properties: + bindings: + description: Bindings is a list of ClusterResourceSets and their resources. + items: + description: ResourceSetBinding keeps info on all of the resources + in a ClusterResourceSet. + properties: + clusterResourceSetName: + description: ClusterResourceSetName is the name of the ClusterResourceSet + that is applied to the owner cluster of the binding. + type: string + resources: + description: Resources is a list of resources that the ClusterResourceSet + has. + items: + description: ResourceBinding shows the status of a resource + that belongs to a ClusterResourceSet matched by the owner + cluster of the ClusterResourceSetBinding object. + properties: + applied: + description: Applied is to track if a resource is applied + to the cluster or not. + type: boolean + hash: + description: Hash is the hash of a resource's data. This + can be used to decide if a resource is changed. For + "ApplyOnce" ClusterResourceSet.spec.strategy, this is + no-op as that strategy does not act on change. + type: string + kind: + description: 'Kind of the resource. Supported kinds are: + Secrets and ConfigMaps.' + enum: + - Secret + - ConfigMap + type: string + lastAppliedTime: + description: LastAppliedTime identifies when this resource + was last applied to the cluster. + format: date-time + type: string + name: + description: Name of the resource that is in the same + namespace with ClusterResourceSet object. + minLength: 1 + type: string + required: + - applied + - kind + - name + type: object + type: array + required: + - clusterResourceSetName + type: object + type: array + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml b/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml index 3f3e30dc25fa..07c539859e80 100644 --- a/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml +++ b/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml @@ -335,6 +335,169 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: Time duration since creation of ClusterResourceSet + jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1beta1 + schema: + openAPIV3Schema: + description: ClusterResourceSet is the Schema for the clusterresourcesets + API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ClusterResourceSetSpec defines the desired state of ClusterResourceSet. + properties: + clusterSelector: + description: Label selector for Clusters. The Clusters that are selected + by this will be the ones affected by this ClusterResourceSet. It + must match the Cluster labels. This field is immutable. Label selector + cannot be empty. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. + properties: + key: + description: key is the label key that the selector applies + to. + type: string + operator: + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + resources: + description: Resources is a list of Secrets/ConfigMaps where each + contains 1 or more resources to be applied to remote clusters. + items: + description: ResourceRef specifies a resource. + properties: + kind: + description: 'Kind of the resource. Supported kinds are: Secrets + and ConfigMaps.' + enum: + - Secret + - ConfigMap + type: string + name: + description: Name of the resource that is in the same namespace + with ClusterResourceSet object. + minLength: 1 + type: string + required: + - kind + - name + type: object + type: array + strategy: + description: Strategy is the strategy to be used during applying resources. + Defaults to ApplyOnce. This field is immutable. + enum: + - ApplyOnce + type: string + required: + - clusterSelector + type: object + status: + description: ClusterResourceSetStatus defines the observed state of ClusterResourceSet. + properties: + conditions: + description: Conditions defines current state of the ClusterResourceSet. + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + description: Last time the condition transitioned from one status + to another. This should be when the underlying condition changed. + If that is not known, then using the time when the API field + changed is acceptable. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. This field may be empty. + type: string + reason: + description: The reason for the condition's last transition + in CamelCase. The specific API may choose whether or not this + field is considered a guaranteed API. This field may not be + empty. + type: string + severity: + description: Severity provides an explicit classification of + Reason code, so the users or machines can immediately understand + the current situation and act accordingly. The Severity field + MUST be set only when Status=False. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of condition in CamelCase or in foo.example.com/CamelCase. + Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. + type: string + required: + - status + - type + type: object + type: array + observedGeneration: + description: ObservedGeneration reflects the generation of the most + recently observed ClusterResourceSet. + format: int64 + type: integer + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml b/config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml index 52bb039a26e4..00ad547d51f6 100644 --- a/config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml +++ b/config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml @@ -377,6 +377,365 @@ spec: type: object type: object served: true + storage: false + subresources: {} + - additionalPrinterColumns: + - description: Time duration since creation of ClusterClass + jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1beta1 + schema: + openAPIV3Schema: + description: ClusterClass is a template which can be used to create managed + topologies. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ClusterClassSpec describes the desired state of the ClusterClass. + properties: + controlPlane: + description: ControlPlane is a reference to a local struct that holds + the details for provisioning the Control Plane for the Cluster. + properties: + machineInfrastructure: + description: "MachineTemplate defines the metadata and infrastructure + information for control plane machines. \n This field is supported + if and only if the control plane provider template referenced + above is Machine based and supports setting replicas." + properties: + ref: + description: Ref is a required reference to a custom resource + offered by a provider. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead + of an entire object, this string should contain a valid + JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this + pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object. TODO: this design + is not final and this field is subject to change in + the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + required: + - ref + type: object + metadata: + description: "Metadata is the metadata applied to the machines + of the ControlPlane. At runtime this metadata is merged with + the corresponding metadata from the topology. \n This field + is supported if and only if the control plane provider template + referenced is Machine based." + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map + stored with a resource that may be set by external tools + to store and retrieve arbitrary metadata. They are not queryable + and should be preserved when modifying objects. More info: + http://kubernetes.io/docs/user-guide/annotations' + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used + to organize and categorize (scope and select) objects. May + match selectors of replication controllers and services. + More info: http://kubernetes.io/docs/user-guide/labels' + type: object + type: object + ref: + description: Ref is a required reference to a custom resource + offered by a provider. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead + of an entire object, this string should contain a valid + JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part + of an object. TODO: this design is not final and this field + is subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + required: + - ref + type: object + infrastructure: + description: Infrastructure is a reference to a provider-specific + template that holds the details for provisioning infrastructure + specific cluster for the underlying provider. The underlying provider + is responsible for the implementation of the template to an infrastructure + cluster. + properties: + ref: + description: Ref is a required reference to a custom resource + offered by a provider. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead + of an entire object, this string should contain a valid + JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part + of an object. TODO: this design is not final and this field + is subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + required: + - ref + type: object + workers: + description: Workers describes the worker nodes for the cluster. It + is a collection of node types which can be used to create the worker + nodes of the cluster. + properties: + machineDeployments: + description: MachineDeployments is a list of machine deployment + classes that can be used to create a set of worker nodes. + items: + description: MachineDeploymentClass serves as a template to + define a set of worker nodes of the cluster provisioned using + the `ClusterClass`. + properties: + class: + description: Class denotes a type of worker node present + in the cluster, this name MUST be unique within a ClusterClass + and can be referenced in the Cluster to create a managed + MachineDeployment. + type: string + template: + description: Template is a local struct containing a collection + of templates for creation of MachineDeployment objects + representing a set of worker nodes. + properties: + bootstrap: + description: Bootstrap contains the bootstrap template + reference to be used for the creation of worker Machines. + properties: + ref: + description: Ref is a required reference to a custom + resource offered by a provider. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an + object instead of an entire object, this string + should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to + a container within a pod, this would take + on a value like: "spec.containers{name}" (where + "name" refers to the name of the container + that triggered the event) or if no container + name is specified "spec.containers[2]" (container + with index 2 in this pod). This syntax is + chosen only to have some well-defined way + of referencing a part of an object. TODO: + this design is not final and this field is + subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: + https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which + this reference is made, if any. More info: + https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + required: + - ref + type: object + infrastructure: + description: Infrastructure contains the infrastructure + template reference to be used for the creation of + worker Machines. + properties: + ref: + description: Ref is a required reference to a custom + resource offered by a provider. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an + object instead of an entire object, this string + should contain a valid JSON/Go field access + statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to + a container within a pod, this would take + on a value like: "spec.containers{name}" (where + "name" refers to the name of the container + that triggered the event) or if no container + name is specified "spec.containers[2]" (container + with index 2 in this pod). This syntax is + chosen only to have some well-defined way + of referencing a part of an object. TODO: + this design is not final and this field is + subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: + https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More + info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which + this reference is made, if any. More info: + https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + required: + - ref + type: object + metadata: + description: Metadata is the metadata applied to the + machines of the MachineDeployment. At runtime this + metadata is merged with the corresponding metadata + from the topology. + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key + value map stored with a resource that may be set + by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be + preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that + can be used to organize and categorize (scope + and select) objects. May match selectors of replication + controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' + type: object + type: object + required: + - bootstrap + - infrastructure + type: object + required: + - class + - template + type: object + type: array + type: object + type: object + type: object + served: true storage: true subresources: {} status: diff --git a/config/crd/bases/cluster.x-k8s.io_clusters.yaml b/config/crd/bases/cluster.x-k8s.io_clusters.yaml index e9d5a2331c73..dce1f25211af 100644 --- a/config/crd/bases/cluster.x-k8s.io_clusters.yaml +++ b/config/crd/bases/cluster.x-k8s.io_clusters.yaml @@ -656,6 +656,390 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: Time duration since creation of Cluster + jsonPath: .metadata.creationTimestamp + name: Age + type: date + - description: Cluster status such as Pending/Provisioning/Provisioned/Deleting/Failed + jsonPath: .status.phase + name: Phase + type: string + name: v1beta1 + schema: + openAPIV3Schema: + description: Cluster is the Schema for the clusters API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ClusterSpec defines the desired state of Cluster. + properties: + clusterNetwork: + description: Cluster network configuration. + properties: + apiServerPort: + description: APIServerPort specifies the port the API Server should + bind to. Defaults to 6443. + format: int32 + type: integer + pods: + description: The network ranges from which Pod networks are allocated. + properties: + cidrBlocks: + items: + type: string + type: array + required: + - cidrBlocks + type: object + serviceDomain: + description: Domain name for services. + type: string + services: + description: The network ranges from which service VIPs are allocated. + properties: + cidrBlocks: + items: + type: string + type: array + required: + - cidrBlocks + type: object + type: object + controlPlaneEndpoint: + description: ControlPlaneEndpoint represents the endpoint used to + communicate with the control plane. + properties: + host: + description: The hostname on which the API server is serving. + type: string + port: + description: The port on which the API server is serving. + format: int32 + type: integer + required: + - host + - port + type: object + controlPlaneRef: + description: ControlPlaneRef is an optional reference to a provider-specific + resource that holds the details for provisioning the Control Plane + for a Cluster. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of + an entire object, this string should contain a valid JSON/Go + field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object. TODO: this design is not final and this field is + subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + infrastructureRef: + description: InfrastructureRef is a reference to a provider-specific + resource that holds the details for provisioning infrastructure + for a cluster in said provider. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of + an entire object, this string should contain a valid JSON/Go + field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object. TODO: this design is not final and this field is + subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + paused: + description: Paused can be used to prevent controllers from processing + the Cluster and all its associated objects. + type: boolean + topology: + description: 'This encapsulates the topology for the cluster. NOTE: + It is required to enable the ClusterTopology feature gate flag to + activate managed topologies support; this feature is highly experimental, + and parts of it might still be not implemented.' + properties: + class: + description: The name of the ClusterClass object to create the + topology. + type: string + controlPlane: + description: ControlPlane describes the cluster control plane. + properties: + metadata: + description: "Metadata is the metadata applied to the machines + of the ControlPlane. At runtime this metadata is merged + with the corresponding metadata from the ClusterClass. \n + This field is supported if and only if the control plane + provider template referenced in the ClusterClass is Machine + based." + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value + map stored with a resource that may be set by external + tools to store and retrieve arbitrary metadata. They + are not queryable and should be preserved when modifying + objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be + used to organize and categorize (scope and select) objects. + May match selectors of replication controllers and services. + More info: http://kubernetes.io/docs/user-guide/labels' + type: object + type: object + replicas: + description: Replicas is the number of control plane nodes. + If the value is nil, the ControlPlane object is created + without the number of Replicas and it's assumed that the + control plane controller does not implement support for + this field. When specified against a control plane provider + that lacks support for this field, this value will be ignored. + format: int32 + type: integer + type: object + rolloutAfter: + description: RolloutAfter performs a rollout of the entire cluster + one component at a time, control plane first and then machine + deployments. + format: date-time + type: string + version: + description: The Kubernetes version of the cluster. + type: string + workers: + description: Workers encapsulates the different constructs that + form the worker nodes for the cluster. + properties: + machineDeployments: + description: MachineDeployments is a list of machine deployments + in the cluster. + items: + description: MachineDeploymentTopology specifies the different + parameters for a set of worker nodes in the topology. + This set of nodes is managed by a MachineDeployment object + whose lifecycle is managed by the Cluster controller. + properties: + class: + description: Class is the name of the MachineDeploymentClass + used to create the set of worker nodes. This should + match one of the deployment classes defined in the + ClusterClass object mentioned in the `Cluster.Spec.Class` + field. + type: string + metadata: + description: Metadata is the metadata applied to the + machines of the MachineDeployment. At runtime this + metadata is merged with the corresponding metadata + from the ClusterClass. + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key + value map stored with a resource that may be set + by external tools to store and retrieve arbitrary + metadata. They are not queryable and should be + preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations' + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that + can be used to organize and categorize (scope + and select) objects. May match selectors of replication + controllers and services. More info: http://kubernetes.io/docs/user-guide/labels' + type: object + type: object + name: + description: Name is the unique identifier for this + MachineDeploymentTopology. The value is used with + other unique identifiers to create a MachineDeployment's + Name (e.g. cluster's name, etc). In case the name + is greater than the allowed maximum length, the values + are hashed together. + type: string + replicas: + description: Replicas is the number of worker nodes + belonging to this set. If the value is nil, the MachineDeployment + is created without the number of Replicas (defaulting + to zero) and it's assumed that an external entity + (like cluster autoscaler) is responsible for the management + of this value. + format: int32 + type: integer + required: + - class + - name + type: object + type: array + type: object + required: + - class + - version + type: object + type: object + status: + description: ClusterStatus defines the observed state of Cluster. + properties: + conditions: + description: Conditions defines current service state of the cluster. + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + description: Last time the condition transitioned from one status + to another. This should be when the underlying condition changed. + If that is not known, then using the time when the API field + changed is acceptable. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. This field may be empty. + type: string + reason: + description: The reason for the condition's last transition + in CamelCase. The specific API may choose whether or not this + field is considered a guaranteed API. This field may not be + empty. + type: string + severity: + description: Severity provides an explicit classification of + Reason code, so the users or machines can immediately understand + the current situation and act accordingly. The Severity field + MUST be set only when Status=False. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of condition in CamelCase or in foo.example.com/CamelCase. + Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. + type: string + required: + - status + - type + type: object + type: array + controlPlaneReady: + description: ControlPlaneReady defines if the control plane is ready. + type: boolean + failureDomains: + additionalProperties: + description: FailureDomainSpec is the Schema for Cluster API failure + domains. It allows controllers to understand how many failure + domains a cluster can optionally span across. + properties: + attributes: + additionalProperties: + type: string + description: Attributes is a free form map of attributes an + infrastructure provider might use or require. + type: object + controlPlane: + description: ControlPlane determines if this failure domain + is suitable for use by control plane machines. + type: boolean + type: object + description: FailureDomains is a slice of failure domain objects synced + from the infrastructure provider. + type: object + failureMessage: + description: FailureMessage indicates that there is a fatal problem + reconciling the state, and will be set to a descriptive error message. + type: string + failureReason: + description: FailureReason indicates that there is a fatal problem + reconciling the state, and will be set to a token value suitable + for programmatic interpretation. + type: string + infrastructureReady: + description: InfrastructureReady is the state of the infrastructure + provider. + type: boolean + observedGeneration: + description: ObservedGeneration is the latest generation observed + by the controller. + format: int64 + type: integer + phase: + description: Phase represents the current phase of cluster actuation. + E.g. Pending, Running, Terminating, Failed etc. + type: string + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml b/config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml index 88bbe8daca61..b50417f7e826 100644 --- a/config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml @@ -955,6 +955,464 @@ spec: type: object type: object served: true + storage: false + subresources: + scale: + labelSelectorPath: .status.selector + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas + status: {} + - additionalPrinterColumns: + - description: Cluster + jsonPath: .spec.clusterName + name: Cluster + type: string + - description: Time duration since creation of MachineDeployment + jsonPath: .metadata.creationTimestamp + name: Age + type: date + - description: MachineDeployment status such as ScalingUp/ScalingDown/Running/Failed/Unknown + jsonPath: .status.phase + name: Phase + type: string + - description: Total number of non-terminated machines targeted by this MachineDeployment + jsonPath: .status.replicas + name: Replicas + type: integer + - description: Total number of ready machines targeted by this MachineDeployment + jsonPath: .status.readyReplicas + name: Ready + type: integer + - description: Total number of non-terminated machines targeted by this deployment + that have the desired template spec + jsonPath: .status.updatedReplicas + name: Updated + type: integer + - description: Total number of unavailable machines targeted by this MachineDeployment + jsonPath: .status.unavailableReplicas + name: Unavailable + type: integer + name: v1beta1 + schema: + openAPIV3Schema: + description: MachineDeployment is the Schema for the machinedeployments API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: MachineDeploymentSpec defines the desired state of MachineDeployment. + properties: + clusterName: + description: ClusterName is the name of the Cluster this object belongs + to. + minLength: 1 + type: string + minReadySeconds: + description: Minimum number of seconds for which a newly created machine + should be ready. Defaults to 0 (machine will be considered available + as soon as it is ready) + format: int32 + type: integer + paused: + description: Indicates that the deployment is paused. + type: boolean + progressDeadlineSeconds: + description: The maximum time in seconds for a deployment to make + progress before it is considered to be failed. The deployment controller + will continue to process failed deployments and a condition with + a ProgressDeadlineExceeded reason will be surfaced in the deployment + status. Note that progress will not be estimated during the time + a deployment is paused. Defaults to 600s. + format: int32 + type: integer + replicas: + default: 1 + description: Number of desired machines. Defaults to 1. This is a + pointer to distinguish between explicit zero and not specified. + format: int32 + type: integer + revisionHistoryLimit: + description: The number of old MachineSets to retain to allow rollback. + This is a pointer to distinguish between explicit zero and not specified. + Defaults to 1. + format: int32 + type: integer + selector: + description: Label selector for machines. Existing MachineSets whose + machines are selected by this will be the ones affected by this + deployment. It must match the machine template's labels. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. + properties: + key: + description: key is the label key that the selector applies + to. + type: string + operator: + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + strategy: + description: The deployment strategy to use to replace existing machines + with new ones. + properties: + rollingUpdate: + description: Rolling update config params. Present only if MachineDeploymentStrategyType + = RollingUpdate. + properties: + deletePolicy: + description: DeletePolicy defines the policy used by the MachineDeployment + to identify nodes to delete when downscaling. Valid values + are "Random, "Newest", "Oldest" When no value is supplied, + the default DeletePolicy of MachineSet is used + enum: + - Random + - Newest + - Oldest + type: string + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of machines that can be scheduled + above the desired number of machines. Value can be an absolute + number (ex: 5) or a percentage of desired machines (ex: + 10%). This can not be 0 if MaxUnavailable is 0. Absolute + number is calculated from percentage by rounding up. Defaults + to 1. Example: when this is set to 30%, the new MachineSet + can be scaled up immediately when the rolling update starts, + such that the total number of old and new machines do not + exceed 130% of desired machines. Once old machines have + been killed, new MachineSet can be scaled up further, ensuring + that total number of machines running at any time during + the update is at most 130% of desired machines.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of machines that can be unavailable + during the update. Value can be an absolute number (ex: + 5) or a percentage of desired machines (ex: 10%). Absolute + number is calculated from percentage by rounding down. This + can not be 0 if MaxSurge is 0. Defaults to 0. Example: when + this is set to 30%, the old MachineSet can be scaled down + to 70% of desired machines immediately when the rolling + update starts. Once new machines are ready, old MachineSet + can be scaled down further, followed by scaling up the new + MachineSet, ensuring that the total number of machines available + at all times during the update is at least 70% of desired + machines.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of deployment. Default is RollingUpdate. + enum: + - RollingUpdate + - OnDelete + type: string + type: object + template: + description: Template describes the machines that will be created. + properties: + metadata: + description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map + stored with a resource that may be set by external tools + to store and retrieve arbitrary metadata. They are not queryable + and should be preserved when modifying objects. More info: + http://kubernetes.io/docs/user-guide/annotations' + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used + to organize and categorize (scope and select) objects. May + match selectors of replication controllers and services. + More info: http://kubernetes.io/docs/user-guide/labels' + type: object + type: object + spec: + description: 'Specification of the desired behavior of the machine. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status' + properties: + bootstrap: + description: Bootstrap is a reference to a local struct which + encapsulates fields to configure the Machine’s bootstrapping + mechanism. + properties: + configRef: + description: ConfigRef is a reference to a bootstrap provider-specific + resource that holds configuration details. The reference + is optional to allow users/operators to specify Bootstrap.DataSecretName + without the need of a controller. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object + instead of an entire object, this string should + contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container + that triggered the event) or if no container name + is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only + to have some well-defined way of referencing a part + of an object. TODO: this design is not final and + this field is subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this + reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + dataSecretName: + description: DataSecretName is the name of the secret + that stores the bootstrap data script. If nil, the Machine + should remain in the Pending state. + type: string + type: object + clusterName: + description: ClusterName is the name of the Cluster this object + belongs to. + minLength: 1 + type: string + failureDomain: + description: FailureDomain is the failure domain the machine + will be created in. Must match a key in the FailureDomains + map stored on the cluster object. + type: string + infrastructureRef: + description: InfrastructureRef is a required reference to + a custom resource offered by an infrastructure provider. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead + of an entire object, this string should contain a valid + JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this + pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object. TODO: this design + is not final and this field is subject to change in + the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + nodeDrainTimeout: + description: 'NodeDrainTimeout is the total amount of time + that the controller will spend on draining a node. The default + value is 0, meaning that the node can be drained without + any time limitations. NOTE: NodeDrainTimeout is different + from `kubectl drain --timeout`' + type: string + providerID: + description: ProviderID is the identification ID of the machine + provided by the provider. This field must match the provider + ID as seen on the node object corresponding to this machine. + This field is required by higher level consumers of cluster-api. + Example use case is cluster autoscaler with cluster-api + as provider. Clean-up logic in the autoscaler compares machines + to nodes to find out machines at provider which could not + get registered as Kubernetes nodes. With cluster-api as + a generic out-of-tree provider for autoscaler, this field + is required by autoscaler to be able to have a provider + view of the list of machines. Another list of nodes is queried + from the k8s apiserver and then a comparison is done to + find out unregistered machines and are marked for delete. + This field will be set by the actuators and consumed by + higher level entities like autoscaler that will be interfacing + with cluster-api as generic provider. + type: string + version: + description: Version defines the desired Kubernetes version. + This field is meant to be optionally used by bootstrap providers. + type: string + required: + - bootstrap + - clusterName + - infrastructureRef + type: object + type: object + required: + - clusterName + - selector + - template + type: object + status: + description: MachineDeploymentStatus defines the observed state of MachineDeployment. + properties: + availableReplicas: + description: Total number of available machines (ready for at least + minReadySeconds) targeted by this deployment. + format: int32 + type: integer + conditions: + description: Conditions defines current service state of the MachineDeployment. + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + description: Last time the condition transitioned from one status + to another. This should be when the underlying condition changed. + If that is not known, then using the time when the API field + changed is acceptable. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. This field may be empty. + type: string + reason: + description: The reason for the condition's last transition + in CamelCase. The specific API may choose whether or not this + field is considered a guaranteed API. This field may not be + empty. + type: string + severity: + description: Severity provides an explicit classification of + Reason code, so the users or machines can immediately understand + the current situation and act accordingly. The Severity field + MUST be set only when Status=False. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of condition in CamelCase or in foo.example.com/CamelCase. + Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. + type: string + required: + - status + - type + type: object + type: array + observedGeneration: + description: The generation observed by the deployment controller. + format: int64 + type: integer + phase: + description: Phase represents the current phase of a MachineDeployment + (ScalingUp, ScalingDown, Running, Failed, or Unknown). + type: string + readyReplicas: + description: Total number of ready machines targeted by this deployment. + format: int32 + type: integer + replicas: + description: Total number of non-terminated machines targeted by this + deployment (their labels match the selector). + format: int32 + type: integer + selector: + description: 'Selector is the same as the label selector but in the + string format to avoid introspection by clients. The string will + be in the same format as the query-param syntax. More info about + label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors' + type: string + unavailableReplicas: + description: Total number of unavailable machines targeted by this + deployment. This is the total number of machines that are still + required for the deployment to have 100% available capacity. They + may either be machines that are running but not yet available or + machines that still have not been created. + format: int32 + type: integer + updatedReplicas: + description: Total number of non-terminated machines targeted by this + deployment that have the desired template spec. + format: int32 + type: integer + type: object + type: object + served: true storage: true subresources: scale: diff --git a/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml b/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml index cbe1fbf93f93..b17c19603ee7 100644 --- a/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml @@ -537,6 +537,275 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: Cluster + jsonPath: .spec.clusterName + name: Cluster + type: string + - description: Time duration since creation of MachineHealthCheck + jsonPath: .metadata.creationTimestamp + name: Age + type: date + - description: Maximum number of unhealthy machines allowed + jsonPath: .spec.maxUnhealthy + name: MaxUnhealthy + type: string + - description: Number of machines currently monitored + jsonPath: .status.expectedMachines + name: ExpectedMachines + type: integer + - description: Current observed healthy machines + jsonPath: .status.currentHealthy + name: CurrentHealthy + type: integer + name: v1beta1 + schema: + openAPIV3Schema: + description: MachineHealthCheck is the Schema for the machinehealthchecks + API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Specification of machine health check policy + properties: + clusterName: + description: ClusterName is the name of the Cluster this object belongs + to. + minLength: 1 + type: string + maxUnhealthy: + anyOf: + - type: integer + - type: string + description: Any further remediation is only allowed if at most "MaxUnhealthy" + machines selected by "selector" are not healthy. + x-kubernetes-int-or-string: true + nodeStartupTimeout: + description: Machines older than this duration without a node will + be considered to have failed and will be remediated. If not set, + this value is defaulted to 10 minutes. If you wish to disable this + feature, set the value explicitly to 0. + type: string + remediationTemplate: + description: "RemediationTemplate is a reference to a remediation + template provided by an infrastructure provider. \n This field is + completely optional, when filled, the MachineHealthCheck controller + creates a new object from the template referenced and hands off + remediation of the machine to a controller that lives outside of + Cluster API." + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of + an entire object, this string should contain a valid JSON/Go + field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object. TODO: this design is not final and this field is + subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + selector: + description: Label selector to match machines whose health will be + exercised + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. + properties: + key: + description: key is the label key that the selector applies + to. + type: string + operator: + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + unhealthyConditions: + description: UnhealthyConditions contains a list of the conditions + that determine whether a node is considered unhealthy. The conditions + are combined in a logical OR, i.e. if any of the conditions is met, + the node is unhealthy. + items: + description: UnhealthyCondition represents a Node condition type + and value with a timeout specified as a duration. When the named + condition has been in the given status for at least the timeout + value, a node is considered unhealthy. + properties: + status: + minLength: 1 + type: string + timeout: + type: string + type: + minLength: 1 + type: string + required: + - status + - timeout + - type + type: object + minItems: 1 + type: array + unhealthyRange: + description: 'Any further remediation is only allowed if the number + of machines selected by "selector" as not healthy is within the + range of "UnhealthyRange". Takes precedence over MaxUnhealthy. Eg. + "[3-5]" - This means that remediation will be allowed only when: + (a) there are at least 3 unhealthy machines (and) (b) there are + at most 5 unhealthy machines' + pattern: ^\[[0-9]+-[0-9]+\]$ + type: string + required: + - clusterName + - selector + - unhealthyConditions + type: object + status: + description: Most recently observed status of MachineHealthCheck resource + properties: + conditions: + description: Conditions defines current service state of the MachineHealthCheck. + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + description: Last time the condition transitioned from one status + to another. This should be when the underlying condition changed. + If that is not known, then using the time when the API field + changed is acceptable. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. This field may be empty. + type: string + reason: + description: The reason for the condition's last transition + in CamelCase. The specific API may choose whether or not this + field is considered a guaranteed API. This field may not be + empty. + type: string + severity: + description: Severity provides an explicit classification of + Reason code, so the users or machines can immediately understand + the current situation and act accordingly. The Severity field + MUST be set only when Status=False. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of condition in CamelCase or in foo.example.com/CamelCase. + Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. + type: string + required: + - status + - type + type: object + type: array + currentHealthy: + description: total number of healthy machines counted by this machine + health check + format: int32 + minimum: 0 + type: integer + expectedMachines: + description: total number of machines counted by this machine health + check + format: int32 + minimum: 0 + type: integer + observedGeneration: + description: ObservedGeneration is the latest generation observed + by the controller. + format: int64 + type: integer + remediationsAllowed: + description: RemediationsAllowed is the number of further remediations + allowed by this machine health check before maxUnhealthy short circuiting + will be applied + format: int32 + minimum: 0 + type: integer + targets: + description: Targets shows the current list of machines the machine + health check is watching + items: + type: string + type: array + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/crd/bases/cluster.x-k8s.io_machinepools.yaml b/config/crd/bases/cluster.x-k8s.io_machinepools.yaml index d84812a97f85..05339859f0d3 100644 --- a/config/crd/bases/cluster.x-k8s.io_machinepools.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machinepools.yaml @@ -959,6 +959,411 @@ spec: type: object type: object served: true + storage: false + subresources: + scale: + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas + status: {} + - additionalPrinterColumns: + - description: Time duration since creation of MachinePool + jsonPath: .metadata.creationTimestamp + name: Age + type: date + - description: MachinePool replicas count + jsonPath: .status.replicas + name: Replicas + type: string + - description: MachinePool status such as Terminating/Pending/Provisioning/Running/Failed + etc + jsonPath: .status.phase + name: Phase + type: string + - description: Kubernetes version associated with this MachinePool + jsonPath: .spec.template.spec.version + name: Version + type: string + name: v1beta1 + schema: + openAPIV3Schema: + description: MachinePool is the Schema for the machinepools API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: MachinePoolSpec defines the desired state of MachinePool. + properties: + clusterName: + description: ClusterName is the name of the Cluster this object belongs + to. + minLength: 1 + type: string + failureDomains: + description: FailureDomains is the list of failure domains this MachinePool + should be attached to. + items: + type: string + type: array + minReadySeconds: + description: Minimum number of seconds for which a newly created machine + instances should be ready. Defaults to 0 (machine instance will + be considered available as soon as it is ready) + format: int32 + type: integer + providerIDList: + description: ProviderIDList are the identification IDs of machine + instances provided by the provider. This field must match the provider + IDs as seen on the node objects corresponding to a machine pool's + machine instances. + items: + type: string + type: array + replicas: + description: Number of desired machines. Defaults to 1. This is a + pointer to distinguish between explicit zero and not specified. + format: int32 + type: integer + template: + description: Template describes the machines that will be created. + properties: + metadata: + description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map + stored with a resource that may be set by external tools + to store and retrieve arbitrary metadata. They are not queryable + and should be preserved when modifying objects. More info: + http://kubernetes.io/docs/user-guide/annotations' + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used + to organize and categorize (scope and select) objects. May + match selectors of replication controllers and services. + More info: http://kubernetes.io/docs/user-guide/labels' + type: object + type: object + spec: + description: 'Specification of the desired behavior of the machine. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status' + properties: + bootstrap: + description: Bootstrap is a reference to a local struct which + encapsulates fields to configure the Machine’s bootstrapping + mechanism. + properties: + configRef: + description: ConfigRef is a reference to a bootstrap provider-specific + resource that holds configuration details. The reference + is optional to allow users/operators to specify Bootstrap.DataSecretName + without the need of a controller. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object + instead of an entire object, this string should + contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container + that triggered the event) or if no container name + is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only + to have some well-defined way of referencing a part + of an object. TODO: this design is not final and + this field is subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this + reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + dataSecretName: + description: DataSecretName is the name of the secret + that stores the bootstrap data script. If nil, the Machine + should remain in the Pending state. + type: string + type: object + clusterName: + description: ClusterName is the name of the Cluster this object + belongs to. + minLength: 1 + type: string + failureDomain: + description: FailureDomain is the failure domain the machine + will be created in. Must match a key in the FailureDomains + map stored on the cluster object. + type: string + infrastructureRef: + description: InfrastructureRef is a required reference to + a custom resource offered by an infrastructure provider. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead + of an entire object, this string should contain a valid + JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this + pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object. TODO: this design + is not final and this field is subject to change in + the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + nodeDrainTimeout: + description: 'NodeDrainTimeout is the total amount of time + that the controller will spend on draining a node. The default + value is 0, meaning that the node can be drained without + any time limitations. NOTE: NodeDrainTimeout is different + from `kubectl drain --timeout`' + type: string + providerID: + description: ProviderID is the identification ID of the machine + provided by the provider. This field must match the provider + ID as seen on the node object corresponding to this machine. + This field is required by higher level consumers of cluster-api. + Example use case is cluster autoscaler with cluster-api + as provider. Clean-up logic in the autoscaler compares machines + to nodes to find out machines at provider which could not + get registered as Kubernetes nodes. With cluster-api as + a generic out-of-tree provider for autoscaler, this field + is required by autoscaler to be able to have a provider + view of the list of machines. Another list of nodes is queried + from the k8s apiserver and then a comparison is done to + find out unregistered machines and are marked for delete. + This field will be set by the actuators and consumed by + higher level entities like autoscaler that will be interfacing + with cluster-api as generic provider. + type: string + version: + description: Version defines the desired Kubernetes version. + This field is meant to be optionally used by bootstrap providers. + type: string + required: + - bootstrap + - clusterName + - infrastructureRef + type: object + type: object + required: + - clusterName + - template + type: object + status: + description: MachinePoolStatus defines the observed state of MachinePool. + properties: + availableReplicas: + description: The number of available replicas (ready for at least + minReadySeconds) for this MachinePool. + format: int32 + type: integer + bootstrapReady: + description: BootstrapReady is the state of the bootstrap provider. + type: boolean + conditions: + description: Conditions define the current service state of the MachinePool. + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + description: Last time the condition transitioned from one status + to another. This should be when the underlying condition changed. + If that is not known, then using the time when the API field + changed is acceptable. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. This field may be empty. + type: string + reason: + description: The reason for the condition's last transition + in CamelCase. The specific API may choose whether or not this + field is considered a guaranteed API. This field may not be + empty. + type: string + severity: + description: Severity provides an explicit classification of + Reason code, so the users or machines can immediately understand + the current situation and act accordingly. The Severity field + MUST be set only when Status=False. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of condition in CamelCase or in foo.example.com/CamelCase. + Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. + type: string + required: + - status + - type + type: object + type: array + failureMessage: + description: FailureMessage indicates that there is a problem reconciling + the state, and will be set to a descriptive error message. + type: string + failureReason: + description: FailureReason indicates that there is a problem reconciling + the state, and will be set to a token value suitable for programmatic + interpretation. + type: string + infrastructureReady: + description: InfrastructureReady is the state of the infrastructure + provider. + type: boolean + nodeRefs: + description: NodeRefs will point to the corresponding Nodes if it + they exist. + items: + description: 'ObjectReference contains enough information to let + you inspect or modify the referred object. --- New uses of this + type are discouraged because of difficulty describing its usage + when embedded in APIs. 1. Ignored fields. It includes many fields + which are not generally honored. For instance, ResourceVersion + and FieldPath are both very rarely valid in actual usage. 2. + Invalid usage help. It is impossible to add specific help for + individual usage. In most embedded usages, there are particular restrictions + like, "must refer only to types A and B" or "UID not honored" + or "name must be restricted". Those cannot be well described + when embedded. 3. Inconsistent validation. Because the usages + are different, the validation rules are different by usage, which + makes it hard for users to predict what will happen. 4. The fields + are both imprecise and overly precise. Kind is not a precise + mapping to a URL. This can produce ambiguity during interpretation + and require a REST mapping. In most cases, the dependency is + on the group,resource tuple and the version of the actual + struct is irrelevant. 5. We cannot easily change it. Because + this type is embedded in many locations, updates to this type will + affect numerous schemas. Don''t make new APIs embed an underspecified + API type they do not control. Instead of using this type, create + a locally provided and used type that is well-focused on your + reference. For example, ServiceReferences for admission registration: + https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 + .' + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of + an entire object, this string should contain a valid JSON/Go + field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object. TODO: this design is not final and this field is + subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + type: array + observedGeneration: + description: ObservedGeneration is the latest generation observed + by the controller. + format: int64 + type: integer + phase: + description: Phase represents the current phase of cluster actuation. + E.g. Pending, Running, Terminating, Failed etc. + type: string + readyReplicas: + description: The number of ready replicas for this MachinePool. A + machine is considered ready when the node has been created and is + "Ready". + format: int32 + type: integer + replicas: + description: Replicas is the most recently observed number of replicas. + format: int32 + type: integer + unavailableReplicas: + description: Total number of unavailable machine instances targeted + by this machine pool. This is the total number of machine instances + that are still required for the machine pool to have 100% available + capacity. They may either be machine instances that are running + but not yet available or machine instances that still have not been + created. + format: int32 + type: integer + type: object + type: object + served: true storage: true subresources: scale: diff --git a/config/crd/bases/cluster.x-k8s.io_machines.yaml b/config/crd/bases/cluster.x-k8s.io_machines.yaml index 74782e015acc..a8507c61c993 100644 --- a/config/crd/bases/cluster.x-k8s.io_machines.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machines.yaml @@ -743,6 +743,397 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: Cluster + jsonPath: .spec.clusterName + name: Cluster + type: string + - description: Time duration since creation of Machine + jsonPath: .metadata.creationTimestamp + name: Age + type: date + - description: Provider ID + jsonPath: .spec.providerID + name: ProviderID + type: string + - description: Machine status such as Terminating/Pending/Running/Failed etc + jsonPath: .status.phase + name: Phase + type: string + - description: Kubernetes version associated with this Machine + jsonPath: .spec.version + name: Version + type: string + - description: Node name associated with this machine + jsonPath: .status.nodeRef.name + name: NodeName + priority: 1 + type: string + name: v1beta1 + schema: + openAPIV3Schema: + description: Machine is the Schema for the machines API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: MachineSpec defines the desired state of Machine. + properties: + bootstrap: + description: Bootstrap is a reference to a local struct which encapsulates + fields to configure the Machine’s bootstrapping mechanism. + properties: + configRef: + description: ConfigRef is a reference to a bootstrap provider-specific + resource that holds configuration details. The reference is + optional to allow users/operators to specify Bootstrap.DataSecretName + without the need of a controller. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead + of an entire object, this string should contain a valid + JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part + of an object. TODO: this design is not final and this field + is subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + dataSecretName: + description: DataSecretName is the name of the secret that stores + the bootstrap data script. If nil, the Machine should remain + in the Pending state. + type: string + type: object + clusterName: + description: ClusterName is the name of the Cluster this object belongs + to. + minLength: 1 + type: string + failureDomain: + description: FailureDomain is the failure domain the machine will + be created in. Must match a key in the FailureDomains map stored + on the cluster object. + type: string + infrastructureRef: + description: InfrastructureRef is a required reference to a custom + resource offered by an infrastructure provider. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of + an entire object, this string should contain a valid JSON/Go + field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object. TODO: this design is not final and this field is + subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + nodeDrainTimeout: + description: 'NodeDrainTimeout is the total amount of time that the + controller will spend on draining a node. The default value is 0, + meaning that the node can be drained without any time limitations. + NOTE: NodeDrainTimeout is different from `kubectl drain --timeout`' + type: string + providerID: + description: ProviderID is the identification ID of the machine provided + by the provider. This field must match the provider ID as seen on + the node object corresponding to this machine. This field is required + by higher level consumers of cluster-api. Example use case is cluster + autoscaler with cluster-api as provider. Clean-up logic in the autoscaler + compares machines to nodes to find out machines at provider which + could not get registered as Kubernetes nodes. With cluster-api as + a generic out-of-tree provider for autoscaler, this field is required + by autoscaler to be able to have a provider view of the list of + machines. Another list of nodes is queried from the k8s apiserver + and then a comparison is done to find out unregistered machines + and are marked for delete. This field will be set by the actuators + and consumed by higher level entities like autoscaler that will + be interfacing with cluster-api as generic provider. + type: string + version: + description: Version defines the desired Kubernetes version. This + field is meant to be optionally used by bootstrap providers. + type: string + required: + - bootstrap + - clusterName + - infrastructureRef + type: object + status: + description: MachineStatus defines the observed state of Machine. + properties: + addresses: + description: Addresses is a list of addresses assigned to the machine. + This field is copied from the infrastructure provider reference. + items: + description: MachineAddress contains information for the node's + address. + properties: + address: + description: The machine address. + type: string + type: + description: Machine address type, one of Hostname, ExternalIP + or InternalIP. + type: string + required: + - address + - type + type: object + type: array + bootstrapReady: + description: BootstrapReady is the state of the bootstrap provider. + type: boolean + conditions: + description: Conditions defines current service state of the Machine. + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + description: Last time the condition transitioned from one status + to another. This should be when the underlying condition changed. + If that is not known, then using the time when the API field + changed is acceptable. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. This field may be empty. + type: string + reason: + description: The reason for the condition's last transition + in CamelCase. The specific API may choose whether or not this + field is considered a guaranteed API. This field may not be + empty. + type: string + severity: + description: Severity provides an explicit classification of + Reason code, so the users or machines can immediately understand + the current situation and act accordingly. The Severity field + MUST be set only when Status=False. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of condition in CamelCase or in foo.example.com/CamelCase. + Many .condition.type values are consistent across resources + like Available, but because arbitrary conditions can be useful + (see .node.status.conditions), the ability to deconflict is + important. + type: string + required: + - status + - type + type: object + type: array + failureMessage: + description: "FailureMessage will be set in the event that there is + a terminal problem reconciling the Machine and will contain a more + verbose string suitable for logging and human consumption. \n This + field should not be set for transitive errors that a controller + faces that are expected to be fixed automatically over time (like + service outages), but instead indicate that something is fundamentally + wrong with the Machine's spec or the configuration of the controller, + and that manual intervention is required. Examples of terminal errors + would be invalid combinations of settings in the spec, values that + are unsupported by the controller, or the responsible controller + itself being critically misconfigured. \n Any transient errors that + occur during the reconciliation of Machines can be added as events + to the Machine object and/or logged in the controller's output." + type: string + failureReason: + description: "FailureReason will be set in the event that there is + a terminal problem reconciling the Machine and will contain a succinct + value suitable for machine interpretation. \n This field should + not be set for transitive errors that a controller faces that are + expected to be fixed automatically over time (like service outages), + but instead indicate that something is fundamentally wrong with + the Machine's spec or the configuration of the controller, and that + manual intervention is required. Examples of terminal errors would + be invalid combinations of settings in the spec, values that are + unsupported by the controller, or the responsible controller itself + being critically misconfigured. \n Any transient errors that occur + during the reconciliation of Machines can be added as events to + the Machine object and/or logged in the controller's output." + type: string + infrastructureReady: + description: InfrastructureReady is the state of the infrastructure + provider. + type: boolean + lastUpdated: + description: LastUpdated identifies when the phase of the Machine + last transitioned. + format: date-time + type: string + nodeInfo: + description: 'NodeInfo is a set of ids/uuids to uniquely identify + the node. More info: https://kubernetes.io/docs/concepts/nodes/node/#info' + properties: + architecture: + description: The Architecture reported by the node + type: string + bootID: + description: Boot ID reported by the node. + type: string + containerRuntimeVersion: + description: ContainerRuntime Version reported by the node through + runtime remote API (e.g. docker://1.5.0). + type: string + kernelVersion: + description: Kernel Version reported by the node from 'uname -r' + (e.g. 3.16.0-0.bpo.4-amd64). + type: string + kubeProxyVersion: + description: KubeProxy Version reported by the node. + type: string + kubeletVersion: + description: Kubelet Version reported by the node. + type: string + machineID: + description: 'MachineID reported by the node. For unique machine + identification in the cluster this field is preferred. Learn + more from man(5) machine-id: http://man7.org/linux/man-pages/man5/machine-id.5.html' + type: string + operatingSystem: + description: The Operating System reported by the node + type: string + osImage: + description: OS Image reported by the node from /etc/os-release + (e.g. Debian GNU/Linux 7 (wheezy)). + type: string + systemUUID: + description: SystemUUID reported by the node. For unique machine + identification MachineID is preferred. This field is specific + to Red Hat hosts https://access.redhat.com/documentation/en-us/red_hat_subscription_management/1/html/rhsm/uuid + type: string + required: + - architecture + - bootID + - containerRuntimeVersion + - kernelVersion + - kubeProxyVersion + - kubeletVersion + - machineID + - operatingSystem + - osImage + - systemUUID + type: object + nodeRef: + description: NodeRef will point to the corresponding Node if it exists. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead of + an entire object, this string should contain a valid JSON/Go + field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container within + a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that triggered + the event) or if no container name is specified "spec.containers[2]" + (container with index 2 in this pod). This syntax is chosen + only to have some well-defined way of referencing a part of + an object. TODO: this design is not final and this field is + subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + observedGeneration: + description: ObservedGeneration is the latest generation observed + by the controller. + format: int64 + type: integer + phase: + description: Phase represents the current phase of machine actuation. + E.g. Pending, Running, Terminating, Failed etc. + type: string + version: + description: Version specifies the current version of Kubernetes running + on the corresponding Node. This is meant to be a means of bubbling + up status from the Node to the Machine. It is entirely optional, + but useful for end-user UX if it’s present. + type: string + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/crd/bases/cluster.x-k8s.io_machinesets.yaml b/config/crd/bases/cluster.x-k8s.io_machinesets.yaml index 84369660617f..5261454054c7 100644 --- a/config/crd/bases/cluster.x-k8s.io_machinesets.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machinesets.yaml @@ -791,6 +791,354 @@ spec: type: object type: object served: true + storage: false + subresources: + scale: + labelSelectorPath: .status.selector + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas + status: {} + - additionalPrinterColumns: + - description: Cluster + jsonPath: .spec.clusterName + name: Cluster + type: string + - description: Time duration since creation of MachineSet + jsonPath: .metadata.creationTimestamp + name: Age + type: date + - description: Total number of non-terminated machines targeted by this machineset + jsonPath: .status.replicas + name: Replicas + type: integer + - description: Total number of available machines (ready for at least minReadySeconds) + jsonPath: .status.availableReplicas + name: Available + type: integer + - description: Total number of ready machines targeted by this machineset. + jsonPath: .status.readyReplicas + name: Ready + type: integer + name: v1beta1 + schema: + openAPIV3Schema: + description: MachineSet is the Schema for the machinesets API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: MachineSetSpec defines the desired state of MachineSet. + properties: + clusterName: + description: ClusterName is the name of the Cluster this object belongs + to. + minLength: 1 + type: string + deletePolicy: + description: DeletePolicy defines the policy used to identify nodes + to delete when downscaling. Defaults to "Random". Valid values + are "Random, "Newest", "Oldest" + enum: + - Random + - Newest + - Oldest + type: string + minReadySeconds: + description: MinReadySeconds is the minimum number of seconds for + which a newly created machine should be ready. Defaults to 0 (machine + will be considered available as soon as it is ready) + format: int32 + type: integer + replicas: + default: 1 + description: Replicas is the number of desired replicas. This is a + pointer to distinguish between explicit zero and unspecified. Defaults + to 1. + format: int32 + type: integer + selector: + description: 'Selector is a label query over machines that should + match the replica count. Label keys and values that must match in + order to be controlled by this MachineSet. It must match the machine + template''s labels. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors' + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. + properties: + key: + description: key is the label key that the selector applies + to. + type: string + operator: + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + template: + description: Template is the object that describes the machine that + will be created if insufficient replicas are detected. Object references + to custom resources resources are treated as templates. + properties: + metadata: + description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map + stored with a resource that may be set by external tools + to store and retrieve arbitrary metadata. They are not queryable + and should be preserved when modifying objects. More info: + http://kubernetes.io/docs/user-guide/annotations' + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used + to organize and categorize (scope and select) objects. May + match selectors of replication controllers and services. + More info: http://kubernetes.io/docs/user-guide/labels' + type: object + type: object + spec: + description: 'Specification of the desired behavior of the machine. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status' + properties: + bootstrap: + description: Bootstrap is a reference to a local struct which + encapsulates fields to configure the Machine’s bootstrapping + mechanism. + properties: + configRef: + description: ConfigRef is a reference to a bootstrap provider-specific + resource that holds configuration details. The reference + is optional to allow users/operators to specify Bootstrap.DataSecretName + without the need of a controller. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object + instead of an entire object, this string should + contain a valid JSON/Go field access statement, + such as desiredState.manifest.containers[2]. For + example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container + that triggered the event) or if no container name + is specified "spec.containers[2]" (container with + index 2 in this pod). This syntax is chosen only + to have some well-defined way of referencing a part + of an object. TODO: this design is not final and + this field is subject to change in the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: + https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this + reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + dataSecretName: + description: DataSecretName is the name of the secret + that stores the bootstrap data script. If nil, the Machine + should remain in the Pending state. + type: string + type: object + clusterName: + description: ClusterName is the name of the Cluster this object + belongs to. + minLength: 1 + type: string + failureDomain: + description: FailureDomain is the failure domain the machine + will be created in. Must match a key in the FailureDomains + map stored on the cluster object. + type: string + infrastructureRef: + description: InfrastructureRef is a required reference to + a custom resource offered by an infrastructure provider. + properties: + apiVersion: + description: API version of the referent. + type: string + fieldPath: + description: 'If referring to a piece of an object instead + of an entire object, this string should contain a valid + JSON/Go field access statement, such as desiredState.manifest.containers[2]. + For example, if the object reference is to a container + within a pod, this would take on a value like: "spec.containers{name}" + (where "name" refers to the name of the container that + triggered the event) or if no container name is specified + "spec.containers[2]" (container with index 2 in this + pod). This syntax is chosen only to have some well-defined + way of referencing a part of an object. TODO: this design + is not final and this field is subject to change in + the future.' + type: string + kind: + description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + namespace: + description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' + type: string + resourceVersion: + description: 'Specific resourceVersion to which this reference + is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' + type: string + uid: + description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' + type: string + type: object + nodeDrainTimeout: + description: 'NodeDrainTimeout is the total amount of time + that the controller will spend on draining a node. The default + value is 0, meaning that the node can be drained without + any time limitations. NOTE: NodeDrainTimeout is different + from `kubectl drain --timeout`' + type: string + providerID: + description: ProviderID is the identification ID of the machine + provided by the provider. This field must match the provider + ID as seen on the node object corresponding to this machine. + This field is required by higher level consumers of cluster-api. + Example use case is cluster autoscaler with cluster-api + as provider. Clean-up logic in the autoscaler compares machines + to nodes to find out machines at provider which could not + get registered as Kubernetes nodes. With cluster-api as + a generic out-of-tree provider for autoscaler, this field + is required by autoscaler to be able to have a provider + view of the list of machines. Another list of nodes is queried + from the k8s apiserver and then a comparison is done to + find out unregistered machines and are marked for delete. + This field will be set by the actuators and consumed by + higher level entities like autoscaler that will be interfacing + with cluster-api as generic provider. + type: string + version: + description: Version defines the desired Kubernetes version. + This field is meant to be optionally used by bootstrap providers. + type: string + required: + - bootstrap + - clusterName + - infrastructureRef + type: object + type: object + required: + - clusterName + - selector + type: object + status: + description: MachineSetStatus defines the observed state of MachineSet. + properties: + availableReplicas: + description: The number of available replicas (ready for at least + minReadySeconds) for this MachineSet. + format: int32 + type: integer + failureMessage: + type: string + failureReason: + description: "In the event that there is a terminal problem reconciling + the replicas, both FailureReason and FailureMessage will be set. + FailureReason will be populated with a succinct value suitable for + machine interpretation, while FailureMessage will contain a more + verbose string suitable for logging and human consumption. \n These + fields should not be set for transitive errors that a controller + faces that are expected to be fixed automatically over time (like + service outages), but instead indicate that something is fundamentally + wrong with the MachineTemplate's spec or the configuration of the + machine controller, and that manual intervention is required. Examples + of terminal errors would be invalid combinations of settings in + the spec, values that are unsupported by the machine controller, + or the responsible machine controller itself being critically misconfigured. + \n Any transient errors that occur during the reconciliation of + Machines can be added as events to the MachineSet object and/or + logged in the controller's output." + type: string + fullyLabeledReplicas: + description: The number of replicas that have labels matching the + labels of the machine template of the MachineSet. + format: int32 + type: integer + observedGeneration: + description: ObservedGeneration reflects the generation of the most + recently observed MachineSet. + format: int64 + type: integer + readyReplicas: + description: The number of ready replicas for this MachineSet. A machine + is considered ready when the node has been created and is "Ready". + format: int32 + type: integer + replicas: + description: Replicas is the most recently observed number of replicas. + format: int32 + type: integer + selector: + description: 'Selector is the same as the label selector but in the + string format to avoid introspection by clients. The string will + be in the same format as the query-param syntax. More info about + label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors' + type: string + type: object + type: object + served: true storage: true subresources: scale: diff --git a/config/webhook/manifests.yaml b/config/webhook/manifests.yaml index 6fb10574b395..0ac270fc58af 100644 --- a/config/webhook/manifests.yaml +++ b/config/webhook/manifests.yaml @@ -13,7 +13,7 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-cluster-x-k8s-io-v1alpha4-cluster + path: /mutate-cluster-x-k8s-io-v1beta1-cluster failurePolicy: Fail matchPolicy: Equivalent name: default.cluster.cluster.x-k8s.io @@ -21,7 +21,7 @@ webhooks: - apiGroups: - cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -35,7 +35,7 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-cluster-x-k8s-io-v1alpha4-clusterclass + path: /mutate-cluster-x-k8s-io-v1beta1-clusterclass failurePolicy: Fail matchPolicy: Equivalent name: default.clusterclass.cluster.x-k8s.io @@ -43,7 +43,7 @@ webhooks: - apiGroups: - cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -57,7 +57,7 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-cluster-x-k8s-io-v1alpha4-machine + path: /mutate-cluster-x-k8s-io-v1beta1-machine failurePolicy: Fail matchPolicy: Equivalent name: default.machine.cluster.x-k8s.io @@ -65,7 +65,7 @@ webhooks: - apiGroups: - cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -79,7 +79,7 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-cluster-x-k8s-io-v1alpha4-machinedeployment + path: /mutate-cluster-x-k8s-io-v1beta1-machinedeployment failurePolicy: Fail matchPolicy: Equivalent name: default.machinedeployment.cluster.x-k8s.io @@ -87,7 +87,7 @@ webhooks: - apiGroups: - cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -101,7 +101,7 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-cluster-x-k8s-io-v1alpha4-machinehealthcheck + path: /mutate-cluster-x-k8s-io-v1beta1-machinehealthcheck failurePolicy: Fail matchPolicy: Equivalent name: default.machinehealthcheck.cluster.x-k8s.io @@ -109,7 +109,7 @@ webhooks: - apiGroups: - cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -123,7 +123,7 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-cluster-x-k8s-io-v1alpha4-machineset + path: /mutate-cluster-x-k8s-io-v1beta1-machineset failurePolicy: Fail matchPolicy: Equivalent name: default.machineset.cluster.x-k8s.io @@ -131,7 +131,7 @@ webhooks: - apiGroups: - cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -145,7 +145,7 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-cluster-x-k8s-io-v1alpha4-machinepool + path: /mutate-cluster-x-k8s-io-v1beta1-machinepool failurePolicy: Fail matchPolicy: Equivalent name: default.machinepool.cluster.x-k8s.io @@ -153,7 +153,7 @@ webhooks: - apiGroups: - cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -167,7 +167,7 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-addons-cluster-x-k8s-io-v1alpha4-clusterresourceset + path: /mutate-addons-cluster-x-k8s-io-v1beta1-clusterresourceset failurePolicy: Fail matchPolicy: Equivalent name: default.clusterresourceset.addons.cluster.x-k8s.io @@ -175,7 +175,7 @@ webhooks: - apiGroups: - addons.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -197,7 +197,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-cluster-x-k8s-io-v1alpha4-cluster + path: /validate-cluster-x-k8s-io-v1beta1-cluster failurePolicy: Fail matchPolicy: Equivalent name: validation.cluster.cluster.x-k8s.io @@ -205,7 +205,7 @@ webhooks: - apiGroups: - cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -219,7 +219,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-cluster-x-k8s-io-v1alpha4-clusterclass + path: /validate-cluster-x-k8s-io-v1beta1-clusterclass failurePolicy: Fail matchPolicy: Equivalent name: validation.clusterclass.cluster.x-k8s.io @@ -227,7 +227,7 @@ webhooks: - apiGroups: - cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -241,7 +241,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-cluster-x-k8s-io-v1alpha4-machine + path: /validate-cluster-x-k8s-io-v1beta1-machine failurePolicy: Fail matchPolicy: Equivalent name: validation.machine.cluster.x-k8s.io @@ -249,7 +249,7 @@ webhooks: - apiGroups: - cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -263,7 +263,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-cluster-x-k8s-io-v1alpha4-machinedeployment + path: /validate-cluster-x-k8s-io-v1beta1-machinedeployment failurePolicy: Fail matchPolicy: Equivalent name: validation.machinedeployment.cluster.x-k8s.io @@ -271,7 +271,7 @@ webhooks: - apiGroups: - cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -285,7 +285,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-cluster-x-k8s-io-v1alpha4-machinehealthcheck + path: /validate-cluster-x-k8s-io-v1beta1-machinehealthcheck failurePolicy: Fail matchPolicy: Equivalent name: validation.machinehealthcheck.cluster.x-k8s.io @@ -293,7 +293,7 @@ webhooks: - apiGroups: - cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -307,7 +307,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-cluster-x-k8s-io-v1alpha4-machineset + path: /validate-cluster-x-k8s-io-v1beta1-machineset failurePolicy: Fail matchPolicy: Equivalent name: validation.machineset.cluster.x-k8s.io @@ -315,7 +315,7 @@ webhooks: - apiGroups: - cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -329,7 +329,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-cluster-x-k8s-io-v1alpha4-machinepool + path: /validate-cluster-x-k8s-io-v1beta1-machinepool failurePolicy: Fail matchPolicy: Equivalent name: validation.machinepool.cluster.x-k8s.io @@ -337,7 +337,7 @@ webhooks: - apiGroups: - cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -351,7 +351,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-addons-cluster-x-k8s-io-v1alpha4-clusterresourceset + path: /validate-addons-cluster-x-k8s-io-v1beta1-clusterresourceset failurePolicy: Fail matchPolicy: Equivalent name: validation.clusterresourceset.addons.cluster.x-k8s.io @@ -359,7 +359,7 @@ webhooks: - apiGroups: - addons.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE diff --git a/controllers/cluster_controller.go b/controllers/cluster_controller.go index d8a31f43f19c..85851d146b82 100644 --- a/controllers/cluster_controller.go +++ b/controllers/cluster_controller.go @@ -31,9 +31,9 @@ import ( "k8s.io/apimachinery/pkg/runtime" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" diff --git a/controllers/cluster_controller_phases.go b/controllers/cluster_controller_phases.go index 21359c5bd22d..a2388a27f364 100644 --- a/controllers/cluster_controller_phases.go +++ b/controllers/cluster_controller_phases.go @@ -25,7 +25,7 @@ import ( corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" capierrors "sigs.k8s.io/cluster-api/errors" "sigs.k8s.io/cluster-api/util" diff --git a/controllers/cluster_controller_phases_test.go b/controllers/cluster_controller_phases_test.go index dbb23fccbfed..8635d97ef4aa 100644 --- a/controllers/cluster_controller_phases_test.go +++ b/controllers/cluster_controller_phases_test.go @@ -25,7 +25,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" capierrors "sigs.k8s.io/cluster-api/errors" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/cluster_controller_test.go b/controllers/cluster_controller_test.go index c026d68dc2dd..2dd3199a365a 100644 --- a/controllers/cluster_controller_test.go +++ b/controllers/cluster_controller_test.go @@ -27,8 +27,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/controllers/external/testing.go b/controllers/external/testing.go index 225ae0906722..c2d07f9acc8b 100644 --- a/controllers/external/testing.go +++ b/controllers/external/testing.go @@ -20,7 +20,7 @@ import ( apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) var ( diff --git a/controllers/external/tracker_test.go b/controllers/external/tracker_test.go index 9d3ef6c24624..7026b4c5a815 100644 --- a/controllers/external/tracker_test.go +++ b/controllers/external/tracker_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/log" diff --git a/controllers/external/util.go b/controllers/external/util.go index 783108fd1b8a..bbb55542dc0d 100644 --- a/controllers/external/util.go +++ b/controllers/external/util.go @@ -27,7 +27,7 @@ import ( "k8s.io/apiserver/pkg/storage/names" "sigs.k8s.io/controller-runtime/pkg/client" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) const ( diff --git a/controllers/external/util_test.go b/controllers/external/util_test.go index 8e85596c0b23..8a61a3d24176 100644 --- a/controllers/external/util_test.go +++ b/controllers/external/util_test.go @@ -26,7 +26,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/controllers/machine_controller.go b/controllers/machine_controller.go index 12254060feb1..fa7535b8f8c7 100644 --- a/controllers/machine_controller.go +++ b/controllers/machine_controller.go @@ -32,8 +32,8 @@ import ( "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/record" "k8s.io/klog/v2" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - "sigs.k8s.io/cluster-api/api/v1alpha4/index" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/controllers/noderefutil" "sigs.k8s.io/cluster-api/controllers/remote" diff --git a/controllers/machine_controller_node_labels.go b/controllers/machine_controller_node_labels.go index f085e648af20..dddcfc917aa3 100644 --- a/controllers/machine_controller_node_labels.go +++ b/controllers/machine_controller_node_labels.go @@ -21,7 +21,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/patch" diff --git a/controllers/machine_controller_node_labels_test.go b/controllers/machine_controller_node_labels_test.go index fcbf7cb0cfcd..0ae0da93869c 100644 --- a/controllers/machine_controller_node_labels_test.go +++ b/controllers/machine_controller_node_labels_test.go @@ -29,7 +29,7 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/machine_controller_noderef.go b/controllers/machine_controller_noderef.go index 8c7536e69538..cdf7c7694822 100644 --- a/controllers/machine_controller_noderef.go +++ b/controllers/machine_controller_noderef.go @@ -23,8 +23,8 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - "sigs.k8s.io/cluster-api/api/v1alpha4/index" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/noderefutil" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" diff --git a/controllers/machine_controller_noderef_test.go b/controllers/machine_controller_noderef_test.go index 74c8cb230139..1e73f3fc21cd 100644 --- a/controllers/machine_controller_noderef_test.go +++ b/controllers/machine_controller_noderef_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/noderefutil" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/util" diff --git a/controllers/machine_controller_phases.go b/controllers/machine_controller_phases.go index 41ec4a1326f6..1f6d73d109a1 100644 --- a/controllers/machine_controller_phases.go +++ b/controllers/machine_controller_phases.go @@ -28,7 +28,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" capierrors "sigs.k8s.io/cluster-api/errors" "sigs.k8s.io/cluster-api/util" diff --git a/controllers/machine_controller_phases_test.go b/controllers/machine_controller_phases_test.go index e7cc0a0db3d2..eb61628b0672 100644 --- a/controllers/machine_controller_phases_test.go +++ b/controllers/machine_controller_phases_test.go @@ -35,7 +35,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/log" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/internal/testtypes" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/controllers/machine_controller_test.go b/controllers/machine_controller_test.go index a2958367bbad..10ce4b4f7a0b 100644 --- a/controllers/machine_controller_test.go +++ b/controllers/machine_controller_test.go @@ -34,7 +34,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/reconcile" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/internal/testtypes" "sigs.k8s.io/cluster-api/util" diff --git a/controllers/machinedeployment_controller.go b/controllers/machinedeployment_controller.go index b11e6162ca16..b6118c0dcb1f 100644 --- a/controllers/machinedeployment_controller.go +++ b/controllers/machinedeployment_controller.go @@ -27,7 +27,7 @@ import ( "k8s.io/apimachinery/pkg/labels" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/controllers/machinedeployment_controller_test.go b/controllers/machinedeployment_controller_test.go index cbbdce5bf54f..aed5469bdeae 100644 --- a/controllers/machinedeployment_controller_test.go +++ b/controllers/machinedeployment_controller_test.go @@ -30,7 +30,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/reconcile" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/controllers/machinedeployment_rolling.go b/controllers/machinedeployment_rolling.go index a86bd01af91e..726a47957b43 100644 --- a/controllers/machinedeployment_rolling.go +++ b/controllers/machinedeployment_rolling.go @@ -22,7 +22,7 @@ import ( "github.com/pkg/errors" "k8s.io/utils/integer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/mdutil" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/machinedeployment_rolling_test.go b/controllers/machinedeployment_rolling_test.go index 6aa0332cc2db..0425d56978fc 100644 --- a/controllers/machinedeployment_rolling_test.go +++ b/controllers/machinedeployment_rolling_test.go @@ -25,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/mdutil" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/controllers/machinedeployment_rollout_ondelete.go b/controllers/machinedeployment_rollout_ondelete.go index 3363414453b1..4cdfd75ee0dd 100644 --- a/controllers/machinedeployment_rollout_ondelete.go +++ b/controllers/machinedeployment_rollout_ondelete.go @@ -22,7 +22,7 @@ import ( "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/mdutil" "sigs.k8s.io/cluster-api/util/patch" ctrl "sigs.k8s.io/controller-runtime" diff --git a/controllers/machinedeployment_sync.go b/controllers/machinedeployment_sync.go index c3264ff7a00f..032a6f4f49bc 100644 --- a/controllers/machinedeployment_sync.go +++ b/controllers/machinedeployment_sync.go @@ -29,7 +29,7 @@ import ( apirand "k8s.io/apimachinery/pkg/util/rand" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/util/retry" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/mdutil" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/util" diff --git a/controllers/machinedeployment_sync_test.go b/controllers/machinedeployment_sync_test.go index 7f97e355d1ed..73366f8ecb61 100644 --- a/controllers/machinedeployment_sync_test.go +++ b/controllers/machinedeployment_sync_test.go @@ -27,7 +27,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/mdutil" capierrors "sigs.k8s.io/cluster-api/errors" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/machinehealthcheck_controller.go b/controllers/machinehealthcheck_controller.go index 699b86729b5c..14c1a8f34c34 100644 --- a/controllers/machinehealthcheck_controller.go +++ b/controllers/machinehealthcheck_controller.go @@ -35,8 +35,8 @@ import ( kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - "sigs.k8s.io/cluster-api/api/v1alpha4/index" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/util" diff --git a/controllers/machinehealthcheck_controller_test.go b/controllers/machinehealthcheck_controller_test.go index 3363e78afef9..bce852c17ebc 100644 --- a/controllers/machinehealthcheck_controller_test.go +++ b/controllers/machinehealthcheck_controller_test.go @@ -41,7 +41,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log" "sigs.k8s.io/controller-runtime/pkg/reconcile" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" capierrors "sigs.k8s.io/cluster-api/errors" "sigs.k8s.io/cluster-api/util" diff --git a/controllers/machinehealthcheck_status_matcher_test.go b/controllers/machinehealthcheck_status_matcher_test.go index 63bcc3e92089..73d5c08f288a 100644 --- a/controllers/machinehealthcheck_status_matcher_test.go +++ b/controllers/machinehealthcheck_status_matcher_test.go @@ -21,7 +21,7 @@ import ( . "github.com/onsi/gomega" "github.com/onsi/gomega/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" ) diff --git a/controllers/machinehealthcheck_targets.go b/controllers/machinehealthcheck_targets.go index c103a9847ab1..f7907b1685a1 100644 --- a/controllers/machinehealthcheck_targets.go +++ b/controllers/machinehealthcheck_targets.go @@ -27,7 +27,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" diff --git a/controllers/machinehealthcheck_targets_test.go b/controllers/machinehealthcheck_targets_test.go index 331b897a15be..d7e776ad395a 100644 --- a/controllers/machinehealthcheck_targets_test.go +++ b/controllers/machinehealthcheck_targets_test.go @@ -24,7 +24,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" ctrl "sigs.k8s.io/controller-runtime" diff --git a/controllers/machineset_controller.go b/controllers/machineset_controller.go index 39d043641617..c8a4adcfc37b 100644 --- a/controllers/machineset_controller.go +++ b/controllers/machineset_controller.go @@ -29,7 +29,7 @@ import ( "k8s.io/apimachinery/pkg/labels" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/controllers/noderefutil" "sigs.k8s.io/cluster-api/controllers/remote" diff --git a/controllers/machineset_controller_test.go b/controllers/machineset_controller_test.go index 4adcf127c991..7bcbedcd63db 100644 --- a/controllers/machineset_controller_test.go +++ b/controllers/machineset_controller_test.go @@ -31,7 +31,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/controller-runtime/pkg/reconcile" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/util" ) diff --git a/controllers/machineset_delete_policy.go b/controllers/machineset_delete_policy.go index 1b705ad6af89..9d52bfd28077 100644 --- a/controllers/machineset_delete_policy.go +++ b/controllers/machineset_delete_policy.go @@ -22,7 +22,7 @@ import ( "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) type ( diff --git a/controllers/machineset_delete_policy_test.go b/controllers/machineset_delete_policy_test.go index ccc9565b2a22..126cecd7794e 100644 --- a/controllers/machineset_delete_policy_test.go +++ b/controllers/machineset_delete_policy_test.go @@ -23,7 +23,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" capierrors "sigs.k8s.io/cluster-api/errors" ) diff --git a/controllers/mdutil/util.go b/controllers/mdutil/util.go index 0388989dc5d3..c9358e778bfc 100644 --- a/controllers/mdutil/util.go +++ b/controllers/mdutil/util.go @@ -34,7 +34,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" intstrutil "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/utils/integer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conversion" ) diff --git a/controllers/mdutil/util_test.go b/controllers/mdutil/util_test.go index f6b038fbfebb..d51fbbf75535 100644 --- a/controllers/mdutil/util_test.go +++ b/controllers/mdutil/util_test.go @@ -31,7 +31,7 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apiserver/pkg/storage/names" "k8s.io/klog/v2/klogr" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func newDControllerRef(d *clusterv1.MachineDeployment) *metav1.OwnerReference { diff --git a/controllers/noderefutil/indexer.go b/controllers/noderefutil/indexer.go index d2fe60006d69..3176154b1292 100644 --- a/controllers/noderefutil/indexer.go +++ b/controllers/noderefutil/indexer.go @@ -21,7 +21,7 @@ import ( "fmt" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controllers/noderefutil/machine.go b/controllers/noderefutil/machine.go index e0845a01b873..c3cf28f883fc 100644 --- a/controllers/noderefutil/machine.go +++ b/controllers/noderefutil/machine.go @@ -20,7 +20,7 @@ import ( "context" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controllers/remote/cluster_cache.go b/controllers/remote/cluster_cache.go index 3b884be02f84..3245ad35656a 100644 --- a/controllers/remote/cluster_cache.go +++ b/controllers/remote/cluster_cache.go @@ -32,7 +32,7 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache" diff --git a/controllers/remote/cluster_cache_healthcheck_test.go b/controllers/remote/cluster_cache_healthcheck_test.go index 259f1269053d..42ec9b573c22 100644 --- a/controllers/remote/cluster_cache_healthcheck_test.go +++ b/controllers/remote/cluster_cache_healthcheck_test.go @@ -29,7 +29,7 @@ import ( "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/klog/v2/klogr" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/remote/cluster_cache_reconciler.go b/controllers/remote/cluster_cache_reconciler.go index a665bab39336..c1138d7c3684 100644 --- a/controllers/remote/cluster_cache_reconciler.go +++ b/controllers/remote/cluster_cache_reconciler.go @@ -22,7 +22,7 @@ import ( "github.com/go-logr/logr" "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/predicates" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/remote/cluster_cache_reconciler_test.go b/controllers/remote/cluster_cache_reconciler_test.go index cc0ddb3fa1b8..df1028fa55c1 100644 --- a/controllers/remote/cluster_cache_reconciler_test.go +++ b/controllers/remote/cluster_cache_reconciler_test.go @@ -25,7 +25,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" diff --git a/controllers/remote/cluster_cache_tracker_test.go b/controllers/remote/cluster_cache_tracker_test.go index 8eb2c302f86a..5507106a6d35 100644 --- a/controllers/remote/cluster_cache_tracker_test.go +++ b/controllers/remote/cluster_cache_tracker_test.go @@ -25,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" ctrl "sigs.k8s.io/controller-runtime" diff --git a/controllers/remote/index.go b/controllers/remote/index.go index 7ed25a431e65..e7a13442cdc7 100644 --- a/controllers/remote/index.go +++ b/controllers/remote/index.go @@ -18,7 +18,7 @@ package remote import ( corev1 "k8s.io/api/core/v1" - "sigs.k8s.io/cluster-api/api/v1alpha4/index" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controllers/schema_test.go b/controllers/schema_test.go index ac6bcec533ee..e9f244fa8331 100644 --- a/controllers/schema_test.go +++ b/controllers/schema_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controllers/suite_test.go b/controllers/suite_test.go index d5db30f5c335..a501eec06fdd 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -31,8 +31,8 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" clientgoscheme "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - "sigs.k8s.io/cluster-api/api/v1alpha4/index" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/internal/envtest" ctrl "sigs.k8s.io/controller-runtime" diff --git a/controllers/suite_util_test.go b/controllers/suite_util_test.go index 62247f571be4..96e3756bd524 100644 --- a/controllers/suite_util_test.go +++ b/controllers/suite_util_test.go @@ -29,7 +29,7 @@ import ( "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func intOrStrPtr(i int32) *intstr.IntOrString { diff --git a/controllers/topology/blueprint.go b/controllers/topology/blueprint.go index a2ce9ee3f5bf..181de1e2ede4 100644 --- a/controllers/topology/blueprint.go +++ b/controllers/topology/blueprint.go @@ -21,7 +21,7 @@ import ( "github.com/pkg/errors" kerrors "k8s.io/apimachinery/pkg/util/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" tlog "sigs.k8s.io/cluster-api/controllers/topology/internal/log" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" "sigs.k8s.io/cluster-api/util/patch" diff --git a/controllers/topology/blueprint_test.go b/controllers/topology/blueprint_test.go index 0cf06c82bd12..bf37b9623692 100644 --- a/controllers/topology/blueprint_test.go +++ b/controllers/topology/blueprint_test.go @@ -23,7 +23,7 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" "sigs.k8s.io/cluster-api/internal/testtypes" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/topology/cluster_controller.go b/controllers/topology/cluster_controller.go index 5fffab34850e..5adf418e06f1 100644 --- a/controllers/topology/cluster_controller.go +++ b/controllers/topology/cluster_controller.go @@ -23,8 +23,8 @@ import ( "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - "sigs.k8s.io/cluster-api/api/v1alpha4/index" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" "sigs.k8s.io/cluster-api/util" diff --git a/controllers/topology/current_state.go b/controllers/topology/current_state.go index ecded39310fe..4daa38d612ed 100644 --- a/controllers/topology/current_state.go +++ b/controllers/topology/current_state.go @@ -22,7 +22,7 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/contract" tlog "sigs.k8s.io/cluster-api/controllers/topology/internal/log" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" diff --git a/controllers/topology/current_state_test.go b/controllers/topology/current_state_test.go index 5e9f65be5869..95667e6e7917 100644 --- a/controllers/topology/current_state_test.go +++ b/controllers/topology/current_state_test.go @@ -26,7 +26,7 @@ import ( "github.com/google/go-cmp/cmp" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/controllers/topology/desired_state.go b/controllers/topology/desired_state.go index 7b2f7d6d8e84..ef7d7ba10a0b 100644 --- a/controllers/topology/desired_state.go +++ b/controllers/topology/desired_state.go @@ -26,7 +26,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apiserver/pkg/storage/names" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/controllers/topology/internal/contract" tlog "sigs.k8s.io/cluster-api/controllers/topology/internal/log" diff --git a/controllers/topology/desired_state_test.go b/controllers/topology/desired_state_test.go index d0c4862ac710..53363670c2a2 100644 --- a/controllers/topology/desired_state_test.go +++ b/controllers/topology/desired_state_test.go @@ -28,7 +28,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/contract" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" ) diff --git a/controllers/topology/internal/contract/controlplane_test.go b/controllers/topology/internal/contract/controlplane_test.go index 806d3fc1f00e..dfd149223448 100644 --- a/controllers/topology/internal/contract/controlplane_test.go +++ b/controllers/topology/internal/contract/controlplane_test.go @@ -21,7 +21,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestControlPlane(t *testing.T) { diff --git a/controllers/topology/internal/contract/metadata.go b/controllers/topology/internal/contract/metadata.go index 3d09e574b32f..eed2c9915912 100644 --- a/controllers/topology/internal/contract/metadata.go +++ b/controllers/topology/internal/contract/metadata.go @@ -21,7 +21,7 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // Metadata provides a helper struct for working with Metadata. diff --git a/controllers/topology/internal/log/log.go b/controllers/topology/internal/log/log.go index fae4b537ba71..b655084e2d13 100644 --- a/controllers/topology/internal/log/log.go +++ b/controllers/topology/internal/log/log.go @@ -22,7 +22,7 @@ import ( "github.com/go-logr/logr" corev1 "k8s.io/api/core/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controllers/topology/internal/scope/blueprint.go b/controllers/topology/internal/scope/blueprint.go index 3a3f73855532..8f9a8b3bf638 100644 --- a/controllers/topology/internal/scope/blueprint.go +++ b/controllers/topology/internal/scope/blueprint.go @@ -18,7 +18,7 @@ package scope import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // ClusterBlueprint holds all the objects required for computing the desired state of a managed Cluster topology, diff --git a/controllers/topology/internal/scope/scope.go b/controllers/topology/internal/scope/scope.go index 6778dd6beaae..0ce1d27f19c3 100644 --- a/controllers/topology/internal/scope/scope.go +++ b/controllers/topology/internal/scope/scope.go @@ -17,7 +17,7 @@ limitations under the License. package scope import ( - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // Scope holds all the information to process a request in the topology/ClusterReconciler controller. diff --git a/controllers/topology/internal/scope/state.go b/controllers/topology/internal/scope/state.go index 123b9539a6e8..da9d72b4962e 100644 --- a/controllers/topology/internal/scope/state.go +++ b/controllers/topology/internal/scope/state.go @@ -18,7 +18,7 @@ package scope import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/mdutil" ) diff --git a/controllers/topology/machinedeployment_controller.go b/controllers/topology/machinedeployment_controller.go index 6b65c7f5c26d..62854d5d06ed 100644 --- a/controllers/topology/machinedeployment_controller.go +++ b/controllers/topology/machinedeployment_controller.go @@ -21,7 +21,7 @@ import ( "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" tlog "sigs.k8s.io/cluster-api/controllers/topology/internal/log" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" diff --git a/controllers/topology/machinedeployment_controller_test.go b/controllers/topology/machinedeployment_controller_test.go index 3fb591aed469..d427d7770467 100644 --- a/controllers/topology/machinedeployment_controller_test.go +++ b/controllers/topology/machinedeployment_controller_test.go @@ -24,7 +24,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/internal/testtypes" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/controllers/topology/machineset_controller.go b/controllers/topology/machineset_controller.go index f289f1cfd7a6..e1afd6eeda5a 100644 --- a/controllers/topology/machineset_controller.go +++ b/controllers/topology/machineset_controller.go @@ -23,7 +23,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" tlog "sigs.k8s.io/cluster-api/controllers/topology/internal/log" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" diff --git a/controllers/topology/machineset_controller_test.go b/controllers/topology/machineset_controller_test.go index 6336166638ce..3c2ebff83298 100644 --- a/controllers/topology/machineset_controller_test.go +++ b/controllers/topology/machineset_controller_test.go @@ -21,7 +21,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/internal/testtypes" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/controllers/topology/reconcile_state_test.go b/controllers/topology/reconcile_state_test.go index dd99817414e2..32691a188f25 100644 --- a/controllers/topology/reconcile_state_test.go +++ b/controllers/topology/reconcile_state_test.go @@ -27,7 +27,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/topology/internal/contract" "sigs.k8s.io/cluster-api/controllers/topology/internal/scope" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controllers/topology/suite_test.go b/controllers/topology/suite_test.go index 076969d78653..fa1955e59b77 100644 --- a/controllers/topology/suite_test.go +++ b/controllers/topology/suite_test.go @@ -22,7 +22,7 @@ import ( clientgoscheme "k8s.io/client-go/kubernetes/scheme" ctrl "sigs.k8s.io/controller-runtime" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) var ( diff --git a/controllers/topology/util.go b/controllers/topology/util.go index 18a18c5b9408..3e76bbb12585 100644 --- a/controllers/topology/util.go +++ b/controllers/topology/util.go @@ -26,7 +26,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" tlog "sigs.k8s.io/cluster-api/controllers/topology/internal/log" utilconversion "sigs.k8s.io/cluster-api/util/conversion" diff --git a/controllers/topology/util_test.go b/controllers/topology/util_test.go index de8baa0d9cce..82af6fe9fb37 100644 --- a/controllers/topology/util_test.go +++ b/controllers/topology/util_test.go @@ -20,7 +20,7 @@ import ( "testing" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/internal/testtypes" "github.com/google/go-cmp/cmp" diff --git a/controlplane/kubeadm/api/v1alpha4/condition_consts.go b/controlplane/kubeadm/api/v1alpha4/condition_consts.go index 5bfe23541228..946b5a487bc8 100644 --- a/controlplane/kubeadm/api/v1alpha4/condition_consts.go +++ b/controlplane/kubeadm/api/v1alpha4/condition_consts.go @@ -16,7 +16,7 @@ limitations under the License. package v1alpha4 -import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" +import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" // Conditions and condition Reasons for the KubeadmControlPlane object diff --git a/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go b/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go index e883ae6cf174..938fe56b697d 100644 --- a/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go +++ b/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go @@ -20,7 +20,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" cabpkv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/errors" ) diff --git a/controlplane/kubeadm/controllers/controller.go b/controlplane/kubeadm/controllers/controller.go index 0e9e69a27e62..c1985a937b65 100644 --- a/controlplane/kubeadm/controllers/controller.go +++ b/controlplane/kubeadm/controllers/controller.go @@ -29,12 +29,12 @@ import ( kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/client-go/tools/record" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controllers/remote" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" diff --git a/controlplane/kubeadm/controllers/controller_test.go b/controlplane/kubeadm/controllers/controller_test.go index d9a9ed4039e0..e5da1805243e 100644 --- a/controlplane/kubeadm/controllers/controller_test.go +++ b/controlplane/kubeadm/controllers/controller_test.go @@ -23,7 +23,7 @@ import ( "testing" "time" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "github.com/blang/semver" @@ -38,7 +38,7 @@ import ( "k8s.io/client-go/tools/record" "k8s.io/klog/v2/klogr" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controllers/external" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" diff --git a/controlplane/kubeadm/controllers/fakes_test.go b/controlplane/kubeadm/controllers/fakes_test.go index ee38d580f331..3ffa529a86d2 100644 --- a/controlplane/kubeadm/controllers/fakes_test.go +++ b/controlplane/kubeadm/controllers/fakes_test.go @@ -20,9 +20,9 @@ import ( "context" "github.com/blang/semver" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/util/collections" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controlplane/kubeadm/controllers/helpers.go b/controlplane/kubeadm/controllers/helpers.go index 12e1b72d40ec..118a172be4cb 100644 --- a/controlplane/kubeadm/controllers/helpers.go +++ b/controlplane/kubeadm/controllers/helpers.go @@ -28,7 +28,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apiserver/pkg/storage/names" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controllers/external" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" diff --git a/controlplane/kubeadm/controllers/helpers_test.go b/controlplane/kubeadm/controllers/helpers_test.go index 2d02abc27827..d11fb603caa5 100644 --- a/controlplane/kubeadm/controllers/helpers_test.go +++ b/controlplane/kubeadm/controllers/helpers_test.go @@ -25,7 +25,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/client-go/tools/record" utilpointer "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controllers/external" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" diff --git a/controlplane/kubeadm/controllers/remediation.go b/controlplane/kubeadm/controllers/remediation.go index f8d5e996a47c..cbfdba21c0a8 100644 --- a/controlplane/kubeadm/controllers/remediation.go +++ b/controlplane/kubeadm/controllers/remediation.go @@ -22,7 +22,7 @@ import ( "github.com/blang/semver" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" "sigs.k8s.io/cluster-api/util" diff --git a/controlplane/kubeadm/controllers/remediation_test.go b/controlplane/kubeadm/controllers/remediation_test.go index 89b0cfa3e228..1172ee04bab9 100644 --- a/controlplane/kubeadm/controllers/remediation_test.go +++ b/controlplane/kubeadm/controllers/remediation_test.go @@ -30,7 +30,7 @@ import ( "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/client-go/tools/record" utilpointer "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" "sigs.k8s.io/cluster-api/util/collections" diff --git a/controlplane/kubeadm/controllers/scale.go b/controlplane/kubeadm/controllers/scale.go index 10229556464a..18d90849fa25 100644 --- a/controlplane/kubeadm/controllers/scale.go +++ b/controlplane/kubeadm/controllers/scale.go @@ -27,7 +27,7 @@ import ( corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" kerrors "k8s.io/apimachinery/pkg/util/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" "sigs.k8s.io/cluster-api/util" diff --git a/controlplane/kubeadm/controllers/scale_test.go b/controlplane/kubeadm/controllers/scale_test.go index d193e8a8dc5a..c1af393bea4a 100644 --- a/controlplane/kubeadm/controllers/scale_test.go +++ b/controlplane/kubeadm/controllers/scale_test.go @@ -29,7 +29,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" diff --git a/controlplane/kubeadm/controllers/status.go b/controlplane/kubeadm/controllers/status.go index 8d91caa1f1c5..54714569c749 100644 --- a/controlplane/kubeadm/controllers/status.go +++ b/controlplane/kubeadm/controllers/status.go @@ -22,7 +22,7 @@ import ( "sigs.k8s.io/cluster-api/util/collections" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" "sigs.k8s.io/cluster-api/util" diff --git a/controlplane/kubeadm/controllers/status_test.go b/controlplane/kubeadm/controllers/status_test.go index cab59cccd8c3..b89455ae6387 100644 --- a/controlplane/kubeadm/controllers/status_test.go +++ b/controlplane/kubeadm/controllers/status_test.go @@ -27,7 +27,7 @@ import ( "k8s.io/client-go/tools/record" "k8s.io/klog/v2/klogr" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/controlplane/kubeadm/controllers/upgrade.go b/controlplane/kubeadm/controllers/upgrade.go index 7ea5a222249f..802ed0142102 100644 --- a/controlplane/kubeadm/controllers/upgrade.go +++ b/controlplane/kubeadm/controllers/upgrade.go @@ -21,7 +21,7 @@ import ( "github.com/blang/semver" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" "sigs.k8s.io/cluster-api/util" diff --git a/controlplane/kubeadm/controllers/upgrade_test.go b/controlplane/kubeadm/controllers/upgrade_test.go index 3f814545a269..33cb84aed11a 100644 --- a/controlplane/kubeadm/controllers/upgrade_test.go +++ b/controlplane/kubeadm/controllers/upgrade_test.go @@ -29,7 +29,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal" ctrl "sigs.k8s.io/controller-runtime" diff --git a/controlplane/kubeadm/internal/cluster.go b/controlplane/kubeadm/internal/cluster.go index 812c9c35d0d1..b497a07a26d0 100644 --- a/controlplane/kubeadm/internal/cluster.go +++ b/controlplane/kubeadm/internal/cluster.go @@ -25,9 +25,9 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/util/collections" "sigs.k8s.io/cluster-api/util/secret" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/controlplane/kubeadm/internal/cluster_labels.go b/controlplane/kubeadm/internal/cluster_labels.go index bb6be3a7472e..22a1300a53a7 100644 --- a/controlplane/kubeadm/internal/cluster_labels.go +++ b/controlplane/kubeadm/internal/cluster_labels.go @@ -17,7 +17,7 @@ limitations under the License. package internal import ( - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" ) diff --git a/controlplane/kubeadm/internal/cluster_test.go b/controlplane/kubeadm/internal/cluster_test.go index 2f0f893e851a..3f004943cebf 100644 --- a/controlplane/kubeadm/internal/cluster_test.go +++ b/controlplane/kubeadm/internal/cluster_test.go @@ -34,7 +34,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/util/certs" "sigs.k8s.io/cluster-api/util/collections" diff --git a/controlplane/kubeadm/internal/control_plane.go b/controlplane/kubeadm/internal/control_plane.go index 81fa9d02ccb2..0be5564113a1 100644 --- a/controlplane/kubeadm/internal/control_plane.go +++ b/controlplane/kubeadm/internal/control_plane.go @@ -28,7 +28,7 @@ import ( kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apiserver/pkg/storage/names" "k8s.io/klog/v2/klogr" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controllers/external" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" diff --git a/controlplane/kubeadm/internal/control_plane_test.go b/controlplane/kubeadm/internal/control_plane_test.go index 62ed22456230..a1ba8796b706 100644 --- a/controlplane/kubeadm/internal/control_plane_test.go +++ b/controlplane/kubeadm/internal/control_plane_test.go @@ -27,7 +27,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/controlplane/kubeadm/internal/filters.go b/controlplane/kubeadm/internal/filters.go index 7714d7f63811..82f0c87d33e4 100644 --- a/controlplane/kubeadm/internal/filters.go +++ b/controlplane/kubeadm/internal/filters.go @@ -21,7 +21,7 @@ import ( "reflect" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/util/collections" diff --git a/controlplane/kubeadm/internal/filters_test.go b/controlplane/kubeadm/internal/filters_test.go index 16d7c12e1dd3..bacc5c52be9c 100644 --- a/controlplane/kubeadm/internal/filters_test.go +++ b/controlplane/kubeadm/internal/filters_test.go @@ -23,7 +23,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" ) diff --git a/controlplane/kubeadm/internal/workload_cluster.go b/controlplane/kubeadm/internal/workload_cluster.go index 1c383e2a6da7..9252bca5db78 100644 --- a/controlplane/kubeadm/internal/workload_cluster.go +++ b/controlplane/kubeadm/internal/workload_cluster.go @@ -37,7 +37,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/client-go/util/retry" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" kubeadmtypes "sigs.k8s.io/cluster-api/bootstrap/kubeadm/types" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" diff --git a/controlplane/kubeadm/internal/workload_cluster_conditions.go b/controlplane/kubeadm/internal/workload_cluster_conditions.go index e0b1d68e9ad2..0d7763de85d8 100644 --- a/controlplane/kubeadm/internal/workload_cluster_conditions.go +++ b/controlplane/kubeadm/internal/workload_cluster_conditions.go @@ -25,7 +25,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/sets" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd" etcdutil "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd/util" diff --git a/controlplane/kubeadm/internal/workload_cluster_conditions_test.go b/controlplane/kubeadm/internal/workload_cluster_conditions_test.go index 1c60fb0c0bab..2ccc9146784c 100644 --- a/controlplane/kubeadm/internal/workload_cluster_conditions_test.go +++ b/controlplane/kubeadm/internal/workload_cluster_conditions_test.go @@ -28,7 +28,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd" diff --git a/controlplane/kubeadm/internal/workload_cluster_etcd.go b/controlplane/kubeadm/internal/workload_cluster_etcd.go index dffa911f5b4a..220dbd8a02f4 100644 --- a/controlplane/kubeadm/internal/workload_cluster_etcd.go +++ b/controlplane/kubeadm/internal/workload_cluster_etcd.go @@ -22,7 +22,7 @@ import ( "github.com/blang/semver" "github.com/pkg/errors" kerrors "k8s.io/apimachinery/pkg/util/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd" etcdutil "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd/util" diff --git a/controlplane/kubeadm/internal/workload_cluster_etcd_test.go b/controlplane/kubeadm/internal/workload_cluster_etcd_test.go index 56a3ca1c0662..bae50da49730 100644 --- a/controlplane/kubeadm/internal/workload_cluster_etcd_test.go +++ b/controlplane/kubeadm/internal/workload_cluster_etcd_test.go @@ -28,7 +28,7 @@ import ( clientv3 "go.etcd.io/etcd/client/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd" fake2 "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd/fake" "sigs.k8s.io/cluster-api/util/yaml" diff --git a/controlplane/kubeadm/internal/workload_cluster_test.go b/controlplane/kubeadm/internal/workload_cluster_test.go index 56423d16e625..4f4292aea2cf 100644 --- a/controlplane/kubeadm/internal/workload_cluster_test.go +++ b/controlplane/kubeadm/internal/workload_cluster_test.go @@ -29,7 +29,7 @@ import ( corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/util/yaml" diff --git a/controlplane/kubeadm/main.go b/controlplane/kubeadm/main.go index 966520f93009..9bca61379aa9 100644 --- a/controlplane/kubeadm/main.go +++ b/controlplane/kubeadm/main.go @@ -35,7 +35,7 @@ import ( cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" kubeadmbootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/controllers/remote" kubeadmcontrolplanev1old "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha3" diff --git a/exp/PROJECT b/exp/PROJECT index 2ce9c9bb8127..6e036406e934 100644 --- a/exp/PROJECT +++ b/exp/PROJECT @@ -8,3 +8,6 @@ resources: - group: cluster kind: MachinePool version: v1alpha4 +- group: cluster + kind: MachinePool + version: v1beta1 diff --git a/exp/addons/PROJECT b/exp/addons/PROJECT index e461cf47d148..ebc320f2ff60 100644 --- a/exp/addons/PROJECT +++ b/exp/addons/PROJECT @@ -8,4 +8,6 @@ resources: - group: addons kind: ClusterResourceSet version: v1alpha4 - +- group: addons + kind: ClusterResourceSet + version: v1beta1 diff --git a/exp/addons/api/v1alpha3/doc.go b/exp/addons/api/v1alpha3/doc.go index e87dca87ab27..943ee7960045 100644 --- a/exp/addons/api/v1alpha3/doc.go +++ b/exp/addons/api/v1alpha3/doc.go @@ -15,5 +15,5 @@ limitations under the License. */ // Package v1alpha3 contains the v1alpha3 API implementation. -// +k8s:conversion-gen=sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4 +// +k8s:conversion-gen=sigs.k8s.io/cluster-api/exp/addons/api/v1beta1 package v1alpha3 diff --git a/exp/addons/api/v1alpha3/zz_generated.conversion.go b/exp/addons/api/v1alpha3/zz_generated.conversion.go index ee8945000722..65b0e28d10a7 100644 --- a/exp/addons/api/v1alpha3/zz_generated.conversion.go +++ b/exp/addons/api/v1alpha3/zz_generated.conversion.go @@ -27,8 +27,8 @@ import ( conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" apiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - v1alpha4 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" + apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" + v1beta1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" ) func init() { @@ -38,216 +38,216 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*ClusterResourceSet)(nil), (*v1alpha4.ClusterResourceSet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ClusterResourceSet_To_v1alpha4_ClusterResourceSet(a.(*ClusterResourceSet), b.(*v1alpha4.ClusterResourceSet), scope) + if err := s.AddGeneratedConversionFunc((*ClusterResourceSet)(nil), (*v1beta1.ClusterResourceSet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClusterResourceSet_To_v1beta1_ClusterResourceSet(a.(*ClusterResourceSet), b.(*v1beta1.ClusterResourceSet), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ClusterResourceSet)(nil), (*ClusterResourceSet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterResourceSet_To_v1alpha3_ClusterResourceSet(a.(*v1alpha4.ClusterResourceSet), b.(*ClusterResourceSet), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterResourceSet)(nil), (*ClusterResourceSet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterResourceSet_To_v1alpha3_ClusterResourceSet(a.(*v1beta1.ClusterResourceSet), b.(*ClusterResourceSet), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ClusterResourceSetBinding)(nil), (*v1alpha4.ClusterResourceSetBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ClusterResourceSetBinding_To_v1alpha4_ClusterResourceSetBinding(a.(*ClusterResourceSetBinding), b.(*v1alpha4.ClusterResourceSetBinding), scope) + if err := s.AddGeneratedConversionFunc((*ClusterResourceSetBinding)(nil), (*v1beta1.ClusterResourceSetBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClusterResourceSetBinding_To_v1beta1_ClusterResourceSetBinding(a.(*ClusterResourceSetBinding), b.(*v1beta1.ClusterResourceSetBinding), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ClusterResourceSetBinding)(nil), (*ClusterResourceSetBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterResourceSetBinding_To_v1alpha3_ClusterResourceSetBinding(a.(*v1alpha4.ClusterResourceSetBinding), b.(*ClusterResourceSetBinding), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterResourceSetBinding)(nil), (*ClusterResourceSetBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterResourceSetBinding_To_v1alpha3_ClusterResourceSetBinding(a.(*v1beta1.ClusterResourceSetBinding), b.(*ClusterResourceSetBinding), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ClusterResourceSetBindingList)(nil), (*v1alpha4.ClusterResourceSetBindingList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ClusterResourceSetBindingList_To_v1alpha4_ClusterResourceSetBindingList(a.(*ClusterResourceSetBindingList), b.(*v1alpha4.ClusterResourceSetBindingList), scope) + if err := s.AddGeneratedConversionFunc((*ClusterResourceSetBindingList)(nil), (*v1beta1.ClusterResourceSetBindingList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClusterResourceSetBindingList_To_v1beta1_ClusterResourceSetBindingList(a.(*ClusterResourceSetBindingList), b.(*v1beta1.ClusterResourceSetBindingList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ClusterResourceSetBindingList)(nil), (*ClusterResourceSetBindingList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterResourceSetBindingList_To_v1alpha3_ClusterResourceSetBindingList(a.(*v1alpha4.ClusterResourceSetBindingList), b.(*ClusterResourceSetBindingList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterResourceSetBindingList)(nil), (*ClusterResourceSetBindingList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterResourceSetBindingList_To_v1alpha3_ClusterResourceSetBindingList(a.(*v1beta1.ClusterResourceSetBindingList), b.(*ClusterResourceSetBindingList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ClusterResourceSetBindingSpec)(nil), (*v1alpha4.ClusterResourceSetBindingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ClusterResourceSetBindingSpec_To_v1alpha4_ClusterResourceSetBindingSpec(a.(*ClusterResourceSetBindingSpec), b.(*v1alpha4.ClusterResourceSetBindingSpec), scope) + if err := s.AddGeneratedConversionFunc((*ClusterResourceSetBindingSpec)(nil), (*v1beta1.ClusterResourceSetBindingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClusterResourceSetBindingSpec_To_v1beta1_ClusterResourceSetBindingSpec(a.(*ClusterResourceSetBindingSpec), b.(*v1beta1.ClusterResourceSetBindingSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ClusterResourceSetBindingSpec)(nil), (*ClusterResourceSetBindingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterResourceSetBindingSpec_To_v1alpha3_ClusterResourceSetBindingSpec(a.(*v1alpha4.ClusterResourceSetBindingSpec), b.(*ClusterResourceSetBindingSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterResourceSetBindingSpec)(nil), (*ClusterResourceSetBindingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterResourceSetBindingSpec_To_v1alpha3_ClusterResourceSetBindingSpec(a.(*v1beta1.ClusterResourceSetBindingSpec), b.(*ClusterResourceSetBindingSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ClusterResourceSetList)(nil), (*v1alpha4.ClusterResourceSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ClusterResourceSetList_To_v1alpha4_ClusterResourceSetList(a.(*ClusterResourceSetList), b.(*v1alpha4.ClusterResourceSetList), scope) + if err := s.AddGeneratedConversionFunc((*ClusterResourceSetList)(nil), (*v1beta1.ClusterResourceSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClusterResourceSetList_To_v1beta1_ClusterResourceSetList(a.(*ClusterResourceSetList), b.(*v1beta1.ClusterResourceSetList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ClusterResourceSetList)(nil), (*ClusterResourceSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterResourceSetList_To_v1alpha3_ClusterResourceSetList(a.(*v1alpha4.ClusterResourceSetList), b.(*ClusterResourceSetList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterResourceSetList)(nil), (*ClusterResourceSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterResourceSetList_To_v1alpha3_ClusterResourceSetList(a.(*v1beta1.ClusterResourceSetList), b.(*ClusterResourceSetList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ClusterResourceSetSpec)(nil), (*v1alpha4.ClusterResourceSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ClusterResourceSetSpec_To_v1alpha4_ClusterResourceSetSpec(a.(*ClusterResourceSetSpec), b.(*v1alpha4.ClusterResourceSetSpec), scope) + if err := s.AddGeneratedConversionFunc((*ClusterResourceSetSpec)(nil), (*v1beta1.ClusterResourceSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClusterResourceSetSpec_To_v1beta1_ClusterResourceSetSpec(a.(*ClusterResourceSetSpec), b.(*v1beta1.ClusterResourceSetSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ClusterResourceSetSpec)(nil), (*ClusterResourceSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterResourceSetSpec_To_v1alpha3_ClusterResourceSetSpec(a.(*v1alpha4.ClusterResourceSetSpec), b.(*ClusterResourceSetSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterResourceSetSpec)(nil), (*ClusterResourceSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterResourceSetSpec_To_v1alpha3_ClusterResourceSetSpec(a.(*v1beta1.ClusterResourceSetSpec), b.(*ClusterResourceSetSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ClusterResourceSetStatus)(nil), (*v1alpha4.ClusterResourceSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ClusterResourceSetStatus_To_v1alpha4_ClusterResourceSetStatus(a.(*ClusterResourceSetStatus), b.(*v1alpha4.ClusterResourceSetStatus), scope) + if err := s.AddGeneratedConversionFunc((*ClusterResourceSetStatus)(nil), (*v1beta1.ClusterResourceSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClusterResourceSetStatus_To_v1beta1_ClusterResourceSetStatus(a.(*ClusterResourceSetStatus), b.(*v1beta1.ClusterResourceSetStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ClusterResourceSetStatus)(nil), (*ClusterResourceSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterResourceSetStatus_To_v1alpha3_ClusterResourceSetStatus(a.(*v1alpha4.ClusterResourceSetStatus), b.(*ClusterResourceSetStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterResourceSetStatus)(nil), (*ClusterResourceSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterResourceSetStatus_To_v1alpha3_ClusterResourceSetStatus(a.(*v1beta1.ClusterResourceSetStatus), b.(*ClusterResourceSetStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ResourceBinding)(nil), (*v1alpha4.ResourceBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ResourceBinding_To_v1alpha4_ResourceBinding(a.(*ResourceBinding), b.(*v1alpha4.ResourceBinding), scope) + if err := s.AddGeneratedConversionFunc((*ResourceBinding)(nil), (*v1beta1.ResourceBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourceBinding_To_v1beta1_ResourceBinding(a.(*ResourceBinding), b.(*v1beta1.ResourceBinding), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ResourceBinding)(nil), (*ResourceBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ResourceBinding_To_v1alpha3_ResourceBinding(a.(*v1alpha4.ResourceBinding), b.(*ResourceBinding), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ResourceBinding)(nil), (*ResourceBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ResourceBinding_To_v1alpha3_ResourceBinding(a.(*v1beta1.ResourceBinding), b.(*ResourceBinding), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ResourceRef)(nil), (*v1alpha4.ResourceRef)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ResourceRef_To_v1alpha4_ResourceRef(a.(*ResourceRef), b.(*v1alpha4.ResourceRef), scope) + if err := s.AddGeneratedConversionFunc((*ResourceRef)(nil), (*v1beta1.ResourceRef)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourceRef_To_v1beta1_ResourceRef(a.(*ResourceRef), b.(*v1beta1.ResourceRef), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ResourceRef)(nil), (*ResourceRef)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ResourceRef_To_v1alpha3_ResourceRef(a.(*v1alpha4.ResourceRef), b.(*ResourceRef), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ResourceRef)(nil), (*ResourceRef)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ResourceRef_To_v1alpha3_ResourceRef(a.(*v1beta1.ResourceRef), b.(*ResourceRef), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ResourceSetBinding)(nil), (*v1alpha4.ResourceSetBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ResourceSetBinding_To_v1alpha4_ResourceSetBinding(a.(*ResourceSetBinding), b.(*v1alpha4.ResourceSetBinding), scope) + if err := s.AddGeneratedConversionFunc((*ResourceSetBinding)(nil), (*v1beta1.ResourceSetBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ResourceSetBinding_To_v1beta1_ResourceSetBinding(a.(*ResourceSetBinding), b.(*v1beta1.ResourceSetBinding), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ResourceSetBinding)(nil), (*ResourceSetBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ResourceSetBinding_To_v1alpha3_ResourceSetBinding(a.(*v1alpha4.ResourceSetBinding), b.(*ResourceSetBinding), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ResourceSetBinding)(nil), (*ResourceSetBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ResourceSetBinding_To_v1alpha3_ResourceSetBinding(a.(*v1beta1.ResourceSetBinding), b.(*ResourceSetBinding), scope) }); err != nil { return err } return nil } -func autoConvert_v1alpha3_ClusterResourceSet_To_v1alpha4_ClusterResourceSet(in *ClusterResourceSet, out *v1alpha4.ClusterResourceSet, s conversion.Scope) error { +func autoConvert_v1alpha3_ClusterResourceSet_To_v1beta1_ClusterResourceSet(in *ClusterResourceSet, out *v1beta1.ClusterResourceSet, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_ClusterResourceSetSpec_To_v1alpha4_ClusterResourceSetSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_ClusterResourceSetSpec_To_v1beta1_ClusterResourceSetSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha3_ClusterResourceSetStatus_To_v1alpha4_ClusterResourceSetStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_ClusterResourceSetStatus_To_v1beta1_ClusterResourceSetStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha3_ClusterResourceSet_To_v1alpha4_ClusterResourceSet is an autogenerated conversion function. -func Convert_v1alpha3_ClusterResourceSet_To_v1alpha4_ClusterResourceSet(in *ClusterResourceSet, out *v1alpha4.ClusterResourceSet, s conversion.Scope) error { - return autoConvert_v1alpha3_ClusterResourceSet_To_v1alpha4_ClusterResourceSet(in, out, s) +// Convert_v1alpha3_ClusterResourceSet_To_v1beta1_ClusterResourceSet is an autogenerated conversion function. +func Convert_v1alpha3_ClusterResourceSet_To_v1beta1_ClusterResourceSet(in *ClusterResourceSet, out *v1beta1.ClusterResourceSet, s conversion.Scope) error { + return autoConvert_v1alpha3_ClusterResourceSet_To_v1beta1_ClusterResourceSet(in, out, s) } -func autoConvert_v1alpha4_ClusterResourceSet_To_v1alpha3_ClusterResourceSet(in *v1alpha4.ClusterResourceSet, out *ClusterResourceSet, s conversion.Scope) error { +func autoConvert_v1beta1_ClusterResourceSet_To_v1alpha3_ClusterResourceSet(in *v1beta1.ClusterResourceSet, out *ClusterResourceSet, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_ClusterResourceSetSpec_To_v1alpha3_ClusterResourceSetSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_ClusterResourceSetSpec_To_v1alpha3_ClusterResourceSetSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha4_ClusterResourceSetStatus_To_v1alpha3_ClusterResourceSetStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_ClusterResourceSetStatus_To_v1alpha3_ClusterResourceSetStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha4_ClusterResourceSet_To_v1alpha3_ClusterResourceSet is an autogenerated conversion function. -func Convert_v1alpha4_ClusterResourceSet_To_v1alpha3_ClusterResourceSet(in *v1alpha4.ClusterResourceSet, out *ClusterResourceSet, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterResourceSet_To_v1alpha3_ClusterResourceSet(in, out, s) +// Convert_v1beta1_ClusterResourceSet_To_v1alpha3_ClusterResourceSet is an autogenerated conversion function. +func Convert_v1beta1_ClusterResourceSet_To_v1alpha3_ClusterResourceSet(in *v1beta1.ClusterResourceSet, out *ClusterResourceSet, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterResourceSet_To_v1alpha3_ClusterResourceSet(in, out, s) } -func autoConvert_v1alpha3_ClusterResourceSetBinding_To_v1alpha4_ClusterResourceSetBinding(in *ClusterResourceSetBinding, out *v1alpha4.ClusterResourceSetBinding, s conversion.Scope) error { +func autoConvert_v1alpha3_ClusterResourceSetBinding_To_v1beta1_ClusterResourceSetBinding(in *ClusterResourceSetBinding, out *v1beta1.ClusterResourceSetBinding, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_ClusterResourceSetBindingSpec_To_v1alpha4_ClusterResourceSetBindingSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_ClusterResourceSetBindingSpec_To_v1beta1_ClusterResourceSetBindingSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha3_ClusterResourceSetBinding_To_v1alpha4_ClusterResourceSetBinding is an autogenerated conversion function. -func Convert_v1alpha3_ClusterResourceSetBinding_To_v1alpha4_ClusterResourceSetBinding(in *ClusterResourceSetBinding, out *v1alpha4.ClusterResourceSetBinding, s conversion.Scope) error { - return autoConvert_v1alpha3_ClusterResourceSetBinding_To_v1alpha4_ClusterResourceSetBinding(in, out, s) +// Convert_v1alpha3_ClusterResourceSetBinding_To_v1beta1_ClusterResourceSetBinding is an autogenerated conversion function. +func Convert_v1alpha3_ClusterResourceSetBinding_To_v1beta1_ClusterResourceSetBinding(in *ClusterResourceSetBinding, out *v1beta1.ClusterResourceSetBinding, s conversion.Scope) error { + return autoConvert_v1alpha3_ClusterResourceSetBinding_To_v1beta1_ClusterResourceSetBinding(in, out, s) } -func autoConvert_v1alpha4_ClusterResourceSetBinding_To_v1alpha3_ClusterResourceSetBinding(in *v1alpha4.ClusterResourceSetBinding, out *ClusterResourceSetBinding, s conversion.Scope) error { +func autoConvert_v1beta1_ClusterResourceSetBinding_To_v1alpha3_ClusterResourceSetBinding(in *v1beta1.ClusterResourceSetBinding, out *ClusterResourceSetBinding, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_ClusterResourceSetBindingSpec_To_v1alpha3_ClusterResourceSetBindingSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_ClusterResourceSetBindingSpec_To_v1alpha3_ClusterResourceSetBindingSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha4_ClusterResourceSetBinding_To_v1alpha3_ClusterResourceSetBinding is an autogenerated conversion function. -func Convert_v1alpha4_ClusterResourceSetBinding_To_v1alpha3_ClusterResourceSetBinding(in *v1alpha4.ClusterResourceSetBinding, out *ClusterResourceSetBinding, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterResourceSetBinding_To_v1alpha3_ClusterResourceSetBinding(in, out, s) +// Convert_v1beta1_ClusterResourceSetBinding_To_v1alpha3_ClusterResourceSetBinding is an autogenerated conversion function. +func Convert_v1beta1_ClusterResourceSetBinding_To_v1alpha3_ClusterResourceSetBinding(in *v1beta1.ClusterResourceSetBinding, out *ClusterResourceSetBinding, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterResourceSetBinding_To_v1alpha3_ClusterResourceSetBinding(in, out, s) } -func autoConvert_v1alpha3_ClusterResourceSetBindingList_To_v1alpha4_ClusterResourceSetBindingList(in *ClusterResourceSetBindingList, out *v1alpha4.ClusterResourceSetBindingList, s conversion.Scope) error { +func autoConvert_v1alpha3_ClusterResourceSetBindingList_To_v1beta1_ClusterResourceSetBindingList(in *ClusterResourceSetBindingList, out *v1beta1.ClusterResourceSetBindingList, s conversion.Scope) error { out.ListMeta = in.ListMeta - out.Items = *(*[]v1alpha4.ClusterResourceSetBinding)(unsafe.Pointer(&in.Items)) + out.Items = *(*[]v1beta1.ClusterResourceSetBinding)(unsafe.Pointer(&in.Items)) return nil } -// Convert_v1alpha3_ClusterResourceSetBindingList_To_v1alpha4_ClusterResourceSetBindingList is an autogenerated conversion function. -func Convert_v1alpha3_ClusterResourceSetBindingList_To_v1alpha4_ClusterResourceSetBindingList(in *ClusterResourceSetBindingList, out *v1alpha4.ClusterResourceSetBindingList, s conversion.Scope) error { - return autoConvert_v1alpha3_ClusterResourceSetBindingList_To_v1alpha4_ClusterResourceSetBindingList(in, out, s) +// Convert_v1alpha3_ClusterResourceSetBindingList_To_v1beta1_ClusterResourceSetBindingList is an autogenerated conversion function. +func Convert_v1alpha3_ClusterResourceSetBindingList_To_v1beta1_ClusterResourceSetBindingList(in *ClusterResourceSetBindingList, out *v1beta1.ClusterResourceSetBindingList, s conversion.Scope) error { + return autoConvert_v1alpha3_ClusterResourceSetBindingList_To_v1beta1_ClusterResourceSetBindingList(in, out, s) } -func autoConvert_v1alpha4_ClusterResourceSetBindingList_To_v1alpha3_ClusterResourceSetBindingList(in *v1alpha4.ClusterResourceSetBindingList, out *ClusterResourceSetBindingList, s conversion.Scope) error { +func autoConvert_v1beta1_ClusterResourceSetBindingList_To_v1alpha3_ClusterResourceSetBindingList(in *v1beta1.ClusterResourceSetBindingList, out *ClusterResourceSetBindingList, s conversion.Scope) error { out.ListMeta = in.ListMeta out.Items = *(*[]ClusterResourceSetBinding)(unsafe.Pointer(&in.Items)) return nil } -// Convert_v1alpha4_ClusterResourceSetBindingList_To_v1alpha3_ClusterResourceSetBindingList is an autogenerated conversion function. -func Convert_v1alpha4_ClusterResourceSetBindingList_To_v1alpha3_ClusterResourceSetBindingList(in *v1alpha4.ClusterResourceSetBindingList, out *ClusterResourceSetBindingList, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterResourceSetBindingList_To_v1alpha3_ClusterResourceSetBindingList(in, out, s) +// Convert_v1beta1_ClusterResourceSetBindingList_To_v1alpha3_ClusterResourceSetBindingList is an autogenerated conversion function. +func Convert_v1beta1_ClusterResourceSetBindingList_To_v1alpha3_ClusterResourceSetBindingList(in *v1beta1.ClusterResourceSetBindingList, out *ClusterResourceSetBindingList, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterResourceSetBindingList_To_v1alpha3_ClusterResourceSetBindingList(in, out, s) } -func autoConvert_v1alpha3_ClusterResourceSetBindingSpec_To_v1alpha4_ClusterResourceSetBindingSpec(in *ClusterResourceSetBindingSpec, out *v1alpha4.ClusterResourceSetBindingSpec, s conversion.Scope) error { - out.Bindings = *(*[]*v1alpha4.ResourceSetBinding)(unsafe.Pointer(&in.Bindings)) +func autoConvert_v1alpha3_ClusterResourceSetBindingSpec_To_v1beta1_ClusterResourceSetBindingSpec(in *ClusterResourceSetBindingSpec, out *v1beta1.ClusterResourceSetBindingSpec, s conversion.Scope) error { + out.Bindings = *(*[]*v1beta1.ResourceSetBinding)(unsafe.Pointer(&in.Bindings)) return nil } -// Convert_v1alpha3_ClusterResourceSetBindingSpec_To_v1alpha4_ClusterResourceSetBindingSpec is an autogenerated conversion function. -func Convert_v1alpha3_ClusterResourceSetBindingSpec_To_v1alpha4_ClusterResourceSetBindingSpec(in *ClusterResourceSetBindingSpec, out *v1alpha4.ClusterResourceSetBindingSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_ClusterResourceSetBindingSpec_To_v1alpha4_ClusterResourceSetBindingSpec(in, out, s) +// Convert_v1alpha3_ClusterResourceSetBindingSpec_To_v1beta1_ClusterResourceSetBindingSpec is an autogenerated conversion function. +func Convert_v1alpha3_ClusterResourceSetBindingSpec_To_v1beta1_ClusterResourceSetBindingSpec(in *ClusterResourceSetBindingSpec, out *v1beta1.ClusterResourceSetBindingSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_ClusterResourceSetBindingSpec_To_v1beta1_ClusterResourceSetBindingSpec(in, out, s) } -func autoConvert_v1alpha4_ClusterResourceSetBindingSpec_To_v1alpha3_ClusterResourceSetBindingSpec(in *v1alpha4.ClusterResourceSetBindingSpec, out *ClusterResourceSetBindingSpec, s conversion.Scope) error { +func autoConvert_v1beta1_ClusterResourceSetBindingSpec_To_v1alpha3_ClusterResourceSetBindingSpec(in *v1beta1.ClusterResourceSetBindingSpec, out *ClusterResourceSetBindingSpec, s conversion.Scope) error { out.Bindings = *(*[]*ResourceSetBinding)(unsafe.Pointer(&in.Bindings)) return nil } -// Convert_v1alpha4_ClusterResourceSetBindingSpec_To_v1alpha3_ClusterResourceSetBindingSpec is an autogenerated conversion function. -func Convert_v1alpha4_ClusterResourceSetBindingSpec_To_v1alpha3_ClusterResourceSetBindingSpec(in *v1alpha4.ClusterResourceSetBindingSpec, out *ClusterResourceSetBindingSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterResourceSetBindingSpec_To_v1alpha3_ClusterResourceSetBindingSpec(in, out, s) +// Convert_v1beta1_ClusterResourceSetBindingSpec_To_v1alpha3_ClusterResourceSetBindingSpec is an autogenerated conversion function. +func Convert_v1beta1_ClusterResourceSetBindingSpec_To_v1alpha3_ClusterResourceSetBindingSpec(in *v1beta1.ClusterResourceSetBindingSpec, out *ClusterResourceSetBindingSpec, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterResourceSetBindingSpec_To_v1alpha3_ClusterResourceSetBindingSpec(in, out, s) } -func autoConvert_v1alpha3_ClusterResourceSetList_To_v1alpha4_ClusterResourceSetList(in *ClusterResourceSetList, out *v1alpha4.ClusterResourceSetList, s conversion.Scope) error { +func autoConvert_v1alpha3_ClusterResourceSetList_To_v1beta1_ClusterResourceSetList(in *ClusterResourceSetList, out *v1beta1.ClusterResourceSetList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha4.ClusterResourceSet, len(*in)) + *out = make([]v1beta1.ClusterResourceSet, len(*in)) for i := range *in { - if err := Convert_v1alpha3_ClusterResourceSet_To_v1alpha4_ClusterResourceSet(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_ClusterResourceSet_To_v1beta1_ClusterResourceSet(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -257,18 +257,18 @@ func autoConvert_v1alpha3_ClusterResourceSetList_To_v1alpha4_ClusterResourceSetL return nil } -// Convert_v1alpha3_ClusterResourceSetList_To_v1alpha4_ClusterResourceSetList is an autogenerated conversion function. -func Convert_v1alpha3_ClusterResourceSetList_To_v1alpha4_ClusterResourceSetList(in *ClusterResourceSetList, out *v1alpha4.ClusterResourceSetList, s conversion.Scope) error { - return autoConvert_v1alpha3_ClusterResourceSetList_To_v1alpha4_ClusterResourceSetList(in, out, s) +// Convert_v1alpha3_ClusterResourceSetList_To_v1beta1_ClusterResourceSetList is an autogenerated conversion function. +func Convert_v1alpha3_ClusterResourceSetList_To_v1beta1_ClusterResourceSetList(in *ClusterResourceSetList, out *v1beta1.ClusterResourceSetList, s conversion.Scope) error { + return autoConvert_v1alpha3_ClusterResourceSetList_To_v1beta1_ClusterResourceSetList(in, out, s) } -func autoConvert_v1alpha4_ClusterResourceSetList_To_v1alpha3_ClusterResourceSetList(in *v1alpha4.ClusterResourceSetList, out *ClusterResourceSetList, s conversion.Scope) error { +func autoConvert_v1beta1_ClusterResourceSetList_To_v1alpha3_ClusterResourceSetList(in *v1beta1.ClusterResourceSetList, out *ClusterResourceSetList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]ClusterResourceSet, len(*in)) for i := range *in { - if err := Convert_v1alpha4_ClusterResourceSet_To_v1alpha3_ClusterResourceSet(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_ClusterResourceSet_To_v1alpha3_ClusterResourceSet(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -278,42 +278,42 @@ func autoConvert_v1alpha4_ClusterResourceSetList_To_v1alpha3_ClusterResourceSetL return nil } -// Convert_v1alpha4_ClusterResourceSetList_To_v1alpha3_ClusterResourceSetList is an autogenerated conversion function. -func Convert_v1alpha4_ClusterResourceSetList_To_v1alpha3_ClusterResourceSetList(in *v1alpha4.ClusterResourceSetList, out *ClusterResourceSetList, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterResourceSetList_To_v1alpha3_ClusterResourceSetList(in, out, s) +// Convert_v1beta1_ClusterResourceSetList_To_v1alpha3_ClusterResourceSetList is an autogenerated conversion function. +func Convert_v1beta1_ClusterResourceSetList_To_v1alpha3_ClusterResourceSetList(in *v1beta1.ClusterResourceSetList, out *ClusterResourceSetList, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterResourceSetList_To_v1alpha3_ClusterResourceSetList(in, out, s) } -func autoConvert_v1alpha3_ClusterResourceSetSpec_To_v1alpha4_ClusterResourceSetSpec(in *ClusterResourceSetSpec, out *v1alpha4.ClusterResourceSetSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_ClusterResourceSetSpec_To_v1beta1_ClusterResourceSetSpec(in *ClusterResourceSetSpec, out *v1beta1.ClusterResourceSetSpec, s conversion.Scope) error { out.ClusterSelector = in.ClusterSelector - out.Resources = *(*[]v1alpha4.ResourceRef)(unsafe.Pointer(&in.Resources)) + out.Resources = *(*[]v1beta1.ResourceRef)(unsafe.Pointer(&in.Resources)) out.Strategy = in.Strategy return nil } -// Convert_v1alpha3_ClusterResourceSetSpec_To_v1alpha4_ClusterResourceSetSpec is an autogenerated conversion function. -func Convert_v1alpha3_ClusterResourceSetSpec_To_v1alpha4_ClusterResourceSetSpec(in *ClusterResourceSetSpec, out *v1alpha4.ClusterResourceSetSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_ClusterResourceSetSpec_To_v1alpha4_ClusterResourceSetSpec(in, out, s) +// Convert_v1alpha3_ClusterResourceSetSpec_To_v1beta1_ClusterResourceSetSpec is an autogenerated conversion function. +func Convert_v1alpha3_ClusterResourceSetSpec_To_v1beta1_ClusterResourceSetSpec(in *ClusterResourceSetSpec, out *v1beta1.ClusterResourceSetSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_ClusterResourceSetSpec_To_v1beta1_ClusterResourceSetSpec(in, out, s) } -func autoConvert_v1alpha4_ClusterResourceSetSpec_To_v1alpha3_ClusterResourceSetSpec(in *v1alpha4.ClusterResourceSetSpec, out *ClusterResourceSetSpec, s conversion.Scope) error { +func autoConvert_v1beta1_ClusterResourceSetSpec_To_v1alpha3_ClusterResourceSetSpec(in *v1beta1.ClusterResourceSetSpec, out *ClusterResourceSetSpec, s conversion.Scope) error { out.ClusterSelector = in.ClusterSelector out.Resources = *(*[]ResourceRef)(unsafe.Pointer(&in.Resources)) out.Strategy = in.Strategy return nil } -// Convert_v1alpha4_ClusterResourceSetSpec_To_v1alpha3_ClusterResourceSetSpec is an autogenerated conversion function. -func Convert_v1alpha4_ClusterResourceSetSpec_To_v1alpha3_ClusterResourceSetSpec(in *v1alpha4.ClusterResourceSetSpec, out *ClusterResourceSetSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterResourceSetSpec_To_v1alpha3_ClusterResourceSetSpec(in, out, s) +// Convert_v1beta1_ClusterResourceSetSpec_To_v1alpha3_ClusterResourceSetSpec is an autogenerated conversion function. +func Convert_v1beta1_ClusterResourceSetSpec_To_v1alpha3_ClusterResourceSetSpec(in *v1beta1.ClusterResourceSetSpec, out *ClusterResourceSetSpec, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterResourceSetSpec_To_v1alpha3_ClusterResourceSetSpec(in, out, s) } -func autoConvert_v1alpha3_ClusterResourceSetStatus_To_v1alpha4_ClusterResourceSetStatus(in *ClusterResourceSetStatus, out *v1alpha4.ClusterResourceSetStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_ClusterResourceSetStatus_To_v1beta1_ClusterResourceSetStatus(in *ClusterResourceSetStatus, out *v1beta1.ClusterResourceSetStatus, s conversion.Scope) error { out.ObservedGeneration = in.ObservedGeneration if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make(apiv1alpha4.Conditions, len(*in)) + *out = make(apiv1beta1.Conditions, len(*in)) for i := range *in { - if err := apiv1alpha3.Convert_v1alpha3_Condition_To_v1alpha4_Condition(&(*in)[i], &(*out)[i], s); err != nil { + if err := apiv1alpha3.Convert_v1alpha3_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -323,18 +323,18 @@ func autoConvert_v1alpha3_ClusterResourceSetStatus_To_v1alpha4_ClusterResourceSe return nil } -// Convert_v1alpha3_ClusterResourceSetStatus_To_v1alpha4_ClusterResourceSetStatus is an autogenerated conversion function. -func Convert_v1alpha3_ClusterResourceSetStatus_To_v1alpha4_ClusterResourceSetStatus(in *ClusterResourceSetStatus, out *v1alpha4.ClusterResourceSetStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_ClusterResourceSetStatus_To_v1alpha4_ClusterResourceSetStatus(in, out, s) +// Convert_v1alpha3_ClusterResourceSetStatus_To_v1beta1_ClusterResourceSetStatus is an autogenerated conversion function. +func Convert_v1alpha3_ClusterResourceSetStatus_To_v1beta1_ClusterResourceSetStatus(in *ClusterResourceSetStatus, out *v1beta1.ClusterResourceSetStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_ClusterResourceSetStatus_To_v1beta1_ClusterResourceSetStatus(in, out, s) } -func autoConvert_v1alpha4_ClusterResourceSetStatus_To_v1alpha3_ClusterResourceSetStatus(in *v1alpha4.ClusterResourceSetStatus, out *ClusterResourceSetStatus, s conversion.Scope) error { +func autoConvert_v1beta1_ClusterResourceSetStatus_To_v1alpha3_ClusterResourceSetStatus(in *v1beta1.ClusterResourceSetStatus, out *ClusterResourceSetStatus, s conversion.Scope) error { out.ObservedGeneration = in.ObservedGeneration if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make(apiv1alpha3.Conditions, len(*in)) for i := range *in { - if err := apiv1alpha3.Convert_v1alpha4_Condition_To_v1alpha3_Condition(&(*in)[i], &(*out)[i], s); err != nil { + if err := apiv1alpha3.Convert_v1beta1_Condition_To_v1alpha3_Condition(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -344,13 +344,13 @@ func autoConvert_v1alpha4_ClusterResourceSetStatus_To_v1alpha3_ClusterResourceSe return nil } -// Convert_v1alpha4_ClusterResourceSetStatus_To_v1alpha3_ClusterResourceSetStatus is an autogenerated conversion function. -func Convert_v1alpha4_ClusterResourceSetStatus_To_v1alpha3_ClusterResourceSetStatus(in *v1alpha4.ClusterResourceSetStatus, out *ClusterResourceSetStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterResourceSetStatus_To_v1alpha3_ClusterResourceSetStatus(in, out, s) +// Convert_v1beta1_ClusterResourceSetStatus_To_v1alpha3_ClusterResourceSetStatus is an autogenerated conversion function. +func Convert_v1beta1_ClusterResourceSetStatus_To_v1alpha3_ClusterResourceSetStatus(in *v1beta1.ClusterResourceSetStatus, out *ClusterResourceSetStatus, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterResourceSetStatus_To_v1alpha3_ClusterResourceSetStatus(in, out, s) } -func autoConvert_v1alpha3_ResourceBinding_To_v1alpha4_ResourceBinding(in *ResourceBinding, out *v1alpha4.ResourceBinding, s conversion.Scope) error { - if err := Convert_v1alpha3_ResourceRef_To_v1alpha4_ResourceRef(&in.ResourceRef, &out.ResourceRef, s); err != nil { +func autoConvert_v1alpha3_ResourceBinding_To_v1beta1_ResourceBinding(in *ResourceBinding, out *v1beta1.ResourceBinding, s conversion.Scope) error { + if err := Convert_v1alpha3_ResourceRef_To_v1beta1_ResourceRef(&in.ResourceRef, &out.ResourceRef, s); err != nil { return err } out.Hash = in.Hash @@ -359,13 +359,13 @@ func autoConvert_v1alpha3_ResourceBinding_To_v1alpha4_ResourceBinding(in *Resour return nil } -// Convert_v1alpha3_ResourceBinding_To_v1alpha4_ResourceBinding is an autogenerated conversion function. -func Convert_v1alpha3_ResourceBinding_To_v1alpha4_ResourceBinding(in *ResourceBinding, out *v1alpha4.ResourceBinding, s conversion.Scope) error { - return autoConvert_v1alpha3_ResourceBinding_To_v1alpha4_ResourceBinding(in, out, s) +// Convert_v1alpha3_ResourceBinding_To_v1beta1_ResourceBinding is an autogenerated conversion function. +func Convert_v1alpha3_ResourceBinding_To_v1beta1_ResourceBinding(in *ResourceBinding, out *v1beta1.ResourceBinding, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourceBinding_To_v1beta1_ResourceBinding(in, out, s) } -func autoConvert_v1alpha4_ResourceBinding_To_v1alpha3_ResourceBinding(in *v1alpha4.ResourceBinding, out *ResourceBinding, s conversion.Scope) error { - if err := Convert_v1alpha4_ResourceRef_To_v1alpha3_ResourceRef(&in.ResourceRef, &out.ResourceRef, s); err != nil { +func autoConvert_v1beta1_ResourceBinding_To_v1alpha3_ResourceBinding(in *v1beta1.ResourceBinding, out *ResourceBinding, s conversion.Scope) error { + if err := Convert_v1beta1_ResourceRef_To_v1alpha3_ResourceRef(&in.ResourceRef, &out.ResourceRef, s); err != nil { return err } out.Hash = in.Hash @@ -374,51 +374,51 @@ func autoConvert_v1alpha4_ResourceBinding_To_v1alpha3_ResourceBinding(in *v1alph return nil } -// Convert_v1alpha4_ResourceBinding_To_v1alpha3_ResourceBinding is an autogenerated conversion function. -func Convert_v1alpha4_ResourceBinding_To_v1alpha3_ResourceBinding(in *v1alpha4.ResourceBinding, out *ResourceBinding, s conversion.Scope) error { - return autoConvert_v1alpha4_ResourceBinding_To_v1alpha3_ResourceBinding(in, out, s) +// Convert_v1beta1_ResourceBinding_To_v1alpha3_ResourceBinding is an autogenerated conversion function. +func Convert_v1beta1_ResourceBinding_To_v1alpha3_ResourceBinding(in *v1beta1.ResourceBinding, out *ResourceBinding, s conversion.Scope) error { + return autoConvert_v1beta1_ResourceBinding_To_v1alpha3_ResourceBinding(in, out, s) } -func autoConvert_v1alpha3_ResourceRef_To_v1alpha4_ResourceRef(in *ResourceRef, out *v1alpha4.ResourceRef, s conversion.Scope) error { +func autoConvert_v1alpha3_ResourceRef_To_v1beta1_ResourceRef(in *ResourceRef, out *v1beta1.ResourceRef, s conversion.Scope) error { out.Name = in.Name out.Kind = in.Kind return nil } -// Convert_v1alpha3_ResourceRef_To_v1alpha4_ResourceRef is an autogenerated conversion function. -func Convert_v1alpha3_ResourceRef_To_v1alpha4_ResourceRef(in *ResourceRef, out *v1alpha4.ResourceRef, s conversion.Scope) error { - return autoConvert_v1alpha3_ResourceRef_To_v1alpha4_ResourceRef(in, out, s) +// Convert_v1alpha3_ResourceRef_To_v1beta1_ResourceRef is an autogenerated conversion function. +func Convert_v1alpha3_ResourceRef_To_v1beta1_ResourceRef(in *ResourceRef, out *v1beta1.ResourceRef, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourceRef_To_v1beta1_ResourceRef(in, out, s) } -func autoConvert_v1alpha4_ResourceRef_To_v1alpha3_ResourceRef(in *v1alpha4.ResourceRef, out *ResourceRef, s conversion.Scope) error { +func autoConvert_v1beta1_ResourceRef_To_v1alpha3_ResourceRef(in *v1beta1.ResourceRef, out *ResourceRef, s conversion.Scope) error { out.Name = in.Name out.Kind = in.Kind return nil } -// Convert_v1alpha4_ResourceRef_To_v1alpha3_ResourceRef is an autogenerated conversion function. -func Convert_v1alpha4_ResourceRef_To_v1alpha3_ResourceRef(in *v1alpha4.ResourceRef, out *ResourceRef, s conversion.Scope) error { - return autoConvert_v1alpha4_ResourceRef_To_v1alpha3_ResourceRef(in, out, s) +// Convert_v1beta1_ResourceRef_To_v1alpha3_ResourceRef is an autogenerated conversion function. +func Convert_v1beta1_ResourceRef_To_v1alpha3_ResourceRef(in *v1beta1.ResourceRef, out *ResourceRef, s conversion.Scope) error { + return autoConvert_v1beta1_ResourceRef_To_v1alpha3_ResourceRef(in, out, s) } -func autoConvert_v1alpha3_ResourceSetBinding_To_v1alpha4_ResourceSetBinding(in *ResourceSetBinding, out *v1alpha4.ResourceSetBinding, s conversion.Scope) error { +func autoConvert_v1alpha3_ResourceSetBinding_To_v1beta1_ResourceSetBinding(in *ResourceSetBinding, out *v1beta1.ResourceSetBinding, s conversion.Scope) error { out.ClusterResourceSetName = in.ClusterResourceSetName - out.Resources = *(*[]v1alpha4.ResourceBinding)(unsafe.Pointer(&in.Resources)) + out.Resources = *(*[]v1beta1.ResourceBinding)(unsafe.Pointer(&in.Resources)) return nil } -// Convert_v1alpha3_ResourceSetBinding_To_v1alpha4_ResourceSetBinding is an autogenerated conversion function. -func Convert_v1alpha3_ResourceSetBinding_To_v1alpha4_ResourceSetBinding(in *ResourceSetBinding, out *v1alpha4.ResourceSetBinding, s conversion.Scope) error { - return autoConvert_v1alpha3_ResourceSetBinding_To_v1alpha4_ResourceSetBinding(in, out, s) +// Convert_v1alpha3_ResourceSetBinding_To_v1beta1_ResourceSetBinding is an autogenerated conversion function. +func Convert_v1alpha3_ResourceSetBinding_To_v1beta1_ResourceSetBinding(in *ResourceSetBinding, out *v1beta1.ResourceSetBinding, s conversion.Scope) error { + return autoConvert_v1alpha3_ResourceSetBinding_To_v1beta1_ResourceSetBinding(in, out, s) } -func autoConvert_v1alpha4_ResourceSetBinding_To_v1alpha3_ResourceSetBinding(in *v1alpha4.ResourceSetBinding, out *ResourceSetBinding, s conversion.Scope) error { +func autoConvert_v1beta1_ResourceSetBinding_To_v1alpha3_ResourceSetBinding(in *v1beta1.ResourceSetBinding, out *ResourceSetBinding, s conversion.Scope) error { out.ClusterResourceSetName = in.ClusterResourceSetName out.Resources = *(*[]ResourceBinding)(unsafe.Pointer(&in.Resources)) return nil } -// Convert_v1alpha4_ResourceSetBinding_To_v1alpha3_ResourceSetBinding is an autogenerated conversion function. -func Convert_v1alpha4_ResourceSetBinding_To_v1alpha3_ResourceSetBinding(in *v1alpha4.ResourceSetBinding, out *ResourceSetBinding, s conversion.Scope) error { - return autoConvert_v1alpha4_ResourceSetBinding_To_v1alpha3_ResourceSetBinding(in, out, s) +// Convert_v1beta1_ResourceSetBinding_To_v1alpha3_ResourceSetBinding is an autogenerated conversion function. +func Convert_v1beta1_ResourceSetBinding_To_v1alpha3_ResourceSetBinding(in *v1beta1.ResourceSetBinding, out *ResourceSetBinding, s conversion.Scope) error { + return autoConvert_v1beta1_ResourceSetBinding_To_v1alpha3_ResourceSetBinding(in, out, s) } diff --git a/exp/addons/api/v1alpha4/clusterresourceset_types.go b/exp/addons/api/v1alpha4/clusterresourceset_types.go index fa5e1600d50e..0f15fc248e6d 100644 --- a/exp/addons/api/v1alpha4/clusterresourceset_types.go +++ b/exp/addons/api/v1alpha4/clusterresourceset_types.go @@ -19,7 +19,7 @@ package v1alpha4 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) const ( @@ -113,7 +113,6 @@ func (m *ClusterResourceSet) SetConditions(conditions clusterv1.Conditions) { // +kubebuilder:object:root=true // +kubebuilder:resource:path=clusterresourcesets,scope=Namespaced,categories=cluster-api // +kubebuilder:subresource:status -// +kubebuilder:storageversion // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of ClusterResourceSet" // ClusterResourceSet is the Schema for the clusterresourcesets API. diff --git a/exp/addons/api/v1alpha4/clusterresourcesetbinding_types.go b/exp/addons/api/v1alpha4/clusterresourcesetbinding_types.go index b7fe09e57059..b772d220c009 100644 --- a/exp/addons/api/v1alpha4/clusterresourcesetbinding_types.go +++ b/exp/addons/api/v1alpha4/clusterresourcesetbinding_types.go @@ -103,7 +103,6 @@ func (c *ClusterResourceSetBinding) DeleteBinding(clusterResourceSet *ClusterRes // +kubebuilder:object:root=true // +kubebuilder:resource:path=clusterresourcesetbindings,scope=Namespaced,categories=cluster-api // +kubebuilder:subresource:status -// +kubebuilder:storageversion // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of ClusterResourceSetBinding" // ClusterResourceSetBinding lists all matching ClusterResourceSets with the cluster it belongs to. diff --git a/exp/addons/api/v1alpha4/condition_consts.go b/exp/addons/api/v1alpha4/condition_consts.go index 5bfcc3910bc7..f4961f2bb007 100644 --- a/exp/addons/api/v1alpha4/condition_consts.go +++ b/exp/addons/api/v1alpha4/condition_consts.go @@ -16,7 +16,7 @@ limitations under the License. package v1alpha4 -import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" +import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" // Conditions and condition Reasons for the ClusterResourceSet object diff --git a/exp/addons/api/v1alpha4/zz_generated.deepcopy.go b/exp/addons/api/v1alpha4/zz_generated.deepcopy.go index 223fc46221b1..d9d0452647d7 100644 --- a/exp/addons/api/v1alpha4/zz_generated.deepcopy.go +++ b/exp/addons/api/v1alpha4/zz_generated.deepcopy.go @@ -21,8 +21,8 @@ limitations under the License. package v1alpha4 import ( - "k8s.io/apimachinery/pkg/runtime" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + runtime "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/cluster-api/api/v1beta1" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -194,7 +194,7 @@ func (in *ClusterResourceSetStatus) DeepCopyInto(out *ClusterResourceSetStatus) *out = *in if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make(apiv1alpha4.Conditions, len(*in)) + *out = make(v1beta1.Conditions, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } diff --git a/exp/addons/api/v1beta1/clusterresourceset_types.go b/exp/addons/api/v1beta1/clusterresourceset_types.go new file mode 100644 index 000000000000..55465fb8b0f0 --- /dev/null +++ b/exp/addons/api/v1beta1/clusterresourceset_types.go @@ -0,0 +1,139 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" +) + +const ( + // ClusterResourceSetSecretType is the only accepted type of secret in resources. + ClusterResourceSetSecretType corev1.SecretType = "addons.cluster.x-k8s.io/resource-set" //nolint:gosec + + // ClusterResourceSetFinalizer is added to the ClusterResourceSet object for additional cleanup logic on deletion. + ClusterResourceSetFinalizer = "addons.cluster.x-k8s.io" +) + +// ANCHOR: ClusterResourceSetSpec + +// ClusterResourceSetSpec defines the desired state of ClusterResourceSet. +type ClusterResourceSetSpec struct { + // Label selector for Clusters. The Clusters that are + // selected by this will be the ones affected by this ClusterResourceSet. + // It must match the Cluster labels. This field is immutable. + // Label selector cannot be empty. + ClusterSelector metav1.LabelSelector `json:"clusterSelector"` + + // Resources is a list of Secrets/ConfigMaps where each contains 1 or more resources to be applied to remote clusters. + Resources []ResourceRef `json:"resources,omitempty"` + + // Strategy is the strategy to be used during applying resources. Defaults to ApplyOnce. This field is immutable. + // +kubebuilder:validation:Enum=ApplyOnce + // +optional + Strategy string `json:"strategy,omitempty"` +} + +// ANCHOR_END: ClusterResourceSetSpec + +// ClusterResourceSetResourceKind is a string representation of a ClusterResourceSet resource kind. +type ClusterResourceSetResourceKind string + +// Define the ClusterResourceSetResourceKind constants. +const ( + SecretClusterResourceSetResourceKind ClusterResourceSetResourceKind = "Secret" + ConfigMapClusterResourceSetResourceKind ClusterResourceSetResourceKind = "ConfigMap" +) + +// ResourceRef specifies a resource. +type ResourceRef struct { + // Name of the resource that is in the same namespace with ClusterResourceSet object. + // +kubebuilder:validation:MinLength=1 + Name string `json:"name"` + + // Kind of the resource. Supported kinds are: Secrets and ConfigMaps. + // +kubebuilder:validation:Enum=Secret;ConfigMap + Kind string `json:"kind"` +} + +// ClusterResourceSetStrategy is a string representation of a ClusterResourceSet Strategy. +type ClusterResourceSetStrategy string + +const ( + // ClusterResourceSetStrategyApplyOnce is the default strategy a ClusterResourceSet strategy is assigned by + // ClusterResourceSet controller after being created if not specified by user. + ClusterResourceSetStrategyApplyOnce ClusterResourceSetStrategy = "ApplyOnce" +) + +// SetTypedStrategy sets the Strategy field to the string representation of ClusterResourceSetStrategy. +func (c *ClusterResourceSetSpec) SetTypedStrategy(p ClusterResourceSetStrategy) { + c.Strategy = string(p) +} + +// ANCHOR: ClusterResourceSetStatus + +// ClusterResourceSetStatus defines the observed state of ClusterResourceSet. +type ClusterResourceSetStatus struct { + // ObservedGeneration reflects the generation of the most recently observed ClusterResourceSet. + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // Conditions defines current state of the ClusterResourceSet. + // +optional + Conditions clusterv1.Conditions `json:"conditions,omitempty"` +} + +// ANCHOR_END: ClusterResourceSetStatus + +// GetConditions returns the set of conditions for this object. +func (m *ClusterResourceSet) GetConditions() clusterv1.Conditions { + return m.Status.Conditions +} + +// SetConditions sets the conditions on this object. +func (m *ClusterResourceSet) SetConditions(conditions clusterv1.Conditions) { + m.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=clusterresourcesets,scope=Namespaced,categories=cluster-api +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of ClusterResourceSet" + +// ClusterResourceSet is the Schema for the clusterresourcesets API. +type ClusterResourceSet struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec ClusterResourceSetSpec `json:"spec,omitempty"` + Status ClusterResourceSetStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// ClusterResourceSetList contains a list of ClusterResourceSet. +type ClusterResourceSetList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ClusterResourceSet `json:"items"` +} + +func init() { + SchemeBuilder.Register(&ClusterResourceSet{}, &ClusterResourceSetList{}) +} diff --git a/exp/addons/api/v1alpha4/clusterresourceset_webhook.go b/exp/addons/api/v1beta1/clusterresourceset_webhook.go similarity index 84% rename from exp/addons/api/v1alpha4/clusterresourceset_webhook.go rename to exp/addons/api/v1beta1/clusterresourceset_webhook.go index d43f52f9c020..bffcceb8bec5 100644 --- a/exp/addons/api/v1alpha4/clusterresourceset_webhook.go +++ b/exp/addons/api/v1beta1/clusterresourceset_webhook.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "fmt" @@ -34,8 +34,8 @@ func (m *ClusterResourceSet) SetupWebhookWithManager(mgr ctrl.Manager) error { Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-addons-cluster-x-k8s-io-v1alpha4-clusterresourceset,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=addons.cluster.x-k8s.io,resources=clusterresourcesets,versions=v1alpha4,name=validation.clusterresourceset.addons.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-addons-cluster-x-k8s-io-v1alpha4-clusterresourceset,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=addons.cluster.x-k8s.io,resources=clusterresourcesets,versions=v1alpha4,name=default.clusterresourceset.addons.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-addons-cluster-x-k8s-io-v1beta1-clusterresourceset,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=addons.cluster.x-k8s.io,resources=clusterresourcesets,versions=v1beta1,name=validation.clusterresourceset.addons.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-addons-cluster-x-k8s-io-v1beta1-clusterresourceset,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=addons.cluster.x-k8s.io,resources=clusterresourcesets,versions=v1beta1,name=default.clusterresourceset.addons.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 var _ webhook.Defaulter = &ClusterResourceSet{} var _ webhook.Validator = &ClusterResourceSet{} diff --git a/exp/addons/api/v1alpha4/clusterresourceset_webhook_test.go b/exp/addons/api/v1beta1/clusterresourceset_webhook_test.go similarity index 98% rename from exp/addons/api/v1alpha4/clusterresourceset_webhook_test.go rename to exp/addons/api/v1beta1/clusterresourceset_webhook_test.go index 7e2b8a3915b2..cfb168844f93 100644 --- a/exp/addons/api/v1alpha4/clusterresourceset_webhook_test.go +++ b/exp/addons/api/v1beta1/clusterresourceset_webhook_test.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "testing" diff --git a/exp/addons/api/v1beta1/clusterresourcesetbinding_types.go b/exp/addons/api/v1beta1/clusterresourcesetbinding_types.go new file mode 100644 index 000000000000..f5832deca7e1 --- /dev/null +++ b/exp/addons/api/v1beta1/clusterresourcesetbinding_types.go @@ -0,0 +1,137 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "reflect" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ANCHOR: ResourceBinding + +// ResourceBinding shows the status of a resource that belongs to a ClusterResourceSet matched by the owner cluster of the ClusterResourceSetBinding object. +type ResourceBinding struct { + // ResourceRef specifies a resource. + ResourceRef `json:",inline"` + + // Hash is the hash of a resource's data. This can be used to decide if a resource is changed. + // For "ApplyOnce" ClusterResourceSet.spec.strategy, this is no-op as that strategy does not act on change. + Hash string `json:"hash,omitempty"` + + // LastAppliedTime identifies when this resource was last applied to the cluster. + // +optional + LastAppliedTime *metav1.Time `json:"lastAppliedTime,omitempty"` + + // Applied is to track if a resource is applied to the cluster or not. + Applied bool `json:"applied"` +} + +// ANCHOR_END: ResourceBinding + +// ResourceSetBinding keeps info on all of the resources in a ClusterResourceSet. +type ResourceSetBinding struct { + // ClusterResourceSetName is the name of the ClusterResourceSet that is applied to the owner cluster of the binding. + ClusterResourceSetName string `json:"clusterResourceSetName"` + + // Resources is a list of resources that the ClusterResourceSet has. + Resources []ResourceBinding `json:"resources,omitempty"` +} + +// IsApplied returns true if the resource is applied to the cluster by checking the cluster's binding. +func (r *ResourceSetBinding) IsApplied(resourceRef ResourceRef) bool { + for _, resource := range r.Resources { + if reflect.DeepEqual(resource.ResourceRef, resourceRef) { + if resource.Applied { + return true + } + } + } + return false +} + +// SetBinding sets resourceBinding for a resource in resourceSetbinding either by updating the existing one or +// creating a new one. +func (r *ResourceSetBinding) SetBinding(resourceBinding ResourceBinding) { + for i := range r.Resources { + if reflect.DeepEqual(r.Resources[i].ResourceRef, resourceBinding.ResourceRef) { + r.Resources[i] = resourceBinding + return + } + } + r.Resources = append(r.Resources, resourceBinding) +} + +// GetOrCreateBinding returns the ResourceSetBinding for a given ClusterResourceSet if exists, +// otherwise creates one and updates ClusterResourceSet with it. +func (c *ClusterResourceSetBinding) GetOrCreateBinding(clusterResourceSet *ClusterResourceSet) *ResourceSetBinding { + for _, binding := range c.Spec.Bindings { + if binding.ClusterResourceSetName == clusterResourceSet.Name { + return binding + } + } + binding := &ResourceSetBinding{ClusterResourceSetName: clusterResourceSet.Name, Resources: []ResourceBinding{}} + c.Spec.Bindings = append(c.Spec.Bindings, binding) + return binding +} + +// DeleteBinding removes the ClusterResourceSet from the ClusterResourceSetBinding Bindings list. +func (c *ClusterResourceSetBinding) DeleteBinding(clusterResourceSet *ClusterResourceSet) { + for i, binding := range c.Spec.Bindings { + if binding.ClusterResourceSetName == clusterResourceSet.Name { + copy(c.Spec.Bindings[i:], c.Spec.Bindings[i+1:]) + c.Spec.Bindings = c.Spec.Bindings[:len(c.Spec.Bindings)-1] + break + } + } +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=clusterresourcesetbindings,scope=Namespaced,categories=cluster-api +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of ClusterResourceSetBinding" + +// ClusterResourceSetBinding lists all matching ClusterResourceSets with the cluster it belongs to. +type ClusterResourceSetBinding struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + Spec ClusterResourceSetBindingSpec `json:"spec,omitempty"` +} + +// ANCHOR: ClusterResourceSetBindingSpec + +// ClusterResourceSetBindingSpec defines the desired state of ClusterResourceSetBinding. +type ClusterResourceSetBindingSpec struct { + // Bindings is a list of ClusterResourceSets and their resources. + Bindings []*ResourceSetBinding `json:"bindings,omitempty"` +} + +// ANCHOR_END: ClusterResourceSetBindingSpec + +// +kubebuilder:object:root=true + +// ClusterResourceSetBindingList contains a list of ClusterResourceSetBinding. +type ClusterResourceSetBindingList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []ClusterResourceSetBinding `json:"items"` +} + +func init() { + SchemeBuilder.Register(&ClusterResourceSetBinding{}, &ClusterResourceSetBindingList{}) +} diff --git a/exp/addons/api/v1beta1/clusterresourcesetbinding_types_test.go b/exp/addons/api/v1beta1/clusterresourcesetbinding_types_test.go new file mode 100644 index 000000000000..51be63303ffa --- /dev/null +++ b/exp/addons/api/v1beta1/clusterresourcesetbinding_types_test.go @@ -0,0 +1,159 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "reflect" + "testing" + "time" + + . "github.com/onsi/gomega" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +func TestIsResourceApplied(t *testing.T) { + resourceRefApplyFailed := ResourceRef{ + Name: "applyFailed", + Kind: "Secret", + } + resourceRefApplySucceeded := ResourceRef{ + Name: "ApplySucceeded", + Kind: "Secret", + } + resourceRefNotExist := ResourceRef{ + Name: "notExist", + Kind: "Secret", + } + CRSBinding := &ResourceSetBinding{ + ClusterResourceSetName: "test-clusterResourceSet", + Resources: []ResourceBinding{ + { + ResourceRef: resourceRefApplySucceeded, + Applied: true, + Hash: "xyz", + LastAppliedTime: &metav1.Time{Time: time.Now().UTC()}, + }, + { + ResourceRef: resourceRefApplyFailed, + Applied: false, + Hash: "", + LastAppliedTime: &metav1.Time{Time: time.Now().UTC()}, + }, + }, + } + + tests := []struct { + name string + resourceSetBinding *ResourceSetBinding + resourceRef ResourceRef + isApplied bool + }{ + { + name: "should return true if the resource is applied successfully", + resourceSetBinding: CRSBinding, + resourceRef: resourceRefApplySucceeded, + isApplied: true, + }, + { + name: "should return false if the resource apply failed", + resourceSetBinding: CRSBinding, + resourceRef: resourceRefApplyFailed, + isApplied: false, + }, + { + name: "should return false if the resource does not exist", + resourceSetBinding: CRSBinding, + resourceRef: resourceRefNotExist, + isApplied: false, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + gs := NewWithT(t) + gs.Expect(tt.resourceSetBinding.IsApplied(tt.resourceRef)).To(BeEquivalentTo(tt.isApplied)) + }) + } +} + +func TestSetResourceBinding(t *testing.T) { + resourceRefApplyFailed := ResourceRef{ + Name: "applyFailed", + Kind: "Secret", + } + + CRSBinding := &ResourceSetBinding{ + ClusterResourceSetName: "test-clusterResourceSet", + Resources: []ResourceBinding{ + { + ResourceRef: resourceRefApplyFailed, + Applied: false, + Hash: "", + LastAppliedTime: &metav1.Time{Time: time.Now().UTC()}, + }, + }, + } + updateFailedResourceBinding := ResourceBinding{ + ResourceRef: resourceRefApplyFailed, + Applied: true, + Hash: "xyz", + LastAppliedTime: &metav1.Time{Time: time.Now().UTC()}, + } + + newResourceBinding := ResourceBinding{ + ResourceRef: ResourceRef{ + Name: "newBinding", + Kind: "Secret", + }, + Applied: false, + Hash: "xyz", + LastAppliedTime: &metav1.Time{Time: time.Now().UTC()}, + } + + tests := []struct { + name string + resourceSetBinding *ResourceSetBinding + resourceBinding ResourceBinding + }{ + { + name: "should update resourceSetBinding with new resource binding if not exist", + resourceSetBinding: CRSBinding, + resourceBinding: newResourceBinding, + }, + { + name: "should update Applied if resource failed before", + resourceSetBinding: CRSBinding, + resourceBinding: updateFailedResourceBinding, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + gs := NewWithT(t) + tt.resourceSetBinding.SetBinding(tt.resourceBinding) + exist := false + for _, b := range tt.resourceSetBinding.Resources { + if reflect.DeepEqual(b.ResourceRef, tt.resourceBinding.ResourceRef) { + gs.Expect(tt.resourceBinding.Applied).To(BeEquivalentTo(b.Applied)) + exist = true + } + } + gs.Expect(exist).To(BeTrue()) + }) + } +} diff --git a/exp/addons/api/v1beta1/condition_consts.go b/exp/addons/api/v1beta1/condition_consts.go new file mode 100644 index 000000000000..c354fe702160 --- /dev/null +++ b/exp/addons/api/v1beta1/condition_consts.go @@ -0,0 +1,42 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + +// Conditions and condition Reasons for the ClusterResourceSet object + +const ( + // ResourcesAppliedCondition documents that all resources in the ClusterResourceSet object are applied to + // all matching clusters. This indicates all resources exist, and no errors during applying them to all clusters. + ResourcesAppliedCondition clusterv1.ConditionType = "ResourcesApplied" + + // RemoteClusterClientFailedReason (Severity=Error) documents failure during getting the remote cluster client. + RemoteClusterClientFailedReason = "RemoteClusterClientFailed" + + // ClusterMatchFailedReason (Severity=Warning) documents failure getting clusters that match the clusterSelector. + ClusterMatchFailedReason = "ClusterMatchFailed" + + // ApplyFailedReason (Severity=Warning) documents applying at least one of the resources to one of the matching clusters is failed. + ApplyFailedReason = "ApplyFailed" + + // RetrievingResourceFailedReason (Severity=Warning) documents at least one of the resources are not successfully retrieved. + RetrievingResourceFailedReason = "RetrievingResourceFailed" + + // WrongSecretTypeReason (Severity=Warning) documents at least one of the Secret's type in the resource list is not supported. + WrongSecretTypeReason = "WrongSecretType" +) diff --git a/exp/addons/api/v1beta1/doc.go b/exp/addons/api/v1beta1/doc.go new file mode 100644 index 000000000000..d55ab5609a7b --- /dev/null +++ b/exp/addons/api/v1beta1/doc.go @@ -0,0 +1,17 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 diff --git a/exp/addons/api/v1beta1/groupversion_info.go b/exp/addons/api/v1beta1/groupversion_info.go new file mode 100644 index 000000000000..b6ef37586669 --- /dev/null +++ b/exp/addons/api/v1beta1/groupversion_info.go @@ -0,0 +1,36 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// package v1beta1 contains API Schema definitions for the addons v1beta1 API group +// +kubebuilder:object:generate=true +// +groupName=addons.cluster.x-k8s.io +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects. + GroupVersion = schema.GroupVersion{Group: "addons.cluster.x-k8s.io", Version: "v1beta1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/exp/addons/api/v1beta1/zz_generated.deepcopy.go b/exp/addons/api/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 000000000000..419867bf03fb --- /dev/null +++ b/exp/addons/api/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,269 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime" + apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterResourceSet) DeepCopyInto(out *ClusterResourceSet) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceSet. +func (in *ClusterResourceSet) DeepCopy() *ClusterResourceSet { + if in == nil { + return nil + } + out := new(ClusterResourceSet) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterResourceSet) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterResourceSetBinding) DeepCopyInto(out *ClusterResourceSetBinding) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceSetBinding. +func (in *ClusterResourceSetBinding) DeepCopy() *ClusterResourceSetBinding { + if in == nil { + return nil + } + out := new(ClusterResourceSetBinding) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterResourceSetBinding) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterResourceSetBindingList) DeepCopyInto(out *ClusterResourceSetBindingList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterResourceSetBinding, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceSetBindingList. +func (in *ClusterResourceSetBindingList) DeepCopy() *ClusterResourceSetBindingList { + if in == nil { + return nil + } + out := new(ClusterResourceSetBindingList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterResourceSetBindingList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterResourceSetBindingSpec) DeepCopyInto(out *ClusterResourceSetBindingSpec) { + *out = *in + if in.Bindings != nil { + in, out := &in.Bindings, &out.Bindings + *out = make([]*ResourceSetBinding, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(ResourceSetBinding) + (*in).DeepCopyInto(*out) + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceSetBindingSpec. +func (in *ClusterResourceSetBindingSpec) DeepCopy() *ClusterResourceSetBindingSpec { + if in == nil { + return nil + } + out := new(ClusterResourceSetBindingSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterResourceSetList) DeepCopyInto(out *ClusterResourceSetList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterResourceSet, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceSetList. +func (in *ClusterResourceSetList) DeepCopy() *ClusterResourceSetList { + if in == nil { + return nil + } + out := new(ClusterResourceSetList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *ClusterResourceSetList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterResourceSetSpec) DeepCopyInto(out *ClusterResourceSetSpec) { + *out = *in + in.ClusterSelector.DeepCopyInto(&out.ClusterSelector) + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]ResourceRef, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceSetSpec. +func (in *ClusterResourceSetSpec) DeepCopy() *ClusterResourceSetSpec { + if in == nil { + return nil + } + out := new(ClusterResourceSetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterResourceSetStatus) DeepCopyInto(out *ClusterResourceSetStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(apiv1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceSetStatus. +func (in *ClusterResourceSetStatus) DeepCopy() *ClusterResourceSetStatus { + if in == nil { + return nil + } + out := new(ClusterResourceSetStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceBinding) DeepCopyInto(out *ResourceBinding) { + *out = *in + out.ResourceRef = in.ResourceRef + if in.LastAppliedTime != nil { + in, out := &in.LastAppliedTime, &out.LastAppliedTime + *out = (*in).DeepCopy() + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceBinding. +func (in *ResourceBinding) DeepCopy() *ResourceBinding { + if in == nil { + return nil + } + out := new(ResourceBinding) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceRef) DeepCopyInto(out *ResourceRef) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRef. +func (in *ResourceRef) DeepCopy() *ResourceRef { + if in == nil { + return nil + } + out := new(ResourceRef) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ResourceSetBinding) DeepCopyInto(out *ResourceSetBinding) { + *out = *in + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]ResourceBinding, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSetBinding. +func (in *ResourceSetBinding) DeepCopy() *ResourceSetBinding { + if in == nil { + return nil + } + out := new(ResourceSetBinding) + in.DeepCopyInto(out) + return out +} diff --git a/exp/addons/controllers/clusterresourceset_controller.go b/exp/addons/controllers/clusterresourceset_controller.go index 7b395c8e69f1..54c70ff59660 100644 --- a/exp/addons/controllers/clusterresourceset_controller.go +++ b/exp/addons/controllers/clusterresourceset_controller.go @@ -31,9 +31,9 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" kerrors "k8s.io/apimachinery/pkg/util/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" + addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" resourcepredicates "sigs.k8s.io/cluster-api/exp/addons/controllers/predicates" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/exp/addons/controllers/clusterresourceset_controller_test.go b/exp/addons/controllers/clusterresourceset_controller_test.go index d1beea996d14..3d77b4c66bf1 100644 --- a/exp/addons/controllers/clusterresourceset_controller_test.go +++ b/exp/addons/controllers/clusterresourceset_controller_test.go @@ -27,8 +27,8 @@ import ( corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/exp/addons/controllers/clusterresourceset_helpers.go b/exp/addons/controllers/clusterresourceset_helpers.go index 681768ec6e8e..fe66bf2cb92d 100644 --- a/exp/addons/controllers/clusterresourceset_helpers.go +++ b/exp/addons/controllers/clusterresourceset_helpers.go @@ -32,8 +32,8 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" kerrors "k8s.io/apimachinery/pkg/util/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" "sigs.k8s.io/cluster-api/util" utilresource "sigs.k8s.io/cluster-api/util/resource" utilyaml "sigs.k8s.io/cluster-api/util/yaml" diff --git a/exp/addons/controllers/clusterresourceset_helpers_test.go b/exp/addons/controllers/clusterresourceset_helpers_test.go index 4c485d28e919..8e78b5f9a987 100644 --- a/exp/addons/controllers/clusterresourceset_helpers_test.go +++ b/exp/addons/controllers/clusterresourceset_helpers_test.go @@ -27,8 +27,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) diff --git a/exp/addons/controllers/clusterresourcesetbinding_controller.go b/exp/addons/controllers/clusterresourcesetbinding_controller.go index 85a3cffe93db..29a00918d66c 100644 --- a/exp/addons/controllers/clusterresourcesetbinding_controller.go +++ b/exp/addons/controllers/clusterresourcesetbinding_controller.go @@ -21,8 +21,8 @@ import ( "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/predicates" ctrl "sigs.k8s.io/controller-runtime" diff --git a/exp/addons/controllers/suite_test.go b/exp/addons/controllers/suite_test.go index 6d658385e5db..ecf63c159413 100644 --- a/exp/addons/controllers/suite_test.go +++ b/exp/addons/controllers/suite_test.go @@ -23,7 +23,7 @@ import ( "testing" corev1 "k8s.io/api/core/v1" - "sigs.k8s.io/cluster-api/api/v1alpha4/index" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" "sigs.k8s.io/cluster-api/internal/envtest" diff --git a/exp/api/v1alpha3/conversion.go b/exp/api/v1alpha3/conversion.go index c42053280cb2..74f0967c5ffb 100644 --- a/exp/api/v1alpha3/conversion.go +++ b/exp/api/v1alpha3/conversion.go @@ -18,24 +18,24 @@ package v1alpha3 import ( "k8s.io/apimachinery/pkg/conversion" - "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" ) -// Convert_v1alpha3_MachinePoolSpec_To_v1alpha4_MachinePoolSpec is an autogenerated conversion function. -func Convert_v1alpha3_MachinePoolSpec_To_v1alpha4_MachinePoolSpec(in *MachinePoolSpec, out *v1alpha4.MachinePoolSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_MachinePoolSpec_To_v1alpha4_MachinePoolSpec(in, out, s) +// Convert_v1alpha3_MachinePoolSpec_To_v1beta1_MachinePoolSpec is an autogenerated conversion function. +func Convert_v1alpha3_MachinePoolSpec_To_v1beta1_MachinePoolSpec(in *MachinePoolSpec, out *v1beta1.MachinePoolSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_MachinePoolSpec_To_v1beta1_MachinePoolSpec(in, out, s) } -func Convert_v1alpha3_MachinePool_To_v1alpha4_MachinePool(in *MachinePool, out *v1alpha4.MachinePool, s conversion.Scope) error { - if err := autoConvert_v1alpha3_MachinePool_To_v1alpha4_MachinePool(in, out, s); err != nil { +func Convert_v1alpha3_MachinePool_To_v1beta1_MachinePool(in *MachinePool, out *v1beta1.MachinePool, s conversion.Scope) error { + if err := autoConvert_v1alpha3_MachinePool_To_v1beta1_MachinePool(in, out, s); err != nil { return err } // Replace v1alpha3 finalizer to allow old MachinePools to get deleted. if !controllerutil.ContainsFinalizer(out, MachinePoolFinalizer) { controllerutil.RemoveFinalizer(out, MachinePoolFinalizer) - controllerutil.AddFinalizer(out, v1alpha4.MachinePoolFinalizer) + controllerutil.AddFinalizer(out, v1beta1.MachinePoolFinalizer) } return nil diff --git a/exp/api/v1alpha3/doc.go b/exp/api/v1alpha3/doc.go index 781a057261ba..46a17737a5b7 100644 --- a/exp/api/v1alpha3/doc.go +++ b/exp/api/v1alpha3/doc.go @@ -15,5 +15,5 @@ limitations under the License. */ // Package v1alpha3 contains the v1alpha3 API implementation. -// +k8s:conversion-gen=sigs.k8s.io/cluster-api/exp/api/v1alpha4 +// +k8s:conversion-gen=sigs.k8s.io/cluster-api/exp/api/v1beta1 package v1alpha3 diff --git a/exp/api/v1alpha3/zz_generated.conversion.go b/exp/api/v1alpha3/zz_generated.conversion.go index c1de67b6c69b..258e74660f90 100644 --- a/exp/api/v1alpha3/zz_generated.conversion.go +++ b/exp/api/v1alpha3/zz_generated.conversion.go @@ -27,9 +27,9 @@ import ( conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" apiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" errors "sigs.k8s.io/cluster-api/errors" - v1alpha4 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + v1beta1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" ) func init() { @@ -39,83 +39,83 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachinePool)(nil), (*MachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachinePool_To_v1alpha3_MachinePool(a.(*v1alpha4.MachinePool), b.(*MachinePool), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachinePool)(nil), (*MachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachinePool_To_v1alpha3_MachinePool(a.(*v1beta1.MachinePool), b.(*MachinePool), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachinePoolList)(nil), (*v1alpha4.MachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachinePoolList_To_v1alpha4_MachinePoolList(a.(*MachinePoolList), b.(*v1alpha4.MachinePoolList), scope) + if err := s.AddGeneratedConversionFunc((*MachinePoolList)(nil), (*v1beta1.MachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachinePoolList_To_v1beta1_MachinePoolList(a.(*MachinePoolList), b.(*v1beta1.MachinePoolList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachinePoolList)(nil), (*MachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachinePoolList_To_v1alpha3_MachinePoolList(a.(*v1alpha4.MachinePoolList), b.(*MachinePoolList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachinePoolList)(nil), (*MachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachinePoolList_To_v1alpha3_MachinePoolList(a.(*v1beta1.MachinePoolList), b.(*MachinePoolList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachinePoolSpec)(nil), (*MachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachinePoolSpec_To_v1alpha3_MachinePoolSpec(a.(*v1alpha4.MachinePoolSpec), b.(*MachinePoolSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachinePoolSpec)(nil), (*MachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachinePoolSpec_To_v1alpha3_MachinePoolSpec(a.(*v1beta1.MachinePoolSpec), b.(*MachinePoolSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MachinePoolStatus)(nil), (*v1alpha4.MachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachinePoolStatus_To_v1alpha4_MachinePoolStatus(a.(*MachinePoolStatus), b.(*v1alpha4.MachinePoolStatus), scope) + if err := s.AddGeneratedConversionFunc((*MachinePoolStatus)(nil), (*v1beta1.MachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachinePoolStatus_To_v1beta1_MachinePoolStatus(a.(*MachinePoolStatus), b.(*v1beta1.MachinePoolStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MachinePoolStatus)(nil), (*MachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachinePoolStatus_To_v1alpha3_MachinePoolStatus(a.(*v1alpha4.MachinePoolStatus), b.(*MachinePoolStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MachinePoolStatus)(nil), (*MachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachinePoolStatus_To_v1alpha3_MachinePoolStatus(a.(*v1beta1.MachinePoolStatus), b.(*MachinePoolStatus), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*MachinePoolSpec)(nil), (*v1alpha4.MachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachinePoolSpec_To_v1alpha4_MachinePoolSpec(a.(*MachinePoolSpec), b.(*v1alpha4.MachinePoolSpec), scope) + if err := s.AddConversionFunc((*MachinePoolSpec)(nil), (*v1beta1.MachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachinePoolSpec_To_v1beta1_MachinePoolSpec(a.(*MachinePoolSpec), b.(*v1beta1.MachinePoolSpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*MachinePool)(nil), (*v1alpha4.MachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MachinePool_To_v1alpha4_MachinePool(a.(*MachinePool), b.(*v1alpha4.MachinePool), scope) + if err := s.AddConversionFunc((*MachinePool)(nil), (*v1beta1.MachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MachinePool_To_v1beta1_MachinePool(a.(*MachinePool), b.(*v1beta1.MachinePool), scope) }); err != nil { return err } return nil } -func autoConvert_v1alpha3_MachinePool_To_v1alpha4_MachinePool(in *MachinePool, out *v1alpha4.MachinePool, s conversion.Scope) error { +func autoConvert_v1alpha3_MachinePool_To_v1beta1_MachinePool(in *MachinePool, out *v1beta1.MachinePool, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_MachinePoolSpec_To_v1alpha4_MachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_MachinePoolSpec_To_v1beta1_MachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha3_MachinePoolStatus_To_v1alpha4_MachinePoolStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_MachinePoolStatus_To_v1beta1_MachinePoolStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -func autoConvert_v1alpha4_MachinePool_To_v1alpha3_MachinePool(in *v1alpha4.MachinePool, out *MachinePool, s conversion.Scope) error { +func autoConvert_v1beta1_MachinePool_To_v1alpha3_MachinePool(in *v1beta1.MachinePool, out *MachinePool, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_MachinePoolSpec_To_v1alpha3_MachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_MachinePoolSpec_To_v1alpha3_MachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha4_MachinePoolStatus_To_v1alpha3_MachinePoolStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_MachinePoolStatus_To_v1alpha3_MachinePoolStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha4_MachinePool_To_v1alpha3_MachinePool is an autogenerated conversion function. -func Convert_v1alpha4_MachinePool_To_v1alpha3_MachinePool(in *v1alpha4.MachinePool, out *MachinePool, s conversion.Scope) error { - return autoConvert_v1alpha4_MachinePool_To_v1alpha3_MachinePool(in, out, s) +// Convert_v1beta1_MachinePool_To_v1alpha3_MachinePool is an autogenerated conversion function. +func Convert_v1beta1_MachinePool_To_v1alpha3_MachinePool(in *v1beta1.MachinePool, out *MachinePool, s conversion.Scope) error { + return autoConvert_v1beta1_MachinePool_To_v1alpha3_MachinePool(in, out, s) } -func autoConvert_v1alpha3_MachinePoolList_To_v1alpha4_MachinePoolList(in *MachinePoolList, out *v1alpha4.MachinePoolList, s conversion.Scope) error { +func autoConvert_v1alpha3_MachinePoolList_To_v1beta1_MachinePoolList(in *MachinePoolList, out *v1beta1.MachinePoolList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha4.MachinePool, len(*in)) + *out = make([]v1beta1.MachinePool, len(*in)) for i := range *in { - if err := Convert_v1alpha3_MachinePool_To_v1alpha4_MachinePool(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_MachinePool_To_v1beta1_MachinePool(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -125,18 +125,18 @@ func autoConvert_v1alpha3_MachinePoolList_To_v1alpha4_MachinePoolList(in *Machin return nil } -// Convert_v1alpha3_MachinePoolList_To_v1alpha4_MachinePoolList is an autogenerated conversion function. -func Convert_v1alpha3_MachinePoolList_To_v1alpha4_MachinePoolList(in *MachinePoolList, out *v1alpha4.MachinePoolList, s conversion.Scope) error { - return autoConvert_v1alpha3_MachinePoolList_To_v1alpha4_MachinePoolList(in, out, s) +// Convert_v1alpha3_MachinePoolList_To_v1beta1_MachinePoolList is an autogenerated conversion function. +func Convert_v1alpha3_MachinePoolList_To_v1beta1_MachinePoolList(in *MachinePoolList, out *v1beta1.MachinePoolList, s conversion.Scope) error { + return autoConvert_v1alpha3_MachinePoolList_To_v1beta1_MachinePoolList(in, out, s) } -func autoConvert_v1alpha4_MachinePoolList_To_v1alpha3_MachinePoolList(in *v1alpha4.MachinePoolList, out *MachinePoolList, s conversion.Scope) error { +func autoConvert_v1beta1_MachinePoolList_To_v1alpha3_MachinePoolList(in *v1beta1.MachinePoolList, out *MachinePoolList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]MachinePool, len(*in)) for i := range *in { - if err := Convert_v1alpha4_MachinePool_To_v1alpha3_MachinePool(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_MachinePool_To_v1alpha3_MachinePool(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -146,15 +146,15 @@ func autoConvert_v1alpha4_MachinePoolList_To_v1alpha3_MachinePoolList(in *v1alph return nil } -// Convert_v1alpha4_MachinePoolList_To_v1alpha3_MachinePoolList is an autogenerated conversion function. -func Convert_v1alpha4_MachinePoolList_To_v1alpha3_MachinePoolList(in *v1alpha4.MachinePoolList, out *MachinePoolList, s conversion.Scope) error { - return autoConvert_v1alpha4_MachinePoolList_To_v1alpha3_MachinePoolList(in, out, s) +// Convert_v1beta1_MachinePoolList_To_v1alpha3_MachinePoolList is an autogenerated conversion function. +func Convert_v1beta1_MachinePoolList_To_v1alpha3_MachinePoolList(in *v1beta1.MachinePoolList, out *MachinePoolList, s conversion.Scope) error { + return autoConvert_v1beta1_MachinePoolList_To_v1alpha3_MachinePoolList(in, out, s) } -func autoConvert_v1alpha3_MachinePoolSpec_To_v1alpha4_MachinePoolSpec(in *MachinePoolSpec, out *v1alpha4.MachinePoolSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_MachinePoolSpec_To_v1beta1_MachinePoolSpec(in *MachinePoolSpec, out *v1beta1.MachinePoolSpec, s conversion.Scope) error { out.ClusterName = in.ClusterName out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - if err := apiv1alpha3.Convert_v1alpha3_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { + if err := apiv1alpha3.Convert_v1alpha3_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } // WARNING: in.Strategy requires manual conversion: does not exist in peer-type @@ -164,10 +164,10 @@ func autoConvert_v1alpha3_MachinePoolSpec_To_v1alpha4_MachinePoolSpec(in *Machin return nil } -func autoConvert_v1alpha4_MachinePoolSpec_To_v1alpha3_MachinePoolSpec(in *v1alpha4.MachinePoolSpec, out *MachinePoolSpec, s conversion.Scope) error { +func autoConvert_v1beta1_MachinePoolSpec_To_v1alpha3_MachinePoolSpec(in *v1beta1.MachinePoolSpec, out *MachinePoolSpec, s conversion.Scope) error { out.ClusterName = in.ClusterName out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - if err := apiv1alpha3.Convert_v1alpha4_MachineTemplateSpec_To_v1alpha3_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { + if err := apiv1alpha3.Convert_v1beta1_MachineTemplateSpec_To_v1alpha3_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { return err } out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) @@ -176,12 +176,12 @@ func autoConvert_v1alpha4_MachinePoolSpec_To_v1alpha3_MachinePoolSpec(in *v1alph return nil } -// Convert_v1alpha4_MachinePoolSpec_To_v1alpha3_MachinePoolSpec is an autogenerated conversion function. -func Convert_v1alpha4_MachinePoolSpec_To_v1alpha3_MachinePoolSpec(in *v1alpha4.MachinePoolSpec, out *MachinePoolSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_MachinePoolSpec_To_v1alpha3_MachinePoolSpec(in, out, s) +// Convert_v1beta1_MachinePoolSpec_To_v1alpha3_MachinePoolSpec is an autogenerated conversion function. +func Convert_v1beta1_MachinePoolSpec_To_v1alpha3_MachinePoolSpec(in *v1beta1.MachinePoolSpec, out *MachinePoolSpec, s conversion.Scope) error { + return autoConvert_v1beta1_MachinePoolSpec_To_v1alpha3_MachinePoolSpec(in, out, s) } -func autoConvert_v1alpha3_MachinePoolStatus_To_v1alpha4_MachinePoolStatus(in *MachinePoolStatus, out *v1alpha4.MachinePoolStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_MachinePoolStatus_To_v1beta1_MachinePoolStatus(in *MachinePoolStatus, out *v1beta1.MachinePoolStatus, s conversion.Scope) error { out.NodeRefs = *(*[]v1.ObjectReference)(unsafe.Pointer(&in.NodeRefs)) out.Replicas = in.Replicas out.ReadyReplicas = in.ReadyReplicas @@ -195,9 +195,9 @@ func autoConvert_v1alpha3_MachinePoolStatus_To_v1alpha4_MachinePoolStatus(in *Ma out.ObservedGeneration = in.ObservedGeneration if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make(apiv1alpha4.Conditions, len(*in)) + *out = make(apiv1beta1.Conditions, len(*in)) for i := range *in { - if err := apiv1alpha3.Convert_v1alpha3_Condition_To_v1alpha4_Condition(&(*in)[i], &(*out)[i], s); err != nil { + if err := apiv1alpha3.Convert_v1alpha3_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -207,12 +207,12 @@ func autoConvert_v1alpha3_MachinePoolStatus_To_v1alpha4_MachinePoolStatus(in *Ma return nil } -// Convert_v1alpha3_MachinePoolStatus_To_v1alpha4_MachinePoolStatus is an autogenerated conversion function. -func Convert_v1alpha3_MachinePoolStatus_To_v1alpha4_MachinePoolStatus(in *MachinePoolStatus, out *v1alpha4.MachinePoolStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_MachinePoolStatus_To_v1alpha4_MachinePoolStatus(in, out, s) +// Convert_v1alpha3_MachinePoolStatus_To_v1beta1_MachinePoolStatus is an autogenerated conversion function. +func Convert_v1alpha3_MachinePoolStatus_To_v1beta1_MachinePoolStatus(in *MachinePoolStatus, out *v1beta1.MachinePoolStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_MachinePoolStatus_To_v1beta1_MachinePoolStatus(in, out, s) } -func autoConvert_v1alpha4_MachinePoolStatus_To_v1alpha3_MachinePoolStatus(in *v1alpha4.MachinePoolStatus, out *MachinePoolStatus, s conversion.Scope) error { +func autoConvert_v1beta1_MachinePoolStatus_To_v1alpha3_MachinePoolStatus(in *v1beta1.MachinePoolStatus, out *MachinePoolStatus, s conversion.Scope) error { out.NodeRefs = *(*[]v1.ObjectReference)(unsafe.Pointer(&in.NodeRefs)) out.Replicas = in.Replicas out.ReadyReplicas = in.ReadyReplicas @@ -228,7 +228,7 @@ func autoConvert_v1alpha4_MachinePoolStatus_To_v1alpha3_MachinePoolStatus(in *v1 in, out := &in.Conditions, &out.Conditions *out = make(apiv1alpha3.Conditions, len(*in)) for i := range *in { - if err := apiv1alpha3.Convert_v1alpha4_Condition_To_v1alpha3_Condition(&(*in)[i], &(*out)[i], s); err != nil { + if err := apiv1alpha3.Convert_v1beta1_Condition_To_v1alpha3_Condition(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -238,7 +238,7 @@ func autoConvert_v1alpha4_MachinePoolStatus_To_v1alpha3_MachinePoolStatus(in *v1 return nil } -// Convert_v1alpha4_MachinePoolStatus_To_v1alpha3_MachinePoolStatus is an autogenerated conversion function. -func Convert_v1alpha4_MachinePoolStatus_To_v1alpha3_MachinePoolStatus(in *v1alpha4.MachinePoolStatus, out *MachinePoolStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_MachinePoolStatus_To_v1alpha3_MachinePoolStatus(in, out, s) +// Convert_v1beta1_MachinePoolStatus_To_v1alpha3_MachinePoolStatus is an autogenerated conversion function. +func Convert_v1beta1_MachinePoolStatus_To_v1alpha3_MachinePoolStatus(in *v1beta1.MachinePoolStatus, out *MachinePoolStatus, s conversion.Scope) error { + return autoConvert_v1beta1_MachinePoolStatus_To_v1alpha3_MachinePoolStatus(in, out, s) } diff --git a/exp/api/v1alpha4/condition_consts.go b/exp/api/v1alpha4/condition_consts.go index 7da5038f9848..86486e03983e 100644 --- a/exp/api/v1alpha4/condition_consts.go +++ b/exp/api/v1alpha4/condition_consts.go @@ -16,7 +16,7 @@ limitations under the License. package v1alpha4 -import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" +import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" // Conditions and condition Reasons for the MachinePool object diff --git a/exp/api/v1alpha4/doc.go b/exp/api/v1alpha4/doc.go index b0efd4cde559..1a95a0617eff 100644 --- a/exp/api/v1alpha4/doc.go +++ b/exp/api/v1alpha4/doc.go @@ -14,4 +14,5 @@ See the License for the specific language governing permissions and limitations under the License. */ +// +k8s:conversion-gen=sigs.k8s.io/cluster-api/exp/api/v1beta1 package v1alpha4 diff --git a/exp/api/v1alpha4/groupversion_info.go b/exp/api/v1alpha4/groupversion_info.go index 7531f76e7854..77585cdec3d3 100644 --- a/exp/api/v1alpha4/groupversion_info.go +++ b/exp/api/v1alpha4/groupversion_info.go @@ -33,4 +33,6 @@ var ( // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme + + localSchemeBuilder = SchemeBuilder.SchemeBuilder ) diff --git a/exp/api/v1alpha4/machinepool_types.go b/exp/api/v1alpha4/machinepool_types.go index 038c7f5bbbab..1097ba3fcdbe 100644 --- a/exp/api/v1alpha4/machinepool_types.go +++ b/exp/api/v1alpha4/machinepool_types.go @@ -19,7 +19,7 @@ package v1alpha4 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" capierrors "sigs.k8s.io/cluster-api/errors" ) @@ -201,7 +201,6 @@ func (m *MachinePoolStatus) GetTypedPhase() MachinePoolPhase { // +kubebuilder:resource:path=machinepools,shortName=mp,scope=Namespaced,categories=cluster-api // +kubebuilder:subresource:status // +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas -// +kubebuilder:storageversion // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachinePool" // +kubebuilder:printcolumn:name="Replicas",type="string",JSONPath=".status.replicas",description="MachinePool replicas count" // +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="MachinePool status such as Terminating/Pending/Provisioning/Running/Failed etc" diff --git a/exp/api/v1alpha4/zz_generated.conversion.go b/exp/api/v1alpha4/zz_generated.conversion.go new file mode 100644 index 000000000000..4936137882b6 --- /dev/null +++ b/exp/api/v1alpha4/zz_generated.conversion.go @@ -0,0 +1,208 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by conversion-gen. DO NOT EDIT. + +package v1alpha4 + +import ( + unsafe "unsafe" + + v1 "k8s.io/api/core/v1" + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" + apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" + errors "sigs.k8s.io/cluster-api/errors" + v1beta1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*MachinePool)(nil), (*v1beta1.MachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachinePool_To_v1beta1_MachinePool(a.(*MachinePool), b.(*v1beta1.MachinePool), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachinePool)(nil), (*MachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachinePool_To_v1alpha4_MachinePool(a.(*v1beta1.MachinePool), b.(*MachinePool), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachinePoolList)(nil), (*v1beta1.MachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachinePoolList_To_v1beta1_MachinePoolList(a.(*MachinePoolList), b.(*v1beta1.MachinePoolList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachinePoolList)(nil), (*MachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachinePoolList_To_v1alpha4_MachinePoolList(a.(*v1beta1.MachinePoolList), b.(*MachinePoolList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachinePoolSpec)(nil), (*v1beta1.MachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachinePoolSpec_To_v1beta1_MachinePoolSpec(a.(*MachinePoolSpec), b.(*v1beta1.MachinePoolSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachinePoolSpec)(nil), (*MachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachinePoolSpec_To_v1alpha4_MachinePoolSpec(a.(*v1beta1.MachinePoolSpec), b.(*MachinePoolSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachinePoolStatus)(nil), (*v1beta1.MachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MachinePoolStatus_To_v1beta1_MachinePoolStatus(a.(*MachinePoolStatus), b.(*v1beta1.MachinePoolStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MachinePoolStatus)(nil), (*MachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachinePoolStatus_To_v1alpha4_MachinePoolStatus(a.(*v1beta1.MachinePoolStatus), b.(*MachinePoolStatus), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha4_MachinePool_To_v1beta1_MachinePool(in *MachinePool, out *v1beta1.MachinePool, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_MachinePoolSpec_To_v1beta1_MachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_MachinePoolStatus_To_v1beta1_MachinePoolStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_MachinePool_To_v1beta1_MachinePool is an autogenerated conversion function. +func Convert_v1alpha4_MachinePool_To_v1beta1_MachinePool(in *MachinePool, out *v1beta1.MachinePool, s conversion.Scope) error { + return autoConvert_v1alpha4_MachinePool_To_v1beta1_MachinePool(in, out, s) +} + +func autoConvert_v1beta1_MachinePool_To_v1alpha4_MachinePool(in *v1beta1.MachinePool, out *MachinePool, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_MachinePoolSpec_To_v1alpha4_MachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_MachinePoolStatus_To_v1alpha4_MachinePoolStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_MachinePool_To_v1alpha4_MachinePool is an autogenerated conversion function. +func Convert_v1beta1_MachinePool_To_v1alpha4_MachinePool(in *v1beta1.MachinePool, out *MachinePool, s conversion.Scope) error { + return autoConvert_v1beta1_MachinePool_To_v1alpha4_MachinePool(in, out, s) +} + +func autoConvert_v1alpha4_MachinePoolList_To_v1beta1_MachinePoolList(in *MachinePoolList, out *v1beta1.MachinePoolList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1beta1.MachinePool)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha4_MachinePoolList_To_v1beta1_MachinePoolList is an autogenerated conversion function. +func Convert_v1alpha4_MachinePoolList_To_v1beta1_MachinePoolList(in *MachinePoolList, out *v1beta1.MachinePoolList, s conversion.Scope) error { + return autoConvert_v1alpha4_MachinePoolList_To_v1beta1_MachinePoolList(in, out, s) +} + +func autoConvert_v1beta1_MachinePoolList_To_v1alpha4_MachinePoolList(in *v1beta1.MachinePoolList, out *MachinePoolList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]MachinePool)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1beta1_MachinePoolList_To_v1alpha4_MachinePoolList is an autogenerated conversion function. +func Convert_v1beta1_MachinePoolList_To_v1alpha4_MachinePoolList(in *v1beta1.MachinePoolList, out *MachinePoolList, s conversion.Scope) error { + return autoConvert_v1beta1_MachinePoolList_To_v1alpha4_MachinePoolList(in, out, s) +} + +func autoConvert_v1alpha4_MachinePoolSpec_To_v1beta1_MachinePoolSpec(in *MachinePoolSpec, out *v1beta1.MachinePoolSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + out.Template = in.Template + out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) + out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) + out.FailureDomains = *(*[]string)(unsafe.Pointer(&in.FailureDomains)) + return nil +} + +// Convert_v1alpha4_MachinePoolSpec_To_v1beta1_MachinePoolSpec is an autogenerated conversion function. +func Convert_v1alpha4_MachinePoolSpec_To_v1beta1_MachinePoolSpec(in *MachinePoolSpec, out *v1beta1.MachinePoolSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_MachinePoolSpec_To_v1beta1_MachinePoolSpec(in, out, s) +} + +func autoConvert_v1beta1_MachinePoolSpec_To_v1alpha4_MachinePoolSpec(in *v1beta1.MachinePoolSpec, out *MachinePoolSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + out.Template = in.Template + out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) + out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) + out.FailureDomains = *(*[]string)(unsafe.Pointer(&in.FailureDomains)) + return nil +} + +// Convert_v1beta1_MachinePoolSpec_To_v1alpha4_MachinePoolSpec is an autogenerated conversion function. +func Convert_v1beta1_MachinePoolSpec_To_v1alpha4_MachinePoolSpec(in *v1beta1.MachinePoolSpec, out *MachinePoolSpec, s conversion.Scope) error { + return autoConvert_v1beta1_MachinePoolSpec_To_v1alpha4_MachinePoolSpec(in, out, s) +} + +func autoConvert_v1alpha4_MachinePoolStatus_To_v1beta1_MachinePoolStatus(in *MachinePoolStatus, out *v1beta1.MachinePoolStatus, s conversion.Scope) error { + out.NodeRefs = *(*[]v1.ObjectReference)(unsafe.Pointer(&in.NodeRefs)) + out.Replicas = in.Replicas + out.ReadyReplicas = in.ReadyReplicas + out.AvailableReplicas = in.AvailableReplicas + out.UnavailableReplicas = in.UnavailableReplicas + out.FailureReason = (*errors.MachinePoolStatusFailure)(unsafe.Pointer(in.FailureReason)) + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + out.Phase = in.Phase + out.BootstrapReady = in.BootstrapReady + out.InfrastructureReady = in.InfrastructureReady + out.ObservedGeneration = in.ObservedGeneration + out.Conditions = *(*apiv1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) + return nil +} + +// Convert_v1alpha4_MachinePoolStatus_To_v1beta1_MachinePoolStatus is an autogenerated conversion function. +func Convert_v1alpha4_MachinePoolStatus_To_v1beta1_MachinePoolStatus(in *MachinePoolStatus, out *v1beta1.MachinePoolStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_MachinePoolStatus_To_v1beta1_MachinePoolStatus(in, out, s) +} + +func autoConvert_v1beta1_MachinePoolStatus_To_v1alpha4_MachinePoolStatus(in *v1beta1.MachinePoolStatus, out *MachinePoolStatus, s conversion.Scope) error { + out.NodeRefs = *(*[]v1.ObjectReference)(unsafe.Pointer(&in.NodeRefs)) + out.Replicas = in.Replicas + out.ReadyReplicas = in.ReadyReplicas + out.AvailableReplicas = in.AvailableReplicas + out.UnavailableReplicas = in.UnavailableReplicas + out.FailureReason = (*errors.MachinePoolStatusFailure)(unsafe.Pointer(in.FailureReason)) + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + out.Phase = in.Phase + out.BootstrapReady = in.BootstrapReady + out.InfrastructureReady = in.InfrastructureReady + out.ObservedGeneration = in.ObservedGeneration + out.Conditions = *(*apiv1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) + return nil +} + +// Convert_v1beta1_MachinePoolStatus_To_v1alpha4_MachinePoolStatus is an autogenerated conversion function. +func Convert_v1beta1_MachinePoolStatus_To_v1alpha4_MachinePoolStatus(in *v1beta1.MachinePoolStatus, out *MachinePoolStatus, s conversion.Scope) error { + return autoConvert_v1beta1_MachinePoolStatus_To_v1alpha4_MachinePoolStatus(in, out, s) +} diff --git a/exp/api/v1alpha4/zz_generated.deepcopy.go b/exp/api/v1alpha4/zz_generated.deepcopy.go index e67e5831a7b1..676220335a1f 100644 --- a/exp/api/v1alpha4/zz_generated.deepcopy.go +++ b/exp/api/v1alpha4/zz_generated.deepcopy.go @@ -22,8 +22,8 @@ package v1alpha4 import ( "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/runtime" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + runtime "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/errors" ) @@ -142,7 +142,7 @@ func (in *MachinePoolStatus) DeepCopyInto(out *MachinePoolStatus) { } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make(apiv1alpha4.Conditions, len(*in)) + *out = make(v1beta1.Conditions, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } diff --git a/exp/api/v1beta1/condition_consts.go b/exp/api/v1beta1/condition_consts.go new file mode 100644 index 000000000000..ca6f090f5571 --- /dev/null +++ b/exp/api/v1beta1/condition_consts.go @@ -0,0 +1,30 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + +// Conditions and condition Reasons for the MachinePool object + +const ( + // ReplicasReadyCondition reports an aggregate of current status of the replicas controlled by the MachinePool. + ReplicasReadyCondition clusterv1.ConditionType = "ReplicasReady" + + // WaitingForReplicasReadyReason (Severity=Info) documents a machinepool waiting for the required replicas + // to be ready. + WaitingForReplicasReadyReason = "WaitingForReplicasReady" +) diff --git a/exp/api/v1beta1/doc.go b/exp/api/v1beta1/doc.go new file mode 100644 index 000000000000..d55ab5609a7b --- /dev/null +++ b/exp/api/v1beta1/doc.go @@ -0,0 +1,17 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 diff --git a/exp/api/v1beta1/groupversion_info.go b/exp/api/v1beta1/groupversion_info.go new file mode 100644 index 000000000000..c1d6df6026c2 --- /dev/null +++ b/exp/api/v1beta1/groupversion_info.go @@ -0,0 +1,36 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// package v1beta1 contains API Schema definitions for the exp v1beta1 API group +// +kubebuilder:object:generate=true +// +groupName=cluster.x-k8s.io +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects. + GroupVersion = schema.GroupVersion{Group: "cluster.x-k8s.io", Version: "v1beta1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/exp/api/v1beta1/machinepool_types.go b/exp/api/v1beta1/machinepool_types.go new file mode 100644 index 000000000000..3d20efd5ba0b --- /dev/null +++ b/exp/api/v1beta1/machinepool_types.go @@ -0,0 +1,241 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + capierrors "sigs.k8s.io/cluster-api/errors" +) + +const ( + // MachinePoolFinalizer is used to ensure deletion of dependencies (nodes, infra). + MachinePoolFinalizer = "machinepool.cluster.x-k8s.io" +) + +// ANCHOR: MachinePoolSpec + +// MachinePoolSpec defines the desired state of MachinePool. +type MachinePoolSpec struct { + // ClusterName is the name of the Cluster this object belongs to. + // +kubebuilder:validation:MinLength=1 + ClusterName string `json:"clusterName"` + + // Number of desired machines. Defaults to 1. + // This is a pointer to distinguish between explicit zero and not specified. + Replicas *int32 `json:"replicas,omitempty"` + + // Template describes the machines that will be created. + Template clusterv1.MachineTemplateSpec `json:"template"` + + // Minimum number of seconds for which a newly created machine instances should + // be ready. + // Defaults to 0 (machine instance will be considered available as soon as it + // is ready) + // +optional + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` + + // ProviderIDList are the identification IDs of machine instances provided by the provider. + // This field must match the provider IDs as seen on the node objects corresponding to a machine pool's machine instances. + // +optional + ProviderIDList []string `json:"providerIDList,omitempty"` + + // FailureDomains is the list of failure domains this MachinePool should be attached to. + FailureDomains []string `json:"failureDomains,omitempty"` +} + +// ANCHOR_END: MachinePoolSpec + +// ANCHOR: MachinePoolStatus + +// MachinePoolStatus defines the observed state of MachinePool. +type MachinePoolStatus struct { + // NodeRefs will point to the corresponding Nodes if it they exist. + // +optional + NodeRefs []corev1.ObjectReference `json:"nodeRefs,omitempty"` + + // Replicas is the most recently observed number of replicas. + // +optional + Replicas int32 `json:"replicas"` + + // The number of ready replicas for this MachinePool. A machine is considered ready when the node has been created and is "Ready". + // +optional + ReadyReplicas int32 `json:"readyReplicas,omitempty"` + + // The number of available replicas (ready for at least minReadySeconds) for this MachinePool. + // +optional + AvailableReplicas int32 `json:"availableReplicas,omitempty"` + + // Total number of unavailable machine instances targeted by this machine pool. + // This is the total number of machine instances that are still required for + // the machine pool to have 100% available capacity. They may either + // be machine instances that are running but not yet available or machine instances + // that still have not been created. + // +optional + UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"` + + // FailureReason indicates that there is a problem reconciling the state, and + // will be set to a token value suitable for programmatic interpretation. + // +optional + FailureReason *capierrors.MachinePoolStatusFailure `json:"failureReason,omitempty"` + + // FailureMessage indicates that there is a problem reconciling the state, + // and will be set to a descriptive error message. + // +optional + FailureMessage *string `json:"failureMessage,omitempty"` + + // Phase represents the current phase of cluster actuation. + // E.g. Pending, Running, Terminating, Failed etc. + // +optional + Phase string `json:"phase,omitempty"` + + // BootstrapReady is the state of the bootstrap provider. + // +optional + BootstrapReady bool `json:"bootstrapReady"` + + // InfrastructureReady is the state of the infrastructure provider. + // +optional + InfrastructureReady bool `json:"infrastructureReady"` + + // ObservedGeneration is the latest generation observed by the controller. + // +optional + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // Conditions define the current service state of the MachinePool. + // +optional + Conditions clusterv1.Conditions `json:"conditions,omitempty"` +} + +// ANCHOR_END: MachinePoolStatus + +// MachinePoolPhase is a string representation of a MachinePool Phase. +// +// This type is a high-level indicator of the status of the MachinePool as it is provisioned, +// from the API user’s perspective. +// +// The value should not be interpreted by any software components as a reliable indication +// of the actual state of the MachinePool, and controllers should not use the MachinePool Phase field +// value when making decisions about what action to take. +// +// Controllers should always look at the actual state of the MachinePool’s fields to make those decisions. +type MachinePoolPhase string + +const ( + // MachinePoolPhasePending is the first state a MachinePool is assigned by + // Cluster API MachinePool controller after being created. + MachinePoolPhasePending = MachinePoolPhase("Pending") + + // MachinePoolPhaseProvisioning is the state when the + // MachinePool infrastructure is being created or updated. + MachinePoolPhaseProvisioning = MachinePoolPhase("Provisioning") + + // MachinePoolPhaseProvisioned is the state when its + // infrastructure has been created and configured. + MachinePoolPhaseProvisioned = MachinePoolPhase("Provisioned") + + // MachinePoolPhaseRunning is the MachinePool state when its instances + // have become Kubernetes Nodes in the Ready state. + MachinePoolPhaseRunning = MachinePoolPhase("Running") + + // MachinePoolPhaseScalingUp is the MachinePool state when the + // MachinePool infrastructure is scaling up. + MachinePoolPhaseScalingUp = MachinePoolPhase("ScalingUp") + + // MachinePoolPhaseScalingDown is the MachinePool state when the + // MachinePool infrastructure is scaling down. + MachinePoolPhaseScalingDown = MachinePoolPhase("ScalingDown") + + // MachinePoolPhaseDeleting is the MachinePool state when a delete + // request has been sent to the API Server, + // but its infrastructure has not yet been fully deleted. + MachinePoolPhaseDeleting = MachinePoolPhase("Deleting") + + // MachinePoolPhaseFailed is the MachinePool state when the system + // might require user intervention. + MachinePoolPhaseFailed = MachinePoolPhase("Failed") + + // MachinePoolPhaseUnknown is returned if the MachinePool state cannot be determined. + MachinePoolPhaseUnknown = MachinePoolPhase("Unknown") +) + +// SetTypedPhase sets the Phase field to the string representation of MachinePoolPhase. +func (m *MachinePoolStatus) SetTypedPhase(p MachinePoolPhase) { + m.Phase = string(p) +} + +// GetTypedPhase attempts to parse the Phase field and return +// the typed MachinePoolPhase representation as described in `machinepool_phase_types.go`. +func (m *MachinePoolStatus) GetTypedPhase() MachinePoolPhase { + switch phase := MachinePoolPhase(m.Phase); phase { + case + MachinePoolPhasePending, + MachinePoolPhaseProvisioning, + MachinePoolPhaseProvisioned, + MachinePoolPhaseRunning, + MachinePoolPhaseScalingUp, + MachinePoolPhaseScalingDown, + MachinePoolPhaseDeleting, + MachinePoolPhaseFailed: + return phase + default: + return MachinePoolPhaseUnknown + } +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=machinepools,shortName=mp,scope=Namespaced,categories=cluster-api +// +kubebuilder:subresource:status +// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachinePool" +// +kubebuilder:printcolumn:name="Replicas",type="string",JSONPath=".status.replicas",description="MachinePool replicas count" +// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="MachinePool status such as Terminating/Pending/Provisioning/Running/Failed etc" +// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.template.spec.version",description="Kubernetes version associated with this MachinePool" +// +k8s:conversion-gen=false + +// MachinePool is the Schema for the machinepools API. +type MachinePool struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec MachinePoolSpec `json:"spec,omitempty"` + Status MachinePoolStatus `json:"status,omitempty"` +} + +// GetConditions returns the set of conditions for this object. +func (m *MachinePool) GetConditions() clusterv1.Conditions { + return m.Status.Conditions +} + +// SetConditions sets the conditions on this object. +func (m *MachinePool) SetConditions(conditions clusterv1.Conditions) { + m.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// MachinePoolList contains a list of MachinePool. +type MachinePoolList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []MachinePool `json:"items"` +} + +func init() { + SchemeBuilder.Register(&MachinePool{}, &MachinePoolList{}) +} diff --git a/exp/api/v1alpha4/machinepool_webhook.go b/exp/api/v1beta1/machinepool_webhook.go similarity index 86% rename from exp/api/v1alpha4/machinepool_webhook.go rename to exp/api/v1beta1/machinepool_webhook.go index 4250feb103c9..f2fc4041bf36 100644 --- a/exp/api/v1alpha4/machinepool_webhook.go +++ b/exp/api/v1beta1/machinepool_webhook.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "fmt" @@ -24,7 +24,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" runtime "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/webhook" ) @@ -35,8 +35,8 @@ func (m *MachinePool) SetupWebhookWithManager(mgr ctrl.Manager) error { Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-cluster-x-k8s-io-v1alpha4-machinepool,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machinepools,versions=v1alpha4,name=validation.machinepool.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-cluster-x-k8s-io-v1alpha4-machinepool,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machinepools,versions=v1alpha4,name=default.machinepool.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-cluster-x-k8s-io-v1beta1-machinepool,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machinepools,versions=v1beta1,name=validation.machinepool.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-cluster-x-k8s-io-v1beta1-machinepool,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=cluster.x-k8s.io,resources=machinepools,versions=v1beta1,name=default.machinepool.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1;v1beta1 var _ webhook.Defaulter = &MachinePool{} var _ webhook.Validator = &MachinePool{} diff --git a/exp/api/v1alpha4/machinepool_webhook_test.go b/exp/api/v1beta1/machinepool_webhook_test.go similarity index 98% rename from exp/api/v1alpha4/machinepool_webhook_test.go rename to exp/api/v1beta1/machinepool_webhook_test.go index 5d35935290eb..103767829cc8 100644 --- a/exp/api/v1alpha4/machinepool_webhook_test.go +++ b/exp/api/v1beta1/machinepool_webhook_test.go @@ -1,5 +1,5 @@ /* -Copyright 2019 The Kubernetes Authors. +Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "testing" @@ -24,7 +24,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" utildefaulting "sigs.k8s.io/cluster-api/util/defaulting" ) diff --git a/exp/api/v1beta1/zz_generated.deepcopy.go b/exp/api/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 000000000000..fdbea08fc5ea --- /dev/null +++ b/exp/api/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,160 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/runtime" + apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/errors" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachinePool) DeepCopyInto(out *MachinePool) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePool. +func (in *MachinePool) DeepCopy() *MachinePool { + if in == nil { + return nil + } + out := new(MachinePool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachinePool) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachinePoolList) DeepCopyInto(out *MachinePoolList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MachinePool, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolList. +func (in *MachinePoolList) DeepCopy() *MachinePoolList { + if in == nil { + return nil + } + out := new(MachinePoolList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachinePoolList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachinePoolSpec) DeepCopyInto(out *MachinePoolSpec) { + *out = *in + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + in.Template.DeepCopyInto(&out.Template) + if in.MinReadySeconds != nil { + in, out := &in.MinReadySeconds, &out.MinReadySeconds + *out = new(int32) + **out = **in + } + if in.ProviderIDList != nil { + in, out := &in.ProviderIDList, &out.ProviderIDList + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolSpec. +func (in *MachinePoolSpec) DeepCopy() *MachinePoolSpec { + if in == nil { + return nil + } + out := new(MachinePoolSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachinePoolStatus) DeepCopyInto(out *MachinePoolStatus) { + *out = *in + if in.NodeRefs != nil { + in, out := &in.NodeRefs, &out.NodeRefs + *out = make([]v1.ObjectReference, len(*in)) + copy(*out, *in) + } + if in.FailureReason != nil { + in, out := &in.FailureReason, &out.FailureReason + *out = new(errors.MachinePoolStatusFailure) + **out = **in + } + if in.FailureMessage != nil { + in, out := &in.FailureMessage, &out.FailureMessage + *out = new(string) + **out = **in + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(apiv1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolStatus. +func (in *MachinePoolStatus) DeepCopy() *MachinePoolStatus { + if in == nil { + return nil + } + out := new(MachinePoolStatus) + in.DeepCopyInto(out) + return out +} diff --git a/exp/controllers/machinepool_controller.go b/exp/controllers/machinepool_controller.go index 5099c99f507e..d2061cd30b31 100644 --- a/exp/controllers/machinepool_controller.go +++ b/exp/controllers/machinepool_controller.go @@ -27,10 +27,10 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/controllers/remote" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/exp/controllers/machinepool_controller_noderef.go b/exp/controllers/machinepool_controller_noderef.go index 53c61afaef29..0b4cb46e845e 100644 --- a/exp/controllers/machinepool_controller_noderef.go +++ b/exp/controllers/machinepool_controller_noderef.go @@ -23,10 +23,10 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/noderefutil" "sigs.k8s.io/cluster-api/controllers/remote" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/exp/controllers/machinepool_controller_phases.go b/exp/controllers/machinepool_controller_phases.go index e5cba40a993e..960516911a1e 100644 --- a/exp/controllers/machinepool_controller_phases.go +++ b/exp/controllers/machinepool_controller_phases.go @@ -30,10 +30,10 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" capierrors "sigs.k8s.io/cluster-api/errors" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" diff --git a/exp/controllers/machinepool_controller_phases_test.go b/exp/controllers/machinepool_controller_phases_test.go index f643e81ac317..d33891795c4b 100644 --- a/exp/controllers/machinepool_controller_phases_test.go +++ b/exp/controllers/machinepool_controller_phases_test.go @@ -27,8 +27,8 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/util/kubeconfig" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/exp/controllers/machinepool_controller_test.go b/exp/controllers/machinepool_controller_test.go index e1805e25265d..e8ff9f5987d4 100644 --- a/exp/controllers/machinepool_controller_test.go +++ b/exp/controllers/machinepool_controller_test.go @@ -26,8 +26,8 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/client-go/kubernetes/scheme" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" ctrl "sigs.k8s.io/controller-runtime" diff --git a/exp/controllers/suite_test.go b/exp/controllers/suite_test.go index e5022b55612a..a70f231423d0 100644 --- a/exp/controllers/suite_test.go +++ b/exp/controllers/suite_test.go @@ -22,7 +22,7 @@ import ( "os" "testing" - "sigs.k8s.io/cluster-api/api/v1alpha4/index" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/internal/envtest" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/controller" diff --git a/exp/util/util.go b/exp/util/util.go index 93cb93054922..9e70b033dca3 100644 --- a/exp/util/util.go +++ b/exp/util/util.go @@ -25,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" - clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/reconcile" diff --git a/internal/envtest/environment.go b/internal/envtest/environment.go index 7a533c49ea40..0218befc2e8e 100644 --- a/internal/envtest/environment.go +++ b/internal/envtest/environment.go @@ -43,12 +43,12 @@ import ( "k8s.io/client-go/rest" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/cmd/clusterctl/log" kcpv1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" - addonv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + addonv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/internal/testtypes" "sigs.k8s.io/cluster-api/util/kubeconfig" ctrl "sigs.k8s.io/controller-runtime" diff --git a/internal/testtypes/builders.go b/internal/testtypes/builders.go index 6069f5316a90..d6c4018e8fed 100644 --- a/internal/testtypes/builders.go +++ b/internal/testtypes/builders.go @@ -23,7 +23,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/internal/testtypes/crds.go b/internal/testtypes/crds.go index f9e6e2c5415b..e8c0e80c6cdd 100644 --- a/internal/testtypes/crds.go +++ b/internal/testtypes/crds.go @@ -25,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func generateCRD(gvk schema.GroupVersionKind) *apiextensionsv1.CustomResourceDefinition { diff --git a/main.go b/main.go index c7d3abc0ee88..a1e9cbe6eb55 100644 --- a/main.go +++ b/main.go @@ -33,17 +33,18 @@ import ( cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" - clusterv1old "sigs.k8s.io/cluster-api/api/v1alpha3" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - "sigs.k8s.io/cluster-api/api/v1alpha4/index" + clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/controllers/topology" addonsv1old "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha3" - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" + addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" addonscontrollers "sigs.k8s.io/cluster-api/exp/addons/controllers" expv1old "sigs.k8s.io/cluster-api/exp/api/v1alpha3" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" expcontrollers "sigs.k8s.io/cluster-api/exp/controllers" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/version" @@ -84,7 +85,8 @@ func init() { klog.InitFlags(nil) _ = clientgoscheme.AddToScheme(scheme) - _ = clusterv1old.AddToScheme(scheme) + _ = clusterv1alpha4.AddToScheme(scheme) + _ = clusterv1alpha3.AddToScheme(scheme) _ = clusterv1.AddToScheme(scheme) _ = expv1old.AddToScheme(scheme) _ = expv1.AddToScheme(scheme) diff --git a/test/e2e/clusterctl_upgrade.go b/test/e2e/clusterctl_upgrade.go index 209383c07518..bcd44a9b42db 100644 --- a/test/e2e/clusterctl_upgrade.go +++ b/test/e2e/clusterctl_upgrade.go @@ -35,7 +35,7 @@ import ( "k8s.io/client-go/discovery" "k8s.io/utils/pointer" clusterv1old "sigs.k8s.io/cluster-api/api/v1alpha3" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/test/e2e/internal/log" "sigs.k8s.io/cluster-api/test/framework" diff --git a/test/e2e/common.go b/test/e2e/common.go index 3dfa7b7b9e9d..ca37c6d8ad1c 100644 --- a/test/e2e/common.go +++ b/test/e2e/common.go @@ -26,7 +26,7 @@ import ( "github.com/onsi/gomega/types" corev1 "k8s.io/api/core/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/util" ) diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index f4981d45a7d4..f955760723d2 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -32,7 +32,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/bootstrap" "sigs.k8s.io/cluster-api/test/framework/clusterctl" diff --git a/test/e2e/kcp_adoption.go b/test/e2e/kcp_adoption.go index ac45f871849a..3ba3ef115ead 100644 --- a/test/e2e/kcp_adoption.go +++ b/test/e2e/kcp_adoption.go @@ -32,7 +32,7 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/selection" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/clusterctl" diff --git a/test/e2e/node_drain_timeout.go b/test/e2e/node_drain_timeout.go index bfd83f79ed76..d1f8d45bfbc0 100644 --- a/test/e2e/node_drain_timeout.go +++ b/test/e2e/node_drain_timeout.go @@ -30,7 +30,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/clusterctl" diff --git a/test/e2e/self_hosted.go b/test/e2e/self_hosted.go index 8f728c077684..f6f527d621dc 100644 --- a/test/e2e/self_hosted.go +++ b/test/e2e/self_hosted.go @@ -28,7 +28,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/e2e/internal/log" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/bootstrap" diff --git a/test/framework/alltypes_helpers.go b/test/framework/alltypes_helpers.go index c62c2c74e12e..4f38d18f6216 100644 --- a/test/framework/alltypes_helpers.go +++ b/test/framework/alltypes_helpers.go @@ -33,7 +33,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" ) diff --git a/test/framework/bootstrap/kind_provider.go b/test/framework/bootstrap/kind_provider.go index e63a7254b2e4..ea096b16077e 100644 --- a/test/framework/bootstrap/kind_provider.go +++ b/test/framework/bootstrap/kind_provider.go @@ -23,7 +23,7 @@ import ( . "github.com/onsi/gomega" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework/internal/log" kindv1 "sigs.k8s.io/kind/pkg/apis/config/v1alpha4" kind "sigs.k8s.io/kind/pkg/cluster" diff --git a/test/framework/cluster_helpers.go b/test/framework/cluster_helpers.go index 11055f5f0568..c3b8204fd06d 100644 --- a/test/framework/cluster_helpers.go +++ b/test/framework/cluster_helpers.go @@ -24,7 +24,7 @@ import ( . "github.com/onsi/gomega" apierrors "k8s.io/apimachinery/pkg/api/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework/internal/log" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/test/framework/cluster_proxy.go b/test/framework/cluster_proxy.go index 56ba44e0f1f2..efc6379517ba 100644 --- a/test/framework/cluster_proxy.go +++ b/test/framework/cluster_proxy.go @@ -32,8 +32,8 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd/api" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework/exec" "sigs.k8s.io/cluster-api/test/framework/internal/log" "sigs.k8s.io/cluster-api/test/infrastructure/container" diff --git a/test/framework/clusterctl/clusterctl_helpers.go b/test/framework/clusterctl/clusterctl_helpers.go index 3b5413f63b9e..2677ad2c7945 100644 --- a/test/framework/clusterctl/clusterctl_helpers.go +++ b/test/framework/clusterctl/clusterctl_helpers.go @@ -23,10 +23,10 @@ import ( . "github.com/onsi/gomega" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" - clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/internal/log" ) diff --git a/test/framework/clusterresourceset_helpers.go b/test/framework/clusterresourceset_helpers.go index 4c4068192710..510aebe608e0 100644 --- a/test/framework/clusterresourceset_helpers.go +++ b/test/framework/clusterresourceset_helpers.go @@ -25,8 +25,8 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/test/framework/controlplane_helpers.go b/test/framework/controlplane_helpers.go index 1f1040ba61cb..fd495d8ba9f5 100644 --- a/test/framework/controlplane_helpers.go +++ b/test/framework/controlplane_helpers.go @@ -25,7 +25,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/test/framework/internal/log" diff --git a/test/framework/convenience.go b/test/framework/convenience.go index a46b62cca8a0..fcb7dc64db7f 100644 --- a/test/framework/convenience.go +++ b/test/framework/convenience.go @@ -26,11 +26,11 @@ import ( apiextensionsv1beta "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" "k8s.io/apimachinery/pkg/runtime" clusterv1old "sigs.k8s.io/cluster-api/api/v1alpha3" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" ) // TryAddDefaultSchemes tries to add the following schemes: diff --git a/test/framework/docker_logcollector.go b/test/framework/docker_logcollector.go index d69a157d59ff..baff13711d92 100644 --- a/test/framework/docker_logcollector.go +++ b/test/framework/docker_logcollector.go @@ -25,8 +25,8 @@ import ( "strings" kerrors "k8s.io/apimachinery/pkg/util/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/container" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/kind/pkg/errors" diff --git a/test/framework/machine_helpers.go b/test/framework/machine_helpers.go index d75ce67ac0bd..8710943348fc 100644 --- a/test/framework/machine_helpers.go +++ b/test/framework/machine_helpers.go @@ -26,7 +26,7 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework/internal/log" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" diff --git a/test/framework/machinedeployment_helpers.go b/test/framework/machinedeployment_helpers.go index 5630d2f6f37b..78dbe04725f1 100644 --- a/test/framework/machinedeployment_helpers.go +++ b/test/framework/machinedeployment_helpers.go @@ -27,7 +27,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework/internal/log" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/patch" diff --git a/test/framework/machinehealthcheck_helpers.go b/test/framework/machinehealthcheck_helpers.go index 3b168711e714..7403924f2f6f 100644 --- a/test/framework/machinehealthcheck_helpers.go +++ b/test/framework/machinehealthcheck_helpers.go @@ -27,7 +27,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/test/framework/machinepool_helpers.go b/test/framework/machinepool_helpers.go index 6cc22851ea74..9586389050e5 100644 --- a/test/framework/machinepool_helpers.go +++ b/test/framework/machinepool_helpers.go @@ -27,8 +27,8 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/test/framework/machines.go b/test/framework/machines.go index 8478f0b17424..f1179f9cec3b 100644 --- a/test/framework/machines.go +++ b/test/framework/machines.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/test/infrastructure/container/docker.go b/test/infrastructure/container/docker.go index 3b632b69eca3..f8cca252bf27 100644 --- a/test/infrastructure/container/docker.go +++ b/test/infrastructure/container/docker.go @@ -35,7 +35,7 @@ import ( "github.com/docker/docker/pkg/stdcopy" "github.com/docker/go-connections/nat" "github.com/pkg/errors" - "sigs.k8s.io/cluster-api/api/v1alpha4" + "sigs.k8s.io/cluster-api/api/v1beta1" ) const ( @@ -392,7 +392,7 @@ func (d *docker) RunContainer(ctx context.Context, runConfig *RunContainerInput, } networkConfig := network.NetworkingConfig{} - if runConfig.IPFamily == v1alpha4.IPv6IPFamily { + if runConfig.IPFamily == v1beta1.IPv6IPFamily { hostConfig.Sysctls = map[string]string{ "net.ipv6.conf.all.disable_ipv6": "0", "net.ipv6.conf.all.forwarding": "1", diff --git a/test/infrastructure/container/interface.go b/test/infrastructure/container/interface.go index 8a9ba19b539a..e260fb2e73a0 100644 --- a/test/infrastructure/container/interface.go +++ b/test/infrastructure/container/interface.go @@ -20,7 +20,7 @@ import ( "context" "io" - "sigs.k8s.io/cluster-api/api/v1alpha4" + "sigs.k8s.io/cluster-api/api/v1beta1" ) // Runtime defines the interface for interacting with a container runtime. @@ -88,7 +88,7 @@ type RunContainerInput struct { // PortMappings contains host<>container ports to map. PortMappings []PortMapping // IPFamily is the IP version to use. - IPFamily v1alpha4.ClusterIPFamily + IPFamily v1beta1.ClusterIPFamily } // ExecContainerInput contains values for running exec on a container. diff --git a/test/infrastructure/docker/api/v1alpha4/condition_consts.go b/test/infrastructure/docker/api/v1alpha4/condition_consts.go index 8280bb71b92a..45235d5d6c2e 100644 --- a/test/infrastructure/docker/api/v1alpha4/condition_consts.go +++ b/test/infrastructure/docker/api/v1alpha4/condition_consts.go @@ -16,7 +16,7 @@ limitations under the License. package v1alpha4 -import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" +import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" // Conditions and condition Reasons for the DockerMachine object diff --git a/test/infrastructure/docker/api/v1alpha4/dockercluster_types.go b/test/infrastructure/docker/api/v1alpha4/dockercluster_types.go index 1c4358fb16f5..97b264aede89 100644 --- a/test/infrastructure/docker/api/v1alpha4/dockercluster_types.go +++ b/test/infrastructure/docker/api/v1alpha4/dockercluster_types.go @@ -18,7 +18,7 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) const ( diff --git a/test/infrastructure/docker/api/v1alpha4/dockermachine_types.go b/test/infrastructure/docker/api/v1alpha4/dockermachine_types.go index 3417a9fc2be3..0829272fc5f9 100644 --- a/test/infrastructure/docker/api/v1alpha4/dockermachine_types.go +++ b/test/infrastructure/docker/api/v1alpha4/dockermachine_types.go @@ -18,7 +18,7 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) const ( diff --git a/test/infrastructure/docker/controllers/dockercluster_controller.go b/test/infrastructure/docker/controllers/dockercluster_controller.go index c9e8662cea2c..a9c389c74584 100644 --- a/test/infrastructure/docker/controllers/dockercluster_controller.go +++ b/test/infrastructure/docker/controllers/dockercluster_controller.go @@ -25,7 +25,7 @@ import ( "github.com/go-logr/logr" "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" "sigs.k8s.io/cluster-api/test/infrastructure/docker/docker" "sigs.k8s.io/cluster-api/util" diff --git a/test/infrastructure/docker/controllers/dockermachine_controller.go b/test/infrastructure/docker/controllers/dockermachine_controller.go index bb50bcdcc1a2..3dd4e3aef26d 100644 --- a/test/infrastructure/docker/controllers/dockermachine_controller.go +++ b/test/infrastructure/docker/controllers/dockermachine_controller.go @@ -25,7 +25,7 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" "sigs.k8s.io/cluster-api/test/infrastructure/docker/docker" "sigs.k8s.io/cluster-api/util" diff --git a/test/infrastructure/docker/controllers/dockermachine_controller_test.go b/test/infrastructure/docker/controllers/dockermachine_controller_test.go index b36c14b207d1..7658fa0c9940 100644 --- a/test/infrastructure/docker/controllers/dockermachine_controller_test.go +++ b/test/infrastructure/docker/controllers/dockermachine_controller_test.go @@ -23,7 +23,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/test/infrastructure/docker/controllers/suite_test.go b/test/infrastructure/docker/controllers/suite_test.go index 085bbe7379e4..792a309d9f3f 100644 --- a/test/infrastructure/docker/controllers/suite_test.go +++ b/test/infrastructure/docker/controllers/suite_test.go @@ -19,7 +19,7 @@ package controllers import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" ) diff --git a/test/infrastructure/docker/docker/kind_manager.go b/test/infrastructure/docker/docker/kind_manager.go index 32852a97640e..409d0b1c0948 100644 --- a/test/infrastructure/docker/docker/kind_manager.go +++ b/test/infrastructure/docker/docker/kind_manager.go @@ -23,7 +23,7 @@ import ( "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/container" "sigs.k8s.io/cluster-api/test/infrastructure/docker/docker/types" ctrl "sigs.k8s.io/controller-runtime" diff --git a/test/infrastructure/docker/docker/loadbalancer.go b/test/infrastructure/docker/docker/loadbalancer.go index 362891f35e9d..15b0ca5723ba 100644 --- a/test/infrastructure/docker/docker/loadbalancer.go +++ b/test/infrastructure/docker/docker/loadbalancer.go @@ -22,7 +22,7 @@ import ( "net" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/container" "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" "sigs.k8s.io/cluster-api/test/infrastructure/docker/docker/types" diff --git a/test/infrastructure/docker/docker/machine.go b/test/infrastructure/docker/docker/machine.go index e318d7c3653b..0d5514aa790a 100644 --- a/test/infrastructure/docker/docker/machine.go +++ b/test/infrastructure/docker/docker/machine.go @@ -33,7 +33,7 @@ import ( "sigs.k8s.io/kind/pkg/apis/config/v1alpha4" "sigs.k8s.io/kind/pkg/cluster/constants" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/container" infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" "sigs.k8s.io/cluster-api/test/infrastructure/docker/cloudinit" diff --git a/test/infrastructure/docker/exp/api/v1alpha4/dockermachinepool_types.go b/test/infrastructure/docker/exp/api/v1alpha4/dockermachinepool_types.go index 4a4a7a114401..3abf3218b676 100644 --- a/test/infrastructure/docker/exp/api/v1alpha4/dockermachinepool_types.go +++ b/test/infrastructure/docker/exp/api/v1alpha4/dockermachinepool_types.go @@ -19,7 +19,7 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" ) diff --git a/test/infrastructure/docker/exp/controllers/dockermachinepool_controller.go b/test/infrastructure/docker/exp/controllers/dockermachinepool_controller.go index 3b8d80ee83ad..6d2ccb3771b3 100644 --- a/test/infrastructure/docker/exp/controllers/dockermachinepool_controller.go +++ b/test/infrastructure/docker/exp/controllers/dockermachinepool_controller.go @@ -26,8 +26,8 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1beta1" utilexp "sigs.k8s.io/cluster-api/exp/util" infrav1exp "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1alpha4" "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/docker" diff --git a/test/infrastructure/docker/exp/docker/nodepool.go b/test/infrastructure/docker/exp/docker/nodepool.go index 18e5239b6c17..d97f34ecea76 100644 --- a/test/infrastructure/docker/exp/docker/nodepool.go +++ b/test/infrastructure/docker/exp/docker/nodepool.go @@ -25,8 +25,8 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/docker/docker" infrav1exp "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1alpha4" "sigs.k8s.io/cluster-api/util" diff --git a/test/infrastructure/docker/main.go b/test/infrastructure/docker/main.go index 70c3fca010bc..2416dd202974 100644 --- a/test/infrastructure/docker/main.go +++ b/test/infrastructure/docker/main.go @@ -31,9 +31,9 @@ import ( cliflag "k8s.io/component-base/cli/flag" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/controller" diff --git a/util/annotations/helpers.go b/util/annotations/helpers.go index 286d5187f8fa..c5405eb1fafd 100644 --- a/util/annotations/helpers.go +++ b/util/annotations/helpers.go @@ -21,7 +21,7 @@ import ( "strings" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // IsPaused returns true if the Cluster is paused or the object has the `paused` annotation. diff --git a/util/collections/helpers.go b/util/collections/helpers.go index 1d989e795065..be059c6e0be4 100644 --- a/util/collections/helpers.go +++ b/util/collections/helpers.go @@ -21,7 +21,7 @@ import ( "context" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/util/collections/machine_collection.go b/util/collections/machine_collection.go index eb3b9844a921..8265889eea3b 100644 --- a/util/collections/machine_collection.go +++ b/util/collections/machine_collection.go @@ -31,7 +31,7 @@ import ( "sort" "github.com/blang/semver" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/version" diff --git a/util/collections/machine_collection_test.go b/util/collections/machine_collection_test.go index e01355b4a265..4fae8bbe6f1b 100644 --- a/util/collections/machine_collection_test.go +++ b/util/collections/machine_collection_test.go @@ -23,7 +23,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/collections" ) diff --git a/util/collections/machine_filters.go b/util/collections/machine_filters.go index 374629fa814a..69947c765b6a 100644 --- a/util/collections/machine_filters.go +++ b/util/collections/machine_filters.go @@ -21,7 +21,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/selection" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/util/collections/machine_filters_test.go b/util/collections/machine_filters_test.go index d05f427e3460..bf3565cdbd70 100644 --- a/util/collections/machine_filters_test.go +++ b/util/collections/machine_filters_test.go @@ -28,7 +28,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" ) diff --git a/util/conditions/getter.go b/util/conditions/getter.go index 92a1a67a7a77..379e1ecb68a1 100644 --- a/util/conditions/getter.go +++ b/util/conditions/getter.go @@ -19,7 +19,7 @@ package conditions import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/util/conditions/getter_test.go b/util/conditions/getter_test.go index 9aef2a8c37e2..88b961b1e418 100644 --- a/util/conditions/getter_test.go +++ b/util/conditions/getter_test.go @@ -20,7 +20,7 @@ import ( "testing" . "github.com/onsi/gomega" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) var ( diff --git a/util/conditions/matcher.go b/util/conditions/matcher.go index d9415b8fe4ff..dc5757dece40 100644 --- a/util/conditions/matcher.go +++ b/util/conditions/matcher.go @@ -21,7 +21,7 @@ import ( "github.com/onsi/gomega" "github.com/onsi/gomega/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // MatchConditions returns a custom matcher to check equality of clusterv1.Conditions. diff --git a/util/conditions/matcher_test.go b/util/conditions/matcher_test.go index 3703fcb4f05a..0b9ca1b81e05 100644 --- a/util/conditions/matcher_test.go +++ b/util/conditions/matcher_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestMatchConditions(t *testing.T) { diff --git a/util/conditions/matchers.go b/util/conditions/matchers.go index e49ebced6486..a2fd651744ef 100644 --- a/util/conditions/matchers.go +++ b/util/conditions/matchers.go @@ -22,7 +22,7 @@ import ( "github.com/onsi/gomega/format" "github.com/onsi/gomega/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // HaveSameStateOf matches a condition to have the same state of another. diff --git a/util/conditions/merge.go b/util/conditions/merge.go index a5650d891cdc..54c1ec3d2eed 100644 --- a/util/conditions/merge.go +++ b/util/conditions/merge.go @@ -20,7 +20,7 @@ import ( "sort" corev1 "k8s.io/api/core/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // localizedCondition defines a condition with the information of the object the conditions diff --git a/util/conditions/merge_strategies.go b/util/conditions/merge_strategies.go index 87bda830fcd0..6e582bf10d0e 100644 --- a/util/conditions/merge_strategies.go +++ b/util/conditions/merge_strategies.go @@ -20,7 +20,7 @@ import ( "fmt" "strings" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // mergeOptions allows to set strategies for merging a set of conditions into a single condition, diff --git a/util/conditions/merge_strategies_test.go b/util/conditions/merge_strategies_test.go index cddc13572b12..0fa6170f4583 100644 --- a/util/conditions/merge_strategies_test.go +++ b/util/conditions/merge_strategies_test.go @@ -21,7 +21,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestGetStepCounterMessage(t *testing.T) { diff --git a/util/conditions/merge_test.go b/util/conditions/merge_test.go index 67504db2c7e6..2cd91370d4fe 100644 --- a/util/conditions/merge_test.go +++ b/util/conditions/merge_test.go @@ -21,7 +21,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestNewConditionsGroup(t *testing.T) { diff --git a/util/conditions/patch.go b/util/conditions/patch.go index d9bdd386204b..51af0b398c5f 100644 --- a/util/conditions/patch.go +++ b/util/conditions/patch.go @@ -21,7 +21,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // Patch defines a list of operations to change a list of conditions into another. diff --git a/util/conditions/patch_test.go b/util/conditions/patch_test.go index 4d87b92a5709..137c94441909 100644 --- a/util/conditions/patch_test.go +++ b/util/conditions/patch_test.go @@ -23,7 +23,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestNewPatch(t *testing.T) { diff --git a/util/conditions/setter.go b/util/conditions/setter.go index 207ce55b2b9c..415013739299 100644 --- a/util/conditions/setter.go +++ b/util/conditions/setter.go @@ -23,7 +23,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // Setter interface defines methods that a Cluster API object should implement in order to diff --git a/util/conditions/setter_test.go b/util/conditions/setter_test.go index d9dcc10d593a..470ae4f8d98c 100644 --- a/util/conditions/setter_test.go +++ b/util/conditions/setter_test.go @@ -26,7 +26,7 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestHasSameState(t *testing.T) { diff --git a/util/conditions/suite_test.go b/util/conditions/suite_test.go index bb2ad0cb5b35..9fa7fb7a8093 100644 --- a/util/conditions/suite_test.go +++ b/util/conditions/suite_test.go @@ -19,7 +19,7 @@ package conditions import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func init() { diff --git a/util/conditions/unstructured.go b/util/conditions/unstructured.go index dfd50d50f201..00ec7ac3587f 100644 --- a/util/conditions/unstructured.go +++ b/util/conditions/unstructured.go @@ -19,7 +19,7 @@ package conditions import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/controller-runtime/pkg/log" ) diff --git a/util/conditions/unstructured_test.go b/util/conditions/unstructured_test.go index 618022cf1240..c628ae8065db 100644 --- a/util/conditions/unstructured_test.go +++ b/util/conditions/unstructured_test.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestUnstructuredGetConditions(t *testing.T) { diff --git a/util/conversion/conversion.go b/util/conversion/conversion.go index 49a4d6bf6253..2e1949260ddf 100644 --- a/util/conversion/conversion.go +++ b/util/conversion/conversion.go @@ -39,7 +39,7 @@ import ( "k8s.io/apimachinery/pkg/util/json" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/util/conversion/conversion_test.go b/util/conversion/conversion_test.go index 23f4bf074278..6762cafcfb2a 100644 --- a/util/conversion/conversion_test.go +++ b/util/conversion/conversion_test.go @@ -24,7 +24,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) var ( diff --git a/util/deprecated.go b/util/deprecated.go index f422189efb4c..dbd82ba9c0f0 100644 --- a/util/deprecated.go +++ b/util/deprecated.go @@ -21,7 +21,7 @@ import ( "context" "github.com/blang/semver" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/version" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/util/failuredomains/failure_domains.go b/util/failuredomains/failure_domains.go index d373298e0970..005d2f36a477 100644 --- a/util/failuredomains/failure_domains.go +++ b/util/failuredomains/failure_domains.go @@ -23,7 +23,7 @@ import ( "k8s.io/klog/v2/klogr" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/collections" ) diff --git a/util/failuredomains/failure_domains_test.go b/util/failuredomains/failure_domains_test.go index d6b358d8fcca..40eb4015132f 100644 --- a/util/failuredomains/failure_domains_test.go +++ b/util/failuredomains/failure_domains_test.go @@ -25,7 +25,7 @@ import ( "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestNewFailureDomainPicker(t *testing.T) { diff --git a/util/kubeconfig/kubeconfig.go b/util/kubeconfig/kubeconfig.go index 4b4b91f4c546..283c2817d737 100644 --- a/util/kubeconfig/kubeconfig.go +++ b/util/kubeconfig/kubeconfig.go @@ -30,7 +30,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd/api" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/certs" "sigs.k8s.io/cluster-api/util/secret" diff --git a/util/kubeconfig/kubeconfig_test.go b/util/kubeconfig/kubeconfig_test.go index 92063c74bd4f..980eb2641626 100644 --- a/util/kubeconfig/kubeconfig_test.go +++ b/util/kubeconfig/kubeconfig_test.go @@ -31,7 +31,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd/api" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/certs" "sigs.k8s.io/cluster-api/util/secret" diff --git a/util/kubeconfig/testing.go b/util/kubeconfig/testing.go index c7e50ee365ee..51da00ad1c94 100644 --- a/util/kubeconfig/testing.go +++ b/util/kubeconfig/testing.go @@ -22,7 +22,7 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd/api" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // FromEnvTestConfig returns a new Kubeconfig in byte form when running in envtest. diff --git a/util/labels/helpers.go b/util/labels/helpers.go index 6de98c118929..673ccd1cf5d4 100644 --- a/util/labels/helpers.go +++ b/util/labels/helpers.go @@ -19,7 +19,7 @@ package labels import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // IsTopologyOwned returns true if the object has the `topology.cluster.x-k8s.io/owned` label. diff --git a/util/labels/helpers_test.go b/util/labels/helpers_test.go index c747bc9bd22b..329f8d57f6eb 100644 --- a/util/labels/helpers_test.go +++ b/util/labels/helpers_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestHasWatchLabel(t *testing.T) { diff --git a/util/patch/options.go b/util/patch/options.go index 1b4defaf2d13..9c2adffbdce3 100644 --- a/util/patch/options.go +++ b/util/patch/options.go @@ -16,7 +16,7 @@ limitations under the License. package patch -import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" +import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" // Option is some configuration that modifies options for a patch request. type Option interface { diff --git a/util/patch/patch.go b/util/patch/patch.go index 9423a9e0da56..48f2efecc95f 100644 --- a/util/patch/patch.go +++ b/util/patch/patch.go @@ -29,7 +29,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/wait" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/apiutil" diff --git a/util/patch/patch_test.go b/util/patch/patch_test.go index fcf82404504b..fb02f99b4ca5 100644 --- a/util/patch/patch_test.go +++ b/util/patch/patch_test.go @@ -29,7 +29,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/types" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/external" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/util/patch/utils_test.go b/util/patch/utils_test.go index f297112c2e26..9f4746475afc 100644 --- a/util/patch/utils_test.go +++ b/util/patch/utils_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestToUnstructured(t *testing.T) { diff --git a/util/predicates/cluster_predicates.go b/util/predicates/cluster_predicates.go index 71cb0bb5b5a1..9bf91d4c53cc 100644 --- a/util/predicates/cluster_predicates.go +++ b/util/predicates/cluster_predicates.go @@ -19,7 +19,7 @@ package predicates import ( "github.com/go-logr/logr" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/predicate" ) diff --git a/util/secret/certificates.go b/util/secret/certificates.go index 5085f5fe0c36..22200c453c82 100644 --- a/util/secret/certificates.go +++ b/util/secret/certificates.go @@ -34,7 +34,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/util/cert" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" "sigs.k8s.io/cluster-api/util/certs" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/util/suite_test.go b/util/suite_test.go index 21ef3db697e8..86dca5158185 100644 --- a/util/suite_test.go +++ b/util/suite_test.go @@ -19,7 +19,7 @@ package util import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" ) diff --git a/util/util.go b/util/util.go index a4d9de37794f..11635f4f6239 100644 --- a/util/util.go +++ b/util/util.go @@ -38,7 +38,7 @@ import ( k8sversion "k8s.io/apimachinery/pkg/version" "k8s.io/client-go/metadata" "k8s.io/client-go/rest" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/apiutil" diff --git a/util/util_test.go b/util/util_test.go index 6d2a39f90df5..eed03c816438 100644 --- a/util/util_test.go +++ b/util/util_test.go @@ -28,7 +28,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" diff --git a/util/yaml/yaml.go b/util/yaml/yaml.go index 8ee41b94423e..49e0dc99d1aa 100644 --- a/util/yaml/yaml.go +++ b/util/yaml/yaml.go @@ -33,7 +33,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/serializer/streaming" apiyaml "k8s.io/apimachinery/pkg/util/yaml" "k8s.io/client-go/kubernetes/scheme" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/yaml" )