diff --git a/cmd/vsphere/main.go b/cmd/vsphere/main.go index 5b30fa4838..23f6bc06a2 100644 --- a/cmd/vsphere/main.go +++ b/cmd/vsphere/main.go @@ -11,7 +11,7 @@ import ( "k8s.io/apiserver/pkg/util/feature" "k8s.io/component-base/featuregate" "k8s.io/klog/v2" - ipamv1beta1 "sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1" + ipamv1beta1 "sigs.k8s.io/cluster-api/api/ipam/v1beta1" //nolint:staticcheck ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client/config" diff --git a/go.mod b/go.mod index d092d310d3..2698f421f4 100644 --- a/go.mod +++ b/go.mod @@ -48,7 +48,7 @@ require ( k8s.io/mount-utils v0.34.1 // indirect k8s.io/sample-apiserver v0.34.1 // indirect k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 - sigs.k8s.io/cluster-api v1.10.7 + sigs.k8s.io/cluster-api v1.11.3 sigs.k8s.io/controller-runtime v0.22.3 sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240923090159-236e448db12c sigs.k8s.io/kube-storage-version-migrator v0.0.6-0.20230721195810-5c8923c5ff96 @@ -276,7 +276,7 @@ require ( github.com/sourcegraph/go-diff v0.7.0 // indirect github.com/spf13/afero v1.12.0 // indirect github.com/spf13/cast v1.7.1 // indirect - github.com/spf13/viper v1.20.0 // indirect + github.com/spf13/viper v1.20.1 // indirect github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect github.com/stbenjam/no-sprintf-host-port v0.2.0 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect @@ -349,7 +349,7 @@ require ( k8s.io/apiextensions-apiserver v0.34.1 // indirect k8s.io/cli-runtime v0.34.1 // indirect k8s.io/cloud-provider v0.32.0 // indirect - k8s.io/cluster-bootstrap v0.32.3 // indirect + k8s.io/cluster-bootstrap v0.33.3 // indirect k8s.io/component-helpers v0.34.1 // indirect k8s.io/controller-manager v0.32.1 // indirect k8s.io/cri-api v0.34.1 // indirect diff --git a/go.sum b/go.sum index fd132c885f..b4628e1890 100644 --- a/go.sum +++ b/go.sum @@ -562,8 +562,8 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk= github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/spf13/viper v1.20.0 h1:zrxIyR3RQIOsarIrgL8+sAvALXul9jeEPa06Y0Ph6vY= -github.com/spf13/viper v1.20.0/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= +github.com/spf13/viper v1.20.1 h1:ZMi+z/lvLyPSCoNtFCpqjy0S4kPbirhpTMwl8BkW9X4= +github.com/spf13/viper v1.20.1/go.mod h1:P9Mdzt1zoHIG8m2eZQinpiBjo6kCmZSKBClNNqjJvu4= github.com/ssgreg/nlreturn/v2 v2.2.1 h1:X4XDI7jstt3ySqGU86YGAURbxw3oTDPK9sPEi6YEwQ0= github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRkkxBiELzh2I= github.com/stbenjam/no-sprintf-host-port v0.2.0 h1:i8pxvGrt1+4G0czLr/WnmyH7zbZ8Bg8etvARQ1rpyl4= @@ -881,8 +881,8 @@ k8s.io/cloud-provider v0.32.0 h1:QXYJGmwME2q2rprymbmw2GroMChQYc/MWN6l/I4Kgp8= k8s.io/cloud-provider v0.32.0/go.mod h1:cz3gVodkhgwi2ugj/JUPglIruLSdDaThxawuDyCHfr8= k8s.io/cloud-provider-vsphere v1.32.2 h1:/OWUMXhRIDACM2j9Loj/Jh3/Z7q6o7kFbE78iCs92Zg= k8s.io/cloud-provider-vsphere v1.32.2/go.mod h1:v+shTeZ4WM232SEePcD+svnV+atFeEAc07Y0EIWn36M= -k8s.io/cluster-bootstrap v0.32.3 h1:AqIpsUhB6MUeaAsl1WvaUw54AHRd2hfZrESlKChtd8s= -k8s.io/cluster-bootstrap v0.32.3/go.mod h1:CHbBwgOb6liDV6JFUTkx5t85T2xidy0sChBDoyYw344= +k8s.io/cluster-bootstrap v0.33.3 h1:u2NTxJ5CFSBFXaDxLQoOWMly8eni31psVso+caq6uwI= +k8s.io/cluster-bootstrap v0.33.3/go.mod h1:p970f8u8jf273zyQ5raD8WUu2XyAl0SAWOY82o7i/ds= k8s.io/component-base v0.34.1 h1:v7xFgG+ONhytZNFpIz5/kecwD+sUhVE6HU7qQUiRM4A= k8s.io/component-base v0.34.1/go.mod h1:mknCpLlTSKHzAQJJnnHVKqjxR7gBeHRv0rPXA7gdtQ0= k8s.io/component-helpers v0.34.1 h1:gWhH3CCdwAx5P3oJqZKb4Lg5FYZTWVbdWtOI8n9U4XY= @@ -923,8 +923,8 @@ mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8 mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2 h1:jpcvIRr3GLoUoEKRkHKSmGjxb6lWwrBlJsXc+eUYQHM= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.2/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw= -sigs.k8s.io/cluster-api v1.10.7 h1:MuzeuAhLJLTgmqTitVz1XeXZLgAd4tJfnH9xitKG63A= -sigs.k8s.io/cluster-api v1.10.7/go.mod h1:PTuQc7CgNahPlJrLNJ0q4gKdpQ4wITgeVXDiDQQv2to= +sigs.k8s.io/cluster-api v1.11.3 h1:apxfugbP1X8AG7THCM74CTarCOW4H2oOc6hlbm1hY80= +sigs.k8s.io/cluster-api v1.11.3/go.mod h1:CA471SACi81M8DzRKTlWpHV33G0cfWEj7sC4fALFVok= sigs.k8s.io/controller-runtime v0.22.3 h1:I7mfqz/a/WdmDCEnXmSPm8/b/yRTy6JsKKENTijTq8Y= sigs.k8s.io/controller-runtime v0.22.3/go.mod h1:+QX1XUpTXN4mLoblf4tqr5CQcyHPAki2HLXqQMY6vh8= sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20240923090159-236e448db12c h1:w1vANkdIpYwbEZH0y1C7iJItgdEGvF9A3eCdRmLhg8I= diff --git a/pkg/controller/vsphere/actuator_test.go b/pkg/controller/vsphere/actuator_test.go index c3431dc68e..8193dad593 100644 --- a/pkg/controller/vsphere/actuator_test.go +++ b/pkg/controller/vsphere/actuator_test.go @@ -19,7 +19,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/scheme" - ipamv1beta1 "sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1" + ipamv1beta1 "sigs.k8s.io/cluster-api/api/ipam/v1beta1" //nolint:staticcheck "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/envtest" "sigs.k8s.io/controller-runtime/pkg/manager" diff --git a/pkg/controller/vsphere/reconciler_test.go b/pkg/controller/vsphere/reconciler_test.go index b794830e7d..1444b7c6e0 100644 --- a/pkg/controller/vsphere/reconciler_test.go +++ b/pkg/controller/vsphere/reconciler_test.go @@ -48,7 +48,7 @@ import ( "github.com/openshift/api/features" machinev1 "github.com/openshift/api/machine/v1beta1" - ipamv1beta1 "sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1" + ipamv1beta1 "sigs.k8s.io/cluster-api/api/ipam/v1beta1" //nolint:staticcheck machinecontroller "github.com/openshift/machine-api-operator/pkg/controller/machine" "github.com/openshift/machine-api-operator/pkg/controller/vsphere/session" diff --git a/pkg/util/ipam/util.go b/pkg/util/ipam/util.go index b028ecb1a9..81a616e15c 100644 --- a/pkg/util/ipam/util.go +++ b/pkg/util/ipam/util.go @@ -5,7 +5,7 @@ import ( "fmt" machinev1 "github.com/openshift/api/machine/v1beta1" - ipamv1beta1 "sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1" + ipamv1beta1 "sigs.k8s.io/cluster-api/api/ipam/v1beta1" //nolint:staticcheck corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/vendor/github.com/spf13/viper/viper.go b/vendor/github.com/spf13/viper/viper.go index f900e58b1a..a58d757bdb 100644 --- a/vendor/github.com/spf13/viper/viper.go +++ b/vendor/github.com/spf13/viper/viper.go @@ -1535,27 +1535,29 @@ func (v *Viper) MergeInConfig() error { func ReadConfig(in io.Reader) error { return v.ReadConfig(in) } func (v *Viper) ReadConfig(in io.Reader) error { - if v.configType == "" { - return errors.New("cannot decode configuration: config type is not set") + config := make(map[string]any) + + err := v.unmarshalReader(in, config) + if err != nil { + return err } - v.config = make(map[string]any) - return v.unmarshalReader(in, v.config) + v.config = config + + return nil } // MergeConfig merges a new configuration with an existing config. func MergeConfig(in io.Reader) error { return v.MergeConfig(in) } func (v *Viper) MergeConfig(in io.Reader) error { - if v.configType == "" { - return errors.New("cannot decode configuration: config type is not set") - } + config := make(map[string]any) - cfg := make(map[string]any) - if err := v.unmarshalReader(in, cfg); err != nil { + if err := v.unmarshalReader(in, config); err != nil { return err } - return v.MergeConfigMap(cfg) + + return v.MergeConfigMap(config) } // MergeConfigMap merges the configuration from the map given with an existing config. @@ -1662,15 +1664,21 @@ func (v *Viper) writeConfig(filename string, force bool) error { } func (v *Viper) unmarshalReader(in io.Reader, c map[string]any) error { + format := strings.ToLower(v.getConfigType()) + if format == "" { + return errors.New("cannot decode configuration: unable to determine config type") + } + buf := new(bytes.Buffer) buf.ReadFrom(in) - format := strings.ToLower(v.getConfigType()) - + // TODO: remove this once SupportedExts is deprecated/removed if !slices.Contains(SupportedExts, format) { return UnsupportedConfigError(format) } + // TODO: return [UnsupportedConfigError] if the registry does not contain the format + // TODO: consider deprecating this error type decoder, err := v.decoderRegistry.Decoder(format) if err != nil { return ConfigParseError{err} diff --git a/vendor/k8s.io/apimachinery/pkg/api/apitesting/close.go b/vendor/k8s.io/apimachinery/pkg/api/apitesting/close.go new file mode 100644 index 0000000000..dfb5657eb9 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/api/apitesting/close.go @@ -0,0 +1,54 @@ +/* +Copyright 2025 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 apitesting + +import ( + "io" + "testing" +) + +// Close and fail the test if it returns an error. +func Close(t TestingT, c io.Closer) { + t.Helper() + assertNoError(t, c.Close()) +} + +// CloseNoOp does nothing. Use as a replacement for Close when you +// need to disable a defer. +func CloseNoOp(TestingT, io.Closer) {} + +// TestingT simulates assert.TestingT and assert.tHelper without adding +// testify as a non-test dependency. +type TestingT interface { + Errorf(format string, args ...interface{}) + Helper() +} + +// Ensure that testing T & B satisfy the TestingT interface +var _ TestingT = &testing.T{} +var _ TestingT = &testing.B{} + +// assertNoError simulates assert.NoError without adding testify as a +// non-test dependency. +// +// In test files, use github.com/stretchr/testify/assert instead. +func assertNoError(t TestingT, err error) { + t.Helper() + if err != nil { + t.Errorf("Received unexpected error:\n%+v", err) + } +} diff --git a/vendor/k8s.io/apimachinery/pkg/api/apitesting/codec.go b/vendor/k8s.io/apimachinery/pkg/api/apitesting/codec.go new file mode 100644 index 0000000000..542b0aa275 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/api/apitesting/codec.go @@ -0,0 +1,116 @@ +/* +Copyright 2017 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 apitesting + +import ( + "fmt" + "mime" + "os" + + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" + runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" + "k8s.io/apimachinery/pkg/runtime/serializer/recognizer" +) + +var ( + testCodecMediaType string + testStorageCodecMediaType string +) + +// TestCodec returns the codec for the API version to test against, as set by the +// KUBE_TEST_API_TYPE env var. +func TestCodec(codecs runtimeserializer.CodecFactory, gvs ...schema.GroupVersion) runtime.Codec { + if len(testCodecMediaType) != 0 { + serializerInfo, ok := runtime.SerializerInfoForMediaType(codecs.SupportedMediaTypes(), testCodecMediaType) + if !ok { + panic(fmt.Sprintf("no serializer for %s", testCodecMediaType)) + } + return codecs.CodecForVersions(serializerInfo.Serializer, codecs.UniversalDeserializer(), schema.GroupVersions(gvs), nil) + } + return codecs.LegacyCodec(gvs...) +} + +// TestStorageCodec returns the codec for the API version to test against used in storage, as set by the +// KUBE_TEST_API_STORAGE_TYPE env var. +func TestStorageCodec(codecs runtimeserializer.CodecFactory, gvs ...schema.GroupVersion) runtime.Codec { + if len(testStorageCodecMediaType) != 0 { + serializerInfo, ok := runtime.SerializerInfoForMediaType(codecs.SupportedMediaTypes(), testStorageCodecMediaType) + if !ok { + panic(fmt.Sprintf("no serializer for %s", testStorageCodecMediaType)) + } + + // etcd2 only supports string data - we must wrap any result before returning + // TODO: remove for etcd3 / make parameterizable + serializer := serializerInfo.Serializer + if !serializerInfo.EncodesAsText { + serializer = runtime.NewBase64Serializer(serializer, serializer) + } + + decoder := recognizer.NewDecoder(serializer, codecs.UniversalDeserializer()) + return codecs.CodecForVersions(serializer, decoder, schema.GroupVersions(gvs), nil) + + } + return codecs.LegacyCodec(gvs...) +} + +func init() { + var err error + if apiMediaType := os.Getenv("KUBE_TEST_API_TYPE"); len(apiMediaType) > 0 { + testCodecMediaType, _, err = mime.ParseMediaType(apiMediaType) + if err != nil { + panic(err) + } + } + + if storageMediaType := os.Getenv("KUBE_TEST_API_STORAGE_TYPE"); len(storageMediaType) > 0 { + testStorageCodecMediaType, _, err = mime.ParseMediaType(storageMediaType) + if err != nil { + panic(err) + } + } +} + +// InstallOrDieFunc mirrors install functions that require success +type InstallOrDieFunc func(scheme *runtime.Scheme) + +// SchemeForInstallOrDie builds a simple test scheme and codecfactory pair for easy unit testing from higher level install methods +func SchemeForInstallOrDie(installFns ...InstallOrDieFunc) (*runtime.Scheme, runtimeserializer.CodecFactory) { + scheme := runtime.NewScheme() + codecFactory := runtimeserializer.NewCodecFactory(scheme) + for _, installFn := range installFns { + installFn(scheme) + } + + return scheme, codecFactory +} + +// InstallFunc mirrors install functions that can return an error +type InstallFunc func(scheme *runtime.Scheme) error + +// SchemeForOrDie builds a simple test scheme and codecfactory pair for easy unit testing from the bare registration methods. +func SchemeForOrDie(installFns ...InstallFunc) (*runtime.Scheme, runtimeserializer.CodecFactory) { + scheme := runtime.NewScheme() + codecFactory := runtimeserializer.NewCodecFactory(scheme) + for _, installFn := range installFns { + if err := installFn(scheme); err != nil { + panic(err) + } + } + + return scheme, codecFactory +} diff --git a/vendor/k8s.io/apimachinery/pkg/api/apitesting/fuzzer/fuzzer.go b/vendor/k8s.io/apimachinery/pkg/api/apitesting/fuzzer/fuzzer.go new file mode 100644 index 0000000000..a12370886f --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/api/apitesting/fuzzer/fuzzer.go @@ -0,0 +1,73 @@ +/* +Copyright 2017 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 fuzzer + +import ( + "encoding/json" + "fmt" + "math/rand" + + "sigs.k8s.io/randfill" + + "k8s.io/apimachinery/pkg/runtime" + runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" + kjson "k8s.io/apimachinery/pkg/util/json" +) + +// FuzzerFuncs returns a list of func(*SomeType, c randfill.Continue) functions. +type FuzzerFuncs func(codecs runtimeserializer.CodecFactory) []interface{} + +// FuzzerFor can randomly populate api objects that are destined for version. +func FuzzerFor(funcs FuzzerFuncs, src rand.Source, codecs runtimeserializer.CodecFactory) *randfill.Filler { + f := randfill.New().NilChance(.5).NumElements(0, 1) + if src != nil { + f.RandSource(src) + } + f.Funcs(funcs(codecs)...) + return f +} + +// MergeFuzzerFuncs will merge the given funcLists, overriding early funcs with later ones if there first +// argument has the same type. +func MergeFuzzerFuncs(funcs ...FuzzerFuncs) FuzzerFuncs { + return FuzzerFuncs(func(codecs runtimeserializer.CodecFactory) []interface{} { + result := []interface{}{} + for _, f := range funcs { + if f != nil { + result = append(result, f(codecs)...) + } + } + return result + }) +} + +func NormalizeJSONRawExtension(ext *runtime.RawExtension) { + if json.Valid(ext.Raw) { + // RawExtension->JSON encodes struct fields in field index order while map[string]interface{}->JSON encodes + // struct fields (i.e. keys in the map) lexicographically. We have to sort the fields here to ensure the + // JSON in the (RawExtension->)JSON->map[string]interface{}->JSON round trip results in identical JSON. + var u any + err := kjson.Unmarshal(ext.Raw, &u) + if err != nil { + panic(fmt.Sprintf("Failed to encode object: %v", err)) + } + ext.Raw, err = kjson.Marshal(&u) + if err != nil { + panic(fmt.Sprintf("Failed to encode object: %v", err)) + } + } +} diff --git a/vendor/k8s.io/apimachinery/pkg/api/apitesting/fuzzer/valuefuzz.go b/vendor/k8s.io/apimachinery/pkg/api/apitesting/fuzzer/valuefuzz.go new file mode 100644 index 0000000000..facff57bba --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/api/apitesting/fuzzer/valuefuzz.go @@ -0,0 +1,86 @@ +/* +Copyright 2017 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 fuzzer + +import ( + "reflect" +) + +// ValueFuzz recursively changes all basic type values in an object. Any kind of references will not +// be touch, i.e. the addresses of slices, maps, pointers will stay unchanged. +func ValueFuzz(obj interface{}) { + valueFuzz(reflect.ValueOf(obj)) +} + +func valueFuzz(obj reflect.Value) { + switch obj.Kind() { + case reflect.Array: + for i := 0; i < obj.Len(); i++ { + valueFuzz(obj.Index(i)) + } + case reflect.Slice: + if obj.IsNil() { + // TODO: set non-nil value + } else { + for i := 0; i < obj.Len(); i++ { + valueFuzz(obj.Index(i)) + } + } + case reflect.Interface, reflect.Pointer: + if obj.IsNil() { + // TODO: set non-nil value + } else { + valueFuzz(obj.Elem()) + } + case reflect.Struct: + for i, n := 0, obj.NumField(); i < n; i++ { + valueFuzz(obj.Field(i)) + } + case reflect.Map: + if obj.IsNil() { + // TODO: set non-nil value + } else { + for _, k := range obj.MapKeys() { + // map values are not addressable. We need a copy. + v := obj.MapIndex(k) + copy := reflect.New(v.Type()) + copy.Elem().Set(v) + valueFuzz(copy.Elem()) + obj.SetMapIndex(k, copy.Elem()) + } + // TODO: set some new value + } + case reflect.Func: // ignore, we don't have function types in our API + default: + if !obj.CanSet() { + return + } + switch obj.Kind() { + case reflect.String: + obj.SetString(obj.String() + "x") + case reflect.Bool: + obj.SetBool(!obj.Bool()) + case reflect.Float32, reflect.Float64: + obj.SetFloat(obj.Float()*2.0 + 1.0) + case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int: + obj.SetInt(obj.Int() + 1) + case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint: + obj.SetUint(obj.Uint() + 1) + default: + } + } +} diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/fuzzer/fuzzer.go b/vendor/k8s.io/apimachinery/pkg/apis/meta/fuzzer/fuzzer.go new file mode 100644 index 0000000000..c263f1450d --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/fuzzer/fuzzer.go @@ -0,0 +1,339 @@ +/* +Copyright 2017 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 fuzzer + +import ( + "fmt" + "math/rand" + "sort" + "strconv" + "strings" + + "sigs.k8s.io/randfill" + + apitesting "k8s.io/apimachinery/pkg/api/apitesting" + "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" + "k8s.io/apimachinery/pkg/api/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1beta1 "k8s.io/apimachinery/pkg/apis/meta/v1beta1" + "k8s.io/apimachinery/pkg/runtime" + runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/sets" +) + +func genericFuzzerFuncs(codecs runtimeserializer.CodecFactory) []interface{} { + return []interface{}{ + func(q *resource.Quantity, c randfill.Continue) { + *q = *resource.NewQuantity(c.Int63n(1000), resource.DecimalExponent) + }, + func(j *int, c randfill.Continue) { + *j = int(c.Int31()) + }, + func(j **int, c randfill.Continue) { + if c.Bool() { + i := int(c.Int31()) + *j = &i + } else { + *j = nil + } + }, + func(j *runtime.TypeMeta, c randfill.Continue) { + // We have to customize the randomization of TypeMetas because their + // APIVersion and Kind must remain blank in memory. + j.APIVersion = "" + j.Kind = "" + }, + func(j *runtime.Object, c randfill.Continue) { + // TODO: uncomment when round trip starts from a versioned object + if true { // c.Bool() { + *j = &runtime.Unknown{ + // We do not set TypeMeta here because it is not carried through a round trip + Raw: []byte(`{"apiVersion":"unknown.group/unknown","kind":"Something","someKey":"someValue"}`), + ContentType: runtime.ContentTypeJSON, + } + } else { + types := []runtime.Object{&metav1.Status{}, &metav1.APIGroup{}} + t := types[c.Rand.Intn(len(types))] + c.Fill(t) + *j = t + } + }, + func(r *runtime.RawExtension, c randfill.Continue) { + // Pick an arbitrary type and fuzz it + types := []runtime.Object{&metav1.Status{}, &metav1.APIGroup{}} + obj := types[c.Rand.Intn(len(types))] + c.Fill(obj) + + // Find a codec for converting the object to raw bytes. This is necessary for the + // api version and kind to be correctly set be serialization. + var codec = apitesting.TestCodec(codecs, metav1.SchemeGroupVersion) + + // Convert the object to raw bytes + bytes, err := runtime.Encode(codec, obj) + if err != nil { + panic(fmt.Sprintf("Failed to encode object: %v", err)) + } + + // strip trailing newlines which do not survive roundtrips + for len(bytes) >= 1 && bytes[len(bytes)-1] == 10 { + bytes = bytes[:len(bytes)-1] + } + + // Set the bytes field on the RawExtension + r.Raw = bytes + }, + } +} + +// taken from randfill (nee gofuzz) internals for RandString +type charRange struct { + first, last rune +} + +func (c *charRange) choose(r *rand.Rand) rune { + count := int64(c.last - c.first + 1) + ch := c.first + rune(r.Int63n(count)) + + return ch +} + +// randomLabelPart produces a valid random label value or name-part +// of a label key. +func randomLabelPart(c randfill.Continue, canBeEmpty bool) string { + validStartEnd := []charRange{{'0', '9'}, {'a', 'z'}, {'A', 'Z'}} + validMiddle := []charRange{{'0', '9'}, {'a', 'z'}, {'A', 'Z'}, + {'.', '.'}, {'-', '-'}, {'_', '_'}} + + partLen := c.Rand.Intn(64) // len is [0, 63] + if !canBeEmpty { + partLen = c.Rand.Intn(63) + 1 // len is [1, 63] + } + + runes := make([]rune, partLen) + if partLen == 0 { + return string(runes) + } + + runes[0] = validStartEnd[c.Rand.Intn(len(validStartEnd))].choose(c.Rand) + for i := range runes[1:] { + runes[i+1] = validMiddle[c.Rand.Intn(len(validMiddle))].choose(c.Rand) + } + runes[len(runes)-1] = validStartEnd[c.Rand.Intn(len(validStartEnd))].choose(c.Rand) + + return string(runes) +} + +func randomDNSLabel(c randfill.Continue) string { + validStartEnd := []charRange{{'0', '9'}, {'a', 'z'}} + validMiddle := []charRange{{'0', '9'}, {'a', 'z'}, {'-', '-'}} + + partLen := c.Rand.Intn(63) + 1 // len is [1, 63] + runes := make([]rune, partLen) + + runes[0] = validStartEnd[c.Rand.Intn(len(validStartEnd))].choose(c.Rand) + for i := range runes[1:] { + runes[i+1] = validMiddle[c.Rand.Intn(len(validMiddle))].choose(c.Rand) + } + runes[len(runes)-1] = validStartEnd[c.Rand.Intn(len(validStartEnd))].choose(c.Rand) + + return string(runes) +} + +func randomLabelKey(c randfill.Continue) string { + namePart := randomLabelPart(c, false) + prefixPart := "" + + usePrefix := c.Bool() + if usePrefix { + // we can fit, with dots, at most 3 labels in the 253 allotted characters + prefixPartsLen := c.Rand.Intn(2) + 1 + prefixParts := make([]string, prefixPartsLen) + for i := range prefixParts { + prefixParts[i] = randomDNSLabel(c) + } + prefixPart = strings.Join(prefixParts, ".") + "/" + } + + return prefixPart + namePart +} + +func v1FuzzerFuncs(codecs runtimeserializer.CodecFactory) []interface{} { + + return []interface{}{ + func(j *metav1.TypeMeta, c randfill.Continue) { + // We have to customize the randomization of TypeMetas because their + // APIVersion and Kind must remain blank in memory. + j.APIVersion = "" + j.Kind = "" + }, + func(j *metav1.ObjectMeta, c randfill.Continue) { + c.FillNoCustom(j) + + j.ResourceVersion = strconv.FormatUint(c.Uint64(), 10) + j.UID = types.UID(c.String(0)) + + // Fuzzing sec and nsec in a smaller range (uint32 instead of int64), + // so that the result Unix time is a valid date and can be parsed into RFC3339 format. + var sec, nsec uint32 + c.Fill(&sec) + c.Fill(&nsec) + j.CreationTimestamp = metav1.Unix(int64(sec), int64(nsec)).Rfc3339Copy() + + if j.DeletionTimestamp != nil { + c.Fill(&sec) + c.Fill(&nsec) + t := metav1.Unix(int64(sec), int64(nsec)).Rfc3339Copy() + j.DeletionTimestamp = &t + } + + if len(j.Labels) == 0 { + j.Labels = nil + } else { + delete(j.Labels, "") + } + if len(j.Annotations) == 0 { + j.Annotations = nil + } else { + delete(j.Annotations, "") + } + if len(j.OwnerReferences) == 0 { + j.OwnerReferences = nil + } + if len(j.Finalizers) == 0 { + j.Finalizers = nil + } + }, + func(j *metav1.ResourceVersionMatch, c randfill.Continue) { + matches := []metav1.ResourceVersionMatch{"", metav1.ResourceVersionMatchExact, metav1.ResourceVersionMatchNotOlderThan} + *j = matches[c.Rand.Intn(len(matches))] + }, + func(j *metav1.ListMeta, c randfill.Continue) { + j.ResourceVersion = strconv.FormatUint(c.Uint64(), 10) + j.SelfLink = c.String(0) //nolint:staticcheck // SA1019 backwards compatibility + }, + func(j *metav1.LabelSelector, c randfill.Continue) { + c.FillNoCustom(j) + // we can't have an entirely empty selector, so force + // use of MatchExpression if necessary + if len(j.MatchLabels) == 0 && len(j.MatchExpressions) == 0 { + j.MatchExpressions = make([]metav1.LabelSelectorRequirement, c.Rand.Intn(2)+1) + } + + if j.MatchLabels != nil { + fuzzedMatchLabels := make(map[string]string, len(j.MatchLabels)) + for i := 0; i < len(j.MatchLabels); i++ { + fuzzedMatchLabels[randomLabelKey(c)] = randomLabelPart(c, true) + } + j.MatchLabels = fuzzedMatchLabels + } + + validOperators := []metav1.LabelSelectorOperator{ + metav1.LabelSelectorOpIn, + metav1.LabelSelectorOpNotIn, + metav1.LabelSelectorOpExists, + metav1.LabelSelectorOpDoesNotExist, + } + + if j.MatchExpressions != nil { + // NB: the label selector parser code sorts match expressions by key, and + // sorts and deduplicates the values, so we need to make sure ours are + // sorted and deduplicated as well here to preserve round-trip comparison. + // In practice, not sorting doesn't hurt anything... + + for i := range j.MatchExpressions { + req := metav1.LabelSelectorRequirement{} + c.Fill(&req) + req.Key = randomLabelKey(c) + req.Operator = validOperators[c.Rand.Intn(len(validOperators))] + if req.Operator == metav1.LabelSelectorOpIn || req.Operator == metav1.LabelSelectorOpNotIn { + if len(req.Values) == 0 { + // we must have some values here, so randomly choose a short length + req.Values = make([]string, c.Rand.Intn(2)+1) + } + for i := range req.Values { + req.Values[i] = randomLabelPart(c, true) + } + req.Values = sets.List(sets.New(req.Values...)) + } else { + req.Values = nil + } + j.MatchExpressions[i] = req + } + + sort.Slice(j.MatchExpressions, func(a, b int) bool { return j.MatchExpressions[a].Key < j.MatchExpressions[b].Key }) + } + }, + func(j *metav1.ManagedFieldsEntry, c randfill.Continue) { + c.FillNoCustom(j) + j.FieldsV1 = nil + }, + } +} + +func v1beta1FuzzerFuncs(codecs runtimeserializer.CodecFactory) []interface{} { + return []interface{}{ + func(r *metav1beta1.TableOptions, c randfill.Continue) { + c.FillNoCustom(r) + // NoHeaders is not serialized to the wire but is allowed within the versioned + // type because we don't use meta internal types in the client and API server. + r.NoHeaders = false + }, + func(r *metav1beta1.TableRow, c randfill.Continue) { + c.Fill(&r.Object) + c.Fill(&r.Conditions) + if len(r.Conditions) == 0 { + r.Conditions = nil + } + n := c.Intn(10) + if n > 0 { + r.Cells = make([]interface{}, n) + } + for i := range r.Cells { + t := c.Intn(6) + switch t { + case 0: + r.Cells[i] = c.String(0) + case 1: + r.Cells[i] = c.Int63() + case 2: + r.Cells[i] = c.Bool() + case 3: + x := map[string]interface{}{} + for j := c.Intn(10) + 1; j >= 0; j-- { + x[c.String(0)] = c.String(0) + } + r.Cells[i] = x + case 4: + x := make([]interface{}, c.Intn(10)) + for i := range x { + x[i] = c.Int63() + } + r.Cells[i] = x + default: + r.Cells[i] = nil + } + } + }, + } +} + +var Funcs = fuzzer.MergeFuzzerFuncs( + genericFuzzerFuncs, + v1FuzzerFuncs, + v1beta1FuzzerFuncs, +) diff --git a/vendor/k8s.io/cluster-bootstrap/token/api/doc.go b/vendor/k8s.io/cluster-bootstrap/token/api/doc.go index 9bb5d9cdb0..c76ec9bbb3 100644 --- a/vendor/k8s.io/cluster-bootstrap/token/api/doc.go +++ b/vendor/k8s.io/cluster-bootstrap/token/api/doc.go @@ -17,4 +17,4 @@ limitations under the License. // Package api (k8s.io/cluster-bootstrap/token/api) contains constants and types needed for // bootstrap tokens as maintained by the BootstrapSigner and TokenCleaner // controllers (in k8s.io/kubernetes/pkg/controller/bootstrap) -package api // import "k8s.io/cluster-bootstrap/token/api" +package api diff --git a/vendor/modules.txt b/vendor/modules.txt index 658a9d7a5d..ef92af28ca 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1294,7 +1294,7 @@ github.com/spf13/cobra # github.com/spf13/pflag v1.0.10 ## explicit; go 1.12 github.com/spf13/pflag -# github.com/spf13/viper v1.20.0 +# github.com/spf13/viper v1.20.1 ## explicit; go 1.21.0 github.com/spf13/viper github.com/spf13/viper/internal/encoding/dotenv @@ -2197,6 +2197,8 @@ k8s.io/apiextensions-apiserver/test/integration k8s.io/apiextensions-apiserver/test/integration/fixtures # k8s.io/apimachinery v0.34.1 ## explicit; go 1.24.0 +k8s.io/apimachinery/pkg/api/apitesting +k8s.io/apimachinery/pkg/api/apitesting/fuzzer k8s.io/apimachinery/pkg/api/equality k8s.io/apimachinery/pkg/api/errors k8s.io/apimachinery/pkg/api/meta @@ -2211,6 +2213,7 @@ k8s.io/apimachinery/pkg/api/validate/content k8s.io/apimachinery/pkg/api/validation k8s.io/apimachinery/pkg/api/validation/path k8s.io/apimachinery/pkg/apis/asn1 +k8s.io/apimachinery/pkg/apis/meta/fuzzer k8s.io/apimachinery/pkg/apis/meta/internalversion k8s.io/apimachinery/pkg/apis/meta/internalversion/scheme k8s.io/apimachinery/pkg/apis/meta/internalversion/validation @@ -2838,8 +2841,8 @@ k8s.io/cloud-provider/volume/helpers # k8s.io/cloud-provider-vsphere v1.32.2 ## explicit; go 1.23.0 k8s.io/cloud-provider-vsphere/pkg/common/config -# k8s.io/cluster-bootstrap v0.32.3 -## explicit; go 1.23.0 +# k8s.io/cluster-bootstrap v0.33.3 +## explicit; go 1.24.0 k8s.io/cluster-bootstrap/token/api # k8s.io/component-base v0.34.1 ## explicit; go 1.24.0 @@ -3484,11 +3487,14 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/client/metrics sigs.k8s.io/apiserver-network-proxy/konnectivity-client/pkg/common/metrics sigs.k8s.io/apiserver-network-proxy/konnectivity-client/proto/client -# sigs.k8s.io/cluster-api v1.10.7 -## explicit; go 1.23.0 -sigs.k8s.io/cluster-api/api/v1beta1 +# sigs.k8s.io/cluster-api v1.11.3 +## explicit; go 1.24.0 +sigs.k8s.io/cluster-api/api/core/v1beta1 +sigs.k8s.io/cluster-api/api/core/v1beta2 +sigs.k8s.io/cluster-api/api/ipam/v1beta1 +sigs.k8s.io/cluster-api/api/ipam/v1beta2 sigs.k8s.io/cluster-api/errors -sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1 +sigs.k8s.io/cluster-api/util/conversion # sigs.k8s.io/controller-runtime v0.22.3 ## explicit; go 1.24.0 sigs.k8s.io/controller-runtime diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/.import-restrictions b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/.import-restrictions new file mode 100644 index 0000000000..f6f10b3ff5 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/.import-restrictions @@ -0,0 +1,5 @@ +rules: + - selectorRegexp: sigs[.]k8s[.]io/controller-runtime + allowedPrefixes: + - "sigs.k8s.io/controller-runtime/pkg/conversion" + forbiddenPrefixes: [] diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/cluster_phase_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/cluster_phase_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/cluster_phase_types.go rename to vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/cluster_phase_types.go diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/cluster_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/cluster_types.go similarity index 98% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/cluster_types.go rename to vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/cluster_types.go index be27ac6d13..c6ff0853b1 100644 --- a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/cluster_types.go +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/cluster_types.go @@ -458,8 +458,6 @@ const ( ClusterDeletingInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason ) -// 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. @@ -904,10 +902,6 @@ type MachinePoolVariables struct { Overrides []ClusterVariable `json:"overrides,omitempty"` } -// ANCHOR_END: ClusterSpec - -// ANCHOR: ClusterNetwork - // ClusterNetwork specifies the different networking // parameters for a cluster. type ClusterNetwork struct { @@ -931,10 +925,6 @@ type ClusterNetwork struct { ServiceDomain string `json:"serviceDomain,omitempty"` } -// ANCHOR_END: ClusterNetwork - -// ANCHOR: NetworkRanges - // NetworkRanges represents ranges of network addresses. type NetworkRanges struct { // cidrBlocks is a list of CIDR blocks. @@ -952,10 +942,6 @@ func (n NetworkRanges) String() string { 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. @@ -966,7 +952,7 @@ type ClusterStatus struct { // state, and will be set to a token value suitable for // programmatic interpretation. // - // Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. // // +optional FailureReason *capierrors.ClusterStatusError `json:"failureReason,omitempty"` @@ -974,7 +960,7 @@ type ClusterStatus struct { // failureMessage indicates that there is a fatal problem reconciling the // state, and will be set to a descriptive error message. // - // Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. // // +optional // +kubebuilder:validation:MinLength=1 @@ -1081,8 +1067,6 @@ type WorkersStatus struct { AvailableReplicas *int32 `json:"availableReplicas,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) @@ -1104,8 +1088,6 @@ func (c *ClusterStatus) GetTypedPhase() ClusterPhase { } } -// ANCHOR: APIEndpoint - // APIEndpoint represents a reachable Kubernetes API endpoint. type APIEndpoint struct { // host is the hostname on which the API server is serving. @@ -1134,11 +1116,9 @@ 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:deprecatedversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="ClusterClass",type="string",JSONPath=".spec.topology.class",description="ClusterClass of this Cluster, empty if the Cluster is not using a ClusterClass" // +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Cluster status such as Pending/Provisioning/Provisioned/Deleting/Failed" diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/clusterclass_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/clusterclass_types.go similarity index 99% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/clusterclass_types.go rename to vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/clusterclass_types.go index 4d62dbf724..058507504f 100644 --- a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/clusterclass_types.go +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/clusterclass_types.go @@ -66,7 +66,7 @@ const ( // +kubebuilder:object:root=true // +kubebuilder:resource:path=clusterclasses,shortName=cc,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion +// +kubebuilder:deprecatedversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of ClusterClass" @@ -889,7 +889,7 @@ type ValidationRule struct { // +optional // +kubebuilder:validation:Enum=FieldValueInvalid;FieldValueForbidden;FieldValueRequired;FieldValueDuplicate // +kubebuilder:default=FieldValueInvalid - // +default=ref(sigs.k8s.io/cluster-api/api/v1beta1.FieldValueInvalid) + // +default=ref(sigs.k8s.io/cluster-api/api/core/v1beta1.FieldValueInvalid) Reason FieldValueErrorReason `json:"reason,omitempty"` // fieldPath represents the field path returned when the validation fails. // It must be a relative JSON path (i.e. with array notation) scoped to the location of this x-kubernetes-validations extension in the schema and refer to an existing field. @@ -1136,8 +1136,6 @@ type LocalObjectTemplate struct { Ref *corev1.ObjectReference `json:"ref"` } -// ANCHOR: ClusterClassStatus - // ClusterClassStatus defines the observed state of the ClusterClass. type ClusterClassStatus struct { // variables is a list of ClusterClassStatusVariable that are defined for the ClusterClass. @@ -1245,8 +1243,6 @@ func (c *ClusterClass) SetV1Beta2Conditions(conditions []metav1.Condition) { c.Status.V1Beta2.Conditions = conditions } -// ANCHOR_END: ClusterClassStatus - // +kubebuilder:object:root=true // ClusterClassList contains a list of Cluster. diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/common_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/common_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/common_types.go rename to vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/common_types.go diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/condition_consts.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/condition_consts.go similarity index 97% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/condition_consts.go rename to vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/condition_consts.go index b2797402e8..8e36313c79 100644 --- a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/condition_consts.go +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/condition_consts.go @@ -16,8 +16,6 @@ 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. @@ -53,8 +51,6 @@ const ( WaitingForInfrastructureFallbackReason = "WaitingForInfrastructure" ) -// ANCHOR_END: CommonConditions - // Conditions and condition Reasons for the ClusterClass object. const ( // ClusterClassVariablesReconciledCondition reports if the ClusterClass variables, including both inline and external @@ -358,3 +354,14 @@ const ( // if the references are up-to-date. ClusterClassRefVersionsUpToDateInternalErrorReason = "InternalError" ) + +// Conditions and condition Reasons for the MachinePool object. + +const ( + // ReplicasReadyCondition reports an aggregate of current status of the replicas controlled by the MachinePool. + ReplicasReadyCondition ConditionType = "ReplicasReady" + + // WaitingForReplicasReadyReason (Severity=Info) documents a machinepool waiting for the required replicas + // to be ready. + WaitingForReplicasReadyReason = "WaitingForReplicasReady" +) diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/condition_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/condition_types.go similarity index 93% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/condition_types.go rename to vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/condition_types.go index d9e0f44f25..687a487fe7 100644 --- a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/condition_types.go +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/condition_types.go @@ -21,8 +21,6 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) -// ANCHOR: ConditionSeverity - // ConditionSeverity expresses the severity of a Condition Type failing. // +kubebuilder:validation:MaxLength=32 type ConditionSeverity string @@ -41,19 +39,11 @@ const ( ConditionSeverityNone ConditionSeverity = "" ) -// ANCHOR_END: ConditionSeverity - -// ANCHOR: ConditionType - // ConditionType is a valid value for Condition.Type. // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=256 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. @@ -94,11 +84,5 @@ type Condition struct { 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/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/conversion.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/conversion.go new file mode 100644 index 0000000000..03d7a7a9ad --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/conversion.go @@ -0,0 +1,2403 @@ +/* +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 ( + "errors" + "fmt" + "maps" + "reflect" + "slices" + "sort" + "unsafe" + + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + apimachineryconversion "k8s.io/apimachinery/pkg/conversion" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/utils/ptr" + "sigs.k8s.io/controller-runtime/pkg/conversion" + + clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2" + utilconversion "sigs.k8s.io/cluster-api/util/conversion" +) + +var apiVersionGetter = func(_ schema.GroupKind) (string, error) { + return "", errors.New("apiVersionGetter not set") +} + +func SetAPIVersionGetter(f func(gk schema.GroupKind) (string, error)) { + apiVersionGetter = f +} + +func (src *Cluster) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*clusterv1.Cluster) + + if err := Convert_v1beta1_Cluster_To_v1beta2_Cluster(src, dst, nil); err != nil { + return err + } + + if src.Spec.InfrastructureRef != nil { + infraRef, err := convertToContractVersionedObjectReference(src.Spec.InfrastructureRef) + if err != nil { + return err + } + dst.Spec.InfrastructureRef = infraRef + } + + if src.Spec.ControlPlaneRef != nil { + controlPlaneRef, err := convertToContractVersionedObjectReference(src.Spec.ControlPlaneRef) + if err != nil { + return err + } + dst.Spec.ControlPlaneRef = controlPlaneRef + } + + restored := &clusterv1.Cluster{} + ok, err := utilconversion.UnmarshalData(src, restored) + if err != nil { + return err + } + + // Recover intent for bool values converted to *bool. + clusterv1.Convert_bool_To_Pointer_bool(src.Spec.Paused, ok, restored.Spec.Paused, &dst.Spec.Paused) + + initialization := clusterv1.ClusterInitializationStatus{} + restoredControlPlaneInitialized := restored.Status.Initialization.ControlPlaneInitialized + restoredInfrastructureProvisioned := restored.Status.Initialization.InfrastructureProvisioned + clusterv1.Convert_bool_To_Pointer_bool(src.Status.ControlPlaneReady, ok, restoredControlPlaneInitialized, &initialization.ControlPlaneInitialized) + clusterv1.Convert_bool_To_Pointer_bool(src.Status.InfrastructureReady, ok, restoredInfrastructureProvisioned, &initialization.InfrastructureProvisioned) + if !reflect.DeepEqual(initialization, clusterv1.ClusterInitializationStatus{}) { + dst.Status.Initialization = initialization + } + return nil +} + +func (dst *Cluster) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*clusterv1.Cluster) + if err := Convert_v1beta2_Cluster_To_v1beta1_Cluster(src, dst, nil); err != nil { + return err + } + + if src.Spec.InfrastructureRef.IsDefined() { + infraRef, err := convertToObjectReference(src.Spec.InfrastructureRef, src.Namespace) + if err != nil { + return err + } + dst.Spec.InfrastructureRef = infraRef + } + + if src.Spec.ControlPlaneRef.IsDefined() { + controlPlaneRef, err := convertToObjectReference(src.Spec.ControlPlaneRef, src.Namespace) + if err != nil { + return err + } + dst.Spec.ControlPlaneRef = controlPlaneRef + } + + if dst.Spec.ClusterNetwork != nil && dst.Spec.ClusterNetwork.APIServerPort != nil && + *dst.Spec.ClusterNetwork.APIServerPort == 0 { + dst.Spec.ClusterNetwork.APIServerPort = nil + } + + if dst.Spec.Topology != nil { + if dst.Spec.Topology.ControlPlane.MachineHealthCheck != nil && dst.Spec.Topology.ControlPlane.MachineHealthCheck.RemediationTemplate != nil { + dst.Spec.Topology.ControlPlane.MachineHealthCheck.RemediationTemplate.Namespace = dst.Namespace + } + if dst.Spec.Topology.Workers != nil { + for _, md := range dst.Spec.Topology.Workers.MachineDeployments { + if md.MachineHealthCheck != nil && md.MachineHealthCheck.RemediationTemplate != nil { + md.MachineHealthCheck.RemediationTemplate.Namespace = dst.Namespace + } + } + } + } + + dropEmptyStringsCluster(dst) + + return utilconversion.MarshalData(src, dst) +} + +func (src *ClusterClass) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*clusterv1.ClusterClass) + + if err := Convert_v1beta1_ClusterClass_To_v1beta2_ClusterClass(src, dst, nil); err != nil { + return err + } + + restored := &clusterv1.ClusterClass{} + ok, err := utilconversion.UnmarshalData(src, restored) + if err != nil { + return err + } + + // Recover intent for bool values converted to *bool. + for i, patch := range dst.Spec.Patches { + for j, definition := range patch.Definitions { + var srcDefinition = &PatchDefinition{} + for _, p := range src.Spec.Patches { + if p.Name == patch.Name { + if len(p.Definitions) == len(patch.Definitions) { + srcDefinition = &p.Definitions[j] + } + break + } + } + if srcDefinition == nil { + return fmt.Errorf("definition %d for patch %s not found in source data", j, patch.Name) + } + var restoredPatchMatchControlPlane, restoredPatchMatchInfrastructureCluster *bool + for _, p := range restored.Spec.Patches { + if p.Name == patch.Name { + if len(p.Definitions) == len(patch.Definitions) { + restoredPatchMatchInfrastructureCluster = p.Definitions[j].Selector.MatchResources.InfrastructureCluster + restoredPatchMatchControlPlane = p.Definitions[j].Selector.MatchResources.ControlPlane + } + break + } + } + clusterv1.Convert_bool_To_Pointer_bool(srcDefinition.Selector.MatchResources.InfrastructureCluster, ok, restoredPatchMatchInfrastructureCluster, &definition.Selector.MatchResources.InfrastructureCluster) + clusterv1.Convert_bool_To_Pointer_bool(srcDefinition.Selector.MatchResources.ControlPlane, ok, restoredPatchMatchControlPlane, &definition.Selector.MatchResources.ControlPlane) + dst.Spec.Patches[i].Definitions[j] = definition + } + } + + for i, variable := range dst.Spec.Variables { + var srcVariable *ClusterClassVariable + for _, v := range src.Spec.Variables { + if v.Name == variable.Name { + srcVariable = &v + break + } + } + if srcVariable == nil { + return fmt.Errorf("variable %q not found in source data", variable.Name) + } + var restoredVariableOpenAPIV3Schema *clusterv1.JSONSchemaProps + for _, v := range restored.Spec.Variables { + if v.Name == variable.Name { + restoredVariableOpenAPIV3Schema = &v.Schema.OpenAPIV3Schema + break + } + } + if err := restoreBoolIntentJSONSchemaProps(&srcVariable.Schema.OpenAPIV3Schema, &variable.Schema.OpenAPIV3Schema, ok, restoredVariableOpenAPIV3Schema); err != nil { + return err + } + dst.Spec.Variables[i] = variable + } + + for i, variable := range dst.Status.Variables { + var srcVariable *ClusterClassStatusVariable + for _, v := range src.Status.Variables { + if v.Name == variable.Name { + srcVariable = &v + break + } + } + if srcVariable == nil { + return fmt.Errorf("variable %q not found in source data", variable.Name) + } + var restoredVariable *clusterv1.ClusterClassStatusVariable + var restoredVariableDefinitionsConflict *bool + for _, v := range restored.Status.Variables { + if v.Name == variable.Name { + restoredVariable = &v + restoredVariableDefinitionsConflict = v.DefinitionsConflict + break + } + } + clusterv1.Convert_bool_To_Pointer_bool(srcVariable.DefinitionsConflict, ok, restoredVariableDefinitionsConflict, &variable.DefinitionsConflict) + + for j, definition := range variable.Definitions { + var srcDefinition *ClusterClassStatusVariableDefinition + for _, d := range srcVariable.Definitions { + if d.From == definition.From { + srcDefinition = &d + } + } + if srcDefinition == nil { + return fmt.Errorf("definition %d for variable %s not found in source data", j, variable.Name) + } + var restoredVariableOpenAPIV3Schema *clusterv1.JSONSchemaProps + if restoredVariable != nil { + for _, d := range restoredVariable.Definitions { + if d.From == definition.From { + restoredVariableOpenAPIV3Schema = &d.Schema.OpenAPIV3Schema + } + } + } + if err := restoreBoolIntentJSONSchemaProps(&srcDefinition.Schema.OpenAPIV3Schema, &definition.Schema.OpenAPIV3Schema, ok, restoredVariableOpenAPIV3Schema); err != nil { + return err + } + variable.Definitions[j] = definition + } + dst.Status.Variables[i] = variable + } + + return nil +} + +func restoreBoolIntentJSONSchemaProps(src *JSONSchemaProps, dst *clusterv1.JSONSchemaProps, hasRestored bool, restored *clusterv1.JSONSchemaProps) error { + var restoredUniqueItems, restoreExclusiveMaximum, restoredExclusiveMinimum, restoreXPreserveUnknownFields, restoredXIntOrString *bool + if restored != nil { + restoredUniqueItems = restored.UniqueItems + restoreExclusiveMaximum = restored.ExclusiveMaximum + restoredExclusiveMinimum = restored.ExclusiveMinimum + restoreXPreserveUnknownFields = restored.XPreserveUnknownFields + restoredXIntOrString = restored.XIntOrString + } + clusterv1.Convert_bool_To_Pointer_bool(src.UniqueItems, hasRestored, restoredUniqueItems, &dst.UniqueItems) + clusterv1.Convert_bool_To_Pointer_bool(src.ExclusiveMaximum, hasRestored, restoreExclusiveMaximum, &dst.ExclusiveMaximum) + clusterv1.Convert_bool_To_Pointer_bool(src.ExclusiveMinimum, hasRestored, restoredExclusiveMinimum, &dst.ExclusiveMinimum) + clusterv1.Convert_bool_To_Pointer_bool(src.XPreserveUnknownFields, hasRestored, restoreXPreserveUnknownFields, &dst.XPreserveUnknownFields) + clusterv1.Convert_bool_To_Pointer_bool(src.XIntOrString, hasRestored, restoredXIntOrString, &dst.XIntOrString) + + for name, property := range dst.Properties { + srcProperty, ok := src.Properties[name] + if !ok { + return fmt.Errorf("property %s not found in source data", name) + } + var restoredPropertyOpenAPIV3Schema *clusterv1.JSONSchemaProps + if restored != nil { + if v, ok := restored.Properties[name]; ok { + restoredPropertyOpenAPIV3Schema = &v + } + } + if err := restoreBoolIntentJSONSchemaProps(&srcProperty, &property, hasRestored, restoredPropertyOpenAPIV3Schema); err != nil { + return err + } + dst.Properties[name] = property + } + if src.AdditionalProperties != nil { + var restoredAdditionalPropertiesOpenAPIV3Schema *clusterv1.JSONSchemaProps + if restored != nil { + restoredAdditionalPropertiesOpenAPIV3Schema = restored.AdditionalProperties + } + if err := restoreBoolIntentJSONSchemaProps(src.AdditionalProperties, dst.AdditionalProperties, hasRestored, restoredAdditionalPropertiesOpenAPIV3Schema); err != nil { + return err + } + } + if src.Items != nil { + var restoreItemsOpenAPIV3Schema *clusterv1.JSONSchemaProps + if restored != nil { + restoreItemsOpenAPIV3Schema = restored.Items + } + if err := restoreBoolIntentJSONSchemaProps(src.Items, dst.Items, hasRestored, restoreItemsOpenAPIV3Schema); err != nil { + return err + } + } + for i, value := range dst.AllOf { + srcValue := src.AllOf[i] + var restoredValueOpenAPIV3Schema *clusterv1.JSONSchemaProps + if restored != nil && len(src.AllOf) == len(dst.AllOf) { + restoredValueOpenAPIV3Schema = &restored.AllOf[i] + } + if err := restoreBoolIntentJSONSchemaProps(&srcValue, &value, hasRestored, restoredValueOpenAPIV3Schema); err != nil { + return err + } + dst.AllOf[i] = value + } + for i, value := range dst.OneOf { + srcValue := src.OneOf[i] + var restoredValueOpenAPIV3Schema *clusterv1.JSONSchemaProps + if restored != nil && len(src.OneOf) == len(dst.OneOf) { + restoredValueOpenAPIV3Schema = &restored.OneOf[i] + } + if err := restoreBoolIntentJSONSchemaProps(&srcValue, &value, hasRestored, restoredValueOpenAPIV3Schema); err != nil { + return err + } + dst.OneOf[i] = value + } + for i, value := range dst.AnyOf { + srcValue := src.AnyOf[i] + var restoredValueOpenAPIV3Schema *clusterv1.JSONSchemaProps + if restored != nil && len(src.AnyOf) == len(dst.AnyOf) { + restoredValueOpenAPIV3Schema = &restored.AnyOf[i] + } + if err := restoreBoolIntentJSONSchemaProps(&srcValue, &value, hasRestored, restoredValueOpenAPIV3Schema); err != nil { + return err + } + dst.AnyOf[i] = value + } + if src.Not != nil { + var restoredNotOpenAPIV3Schema *clusterv1.JSONSchemaProps + if restored != nil { + restoredNotOpenAPIV3Schema = restored.Not + } + if err := restoreBoolIntentJSONSchemaProps(src.Not, dst.Not, hasRestored, restoredNotOpenAPIV3Schema); err != nil { + return err + } + } + return nil +} + +func (dst *ClusterClass) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*clusterv1.ClusterClass) + if err := Convert_v1beta2_ClusterClass_To_v1beta1_ClusterClass(src, dst, nil); err != nil { + return err + } + + if dst.Spec.ControlPlane.MachineHealthCheck != nil && dst.Spec.ControlPlane.MachineHealthCheck.RemediationTemplate != nil { + dst.Spec.ControlPlane.MachineHealthCheck.RemediationTemplate.Namespace = dst.Namespace + } + for _, md := range dst.Spec.Workers.MachineDeployments { + if md.MachineHealthCheck != nil && md.MachineHealthCheck.RemediationTemplate != nil { + md.MachineHealthCheck.RemediationTemplate.Namespace = dst.Namespace + } + } + dropEmptyStringsClusterClass(dst) + + return utilconversion.MarshalData(src, dst) +} + +func (src *Machine) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*clusterv1.Machine) + + if err := Convert_v1beta1_Machine_To_v1beta2_Machine(src, dst, nil); err != nil { + return err + } + + if err := convertMachineSpecToContractVersionedObjectReference(&src.Spec, &dst.Spec); err != nil { + return err + } + + restored := &clusterv1.Machine{} + ok, err := utilconversion.UnmarshalData(src, restored) + if err != nil { + return err + } + + // Recover intent for bool values converted to *bool. + initialization := clusterv1.MachineInitializationStatus{} + restoredBootstrapDataSecretCreated := restored.Status.Initialization.BootstrapDataSecretCreated + restoredInfrastructureProvisioned := restored.Status.Initialization.InfrastructureProvisioned + clusterv1.Convert_bool_To_Pointer_bool(src.Status.BootstrapReady, ok, restoredBootstrapDataSecretCreated, &initialization.BootstrapDataSecretCreated) + clusterv1.Convert_bool_To_Pointer_bool(src.Status.InfrastructureReady, ok, restoredInfrastructureProvisioned, &initialization.InfrastructureProvisioned) + if !reflect.DeepEqual(initialization, clusterv1.MachineInitializationStatus{}) { + dst.Status.Initialization = initialization + } + + // Recover other values. + if ok { + dst.Spec.MinReadySeconds = restored.Spec.MinReadySeconds + } + + return nil +} + +func (dst *Machine) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*clusterv1.Machine) + + if err := Convert_v1beta2_Machine_To_v1beta1_Machine(src, dst, nil); err != nil { + return err + } + + if err := convertMachineSpecToObjectReference(&src.Spec, &dst.Spec, src.Namespace); err != nil { + return err + } + + dropEmptyStringsMachineSpec(&dst.Spec) + + return utilconversion.MarshalData(src, dst) +} + +func (src *MachineSet) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*clusterv1.MachineSet) + + if err := Convert_v1beta1_MachineSet_To_v1beta2_MachineSet(src, dst, nil); err != nil { + return err + } + + if err := convertMachineSpecToContractVersionedObjectReference(&src.Spec.Template.Spec, &dst.Spec.Template.Spec); err != nil { + return err + } + + if src.Spec.MinReadySeconds == 0 { + dst.Spec.Template.Spec.MinReadySeconds = nil + } else { + dst.Spec.Template.Spec.MinReadySeconds = &src.Spec.MinReadySeconds + } + + return nil +} + +func (dst *MachineSet) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*clusterv1.MachineSet) + + if err := Convert_v1beta2_MachineSet_To_v1beta1_MachineSet(src, dst, nil); err != nil { + return err + } + + if err := convertMachineSpecToObjectReference(&src.Spec.Template.Spec, &dst.Spec.Template.Spec, src.Namespace); err != nil { + return err + } + + dst.Spec.MinReadySeconds = ptr.Deref(src.Spec.Template.Spec.MinReadySeconds, 0) + + dropEmptyStringsMachineSpec(&dst.Spec.Template.Spec) + return nil +} + +func (src *MachineDeployment) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*clusterv1.MachineDeployment) + + if err := Convert_v1beta1_MachineDeployment_To_v1beta2_MachineDeployment(src, dst, nil); err != nil { + return err + } + + if err := convertMachineSpecToContractVersionedObjectReference(&src.Spec.Template.Spec, &dst.Spec.Template.Spec); err != nil { + return err + } + + dst.Spec.Template.Spec.MinReadySeconds = src.Spec.MinReadySeconds + + restored := &clusterv1.MachineDeployment{} + ok, err := utilconversion.UnmarshalData(src, restored) + if err != nil { + return err + } + + // Recover intent for bool values converted to *bool. + clusterv1.Convert_bool_To_Pointer_bool(src.Spec.Paused, ok, restored.Spec.Paused, &dst.Spec.Paused) + + return nil +} + +func (dst *MachineDeployment) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*clusterv1.MachineDeployment) + + if err := Convert_v1beta2_MachineDeployment_To_v1beta1_MachineDeployment(src, dst, nil); err != nil { + return err + } + + if err := convertMachineSpecToObjectReference(&src.Spec.Template.Spec, &dst.Spec.Template.Spec, src.Namespace); err != nil { + return err + } + + dst.Spec.MinReadySeconds = src.Spec.Template.Spec.MinReadySeconds + + dropEmptyStringsMachineSpec(&dst.Spec.Template.Spec) + + return utilconversion.MarshalData(src, dst) +} + +func (src *MachineHealthCheck) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*clusterv1.MachineHealthCheck) + + if err := Convert_v1beta1_MachineHealthCheck_To_v1beta2_MachineHealthCheck(src, dst, nil); err != nil { + return err + } + + // Manually restore data. + restored := &clusterv1.MachineHealthCheck{} + ok, err := utilconversion.UnmarshalData(src, restored) + if err != nil { + return err + } + + clusterv1.Convert_int32_To_Pointer_int32(src.Status.ExpectedMachines, ok, restored.Status.ExpectedMachines, &dst.Status.ExpectedMachines) + clusterv1.Convert_int32_To_Pointer_int32(src.Status.CurrentHealthy, ok, restored.Status.CurrentHealthy, &dst.Status.CurrentHealthy) + clusterv1.Convert_int32_To_Pointer_int32(src.Status.RemediationsAllowed, ok, restored.Status.RemediationsAllowed, &dst.Status.RemediationsAllowed) + + return nil +} + +func (dst *MachineHealthCheck) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*clusterv1.MachineHealthCheck) + if err := Convert_v1beta2_MachineHealthCheck_To_v1beta1_MachineHealthCheck(src, dst, nil); err != nil { + return err + } + + if dst.Spec.RemediationTemplate != nil { + dst.Spec.RemediationTemplate.Namespace = src.Namespace + } + + return utilconversion.MarshalData(src, dst) +} + +func (src *MachinePool) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*clusterv1.MachinePool) + + if err := Convert_v1beta1_MachinePool_To_v1beta2_MachinePool(src, dst, nil); err != nil { + return err + } + + if err := convertMachineSpecToContractVersionedObjectReference(&src.Spec.Template.Spec, &dst.Spec.Template.Spec); err != nil { + return err + } + + dst.Spec.Template.Spec.MinReadySeconds = src.Spec.MinReadySeconds + + restored := &clusterv1.MachinePool{} + ok, err := utilconversion.UnmarshalData(src, restored) + if err != nil { + return err + } + + // Recover intent for bool values converted to *bool. + initialization := clusterv1.MachinePoolInitializationStatus{} + restoredBootstrapDataSecretCreated := restored.Status.Initialization.BootstrapDataSecretCreated + restoredInfrastructureProvisioned := restored.Status.Initialization.InfrastructureProvisioned + clusterv1.Convert_bool_To_Pointer_bool(src.Status.BootstrapReady, ok, restoredBootstrapDataSecretCreated, &initialization.BootstrapDataSecretCreated) + clusterv1.Convert_bool_To_Pointer_bool(src.Status.InfrastructureReady, ok, restoredInfrastructureProvisioned, &initialization.InfrastructureProvisioned) + if !reflect.DeepEqual(initialization, clusterv1.MachinePoolInitializationStatus{}) { + dst.Status.Initialization = initialization + } + + return nil +} + +func (dst *MachinePool) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*clusterv1.MachinePool) + + if err := Convert_v1beta2_MachinePool_To_v1beta1_MachinePool(src, dst, nil); err != nil { + return err + } + + if err := convertMachineSpecToObjectReference(&src.Spec.Template.Spec, &dst.Spec.Template.Spec, src.Namespace); err != nil { + return err + } + + dst.Spec.MinReadySeconds = src.Spec.Template.Spec.MinReadySeconds + + dropEmptyStringsMachineSpec(&dst.Spec.Template.Spec) + + return utilconversion.MarshalData(src, dst) +} + +func (src *MachineDrainRule) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*clusterv1.MachineDrainRule) + return Convert_v1beta1_MachineDrainRule_To_v1beta2_MachineDrainRule(src, dst, nil) +} + +func (dst *MachineDrainRule) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*clusterv1.MachineDrainRule) + return Convert_v1beta2_MachineDrainRule_To_v1beta1_MachineDrainRule(src, dst, nil) +} + +func Convert_v1beta2_ClusterClass_To_v1beta1_ClusterClass(in *clusterv1.ClusterClass, out *ClusterClass, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_ClusterClass_To_v1beta1_ClusterClass(in, out, s); err != nil { + return err + } + + if out.Spec.Infrastructure.Ref != nil { + out.Spec.Infrastructure.Ref.Namespace = in.Namespace + } + if out.Spec.ControlPlane.Ref != nil { + out.Spec.ControlPlane.Ref.Namespace = in.Namespace + } + if out.Spec.ControlPlane.MachineInfrastructure != nil && out.Spec.ControlPlane.MachineInfrastructure.Ref != nil { + out.Spec.ControlPlane.MachineInfrastructure.Ref.Namespace = in.Namespace + } + for _, md := range out.Spec.Workers.MachineDeployments { + if md.Template.Bootstrap.Ref != nil { + md.Template.Bootstrap.Ref.Namespace = in.Namespace + } + if md.Template.Infrastructure.Ref != nil { + md.Template.Infrastructure.Ref.Namespace = in.Namespace + } + } + for _, mp := range out.Spec.Workers.MachinePools { + if mp.Template.Bootstrap.Ref != nil { + mp.Template.Bootstrap.Ref.Namespace = in.Namespace + } + if mp.Template.Infrastructure.Ref != nil { + mp.Template.Infrastructure.Ref.Namespace = in.Namespace + } + } + return nil +} + +func Convert_v1beta2_ClusterClassSpec_To_v1beta1_ClusterClassSpec(in *clusterv1.ClusterClassSpec, out *ClusterClassSpec, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_ClusterClassSpec_To_v1beta1_ClusterClassSpec(in, out, s); err != nil { + return err + } + + if in.Infrastructure.Naming.Template != "" { + out.InfrastructureNamingStrategy = &InfrastructureNamingStrategy{ + Template: ptr.To(in.Infrastructure.Naming.Template), + } + } + + return nil +} + +func Convert_v1beta2_InfrastructureClass_To_v1beta1_LocalObjectTemplate(in *clusterv1.InfrastructureClass, out *LocalObjectTemplate, s apimachineryconversion.Scope) error { + if in == nil { + return nil + } + + Convert_v1beta2_ClusterClassTemplateReference_To_v1beta1_LocalObjectTemplate(&in.TemplateRef, out, s) + return nil +} + +func Convert_v1beta1_ClusterClassSpec_To_v1beta2_ClusterClassSpec(in *ClusterClassSpec, out *clusterv1.ClusterClassSpec, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_ClusterClassSpec_To_v1beta2_ClusterClassSpec(in, out, s); err != nil { + return err + } + + if in.InfrastructureNamingStrategy != nil { + out.Infrastructure.Naming = clusterv1.InfrastructureClassNamingSpec{ + Template: ptr.Deref(in.InfrastructureNamingStrategy.Template, ""), + } + } + return nil +} + +func Convert_v1beta1_LocalObjectTemplate_To_v1beta2_InfrastructureClass(in *LocalObjectTemplate, out *clusterv1.InfrastructureClass, s apimachineryconversion.Scope) error { + if in == nil { + return nil + } + + convert_v1beta1_LocalObjectTemplate_To_v1beta2_ClusterClassTemplateReference(in, &out.TemplateRef, s) + return nil +} + +func Convert_v1beta1_ControlPlaneClass_To_v1beta2_ControlPlaneClass(in *ControlPlaneClass, out *clusterv1.ControlPlaneClass, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_ControlPlaneClass_To_v1beta2_ControlPlaneClass(in, out, s); err != nil { + return err + } + out.Deletion.NodeDrainTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeDrainTimeout) + out.Deletion.NodeVolumeDetachTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeVolumeDetachTimeout) + out.Deletion.NodeDeletionTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeDeletionTimeout) + convert_v1beta1_LocalObjectTemplate_To_v1beta2_ClusterClassTemplateReference(&in.LocalObjectTemplate, &out.TemplateRef, s) + + if in.MachineHealthCheck != nil { + for _, c := range in.MachineHealthCheck.UnhealthyConditions { + out.HealthCheck.Checks.UnhealthyNodeConditions = append(out.HealthCheck.Checks.UnhealthyNodeConditions, clusterv1.UnhealthyNodeCondition{ + Type: c.Type, + Status: c.Status, + TimeoutSeconds: clusterv1.ConvertToSeconds(&c.Timeout), + }) + } + out.HealthCheck.Checks.NodeStartupTimeoutSeconds = clusterv1.ConvertToSeconds(in.MachineHealthCheck.NodeStartupTimeout) + out.HealthCheck.Remediation.TriggerIf.UnhealthyLessThanOrEqualTo = in.MachineHealthCheck.MaxUnhealthy + out.HealthCheck.Remediation.TriggerIf.UnhealthyInRange = ptr.Deref(in.MachineHealthCheck.UnhealthyRange, "") + if in.MachineHealthCheck.RemediationTemplate != nil { + if err := Convert_v1_ObjectReference_To_v1beta2_MachineHealthCheckRemediationTemplateReference(in.MachineHealthCheck.RemediationTemplate, &out.HealthCheck.Remediation.TemplateRef, s); err != nil { + return err + } + } + } + if in.NamingStrategy != nil { + out.Naming = clusterv1.ControlPlaneClassNamingSpec{ + Template: ptr.Deref(in.NamingStrategy.Template, ""), + } + } + if in.MachineInfrastructure != nil { + if err := Convert_v1beta1_LocalObjectTemplate_To_v1beta2_ControlPlaneClassMachineInfrastructureTemplate(in.MachineInfrastructure, &out.MachineInfrastructure, s); err != nil { + return err + } + } + return nil +} + +func Convert_v1beta2_ControlPlaneClass_To_v1beta1_ControlPlaneClass(in *clusterv1.ControlPlaneClass, out *ControlPlaneClass, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_ControlPlaneClass_To_v1beta1_ControlPlaneClass(in, out, s); err != nil { + return err + } + out.NodeDrainTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeDrainTimeoutSeconds) + out.NodeVolumeDetachTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeVolumeDetachTimeoutSeconds) + out.NodeDeletionTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeDeletionTimeoutSeconds) + Convert_v1beta2_ClusterClassTemplateReference_To_v1beta1_LocalObjectTemplate(&in.TemplateRef, &out.LocalObjectTemplate, s) + + if !reflect.DeepEqual(in.HealthCheck, clusterv1.ControlPlaneClassHealthCheck{}) { + out.MachineHealthCheck = &MachineHealthCheckClass{} + for _, c := range in.HealthCheck.Checks.UnhealthyNodeConditions { + out.MachineHealthCheck.UnhealthyConditions = append(out.MachineHealthCheck.UnhealthyConditions, UnhealthyCondition{ + Type: c.Type, + Status: c.Status, + Timeout: ptr.Deref(clusterv1.ConvertFromSeconds(c.TimeoutSeconds), metav1.Duration{}), + }) + } + out.MachineHealthCheck.NodeStartupTimeout = clusterv1.ConvertFromSeconds(in.HealthCheck.Checks.NodeStartupTimeoutSeconds) + out.MachineHealthCheck.MaxUnhealthy = in.HealthCheck.Remediation.TriggerIf.UnhealthyLessThanOrEqualTo + if in.HealthCheck.Remediation.TriggerIf.UnhealthyInRange != "" { + out.MachineHealthCheck.UnhealthyRange = ptr.To(in.HealthCheck.Remediation.TriggerIf.UnhealthyInRange) + } + if in.HealthCheck.Remediation.TemplateRef.IsDefined() { + out.MachineHealthCheck.RemediationTemplate = &corev1.ObjectReference{} + if err := Convert_v1beta2_MachineHealthCheckRemediationTemplateReference_To_v1_ObjectReference(&in.HealthCheck.Remediation.TemplateRef, out.MachineHealthCheck.RemediationTemplate, s); err != nil { + return err + } + } + } + if in.Naming.Template != "" { + out.NamingStrategy = &ControlPlaneClassNamingStrategy{ + Template: ptr.To(in.Naming.Template), + } + } + if in.MachineInfrastructure.TemplateRef.IsDefined() { + out.MachineInfrastructure = &LocalObjectTemplate{} + if err := Convert_v1beta2_ControlPlaneClassMachineInfrastructureTemplate_To_v1beta1_LocalObjectTemplate(&in.MachineInfrastructure, out.MachineInfrastructure, s); err != nil { + return err + } + } + return nil +} + +func Convert_v1beta1_ControlPlaneTopology_To_v1beta2_ControlPlaneTopology(in *ControlPlaneTopology, out *clusterv1.ControlPlaneTopology, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_ControlPlaneTopology_To_v1beta2_ControlPlaneTopology(in, out, s); err != nil { + return err + } + if in.Variables != nil { + if err := autoConvert_v1beta1_ControlPlaneVariables_To_v1beta2_ControlPlaneVariables(in.Variables, &out.Variables, s); err != nil { + return err + } + } + out.Deletion.NodeDrainTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeDrainTimeout) + out.Deletion.NodeVolumeDetachTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeVolumeDetachTimeout) + out.Deletion.NodeDeletionTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeDeletionTimeout) + + if in.MachineHealthCheck != nil { + out.HealthCheck.Enabled = in.MachineHealthCheck.Enable + for _, c := range in.MachineHealthCheck.UnhealthyConditions { + out.HealthCheck.Checks.UnhealthyNodeConditions = append(out.HealthCheck.Checks.UnhealthyNodeConditions, clusterv1.UnhealthyNodeCondition{ + Type: c.Type, + Status: c.Status, + TimeoutSeconds: clusterv1.ConvertToSeconds(&c.Timeout), + }) + } + out.HealthCheck.Checks.NodeStartupTimeoutSeconds = clusterv1.ConvertToSeconds(in.MachineHealthCheck.NodeStartupTimeout) + out.HealthCheck.Remediation.TriggerIf.UnhealthyLessThanOrEqualTo = in.MachineHealthCheck.MaxUnhealthy + out.HealthCheck.Remediation.TriggerIf.UnhealthyInRange = ptr.Deref(in.MachineHealthCheck.UnhealthyRange, "") + if in.MachineHealthCheck.RemediationTemplate != nil { + if err := Convert_v1_ObjectReference_To_v1beta2_MachineHealthCheckRemediationTemplateReference(in.MachineHealthCheck.RemediationTemplate, &out.HealthCheck.Remediation.TemplateRef, s); err != nil { + return err + } + } + } + return nil +} + +func Convert_v1beta2_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(in *clusterv1.ControlPlaneTopology, out *ControlPlaneTopology, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(in, out, s); err != nil { + return err + } + if !reflect.DeepEqual(in.Variables, clusterv1.ControlPlaneVariables{}) { + out.Variables = &ControlPlaneVariables{} + if err := autoConvert_v1beta2_ControlPlaneVariables_To_v1beta1_ControlPlaneVariables(&in.Variables, out.Variables, s); err != nil { + return err + } + } + out.NodeDrainTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeDrainTimeoutSeconds) + out.NodeVolumeDetachTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeVolumeDetachTimeoutSeconds) + out.NodeDeletionTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeDeletionTimeoutSeconds) + + if !reflect.DeepEqual(in.HealthCheck, clusterv1.ControlPlaneTopologyHealthCheck{}) { + out.MachineHealthCheck = &MachineHealthCheckTopology{} + out.MachineHealthCheck.Enable = in.HealthCheck.Enabled + for _, c := range in.HealthCheck.Checks.UnhealthyNodeConditions { + out.MachineHealthCheck.UnhealthyConditions = append(out.MachineHealthCheck.UnhealthyConditions, UnhealthyCondition{ + Type: c.Type, + Status: c.Status, + Timeout: ptr.Deref(clusterv1.ConvertFromSeconds(c.TimeoutSeconds), metav1.Duration{}), + }) + } + out.MachineHealthCheck.NodeStartupTimeout = clusterv1.ConvertFromSeconds(in.HealthCheck.Checks.NodeStartupTimeoutSeconds) + out.MachineHealthCheck.MaxUnhealthy = in.HealthCheck.Remediation.TriggerIf.UnhealthyLessThanOrEqualTo + if in.HealthCheck.Remediation.TriggerIf.UnhealthyInRange != "" { + out.MachineHealthCheck.UnhealthyRange = ptr.To(in.HealthCheck.Remediation.TriggerIf.UnhealthyInRange) + } + if in.HealthCheck.Remediation.TemplateRef.IsDefined() { + out.MachineHealthCheck.RemediationTemplate = &corev1.ObjectReference{} + if err := Convert_v1beta2_MachineHealthCheckRemediationTemplateReference_To_v1_ObjectReference(&in.HealthCheck.Remediation.TemplateRef, out.MachineHealthCheck.RemediationTemplate, s); err != nil { + return err + } + } + } + return nil +} + +func Convert_v1beta1_MachineDeploymentClass_To_v1beta2_MachineDeploymentClass(in *MachineDeploymentClass, out *clusterv1.MachineDeploymentClass, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_MachineDeploymentClass_To_v1beta2_MachineDeploymentClass(in, out, s); err != nil { + return err + } + if err := Convert_v1beta1_ObjectMeta_To_v1beta2_ObjectMeta(&in.Template.Metadata, &out.Metadata, s); err != nil { + return err + } + if err := Convert_v1beta1_LocalObjectTemplate_To_v1beta2_MachineDeploymentClassBootstrapTemplate(&in.Template.Bootstrap, &out.Bootstrap, s); err != nil { + return err + } + if err := Convert_v1beta1_LocalObjectTemplate_To_v1beta2_MachineDeploymentClassInfrastructureTemplate(&in.Template.Infrastructure, &out.Infrastructure, s); err != nil { + return err + } + if in.Strategy != nil { + out.Rollout.Strategy.Type = clusterv1.MachineDeploymentRolloutStrategyType(in.Strategy.Type) + if in.Strategy.RollingUpdate != nil { + out.Rollout.Strategy.RollingUpdate.MaxUnavailable = in.Strategy.RollingUpdate.MaxUnavailable + out.Rollout.Strategy.RollingUpdate.MaxSurge = in.Strategy.RollingUpdate.MaxSurge + if in.Strategy.RollingUpdate.DeletePolicy != nil { + out.Deletion.Order = clusterv1.MachineSetDeletionOrder(*in.Strategy.RollingUpdate.DeletePolicy) + } + } + if in.Strategy.Remediation != nil && in.Strategy.Remediation.MaxInFlight != nil { + out.HealthCheck.Remediation.MaxInFlight = in.Strategy.Remediation.MaxInFlight + } + } + out.Deletion.NodeDrainTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeDrainTimeout) + out.Deletion.NodeVolumeDetachTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeVolumeDetachTimeout) + out.Deletion.NodeDeletionTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeDeletionTimeout) + + if in.MachineHealthCheck != nil { + for _, c := range in.MachineHealthCheck.UnhealthyConditions { + out.HealthCheck.Checks.UnhealthyNodeConditions = append(out.HealthCheck.Checks.UnhealthyNodeConditions, clusterv1.UnhealthyNodeCondition{ + Type: c.Type, + Status: c.Status, + TimeoutSeconds: clusterv1.ConvertToSeconds(&c.Timeout), + }) + } + out.HealthCheck.Checks.NodeStartupTimeoutSeconds = clusterv1.ConvertToSeconds(in.MachineHealthCheck.NodeStartupTimeout) + out.HealthCheck.Remediation.TriggerIf.UnhealthyLessThanOrEqualTo = in.MachineHealthCheck.MaxUnhealthy + out.HealthCheck.Remediation.TriggerIf.UnhealthyInRange = ptr.Deref(in.MachineHealthCheck.UnhealthyRange, "") + if in.MachineHealthCheck.RemediationTemplate != nil { + if err := Convert_v1_ObjectReference_To_v1beta2_MachineHealthCheckRemediationTemplateReference(in.MachineHealthCheck.RemediationTemplate, &out.HealthCheck.Remediation.TemplateRef, s); err != nil { + return err + } + } + } + if in.NamingStrategy != nil { + out.Naming = clusterv1.MachineDeploymentClassNamingSpec{ + Template: ptr.Deref(in.NamingStrategy.Template, ""), + } + } + return nil +} + +func Convert_v1beta2_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(in *clusterv1.MachineDeploymentClass, out *MachineDeploymentClass, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(in, out, s); err != nil { + return err + } + if err := Convert_v1beta2_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Template.Metadata, s); err != nil { + return err + } + if err := Convert_v1beta2_MachineDeploymentClassBootstrapTemplate_To_v1beta1_LocalObjectTemplate(&in.Bootstrap, &out.Template.Bootstrap, s); err != nil { + return err + } + if err := Convert_v1beta2_MachineDeploymentClassInfrastructureTemplate_To_v1beta1_LocalObjectTemplate(&in.Infrastructure, &out.Template.Infrastructure, s); err != nil { + return err + } + if !reflect.DeepEqual(in.Rollout.Strategy, clusterv1.MachineDeploymentClassRolloutStrategy{}) { + out.Strategy = &MachineDeploymentStrategy{} + out.Strategy.Type = MachineDeploymentStrategyType(in.Rollout.Strategy.Type) + if !reflect.DeepEqual(in.Rollout.Strategy.RollingUpdate, clusterv1.MachineDeploymentClassRolloutStrategyRollingUpdate{}) { + out.Strategy.RollingUpdate = &MachineRollingUpdateDeployment{} + out.Strategy.RollingUpdate.MaxUnavailable = in.Rollout.Strategy.RollingUpdate.MaxUnavailable + out.Strategy.RollingUpdate.MaxSurge = in.Rollout.Strategy.RollingUpdate.MaxSurge + } + } + if in.Deletion.Order != "" { + if out.Strategy == nil { + out.Strategy = &MachineDeploymentStrategy{} + } + if out.Strategy.RollingUpdate == nil { + out.Strategy.RollingUpdate = &MachineRollingUpdateDeployment{} + } + out.Strategy.RollingUpdate.DeletePolicy = ptr.To(string(in.Deletion.Order)) + } + if in.HealthCheck.Remediation.MaxInFlight != nil { + if out.Strategy == nil { + out.Strategy = &MachineDeploymentStrategy{} + } + if out.Strategy.Remediation == nil { + out.Strategy.Remediation = &RemediationStrategy{} + } + out.Strategy.Remediation.MaxInFlight = in.HealthCheck.Remediation.MaxInFlight + } + out.NodeDrainTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeDrainTimeoutSeconds) + out.NodeVolumeDetachTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeVolumeDetachTimeoutSeconds) + out.NodeDeletionTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeDeletionTimeoutSeconds) + + // Check if HealthCheck is not nil and another field apart from MaxInFlight is set (MaxInFlight is set in Strategy above). + if !reflect.DeepEqual(in.HealthCheck, clusterv1.MachineDeploymentClassHealthCheck{ + Remediation: clusterv1.MachineDeploymentClassHealthCheckRemediation{MaxInFlight: in.HealthCheck.Remediation.MaxInFlight}, + }) { + out.MachineHealthCheck = &MachineHealthCheckClass{} + for _, c := range in.HealthCheck.Checks.UnhealthyNodeConditions { + out.MachineHealthCheck.UnhealthyConditions = append(out.MachineHealthCheck.UnhealthyConditions, UnhealthyCondition{ + Type: c.Type, + Status: c.Status, + Timeout: ptr.Deref(clusterv1.ConvertFromSeconds(c.TimeoutSeconds), metav1.Duration{}), + }) + } + out.MachineHealthCheck.NodeStartupTimeout = clusterv1.ConvertFromSeconds(in.HealthCheck.Checks.NodeStartupTimeoutSeconds) + out.MachineHealthCheck.MaxUnhealthy = in.HealthCheck.Remediation.TriggerIf.UnhealthyLessThanOrEqualTo + if in.HealthCheck.Remediation.TriggerIf.UnhealthyInRange != "" { + out.MachineHealthCheck.UnhealthyRange = ptr.To(in.HealthCheck.Remediation.TriggerIf.UnhealthyInRange) + } + if in.HealthCheck.Remediation.TemplateRef.IsDefined() { + out.MachineHealthCheck.RemediationTemplate = &corev1.ObjectReference{} + if err := Convert_v1beta2_MachineHealthCheckRemediationTemplateReference_To_v1_ObjectReference(&in.HealthCheck.Remediation.TemplateRef, out.MachineHealthCheck.RemediationTemplate, s); err != nil { + return err + } + } + } + if in.Naming.Template != "" { + out.NamingStrategy = &MachineDeploymentClassNamingStrategy{ + Template: ptr.To(in.Naming.Template), + } + } + return nil +} + +func Convert_v1beta1_MachineDeploymentTopology_To_v1beta2_MachineDeploymentTopology(in *MachineDeploymentTopology, out *clusterv1.MachineDeploymentTopology, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_MachineDeploymentTopology_To_v1beta2_MachineDeploymentTopology(in, out, s); err != nil { + return err + } + if in.Variables != nil { + if err := autoConvert_v1beta1_MachineDeploymentVariables_To_v1beta2_MachineDeploymentVariables(in.Variables, &out.Variables, s); err != nil { + return err + } + } + if in.Strategy != nil { + out.Rollout.Strategy.Type = clusterv1.MachineDeploymentRolloutStrategyType(in.Strategy.Type) + if in.Strategy.RollingUpdate != nil { + out.Rollout.Strategy.RollingUpdate.MaxUnavailable = in.Strategy.RollingUpdate.MaxUnavailable + out.Rollout.Strategy.RollingUpdate.MaxSurge = in.Strategy.RollingUpdate.MaxSurge + if in.Strategy.RollingUpdate.DeletePolicy != nil { + out.Deletion.Order = clusterv1.MachineSetDeletionOrder(*in.Strategy.RollingUpdate.DeletePolicy) + } + } + if in.Strategy.Remediation != nil && in.Strategy.Remediation.MaxInFlight != nil { + out.HealthCheck.Remediation.MaxInFlight = in.Strategy.Remediation.MaxInFlight + } + } + out.Deletion.NodeDrainTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeDrainTimeout) + out.Deletion.NodeVolumeDetachTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeVolumeDetachTimeout) + out.Deletion.NodeDeletionTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeDeletionTimeout) + + if in.MachineHealthCheck != nil { + out.HealthCheck.Enabled = in.MachineHealthCheck.Enable + for _, c := range in.MachineHealthCheck.UnhealthyConditions { + out.HealthCheck.Checks.UnhealthyNodeConditions = append(out.HealthCheck.Checks.UnhealthyNodeConditions, clusterv1.UnhealthyNodeCondition{ + Type: c.Type, + Status: c.Status, + TimeoutSeconds: clusterv1.ConvertToSeconds(&c.Timeout), + }) + } + out.HealthCheck.Checks.NodeStartupTimeoutSeconds = clusterv1.ConvertToSeconds(in.MachineHealthCheck.NodeStartupTimeout) + out.HealthCheck.Remediation.TriggerIf.UnhealthyLessThanOrEqualTo = in.MachineHealthCheck.MaxUnhealthy + out.HealthCheck.Remediation.TriggerIf.UnhealthyInRange = ptr.Deref(in.MachineHealthCheck.UnhealthyRange, "") + if in.MachineHealthCheck.RemediationTemplate != nil { + if err := Convert_v1_ObjectReference_To_v1beta2_MachineHealthCheckRemediationTemplateReference(in.MachineHealthCheck.RemediationTemplate, &out.HealthCheck.Remediation.TemplateRef, s); err != nil { + return err + } + } + } + return nil +} + +func Convert_v1beta2_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(in *clusterv1.MachineDeploymentTopology, out *MachineDeploymentTopology, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(in, out, s); err != nil { + return err + } + if !reflect.DeepEqual(in.Variables, clusterv1.MachineDeploymentVariables{}) { + out.Variables = &MachineDeploymentVariables{} + if err := autoConvert_v1beta2_MachineDeploymentVariables_To_v1beta1_MachineDeploymentVariables(&in.Variables, out.Variables, s); err != nil { + return err + } + } + if !reflect.DeepEqual(in.Rollout.Strategy, clusterv1.MachineDeploymentTopologyRolloutStrategy{}) { + out.Strategy = &MachineDeploymentStrategy{} + out.Strategy.Type = MachineDeploymentStrategyType(in.Rollout.Strategy.Type) + if !reflect.DeepEqual(in.Rollout.Strategy.RollingUpdate, clusterv1.MachineDeploymentTopologyRolloutStrategyRollingUpdate{}) { + out.Strategy.RollingUpdate = &MachineRollingUpdateDeployment{} + out.Strategy.RollingUpdate.MaxUnavailable = in.Rollout.Strategy.RollingUpdate.MaxUnavailable + out.Strategy.RollingUpdate.MaxSurge = in.Rollout.Strategy.RollingUpdate.MaxSurge + } + } + if in.Deletion.Order != "" { + if out.Strategy == nil { + out.Strategy = &MachineDeploymentStrategy{} + } + if out.Strategy.RollingUpdate == nil { + out.Strategy.RollingUpdate = &MachineRollingUpdateDeployment{} + } + out.Strategy.RollingUpdate.DeletePolicy = ptr.To(string(in.Deletion.Order)) + } + if in.HealthCheck.Remediation.MaxInFlight != nil { + if out.Strategy == nil { + out.Strategy = &MachineDeploymentStrategy{} + } + if out.Strategy.Remediation == nil { + out.Strategy.Remediation = &RemediationStrategy{} + } + out.Strategy.Remediation.MaxInFlight = in.HealthCheck.Remediation.MaxInFlight + } + out.NodeDrainTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeDrainTimeoutSeconds) + out.NodeVolumeDetachTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeVolumeDetachTimeoutSeconds) + out.NodeDeletionTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeDeletionTimeoutSeconds) + + // Check if HealthCheck is not nil and another field apart from MaxInFlight is set (MaxInFlight is set in Strategy above). + if !reflect.DeepEqual(in.HealthCheck, clusterv1.MachineDeploymentTopologyHealthCheck{ + Remediation: clusterv1.MachineDeploymentTopologyHealthCheckRemediation{MaxInFlight: in.HealthCheck.Remediation.MaxInFlight}, + }) { + out.MachineHealthCheck = &MachineHealthCheckTopology{} + out.MachineHealthCheck.Enable = in.HealthCheck.Enabled + for _, c := range in.HealthCheck.Checks.UnhealthyNodeConditions { + out.MachineHealthCheck.UnhealthyConditions = append(out.MachineHealthCheck.UnhealthyConditions, UnhealthyCondition{ + Type: c.Type, + Status: c.Status, + Timeout: ptr.Deref(clusterv1.ConvertFromSeconds(c.TimeoutSeconds), metav1.Duration{}), + }) + } + out.MachineHealthCheck.NodeStartupTimeout = clusterv1.ConvertFromSeconds(in.HealthCheck.Checks.NodeStartupTimeoutSeconds) + out.MachineHealthCheck.MaxUnhealthy = in.HealthCheck.Remediation.TriggerIf.UnhealthyLessThanOrEqualTo + if in.HealthCheck.Remediation.TriggerIf.UnhealthyInRange != "" { + out.MachineHealthCheck.UnhealthyRange = ptr.To(in.HealthCheck.Remediation.TriggerIf.UnhealthyInRange) + } + if in.HealthCheck.Remediation.TemplateRef.IsDefined() { + out.MachineHealthCheck.RemediationTemplate = &corev1.ObjectReference{} + if err := Convert_v1beta2_MachineHealthCheckRemediationTemplateReference_To_v1_ObjectReference(&in.HealthCheck.Remediation.TemplateRef, out.MachineHealthCheck.RemediationTemplate, s); err != nil { + return err + } + } + } + return nil +} + +func Convert_v1beta1_MachinePoolClass_To_v1beta2_MachinePoolClass(in *MachinePoolClass, out *clusterv1.MachinePoolClass, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_MachinePoolClass_To_v1beta2_MachinePoolClass(in, out, s); err != nil { + return err + } + if err := Convert_v1beta1_ObjectMeta_To_v1beta2_ObjectMeta(&in.Template.Metadata, &out.Metadata, s); err != nil { + return err + } + if err := Convert_v1beta1_LocalObjectTemplate_To_v1beta2_MachinePoolClassBootstrapTemplate(&in.Template.Bootstrap, &out.Bootstrap, s); err != nil { + return err + } + if err := Convert_v1beta1_LocalObjectTemplate_To_v1beta2_MachinePoolClassInfrastructureTemplate(&in.Template.Infrastructure, &out.Infrastructure, s); err != nil { + return err + } + out.Deletion.NodeDrainTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeDrainTimeout) + out.Deletion.NodeVolumeDetachTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeVolumeDetachTimeout) + out.Deletion.NodeDeletionTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeDeletionTimeout) + if in.NamingStrategy != nil { + out.Naming = clusterv1.MachinePoolClassNamingSpec{ + Template: ptr.Deref(in.NamingStrategy.Template, ""), + } + } + return nil +} + +func Convert_v1beta2_MachinePoolClass_To_v1beta1_MachinePoolClass(in *clusterv1.MachinePoolClass, out *MachinePoolClass, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_MachinePoolClass_To_v1beta1_MachinePoolClass(in, out, s); err != nil { + return err + } + if err := Convert_v1beta2_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Template.Metadata, s); err != nil { + return err + } + if err := Convert_v1beta2_MachinePoolClassBootstrapTemplate_To_v1beta1_LocalObjectTemplate(&in.Bootstrap, &out.Template.Bootstrap, s); err != nil { + return err + } + if err := Convert_v1beta2_MachinePoolClassInfrastructureTemplate_To_v1beta1_LocalObjectTemplate(&in.Infrastructure, &out.Template.Infrastructure, s); err != nil { + return err + } + out.NodeDrainTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeDrainTimeoutSeconds) + out.NodeVolumeDetachTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeVolumeDetachTimeoutSeconds) + out.NodeDeletionTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeDeletionTimeoutSeconds) + if in.Naming.Template != "" { + out.NamingStrategy = &MachinePoolClassNamingStrategy{ + Template: ptr.To(in.Naming.Template), + } + } + return nil +} + +func Convert_v1beta1_MachinePoolTopology_To_v1beta2_MachinePoolTopology(in *MachinePoolTopology, out *clusterv1.MachinePoolTopology, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_MachinePoolTopology_To_v1beta2_MachinePoolTopology(in, out, s); err != nil { + return err + } + if in.Variables != nil { + if err := autoConvert_v1beta1_MachinePoolVariables_To_v1beta2_MachinePoolVariables(in.Variables, &out.Variables, s); err != nil { + return err + } + } + out.Deletion.NodeDrainTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeDrainTimeout) + out.Deletion.NodeVolumeDetachTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeVolumeDetachTimeout) + out.Deletion.NodeDeletionTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeDeletionTimeout) + return nil +} + +func Convert_v1beta2_MachinePoolTopology_To_v1beta1_MachinePoolTopology(in *clusterv1.MachinePoolTopology, out *MachinePoolTopology, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_MachinePoolTopology_To_v1beta1_MachinePoolTopology(in, out, s); err != nil { + return err + } + if !reflect.DeepEqual(in.Variables, clusterv1.MachinePoolVariables{}) { + out.Variables = &MachinePoolVariables{} + if err := autoConvert_v1beta2_MachinePoolVariables_To_v1beta1_MachinePoolVariables(&in.Variables, out.Variables, s); err != nil { + return err + } + } + out.NodeDrainTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeDrainTimeoutSeconds) + out.NodeVolumeDetachTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeVolumeDetachTimeoutSeconds) + out.NodeDeletionTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeDeletionTimeoutSeconds) + return nil +} + +func Convert_v1beta1_MachineSpec_To_v1beta2_MachineSpec(in *MachineSpec, out *clusterv1.MachineSpec, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_MachineSpec_To_v1beta2_MachineSpec(in, out, s); err != nil { + return err + } + out.Deletion.NodeDrainTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeDrainTimeout) + out.Deletion.NodeVolumeDetachTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeVolumeDetachTimeout) + out.Deletion.NodeDeletionTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeDeletionTimeout) + return nil +} + +func Convert_v1beta2_ClusterClassStatus_To_v1beta1_ClusterClassStatus(in *clusterv1.ClusterClassStatus, out *ClusterClassStatus, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_ClusterClassStatus_To_v1beta1_ClusterClassStatus(in, out, s); err != nil { + return err + } + + // Reset conditions from autogenerated conversions + // NOTE: v1beta2 conditions should not be automatically be converted into legacy conditions (v1beta1). + out.Conditions = nil + + // Retrieve legacy conditions (v1beta1) from the deprecated field. + if in.Deprecated != nil && in.Deprecated.V1Beta1 != nil { + if in.Deprecated.V1Beta1.Conditions != nil { + Convert_v1beta2_Deprecated_V1Beta1_Conditions_To_v1beta1_Conditions(&in.Deprecated.V1Beta1.Conditions, &out.Conditions) + } + } + + // Move new conditions (v1beta2) to the v1beta2 field. + if in.Conditions == nil { + return nil + } + out.V1Beta2 = &ClusterClassV1Beta2Status{} + out.V1Beta2.Conditions = in.Conditions + return nil +} + +func Convert_v1beta1_ClusterClassStatus_To_v1beta2_ClusterClassStatus(in *ClusterClassStatus, out *clusterv1.ClusterClassStatus, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_ClusterClassStatus_To_v1beta2_ClusterClassStatus(in, out, s); err != nil { + return err + } + + // Reset conditions from autogenerated conversions + // NOTE: v1beta1 conditions should not be automatically be converted into v1beta2 conditions. + out.Conditions = nil + + // Retrieve new conditions (v1beta2) from the v1beta2 field. + if in.V1Beta2 != nil { + out.Conditions = in.V1Beta2.Conditions + } + + // Move legacy conditions (v1beta1) to the deprecated field. + if in.Conditions == nil { + return nil + } + + if out.Deprecated == nil { + out.Deprecated = &clusterv1.ClusterClassDeprecatedStatus{} + } + if out.Deprecated.V1Beta1 == nil { + out.Deprecated.V1Beta1 = &clusterv1.ClusterClassV1Beta1DeprecatedStatus{} + } + if in.Conditions != nil { + Convert_v1beta1_Conditions_To_v1beta2_Deprecated_V1Beta1_Conditions(&in.Conditions, &out.Deprecated.V1Beta1.Conditions) + } + return nil +} + +func Convert_v1beta2_ClusterStatus_To_v1beta1_ClusterStatus(in *clusterv1.ClusterStatus, out *ClusterStatus, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_ClusterStatus_To_v1beta1_ClusterStatus(in, out, s); err != nil { + return err + } + + // Reset conditions from autogenerated conversions + // NOTE: v1beta2 conditions should not be automatically be converted into legacy conditions (v1beta1). + out.Conditions = nil + + // Retrieve legacy conditions (v1beta1) from the deprecated field. + if in.Deprecated != nil && in.Deprecated.V1Beta1 != nil { + if in.Deprecated.V1Beta1.Conditions != nil { + Convert_v1beta2_Deprecated_V1Beta1_Conditions_To_v1beta1_Conditions(&in.Deprecated.V1Beta1.Conditions, &out.Conditions) + } + out.FailureReason = in.Deprecated.V1Beta1.FailureReason + out.FailureMessage = in.Deprecated.V1Beta1.FailureMessage + } + + // Move initialization to old fields + out.ControlPlaneReady = ptr.Deref(in.Initialization.ControlPlaneInitialized, false) + out.InfrastructureReady = ptr.Deref(in.Initialization.InfrastructureProvisioned, false) + + // Move FailureDomains + if in.FailureDomains != nil { + out.FailureDomains = FailureDomains{} + for _, fd := range in.FailureDomains { + out.FailureDomains[fd.Name] = FailureDomainSpec{ + ControlPlane: ptr.Deref(fd.ControlPlane, false), + Attributes: fd.Attributes, + } + } + } + + // Move new conditions (v1beta2), controlPlane and workers counters to the v1beta2 field. + if in.Conditions == nil && in.ControlPlane == nil && in.Workers == nil { + return nil + } + out.V1Beta2 = &ClusterV1Beta2Status{} + out.V1Beta2.Conditions = in.Conditions + if in.ControlPlane != nil { + out.V1Beta2.ControlPlane = &ClusterControlPlaneStatus{ + DesiredReplicas: in.ControlPlane.DesiredReplicas, + Replicas: in.ControlPlane.Replicas, + UpToDateReplicas: in.ControlPlane.UpToDateReplicas, + ReadyReplicas: in.ControlPlane.ReadyReplicas, + AvailableReplicas: in.ControlPlane.AvailableReplicas, + } + } + if in.Workers != nil { + out.V1Beta2.Workers = &WorkersStatus{ + DesiredReplicas: in.Workers.DesiredReplicas, + Replicas: in.Workers.Replicas, + UpToDateReplicas: in.Workers.UpToDateReplicas, + ReadyReplicas: in.Workers.ReadyReplicas, + AvailableReplicas: in.Workers.AvailableReplicas, + } + } + return nil +} + +func Convert_v1beta1_Topology_To_v1beta2_Topology(in *Topology, out *clusterv1.Topology, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_Topology_To_v1beta2_Topology(in, out, s); err != nil { + return err + } + if in.Workers != nil { + if err := autoConvert_v1beta1_WorkersTopology_To_v1beta2_WorkersTopology(in.Workers, &out.Workers, s); err != nil { + return err + } + } + out.ClassRef.Name = in.Class + out.ClassRef.Namespace = in.ClassNamespace + return nil +} + +func Convert_v1beta1_ClusterStatus_To_v1beta2_ClusterStatus(in *ClusterStatus, out *clusterv1.ClusterStatus, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_ClusterStatus_To_v1beta2_ClusterStatus(in, out, s); err != nil { + return err + } + + // Reset conditions from autogenerated conversions + // NOTE: v1beta1 conditions should not be automatically be converted into v1beta2 conditions. + out.Conditions = nil + + // Retrieve new conditions (v1beta2), controlPlane and workers counters from the v1beta2 field. + if in.V1Beta2 != nil { + out.Conditions = in.V1Beta2.Conditions + if in.V1Beta2.ControlPlane != nil { + out.ControlPlane = &clusterv1.ClusterControlPlaneStatus{ + DesiredReplicas: in.V1Beta2.ControlPlane.DesiredReplicas, + Replicas: in.V1Beta2.ControlPlane.Replicas, + UpToDateReplicas: in.V1Beta2.ControlPlane.UpToDateReplicas, + ReadyReplicas: in.V1Beta2.ControlPlane.ReadyReplicas, + AvailableReplicas: in.V1Beta2.ControlPlane.AvailableReplicas, + } + } + if in.V1Beta2.Workers != nil { + out.Workers = &clusterv1.WorkersStatus{ + DesiredReplicas: in.V1Beta2.Workers.DesiredReplicas, + Replicas: in.V1Beta2.Workers.Replicas, + UpToDateReplicas: in.V1Beta2.Workers.UpToDateReplicas, + ReadyReplicas: in.V1Beta2.Workers.ReadyReplicas, + AvailableReplicas: in.V1Beta2.Workers.AvailableReplicas, + } + } + } + + // Move ControlPlaneReady and InfrastructureReady to Initialization is implemented in ConvertTo. + + // Move FailureDomains + if in.FailureDomains != nil { + out.FailureDomains = []clusterv1.FailureDomain{} + domainNames := slices.Collect(maps.Keys(in.FailureDomains)) + sort.Strings(domainNames) + for _, name := range domainNames { + fd := in.FailureDomains[name] + out.FailureDomains = append(out.FailureDomains, clusterv1.FailureDomain{ + Name: name, + ControlPlane: ptr.To(fd.ControlPlane), + Attributes: fd.Attributes, + }) + } + } + + // Move legacy conditions (v1beta1), FailureReason and FailureMessage to the deprecated field. + if in.Conditions == nil && in.FailureReason == nil && in.FailureMessage == nil { + return nil + } + + if out.Deprecated == nil { + out.Deprecated = &clusterv1.ClusterDeprecatedStatus{} + } + if out.Deprecated.V1Beta1 == nil { + out.Deprecated.V1Beta1 = &clusterv1.ClusterV1Beta1DeprecatedStatus{} + } + if in.Conditions != nil { + Convert_v1beta1_Conditions_To_v1beta2_Deprecated_V1Beta1_Conditions(&in.Conditions, &out.Deprecated.V1Beta1.Conditions) + } + out.Deprecated.V1Beta1.FailureReason = in.FailureReason + out.Deprecated.V1Beta1.FailureMessage = in.FailureMessage + return nil +} + +func Convert_v1beta2_Topology_To_v1beta1_Topology(in *clusterv1.Topology, out *Topology, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_Topology_To_v1beta1_Topology(in, out, s); err != nil { + return err + } + if !reflect.DeepEqual(in.Workers, clusterv1.WorkersTopology{}) { + out.Workers = &WorkersTopology{} + if err := autoConvert_v1beta2_WorkersTopology_To_v1beta1_WorkersTopology(&in.Workers, out.Workers, s); err != nil { + return err + } + } + out.Class = in.ClassRef.Name + out.ClassNamespace = in.ClassRef.Namespace + return nil +} + +func Convert_v1beta2_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(in *clusterv1.MachineDeploymentStatus, out *MachineDeploymentStatus, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(in, out, s); err != nil { + return err + } + + // Reset conditions from autogenerated conversions + // NOTE: v1beta2 conditions should not be automatically be converted into legacy conditions (v1beta1). + out.Conditions = nil + + // Reset replica counters from autogenerated conversions + // NOTE: replica counters with a new semantic should not be automatically be converted into old replica counters. + out.AvailableReplicas = 0 + out.ReadyReplicas = 0 + + // Retrieve legacy conditions (v1beta1) and replica counters from the deprecated field. + if in.Deprecated != nil && in.Deprecated.V1Beta1 != nil { + if in.Deprecated.V1Beta1.Conditions != nil { + Convert_v1beta2_Deprecated_V1Beta1_Conditions_To_v1beta1_Conditions(&in.Deprecated.V1Beta1.Conditions, &out.Conditions) + } + out.AvailableReplicas = in.Deprecated.V1Beta1.AvailableReplicas + out.UnavailableReplicas = in.Deprecated.V1Beta1.UnavailableReplicas + out.UpdatedReplicas = in.Deprecated.V1Beta1.UpdatedReplicas + out.ReadyReplicas = in.Deprecated.V1Beta1.ReadyReplicas + } + + // Move new conditions (v1beta2) and replica counters to the v1beta2 field. + if in.Conditions == nil && in.ReadyReplicas == nil && in.AvailableReplicas == nil && in.UpToDateReplicas == nil { + return nil + } + out.V1Beta2 = &MachineDeploymentV1Beta2Status{} + out.V1Beta2.Conditions = in.Conditions + out.V1Beta2.ReadyReplicas = in.ReadyReplicas + out.V1Beta2.AvailableReplicas = in.AvailableReplicas + out.V1Beta2.UpToDateReplicas = in.UpToDateReplicas + return nil +} + +func Convert_v1beta1_MachineDeploymentStatus_To_v1beta2_MachineDeploymentStatus(in *MachineDeploymentStatus, out *clusterv1.MachineDeploymentStatus, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_MachineDeploymentStatus_To_v1beta2_MachineDeploymentStatus(in, out, s); err != nil { + return err + } + + // Reset conditions from autogenerated conversions + // NOTE: v1beta1 conditions should not be automatically be converted into v1beta2 conditions. + out.Conditions = nil + + // Reset replica counters from autogenerated conversions + // NOTE: old replica counters should not be automatically be converted into replica counters with a new semantic. + out.AvailableReplicas = nil + out.ReadyReplicas = nil + + // Retrieve new conditions (v1beta2) and replica counters from the v1beta2 field. + if in.V1Beta2 != nil { + out.Conditions = in.V1Beta2.Conditions + out.ReadyReplicas = in.V1Beta2.ReadyReplicas + out.AvailableReplicas = in.V1Beta2.AvailableReplicas + out.UpToDateReplicas = in.V1Beta2.UpToDateReplicas + } + + // Move legacy conditions (v1beta1) and replica counters to the deprecated field. + if out.Deprecated == nil { + out.Deprecated = &clusterv1.MachineDeploymentDeprecatedStatus{} + } + if out.Deprecated.V1Beta1 == nil { + out.Deprecated.V1Beta1 = &clusterv1.MachineDeploymentV1Beta1DeprecatedStatus{} + } + if in.Conditions != nil { + Convert_v1beta1_Conditions_To_v1beta2_Deprecated_V1Beta1_Conditions(&in.Conditions, &out.Deprecated.V1Beta1.Conditions) + } + out.Deprecated.V1Beta1.AvailableReplicas = in.AvailableReplicas + out.Deprecated.V1Beta1.UnavailableReplicas = in.UnavailableReplicas + out.Deprecated.V1Beta1.UpdatedReplicas = in.UpdatedReplicas + out.Deprecated.V1Beta1.ReadyReplicas = in.ReadyReplicas + return nil +} + +func Convert_v1beta1_MachineHealthCheckSpec_To_v1beta2_MachineHealthCheckSpec(in *MachineHealthCheckSpec, out *clusterv1.MachineHealthCheckSpec, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_MachineHealthCheckSpec_To_v1beta2_MachineHealthCheckSpec(in, out, s); err != nil { + return err + } + + for _, c := range in.UnhealthyConditions { + out.Checks.UnhealthyNodeConditions = append(out.Checks.UnhealthyNodeConditions, clusterv1.UnhealthyNodeCondition{ + Type: c.Type, + Status: c.Status, + TimeoutSeconds: clusterv1.ConvertToSeconds(&c.Timeout), + }) + } + out.Checks.NodeStartupTimeoutSeconds = clusterv1.ConvertToSeconds(in.NodeStartupTimeout) + out.Remediation.TriggerIf.UnhealthyLessThanOrEqualTo = in.MaxUnhealthy + out.Remediation.TriggerIf.UnhealthyInRange = ptr.Deref(in.UnhealthyRange, "") + if in.RemediationTemplate != nil { + if err := Convert_v1_ObjectReference_To_v1beta2_MachineHealthCheckRemediationTemplateReference(in.RemediationTemplate, &out.Remediation.TemplateRef, s); err != nil { + return err + } + } + + return nil +} + +func Convert_v1beta2_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in *clusterv1.MachineHealthCheckSpec, out *MachineHealthCheckSpec, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in, out, s); err != nil { + return err + } + + for _, c := range in.Checks.UnhealthyNodeConditions { + out.UnhealthyConditions = append(out.UnhealthyConditions, UnhealthyCondition{ + Type: c.Type, + Status: c.Status, + Timeout: ptr.Deref(clusterv1.ConvertFromSeconds(c.TimeoutSeconds), metav1.Duration{}), + }) + } + out.NodeStartupTimeout = clusterv1.ConvertFromSeconds(in.Checks.NodeStartupTimeoutSeconds) + out.MaxUnhealthy = in.Remediation.TriggerIf.UnhealthyLessThanOrEqualTo + if in.Remediation.TriggerIf.UnhealthyInRange != "" { + out.UnhealthyRange = ptr.To(in.Remediation.TriggerIf.UnhealthyInRange) + } + if in.Remediation.TemplateRef.IsDefined() { + out.RemediationTemplate = &corev1.ObjectReference{} + if err := Convert_v1beta2_MachineHealthCheckRemediationTemplateReference_To_v1_ObjectReference(&in.Remediation.TemplateRef, out.RemediationTemplate, s); err != nil { + return err + } + } + + return nil +} + +func Convert_v1beta2_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in *clusterv1.MachineHealthCheckStatus, out *MachineHealthCheckStatus, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in, out, s); err != nil { + return err + } + + // Reset conditions from autogenerated conversions + // NOTE: v1beta2 conditions should not be automatically be converted into legacy conditions (v1beta1). + out.Conditions = nil + + // Retrieve legacy conditions (v1beta1) from the deprecated field. + if in.Deprecated != nil && in.Deprecated.V1Beta1 != nil { + if in.Deprecated.V1Beta1.Conditions != nil { + Convert_v1beta2_Deprecated_V1Beta1_Conditions_To_v1beta1_Conditions(&in.Deprecated.V1Beta1.Conditions, &out.Conditions) + } + } + + // Move new conditions (v1beta2) to the v1beta2 field. + if in.Conditions == nil { + return nil + } + out.V1Beta2 = &MachineHealthCheckV1Beta2Status{} + out.V1Beta2.Conditions = in.Conditions + return nil +} + +func Convert_v1beta1_MachineHealthCheckStatus_To_v1beta2_MachineHealthCheckStatus(in *MachineHealthCheckStatus, out *clusterv1.MachineHealthCheckStatus, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_MachineHealthCheckStatus_To_v1beta2_MachineHealthCheckStatus(in, out, s); err != nil { + return err + } + + // Reset conditions from autogenerated conversions + // NOTE: v1beta1 conditions should not be automatically be converted into v1beta2 conditions. + out.Conditions = nil + + // Retrieve new conditions (v1beta2) from the v1beta2 field. + if in.V1Beta2 != nil { + out.Conditions = in.V1Beta2.Conditions + } + + // Move legacy conditions (v1beta1) to the deprecated field. + if in.Conditions == nil { + return nil + } + + if out.Deprecated == nil { + out.Deprecated = &clusterv1.MachineHealthCheckDeprecatedStatus{} + } + if out.Deprecated.V1Beta1 == nil { + out.Deprecated.V1Beta1 = &clusterv1.MachineHealthCheckV1Beta1DeprecatedStatus{} + } + if in.Conditions != nil { + Convert_v1beta1_Conditions_To_v1beta2_Deprecated_V1Beta1_Conditions(&in.Conditions, &out.Deprecated.V1Beta1.Conditions) + } + return nil +} + +func Convert_v1beta2_MachineSetStatus_To_v1beta1_MachineSetStatus(in *clusterv1.MachineSetStatus, out *MachineSetStatus, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_MachineSetStatus_To_v1beta1_MachineSetStatus(in, out, s); err != nil { + return err + } + + // Reset conditions from autogenerated conversions + // NOTE: v1beta2 conditions should not be automatically be converted into legacy conditions (v1beta1). + out.Conditions = nil + + // Reset replica counters from autogenerated conversions + // NOTE: replica counters with a new semantic should not be automatically be converted into old replica counters. + out.AvailableReplicas = 0 + out.ReadyReplicas = 0 + + // Retrieve legacy conditions (v1beta1), failureReason, failureMessage, and replica counters from the deprecated field. + if in.Deprecated != nil && in.Deprecated.V1Beta1 != nil { + if in.Deprecated.V1Beta1.Conditions != nil { + Convert_v1beta2_Deprecated_V1Beta1_Conditions_To_v1beta1_Conditions(&in.Deprecated.V1Beta1.Conditions, &out.Conditions) + } + out.AvailableReplicas = in.Deprecated.V1Beta1.AvailableReplicas + out.FullyLabeledReplicas = in.Deprecated.V1Beta1.FullyLabeledReplicas + out.ReadyReplicas = in.Deprecated.V1Beta1.ReadyReplicas + out.FailureReason = in.Deprecated.V1Beta1.FailureReason + out.FailureMessage = in.Deprecated.V1Beta1.FailureMessage + } + + // Move new conditions (v1beta2) and replica counters to the v1beta2 field. + if in.Conditions == nil && in.ReadyReplicas == nil && in.AvailableReplicas == nil && in.UpToDateReplicas == nil { + return nil + } + out.V1Beta2 = &MachineSetV1Beta2Status{} + out.V1Beta2.Conditions = in.Conditions + out.V1Beta2.ReadyReplicas = in.ReadyReplicas + out.V1Beta2.AvailableReplicas = in.AvailableReplicas + out.V1Beta2.UpToDateReplicas = in.UpToDateReplicas + return nil +} + +func Convert_v1beta1_MachineSetStatus_To_v1beta2_MachineSetStatus(in *MachineSetStatus, out *clusterv1.MachineSetStatus, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_MachineSetStatus_To_v1beta2_MachineSetStatus(in, out, s); err != nil { + return err + } + + // Reset conditions from autogenerated conversions + // NOTE: v1beta1 conditions should not be automatically be converted into v1beta2 conditions. + out.Conditions = nil + + // Reset replica counters from autogenerated conversions + // NOTE: old replica counters should not be automatically be converted into replica counters with a new semantic. + out.AvailableReplicas = nil + out.ReadyReplicas = nil + + // Retrieve new conditions (v1beta2) and replica counters from the v1beta2 field. + if in.V1Beta2 != nil { + out.Conditions = in.V1Beta2.Conditions + out.ReadyReplicas = in.V1Beta2.ReadyReplicas + out.AvailableReplicas = in.V1Beta2.AvailableReplicas + out.UpToDateReplicas = in.V1Beta2.UpToDateReplicas + } + + // Move legacy conditions (v1beta1), failureReason, failureMessage, and replica counters to the deprecated field. + if out.Deprecated == nil { + out.Deprecated = &clusterv1.MachineSetDeprecatedStatus{} + } + if out.Deprecated.V1Beta1 == nil { + out.Deprecated.V1Beta1 = &clusterv1.MachineSetV1Beta1DeprecatedStatus{} + } + if in.Conditions != nil { + Convert_v1beta1_Conditions_To_v1beta2_Deprecated_V1Beta1_Conditions(&in.Conditions, &out.Deprecated.V1Beta1.Conditions) + } + out.Deprecated.V1Beta1.AvailableReplicas = in.AvailableReplicas + out.Deprecated.V1Beta1.FullyLabeledReplicas = in.FullyLabeledReplicas + out.Deprecated.V1Beta1.ReadyReplicas = in.ReadyReplicas + out.Deprecated.V1Beta1.FailureReason = in.FailureReason + out.Deprecated.V1Beta1.FailureMessage = in.FailureMessage + return nil +} + +func Convert_v1beta2_MachineStatus_To_v1beta1_MachineStatus(in *clusterv1.MachineStatus, out *MachineStatus, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_MachineStatus_To_v1beta1_MachineStatus(in, out, s); err != nil { + return err + } + if !reflect.DeepEqual(in.LastUpdated, metav1.Time{}) { + out.LastUpdated = ptr.To(in.LastUpdated) + } + if !reflect.DeepEqual(in.CertificatesExpiryDate, metav1.Time{}) { + out.CertificatesExpiryDate = ptr.To(in.CertificatesExpiryDate) + } + if in.NodeRef.IsDefined() { + out.NodeRef = &corev1.ObjectReference{ + Name: in.NodeRef.Name, + APIVersion: corev1.SchemeGroupVersion.String(), + Kind: "Node", + } + } + + // Reset conditions from autogenerated conversions + // NOTE: v1beta2 conditions should not be automatically be converted into legacy conditions (v1beta1). + out.Conditions = nil + + // Retrieve legacy conditions (v1beta1), failureReason and failureMessage from the deprecated field. + if in.Deprecated != nil && in.Deprecated.V1Beta1 != nil { + if in.Deprecated.V1Beta1.Conditions != nil { + Convert_v1beta2_Deprecated_V1Beta1_Conditions_To_v1beta1_Conditions(&in.Deprecated.V1Beta1.Conditions, &out.Conditions) + } + out.FailureReason = in.Deprecated.V1Beta1.FailureReason + out.FailureMessage = in.Deprecated.V1Beta1.FailureMessage + } + + // Move initialization to old fields + out.BootstrapReady = ptr.Deref(in.Initialization.BootstrapDataSecretCreated, false) + out.InfrastructureReady = ptr.Deref(in.Initialization.InfrastructureProvisioned, false) + + // Move new conditions (v1beta2) to the v1beta2 field. + if in.Conditions == nil { + return nil + } + out.V1Beta2 = &MachineV1Beta2Status{} + out.V1Beta2.Conditions = in.Conditions + return nil +} + +func Convert_v1beta1_MachineStatus_To_v1beta2_MachineStatus(in *MachineStatus, out *clusterv1.MachineStatus, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_MachineStatus_To_v1beta2_MachineStatus(in, out, s); err != nil { + return err + } + + if in.LastUpdated != nil && !reflect.DeepEqual(in.LastUpdated, &metav1.Time{}) { + out.LastUpdated = *in.LastUpdated + } + if in.CertificatesExpiryDate != nil && !reflect.DeepEqual(in.CertificatesExpiryDate, &metav1.Time{}) { + out.CertificatesExpiryDate = *in.CertificatesExpiryDate + } + if in.NodeRef != nil && !reflect.DeepEqual(in.NodeRef, &corev1.ObjectReference{}) { + out.NodeRef.Name = in.NodeRef.Name + } + + // Reset conditions from autogenerated conversions + // NOTE: v1beta1 conditions should not be automatically be converted into v1beta2 conditions. + out.Conditions = nil + + // Retrieve new conditions (v1beta2) from the v1beta2 field. + if in.V1Beta2 != nil { + out.Conditions = in.V1Beta2.Conditions + } + + // Move BootstrapReady and InfrastructureReady to Initialization is implemented in ConvertTo. + + // Move legacy conditions (v1beta1), failureReason and failureMessage to the deprecated field. + if in.Conditions == nil && in.FailureReason == nil && in.FailureMessage == nil { + return nil + } + + if out.Deprecated == nil { + out.Deprecated = &clusterv1.MachineDeprecatedStatus{} + } + if out.Deprecated.V1Beta1 == nil { + out.Deprecated.V1Beta1 = &clusterv1.MachineV1Beta1DeprecatedStatus{} + } + if in.Conditions != nil { + Convert_v1beta1_Conditions_To_v1beta2_Deprecated_V1Beta1_Conditions(&in.Conditions, &out.Deprecated.V1Beta1.Conditions) + } + out.Deprecated.V1Beta1.FailureReason = in.FailureReason + out.Deprecated.V1Beta1.FailureMessage = in.FailureMessage + return nil +} + +func Convert_v1beta2_Deprecated_V1Beta1_Conditions_To_v1beta1_Conditions(in *clusterv1.Conditions, out *Conditions) { + *out = make(Conditions, len(*in)) + for i := range *in { + (*out)[i] = *(*Condition)(unsafe.Pointer(&(*in)[i])) //nolint:gosec + } +} + +func Convert_v1beta1_Conditions_To_v1beta2_Deprecated_V1Beta1_Conditions(in *Conditions, out *clusterv1.Conditions) { + *out = make(clusterv1.Conditions, len(*in)) + for i := range *in { + (*out)[i] = *(*clusterv1.Condition)(unsafe.Pointer(&(*in)[i])) //nolint:gosec + } +} + +func Convert_v1_Condition_To_v1beta1_Condition(_ *metav1.Condition, _ *Condition, _ apimachineryconversion.Scope) error { + // NOTE: v1beta2 conditions should not be automatically converted into legacy (v1beta1) conditions. + return nil +} + +func Convert_v1beta1_Condition_To_v1_Condition(_ *Condition, _ *metav1.Condition, _ apimachineryconversion.Scope) error { + // NOTE: legacy (v1beta1) conditions should not be automatically converted into v1beta2 conditions. + return nil +} + +func Convert_v1beta1_ClusterVariable_To_v1beta2_ClusterVariable(in *ClusterVariable, out *clusterv1.ClusterVariable, s apimachineryconversion.Scope) error { + // NOTE: v1beta2 ClusterVariable does not have DefinitionFrom anymore. But it's fine to just lose this field, + // because it was already not possible to set it anymore with v1beta1. + return autoConvert_v1beta1_ClusterVariable_To_v1beta2_ClusterVariable(in, out, s) +} + +func Convert_v1beta2_MachineSpec_To_v1beta1_MachineSpec(in *clusterv1.MachineSpec, out *MachineSpec, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_MachineSpec_To_v1beta1_MachineSpec(in, out, s); err != nil { + return err + } + out.NodeDrainTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeDrainTimeoutSeconds) + out.NodeVolumeDetachTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeVolumeDetachTimeoutSeconds) + out.NodeDeletionTimeout = clusterv1.ConvertFromSeconds(in.Deletion.NodeDeletionTimeoutSeconds) + return nil +} + +func Convert_v1beta2_MachinePoolStatus_To_v1beta1_MachinePoolStatus(in *clusterv1.MachinePoolStatus, out *MachinePoolStatus, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_MachinePoolStatus_To_v1beta1_MachinePoolStatus(in, out, s); err != nil { + return err + } + + // Reset conditions from autogenerated conversions + // NOTE: v1beta2 conditions should not be automatically be converted into legacy conditions (v1beta1). + out.Conditions = nil + + // Reset replica counters from autogenerated conversions + // NOTE: replica counters with a new semantic should not be automatically be converted into old replica counters. + out.ReadyReplicas = 0 + out.AvailableReplicas = 0 + + // Retrieve legacy conditions (v1beta1), failureReason, failureMessage and replica counters from the deprecated field. + if in.Deprecated != nil && in.Deprecated.V1Beta1 != nil { + if in.Deprecated.V1Beta1.Conditions != nil { + Convert_v1beta2_Deprecated_V1Beta1_Conditions_To_v1beta1_Conditions(&in.Deprecated.V1Beta1.Conditions, &out.Conditions) + } + out.FailureReason = in.Deprecated.V1Beta1.FailureReason + out.FailureMessage = in.Deprecated.V1Beta1.FailureMessage + out.ReadyReplicas = in.Deprecated.V1Beta1.ReadyReplicas + out.AvailableReplicas = in.Deprecated.V1Beta1.AvailableReplicas + out.UnavailableReplicas = in.Deprecated.V1Beta1.UnavailableReplicas + } + + // Move initialization to old fields + out.BootstrapReady = ptr.Deref(in.Initialization.BootstrapDataSecretCreated, false) + out.InfrastructureReady = ptr.Deref(in.Initialization.InfrastructureProvisioned, false) + + // Move new conditions (v1beta2) and replica counters to the v1beta2 field. + if in.Conditions == nil && in.ReadyReplicas == nil && in.AvailableReplicas == nil && in.UpToDateReplicas == nil { + return nil + } + out.V1Beta2 = &MachinePoolV1Beta2Status{} + out.V1Beta2.Conditions = in.Conditions + out.V1Beta2.ReadyReplicas = in.ReadyReplicas + out.V1Beta2.AvailableReplicas = in.AvailableReplicas + out.V1Beta2.UpToDateReplicas = in.UpToDateReplicas + return nil +} + +func Convert_v1beta1_MachinePoolStatus_To_v1beta2_MachinePoolStatus(in *MachinePoolStatus, out *clusterv1.MachinePoolStatus, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_MachinePoolStatus_To_v1beta2_MachinePoolStatus(in, out, s); err != nil { + return err + } + + // Reset conditions from autogenerated conversions + // NOTE: v1beta1 conditions should not be automatically be converted into v1beta2 conditions. + out.Conditions = nil + + // Reset replica counters from autogenerated conversions + // NOTE: old replica counters should not be automatically be converted into replica counters with a new semantic. + out.ReadyReplicas = nil + out.AvailableReplicas = nil + + // Retrieve new conditions (v1beta2) and replica counters from the v1beta2 field. + if in.V1Beta2 != nil { + out.Conditions = in.V1Beta2.Conditions + out.ReadyReplicas = in.V1Beta2.ReadyReplicas + out.AvailableReplicas = in.V1Beta2.AvailableReplicas + out.UpToDateReplicas = in.V1Beta2.UpToDateReplicas + } + + // Move BootstrapReady and InfrastructureReady to Initialization is implemented in ConvertTo. + + // Move legacy conditions (v1beta1), failureReason, failureMessage and replica counters to the deprecated field. + if out.Deprecated == nil { + out.Deprecated = &clusterv1.MachinePoolDeprecatedStatus{} + } + if out.Deprecated.V1Beta1 == nil { + out.Deprecated.V1Beta1 = &clusterv1.MachinePoolV1Beta1DeprecatedStatus{} + } + if in.Conditions != nil { + Convert_v1beta1_Conditions_To_v1beta2_Deprecated_V1Beta1_Conditions(&in.Conditions, &out.Deprecated.V1Beta1.Conditions) + } + out.Deprecated.V1Beta1.FailureReason = in.FailureReason + out.Deprecated.V1Beta1.FailureMessage = in.FailureMessage + out.Deprecated.V1Beta1.ReadyReplicas = in.ReadyReplicas + out.Deprecated.V1Beta1.AvailableReplicas = in.AvailableReplicas + out.Deprecated.V1Beta1.UnavailableReplicas = in.UnavailableReplicas + return nil +} + +func Convert_v1beta1_MachinePoolSpec_To_v1beta2_MachinePoolSpec(in *MachinePoolSpec, out *clusterv1.MachinePoolSpec, s apimachineryconversion.Scope) error { + return autoConvert_v1beta1_MachinePoolSpec_To_v1beta2_MachinePoolSpec(in, out, s) +} + +func Convert_v1beta1_ClusterClassStatusVariableDefinition_To_v1beta2_ClusterClassStatusVariableDefinition(in *ClusterClassStatusVariableDefinition, out *clusterv1.ClusterClassStatusVariableDefinition, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_ClusterClassStatusVariableDefinition_To_v1beta2_ClusterClassStatusVariableDefinition(in, out, s); err != nil { + return err + } + return autoConvert_v1beta1_ClusterClassVariableMetadata_To_v1beta2_ClusterClassVariableMetadata(&in.Metadata, &out.DeprecatedV1Beta1Metadata, s) +} + +func Convert_v1beta2_ClusterClassStatusVariableDefinition_To_v1beta1_ClusterClassStatusVariableDefinition(in *clusterv1.ClusterClassStatusVariableDefinition, out *ClusterClassStatusVariableDefinition, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_ClusterClassStatusVariableDefinition_To_v1beta1_ClusterClassStatusVariableDefinition(in, out, s); err != nil { + return err + } + return autoConvert_v1beta2_ClusterClassVariableMetadata_To_v1beta1_ClusterClassVariableMetadata(&in.DeprecatedV1Beta1Metadata, &out.Metadata, s) +} + +func Convert_v1beta1_ClusterClassVariable_To_v1beta2_ClusterClassVariable(in *ClusterClassVariable, out *clusterv1.ClusterClassVariable, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_ClusterClassVariable_To_v1beta2_ClusterClassVariable(in, out, s); err != nil { + return err + } + return autoConvert_v1beta1_ClusterClassVariableMetadata_To_v1beta2_ClusterClassVariableMetadata(&in.Metadata, &out.DeprecatedV1Beta1Metadata, s) +} + +func Convert_v1beta2_ClusterClassVariable_To_v1beta1_ClusterClassVariable(in *clusterv1.ClusterClassVariable, out *ClusterClassVariable, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_ClusterClassVariable_To_v1beta1_ClusterClassVariable(in, out, s); err != nil { + return err + } + return autoConvert_v1beta2_ClusterClassVariableMetadata_To_v1beta1_ClusterClassVariableMetadata(&in.DeprecatedV1Beta1Metadata, &out.Metadata, s) +} + +func Convert_v1beta1_ExternalPatchDefinition_To_v1beta2_ExternalPatchDefinition(in *ExternalPatchDefinition, out *clusterv1.ExternalPatchDefinition, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_ExternalPatchDefinition_To_v1beta2_ExternalPatchDefinition(in, out, s); err != nil { + return err + } + + out.GeneratePatchesExtension = ptr.Deref(in.GenerateExtension, "") + out.ValidateTopologyExtension = ptr.Deref(in.ValidateExtension, "") + return nil +} + +func Convert_v1beta2_ExternalPatchDefinition_To_v1beta1_ExternalPatchDefinition(in *clusterv1.ExternalPatchDefinition, out *ExternalPatchDefinition, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_ExternalPatchDefinition_To_v1beta1_ExternalPatchDefinition(in, out, s); err != nil { + return err + } + + if in.GeneratePatchesExtension != "" { + out.GenerateExtension = ptr.To(in.GeneratePatchesExtension) + } + if in.ValidateTopologyExtension != "" { + out.ValidateExtension = ptr.To(in.ValidateTopologyExtension) + } + return nil +} + +func Convert_v1_ObjectReference_To_v1beta2_MachineHealthCheckRemediationTemplateReference(in *corev1.ObjectReference, out *clusterv1.MachineHealthCheckRemediationTemplateReference, _ apimachineryconversion.Scope) error { + out.Name = in.Name + out.Kind = in.Kind + out.APIVersion = in.APIVersion + return nil +} + +func Convert_v1beta2_MachineHealthCheckRemediationTemplateReference_To_v1_ObjectReference(in *clusterv1.MachineHealthCheckRemediationTemplateReference, out *corev1.ObjectReference, _ apimachineryconversion.Scope) error { + out.Name = in.Name + out.Kind = in.Kind + out.APIVersion = in.APIVersion + return nil +} + +func Convert_v1_ObjectReference_To_v1beta2_ContractVersionedObjectReference(_ *corev1.ObjectReference, _ *clusterv1.ContractVersionedObjectReference, _ apimachineryconversion.Scope) error { + // This is implemented in ConvertTo/ConvertFrom as we have all necessary information available there. + return nil +} + +func Convert_v1beta2_ContractVersionedObjectReference_To_v1_ObjectReference(_ *clusterv1.ContractVersionedObjectReference, _ *corev1.ObjectReference, _ apimachineryconversion.Scope) error { + // This is implemented in ConvertTo/ConvertFrom as we have all necessary information available there. + return nil +} + +func Convert_v1_ObjectReference_To_v1beta2_MachineNodeReference(in *corev1.ObjectReference, out *clusterv1.MachineNodeReference, _ apimachineryconversion.Scope) error { + out.Name = in.Name + return nil +} + +func Convert_v1beta2_MachineNodeReference_To_v1_ObjectReference(in *clusterv1.MachineNodeReference, out *corev1.ObjectReference, _ apimachineryconversion.Scope) error { + out.Name = in.Name + out.APIVersion = corev1.SchemeGroupVersion.String() + out.Kind = "Node" + return nil +} + +func Convert_v1beta1_LocalObjectTemplate_To_v1beta2_ControlPlaneClassMachineInfrastructureTemplate(in *LocalObjectTemplate, out *clusterv1.ControlPlaneClassMachineInfrastructureTemplate, s apimachineryconversion.Scope) error { + convert_v1beta1_LocalObjectTemplate_To_v1beta2_ClusterClassTemplateReference(in, &out.TemplateRef, s) + return nil +} + +func Convert_v1beta1_LocalObjectTemplate_To_v1beta2_MachineDeploymentClassBootstrapTemplate(in *LocalObjectTemplate, out *clusterv1.MachineDeploymentClassBootstrapTemplate, s apimachineryconversion.Scope) error { + convert_v1beta1_LocalObjectTemplate_To_v1beta2_ClusterClassTemplateReference(in, &out.TemplateRef, s) + return nil +} + +func Convert_v1beta1_LocalObjectTemplate_To_v1beta2_MachineDeploymentClassInfrastructureTemplate(in *LocalObjectTemplate, out *clusterv1.MachineDeploymentClassInfrastructureTemplate, s apimachineryconversion.Scope) error { + convert_v1beta1_LocalObjectTemplate_To_v1beta2_ClusterClassTemplateReference(in, &out.TemplateRef, s) + return nil +} + +func Convert_v1beta1_LocalObjectTemplate_To_v1beta2_MachinePoolClassBootstrapTemplate(in *LocalObjectTemplate, out *clusterv1.MachinePoolClassBootstrapTemplate, s apimachineryconversion.Scope) error { + convert_v1beta1_LocalObjectTemplate_To_v1beta2_ClusterClassTemplateReference(in, &out.TemplateRef, s) + return nil +} + +func Convert_v1beta1_LocalObjectTemplate_To_v1beta2_MachinePoolClassInfrastructureTemplate(in *LocalObjectTemplate, out *clusterv1.MachinePoolClassInfrastructureTemplate, s apimachineryconversion.Scope) error { + convert_v1beta1_LocalObjectTemplate_To_v1beta2_ClusterClassTemplateReference(in, &out.TemplateRef, s) + return nil +} + +func convert_v1beta1_LocalObjectTemplate_To_v1beta2_ClusterClassTemplateReference(in *LocalObjectTemplate, out *clusterv1.ClusterClassTemplateReference, _ apimachineryconversion.Scope) { + if in == nil || in.Ref == nil { + return + } + + *out = clusterv1.ClusterClassTemplateReference{ + Kind: in.Ref.Kind, + Name: in.Ref.Name, + APIVersion: in.Ref.APIVersion, + } +} + +func Convert_v1beta2_ControlPlaneClassMachineInfrastructureTemplate_To_v1beta1_LocalObjectTemplate(in *clusterv1.ControlPlaneClassMachineInfrastructureTemplate, out *LocalObjectTemplate, s apimachineryconversion.Scope) error { + Convert_v1beta2_ClusterClassTemplateReference_To_v1beta1_LocalObjectTemplate(&in.TemplateRef, out, s) + return nil +} + +func Convert_v1beta2_MachineDeploymentClassBootstrapTemplate_To_v1beta1_LocalObjectTemplate(in *clusterv1.MachineDeploymentClassBootstrapTemplate, out *LocalObjectTemplate, s apimachineryconversion.Scope) error { + Convert_v1beta2_ClusterClassTemplateReference_To_v1beta1_LocalObjectTemplate(&in.TemplateRef, out, s) + return nil +} + +func Convert_v1beta2_MachineDeploymentClassInfrastructureTemplate_To_v1beta1_LocalObjectTemplate(in *clusterv1.MachineDeploymentClassInfrastructureTemplate, out *LocalObjectTemplate, s apimachineryconversion.Scope) error { + Convert_v1beta2_ClusterClassTemplateReference_To_v1beta1_LocalObjectTemplate(&in.TemplateRef, out, s) + return nil +} + +func Convert_v1beta2_MachinePoolClassBootstrapTemplate_To_v1beta1_LocalObjectTemplate(in *clusterv1.MachinePoolClassBootstrapTemplate, out *LocalObjectTemplate, s apimachineryconversion.Scope) error { + Convert_v1beta2_ClusterClassTemplateReference_To_v1beta1_LocalObjectTemplate(&in.TemplateRef, out, s) + return nil +} + +func Convert_v1beta2_MachinePoolClassInfrastructureTemplate_To_v1beta1_LocalObjectTemplate(in *clusterv1.MachinePoolClassInfrastructureTemplate, out *LocalObjectTemplate, s apimachineryconversion.Scope) error { + Convert_v1beta2_ClusterClassTemplateReference_To_v1beta1_LocalObjectTemplate(&in.TemplateRef, out, s) + return nil +} + +func Convert_v1beta2_ClusterClassTemplateReference_To_v1beta1_LocalObjectTemplate(in *clusterv1.ClusterClassTemplateReference, out *LocalObjectTemplate, _ apimachineryconversion.Scope) { + if in == nil { + return + } + + out.Ref = &corev1.ObjectReference{ + Kind: in.Kind, + Name: in.Name, + APIVersion: in.APIVersion, + } +} + +func Convert_v1beta1_MachineSetSpec_To_v1beta2_MachineSetSpec(in *MachineSetSpec, out *clusterv1.MachineSetSpec, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_MachineSetSpec_To_v1beta2_MachineSetSpec(in, out, s); err != nil { + return err + } + + out.Deletion.Order = clusterv1.MachineSetDeletionOrder(in.DeletePolicy) + if in.MachineNamingStrategy != nil { + out.MachineNaming = clusterv1.MachineNamingSpec{ + Template: in.MachineNamingStrategy.Template, + } + } + return nil +} + +func Convert_v1beta2_MachineSetSpec_To_v1beta1_MachineSetSpec(in *clusterv1.MachineSetSpec, out *MachineSetSpec, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_MachineSetSpec_To_v1beta1_MachineSetSpec(in, out, s); err != nil { + return err + } + + out.DeletePolicy = string(in.Deletion.Order) + if in.MachineNaming.Template != "" { + out.MachineNamingStrategy = &MachineNamingStrategy{ + Template: in.MachineNaming.Template, + } + } + return nil +} + +func Convert_v1beta1_ClusterSpec_To_v1beta2_ClusterSpec(in *ClusterSpec, out *clusterv1.ClusterSpec, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_ClusterSpec_To_v1beta2_ClusterSpec(in, out, s); err != nil { + return err + } + if in.ClusterNetwork != nil { + if err := Convert_v1beta1_ClusterNetwork_To_v1beta2_ClusterNetwork(in.ClusterNetwork, &out.ClusterNetwork, s); err != nil { + return err + } + } + if in.Topology != nil { + if err := Convert_v1beta1_Topology_To_v1beta2_Topology(in.Topology, &out.Topology, s); err != nil { + return err + } + } + + return nil +} + +func Convert_v1beta2_ClusterSpec_To_v1beta1_ClusterSpec(in *clusterv1.ClusterSpec, out *ClusterSpec, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_ClusterSpec_To_v1beta1_ClusterSpec(in, out, s); err != nil { + return err + } + if !reflect.DeepEqual(in.ClusterNetwork, clusterv1.ClusterNetwork{}) { + out.ClusterNetwork = &ClusterNetwork{} + if err := Convert_v1beta2_ClusterNetwork_To_v1beta1_ClusterNetwork(&in.ClusterNetwork, out.ClusterNetwork, s); err != nil { + return err + } + } + if !reflect.DeepEqual(in.Topology, clusterv1.Topology{}) { + out.Topology = &Topology{} + if err := Convert_v1beta2_Topology_To_v1beta1_Topology(&in.Topology, out.Topology, s); err != nil { + return err + } + } + + return nil +} + +func Convert_v1beta1_ClusterNetwork_To_v1beta2_ClusterNetwork(in *ClusterNetwork, out *clusterv1.ClusterNetwork, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_ClusterNetwork_To_v1beta2_ClusterNetwork(in, out, s); err != nil { + return err + } + if in.Services != nil { + if err := autoConvert_v1beta1_NetworkRanges_To_v1beta2_NetworkRanges(in.Services, &out.Services, s); err != nil { + return err + } + } + if in.Pods != nil { + if err := autoConvert_v1beta1_NetworkRanges_To_v1beta2_NetworkRanges(in.Pods, &out.Pods, s); err != nil { + return err + } + } + + return nil +} + +func Convert_v1beta2_ClusterNetwork_To_v1beta1_ClusterNetwork(in *clusterv1.ClusterNetwork, out *ClusterNetwork, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_ClusterNetwork_To_v1beta1_ClusterNetwork(in, out, s); err != nil { + return err + } + if !reflect.DeepEqual(in.Services, clusterv1.NetworkRanges{}) { + out.Services = &NetworkRanges{} + if err := autoConvert_v1beta2_NetworkRanges_To_v1beta1_NetworkRanges(&in.Services, out.Services, s); err != nil { + return err + } + } + + if !reflect.DeepEqual(in.Pods, clusterv1.NetworkRanges{}) { + out.Pods = &NetworkRanges{} + if err := autoConvert_v1beta2_NetworkRanges_To_v1beta1_NetworkRanges(&in.Pods, out.Pods, s); err != nil { + return err + } + } + + return nil +} + +func Convert_v1beta1_MachineDeploymentSpec_To_v1beta2_MachineDeploymentSpec(in *MachineDeploymentSpec, out *clusterv1.MachineDeploymentSpec, s apimachineryconversion.Scope) error { + // NOTE: v1beta2 MachineDeploymentSpec does not have ProgressDeadlineSeconds anymore. But it's fine to just lose this field it was never used. + if err := autoConvert_v1beta1_MachineDeploymentSpec_To_v1beta2_MachineDeploymentSpec(in, out, s); err != nil { + return err + } + if in.Strategy != nil { + out.Rollout.Strategy.Type = clusterv1.MachineDeploymentRolloutStrategyType(in.Strategy.Type) + if in.Strategy.RollingUpdate != nil { + out.Rollout.Strategy.RollingUpdate.MaxUnavailable = in.Strategy.RollingUpdate.MaxUnavailable + out.Rollout.Strategy.RollingUpdate.MaxSurge = in.Strategy.RollingUpdate.MaxSurge + if in.Strategy.RollingUpdate.DeletePolicy != nil { + out.Deletion.Order = clusterv1.MachineSetDeletionOrder(*in.Strategy.RollingUpdate.DeletePolicy) + } + } + if in.Strategy.Remediation != nil && in.Strategy.Remediation.MaxInFlight != nil { + out.Remediation.MaxInFlight = in.Strategy.Remediation.MaxInFlight + } + } + if in.RolloutAfter != nil && !reflect.DeepEqual(in.RolloutAfter, &metav1.Time{}) { + out.Rollout.After = *in.RolloutAfter + } + if in.MachineNamingStrategy != nil { + out.MachineNaming = clusterv1.MachineNamingSpec{ + Template: in.MachineNamingStrategy.Template, + } + } + + return nil +} + +func Convert_v1beta2_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(in *clusterv1.MachineDeploymentSpec, out *MachineDeploymentSpec, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(in, out, s); err != nil { + return err + } + if !reflect.DeepEqual(in.Rollout.Strategy, clusterv1.MachineDeploymentRolloutStrategy{}) { + out.Strategy = &MachineDeploymentStrategy{} + out.Strategy.Type = MachineDeploymentStrategyType(in.Rollout.Strategy.Type) + if !reflect.DeepEqual(in.Rollout.Strategy.RollingUpdate, clusterv1.MachineDeploymentRolloutStrategyRollingUpdate{}) { + out.Strategy.RollingUpdate = &MachineRollingUpdateDeployment{} + out.Strategy.RollingUpdate.MaxUnavailable = in.Rollout.Strategy.RollingUpdate.MaxUnavailable + out.Strategy.RollingUpdate.MaxSurge = in.Rollout.Strategy.RollingUpdate.MaxSurge + } + } + if in.Deletion.Order != "" { + if out.Strategy == nil { + out.Strategy = &MachineDeploymentStrategy{} + } + if out.Strategy.RollingUpdate == nil { + out.Strategy.RollingUpdate = &MachineRollingUpdateDeployment{} + } + out.Strategy.RollingUpdate.DeletePolicy = ptr.To(string(in.Deletion.Order)) + } + if in.Remediation.MaxInFlight != nil { + if out.Strategy == nil { + out.Strategy = &MachineDeploymentStrategy{} + } + if out.Strategy.Remediation == nil { + out.Strategy.Remediation = &RemediationStrategy{} + } + out.Strategy.Remediation.MaxInFlight = in.Remediation.MaxInFlight + } + if !reflect.DeepEqual(in.Rollout.After, metav1.Time{}) { + out.RolloutAfter = ptr.To(in.Rollout.After) + } + if in.MachineNaming.Template != "" { + out.MachineNamingStrategy = &MachineNamingStrategy{ + Template: in.MachineNaming.Template, + } + } + return nil +} + +func Convert_v1beta1_Bootstrap_To_v1beta2_Bootstrap(in *Bootstrap, out *clusterv1.Bootstrap, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_Bootstrap_To_v1beta2_Bootstrap(in, out, s); err != nil { + return err + } + if in.ConfigRef != nil { + if err := Convert_v1_ObjectReference_To_v1beta2_ContractVersionedObjectReference(in.ConfigRef, &out.ConfigRef, s); err != nil { + return err + } + } + return nil +} + +func Convert_v1beta2_Bootstrap_To_v1beta1_Bootstrap(in *clusterv1.Bootstrap, out *Bootstrap, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_Bootstrap_To_v1beta1_Bootstrap(in, out, s); err != nil { + return err + } + if in.ConfigRef.IsDefined() { + out.ConfigRef = &corev1.ObjectReference{} + if err := Convert_v1beta2_ContractVersionedObjectReference_To_v1_ObjectReference(&in.ConfigRef, out.ConfigRef, s); err != nil { + return err + } + } + return nil +} + +func convertMachineSpecToContractVersionedObjectReference(src *MachineSpec, dst *clusterv1.MachineSpec) error { + infraRef, err := convertToContractVersionedObjectReference(&src.InfrastructureRef) + if err != nil { + return err + } + dst.InfrastructureRef = infraRef + + if src.Bootstrap.ConfigRef != nil { + bootstrapRef, err := convertToContractVersionedObjectReference(src.Bootstrap.ConfigRef) + if err != nil { + return err + } + dst.Bootstrap.ConfigRef = bootstrapRef + } + + return nil +} + +func convertMachineSpecToObjectReference(src *clusterv1.MachineSpec, dst *MachineSpec, namespace string) error { + if src.InfrastructureRef.IsDefined() { + infraRef, err := convertToObjectReference(src.InfrastructureRef, namespace) + if err != nil { + return err + } + dst.InfrastructureRef = *infraRef + } + + if src.Bootstrap.ConfigRef.IsDefined() { + bootstrapRef, err := convertToObjectReference(src.Bootstrap.ConfigRef, namespace) + if err != nil { + return err + } + dst.Bootstrap.ConfigRef = bootstrapRef + } + + return nil +} + +func convertToContractVersionedObjectReference(ref *corev1.ObjectReference) (clusterv1.ContractVersionedObjectReference, error) { + var apiGroup string + if ref.APIVersion != "" { + gv, err := schema.ParseGroupVersion(ref.APIVersion) + if err != nil { + return clusterv1.ContractVersionedObjectReference{}, fmt.Errorf("failed to convert object: failed to parse apiVersion: %v", err) + } + apiGroup = gv.Group + } + return clusterv1.ContractVersionedObjectReference{ + APIGroup: apiGroup, + Kind: ref.Kind, + Name: ref.Name, + }, nil +} + +func convertToObjectReference(ref clusterv1.ContractVersionedObjectReference, namespace string) (*corev1.ObjectReference, error) { + apiVersion, err := apiVersionGetter(schema.GroupKind{ + Group: ref.APIGroup, + Kind: ref.Kind, + }) + if err != nil { + return nil, fmt.Errorf("failed to convert object: %v", err) + } + return &corev1.ObjectReference{ + APIVersion: apiVersion, + Kind: ref.Kind, + Namespace: namespace, + Name: ref.Name, + }, nil +} + +func Convert_v1beta1_JSONSchemaProps_To_v1beta2_JSONSchemaProps(in *JSONSchemaProps, out *clusterv1.JSONSchemaProps, s apimachineryconversion.Scope) error { + // This conversion func is also required due to a bug in conversion gen that does not recognize the changes for converting bool to *bool. + // By implementing this func, autoConvert_v1beta1_JSONSchemaProps_To_v1beta2_JSONSchemaProps is generated properly. + if err := autoConvert_v1beta1_JSONSchemaProps_To_v1beta2_JSONSchemaProps(in, out, s); err != nil { + return err + } + if in.XMetadata != nil { + if err := Convert_v1beta1_VariableSchemaMetadata_To_v1beta2_VariableSchemaMetadata(in.XMetadata, &out.XMetadata, s); err != nil { + return err + } + } + return nil +} + +func Convert_v1beta2_JSONSchemaProps_To_v1beta1_JSONSchemaProps(in *clusterv1.JSONSchemaProps, out *JSONSchemaProps, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_JSONSchemaProps_To_v1beta1_JSONSchemaProps(in, out, s); err != nil { + return err + } + if !reflect.DeepEqual(in.XMetadata, clusterv1.VariableSchemaMetadata{}) { + out.XMetadata = &VariableSchemaMetadata{} + if err := Convert_v1beta2_VariableSchemaMetadata_To_v1beta1_VariableSchemaMetadata(&in.XMetadata, out.XMetadata, s); err != nil { + return err + } + } + return nil +} + +func dropEmptyStringsCluster(dst *Cluster) { + if dst.Spec.Topology != nil { + if dst.Spec.Topology.Workers != nil { + for i, md := range dst.Spec.Topology.Workers.MachineDeployments { + dropEmptyString(&md.FailureDomain) + dst.Spec.Topology.Workers.MachineDeployments[i] = md + } + } + } +} + +func dropEmptyStringsClusterClass(dst *ClusterClass) { + if dst.Spec.InfrastructureNamingStrategy != nil { + dropEmptyString(&dst.Spec.InfrastructureNamingStrategy.Template) + } + + if dst.Spec.ControlPlane.NamingStrategy != nil { + dropEmptyString(&dst.Spec.ControlPlane.NamingStrategy.Template) + } + + for i, md := range dst.Spec.Workers.MachineDeployments { + if md.NamingStrategy != nil { + dropEmptyString(&md.NamingStrategy.Template) + } + dropEmptyString(&md.FailureDomain) + dst.Spec.Workers.MachineDeployments[i] = md + } + + for i, mp := range dst.Spec.Workers.MachinePools { + if mp.NamingStrategy != nil { + dropEmptyString(&mp.NamingStrategy.Template) + } + + dst.Spec.Workers.MachinePools[i] = mp + } + + for i, p := range dst.Spec.Patches { + dropEmptyString(&p.EnabledIf) + if p.External != nil { + dropEmptyString(&p.External.GenerateExtension) + dropEmptyString(&p.External.ValidateExtension) + dropEmptyString(&p.External.DiscoverVariablesExtension) + } + + for j, d := range p.Definitions { + for k, jp := range d.JSONPatches { + if jp.ValueFrom != nil { + dropEmptyString(&jp.ValueFrom.Variable) + dropEmptyString(&jp.ValueFrom.Template) + } + d.JSONPatches[k] = jp + } + p.Definitions[j] = d + } + + dst.Spec.Patches[i] = p + } +} + +func dropEmptyStringsMachineSpec(spec *MachineSpec) { + dropEmptyString(&spec.Version) + dropEmptyString(&spec.ProviderID) + dropEmptyString(&spec.FailureDomain) +} + +func dropEmptyString(s **string) { + if *s != nil && **s == "" { + *s = nil + } +} + +func Convert_v1beta1_MachineDeletionStatus_To_v1beta2_MachineDeletionStatus(in *MachineDeletionStatus, out *clusterv1.MachineDeletionStatus, _ apimachineryconversion.Scope) error { + if in.NodeDrainStartTime != nil && !reflect.DeepEqual(in.NodeDrainStartTime, &metav1.Time{}) { + out.NodeDrainStartTime = *in.NodeDrainStartTime + } + if in.WaitForNodeVolumeDetachStartTime != nil && !reflect.DeepEqual(in.WaitForNodeVolumeDetachStartTime, &metav1.Time{}) { + out.WaitForNodeVolumeDetachStartTime = *in.WaitForNodeVolumeDetachStartTime + } + return nil +} + +func Convert_v1beta2_MachineDeletionStatus_To_v1beta1_MachineDeletionStatus(in *clusterv1.MachineDeletionStatus, out *MachineDeletionStatus, _ apimachineryconversion.Scope) error { + if !reflect.DeepEqual(in.NodeDrainStartTime, metav1.Time{}) { + out.NodeDrainStartTime = ptr.To(in.NodeDrainStartTime) + } + if !reflect.DeepEqual(in.WaitForNodeVolumeDetachStartTime, metav1.Time{}) { + out.WaitForNodeVolumeDetachStartTime = ptr.To(in.WaitForNodeVolumeDetachStartTime) + } + return nil +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/conversion.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/doc.go similarity index 54% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/conversion.go rename to vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/doc.go index cbbc3b35d7..1df77151b5 100644 --- a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/conversion.go +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/doc.go @@ -14,17 +14,11 @@ 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 +// +k8s:openapi-gen=true +// +k8s:conversion-gen=sigs.k8s.io/cluster-api/api/core/v1beta2 +// +kubebuilder:object:generate=true +// +groupName=cluster.x-k8s.io +// +// Deprecated: This package is deprecated and is going to be removed when support for v1beta1 will be dropped. package v1beta1 - -func (*Cluster) Hub() {} -func (*ClusterList) Hub() {} -func (*ClusterClass) Hub() {} -func (*ClusterClassList) 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/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/groupversion_info.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/groupversion_info.go new file mode 100644 index 0000000000..63ef4c408b --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/groupversion_info.go @@ -0,0 +1,54 @@ +/* +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/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +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 = runtime.NewSchemeBuilder(addKnownTypes) + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = schemeBuilder.AddToScheme + + // localSchemeBuilder is used for type conversions. + localSchemeBuilder = &schemeBuilder + + objectTypes = []runtime.Object{} + + // GroupVersionInfrastructure is the recommended group version for infrastructure objects. + GroupVersionInfrastructure = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1beta1"} + + // GroupVersionBootstrap is the recommended group version for bootstrap objects. + GroupVersionBootstrap = schema.GroupVersion{Group: "bootstrap.cluster.x-k8s.io", Version: "v1beta1"} + + // GroupVersionControlPlane is the recommended group version for controlplane objects. + GroupVersionControlPlane = schema.GroupVersion{Group: "controlplane.cluster.x-k8s.io", Version: "v1beta1"} +) + +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(GroupVersion, objectTypes...) + metav1.AddToGroupVersion(scheme, GroupVersion) + return nil +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/machine_phase_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machine_phase_types.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/machine_phase_types.go rename to vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machine_phase_types.go diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/machine_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machine_types.go similarity index 97% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/machine_types.go rename to vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machine_types.go index f4a1cdee56..9665953dd4 100644 --- a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/machine_types.go +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machine_types.go @@ -375,8 +375,6 @@ const ( MachineDeletingDeletionCompletedV1Beta2Reason = DeletionCompletedV1Beta2Reason ) -// ANCHOR: MachineSpec - // MachineSpec defines the desired state of Machine. type MachineSpec struct { // clusterName is the name of the Cluster this object belongs to. @@ -424,14 +422,6 @@ type MachineSpec struct { // +kubebuilder:validation:MaxLength=256 FailureDomain *string `json:"failureDomain,omitempty"` - // The minimum number of seconds for which a Machine should be ready before considering it available. - // Defaults to 0 (Machine will be considered available as soon as the Machine is ready) - // NOTE: this field will be considered only for computing v1beta2 conditions. - // +optional - // TODO: This field will be added in the v1beta2 API, and act as a replacement of existing MinReadySeconds in - // MachineDeployment, MachineSet and MachinePool - // MinReadySeconds int32 `json:"minReadySeconds,omitempty"` - // readinessGates specifies additional conditions to include when evaluating Machine Ready condition. // // This field can be used e.g. by Cluster API control plane providers to extend the semantic of the @@ -491,10 +481,6 @@ type MachineReadinessGate struct { Polarity ConditionPolarity `json:"polarity,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. @@ -527,7 +513,7 @@ type MachineStatus struct { // can be added as events to the Machine object and/or logged in the // controller's output. // - // Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. // // +optional FailureReason *capierrors.MachineStatusError `json:"failureReason,omitempty"` @@ -549,7 +535,7 @@ type MachineStatus struct { // can be added as events to the Machine object and/or logged in the // controller's output. // - // Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. // // +optional // +kubebuilder:validation:MinLength=1 @@ -613,8 +599,6 @@ type MachineV1Beta2Status struct { Conditions []metav1.Condition `json:"conditions,omitempty"` } -// ANCHOR_END: MachineStatus - // MachineDeletionStatus is the deletion state of the Machine. type MachineDeletionStatus struct { // nodeDrainStartTime is the time when the drain of the node started and is used to determine @@ -655,8 +639,6 @@ func (m *MachineStatus) GetTypedPhase() MachinePhase { } } -// 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 @@ -674,12 +656,10 @@ type Bootstrap struct { 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:deprecatedversion // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" // +kubebuilder:printcolumn:name="NodeName",type="string",JSONPath=".status.nodeRef.name",description="Node name associated with this machine" // +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="Provider ID" diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/machinedeployment_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinedeployment_types.go similarity index 98% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/machinedeployment_types.go rename to vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinedeployment_types.go index 80307605d5..4abb03a9aa 100644 --- a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/machinedeployment_types.go +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinedeployment_types.go @@ -236,8 +236,6 @@ const ( MachineDeploymentDeletingInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason ) -// ANCHOR: MachineDeploymentSpec - // MachineDeploymentSpec defines the desired state of MachineDeployment. type MachineDeploymentSpec struct { // clusterName is the name of the Cluster this object belongs to. @@ -325,10 +323,6 @@ type MachineDeploymentSpec struct { ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` } -// ANCHOR_END: MachineDeploymentSpec - -// ANCHOR: MachineDeploymentStrategy - // MachineDeploymentStrategy describes how to replace existing machines // with new ones. type MachineDeploymentStrategy struct { @@ -349,10 +343,6 @@ type MachineDeploymentStrategy struct { Remediation *RemediationStrategy `json:"remediation,omitempty"` } -// ANCHOR_END: MachineDeploymentStrategy - -// ANCHOR: MachineRollingUpdateDeployment - // MachineRollingUpdateDeployment is used to control the desired behavior of rolling update. type MachineRollingUpdateDeployment struct { // maxUnavailable is the maximum number of machines that can be unavailable during the update. @@ -394,10 +384,6 @@ type MachineRollingUpdateDeployment struct { DeletePolicy *string `json:"deletePolicy,omitempty"` } -// ANCHOR_END: MachineRollingUpdateDeployment - -// ANCHOR: RemediationStrategy - // RemediationStrategy allows to define how the MachineSet can control scaling operations. type RemediationStrategy struct { // maxInFlight determines how many in flight remediations should happen at the same time. @@ -419,8 +405,6 @@ type RemediationStrategy struct { MaxInFlight *intstr.IntOrString `json:"maxInFlight,omitempty"` } -// ANCHOR_END: RemediationStrategy - // MachineNamingStrategy allows changing the naming pattern used when creating // Machines. // Note: InfraMachines & BootstrapConfigs will use the same name as the corresponding Machines. @@ -447,8 +431,6 @@ type MachineNamingStrategy struct { Template string `json:"template,omitempty"` } -// ANCHOR: MachineDeploymentStatus - // MachineDeploymentStatus defines the observed state of MachineDeployment. type MachineDeploymentStatus struct { // observedGeneration is the generation observed by the deployment controller. @@ -488,7 +470,7 @@ type MachineDeploymentStatus struct { // be machines that are running but not yet available or machines // that still have not been created. // - // Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. // // +optional UnavailableReplicas int32 `json:"unavailableReplicas"` @@ -531,8 +513,6 @@ type MachineDeploymentV1Beta2Status struct { UpToDateReplicas *int32 `json:"upToDateReplicas,omitempty"` } -// ANCHOR_END: MachineDeploymentStatus - // MachineDeploymentPhase indicates the progress of the machine deployment. type MachineDeploymentPhase string @@ -575,7 +555,7 @@ func (md *MachineDeploymentStatus) GetTypedPhase() MachineDeploymentPhase { // +kubebuilder:object:root=true // +kubebuilder:resource:path=machinedeployments,shortName=md,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion +// +kubebuilder:deprecatedversion // +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/vendor/sigs.k8s.io/cluster-api/api/v1beta1/machinedrainrules_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinedrainrules_types.go similarity index 99% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/machinedrainrules_types.go rename to vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinedrainrules_types.go index ac9aeb415e..ff653dca05 100644 --- a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/machinedrainrules_types.go +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinedrainrules_types.go @@ -196,7 +196,7 @@ type MachineDrainRulePodSelector struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=machinedrainrules,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion +// +kubebuilder:deprecatedversion // +kubebuilder:printcolumn:name="Behavior",type="string",JSONPath=".spec.drain.behavior",description="Drain behavior" // +kubebuilder:printcolumn:name="Order",type="string",JSONPath=".spec.drain.order",description="Drain order" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of the MachineDrainRule" diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/machinehealthcheck_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinehealthcheck_types.go similarity index 97% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/machinehealthcheck_types.go rename to vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinehealthcheck_types.go index 0646bad116..c8e4d27046 100644 --- a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/machinehealthcheck_types.go +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinehealthcheck_types.go @@ -47,8 +47,6 @@ var ( DefaultNodeStartupTimeout = metav1.Duration{Duration: 10 * time.Minute} ) -// ANCHOR: MachineHealthCheckSpec - // MachineHealthCheckSpec defines the desired state of MachineHealthCheck. type MachineHealthCheckSpec struct { // clusterName is the name of the Cluster this object belongs to. @@ -118,10 +116,6 @@ type MachineHealthCheckSpec struct { 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. @@ -146,10 +140,6 @@ type UnhealthyCondition struct { Timeout metav1.Duration `json:"timeout"` } -// ANCHOR_END: UnhealthyCondition - -// ANCHOR: MachineHealthCheckStatus - // MachineHealthCheckStatus defines the observed state of MachineHealthCheck. type MachineHealthCheckStatus struct { // expectedMachines is the total number of machines counted by this machine health check @@ -200,11 +190,9 @@ type MachineHealthCheckV1Beta2Status struct { Conditions []metav1.Condition `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:deprecatedversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" // +kubebuilder:printcolumn:name="ExpectedMachines",type="integer",JSONPath=".status.expectedMachines",description="Number of machines currently monitored" diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinepool_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinepool_types.go new file mode 100644 index 0000000000..5ecd8fa227 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinepool_types.go @@ -0,0 +1,356 @@ +/* +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 ( + // MachinePoolFinalizer is used to ensure deletion of dependencies (nodes, infra). + MachinePoolFinalizer = "machinepool.cluster.x-k8s.io" +) + +/* +NOTE: we are commenting const for MachinePool's V1Beta2 conditions and reasons because not yet implemented for the 1.9 CAPI release. +However, we are keeping the v1beta2 struct in the MachinePool struct because the code that will collect conditions and replica +counters at cluster level is already implemented. + +// Conditions that will be used for the MachinePool object in v1Beta2 API version. +const ( + // MachinePoolAvailableV1Beta2Condition is true when InfrastructureReady and available replicas >= desired replicas. + MachinePoolAvailableV1Beta2Condition = clusterv1beta1.AvailableV1Beta2Condition + + // MachinePoolBootstrapConfigReadyV1Beta2Condition mirrors the corresponding condition from the MachinePool's BootstrapConfig resource. + MachinePoolBootstrapConfigReadyV1Beta2Condition = clusterv1beta1.BootstrapConfigReadyV1Beta2Condition + + // MachinePoolInfrastructureReadyV1Beta2Condition mirrors the corresponding condition from the MachinePool's Infrastructure resource. + MachinePoolInfrastructureReadyV1Beta2Condition = clusterv1beta1.InfrastructureReadyV1Beta2Condition + + // MachinePoolMachinesReadyV1Beta2Condition surfaces detail of issues on the controlled machines, if any. + MachinePoolMachinesReadyV1Beta2Condition = clusterv1beta1.MachinesReadyV1Beta2Condition + + // MachinePoolMachinesUpToDateV1Beta2Condition surfaces details of controlled machines not up to date, if any. + MachinePoolMachinesUpToDateV1Beta2Condition = clusterv1beta1.MachinesUpToDateV1Beta2Condition + + // MachinePoolScalingUpV1Beta2Condition is true if available replicas < desired replicas. + MachinePoolScalingUpV1Beta2Condition = clusterv1beta1.ScalingUpV1Beta2Condition + + // MachinePoolScalingDownV1Beta2Condition is true if replicas > desired replicas. + MachinePoolScalingDownV1Beta2Condition = clusterv1beta1.ScalingDownV1Beta2Condition + + // MachinePoolRemediatingV1Beta2Condition surfaces details about ongoing remediation of the controlled machines, if any. + MachinePoolRemediatingV1Beta2Condition = clusterv1beta1.RemediatingV1Beta2Condition + + // MachinePoolDeletingV1Beta2Condition surfaces details about ongoing deletion of the controlled machines. + MachinePoolDeletingV1Beta2Condition = clusterv1beta1.DeletingV1Beta2Condition +). +*/ + +// MachinePoolSpec defines the desired state of MachinePool. +type MachinePoolSpec struct { + // clusterName is the name of the Cluster this object belongs to. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + ClusterName string `json:"clusterName"` + + // replicas is the number of desired machines. Defaults to 1. + // This is a pointer to distinguish between explicit zero and not specified. + // +optional + Replicas *int32 `json:"replicas,omitempty"` + + // template describes the machines that will be created. + // +required + Template MachineTemplateSpec `json:"template"` + + // minReadySeconds is the 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 + // +kubebuilder:validation:MaxItems=10000 + // +kubebuilder:validation:items:MinLength=1 + // +kubebuilder:validation:items:MaxLength=512 + ProviderIDList []string `json:"providerIDList,omitempty"` + + // failureDomains is the list of failure domains this MachinePool should be attached to. + // +optional + // +kubebuilder:validation:MaxItems=100 + // +kubebuilder:validation:items:MinLength=1 + // +kubebuilder:validation:items:MaxLength=256 + FailureDomains []string `json:"failureDomains,omitempty"` +} + +// MachinePoolStatus defines the observed state of MachinePool. +type MachinePoolStatus struct { + // nodeRefs will point to the corresponding Nodes if it they exist. + // +optional + // +kubebuilder:validation:MaxItems=10000 + NodeRefs []corev1.ObjectReference `json:"nodeRefs,omitempty"` + + // replicas is the most recently observed number of replicas. + // +optional + Replicas int32 `json:"replicas"` + + // readyReplicas is 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"` + + // availableReplicas is the number of available replicas (ready for at least minReadySeconds) for this MachinePool. + // +optional + AvailableReplicas int32 `json:"availableReplicas,omitempty"` + + // unavailableReplicas is the 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. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +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. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +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. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=10240 + FailureMessage *string `json:"failureMessage,omitempty"` + + // phase represents the current phase of cluster actuation. + // +optional + // +kubebuilder:validation:Enum=Pending;Provisioning;Provisioned;Running;ScalingUp;ScalingDown;Scaling;Deleting;Failed;Unknown + 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 Conditions `json:"conditions,omitempty"` + + // v1beta2 groups all the fields that will be added or modified in MachinePool's status with the V1Beta2 version. + // +optional + V1Beta2 *MachinePoolV1Beta2Status `json:"v1beta2,omitempty"` +} + +// MachinePoolV1Beta2Status groups all the fields that will be added or modified in MachinePoolStatus with the V1Beta2 version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachinePoolV1Beta2Status struct { + // conditions represents the observations of a MachinePool's current state. + // Known condition types are Available, BootstrapConfigReady, InfrastructureReady, MachinesReady, MachinesUpToDate, + // ScalingUp, ScalingDown, Remediating, Deleting, Paused. + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=32 + Conditions []metav1.Condition `json:"conditions,omitempty"` + + // readyReplicas is the number of ready replicas for this MachinePool. A machine is considered ready when Machine's Ready condition is true. + // +optional + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + + // availableReplicas is the number of available replicas for this MachinePool. A machine is considered available when Machine's Available condition is true. + // +optional + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + + // upToDateReplicas is the number of up-to-date replicas targeted by this MachinePool. A machine is considered up-to-date when Machine's UpToDate condition is true. + // +optional + UpToDateReplicas *int32 `json:"upToDateReplicas,omitempty"` +} + +// 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") + + // MachinePoolPhaseScaling is the MachinePool state when the + // MachinePool infrastructure is scaling. + // This phase value is appropriate to indicate an active state of scaling by an external autoscaler. + MachinePoolPhaseScaling = MachinePoolPhase("Scaling") + + // 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, + MachinePoolPhaseScaling, + 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:deprecatedversion +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" +// +kubebuilder:printcolumn:name="Desired",type=integer,JSONPath=".spec.replicas",description="Total number of machines desired by this MachinePool",priority=10 +// +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="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachinePool" +// +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"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec is the desired state of MachinePool. + // +optional + Spec MachinePoolSpec `json:"spec,omitempty"` + // status is the observed state of MachinePool. + // +optional + Status MachinePoolStatus `json:"status,omitempty"` +} + +// GetConditions returns the set of conditions for this object. +func (m *MachinePool) GetConditions() Conditions { + return m.Status.Conditions +} + +// SetConditions sets the conditions on this object. +func (m *MachinePool) SetConditions(conditions Conditions) { + m.Status.Conditions = conditions +} + +// GetV1Beta2Conditions returns the set of conditions for this object. +func (m *MachinePool) GetV1Beta2Conditions() []metav1.Condition { + if m.Status.V1Beta2 == nil { + return nil + } + return m.Status.V1Beta2.Conditions +} + +// SetV1Beta2Conditions sets conditions for an API object. +func (m *MachinePool) SetV1Beta2Conditions(conditions []metav1.Condition) { + if m.Status.V1Beta2 == nil { + m.Status.V1Beta2 = &MachinePoolV1Beta2Status{} + } + m.Status.V1Beta2.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// MachinePoolList contains a list of MachinePool. +type MachinePoolList struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + // items is the list of MachinePools. + Items []MachinePool `json:"items"` +} + +func init() { + objectTypes = append(objectTypes, &MachinePool{}, &MachinePoolList{}) +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/machineset_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machineset_types.go similarity index 96% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/machineset_types.go rename to vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machineset_types.go index cf52f70a16..e302d020d3 100644 --- a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/machineset_types.go +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machineset_types.go @@ -35,8 +35,6 @@ const ( MachineSetFinalizer = "cluster.x-k8s.io/machineset" ) -// ANCHOR: MachineSetSpec - // MachineSetSpec defines the desired state of MachineSet. type MachineSetSpec struct { // clusterName is the name of the Cluster this object belongs to. @@ -233,10 +231,6 @@ const ( MachineSetDeletingInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason ) -// ANCHOR_END: MachineSetSpec - -// ANCHOR: MachineTemplateSpec - // MachineTemplateSpec describes the data needed to create a Machine from a template. type MachineTemplateSpec struct { // metadata is the standard object's metadata. @@ -250,8 +244,6 @@ type MachineTemplateSpec struct { 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 @@ -279,8 +271,6 @@ const ( 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 @@ -297,7 +287,7 @@ type MachineSetStatus struct { // fullyLabeledReplicas is the number of replicas that have labels matching the labels of the machine template of the MachineSet. // - // Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. // // +optional FullyLabeledReplicas int32 `json:"fullyLabeledReplicas"` @@ -337,7 +327,7 @@ type MachineSetStatus struct { // can be added as events to the MachineSet object and/or logged in the // controller's output. // - // Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. // // +optional FailureReason *capierrors.MachineSetStatusError `json:"failureReason,omitempty"` @@ -346,7 +336,7 @@ type MachineSetStatus struct { // reconciling the Machine and will contain a more verbose string suitable // for logging and human consumption. // - // Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. // // +optional // +kubebuilder:validation:MinLength=1 @@ -386,8 +376,6 @@ type MachineSetV1Beta2Status struct { UpToDateReplicas *int32 `json:"upToDateReplicas,omitempty"` } -// ANCHOR_END: MachineSetStatus - // Validate validates the MachineSet fields. func (m *MachineSet) Validate() field.ErrorList { errors := field.ErrorList{} @@ -413,7 +401,7 @@ func (m *MachineSet) Validate() field.ErrorList { // +kubebuilder:object:root=true // +kubebuilder:resource:path=machinesets,shortName=ms,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion +// +kubebuilder:deprecatedversion // +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/vendor/sigs.k8s.io/cluster-api/api/v1beta1/v1beta2_condition_consts.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/v1beta2_condition_consts.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/v1beta2_condition_consts.go rename to vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/v1beta2_condition_consts.go diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.conversion.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.conversion.go new file mode 100644 index 0000000000..eb54f254dd --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.conversion.go @@ -0,0 +1,3728 @@ +//go:build !ignore_autogenerated +// +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 v1beta1 + +import ( + unsafe "unsafe" + + corev1 "k8s.io/api/core/v1" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" + v1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +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), (*v1beta2.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_APIEndpoint_To_v1beta2_APIEndpoint(a.(*APIEndpoint), b.(*v1beta2.APIEndpoint), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.APIEndpoint)(nil), (*APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_APIEndpoint_To_v1beta1_APIEndpoint(a.(*v1beta2.APIEndpoint), b.(*APIEndpoint), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Cluster)(nil), (*v1beta2.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Cluster_To_v1beta2_Cluster(a.(*Cluster), b.(*v1beta2.Cluster), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.Cluster)(nil), (*Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_Cluster_To_v1beta1_Cluster(a.(*v1beta2.Cluster), b.(*Cluster), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClusterAvailabilityGate)(nil), (*v1beta2.ClusterAvailabilityGate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterAvailabilityGate_To_v1beta2_ClusterAvailabilityGate(a.(*ClusterAvailabilityGate), b.(*v1beta2.ClusterAvailabilityGate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.ClusterAvailabilityGate)(nil), (*ClusterAvailabilityGate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ClusterAvailabilityGate_To_v1beta1_ClusterAvailabilityGate(a.(*v1beta2.ClusterAvailabilityGate), b.(*ClusterAvailabilityGate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClusterClass)(nil), (*v1beta2.ClusterClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterClass_To_v1beta2_ClusterClass(a.(*ClusterClass), b.(*v1beta2.ClusterClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClusterClassList)(nil), (*v1beta2.ClusterClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterClassList_To_v1beta2_ClusterClassList(a.(*ClusterClassList), b.(*v1beta2.ClusterClassList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.ClusterClassList)(nil), (*ClusterClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ClusterClassList_To_v1beta1_ClusterClassList(a.(*v1beta2.ClusterClassList), b.(*ClusterClassList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClusterClassPatch)(nil), (*v1beta2.ClusterClassPatch)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterClassPatch_To_v1beta2_ClusterClassPatch(a.(*ClusterClassPatch), b.(*v1beta2.ClusterClassPatch), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.ClusterClassPatch)(nil), (*ClusterClassPatch)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ClusterClassPatch_To_v1beta1_ClusterClassPatch(a.(*v1beta2.ClusterClassPatch), b.(*ClusterClassPatch), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClusterClassStatusVariable)(nil), (*v1beta2.ClusterClassStatusVariable)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterClassStatusVariable_To_v1beta2_ClusterClassStatusVariable(a.(*ClusterClassStatusVariable), b.(*v1beta2.ClusterClassStatusVariable), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.ClusterClassStatusVariable)(nil), (*ClusterClassStatusVariable)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ClusterClassStatusVariable_To_v1beta1_ClusterClassStatusVariable(a.(*v1beta2.ClusterClassStatusVariable), b.(*ClusterClassStatusVariable), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClusterClassVariableMetadata)(nil), (*v1beta2.ClusterClassVariableMetadata)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterClassVariableMetadata_To_v1beta2_ClusterClassVariableMetadata(a.(*ClusterClassVariableMetadata), b.(*v1beta2.ClusterClassVariableMetadata), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.ClusterClassVariableMetadata)(nil), (*ClusterClassVariableMetadata)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ClusterClassVariableMetadata_To_v1beta1_ClusterClassVariableMetadata(a.(*v1beta2.ClusterClassVariableMetadata), b.(*ClusterClassVariableMetadata), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClusterControlPlaneStatus)(nil), (*v1beta2.ClusterControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterControlPlaneStatus_To_v1beta2_ClusterControlPlaneStatus(a.(*ClusterControlPlaneStatus), b.(*v1beta2.ClusterControlPlaneStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.ClusterControlPlaneStatus)(nil), (*ClusterControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ClusterControlPlaneStatus_To_v1beta1_ClusterControlPlaneStatus(a.(*v1beta2.ClusterControlPlaneStatus), b.(*ClusterControlPlaneStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClusterList)(nil), (*v1beta2.ClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterList_To_v1beta2_ClusterList(a.(*ClusterList), b.(*v1beta2.ClusterList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.ClusterList)(nil), (*ClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ClusterList_To_v1beta1_ClusterList(a.(*v1beta2.ClusterList), b.(*ClusterList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.ClusterVariable)(nil), (*ClusterVariable)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ClusterVariable_To_v1beta1_ClusterVariable(a.(*v1beta2.ClusterVariable), b.(*ClusterVariable), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Condition)(nil), (*v1beta2.Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Condition_To_v1beta2_Condition(a.(*Condition), b.(*v1beta2.Condition), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.Condition)(nil), (*Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_Condition_To_v1beta1_Condition(a.(*v1beta2.Condition), b.(*Condition), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ControlPlaneVariables)(nil), (*v1beta2.ControlPlaneVariables)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ControlPlaneVariables_To_v1beta2_ControlPlaneVariables(a.(*ControlPlaneVariables), b.(*v1beta2.ControlPlaneVariables), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.ControlPlaneVariables)(nil), (*ControlPlaneVariables)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ControlPlaneVariables_To_v1beta1_ControlPlaneVariables(a.(*v1beta2.ControlPlaneVariables), b.(*ControlPlaneVariables), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*JSONPatch)(nil), (*v1beta2.JSONPatch)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_JSONPatch_To_v1beta2_JSONPatch(a.(*JSONPatch), b.(*v1beta2.JSONPatch), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.JSONPatch)(nil), (*JSONPatch)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_JSONPatch_To_v1beta1_JSONPatch(a.(*v1beta2.JSONPatch), b.(*JSONPatch), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*JSONPatchValue)(nil), (*v1beta2.JSONPatchValue)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_JSONPatchValue_To_v1beta2_JSONPatchValue(a.(*JSONPatchValue), b.(*v1beta2.JSONPatchValue), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.JSONPatchValue)(nil), (*JSONPatchValue)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_JSONPatchValue_To_v1beta1_JSONPatchValue(a.(*v1beta2.JSONPatchValue), b.(*JSONPatchValue), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Machine)(nil), (*v1beta2.Machine)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Machine_To_v1beta2_Machine(a.(*Machine), b.(*v1beta2.Machine), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.Machine)(nil), (*Machine)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_Machine_To_v1beta1_Machine(a.(*v1beta2.Machine), b.(*Machine), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineAddress)(nil), (*v1beta2.MachineAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineAddress_To_v1beta2_MachineAddress(a.(*MachineAddress), b.(*v1beta2.MachineAddress), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachineAddress)(nil), (*MachineAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineAddress_To_v1beta1_MachineAddress(a.(*v1beta2.MachineAddress), b.(*MachineAddress), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineDeployment)(nil), (*v1beta2.MachineDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeployment_To_v1beta2_MachineDeployment(a.(*MachineDeployment), b.(*v1beta2.MachineDeployment), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachineDeployment)(nil), (*MachineDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineDeployment_To_v1beta1_MachineDeployment(a.(*v1beta2.MachineDeployment), b.(*MachineDeployment), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineDeploymentList)(nil), (*v1beta2.MachineDeploymentList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeploymentList_To_v1beta2_MachineDeploymentList(a.(*MachineDeploymentList), b.(*v1beta2.MachineDeploymentList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachineDeploymentList)(nil), (*MachineDeploymentList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineDeploymentList_To_v1beta1_MachineDeploymentList(a.(*v1beta2.MachineDeploymentList), b.(*MachineDeploymentList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineDeploymentVariables)(nil), (*v1beta2.MachineDeploymentVariables)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeploymentVariables_To_v1beta2_MachineDeploymentVariables(a.(*MachineDeploymentVariables), b.(*v1beta2.MachineDeploymentVariables), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachineDeploymentVariables)(nil), (*MachineDeploymentVariables)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineDeploymentVariables_To_v1beta1_MachineDeploymentVariables(a.(*v1beta2.MachineDeploymentVariables), b.(*MachineDeploymentVariables), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineDrainRule)(nil), (*v1beta2.MachineDrainRule)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDrainRule_To_v1beta2_MachineDrainRule(a.(*MachineDrainRule), b.(*v1beta2.MachineDrainRule), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachineDrainRule)(nil), (*MachineDrainRule)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineDrainRule_To_v1beta1_MachineDrainRule(a.(*v1beta2.MachineDrainRule), b.(*MachineDrainRule), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineDrainRuleDrainConfig)(nil), (*v1beta2.MachineDrainRuleDrainConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDrainRuleDrainConfig_To_v1beta2_MachineDrainRuleDrainConfig(a.(*MachineDrainRuleDrainConfig), b.(*v1beta2.MachineDrainRuleDrainConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachineDrainRuleDrainConfig)(nil), (*MachineDrainRuleDrainConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineDrainRuleDrainConfig_To_v1beta1_MachineDrainRuleDrainConfig(a.(*v1beta2.MachineDrainRuleDrainConfig), b.(*MachineDrainRuleDrainConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineDrainRuleList)(nil), (*v1beta2.MachineDrainRuleList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDrainRuleList_To_v1beta2_MachineDrainRuleList(a.(*MachineDrainRuleList), b.(*v1beta2.MachineDrainRuleList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachineDrainRuleList)(nil), (*MachineDrainRuleList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineDrainRuleList_To_v1beta1_MachineDrainRuleList(a.(*v1beta2.MachineDrainRuleList), b.(*MachineDrainRuleList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineDrainRuleMachineSelector)(nil), (*v1beta2.MachineDrainRuleMachineSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDrainRuleMachineSelector_To_v1beta2_MachineDrainRuleMachineSelector(a.(*MachineDrainRuleMachineSelector), b.(*v1beta2.MachineDrainRuleMachineSelector), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachineDrainRuleMachineSelector)(nil), (*MachineDrainRuleMachineSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineDrainRuleMachineSelector_To_v1beta1_MachineDrainRuleMachineSelector(a.(*v1beta2.MachineDrainRuleMachineSelector), b.(*MachineDrainRuleMachineSelector), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineDrainRulePodSelector)(nil), (*v1beta2.MachineDrainRulePodSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDrainRulePodSelector_To_v1beta2_MachineDrainRulePodSelector(a.(*MachineDrainRulePodSelector), b.(*v1beta2.MachineDrainRulePodSelector), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachineDrainRulePodSelector)(nil), (*MachineDrainRulePodSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineDrainRulePodSelector_To_v1beta1_MachineDrainRulePodSelector(a.(*v1beta2.MachineDrainRulePodSelector), b.(*MachineDrainRulePodSelector), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineDrainRuleSpec)(nil), (*v1beta2.MachineDrainRuleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDrainRuleSpec_To_v1beta2_MachineDrainRuleSpec(a.(*MachineDrainRuleSpec), b.(*v1beta2.MachineDrainRuleSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachineDrainRuleSpec)(nil), (*MachineDrainRuleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineDrainRuleSpec_To_v1beta1_MachineDrainRuleSpec(a.(*v1beta2.MachineDrainRuleSpec), b.(*MachineDrainRuleSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineHealthCheck)(nil), (*v1beta2.MachineHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineHealthCheck_To_v1beta2_MachineHealthCheck(a.(*MachineHealthCheck), b.(*v1beta2.MachineHealthCheck), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachineHealthCheck)(nil), (*MachineHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineHealthCheck_To_v1beta1_MachineHealthCheck(a.(*v1beta2.MachineHealthCheck), b.(*MachineHealthCheck), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineHealthCheckList)(nil), (*v1beta2.MachineHealthCheckList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineHealthCheckList_To_v1beta2_MachineHealthCheckList(a.(*MachineHealthCheckList), b.(*v1beta2.MachineHealthCheckList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachineHealthCheckList)(nil), (*MachineHealthCheckList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(a.(*v1beta2.MachineHealthCheckList), b.(*MachineHealthCheckList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineList)(nil), (*v1beta2.MachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineList_To_v1beta2_MachineList(a.(*MachineList), b.(*v1beta2.MachineList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachineList)(nil), (*MachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineList_To_v1beta1_MachineList(a.(*v1beta2.MachineList), b.(*MachineList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachinePool)(nil), (*v1beta2.MachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachinePool_To_v1beta2_MachinePool(a.(*MachinePool), b.(*v1beta2.MachinePool), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachinePool)(nil), (*MachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachinePool_To_v1beta1_MachinePool(a.(*v1beta2.MachinePool), b.(*MachinePool), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachinePoolList)(nil), (*v1beta2.MachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachinePoolList_To_v1beta2_MachinePoolList(a.(*MachinePoolList), b.(*v1beta2.MachinePoolList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachinePoolList)(nil), (*MachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachinePoolList_To_v1beta1_MachinePoolList(a.(*v1beta2.MachinePoolList), b.(*MachinePoolList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachinePoolSpec)(nil), (*MachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachinePoolSpec_To_v1beta1_MachinePoolSpec(a.(*v1beta2.MachinePoolSpec), b.(*MachinePoolSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachinePoolVariables)(nil), (*v1beta2.MachinePoolVariables)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachinePoolVariables_To_v1beta2_MachinePoolVariables(a.(*MachinePoolVariables), b.(*v1beta2.MachinePoolVariables), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachinePoolVariables)(nil), (*MachinePoolVariables)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachinePoolVariables_To_v1beta1_MachinePoolVariables(a.(*v1beta2.MachinePoolVariables), b.(*MachinePoolVariables), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineReadinessGate)(nil), (*v1beta2.MachineReadinessGate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineReadinessGate_To_v1beta2_MachineReadinessGate(a.(*MachineReadinessGate), b.(*v1beta2.MachineReadinessGate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachineReadinessGate)(nil), (*MachineReadinessGate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineReadinessGate_To_v1beta1_MachineReadinessGate(a.(*v1beta2.MachineReadinessGate), b.(*MachineReadinessGate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineSet)(nil), (*v1beta2.MachineSet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineSet_To_v1beta2_MachineSet(a.(*MachineSet), b.(*v1beta2.MachineSet), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachineSet)(nil), (*MachineSet)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineSet_To_v1beta1_MachineSet(a.(*v1beta2.MachineSet), b.(*MachineSet), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineSetList)(nil), (*v1beta2.MachineSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineSetList_To_v1beta2_MachineSetList(a.(*MachineSetList), b.(*v1beta2.MachineSetList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachineSetList)(nil), (*MachineSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineSetList_To_v1beta1_MachineSetList(a.(*v1beta2.MachineSetList), b.(*MachineSetList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MachineTemplateSpec)(nil), (*v1beta2.MachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineTemplateSpec_To_v1beta2_MachineTemplateSpec(a.(*MachineTemplateSpec), b.(*v1beta2.MachineTemplateSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.MachineTemplateSpec)(nil), (*MachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(a.(*v1beta2.MachineTemplateSpec), b.(*MachineTemplateSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*NetworkRanges)(nil), (*v1beta2.NetworkRanges)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_NetworkRanges_To_v1beta2_NetworkRanges(a.(*NetworkRanges), b.(*v1beta2.NetworkRanges), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.NetworkRanges)(nil), (*NetworkRanges)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_NetworkRanges_To_v1beta1_NetworkRanges(a.(*v1beta2.NetworkRanges), b.(*NetworkRanges), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ObjectMeta)(nil), (*v1beta2.ObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ObjectMeta_To_v1beta2_ObjectMeta(a.(*ObjectMeta), b.(*v1beta2.ObjectMeta), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.ObjectMeta)(nil), (*ObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ObjectMeta_To_v1beta1_ObjectMeta(a.(*v1beta2.ObjectMeta), b.(*ObjectMeta), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*PatchDefinition)(nil), (*v1beta2.PatchDefinition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_PatchDefinition_To_v1beta2_PatchDefinition(a.(*PatchDefinition), b.(*v1beta2.PatchDefinition), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.PatchDefinition)(nil), (*PatchDefinition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_PatchDefinition_To_v1beta1_PatchDefinition(a.(*v1beta2.PatchDefinition), b.(*PatchDefinition), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*PatchSelector)(nil), (*v1beta2.PatchSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_PatchSelector_To_v1beta2_PatchSelector(a.(*PatchSelector), b.(*v1beta2.PatchSelector), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.PatchSelector)(nil), (*PatchSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_PatchSelector_To_v1beta1_PatchSelector(a.(*v1beta2.PatchSelector), b.(*PatchSelector), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*PatchSelectorMatch)(nil), (*v1beta2.PatchSelectorMatch)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_PatchSelectorMatch_To_v1beta2_PatchSelectorMatch(a.(*PatchSelectorMatch), b.(*v1beta2.PatchSelectorMatch), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.PatchSelectorMatch)(nil), (*PatchSelectorMatch)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_PatchSelectorMatch_To_v1beta1_PatchSelectorMatch(a.(*v1beta2.PatchSelectorMatch), b.(*PatchSelectorMatch), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*PatchSelectorMatchMachineDeploymentClass)(nil), (*v1beta2.PatchSelectorMatchMachineDeploymentClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_PatchSelectorMatchMachineDeploymentClass_To_v1beta2_PatchSelectorMatchMachineDeploymentClass(a.(*PatchSelectorMatchMachineDeploymentClass), b.(*v1beta2.PatchSelectorMatchMachineDeploymentClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.PatchSelectorMatchMachineDeploymentClass)(nil), (*PatchSelectorMatchMachineDeploymentClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_PatchSelectorMatchMachineDeploymentClass_To_v1beta1_PatchSelectorMatchMachineDeploymentClass(a.(*v1beta2.PatchSelectorMatchMachineDeploymentClass), b.(*PatchSelectorMatchMachineDeploymentClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*PatchSelectorMatchMachinePoolClass)(nil), (*v1beta2.PatchSelectorMatchMachinePoolClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_PatchSelectorMatchMachinePoolClass_To_v1beta2_PatchSelectorMatchMachinePoolClass(a.(*PatchSelectorMatchMachinePoolClass), b.(*v1beta2.PatchSelectorMatchMachinePoolClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.PatchSelectorMatchMachinePoolClass)(nil), (*PatchSelectorMatchMachinePoolClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_PatchSelectorMatchMachinePoolClass_To_v1beta1_PatchSelectorMatchMachinePoolClass(a.(*v1beta2.PatchSelectorMatchMachinePoolClass), b.(*PatchSelectorMatchMachinePoolClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ValidationRule)(nil), (*v1beta2.ValidationRule)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ValidationRule_To_v1beta2_ValidationRule(a.(*ValidationRule), b.(*v1beta2.ValidationRule), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.ValidationRule)(nil), (*ValidationRule)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ValidationRule_To_v1beta1_ValidationRule(a.(*v1beta2.ValidationRule), b.(*ValidationRule), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VariableSchema)(nil), (*v1beta2.VariableSchema)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_VariableSchema_To_v1beta2_VariableSchema(a.(*VariableSchema), b.(*v1beta2.VariableSchema), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.VariableSchema)(nil), (*VariableSchema)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_VariableSchema_To_v1beta1_VariableSchema(a.(*v1beta2.VariableSchema), b.(*VariableSchema), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VariableSchemaMetadata)(nil), (*v1beta2.VariableSchemaMetadata)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_VariableSchemaMetadata_To_v1beta2_VariableSchemaMetadata(a.(*VariableSchemaMetadata), b.(*v1beta2.VariableSchemaMetadata), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.VariableSchemaMetadata)(nil), (*VariableSchemaMetadata)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_VariableSchemaMetadata_To_v1beta1_VariableSchemaMetadata(a.(*v1beta2.VariableSchemaMetadata), b.(*VariableSchemaMetadata), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*WorkersClass)(nil), (*v1beta2.WorkersClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_WorkersClass_To_v1beta2_WorkersClass(a.(*WorkersClass), b.(*v1beta2.WorkersClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.WorkersClass)(nil), (*WorkersClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_WorkersClass_To_v1beta1_WorkersClass(a.(*v1beta2.WorkersClass), b.(*WorkersClass), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*WorkersStatus)(nil), (*v1beta2.WorkersStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_WorkersStatus_To_v1beta2_WorkersStatus(a.(*WorkersStatus), b.(*v1beta2.WorkersStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.WorkersStatus)(nil), (*WorkersStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_WorkersStatus_To_v1beta1_WorkersStatus(a.(*v1beta2.WorkersStatus), b.(*WorkersStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*WorkersTopology)(nil), (*v1beta2.WorkersTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_WorkersTopology_To_v1beta2_WorkersTopology(a.(*WorkersTopology), b.(*v1beta2.WorkersTopology), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.WorkersTopology)(nil), (*WorkersTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_WorkersTopology_To_v1beta1_WorkersTopology(a.(*v1beta2.WorkersTopology), b.(*WorkersTopology), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1.Condition)(nil), (*Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_Condition_To_v1beta1_Condition(a.(*v1.Condition), b.(*Condition), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*corev1.ObjectReference)(nil), (*v1beta2.ContractVersionedObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_ObjectReference_To_v1beta2_ContractVersionedObjectReference(a.(*corev1.ObjectReference), b.(*v1beta2.ContractVersionedObjectReference), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*corev1.ObjectReference)(nil), (*v1beta2.MachineHealthCheckRemediationTemplateReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_ObjectReference_To_v1beta2_MachineHealthCheckRemediationTemplateReference(a.(*corev1.ObjectReference), b.(*v1beta2.MachineHealthCheckRemediationTemplateReference), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*corev1.ObjectReference)(nil), (*v1beta2.MachineNodeReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_ObjectReference_To_v1beta2_MachineNodeReference(a.(*corev1.ObjectReference), b.(*v1beta2.MachineNodeReference), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*Bootstrap)(nil), (*v1beta2.Bootstrap)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Bootstrap_To_v1beta2_Bootstrap(a.(*Bootstrap), b.(*v1beta2.Bootstrap), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*ClusterClassSpec)(nil), (*v1beta2.ClusterClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterClassSpec_To_v1beta2_ClusterClassSpec(a.(*ClusterClassSpec), b.(*v1beta2.ClusterClassSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*ClusterClassStatusVariableDefinition)(nil), (*v1beta2.ClusterClassStatusVariableDefinition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterClassStatusVariableDefinition_To_v1beta2_ClusterClassStatusVariableDefinition(a.(*ClusterClassStatusVariableDefinition), b.(*v1beta2.ClusterClassStatusVariableDefinition), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*ClusterClassStatus)(nil), (*v1beta2.ClusterClassStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterClassStatus_To_v1beta2_ClusterClassStatus(a.(*ClusterClassStatus), b.(*v1beta2.ClusterClassStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*ClusterClassVariable)(nil), (*v1beta2.ClusterClassVariable)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterClassVariable_To_v1beta2_ClusterClassVariable(a.(*ClusterClassVariable), b.(*v1beta2.ClusterClassVariable), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*ClusterNetwork)(nil), (*v1beta2.ClusterNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterNetwork_To_v1beta2_ClusterNetwork(a.(*ClusterNetwork), b.(*v1beta2.ClusterNetwork), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*ClusterSpec)(nil), (*v1beta2.ClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterSpec_To_v1beta2_ClusterSpec(a.(*ClusterSpec), b.(*v1beta2.ClusterSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*ClusterStatus)(nil), (*v1beta2.ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterStatus_To_v1beta2_ClusterStatus(a.(*ClusterStatus), b.(*v1beta2.ClusterStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*ClusterVariable)(nil), (*v1beta2.ClusterVariable)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterVariable_To_v1beta2_ClusterVariable(a.(*ClusterVariable), b.(*v1beta2.ClusterVariable), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*Condition)(nil), (*v1.Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Condition_To_v1_Condition(a.(*Condition), b.(*v1.Condition), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*ControlPlaneClass)(nil), (*v1beta2.ControlPlaneClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ControlPlaneClass_To_v1beta2_ControlPlaneClass(a.(*ControlPlaneClass), b.(*v1beta2.ControlPlaneClass), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*ControlPlaneTopology)(nil), (*v1beta2.ControlPlaneTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ControlPlaneTopology_To_v1beta2_ControlPlaneTopology(a.(*ControlPlaneTopology), b.(*v1beta2.ControlPlaneTopology), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*ExternalPatchDefinition)(nil), (*v1beta2.ExternalPatchDefinition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ExternalPatchDefinition_To_v1beta2_ExternalPatchDefinition(a.(*ExternalPatchDefinition), b.(*v1beta2.ExternalPatchDefinition), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*JSONSchemaProps)(nil), (*v1beta2.JSONSchemaProps)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_JSONSchemaProps_To_v1beta2_JSONSchemaProps(a.(*JSONSchemaProps), b.(*v1beta2.JSONSchemaProps), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*LocalObjectTemplate)(nil), (*v1beta2.ControlPlaneClassMachineInfrastructureTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_LocalObjectTemplate_To_v1beta2_ControlPlaneClassMachineInfrastructureTemplate(a.(*LocalObjectTemplate), b.(*v1beta2.ControlPlaneClassMachineInfrastructureTemplate), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*LocalObjectTemplate)(nil), (*v1beta2.InfrastructureClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_LocalObjectTemplate_To_v1beta2_InfrastructureClass(a.(*LocalObjectTemplate), b.(*v1beta2.InfrastructureClass), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*LocalObjectTemplate)(nil), (*v1beta2.MachineDeploymentClassBootstrapTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_LocalObjectTemplate_To_v1beta2_MachineDeploymentClassBootstrapTemplate(a.(*LocalObjectTemplate), b.(*v1beta2.MachineDeploymentClassBootstrapTemplate), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*LocalObjectTemplate)(nil), (*v1beta2.MachineDeploymentClassInfrastructureTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_LocalObjectTemplate_To_v1beta2_MachineDeploymentClassInfrastructureTemplate(a.(*LocalObjectTemplate), b.(*v1beta2.MachineDeploymentClassInfrastructureTemplate), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*LocalObjectTemplate)(nil), (*v1beta2.MachinePoolClassBootstrapTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_LocalObjectTemplate_To_v1beta2_MachinePoolClassBootstrapTemplate(a.(*LocalObjectTemplate), b.(*v1beta2.MachinePoolClassBootstrapTemplate), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*LocalObjectTemplate)(nil), (*v1beta2.MachinePoolClassInfrastructureTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_LocalObjectTemplate_To_v1beta2_MachinePoolClassInfrastructureTemplate(a.(*LocalObjectTemplate), b.(*v1beta2.MachinePoolClassInfrastructureTemplate), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*MachineDeletionStatus)(nil), (*v1beta2.MachineDeletionStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeletionStatus_To_v1beta2_MachineDeletionStatus(a.(*MachineDeletionStatus), b.(*v1beta2.MachineDeletionStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*MachineDeploymentClass)(nil), (*v1beta2.MachineDeploymentClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeploymentClass_To_v1beta2_MachineDeploymentClass(a.(*MachineDeploymentClass), b.(*v1beta2.MachineDeploymentClass), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*MachineDeploymentSpec)(nil), (*v1beta2.MachineDeploymentSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeploymentSpec_To_v1beta2_MachineDeploymentSpec(a.(*MachineDeploymentSpec), b.(*v1beta2.MachineDeploymentSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*MachineDeploymentStatus)(nil), (*v1beta2.MachineDeploymentStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeploymentStatus_To_v1beta2_MachineDeploymentStatus(a.(*MachineDeploymentStatus), b.(*v1beta2.MachineDeploymentStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*MachineDeploymentTopology)(nil), (*v1beta2.MachineDeploymentTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineDeploymentTopology_To_v1beta2_MachineDeploymentTopology(a.(*MachineDeploymentTopology), b.(*v1beta2.MachineDeploymentTopology), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*MachineHealthCheckSpec)(nil), (*v1beta2.MachineHealthCheckSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineHealthCheckSpec_To_v1beta2_MachineHealthCheckSpec(a.(*MachineHealthCheckSpec), b.(*v1beta2.MachineHealthCheckSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*MachineHealthCheckStatus)(nil), (*v1beta2.MachineHealthCheckStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineHealthCheckStatus_To_v1beta2_MachineHealthCheckStatus(a.(*MachineHealthCheckStatus), b.(*v1beta2.MachineHealthCheckStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*MachinePoolClass)(nil), (*v1beta2.MachinePoolClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachinePoolClass_To_v1beta2_MachinePoolClass(a.(*MachinePoolClass), b.(*v1beta2.MachinePoolClass), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*MachinePoolSpec)(nil), (*v1beta2.MachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachinePoolSpec_To_v1beta2_MachinePoolSpec(a.(*MachinePoolSpec), b.(*v1beta2.MachinePoolSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*MachinePoolStatus)(nil), (*v1beta2.MachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachinePoolStatus_To_v1beta2_MachinePoolStatus(a.(*MachinePoolStatus), b.(*v1beta2.MachinePoolStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*MachinePoolTopology)(nil), (*v1beta2.MachinePoolTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachinePoolTopology_To_v1beta2_MachinePoolTopology(a.(*MachinePoolTopology), b.(*v1beta2.MachinePoolTopology), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*MachineSetSpec)(nil), (*v1beta2.MachineSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineSetSpec_To_v1beta2_MachineSetSpec(a.(*MachineSetSpec), b.(*v1beta2.MachineSetSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*MachineSetStatus)(nil), (*v1beta2.MachineSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineSetStatus_To_v1beta2_MachineSetStatus(a.(*MachineSetStatus), b.(*v1beta2.MachineSetStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*MachineSpec)(nil), (*v1beta2.MachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineSpec_To_v1beta2_MachineSpec(a.(*MachineSpec), b.(*v1beta2.MachineSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*MachineStatus)(nil), (*v1beta2.MachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MachineStatus_To_v1beta2_MachineStatus(a.(*MachineStatus), b.(*v1beta2.MachineStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*Topology)(nil), (*v1beta2.Topology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Topology_To_v1beta2_Topology(a.(*Topology), b.(*v1beta2.Topology), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.Bootstrap)(nil), (*Bootstrap)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_Bootstrap_To_v1beta1_Bootstrap(a.(*v1beta2.Bootstrap), b.(*Bootstrap), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.ClusterClassSpec)(nil), (*ClusterClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ClusterClassSpec_To_v1beta1_ClusterClassSpec(a.(*v1beta2.ClusterClassSpec), b.(*ClusterClassSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.ClusterClassStatusVariableDefinition)(nil), (*ClusterClassStatusVariableDefinition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ClusterClassStatusVariableDefinition_To_v1beta1_ClusterClassStatusVariableDefinition(a.(*v1beta2.ClusterClassStatusVariableDefinition), b.(*ClusterClassStatusVariableDefinition), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.ClusterClassStatus)(nil), (*ClusterClassStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ClusterClassStatus_To_v1beta1_ClusterClassStatus(a.(*v1beta2.ClusterClassStatus), b.(*ClusterClassStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.ClusterClassVariable)(nil), (*ClusterClassVariable)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ClusterClassVariable_To_v1beta1_ClusterClassVariable(a.(*v1beta2.ClusterClassVariable), b.(*ClusterClassVariable), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.ClusterClass)(nil), (*ClusterClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ClusterClass_To_v1beta1_ClusterClass(a.(*v1beta2.ClusterClass), b.(*ClusterClass), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.ClusterNetwork)(nil), (*ClusterNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ClusterNetwork_To_v1beta1_ClusterNetwork(a.(*v1beta2.ClusterNetwork), b.(*ClusterNetwork), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.ClusterSpec)(nil), (*ClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ClusterSpec_To_v1beta1_ClusterSpec(a.(*v1beta2.ClusterSpec), b.(*ClusterSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.ClusterStatus)(nil), (*ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ClusterStatus_To_v1beta1_ClusterStatus(a.(*v1beta2.ClusterStatus), b.(*ClusterStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.ContractVersionedObjectReference)(nil), (*corev1.ObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ContractVersionedObjectReference_To_v1_ObjectReference(a.(*v1beta2.ContractVersionedObjectReference), b.(*corev1.ObjectReference), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.ControlPlaneClassMachineInfrastructureTemplate)(nil), (*LocalObjectTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ControlPlaneClassMachineInfrastructureTemplate_To_v1beta1_LocalObjectTemplate(a.(*v1beta2.ControlPlaneClassMachineInfrastructureTemplate), b.(*LocalObjectTemplate), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.ControlPlaneClass)(nil), (*ControlPlaneClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ControlPlaneClass_To_v1beta1_ControlPlaneClass(a.(*v1beta2.ControlPlaneClass), b.(*ControlPlaneClass), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.ControlPlaneTopology)(nil), (*ControlPlaneTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(a.(*v1beta2.ControlPlaneTopology), b.(*ControlPlaneTopology), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.ExternalPatchDefinition)(nil), (*ExternalPatchDefinition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_ExternalPatchDefinition_To_v1beta1_ExternalPatchDefinition(a.(*v1beta2.ExternalPatchDefinition), b.(*ExternalPatchDefinition), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.InfrastructureClass)(nil), (*LocalObjectTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_InfrastructureClass_To_v1beta1_LocalObjectTemplate(a.(*v1beta2.InfrastructureClass), b.(*LocalObjectTemplate), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.JSONSchemaProps)(nil), (*JSONSchemaProps)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_JSONSchemaProps_To_v1beta1_JSONSchemaProps(a.(*v1beta2.JSONSchemaProps), b.(*JSONSchemaProps), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachineDeletionStatus)(nil), (*MachineDeletionStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineDeletionStatus_To_v1beta1_MachineDeletionStatus(a.(*v1beta2.MachineDeletionStatus), b.(*MachineDeletionStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachineDeploymentClassBootstrapTemplate)(nil), (*LocalObjectTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineDeploymentClassBootstrapTemplate_To_v1beta1_LocalObjectTemplate(a.(*v1beta2.MachineDeploymentClassBootstrapTemplate), b.(*LocalObjectTemplate), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachineDeploymentClassInfrastructureTemplate)(nil), (*LocalObjectTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineDeploymentClassInfrastructureTemplate_To_v1beta1_LocalObjectTemplate(a.(*v1beta2.MachineDeploymentClassInfrastructureTemplate), b.(*LocalObjectTemplate), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachineDeploymentClass)(nil), (*MachineDeploymentClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(a.(*v1beta2.MachineDeploymentClass), b.(*MachineDeploymentClass), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachineDeploymentSpec)(nil), (*MachineDeploymentSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(a.(*v1beta2.MachineDeploymentSpec), b.(*MachineDeploymentSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachineDeploymentStatus)(nil), (*MachineDeploymentStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(a.(*v1beta2.MachineDeploymentStatus), b.(*MachineDeploymentStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachineDeploymentTopology)(nil), (*MachineDeploymentTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(a.(*v1beta2.MachineDeploymentTopology), b.(*MachineDeploymentTopology), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachineHealthCheckRemediationTemplateReference)(nil), (*corev1.ObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineHealthCheckRemediationTemplateReference_To_v1_ObjectReference(a.(*v1beta2.MachineHealthCheckRemediationTemplateReference), b.(*corev1.ObjectReference), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachineHealthCheckSpec)(nil), (*MachineHealthCheckSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(a.(*v1beta2.MachineHealthCheckSpec), b.(*MachineHealthCheckSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachineHealthCheckStatus)(nil), (*MachineHealthCheckStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(a.(*v1beta2.MachineHealthCheckStatus), b.(*MachineHealthCheckStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachineNodeReference)(nil), (*corev1.ObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineNodeReference_To_v1_ObjectReference(a.(*v1beta2.MachineNodeReference), b.(*corev1.ObjectReference), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachinePoolClassBootstrapTemplate)(nil), (*LocalObjectTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachinePoolClassBootstrapTemplate_To_v1beta1_LocalObjectTemplate(a.(*v1beta2.MachinePoolClassBootstrapTemplate), b.(*LocalObjectTemplate), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachinePoolClassInfrastructureTemplate)(nil), (*LocalObjectTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachinePoolClassInfrastructureTemplate_To_v1beta1_LocalObjectTemplate(a.(*v1beta2.MachinePoolClassInfrastructureTemplate), b.(*LocalObjectTemplate), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachinePoolClass)(nil), (*MachinePoolClass)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachinePoolClass_To_v1beta1_MachinePoolClass(a.(*v1beta2.MachinePoolClass), b.(*MachinePoolClass), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachinePoolStatus)(nil), (*MachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachinePoolStatus_To_v1beta1_MachinePoolStatus(a.(*v1beta2.MachinePoolStatus), b.(*MachinePoolStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachinePoolTopology)(nil), (*MachinePoolTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachinePoolTopology_To_v1beta1_MachinePoolTopology(a.(*v1beta2.MachinePoolTopology), b.(*MachinePoolTopology), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachineSetSpec)(nil), (*MachineSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineSetSpec_To_v1beta1_MachineSetSpec(a.(*v1beta2.MachineSetSpec), b.(*MachineSetSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachineSetStatus)(nil), (*MachineSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineSetStatus_To_v1beta1_MachineSetStatus(a.(*v1beta2.MachineSetStatus), b.(*MachineSetStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachineSpec)(nil), (*MachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineSpec_To_v1beta1_MachineSpec(a.(*v1beta2.MachineSpec), b.(*MachineSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.MachineStatus)(nil), (*MachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_MachineStatus_To_v1beta1_MachineStatus(a.(*v1beta2.MachineStatus), b.(*MachineStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.Topology)(nil), (*Topology)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_Topology_To_v1beta1_Topology(a.(*v1beta2.Topology), b.(*Topology), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1beta1_APIEndpoint_To_v1beta2_APIEndpoint(in *APIEndpoint, out *v1beta2.APIEndpoint, s conversion.Scope) error { + out.Host = in.Host + out.Port = in.Port + return nil +} + +// Convert_v1beta1_APIEndpoint_To_v1beta2_APIEndpoint is an autogenerated conversion function. +func Convert_v1beta1_APIEndpoint_To_v1beta2_APIEndpoint(in *APIEndpoint, out *v1beta2.APIEndpoint, s conversion.Scope) error { + return autoConvert_v1beta1_APIEndpoint_To_v1beta2_APIEndpoint(in, out, s) +} + +func autoConvert_v1beta2_APIEndpoint_To_v1beta1_APIEndpoint(in *v1beta2.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { + out.Host = in.Host + out.Port = in.Port + return nil +} + +// Convert_v1beta2_APIEndpoint_To_v1beta1_APIEndpoint is an autogenerated conversion function. +func Convert_v1beta2_APIEndpoint_To_v1beta1_APIEndpoint(in *v1beta2.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { + return autoConvert_v1beta2_APIEndpoint_To_v1beta1_APIEndpoint(in, out, s) +} + +func autoConvert_v1beta1_Bootstrap_To_v1beta2_Bootstrap(in *Bootstrap, out *v1beta2.Bootstrap, s conversion.Scope) error { + // WARNING: in.ConfigRef requires manual conversion: inconvertible types (*k8s.io/api/core/v1.ObjectReference vs sigs.k8s.io/cluster-api/api/core/v1beta2.ContractVersionedObjectReference) + out.DataSecretName = (*string)(unsafe.Pointer(in.DataSecretName)) + return nil +} + +func autoConvert_v1beta2_Bootstrap_To_v1beta1_Bootstrap(in *v1beta2.Bootstrap, out *Bootstrap, s conversion.Scope) error { + // WARNING: in.ConfigRef requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api/api/core/v1beta2.ContractVersionedObjectReference vs *k8s.io/api/core/v1.ObjectReference) + out.DataSecretName = (*string)(unsafe.Pointer(in.DataSecretName)) + return nil +} + +func autoConvert_v1beta1_Cluster_To_v1beta2_Cluster(in *Cluster, out *v1beta2.Cluster, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_ClusterSpec_To_v1beta2_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_ClusterStatus_To_v1beta2_ClusterStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_Cluster_To_v1beta2_Cluster is an autogenerated conversion function. +func Convert_v1beta1_Cluster_To_v1beta2_Cluster(in *Cluster, out *v1beta2.Cluster, s conversion.Scope) error { + return autoConvert_v1beta1_Cluster_To_v1beta2_Cluster(in, out, s) +} + +func autoConvert_v1beta2_Cluster_To_v1beta1_Cluster(in *v1beta2.Cluster, out *Cluster, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta2_ClusterSpec_To_v1beta1_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta2_ClusterStatus_To_v1beta1_ClusterStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_Cluster_To_v1beta1_Cluster is an autogenerated conversion function. +func Convert_v1beta2_Cluster_To_v1beta1_Cluster(in *v1beta2.Cluster, out *Cluster, s conversion.Scope) error { + return autoConvert_v1beta2_Cluster_To_v1beta1_Cluster(in, out, s) +} + +func autoConvert_v1beta1_ClusterAvailabilityGate_To_v1beta2_ClusterAvailabilityGate(in *ClusterAvailabilityGate, out *v1beta2.ClusterAvailabilityGate, s conversion.Scope) error { + out.ConditionType = in.ConditionType + out.Polarity = v1beta2.ConditionPolarity(in.Polarity) + return nil +} + +// Convert_v1beta1_ClusterAvailabilityGate_To_v1beta2_ClusterAvailabilityGate is an autogenerated conversion function. +func Convert_v1beta1_ClusterAvailabilityGate_To_v1beta2_ClusterAvailabilityGate(in *ClusterAvailabilityGate, out *v1beta2.ClusterAvailabilityGate, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterAvailabilityGate_To_v1beta2_ClusterAvailabilityGate(in, out, s) +} + +func autoConvert_v1beta2_ClusterAvailabilityGate_To_v1beta1_ClusterAvailabilityGate(in *v1beta2.ClusterAvailabilityGate, out *ClusterAvailabilityGate, s conversion.Scope) error { + out.ConditionType = in.ConditionType + out.Polarity = ConditionPolarity(in.Polarity) + return nil +} + +// Convert_v1beta2_ClusterAvailabilityGate_To_v1beta1_ClusterAvailabilityGate is an autogenerated conversion function. +func Convert_v1beta2_ClusterAvailabilityGate_To_v1beta1_ClusterAvailabilityGate(in *v1beta2.ClusterAvailabilityGate, out *ClusterAvailabilityGate, s conversion.Scope) error { + return autoConvert_v1beta2_ClusterAvailabilityGate_To_v1beta1_ClusterAvailabilityGate(in, out, s) +} + +func autoConvert_v1beta1_ClusterClass_To_v1beta2_ClusterClass(in *ClusterClass, out *v1beta2.ClusterClass, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_ClusterClassSpec_To_v1beta2_ClusterClassSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_ClusterClassStatus_To_v1beta2_ClusterClassStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_ClusterClass_To_v1beta2_ClusterClass is an autogenerated conversion function. +func Convert_v1beta1_ClusterClass_To_v1beta2_ClusterClass(in *ClusterClass, out *v1beta2.ClusterClass, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterClass_To_v1beta2_ClusterClass(in, out, s) +} + +func autoConvert_v1beta2_ClusterClass_To_v1beta1_ClusterClass(in *v1beta2.ClusterClass, out *ClusterClass, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta2_ClusterClassSpec_To_v1beta1_ClusterClassSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta2_ClusterClassStatus_To_v1beta1_ClusterClassStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +func autoConvert_v1beta1_ClusterClassList_To_v1beta2_ClusterClassList(in *ClusterClassList, out *v1beta2.ClusterClassList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta2.ClusterClass, len(*in)) + for i := range *in { + if err := Convert_v1beta1_ClusterClass_To_v1beta2_ClusterClass(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_ClusterClassList_To_v1beta2_ClusterClassList is an autogenerated conversion function. +func Convert_v1beta1_ClusterClassList_To_v1beta2_ClusterClassList(in *ClusterClassList, out *v1beta2.ClusterClassList, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterClassList_To_v1beta2_ClusterClassList(in, out, s) +} + +func autoConvert_v1beta2_ClusterClassList_To_v1beta1_ClusterClassList(in *v1beta2.ClusterClassList, out *ClusterClassList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]ClusterClass, len(*in)) + for i := range *in { + if err := Convert_v1beta2_ClusterClass_To_v1beta1_ClusterClass(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta2_ClusterClassList_To_v1beta1_ClusterClassList is an autogenerated conversion function. +func Convert_v1beta2_ClusterClassList_To_v1beta1_ClusterClassList(in *v1beta2.ClusterClassList, out *ClusterClassList, s conversion.Scope) error { + return autoConvert_v1beta2_ClusterClassList_To_v1beta1_ClusterClassList(in, out, s) +} + +func autoConvert_v1beta1_ClusterClassPatch_To_v1beta2_ClusterClassPatch(in *ClusterClassPatch, out *v1beta2.ClusterClassPatch, s conversion.Scope) error { + out.Name = in.Name + out.Description = in.Description + if err := v1.Convert_Pointer_string_To_string(&in.EnabledIf, &out.EnabledIf, s); err != nil { + return err + } + if in.Definitions != nil { + in, out := &in.Definitions, &out.Definitions + *out = make([]v1beta2.PatchDefinition, len(*in)) + for i := range *in { + if err := Convert_v1beta1_PatchDefinition_To_v1beta2_PatchDefinition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Definitions = nil + } + if in.External != nil { + in, out := &in.External, &out.External + *out = new(v1beta2.ExternalPatchDefinition) + if err := Convert_v1beta1_ExternalPatchDefinition_To_v1beta2_ExternalPatchDefinition(*in, *out, s); err != nil { + return err + } + } else { + out.External = nil + } + return nil +} + +// Convert_v1beta1_ClusterClassPatch_To_v1beta2_ClusterClassPatch is an autogenerated conversion function. +func Convert_v1beta1_ClusterClassPatch_To_v1beta2_ClusterClassPatch(in *ClusterClassPatch, out *v1beta2.ClusterClassPatch, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterClassPatch_To_v1beta2_ClusterClassPatch(in, out, s) +} + +func autoConvert_v1beta2_ClusterClassPatch_To_v1beta1_ClusterClassPatch(in *v1beta2.ClusterClassPatch, out *ClusterClassPatch, s conversion.Scope) error { + out.Name = in.Name + out.Description = in.Description + if err := v1.Convert_string_To_Pointer_string(&in.EnabledIf, &out.EnabledIf, s); err != nil { + return err + } + if in.Definitions != nil { + in, out := &in.Definitions, &out.Definitions + *out = make([]PatchDefinition, len(*in)) + for i := range *in { + if err := Convert_v1beta2_PatchDefinition_To_v1beta1_PatchDefinition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Definitions = nil + } + if in.External != nil { + in, out := &in.External, &out.External + *out = new(ExternalPatchDefinition) + if err := Convert_v1beta2_ExternalPatchDefinition_To_v1beta1_ExternalPatchDefinition(*in, *out, s); err != nil { + return err + } + } else { + out.External = nil + } + return nil +} + +// Convert_v1beta2_ClusterClassPatch_To_v1beta1_ClusterClassPatch is an autogenerated conversion function. +func Convert_v1beta2_ClusterClassPatch_To_v1beta1_ClusterClassPatch(in *v1beta2.ClusterClassPatch, out *ClusterClassPatch, s conversion.Scope) error { + return autoConvert_v1beta2_ClusterClassPatch_To_v1beta1_ClusterClassPatch(in, out, s) +} + +func autoConvert_v1beta1_ClusterClassSpec_To_v1beta2_ClusterClassSpec(in *ClusterClassSpec, out *v1beta2.ClusterClassSpec, s conversion.Scope) error { + out.AvailabilityGates = *(*[]v1beta2.ClusterAvailabilityGate)(unsafe.Pointer(&in.AvailabilityGates)) + if err := Convert_v1beta1_LocalObjectTemplate_To_v1beta2_InfrastructureClass(&in.Infrastructure, &out.Infrastructure, s); err != nil { + return err + } + // WARNING: in.InfrastructureNamingStrategy requires manual conversion: does not exist in peer-type + if err := Convert_v1beta1_ControlPlaneClass_To_v1beta2_ControlPlaneClass(&in.ControlPlane, &out.ControlPlane, s); err != nil { + return err + } + if err := Convert_v1beta1_WorkersClass_To_v1beta2_WorkersClass(&in.Workers, &out.Workers, s); err != nil { + return err + } + if in.Variables != nil { + in, out := &in.Variables, &out.Variables + *out = make([]v1beta2.ClusterClassVariable, len(*in)) + for i := range *in { + if err := Convert_v1beta1_ClusterClassVariable_To_v1beta2_ClusterClassVariable(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Variables = nil + } + if in.Patches != nil { + in, out := &in.Patches, &out.Patches + *out = make([]v1beta2.ClusterClassPatch, len(*in)) + for i := range *in { + if err := Convert_v1beta1_ClusterClassPatch_To_v1beta2_ClusterClassPatch(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Patches = nil + } + return nil +} + +func autoConvert_v1beta2_ClusterClassSpec_To_v1beta1_ClusterClassSpec(in *v1beta2.ClusterClassSpec, out *ClusterClassSpec, s conversion.Scope) error { + out.AvailabilityGates = *(*[]ClusterAvailabilityGate)(unsafe.Pointer(&in.AvailabilityGates)) + if err := Convert_v1beta2_InfrastructureClass_To_v1beta1_LocalObjectTemplate(&in.Infrastructure, &out.Infrastructure, s); err != nil { + return err + } + if err := Convert_v1beta2_ControlPlaneClass_To_v1beta1_ControlPlaneClass(&in.ControlPlane, &out.ControlPlane, s); err != nil { + return err + } + if err := Convert_v1beta2_WorkersClass_To_v1beta1_WorkersClass(&in.Workers, &out.Workers, s); err != nil { + return err + } + if in.Variables != nil { + in, out := &in.Variables, &out.Variables + *out = make([]ClusterClassVariable, len(*in)) + for i := range *in { + if err := Convert_v1beta2_ClusterClassVariable_To_v1beta1_ClusterClassVariable(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Variables = nil + } + if in.Patches != nil { + in, out := &in.Patches, &out.Patches + *out = make([]ClusterClassPatch, len(*in)) + for i := range *in { + if err := Convert_v1beta2_ClusterClassPatch_To_v1beta1_ClusterClassPatch(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Patches = nil + } + return nil +} + +func autoConvert_v1beta1_ClusterClassStatus_To_v1beta2_ClusterClassStatus(in *ClusterClassStatus, out *v1beta2.ClusterClassStatus, s conversion.Scope) error { + if in.Variables != nil { + in, out := &in.Variables, &out.Variables + *out = make([]v1beta2.ClusterClassStatusVariable, len(*in)) + for i := range *in { + if err := Convert_v1beta1_ClusterClassStatusVariable_To_v1beta2_ClusterClassStatusVariable(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Variables = nil + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + if err := Convert_v1beta1_Condition_To_v1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + out.ObservedGeneration = in.ObservedGeneration + // WARNING: in.V1Beta2 requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta2_ClusterClassStatus_To_v1beta1_ClusterClassStatus(in *v1beta2.ClusterClassStatus, out *ClusterClassStatus, s conversion.Scope) error { + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(Conditions, len(*in)) + for i := range *in { + if err := Convert_v1_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + if in.Variables != nil { + in, out := &in.Variables, &out.Variables + *out = make([]ClusterClassStatusVariable, len(*in)) + for i := range *in { + if err := Convert_v1beta2_ClusterClassStatusVariable_To_v1beta1_ClusterClassStatusVariable(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Variables = nil + } + out.ObservedGeneration = in.ObservedGeneration + // WARNING: in.Deprecated requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta1_ClusterClassStatusVariable_To_v1beta2_ClusterClassStatusVariable(in *ClusterClassStatusVariable, out *v1beta2.ClusterClassStatusVariable, s conversion.Scope) error { + out.Name = in.Name + if err := v1.Convert_bool_To_Pointer_bool(&in.DefinitionsConflict, &out.DefinitionsConflict, s); err != nil { + return err + } + if in.Definitions != nil { + in, out := &in.Definitions, &out.Definitions + *out = make([]v1beta2.ClusterClassStatusVariableDefinition, len(*in)) + for i := range *in { + if err := Convert_v1beta1_ClusterClassStatusVariableDefinition_To_v1beta2_ClusterClassStatusVariableDefinition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Definitions = nil + } + return nil +} + +// Convert_v1beta1_ClusterClassStatusVariable_To_v1beta2_ClusterClassStatusVariable is an autogenerated conversion function. +func Convert_v1beta1_ClusterClassStatusVariable_To_v1beta2_ClusterClassStatusVariable(in *ClusterClassStatusVariable, out *v1beta2.ClusterClassStatusVariable, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterClassStatusVariable_To_v1beta2_ClusterClassStatusVariable(in, out, s) +} + +func autoConvert_v1beta2_ClusterClassStatusVariable_To_v1beta1_ClusterClassStatusVariable(in *v1beta2.ClusterClassStatusVariable, out *ClusterClassStatusVariable, s conversion.Scope) error { + out.Name = in.Name + if err := v1.Convert_Pointer_bool_To_bool(&in.DefinitionsConflict, &out.DefinitionsConflict, s); err != nil { + return err + } + if in.Definitions != nil { + in, out := &in.Definitions, &out.Definitions + *out = make([]ClusterClassStatusVariableDefinition, len(*in)) + for i := range *in { + if err := Convert_v1beta2_ClusterClassStatusVariableDefinition_To_v1beta1_ClusterClassStatusVariableDefinition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Definitions = nil + } + return nil +} + +// Convert_v1beta2_ClusterClassStatusVariable_To_v1beta1_ClusterClassStatusVariable is an autogenerated conversion function. +func Convert_v1beta2_ClusterClassStatusVariable_To_v1beta1_ClusterClassStatusVariable(in *v1beta2.ClusterClassStatusVariable, out *ClusterClassStatusVariable, s conversion.Scope) error { + return autoConvert_v1beta2_ClusterClassStatusVariable_To_v1beta1_ClusterClassStatusVariable(in, out, s) +} + +func autoConvert_v1beta1_ClusterClassStatusVariableDefinition_To_v1beta2_ClusterClassStatusVariableDefinition(in *ClusterClassStatusVariableDefinition, out *v1beta2.ClusterClassStatusVariableDefinition, s conversion.Scope) error { + out.From = in.From + if err := v1.Convert_bool_To_Pointer_bool(&in.Required, &out.Required, s); err != nil { + return err + } + // WARNING: in.Metadata requires manual conversion: does not exist in peer-type + if err := Convert_v1beta1_VariableSchema_To_v1beta2_VariableSchema(&in.Schema, &out.Schema, s); err != nil { + return err + } + return nil +} + +func autoConvert_v1beta2_ClusterClassStatusVariableDefinition_To_v1beta1_ClusterClassStatusVariableDefinition(in *v1beta2.ClusterClassStatusVariableDefinition, out *ClusterClassStatusVariableDefinition, s conversion.Scope) error { + out.From = in.From + if err := v1.Convert_Pointer_bool_To_bool(&in.Required, &out.Required, s); err != nil { + return err + } + // WARNING: in.DeprecatedV1Beta1Metadata requires manual conversion: does not exist in peer-type + if err := Convert_v1beta2_VariableSchema_To_v1beta1_VariableSchema(&in.Schema, &out.Schema, s); err != nil { + return err + } + return nil +} + +func autoConvert_v1beta1_ClusterClassVariable_To_v1beta2_ClusterClassVariable(in *ClusterClassVariable, out *v1beta2.ClusterClassVariable, s conversion.Scope) error { + out.Name = in.Name + if err := v1.Convert_bool_To_Pointer_bool(&in.Required, &out.Required, s); err != nil { + return err + } + // WARNING: in.Metadata requires manual conversion: does not exist in peer-type + if err := Convert_v1beta1_VariableSchema_To_v1beta2_VariableSchema(&in.Schema, &out.Schema, s); err != nil { + return err + } + return nil +} + +func autoConvert_v1beta2_ClusterClassVariable_To_v1beta1_ClusterClassVariable(in *v1beta2.ClusterClassVariable, out *ClusterClassVariable, s conversion.Scope) error { + out.Name = in.Name + if err := v1.Convert_Pointer_bool_To_bool(&in.Required, &out.Required, s); err != nil { + return err + } + // WARNING: in.DeprecatedV1Beta1Metadata requires manual conversion: does not exist in peer-type + if err := Convert_v1beta2_VariableSchema_To_v1beta1_VariableSchema(&in.Schema, &out.Schema, s); err != nil { + return err + } + return nil +} + +func autoConvert_v1beta1_ClusterClassVariableMetadata_To_v1beta2_ClusterClassVariableMetadata(in *ClusterClassVariableMetadata, out *v1beta2.ClusterClassVariableMetadata, 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_ClusterClassVariableMetadata_To_v1beta2_ClusterClassVariableMetadata is an autogenerated conversion function. +func Convert_v1beta1_ClusterClassVariableMetadata_To_v1beta2_ClusterClassVariableMetadata(in *ClusterClassVariableMetadata, out *v1beta2.ClusterClassVariableMetadata, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterClassVariableMetadata_To_v1beta2_ClusterClassVariableMetadata(in, out, s) +} + +func autoConvert_v1beta2_ClusterClassVariableMetadata_To_v1beta1_ClusterClassVariableMetadata(in *v1beta2.ClusterClassVariableMetadata, out *ClusterClassVariableMetadata, 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_v1beta2_ClusterClassVariableMetadata_To_v1beta1_ClusterClassVariableMetadata is an autogenerated conversion function. +func Convert_v1beta2_ClusterClassVariableMetadata_To_v1beta1_ClusterClassVariableMetadata(in *v1beta2.ClusterClassVariableMetadata, out *ClusterClassVariableMetadata, s conversion.Scope) error { + return autoConvert_v1beta2_ClusterClassVariableMetadata_To_v1beta1_ClusterClassVariableMetadata(in, out, s) +} + +func autoConvert_v1beta1_ClusterControlPlaneStatus_To_v1beta2_ClusterControlPlaneStatus(in *ClusterControlPlaneStatus, out *v1beta2.ClusterControlPlaneStatus, s conversion.Scope) error { + out.DesiredReplicas = (*int32)(unsafe.Pointer(in.DesiredReplicas)) + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + out.UpToDateReplicas = (*int32)(unsafe.Pointer(in.UpToDateReplicas)) + out.ReadyReplicas = (*int32)(unsafe.Pointer(in.ReadyReplicas)) + out.AvailableReplicas = (*int32)(unsafe.Pointer(in.AvailableReplicas)) + return nil +} + +// Convert_v1beta1_ClusterControlPlaneStatus_To_v1beta2_ClusterControlPlaneStatus is an autogenerated conversion function. +func Convert_v1beta1_ClusterControlPlaneStatus_To_v1beta2_ClusterControlPlaneStatus(in *ClusterControlPlaneStatus, out *v1beta2.ClusterControlPlaneStatus, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterControlPlaneStatus_To_v1beta2_ClusterControlPlaneStatus(in, out, s) +} + +func autoConvert_v1beta2_ClusterControlPlaneStatus_To_v1beta1_ClusterControlPlaneStatus(in *v1beta2.ClusterControlPlaneStatus, out *ClusterControlPlaneStatus, s conversion.Scope) error { + out.DesiredReplicas = (*int32)(unsafe.Pointer(in.DesiredReplicas)) + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + out.UpToDateReplicas = (*int32)(unsafe.Pointer(in.UpToDateReplicas)) + out.ReadyReplicas = (*int32)(unsafe.Pointer(in.ReadyReplicas)) + out.AvailableReplicas = (*int32)(unsafe.Pointer(in.AvailableReplicas)) + return nil +} + +// Convert_v1beta2_ClusterControlPlaneStatus_To_v1beta1_ClusterControlPlaneStatus is an autogenerated conversion function. +func Convert_v1beta2_ClusterControlPlaneStatus_To_v1beta1_ClusterControlPlaneStatus(in *v1beta2.ClusterControlPlaneStatus, out *ClusterControlPlaneStatus, s conversion.Scope) error { + return autoConvert_v1beta2_ClusterControlPlaneStatus_To_v1beta1_ClusterControlPlaneStatus(in, out, s) +} + +func autoConvert_v1beta1_ClusterList_To_v1beta2_ClusterList(in *ClusterList, out *v1beta2.ClusterList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta2.Cluster, len(*in)) + for i := range *in { + if err := Convert_v1beta1_Cluster_To_v1beta2_Cluster(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_ClusterList_To_v1beta2_ClusterList is an autogenerated conversion function. +func Convert_v1beta1_ClusterList_To_v1beta2_ClusterList(in *ClusterList, out *v1beta2.ClusterList, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterList_To_v1beta2_ClusterList(in, out, s) +} + +func autoConvert_v1beta2_ClusterList_To_v1beta1_ClusterList(in *v1beta2.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_v1beta2_Cluster_To_v1beta1_Cluster(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta2_ClusterList_To_v1beta1_ClusterList is an autogenerated conversion function. +func Convert_v1beta2_ClusterList_To_v1beta1_ClusterList(in *v1beta2.ClusterList, out *ClusterList, s conversion.Scope) error { + return autoConvert_v1beta2_ClusterList_To_v1beta1_ClusterList(in, out, s) +} + +func autoConvert_v1beta1_ClusterNetwork_To_v1beta2_ClusterNetwork(in *ClusterNetwork, out *v1beta2.ClusterNetwork, s conversion.Scope) error { + if err := v1.Convert_Pointer_int32_To_int32(&in.APIServerPort, &out.APIServerPort, s); err != nil { + return err + } + // WARNING: in.Services requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api/api/core/v1beta1.NetworkRanges vs sigs.k8s.io/cluster-api/api/core/v1beta2.NetworkRanges) + // WARNING: in.Pods requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api/api/core/v1beta1.NetworkRanges vs sigs.k8s.io/cluster-api/api/core/v1beta2.NetworkRanges) + out.ServiceDomain = in.ServiceDomain + return nil +} + +func autoConvert_v1beta2_ClusterNetwork_To_v1beta1_ClusterNetwork(in *v1beta2.ClusterNetwork, out *ClusterNetwork, s conversion.Scope) error { + if err := v1.Convert_int32_To_Pointer_int32(&in.APIServerPort, &out.APIServerPort, s); err != nil { + return err + } + // WARNING: in.Services requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api/api/core/v1beta2.NetworkRanges vs *sigs.k8s.io/cluster-api/api/core/v1beta1.NetworkRanges) + // WARNING: in.Pods requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api/api/core/v1beta2.NetworkRanges vs *sigs.k8s.io/cluster-api/api/core/v1beta1.NetworkRanges) + out.ServiceDomain = in.ServiceDomain + return nil +} + +func autoConvert_v1beta1_ClusterSpec_To_v1beta2_ClusterSpec(in *ClusterSpec, out *v1beta2.ClusterSpec, s conversion.Scope) error { + if err := v1.Convert_bool_To_Pointer_bool(&in.Paused, &out.Paused, s); err != nil { + return err + } + // WARNING: in.ClusterNetwork requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterNetwork vs sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterNetwork) + if err := Convert_v1beta1_APIEndpoint_To_v1beta2_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + // WARNING: in.ControlPlaneRef requires manual conversion: inconvertible types (*k8s.io/api/core/v1.ObjectReference vs sigs.k8s.io/cluster-api/api/core/v1beta2.ContractVersionedObjectReference) + // WARNING: in.InfrastructureRef requires manual conversion: inconvertible types (*k8s.io/api/core/v1.ObjectReference vs sigs.k8s.io/cluster-api/api/core/v1beta2.ContractVersionedObjectReference) + // WARNING: in.Topology requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api/api/core/v1beta1.Topology vs sigs.k8s.io/cluster-api/api/core/v1beta2.Topology) + out.AvailabilityGates = *(*[]v1beta2.ClusterAvailabilityGate)(unsafe.Pointer(&in.AvailabilityGates)) + return nil +} + +func autoConvert_v1beta2_ClusterSpec_To_v1beta1_ClusterSpec(in *v1beta2.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { + if err := v1.Convert_Pointer_bool_To_bool(&in.Paused, &out.Paused, s); err != nil { + return err + } + // WARNING: in.ClusterNetwork requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterNetwork vs *sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterNetwork) + if err := Convert_v1beta2_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + // WARNING: in.ControlPlaneRef requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api/api/core/v1beta2.ContractVersionedObjectReference vs *k8s.io/api/core/v1.ObjectReference) + // WARNING: in.InfrastructureRef requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api/api/core/v1beta2.ContractVersionedObjectReference vs *k8s.io/api/core/v1.ObjectReference) + // WARNING: in.Topology requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api/api/core/v1beta2.Topology vs *sigs.k8s.io/cluster-api/api/core/v1beta1.Topology) + out.AvailabilityGates = *(*[]ClusterAvailabilityGate)(unsafe.Pointer(&in.AvailabilityGates)) + return nil +} + +func autoConvert_v1beta1_ClusterStatus_To_v1beta2_ClusterStatus(in *ClusterStatus, out *v1beta2.ClusterStatus, s conversion.Scope) error { + // WARNING: in.FailureDomains requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api/api/core/v1beta1.FailureDomains vs []sigs.k8s.io/cluster-api/api/core/v1beta2.FailureDomain) + // WARNING: in.FailureReason requires manual conversion: does not exist in peer-type + // WARNING: in.FailureMessage requires manual conversion: does not exist in peer-type + out.Phase = in.Phase + // WARNING: in.InfrastructureReady requires manual conversion: does not exist in peer-type + // WARNING: in.ControlPlaneReady requires manual conversion: does not exist in peer-type + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + if err := Convert_v1beta1_Condition_To_v1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + out.ObservedGeneration = in.ObservedGeneration + // WARNING: in.V1Beta2 requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta2_ClusterStatus_To_v1beta1_ClusterStatus(in *v1beta2.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(Conditions, len(*in)) + for i := range *in { + if err := Convert_v1_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + // WARNING: in.Initialization requires manual conversion: does not exist in peer-type + // WARNING: in.ControlPlane requires manual conversion: does not exist in peer-type + // WARNING: in.Workers requires manual conversion: does not exist in peer-type + // WARNING: in.FailureDomains requires manual conversion: inconvertible types ([]sigs.k8s.io/cluster-api/api/core/v1beta2.FailureDomain vs sigs.k8s.io/cluster-api/api/core/v1beta1.FailureDomains) + out.Phase = in.Phase + out.ObservedGeneration = in.ObservedGeneration + // WARNING: in.Deprecated requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta1_ClusterVariable_To_v1beta2_ClusterVariable(in *ClusterVariable, out *v1beta2.ClusterVariable, s conversion.Scope) error { + out.Name = in.Name + // WARNING: in.DefinitionFrom requires manual conversion: does not exist in peer-type + out.Value = in.Value + return nil +} + +func autoConvert_v1beta2_ClusterVariable_To_v1beta1_ClusterVariable(in *v1beta2.ClusterVariable, out *ClusterVariable, s conversion.Scope) error { + out.Name = in.Name + out.Value = in.Value + return nil +} + +// Convert_v1beta2_ClusterVariable_To_v1beta1_ClusterVariable is an autogenerated conversion function. +func Convert_v1beta2_ClusterVariable_To_v1beta1_ClusterVariable(in *v1beta2.ClusterVariable, out *ClusterVariable, s conversion.Scope) error { + return autoConvert_v1beta2_ClusterVariable_To_v1beta1_ClusterVariable(in, out, s) +} + +func autoConvert_v1beta1_Condition_To_v1beta2_Condition(in *Condition, out *v1beta2.Condition, s conversion.Scope) error { + out.Type = v1beta2.ConditionType(in.Type) + out.Status = corev1.ConditionStatus(in.Status) + out.Severity = v1beta2.ConditionSeverity(in.Severity) + out.LastTransitionTime = in.LastTransitionTime + out.Reason = in.Reason + out.Message = in.Message + return nil +} + +// Convert_v1beta1_Condition_To_v1beta2_Condition is an autogenerated conversion function. +func Convert_v1beta1_Condition_To_v1beta2_Condition(in *Condition, out *v1beta2.Condition, s conversion.Scope) error { + return autoConvert_v1beta1_Condition_To_v1beta2_Condition(in, out, s) +} + +func autoConvert_v1beta2_Condition_To_v1beta1_Condition(in *v1beta2.Condition, out *Condition, s conversion.Scope) error { + out.Type = ConditionType(in.Type) + out.Status = corev1.ConditionStatus(in.Status) + out.Severity = ConditionSeverity(in.Severity) + out.LastTransitionTime = in.LastTransitionTime + out.Reason = in.Reason + out.Message = in.Message + return nil +} + +// Convert_v1beta2_Condition_To_v1beta1_Condition is an autogenerated conversion function. +func Convert_v1beta2_Condition_To_v1beta1_Condition(in *v1beta2.Condition, out *Condition, s conversion.Scope) error { + return autoConvert_v1beta2_Condition_To_v1beta1_Condition(in, out, s) +} + +func autoConvert_v1beta1_ControlPlaneClass_To_v1beta2_ControlPlaneClass(in *ControlPlaneClass, out *v1beta2.ControlPlaneClass, s conversion.Scope) error { + if err := Convert_v1beta1_ObjectMeta_To_v1beta2_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { + return err + } + // WARNING: in.LocalObjectTemplate requires manual conversion: does not exist in peer-type + // WARNING: in.MachineInfrastructure requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api/api/core/v1beta1.LocalObjectTemplate vs sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassMachineInfrastructureTemplate) + // WARNING: in.MachineHealthCheck requires manual conversion: does not exist in peer-type + // WARNING: in.NamingStrategy requires manual conversion: does not exist in peer-type + // WARNING: in.NodeDrainTimeout requires manual conversion: does not exist in peer-type + // WARNING: in.NodeVolumeDetachTimeout requires manual conversion: does not exist in peer-type + // WARNING: in.NodeDeletionTimeout requires manual conversion: does not exist in peer-type + out.ReadinessGates = *(*[]v1beta2.MachineReadinessGate)(unsafe.Pointer(&in.ReadinessGates)) + return nil +} + +func autoConvert_v1beta2_ControlPlaneClass_To_v1beta1_ControlPlaneClass(in *v1beta2.ControlPlaneClass, out *ControlPlaneClass, s conversion.Scope) error { + if err := Convert_v1beta2_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { + return err + } + // WARNING: in.TemplateRef requires manual conversion: does not exist in peer-type + // WARNING: in.MachineInfrastructure requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassMachineInfrastructureTemplate vs *sigs.k8s.io/cluster-api/api/core/v1beta1.LocalObjectTemplate) + // WARNING: in.HealthCheck requires manual conversion: does not exist in peer-type + // WARNING: in.Naming requires manual conversion: does not exist in peer-type + // WARNING: in.Deletion requires manual conversion: does not exist in peer-type + out.ReadinessGates = *(*[]MachineReadinessGate)(unsafe.Pointer(&in.ReadinessGates)) + return nil +} + +func autoConvert_v1beta1_ControlPlaneTopology_To_v1beta2_ControlPlaneTopology(in *ControlPlaneTopology, out *v1beta2.ControlPlaneTopology, s conversion.Scope) error { + if err := Convert_v1beta1_ObjectMeta_To_v1beta2_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { + return err + } + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + // WARNING: in.MachineHealthCheck requires manual conversion: does not exist in peer-type + // WARNING: in.NodeDrainTimeout requires manual conversion: does not exist in peer-type + // WARNING: in.NodeVolumeDetachTimeout requires manual conversion: does not exist in peer-type + // WARNING: in.NodeDeletionTimeout requires manual conversion: does not exist in peer-type + out.ReadinessGates = *(*[]v1beta2.MachineReadinessGate)(unsafe.Pointer(&in.ReadinessGates)) + // WARNING: in.Variables requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api/api/core/v1beta1.ControlPlaneVariables vs sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneVariables) + return nil +} + +func autoConvert_v1beta2_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(in *v1beta2.ControlPlaneTopology, out *ControlPlaneTopology, s conversion.Scope) error { + if err := Convert_v1beta2_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { + return err + } + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + // WARNING: in.HealthCheck requires manual conversion: does not exist in peer-type + // WARNING: in.Deletion requires manual conversion: does not exist in peer-type + out.ReadinessGates = *(*[]MachineReadinessGate)(unsafe.Pointer(&in.ReadinessGates)) + // WARNING: in.Variables requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneVariables vs *sigs.k8s.io/cluster-api/api/core/v1beta1.ControlPlaneVariables) + return nil +} + +func autoConvert_v1beta1_ControlPlaneVariables_To_v1beta2_ControlPlaneVariables(in *ControlPlaneVariables, out *v1beta2.ControlPlaneVariables, s conversion.Scope) error { + if in.Overrides != nil { + in, out := &in.Overrides, &out.Overrides + *out = make([]v1beta2.ClusterVariable, len(*in)) + for i := range *in { + if err := Convert_v1beta1_ClusterVariable_To_v1beta2_ClusterVariable(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Overrides = nil + } + return nil +} + +// Convert_v1beta1_ControlPlaneVariables_To_v1beta2_ControlPlaneVariables is an autogenerated conversion function. +func Convert_v1beta1_ControlPlaneVariables_To_v1beta2_ControlPlaneVariables(in *ControlPlaneVariables, out *v1beta2.ControlPlaneVariables, s conversion.Scope) error { + return autoConvert_v1beta1_ControlPlaneVariables_To_v1beta2_ControlPlaneVariables(in, out, s) +} + +func autoConvert_v1beta2_ControlPlaneVariables_To_v1beta1_ControlPlaneVariables(in *v1beta2.ControlPlaneVariables, out *ControlPlaneVariables, s conversion.Scope) error { + if in.Overrides != nil { + in, out := &in.Overrides, &out.Overrides + *out = make([]ClusterVariable, len(*in)) + for i := range *in { + if err := Convert_v1beta2_ClusterVariable_To_v1beta1_ClusterVariable(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Overrides = nil + } + return nil +} + +// Convert_v1beta2_ControlPlaneVariables_To_v1beta1_ControlPlaneVariables is an autogenerated conversion function. +func Convert_v1beta2_ControlPlaneVariables_To_v1beta1_ControlPlaneVariables(in *v1beta2.ControlPlaneVariables, out *ControlPlaneVariables, s conversion.Scope) error { + return autoConvert_v1beta2_ControlPlaneVariables_To_v1beta1_ControlPlaneVariables(in, out, s) +} + +func autoConvert_v1beta1_ExternalPatchDefinition_To_v1beta2_ExternalPatchDefinition(in *ExternalPatchDefinition, out *v1beta2.ExternalPatchDefinition, s conversion.Scope) error { + // WARNING: in.GenerateExtension requires manual conversion: does not exist in peer-type + // WARNING: in.ValidateExtension requires manual conversion: does not exist in peer-type + if err := v1.Convert_Pointer_string_To_string(&in.DiscoverVariablesExtension, &out.DiscoverVariablesExtension, s); err != nil { + return err + } + out.Settings = *(*map[string]string)(unsafe.Pointer(&in.Settings)) + return nil +} + +func autoConvert_v1beta2_ExternalPatchDefinition_To_v1beta1_ExternalPatchDefinition(in *v1beta2.ExternalPatchDefinition, out *ExternalPatchDefinition, s conversion.Scope) error { + // WARNING: in.GeneratePatchesExtension requires manual conversion: does not exist in peer-type + // WARNING: in.ValidateTopologyExtension requires manual conversion: does not exist in peer-type + if err := v1.Convert_string_To_Pointer_string(&in.DiscoverVariablesExtension, &out.DiscoverVariablesExtension, s); err != nil { + return err + } + out.Settings = *(*map[string]string)(unsafe.Pointer(&in.Settings)) + return nil +} + +func autoConvert_v1beta1_JSONPatch_To_v1beta2_JSONPatch(in *JSONPatch, out *v1beta2.JSONPatch, s conversion.Scope) error { + out.Op = in.Op + out.Path = in.Path + out.Value = (*apiextensionsv1.JSON)(unsafe.Pointer(in.Value)) + if in.ValueFrom != nil { + in, out := &in.ValueFrom, &out.ValueFrom + *out = new(v1beta2.JSONPatchValue) + if err := Convert_v1beta1_JSONPatchValue_To_v1beta2_JSONPatchValue(*in, *out, s); err != nil { + return err + } + } else { + out.ValueFrom = nil + } + return nil +} + +// Convert_v1beta1_JSONPatch_To_v1beta2_JSONPatch is an autogenerated conversion function. +func Convert_v1beta1_JSONPatch_To_v1beta2_JSONPatch(in *JSONPatch, out *v1beta2.JSONPatch, s conversion.Scope) error { + return autoConvert_v1beta1_JSONPatch_To_v1beta2_JSONPatch(in, out, s) +} + +func autoConvert_v1beta2_JSONPatch_To_v1beta1_JSONPatch(in *v1beta2.JSONPatch, out *JSONPatch, s conversion.Scope) error { + out.Op = in.Op + out.Path = in.Path + out.Value = (*apiextensionsv1.JSON)(unsafe.Pointer(in.Value)) + if in.ValueFrom != nil { + in, out := &in.ValueFrom, &out.ValueFrom + *out = new(JSONPatchValue) + if err := Convert_v1beta2_JSONPatchValue_To_v1beta1_JSONPatchValue(*in, *out, s); err != nil { + return err + } + } else { + out.ValueFrom = nil + } + return nil +} + +// Convert_v1beta2_JSONPatch_To_v1beta1_JSONPatch is an autogenerated conversion function. +func Convert_v1beta2_JSONPatch_To_v1beta1_JSONPatch(in *v1beta2.JSONPatch, out *JSONPatch, s conversion.Scope) error { + return autoConvert_v1beta2_JSONPatch_To_v1beta1_JSONPatch(in, out, s) +} + +func autoConvert_v1beta1_JSONPatchValue_To_v1beta2_JSONPatchValue(in *JSONPatchValue, out *v1beta2.JSONPatchValue, s conversion.Scope) error { + if err := v1.Convert_Pointer_string_To_string(&in.Variable, &out.Variable, s); err != nil { + return err + } + if err := v1.Convert_Pointer_string_To_string(&in.Template, &out.Template, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_JSONPatchValue_To_v1beta2_JSONPatchValue is an autogenerated conversion function. +func Convert_v1beta1_JSONPatchValue_To_v1beta2_JSONPatchValue(in *JSONPatchValue, out *v1beta2.JSONPatchValue, s conversion.Scope) error { + return autoConvert_v1beta1_JSONPatchValue_To_v1beta2_JSONPatchValue(in, out, s) +} + +func autoConvert_v1beta2_JSONPatchValue_To_v1beta1_JSONPatchValue(in *v1beta2.JSONPatchValue, out *JSONPatchValue, s conversion.Scope) error { + if err := v1.Convert_string_To_Pointer_string(&in.Variable, &out.Variable, s); err != nil { + return err + } + if err := v1.Convert_string_To_Pointer_string(&in.Template, &out.Template, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_JSONPatchValue_To_v1beta1_JSONPatchValue is an autogenerated conversion function. +func Convert_v1beta2_JSONPatchValue_To_v1beta1_JSONPatchValue(in *v1beta2.JSONPatchValue, out *JSONPatchValue, s conversion.Scope) error { + return autoConvert_v1beta2_JSONPatchValue_To_v1beta1_JSONPatchValue(in, out, s) +} + +func autoConvert_v1beta1_JSONSchemaProps_To_v1beta2_JSONSchemaProps(in *JSONSchemaProps, out *v1beta2.JSONSchemaProps, s conversion.Scope) error { + out.Description = in.Description + out.Example = (*apiextensionsv1.JSON)(unsafe.Pointer(in.Example)) + out.Type = in.Type + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]v1beta2.JSONSchemaProps, len(*in)) + for key, val := range *in { + newVal := new(v1beta2.JSONSchemaProps) + if err := Convert_v1beta1_JSONSchemaProps_To_v1beta2_JSONSchemaProps(&val, newVal, s); err != nil { + return err + } + (*out)[key] = *newVal + } + } else { + out.Properties = nil + } + if in.AdditionalProperties != nil { + in, out := &in.AdditionalProperties, &out.AdditionalProperties + *out = new(v1beta2.JSONSchemaProps) + if err := Convert_v1beta1_JSONSchemaProps_To_v1beta2_JSONSchemaProps(*in, *out, s); err != nil { + return err + } + } else { + out.AdditionalProperties = nil + } + out.MaxProperties = (*int64)(unsafe.Pointer(in.MaxProperties)) + out.MinProperties = (*int64)(unsafe.Pointer(in.MinProperties)) + out.Required = *(*[]string)(unsafe.Pointer(&in.Required)) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = new(v1beta2.JSONSchemaProps) + if err := Convert_v1beta1_JSONSchemaProps_To_v1beta2_JSONSchemaProps(*in, *out, s); err != nil { + return err + } + } else { + out.Items = nil + } + out.MaxItems = (*int64)(unsafe.Pointer(in.MaxItems)) + out.MinItems = (*int64)(unsafe.Pointer(in.MinItems)) + if err := v1.Convert_bool_To_Pointer_bool(&in.UniqueItems, &out.UniqueItems, s); err != nil { + return err + } + out.Format = in.Format + out.MaxLength = (*int64)(unsafe.Pointer(in.MaxLength)) + out.MinLength = (*int64)(unsafe.Pointer(in.MinLength)) + out.Pattern = in.Pattern + out.Maximum = (*int64)(unsafe.Pointer(in.Maximum)) + if err := v1.Convert_bool_To_Pointer_bool(&in.ExclusiveMaximum, &out.ExclusiveMaximum, s); err != nil { + return err + } + out.Minimum = (*int64)(unsafe.Pointer(in.Minimum)) + if err := v1.Convert_bool_To_Pointer_bool(&in.ExclusiveMinimum, &out.ExclusiveMinimum, s); err != nil { + return err + } + if err := v1.Convert_bool_To_Pointer_bool(&in.XPreserveUnknownFields, &out.XPreserveUnknownFields, s); err != nil { + return err + } + out.Enum = *(*[]apiextensionsv1.JSON)(unsafe.Pointer(&in.Enum)) + out.Default = (*apiextensionsv1.JSON)(unsafe.Pointer(in.Default)) + out.XValidations = *(*[]v1beta2.ValidationRule)(unsafe.Pointer(&in.XValidations)) + // WARNING: in.XMetadata requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api/api/core/v1beta1.VariableSchemaMetadata vs sigs.k8s.io/cluster-api/api/core/v1beta2.VariableSchemaMetadata) + if err := v1.Convert_bool_To_Pointer_bool(&in.XIntOrString, &out.XIntOrString, s); err != nil { + return err + } + if in.AllOf != nil { + in, out := &in.AllOf, &out.AllOf + *out = make([]v1beta2.JSONSchemaProps, len(*in)) + for i := range *in { + if err := Convert_v1beta1_JSONSchemaProps_To_v1beta2_JSONSchemaProps(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.AllOf = nil + } + if in.OneOf != nil { + in, out := &in.OneOf, &out.OneOf + *out = make([]v1beta2.JSONSchemaProps, len(*in)) + for i := range *in { + if err := Convert_v1beta1_JSONSchemaProps_To_v1beta2_JSONSchemaProps(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.OneOf = nil + } + if in.AnyOf != nil { + in, out := &in.AnyOf, &out.AnyOf + *out = make([]v1beta2.JSONSchemaProps, len(*in)) + for i := range *in { + if err := Convert_v1beta1_JSONSchemaProps_To_v1beta2_JSONSchemaProps(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.AnyOf = nil + } + if in.Not != nil { + in, out := &in.Not, &out.Not + *out = new(v1beta2.JSONSchemaProps) + if err := Convert_v1beta1_JSONSchemaProps_To_v1beta2_JSONSchemaProps(*in, *out, s); err != nil { + return err + } + } else { + out.Not = nil + } + return nil +} + +func autoConvert_v1beta2_JSONSchemaProps_To_v1beta1_JSONSchemaProps(in *v1beta2.JSONSchemaProps, out *JSONSchemaProps, s conversion.Scope) error { + out.Description = in.Description + out.Example = (*apiextensionsv1.JSON)(unsafe.Pointer(in.Example)) + out.Type = in.Type + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]JSONSchemaProps, len(*in)) + for key, val := range *in { + newVal := new(JSONSchemaProps) + if err := Convert_v1beta2_JSONSchemaProps_To_v1beta1_JSONSchemaProps(&val, newVal, s); err != nil { + return err + } + (*out)[key] = *newVal + } + } else { + out.Properties = nil + } + if in.AdditionalProperties != nil { + in, out := &in.AdditionalProperties, &out.AdditionalProperties + *out = new(JSONSchemaProps) + if err := Convert_v1beta2_JSONSchemaProps_To_v1beta1_JSONSchemaProps(*in, *out, s); err != nil { + return err + } + } else { + out.AdditionalProperties = nil + } + out.MaxProperties = (*int64)(unsafe.Pointer(in.MaxProperties)) + out.MinProperties = (*int64)(unsafe.Pointer(in.MinProperties)) + out.Required = *(*[]string)(unsafe.Pointer(&in.Required)) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = new(JSONSchemaProps) + if err := Convert_v1beta2_JSONSchemaProps_To_v1beta1_JSONSchemaProps(*in, *out, s); err != nil { + return err + } + } else { + out.Items = nil + } + out.MaxItems = (*int64)(unsafe.Pointer(in.MaxItems)) + out.MinItems = (*int64)(unsafe.Pointer(in.MinItems)) + if err := v1.Convert_Pointer_bool_To_bool(&in.UniqueItems, &out.UniqueItems, s); err != nil { + return err + } + out.Format = in.Format + out.MaxLength = (*int64)(unsafe.Pointer(in.MaxLength)) + out.MinLength = (*int64)(unsafe.Pointer(in.MinLength)) + out.Pattern = in.Pattern + out.Maximum = (*int64)(unsafe.Pointer(in.Maximum)) + if err := v1.Convert_Pointer_bool_To_bool(&in.ExclusiveMaximum, &out.ExclusiveMaximum, s); err != nil { + return err + } + out.Minimum = (*int64)(unsafe.Pointer(in.Minimum)) + if err := v1.Convert_Pointer_bool_To_bool(&in.ExclusiveMinimum, &out.ExclusiveMinimum, s); err != nil { + return err + } + if err := v1.Convert_Pointer_bool_To_bool(&in.XPreserveUnknownFields, &out.XPreserveUnknownFields, s); err != nil { + return err + } + out.Enum = *(*[]apiextensionsv1.JSON)(unsafe.Pointer(&in.Enum)) + out.Default = (*apiextensionsv1.JSON)(unsafe.Pointer(in.Default)) + out.XValidations = *(*[]ValidationRule)(unsafe.Pointer(&in.XValidations)) + // WARNING: in.XMetadata requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api/api/core/v1beta2.VariableSchemaMetadata vs *sigs.k8s.io/cluster-api/api/core/v1beta1.VariableSchemaMetadata) + if err := v1.Convert_Pointer_bool_To_bool(&in.XIntOrString, &out.XIntOrString, s); err != nil { + return err + } + if in.AllOf != nil { + in, out := &in.AllOf, &out.AllOf + *out = make([]JSONSchemaProps, len(*in)) + for i := range *in { + if err := Convert_v1beta2_JSONSchemaProps_To_v1beta1_JSONSchemaProps(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.AllOf = nil + } + if in.OneOf != nil { + in, out := &in.OneOf, &out.OneOf + *out = make([]JSONSchemaProps, len(*in)) + for i := range *in { + if err := Convert_v1beta2_JSONSchemaProps_To_v1beta1_JSONSchemaProps(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.OneOf = nil + } + if in.AnyOf != nil { + in, out := &in.AnyOf, &out.AnyOf + *out = make([]JSONSchemaProps, len(*in)) + for i := range *in { + if err := Convert_v1beta2_JSONSchemaProps_To_v1beta1_JSONSchemaProps(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.AnyOf = nil + } + if in.Not != nil { + in, out := &in.Not, &out.Not + *out = new(JSONSchemaProps) + if err := Convert_v1beta2_JSONSchemaProps_To_v1beta1_JSONSchemaProps(*in, *out, s); err != nil { + return err + } + } else { + out.Not = nil + } + return nil +} + +func autoConvert_v1beta1_Machine_To_v1beta2_Machine(in *Machine, out *v1beta2.Machine, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_MachineSpec_To_v1beta2_MachineSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_MachineStatus_To_v1beta2_MachineStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_Machine_To_v1beta2_Machine is an autogenerated conversion function. +func Convert_v1beta1_Machine_To_v1beta2_Machine(in *Machine, out *v1beta2.Machine, s conversion.Scope) error { + return autoConvert_v1beta1_Machine_To_v1beta2_Machine(in, out, s) +} + +func autoConvert_v1beta2_Machine_To_v1beta1_Machine(in *v1beta2.Machine, out *Machine, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta2_MachineSpec_To_v1beta1_MachineSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta2_MachineStatus_To_v1beta1_MachineStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_Machine_To_v1beta1_Machine is an autogenerated conversion function. +func Convert_v1beta2_Machine_To_v1beta1_Machine(in *v1beta2.Machine, out *Machine, s conversion.Scope) error { + return autoConvert_v1beta2_Machine_To_v1beta1_Machine(in, out, s) +} + +func autoConvert_v1beta1_MachineAddress_To_v1beta2_MachineAddress(in *MachineAddress, out *v1beta2.MachineAddress, s conversion.Scope) error { + out.Type = v1beta2.MachineAddressType(in.Type) + out.Address = in.Address + return nil +} + +// Convert_v1beta1_MachineAddress_To_v1beta2_MachineAddress is an autogenerated conversion function. +func Convert_v1beta1_MachineAddress_To_v1beta2_MachineAddress(in *MachineAddress, out *v1beta2.MachineAddress, s conversion.Scope) error { + return autoConvert_v1beta1_MachineAddress_To_v1beta2_MachineAddress(in, out, s) +} + +func autoConvert_v1beta2_MachineAddress_To_v1beta1_MachineAddress(in *v1beta2.MachineAddress, out *MachineAddress, s conversion.Scope) error { + out.Type = MachineAddressType(in.Type) + out.Address = in.Address + return nil +} + +// Convert_v1beta2_MachineAddress_To_v1beta1_MachineAddress is an autogenerated conversion function. +func Convert_v1beta2_MachineAddress_To_v1beta1_MachineAddress(in *v1beta2.MachineAddress, out *MachineAddress, s conversion.Scope) error { + return autoConvert_v1beta2_MachineAddress_To_v1beta1_MachineAddress(in, out, s) +} + +func autoConvert_v1beta1_MachineDeletionStatus_To_v1beta2_MachineDeletionStatus(in *MachineDeletionStatus, out *v1beta2.MachineDeletionStatus, s conversion.Scope) error { + // WARNING: in.NodeDrainStartTime requires manual conversion: inconvertible types (*k8s.io/apimachinery/pkg/apis/meta/v1.Time vs k8s.io/apimachinery/pkg/apis/meta/v1.Time) + // WARNING: in.WaitForNodeVolumeDetachStartTime requires manual conversion: inconvertible types (*k8s.io/apimachinery/pkg/apis/meta/v1.Time vs k8s.io/apimachinery/pkg/apis/meta/v1.Time) + return nil +} + +func autoConvert_v1beta2_MachineDeletionStatus_To_v1beta1_MachineDeletionStatus(in *v1beta2.MachineDeletionStatus, out *MachineDeletionStatus, s conversion.Scope) error { + // WARNING: in.NodeDrainStartTime requires manual conversion: inconvertible types (k8s.io/apimachinery/pkg/apis/meta/v1.Time vs *k8s.io/apimachinery/pkg/apis/meta/v1.Time) + // WARNING: in.WaitForNodeVolumeDetachStartTime requires manual conversion: inconvertible types (k8s.io/apimachinery/pkg/apis/meta/v1.Time vs *k8s.io/apimachinery/pkg/apis/meta/v1.Time) + return nil +} + +func autoConvert_v1beta1_MachineDeployment_To_v1beta2_MachineDeployment(in *MachineDeployment, out *v1beta2.MachineDeployment, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_MachineDeploymentSpec_To_v1beta2_MachineDeploymentSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_MachineDeploymentStatus_To_v1beta2_MachineDeploymentStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_MachineDeployment_To_v1beta2_MachineDeployment is an autogenerated conversion function. +func Convert_v1beta1_MachineDeployment_To_v1beta2_MachineDeployment(in *MachineDeployment, out *v1beta2.MachineDeployment, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDeployment_To_v1beta2_MachineDeployment(in, out, s) +} + +func autoConvert_v1beta2_MachineDeployment_To_v1beta1_MachineDeployment(in *v1beta2.MachineDeployment, out *MachineDeployment, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta2_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta2_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_MachineDeployment_To_v1beta1_MachineDeployment is an autogenerated conversion function. +func Convert_v1beta2_MachineDeployment_To_v1beta1_MachineDeployment(in *v1beta2.MachineDeployment, out *MachineDeployment, s conversion.Scope) error { + return autoConvert_v1beta2_MachineDeployment_To_v1beta1_MachineDeployment(in, out, s) +} + +func autoConvert_v1beta1_MachineDeploymentClass_To_v1beta2_MachineDeploymentClass(in *MachineDeploymentClass, out *v1beta2.MachineDeploymentClass, s conversion.Scope) error { + out.Class = in.Class + // WARNING: in.Template requires manual conversion: does not exist in peer-type + // WARNING: in.MachineHealthCheck requires manual conversion: does not exist in peer-type + if err := v1.Convert_Pointer_string_To_string(&in.FailureDomain, &out.FailureDomain, s); err != nil { + return err + } + // WARNING: in.NamingStrategy requires manual conversion: does not exist in peer-type + // WARNING: in.NodeDrainTimeout requires manual conversion: does not exist in peer-type + // WARNING: in.NodeVolumeDetachTimeout requires manual conversion: does not exist in peer-type + // WARNING: in.NodeDeletionTimeout requires manual conversion: does not exist in peer-type + out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) + out.ReadinessGates = *(*[]v1beta2.MachineReadinessGate)(unsafe.Pointer(&in.ReadinessGates)) + // WARNING: in.Strategy requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta2_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(in *v1beta2.MachineDeploymentClass, out *MachineDeploymentClass, s conversion.Scope) error { + // WARNING: in.Metadata requires manual conversion: does not exist in peer-type + out.Class = in.Class + // WARNING: in.Bootstrap requires manual conversion: does not exist in peer-type + // WARNING: in.Infrastructure requires manual conversion: does not exist in peer-type + // WARNING: in.HealthCheck requires manual conversion: does not exist in peer-type + if err := v1.Convert_string_To_Pointer_string(&in.FailureDomain, &out.FailureDomain, s); err != nil { + return err + } + // WARNING: in.Naming requires manual conversion: does not exist in peer-type + // WARNING: in.Deletion requires manual conversion: does not exist in peer-type + out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) + out.ReadinessGates = *(*[]MachineReadinessGate)(unsafe.Pointer(&in.ReadinessGates)) + // WARNING: in.Rollout requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta1_MachineDeploymentList_To_v1beta2_MachineDeploymentList(in *MachineDeploymentList, out *v1beta2.MachineDeploymentList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta2.MachineDeployment, len(*in)) + for i := range *in { + if err := Convert_v1beta1_MachineDeployment_To_v1beta2_MachineDeployment(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_MachineDeploymentList_To_v1beta2_MachineDeploymentList is an autogenerated conversion function. +func Convert_v1beta1_MachineDeploymentList_To_v1beta2_MachineDeploymentList(in *MachineDeploymentList, out *v1beta2.MachineDeploymentList, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDeploymentList_To_v1beta2_MachineDeploymentList(in, out, s) +} + +func autoConvert_v1beta2_MachineDeploymentList_To_v1beta1_MachineDeploymentList(in *v1beta2.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_v1beta2_MachineDeployment_To_v1beta1_MachineDeployment(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta2_MachineDeploymentList_To_v1beta1_MachineDeploymentList is an autogenerated conversion function. +func Convert_v1beta2_MachineDeploymentList_To_v1beta1_MachineDeploymentList(in *v1beta2.MachineDeploymentList, out *MachineDeploymentList, s conversion.Scope) error { + return autoConvert_v1beta2_MachineDeploymentList_To_v1beta1_MachineDeploymentList(in, out, s) +} + +func autoConvert_v1beta1_MachineDeploymentSpec_To_v1beta2_MachineDeploymentSpec(in *MachineDeploymentSpec, out *v1beta2.MachineDeploymentSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + // WARNING: in.RolloutAfter requires manual conversion: does not exist in peer-type + out.Selector = in.Selector + if err := Convert_v1beta1_MachineTemplateSpec_To_v1beta2_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { + return err + } + // WARNING: in.Strategy requires manual conversion: does not exist in peer-type + // WARNING: in.MachineNamingStrategy requires manual conversion: does not exist in peer-type + // WARNING: in.MinReadySeconds requires manual conversion: does not exist in peer-type + // WARNING: in.RevisionHistoryLimit requires manual conversion: does not exist in peer-type + if err := v1.Convert_bool_To_Pointer_bool(&in.Paused, &out.Paused, s); err != nil { + return err + } + // WARNING: in.ProgressDeadlineSeconds requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta2_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(in *v1beta2.MachineDeploymentSpec, out *MachineDeploymentSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + // WARNING: in.Rollout requires manual conversion: does not exist in peer-type + out.Selector = in.Selector + if err := Convert_v1beta2_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { + return err + } + // WARNING: in.MachineNaming requires manual conversion: does not exist in peer-type + // WARNING: in.Remediation requires manual conversion: does not exist in peer-type + // WARNING: in.Deletion requires manual conversion: does not exist in peer-type + if err := v1.Convert_Pointer_bool_To_bool(&in.Paused, &out.Paused, s); err != nil { + return err + } + return nil +} + +func autoConvert_v1beta1_MachineDeploymentStatus_To_v1beta2_MachineDeploymentStatus(in *MachineDeploymentStatus, out *v1beta2.MachineDeploymentStatus, s conversion.Scope) error { + out.ObservedGeneration = in.ObservedGeneration + out.Selector = in.Selector + if err := v1.Convert_int32_To_Pointer_int32(&in.Replicas, &out.Replicas, s); err != nil { + return err + } + // WARNING: in.UpdatedReplicas requires manual conversion: does not exist in peer-type + if err := v1.Convert_int32_To_Pointer_int32(&in.ReadyReplicas, &out.ReadyReplicas, s); err != nil { + return err + } + if err := v1.Convert_int32_To_Pointer_int32(&in.AvailableReplicas, &out.AvailableReplicas, s); err != nil { + return err + } + // WARNING: in.UnavailableReplicas requires manual conversion: does not exist in peer-type + out.Phase = in.Phase + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + if err := Convert_v1beta1_Condition_To_v1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + // WARNING: in.V1Beta2 requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta2_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(in *v1beta2.MachineDeploymentStatus, out *MachineDeploymentStatus, s conversion.Scope) error { + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(Conditions, len(*in)) + for i := range *in { + if err := Convert_v1_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + out.ObservedGeneration = in.ObservedGeneration + out.Selector = in.Selector + if err := v1.Convert_Pointer_int32_To_int32(&in.Replicas, &out.Replicas, s); err != nil { + return err + } + if err := v1.Convert_Pointer_int32_To_int32(&in.ReadyReplicas, &out.ReadyReplicas, s); err != nil { + return err + } + if err := v1.Convert_Pointer_int32_To_int32(&in.AvailableReplicas, &out.AvailableReplicas, s); err != nil { + return err + } + // WARNING: in.UpToDateReplicas requires manual conversion: does not exist in peer-type + out.Phase = in.Phase + // WARNING: in.Deprecated requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta1_MachineDeploymentTopology_To_v1beta2_MachineDeploymentTopology(in *MachineDeploymentTopology, out *v1beta2.MachineDeploymentTopology, s conversion.Scope) error { + if err := Convert_v1beta1_ObjectMeta_To_v1beta2_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { + return err + } + out.Class = in.Class + out.Name = in.Name + if err := v1.Convert_Pointer_string_To_string(&in.FailureDomain, &out.FailureDomain, s); err != nil { + return err + } + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + // WARNING: in.MachineHealthCheck requires manual conversion: does not exist in peer-type + // WARNING: in.NodeDrainTimeout requires manual conversion: does not exist in peer-type + // WARNING: in.NodeVolumeDetachTimeout requires manual conversion: does not exist in peer-type + // WARNING: in.NodeDeletionTimeout requires manual conversion: does not exist in peer-type + out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) + out.ReadinessGates = *(*[]v1beta2.MachineReadinessGate)(unsafe.Pointer(&in.ReadinessGates)) + // WARNING: in.Strategy requires manual conversion: does not exist in peer-type + // WARNING: in.Variables requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentVariables vs sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentVariables) + return nil +} + +func autoConvert_v1beta2_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(in *v1beta2.MachineDeploymentTopology, out *MachineDeploymentTopology, s conversion.Scope) error { + if err := Convert_v1beta2_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { + return err + } + out.Class = in.Class + out.Name = in.Name + if err := v1.Convert_string_To_Pointer_string(&in.FailureDomain, &out.FailureDomain, s); err != nil { + return err + } + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + // WARNING: in.HealthCheck requires manual conversion: does not exist in peer-type + // WARNING: in.Deletion requires manual conversion: does not exist in peer-type + out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) + out.ReadinessGates = *(*[]MachineReadinessGate)(unsafe.Pointer(&in.ReadinessGates)) + // WARNING: in.Rollout requires manual conversion: does not exist in peer-type + // WARNING: in.Variables requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentVariables vs *sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentVariables) + return nil +} + +func autoConvert_v1beta1_MachineDeploymentVariables_To_v1beta2_MachineDeploymentVariables(in *MachineDeploymentVariables, out *v1beta2.MachineDeploymentVariables, s conversion.Scope) error { + if in.Overrides != nil { + in, out := &in.Overrides, &out.Overrides + *out = make([]v1beta2.ClusterVariable, len(*in)) + for i := range *in { + if err := Convert_v1beta1_ClusterVariable_To_v1beta2_ClusterVariable(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Overrides = nil + } + return nil +} + +// Convert_v1beta1_MachineDeploymentVariables_To_v1beta2_MachineDeploymentVariables is an autogenerated conversion function. +func Convert_v1beta1_MachineDeploymentVariables_To_v1beta2_MachineDeploymentVariables(in *MachineDeploymentVariables, out *v1beta2.MachineDeploymentVariables, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDeploymentVariables_To_v1beta2_MachineDeploymentVariables(in, out, s) +} + +func autoConvert_v1beta2_MachineDeploymentVariables_To_v1beta1_MachineDeploymentVariables(in *v1beta2.MachineDeploymentVariables, out *MachineDeploymentVariables, s conversion.Scope) error { + if in.Overrides != nil { + in, out := &in.Overrides, &out.Overrides + *out = make([]ClusterVariable, len(*in)) + for i := range *in { + if err := Convert_v1beta2_ClusterVariable_To_v1beta1_ClusterVariable(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Overrides = nil + } + return nil +} + +// Convert_v1beta2_MachineDeploymentVariables_To_v1beta1_MachineDeploymentVariables is an autogenerated conversion function. +func Convert_v1beta2_MachineDeploymentVariables_To_v1beta1_MachineDeploymentVariables(in *v1beta2.MachineDeploymentVariables, out *MachineDeploymentVariables, s conversion.Scope) error { + return autoConvert_v1beta2_MachineDeploymentVariables_To_v1beta1_MachineDeploymentVariables(in, out, s) +} + +func autoConvert_v1beta1_MachineDrainRule_To_v1beta2_MachineDrainRule(in *MachineDrainRule, out *v1beta2.MachineDrainRule, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_MachineDrainRuleSpec_To_v1beta2_MachineDrainRuleSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_MachineDrainRule_To_v1beta2_MachineDrainRule is an autogenerated conversion function. +func Convert_v1beta1_MachineDrainRule_To_v1beta2_MachineDrainRule(in *MachineDrainRule, out *v1beta2.MachineDrainRule, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDrainRule_To_v1beta2_MachineDrainRule(in, out, s) +} + +func autoConvert_v1beta2_MachineDrainRule_To_v1beta1_MachineDrainRule(in *v1beta2.MachineDrainRule, out *MachineDrainRule, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta2_MachineDrainRuleSpec_To_v1beta1_MachineDrainRuleSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_MachineDrainRule_To_v1beta1_MachineDrainRule is an autogenerated conversion function. +func Convert_v1beta2_MachineDrainRule_To_v1beta1_MachineDrainRule(in *v1beta2.MachineDrainRule, out *MachineDrainRule, s conversion.Scope) error { + return autoConvert_v1beta2_MachineDrainRule_To_v1beta1_MachineDrainRule(in, out, s) +} + +func autoConvert_v1beta1_MachineDrainRuleDrainConfig_To_v1beta2_MachineDrainRuleDrainConfig(in *MachineDrainRuleDrainConfig, out *v1beta2.MachineDrainRuleDrainConfig, s conversion.Scope) error { + out.Behavior = v1beta2.MachineDrainRuleDrainBehavior(in.Behavior) + out.Order = (*int32)(unsafe.Pointer(in.Order)) + return nil +} + +// Convert_v1beta1_MachineDrainRuleDrainConfig_To_v1beta2_MachineDrainRuleDrainConfig is an autogenerated conversion function. +func Convert_v1beta1_MachineDrainRuleDrainConfig_To_v1beta2_MachineDrainRuleDrainConfig(in *MachineDrainRuleDrainConfig, out *v1beta2.MachineDrainRuleDrainConfig, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDrainRuleDrainConfig_To_v1beta2_MachineDrainRuleDrainConfig(in, out, s) +} + +func autoConvert_v1beta2_MachineDrainRuleDrainConfig_To_v1beta1_MachineDrainRuleDrainConfig(in *v1beta2.MachineDrainRuleDrainConfig, out *MachineDrainRuleDrainConfig, s conversion.Scope) error { + out.Behavior = MachineDrainRuleDrainBehavior(in.Behavior) + out.Order = (*int32)(unsafe.Pointer(in.Order)) + return nil +} + +// Convert_v1beta2_MachineDrainRuleDrainConfig_To_v1beta1_MachineDrainRuleDrainConfig is an autogenerated conversion function. +func Convert_v1beta2_MachineDrainRuleDrainConfig_To_v1beta1_MachineDrainRuleDrainConfig(in *v1beta2.MachineDrainRuleDrainConfig, out *MachineDrainRuleDrainConfig, s conversion.Scope) error { + return autoConvert_v1beta2_MachineDrainRuleDrainConfig_To_v1beta1_MachineDrainRuleDrainConfig(in, out, s) +} + +func autoConvert_v1beta1_MachineDrainRuleList_To_v1beta2_MachineDrainRuleList(in *MachineDrainRuleList, out *v1beta2.MachineDrainRuleList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1beta2.MachineDrainRule)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1beta1_MachineDrainRuleList_To_v1beta2_MachineDrainRuleList is an autogenerated conversion function. +func Convert_v1beta1_MachineDrainRuleList_To_v1beta2_MachineDrainRuleList(in *MachineDrainRuleList, out *v1beta2.MachineDrainRuleList, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDrainRuleList_To_v1beta2_MachineDrainRuleList(in, out, s) +} + +func autoConvert_v1beta2_MachineDrainRuleList_To_v1beta1_MachineDrainRuleList(in *v1beta2.MachineDrainRuleList, out *MachineDrainRuleList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]MachineDrainRule)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1beta2_MachineDrainRuleList_To_v1beta1_MachineDrainRuleList is an autogenerated conversion function. +func Convert_v1beta2_MachineDrainRuleList_To_v1beta1_MachineDrainRuleList(in *v1beta2.MachineDrainRuleList, out *MachineDrainRuleList, s conversion.Scope) error { + return autoConvert_v1beta2_MachineDrainRuleList_To_v1beta1_MachineDrainRuleList(in, out, s) +} + +func autoConvert_v1beta1_MachineDrainRuleMachineSelector_To_v1beta2_MachineDrainRuleMachineSelector(in *MachineDrainRuleMachineSelector, out *v1beta2.MachineDrainRuleMachineSelector, s conversion.Scope) error { + out.Selector = (*v1.LabelSelector)(unsafe.Pointer(in.Selector)) + out.ClusterSelector = (*v1.LabelSelector)(unsafe.Pointer(in.ClusterSelector)) + return nil +} + +// Convert_v1beta1_MachineDrainRuleMachineSelector_To_v1beta2_MachineDrainRuleMachineSelector is an autogenerated conversion function. +func Convert_v1beta1_MachineDrainRuleMachineSelector_To_v1beta2_MachineDrainRuleMachineSelector(in *MachineDrainRuleMachineSelector, out *v1beta2.MachineDrainRuleMachineSelector, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDrainRuleMachineSelector_To_v1beta2_MachineDrainRuleMachineSelector(in, out, s) +} + +func autoConvert_v1beta2_MachineDrainRuleMachineSelector_To_v1beta1_MachineDrainRuleMachineSelector(in *v1beta2.MachineDrainRuleMachineSelector, out *MachineDrainRuleMachineSelector, s conversion.Scope) error { + out.Selector = (*v1.LabelSelector)(unsafe.Pointer(in.Selector)) + out.ClusterSelector = (*v1.LabelSelector)(unsafe.Pointer(in.ClusterSelector)) + return nil +} + +// Convert_v1beta2_MachineDrainRuleMachineSelector_To_v1beta1_MachineDrainRuleMachineSelector is an autogenerated conversion function. +func Convert_v1beta2_MachineDrainRuleMachineSelector_To_v1beta1_MachineDrainRuleMachineSelector(in *v1beta2.MachineDrainRuleMachineSelector, out *MachineDrainRuleMachineSelector, s conversion.Scope) error { + return autoConvert_v1beta2_MachineDrainRuleMachineSelector_To_v1beta1_MachineDrainRuleMachineSelector(in, out, s) +} + +func autoConvert_v1beta1_MachineDrainRulePodSelector_To_v1beta2_MachineDrainRulePodSelector(in *MachineDrainRulePodSelector, out *v1beta2.MachineDrainRulePodSelector, s conversion.Scope) error { + out.Selector = (*v1.LabelSelector)(unsafe.Pointer(in.Selector)) + out.NamespaceSelector = (*v1.LabelSelector)(unsafe.Pointer(in.NamespaceSelector)) + return nil +} + +// Convert_v1beta1_MachineDrainRulePodSelector_To_v1beta2_MachineDrainRulePodSelector is an autogenerated conversion function. +func Convert_v1beta1_MachineDrainRulePodSelector_To_v1beta2_MachineDrainRulePodSelector(in *MachineDrainRulePodSelector, out *v1beta2.MachineDrainRulePodSelector, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDrainRulePodSelector_To_v1beta2_MachineDrainRulePodSelector(in, out, s) +} + +func autoConvert_v1beta2_MachineDrainRulePodSelector_To_v1beta1_MachineDrainRulePodSelector(in *v1beta2.MachineDrainRulePodSelector, out *MachineDrainRulePodSelector, s conversion.Scope) error { + out.Selector = (*v1.LabelSelector)(unsafe.Pointer(in.Selector)) + out.NamespaceSelector = (*v1.LabelSelector)(unsafe.Pointer(in.NamespaceSelector)) + return nil +} + +// Convert_v1beta2_MachineDrainRulePodSelector_To_v1beta1_MachineDrainRulePodSelector is an autogenerated conversion function. +func Convert_v1beta2_MachineDrainRulePodSelector_To_v1beta1_MachineDrainRulePodSelector(in *v1beta2.MachineDrainRulePodSelector, out *MachineDrainRulePodSelector, s conversion.Scope) error { + return autoConvert_v1beta2_MachineDrainRulePodSelector_To_v1beta1_MachineDrainRulePodSelector(in, out, s) +} + +func autoConvert_v1beta1_MachineDrainRuleSpec_To_v1beta2_MachineDrainRuleSpec(in *MachineDrainRuleSpec, out *v1beta2.MachineDrainRuleSpec, s conversion.Scope) error { + if err := Convert_v1beta1_MachineDrainRuleDrainConfig_To_v1beta2_MachineDrainRuleDrainConfig(&in.Drain, &out.Drain, s); err != nil { + return err + } + out.Machines = *(*[]v1beta2.MachineDrainRuleMachineSelector)(unsafe.Pointer(&in.Machines)) + out.Pods = *(*[]v1beta2.MachineDrainRulePodSelector)(unsafe.Pointer(&in.Pods)) + return nil +} + +// Convert_v1beta1_MachineDrainRuleSpec_To_v1beta2_MachineDrainRuleSpec is an autogenerated conversion function. +func Convert_v1beta1_MachineDrainRuleSpec_To_v1beta2_MachineDrainRuleSpec(in *MachineDrainRuleSpec, out *v1beta2.MachineDrainRuleSpec, s conversion.Scope) error { + return autoConvert_v1beta1_MachineDrainRuleSpec_To_v1beta2_MachineDrainRuleSpec(in, out, s) +} + +func autoConvert_v1beta2_MachineDrainRuleSpec_To_v1beta1_MachineDrainRuleSpec(in *v1beta2.MachineDrainRuleSpec, out *MachineDrainRuleSpec, s conversion.Scope) error { + if err := Convert_v1beta2_MachineDrainRuleDrainConfig_To_v1beta1_MachineDrainRuleDrainConfig(&in.Drain, &out.Drain, s); err != nil { + return err + } + out.Machines = *(*[]MachineDrainRuleMachineSelector)(unsafe.Pointer(&in.Machines)) + out.Pods = *(*[]MachineDrainRulePodSelector)(unsafe.Pointer(&in.Pods)) + return nil +} + +// Convert_v1beta2_MachineDrainRuleSpec_To_v1beta1_MachineDrainRuleSpec is an autogenerated conversion function. +func Convert_v1beta2_MachineDrainRuleSpec_To_v1beta1_MachineDrainRuleSpec(in *v1beta2.MachineDrainRuleSpec, out *MachineDrainRuleSpec, s conversion.Scope) error { + return autoConvert_v1beta2_MachineDrainRuleSpec_To_v1beta1_MachineDrainRuleSpec(in, out, s) +} + +func autoConvert_v1beta1_MachineHealthCheck_To_v1beta2_MachineHealthCheck(in *MachineHealthCheck, out *v1beta2.MachineHealthCheck, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_MachineHealthCheckSpec_To_v1beta2_MachineHealthCheckSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_MachineHealthCheckStatus_To_v1beta2_MachineHealthCheckStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_MachineHealthCheck_To_v1beta2_MachineHealthCheck is an autogenerated conversion function. +func Convert_v1beta1_MachineHealthCheck_To_v1beta2_MachineHealthCheck(in *MachineHealthCheck, out *v1beta2.MachineHealthCheck, s conversion.Scope) error { + return autoConvert_v1beta1_MachineHealthCheck_To_v1beta2_MachineHealthCheck(in, out, s) +} + +func autoConvert_v1beta2_MachineHealthCheck_To_v1beta1_MachineHealthCheck(in *v1beta2.MachineHealthCheck, out *MachineHealthCheck, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta2_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta2_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_MachineHealthCheck_To_v1beta1_MachineHealthCheck is an autogenerated conversion function. +func Convert_v1beta2_MachineHealthCheck_To_v1beta1_MachineHealthCheck(in *v1beta2.MachineHealthCheck, out *MachineHealthCheck, s conversion.Scope) error { + return autoConvert_v1beta2_MachineHealthCheck_To_v1beta1_MachineHealthCheck(in, out, s) +} + +func autoConvert_v1beta1_MachineHealthCheckList_To_v1beta2_MachineHealthCheckList(in *MachineHealthCheckList, out *v1beta2.MachineHealthCheckList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta2.MachineHealthCheck, len(*in)) + for i := range *in { + if err := Convert_v1beta1_MachineHealthCheck_To_v1beta2_MachineHealthCheck(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_MachineHealthCheckList_To_v1beta2_MachineHealthCheckList is an autogenerated conversion function. +func Convert_v1beta1_MachineHealthCheckList_To_v1beta2_MachineHealthCheckList(in *MachineHealthCheckList, out *v1beta2.MachineHealthCheckList, s conversion.Scope) error { + return autoConvert_v1beta1_MachineHealthCheckList_To_v1beta2_MachineHealthCheckList(in, out, s) +} + +func autoConvert_v1beta2_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(in *v1beta2.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_v1beta2_MachineHealthCheck_To_v1beta1_MachineHealthCheck(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta2_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList is an autogenerated conversion function. +func Convert_v1beta2_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(in *v1beta2.MachineHealthCheckList, out *MachineHealthCheckList, s conversion.Scope) error { + return autoConvert_v1beta2_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(in, out, s) +} + +func autoConvert_v1beta1_MachineHealthCheckSpec_To_v1beta2_MachineHealthCheckSpec(in *MachineHealthCheckSpec, out *v1beta2.MachineHealthCheckSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.Selector = in.Selector + // WARNING: in.UnhealthyConditions requires manual conversion: does not exist in peer-type + // WARNING: in.MaxUnhealthy requires manual conversion: does not exist in peer-type + // WARNING: in.UnhealthyRange requires manual conversion: does not exist in peer-type + // WARNING: in.NodeStartupTimeout requires manual conversion: does not exist in peer-type + // WARNING: in.RemediationTemplate requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta2_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in *v1beta2.MachineHealthCheckSpec, out *MachineHealthCheckSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.Selector = in.Selector + // WARNING: in.Checks requires manual conversion: does not exist in peer-type + // WARNING: in.Remediation requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta1_MachineHealthCheckStatus_To_v1beta2_MachineHealthCheckStatus(in *MachineHealthCheckStatus, out *v1beta2.MachineHealthCheckStatus, s conversion.Scope) error { + if err := v1.Convert_int32_To_Pointer_int32(&in.ExpectedMachines, &out.ExpectedMachines, s); err != nil { + return err + } + if err := v1.Convert_int32_To_Pointer_int32(&in.CurrentHealthy, &out.CurrentHealthy, s); err != nil { + return err + } + if err := v1.Convert_int32_To_Pointer_int32(&in.RemediationsAllowed, &out.RemediationsAllowed, s); err != nil { + return err + } + out.ObservedGeneration = in.ObservedGeneration + out.Targets = *(*[]string)(unsafe.Pointer(&in.Targets)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + if err := Convert_v1beta1_Condition_To_v1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + // WARNING: in.V1Beta2 requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta2_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in *v1beta2.MachineHealthCheckStatus, out *MachineHealthCheckStatus, s conversion.Scope) error { + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(Conditions, len(*in)) + for i := range *in { + if err := Convert_v1_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + if err := v1.Convert_Pointer_int32_To_int32(&in.ExpectedMachines, &out.ExpectedMachines, s); err != nil { + return err + } + if err := v1.Convert_Pointer_int32_To_int32(&in.CurrentHealthy, &out.CurrentHealthy, s); err != nil { + return err + } + if err := v1.Convert_Pointer_int32_To_int32(&in.RemediationsAllowed, &out.RemediationsAllowed, s); err != nil { + return err + } + out.ObservedGeneration = in.ObservedGeneration + out.Targets = *(*[]string)(unsafe.Pointer(&in.Targets)) + // WARNING: in.Deprecated requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta1_MachineList_To_v1beta2_MachineList(in *MachineList, out *v1beta2.MachineList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta2.Machine, len(*in)) + for i := range *in { + if err := Convert_v1beta1_Machine_To_v1beta2_Machine(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_MachineList_To_v1beta2_MachineList is an autogenerated conversion function. +func Convert_v1beta1_MachineList_To_v1beta2_MachineList(in *MachineList, out *v1beta2.MachineList, s conversion.Scope) error { + return autoConvert_v1beta1_MachineList_To_v1beta2_MachineList(in, out, s) +} + +func autoConvert_v1beta2_MachineList_To_v1beta1_MachineList(in *v1beta2.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_v1beta2_Machine_To_v1beta1_Machine(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta2_MachineList_To_v1beta1_MachineList is an autogenerated conversion function. +func Convert_v1beta2_MachineList_To_v1beta1_MachineList(in *v1beta2.MachineList, out *MachineList, s conversion.Scope) error { + return autoConvert_v1beta2_MachineList_To_v1beta1_MachineList(in, out, s) +} + +func autoConvert_v1beta1_MachinePool_To_v1beta2_MachinePool(in *MachinePool, out *v1beta2.MachinePool, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_MachinePoolSpec_To_v1beta2_MachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_MachinePoolStatus_To_v1beta2_MachinePoolStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_MachinePool_To_v1beta2_MachinePool is an autogenerated conversion function. +func Convert_v1beta1_MachinePool_To_v1beta2_MachinePool(in *MachinePool, out *v1beta2.MachinePool, s conversion.Scope) error { + return autoConvert_v1beta1_MachinePool_To_v1beta2_MachinePool(in, out, s) +} + +func autoConvert_v1beta2_MachinePool_To_v1beta1_MachinePool(in *v1beta2.MachinePool, out *MachinePool, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta2_MachinePoolSpec_To_v1beta1_MachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta2_MachinePoolStatus_To_v1beta1_MachinePoolStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_MachinePool_To_v1beta1_MachinePool is an autogenerated conversion function. +func Convert_v1beta2_MachinePool_To_v1beta1_MachinePool(in *v1beta2.MachinePool, out *MachinePool, s conversion.Scope) error { + return autoConvert_v1beta2_MachinePool_To_v1beta1_MachinePool(in, out, s) +} + +func autoConvert_v1beta1_MachinePoolClass_To_v1beta2_MachinePoolClass(in *MachinePoolClass, out *v1beta2.MachinePoolClass, s conversion.Scope) error { + out.Class = in.Class + // WARNING: in.Template requires manual conversion: does not exist in peer-type + out.FailureDomains = *(*[]string)(unsafe.Pointer(&in.FailureDomains)) + // WARNING: in.NamingStrategy requires manual conversion: does not exist in peer-type + // WARNING: in.NodeDrainTimeout requires manual conversion: does not exist in peer-type + // WARNING: in.NodeVolumeDetachTimeout requires manual conversion: does not exist in peer-type + // WARNING: in.NodeDeletionTimeout requires manual conversion: does not exist in peer-type + out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) + return nil +} + +func autoConvert_v1beta2_MachinePoolClass_To_v1beta1_MachinePoolClass(in *v1beta2.MachinePoolClass, out *MachinePoolClass, s conversion.Scope) error { + // WARNING: in.Metadata requires manual conversion: does not exist in peer-type + out.Class = in.Class + // WARNING: in.Bootstrap requires manual conversion: does not exist in peer-type + // WARNING: in.Infrastructure requires manual conversion: does not exist in peer-type + out.FailureDomains = *(*[]string)(unsafe.Pointer(&in.FailureDomains)) + // WARNING: in.Naming requires manual conversion: does not exist in peer-type + // WARNING: in.Deletion requires manual conversion: does not exist in peer-type + out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) + return nil +} + +func autoConvert_v1beta1_MachinePoolList_To_v1beta2_MachinePoolList(in *MachinePoolList, out *v1beta2.MachinePoolList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta2.MachinePool, len(*in)) + for i := range *in { + if err := Convert_v1beta1_MachinePool_To_v1beta2_MachinePool(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_MachinePoolList_To_v1beta2_MachinePoolList is an autogenerated conversion function. +func Convert_v1beta1_MachinePoolList_To_v1beta2_MachinePoolList(in *MachinePoolList, out *v1beta2.MachinePoolList, s conversion.Scope) error { + return autoConvert_v1beta1_MachinePoolList_To_v1beta2_MachinePoolList(in, out, s) +} + +func autoConvert_v1beta2_MachinePoolList_To_v1beta1_MachinePoolList(in *v1beta2.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_v1beta2_MachinePool_To_v1beta1_MachinePool(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta2_MachinePoolList_To_v1beta1_MachinePoolList is an autogenerated conversion function. +func Convert_v1beta2_MachinePoolList_To_v1beta1_MachinePoolList(in *v1beta2.MachinePoolList, out *MachinePoolList, s conversion.Scope) error { + return autoConvert_v1beta2_MachinePoolList_To_v1beta1_MachinePoolList(in, out, s) +} + +func autoConvert_v1beta1_MachinePoolSpec_To_v1beta2_MachinePoolSpec(in *MachinePoolSpec, out *v1beta2.MachinePoolSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + if err := Convert_v1beta1_MachineTemplateSpec_To_v1beta2_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { + return err + } + // WARNING: in.MinReadySeconds requires manual conversion: does not exist in peer-type + out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) + out.FailureDomains = *(*[]string)(unsafe.Pointer(&in.FailureDomains)) + return nil +} + +func autoConvert_v1beta2_MachinePoolSpec_To_v1beta1_MachinePoolSpec(in *v1beta2.MachinePoolSpec, out *MachinePoolSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + if err := Convert_v1beta2_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { + return err + } + out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) + out.FailureDomains = *(*[]string)(unsafe.Pointer(&in.FailureDomains)) + return nil +} + +// Convert_v1beta2_MachinePoolSpec_To_v1beta1_MachinePoolSpec is an autogenerated conversion function. +func Convert_v1beta2_MachinePoolSpec_To_v1beta1_MachinePoolSpec(in *v1beta2.MachinePoolSpec, out *MachinePoolSpec, s conversion.Scope) error { + return autoConvert_v1beta2_MachinePoolSpec_To_v1beta1_MachinePoolSpec(in, out, s) +} + +func autoConvert_v1beta1_MachinePoolStatus_To_v1beta2_MachinePoolStatus(in *MachinePoolStatus, out *v1beta2.MachinePoolStatus, s conversion.Scope) error { + out.NodeRefs = *(*[]corev1.ObjectReference)(unsafe.Pointer(&in.NodeRefs)) + if err := v1.Convert_int32_To_Pointer_int32(&in.Replicas, &out.Replicas, s); err != nil { + return err + } + if err := v1.Convert_int32_To_Pointer_int32(&in.ReadyReplicas, &out.ReadyReplicas, s); err != nil { + return err + } + if err := v1.Convert_int32_To_Pointer_int32(&in.AvailableReplicas, &out.AvailableReplicas, s); err != nil { + return err + } + // WARNING: in.UnavailableReplicas requires manual conversion: does not exist in peer-type + // WARNING: in.FailureReason requires manual conversion: does not exist in peer-type + // WARNING: in.FailureMessage requires manual conversion: does not exist in peer-type + out.Phase = in.Phase + // WARNING: in.BootstrapReady requires manual conversion: does not exist in peer-type + // WARNING: in.InfrastructureReady requires manual conversion: does not exist in peer-type + out.ObservedGeneration = in.ObservedGeneration + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + if err := Convert_v1beta1_Condition_To_v1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + // WARNING: in.V1Beta2 requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta2_MachinePoolStatus_To_v1beta1_MachinePoolStatus(in *v1beta2.MachinePoolStatus, out *MachinePoolStatus, s conversion.Scope) error { + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(Conditions, len(*in)) + for i := range *in { + if err := Convert_v1_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + // WARNING: in.Initialization requires manual conversion: does not exist in peer-type + out.NodeRefs = *(*[]corev1.ObjectReference)(unsafe.Pointer(&in.NodeRefs)) + if err := v1.Convert_Pointer_int32_To_int32(&in.Replicas, &out.Replicas, s); err != nil { + return err + } + if err := v1.Convert_Pointer_int32_To_int32(&in.ReadyReplicas, &out.ReadyReplicas, s); err != nil { + return err + } + if err := v1.Convert_Pointer_int32_To_int32(&in.AvailableReplicas, &out.AvailableReplicas, s); err != nil { + return err + } + // WARNING: in.UpToDateReplicas requires manual conversion: does not exist in peer-type + out.Phase = in.Phase + out.ObservedGeneration = in.ObservedGeneration + // WARNING: in.Deprecated requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta1_MachinePoolTopology_To_v1beta2_MachinePoolTopology(in *MachinePoolTopology, out *v1beta2.MachinePoolTopology, s conversion.Scope) error { + if err := Convert_v1beta1_ObjectMeta_To_v1beta2_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { + return err + } + out.Class = in.Class + out.Name = in.Name + out.FailureDomains = *(*[]string)(unsafe.Pointer(&in.FailureDomains)) + // WARNING: in.NodeDrainTimeout requires manual conversion: does not exist in peer-type + // WARNING: in.NodeVolumeDetachTimeout requires manual conversion: does not exist in peer-type + // WARNING: in.NodeDeletionTimeout requires manual conversion: does not exist in peer-type + out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + // WARNING: in.Variables requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolVariables vs sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolVariables) + return nil +} + +func autoConvert_v1beta2_MachinePoolTopology_To_v1beta1_MachinePoolTopology(in *v1beta2.MachinePoolTopology, out *MachinePoolTopology, s conversion.Scope) error { + if err := Convert_v1beta2_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { + return err + } + out.Class = in.Class + out.Name = in.Name + out.FailureDomains = *(*[]string)(unsafe.Pointer(&in.FailureDomains)) + // WARNING: in.Deletion requires manual conversion: does not exist in peer-type + out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + // WARNING: in.Variables requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolVariables vs *sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolVariables) + return nil +} + +func autoConvert_v1beta1_MachinePoolVariables_To_v1beta2_MachinePoolVariables(in *MachinePoolVariables, out *v1beta2.MachinePoolVariables, s conversion.Scope) error { + if in.Overrides != nil { + in, out := &in.Overrides, &out.Overrides + *out = make([]v1beta2.ClusterVariable, len(*in)) + for i := range *in { + if err := Convert_v1beta1_ClusterVariable_To_v1beta2_ClusterVariable(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Overrides = nil + } + return nil +} + +// Convert_v1beta1_MachinePoolVariables_To_v1beta2_MachinePoolVariables is an autogenerated conversion function. +func Convert_v1beta1_MachinePoolVariables_To_v1beta2_MachinePoolVariables(in *MachinePoolVariables, out *v1beta2.MachinePoolVariables, s conversion.Scope) error { + return autoConvert_v1beta1_MachinePoolVariables_To_v1beta2_MachinePoolVariables(in, out, s) +} + +func autoConvert_v1beta2_MachinePoolVariables_To_v1beta1_MachinePoolVariables(in *v1beta2.MachinePoolVariables, out *MachinePoolVariables, s conversion.Scope) error { + if in.Overrides != nil { + in, out := &in.Overrides, &out.Overrides + *out = make([]ClusterVariable, len(*in)) + for i := range *in { + if err := Convert_v1beta2_ClusterVariable_To_v1beta1_ClusterVariable(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Overrides = nil + } + return nil +} + +// Convert_v1beta2_MachinePoolVariables_To_v1beta1_MachinePoolVariables is an autogenerated conversion function. +func Convert_v1beta2_MachinePoolVariables_To_v1beta1_MachinePoolVariables(in *v1beta2.MachinePoolVariables, out *MachinePoolVariables, s conversion.Scope) error { + return autoConvert_v1beta2_MachinePoolVariables_To_v1beta1_MachinePoolVariables(in, out, s) +} + +func autoConvert_v1beta1_MachineReadinessGate_To_v1beta2_MachineReadinessGate(in *MachineReadinessGate, out *v1beta2.MachineReadinessGate, s conversion.Scope) error { + out.ConditionType = in.ConditionType + out.Polarity = v1beta2.ConditionPolarity(in.Polarity) + return nil +} + +// Convert_v1beta1_MachineReadinessGate_To_v1beta2_MachineReadinessGate is an autogenerated conversion function. +func Convert_v1beta1_MachineReadinessGate_To_v1beta2_MachineReadinessGate(in *MachineReadinessGate, out *v1beta2.MachineReadinessGate, s conversion.Scope) error { + return autoConvert_v1beta1_MachineReadinessGate_To_v1beta2_MachineReadinessGate(in, out, s) +} + +func autoConvert_v1beta2_MachineReadinessGate_To_v1beta1_MachineReadinessGate(in *v1beta2.MachineReadinessGate, out *MachineReadinessGate, s conversion.Scope) error { + out.ConditionType = in.ConditionType + out.Polarity = ConditionPolarity(in.Polarity) + return nil +} + +// Convert_v1beta2_MachineReadinessGate_To_v1beta1_MachineReadinessGate is an autogenerated conversion function. +func Convert_v1beta2_MachineReadinessGate_To_v1beta1_MachineReadinessGate(in *v1beta2.MachineReadinessGate, out *MachineReadinessGate, s conversion.Scope) error { + return autoConvert_v1beta2_MachineReadinessGate_To_v1beta1_MachineReadinessGate(in, out, s) +} + +func autoConvert_v1beta1_MachineSet_To_v1beta2_MachineSet(in *MachineSet, out *v1beta2.MachineSet, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_MachineSetSpec_To_v1beta2_MachineSetSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_MachineSetStatus_To_v1beta2_MachineSetStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_MachineSet_To_v1beta2_MachineSet is an autogenerated conversion function. +func Convert_v1beta1_MachineSet_To_v1beta2_MachineSet(in *MachineSet, out *v1beta2.MachineSet, s conversion.Scope) error { + return autoConvert_v1beta1_MachineSet_To_v1beta2_MachineSet(in, out, s) +} + +func autoConvert_v1beta2_MachineSet_To_v1beta1_MachineSet(in *v1beta2.MachineSet, out *MachineSet, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta2_MachineSetSpec_To_v1beta1_MachineSetSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta2_MachineSetStatus_To_v1beta1_MachineSetStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_MachineSet_To_v1beta1_MachineSet is an autogenerated conversion function. +func Convert_v1beta2_MachineSet_To_v1beta1_MachineSet(in *v1beta2.MachineSet, out *MachineSet, s conversion.Scope) error { + return autoConvert_v1beta2_MachineSet_To_v1beta1_MachineSet(in, out, s) +} + +func autoConvert_v1beta1_MachineSetList_To_v1beta2_MachineSetList(in *MachineSetList, out *v1beta2.MachineSetList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta2.MachineSet, len(*in)) + for i := range *in { + if err := Convert_v1beta1_MachineSet_To_v1beta2_MachineSet(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_MachineSetList_To_v1beta2_MachineSetList is an autogenerated conversion function. +func Convert_v1beta1_MachineSetList_To_v1beta2_MachineSetList(in *MachineSetList, out *v1beta2.MachineSetList, s conversion.Scope) error { + return autoConvert_v1beta1_MachineSetList_To_v1beta2_MachineSetList(in, out, s) +} + +func autoConvert_v1beta2_MachineSetList_To_v1beta1_MachineSetList(in *v1beta2.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_v1beta2_MachineSet_To_v1beta1_MachineSet(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta2_MachineSetList_To_v1beta1_MachineSetList is an autogenerated conversion function. +func Convert_v1beta2_MachineSetList_To_v1beta1_MachineSetList(in *v1beta2.MachineSetList, out *MachineSetList, s conversion.Scope) error { + return autoConvert_v1beta2_MachineSetList_To_v1beta1_MachineSetList(in, out, s) +} + +func autoConvert_v1beta1_MachineSetSpec_To_v1beta2_MachineSetSpec(in *MachineSetSpec, out *v1beta2.MachineSetSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + // WARNING: in.MinReadySeconds requires manual conversion: does not exist in peer-type + // WARNING: in.DeletePolicy requires manual conversion: does not exist in peer-type + out.Selector = in.Selector + if err := Convert_v1beta1_MachineTemplateSpec_To_v1beta2_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { + return err + } + // WARNING: in.MachineNamingStrategy requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta2_MachineSetSpec_To_v1beta1_MachineSetSpec(in *v1beta2.MachineSetSpec, out *MachineSetSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + out.Selector = in.Selector + if err := Convert_v1beta2_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { + return err + } + // WARNING: in.MachineNaming requires manual conversion: does not exist in peer-type + // WARNING: in.Deletion requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta1_MachineSetStatus_To_v1beta2_MachineSetStatus(in *MachineSetStatus, out *v1beta2.MachineSetStatus, s conversion.Scope) error { + out.Selector = in.Selector + if err := v1.Convert_int32_To_Pointer_int32(&in.Replicas, &out.Replicas, s); err != nil { + return err + } + // WARNING: in.FullyLabeledReplicas requires manual conversion: does not exist in peer-type + if err := v1.Convert_int32_To_Pointer_int32(&in.ReadyReplicas, &out.ReadyReplicas, s); err != nil { + return err + } + if err := v1.Convert_int32_To_Pointer_int32(&in.AvailableReplicas, &out.AvailableReplicas, s); err != nil { + return err + } + out.ObservedGeneration = in.ObservedGeneration + // WARNING: in.FailureReason requires manual conversion: does not exist in peer-type + // WARNING: in.FailureMessage requires manual conversion: does not exist in peer-type + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + if err := Convert_v1beta1_Condition_To_v1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + // WARNING: in.V1Beta2 requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta2_MachineSetStatus_To_v1beta1_MachineSetStatus(in *v1beta2.MachineSetStatus, out *MachineSetStatus, s conversion.Scope) error { + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(Conditions, len(*in)) + for i := range *in { + if err := Convert_v1_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + out.Selector = in.Selector + if err := v1.Convert_Pointer_int32_To_int32(&in.Replicas, &out.Replicas, s); err != nil { + return err + } + if err := v1.Convert_Pointer_int32_To_int32(&in.ReadyReplicas, &out.ReadyReplicas, s); err != nil { + return err + } + if err := v1.Convert_Pointer_int32_To_int32(&in.AvailableReplicas, &out.AvailableReplicas, s); err != nil { + return err + } + // WARNING: in.UpToDateReplicas requires manual conversion: does not exist in peer-type + out.ObservedGeneration = in.ObservedGeneration + // WARNING: in.Deprecated requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta1_MachineSpec_To_v1beta2_MachineSpec(in *MachineSpec, out *v1beta2.MachineSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + if err := Convert_v1beta1_Bootstrap_To_v1beta2_Bootstrap(&in.Bootstrap, &out.Bootstrap, s); err != nil { + return err + } + if err := Convert_v1_ObjectReference_To_v1beta2_ContractVersionedObjectReference(&in.InfrastructureRef, &out.InfrastructureRef, s); err != nil { + return err + } + if err := v1.Convert_Pointer_string_To_string(&in.Version, &out.Version, s); err != nil { + return err + } + if err := v1.Convert_Pointer_string_To_string(&in.ProviderID, &out.ProviderID, s); err != nil { + return err + } + if err := v1.Convert_Pointer_string_To_string(&in.FailureDomain, &out.FailureDomain, s); err != nil { + return err + } + out.ReadinessGates = *(*[]v1beta2.MachineReadinessGate)(unsafe.Pointer(&in.ReadinessGates)) + // WARNING: in.NodeDrainTimeout requires manual conversion: does not exist in peer-type + // WARNING: in.NodeVolumeDetachTimeout requires manual conversion: does not exist in peer-type + // WARNING: in.NodeDeletionTimeout requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta2_MachineSpec_To_v1beta1_MachineSpec(in *v1beta2.MachineSpec, out *MachineSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + if err := Convert_v1beta2_Bootstrap_To_v1beta1_Bootstrap(&in.Bootstrap, &out.Bootstrap, s); err != nil { + return err + } + if err := Convert_v1beta2_ContractVersionedObjectReference_To_v1_ObjectReference(&in.InfrastructureRef, &out.InfrastructureRef, s); err != nil { + return err + } + if err := v1.Convert_string_To_Pointer_string(&in.Version, &out.Version, s); err != nil { + return err + } + if err := v1.Convert_string_To_Pointer_string(&in.ProviderID, &out.ProviderID, s); err != nil { + return err + } + if err := v1.Convert_string_To_Pointer_string(&in.FailureDomain, &out.FailureDomain, s); err != nil { + return err + } + // WARNING: in.MinReadySeconds requires manual conversion: does not exist in peer-type + out.ReadinessGates = *(*[]MachineReadinessGate)(unsafe.Pointer(&in.ReadinessGates)) + // WARNING: in.Deletion requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta1_MachineStatus_To_v1beta2_MachineStatus(in *MachineStatus, out *v1beta2.MachineStatus, s conversion.Scope) error { + // WARNING: in.NodeRef requires manual conversion: inconvertible types (*k8s.io/api/core/v1.ObjectReference vs sigs.k8s.io/cluster-api/api/core/v1beta2.MachineNodeReference) + out.NodeInfo = (*corev1.NodeSystemInfo)(unsafe.Pointer(in.NodeInfo)) + // WARNING: in.LastUpdated requires manual conversion: inconvertible types (*k8s.io/apimachinery/pkg/apis/meta/v1.Time vs k8s.io/apimachinery/pkg/apis/meta/v1.Time) + // WARNING: in.FailureReason requires manual conversion: does not exist in peer-type + // WARNING: in.FailureMessage requires manual conversion: does not exist in peer-type + out.Addresses = *(*v1beta2.MachineAddresses)(unsafe.Pointer(&in.Addresses)) + out.Phase = in.Phase + // WARNING: in.CertificatesExpiryDate requires manual conversion: inconvertible types (*k8s.io/apimachinery/pkg/apis/meta/v1.Time vs k8s.io/apimachinery/pkg/apis/meta/v1.Time) + // WARNING: in.BootstrapReady requires manual conversion: does not exist in peer-type + // WARNING: in.InfrastructureReady requires manual conversion: does not exist in peer-type + out.ObservedGeneration = in.ObservedGeneration + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + if err := Convert_v1beta1_Condition_To_v1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + if in.Deletion != nil { + in, out := &in.Deletion, &out.Deletion + *out = new(v1beta2.MachineDeletionStatus) + if err := Convert_v1beta1_MachineDeletionStatus_To_v1beta2_MachineDeletionStatus(*in, *out, s); err != nil { + return err + } + } else { + out.Deletion = nil + } + // WARNING: in.V1Beta2 requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta2_MachineStatus_To_v1beta1_MachineStatus(in *v1beta2.MachineStatus, out *MachineStatus, s conversion.Scope) error { + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(Conditions, len(*in)) + for i := range *in { + if err := Convert_v1_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + // WARNING: in.Initialization requires manual conversion: does not exist in peer-type + // WARNING: in.NodeRef requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api/api/core/v1beta2.MachineNodeReference vs *k8s.io/api/core/v1.ObjectReference) + out.NodeInfo = (*corev1.NodeSystemInfo)(unsafe.Pointer(in.NodeInfo)) + // WARNING: in.LastUpdated requires manual conversion: inconvertible types (k8s.io/apimachinery/pkg/apis/meta/v1.Time vs *k8s.io/apimachinery/pkg/apis/meta/v1.Time) + out.Addresses = *(*MachineAddresses)(unsafe.Pointer(&in.Addresses)) + out.Phase = in.Phase + // WARNING: in.CertificatesExpiryDate requires manual conversion: inconvertible types (k8s.io/apimachinery/pkg/apis/meta/v1.Time vs *k8s.io/apimachinery/pkg/apis/meta/v1.Time) + out.ObservedGeneration = in.ObservedGeneration + if in.Deletion != nil { + in, out := &in.Deletion, &out.Deletion + *out = new(MachineDeletionStatus) + if err := Convert_v1beta2_MachineDeletionStatus_To_v1beta1_MachineDeletionStatus(*in, *out, s); err != nil { + return err + } + } else { + out.Deletion = nil + } + // WARNING: in.Deprecated requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta1_MachineTemplateSpec_To_v1beta2_MachineTemplateSpec(in *MachineTemplateSpec, out *v1beta2.MachineTemplateSpec, s conversion.Scope) error { + if err := Convert_v1beta1_ObjectMeta_To_v1beta2_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { + return err + } + if err := Convert_v1beta1_MachineSpec_To_v1beta2_MachineSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_MachineTemplateSpec_To_v1beta2_MachineTemplateSpec is an autogenerated conversion function. +func Convert_v1beta1_MachineTemplateSpec_To_v1beta2_MachineTemplateSpec(in *MachineTemplateSpec, out *v1beta2.MachineTemplateSpec, s conversion.Scope) error { + return autoConvert_v1beta1_MachineTemplateSpec_To_v1beta2_MachineTemplateSpec(in, out, s) +} + +func autoConvert_v1beta2_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(in *v1beta2.MachineTemplateSpec, out *MachineTemplateSpec, s conversion.Scope) error { + if err := Convert_v1beta2_ObjectMeta_To_v1beta1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { + return err + } + if err := Convert_v1beta2_MachineSpec_To_v1beta1_MachineSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec is an autogenerated conversion function. +func Convert_v1beta2_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(in *v1beta2.MachineTemplateSpec, out *MachineTemplateSpec, s conversion.Scope) error { + return autoConvert_v1beta2_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(in, out, s) +} + +func autoConvert_v1beta1_NetworkRanges_To_v1beta2_NetworkRanges(in *NetworkRanges, out *v1beta2.NetworkRanges, s conversion.Scope) error { + out.CIDRBlocks = *(*[]string)(unsafe.Pointer(&in.CIDRBlocks)) + return nil +} + +// Convert_v1beta1_NetworkRanges_To_v1beta2_NetworkRanges is an autogenerated conversion function. +func Convert_v1beta1_NetworkRanges_To_v1beta2_NetworkRanges(in *NetworkRanges, out *v1beta2.NetworkRanges, s conversion.Scope) error { + return autoConvert_v1beta1_NetworkRanges_To_v1beta2_NetworkRanges(in, out, s) +} + +func autoConvert_v1beta2_NetworkRanges_To_v1beta1_NetworkRanges(in *v1beta2.NetworkRanges, out *NetworkRanges, s conversion.Scope) error { + out.CIDRBlocks = *(*[]string)(unsafe.Pointer(&in.CIDRBlocks)) + return nil +} + +// Convert_v1beta2_NetworkRanges_To_v1beta1_NetworkRanges is an autogenerated conversion function. +func Convert_v1beta2_NetworkRanges_To_v1beta1_NetworkRanges(in *v1beta2.NetworkRanges, out *NetworkRanges, s conversion.Scope) error { + return autoConvert_v1beta2_NetworkRanges_To_v1beta1_NetworkRanges(in, out, s) +} + +func autoConvert_v1beta1_ObjectMeta_To_v1beta2_ObjectMeta(in *ObjectMeta, out *v1beta2.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_v1beta2_ObjectMeta is an autogenerated conversion function. +func Convert_v1beta1_ObjectMeta_To_v1beta2_ObjectMeta(in *ObjectMeta, out *v1beta2.ObjectMeta, s conversion.Scope) error { + return autoConvert_v1beta1_ObjectMeta_To_v1beta2_ObjectMeta(in, out, s) +} + +func autoConvert_v1beta2_ObjectMeta_To_v1beta1_ObjectMeta(in *v1beta2.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_v1beta2_ObjectMeta_To_v1beta1_ObjectMeta is an autogenerated conversion function. +func Convert_v1beta2_ObjectMeta_To_v1beta1_ObjectMeta(in *v1beta2.ObjectMeta, out *ObjectMeta, s conversion.Scope) error { + return autoConvert_v1beta2_ObjectMeta_To_v1beta1_ObjectMeta(in, out, s) +} + +func autoConvert_v1beta1_PatchDefinition_To_v1beta2_PatchDefinition(in *PatchDefinition, out *v1beta2.PatchDefinition, s conversion.Scope) error { + if err := Convert_v1beta1_PatchSelector_To_v1beta2_PatchSelector(&in.Selector, &out.Selector, s); err != nil { + return err + } + if in.JSONPatches != nil { + in, out := &in.JSONPatches, &out.JSONPatches + *out = make([]v1beta2.JSONPatch, len(*in)) + for i := range *in { + if err := Convert_v1beta1_JSONPatch_To_v1beta2_JSONPatch(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.JSONPatches = nil + } + return nil +} + +// Convert_v1beta1_PatchDefinition_To_v1beta2_PatchDefinition is an autogenerated conversion function. +func Convert_v1beta1_PatchDefinition_To_v1beta2_PatchDefinition(in *PatchDefinition, out *v1beta2.PatchDefinition, s conversion.Scope) error { + return autoConvert_v1beta1_PatchDefinition_To_v1beta2_PatchDefinition(in, out, s) +} + +func autoConvert_v1beta2_PatchDefinition_To_v1beta1_PatchDefinition(in *v1beta2.PatchDefinition, out *PatchDefinition, s conversion.Scope) error { + if err := Convert_v1beta2_PatchSelector_To_v1beta1_PatchSelector(&in.Selector, &out.Selector, s); err != nil { + return err + } + if in.JSONPatches != nil { + in, out := &in.JSONPatches, &out.JSONPatches + *out = make([]JSONPatch, len(*in)) + for i := range *in { + if err := Convert_v1beta2_JSONPatch_To_v1beta1_JSONPatch(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.JSONPatches = nil + } + return nil +} + +// Convert_v1beta2_PatchDefinition_To_v1beta1_PatchDefinition is an autogenerated conversion function. +func Convert_v1beta2_PatchDefinition_To_v1beta1_PatchDefinition(in *v1beta2.PatchDefinition, out *PatchDefinition, s conversion.Scope) error { + return autoConvert_v1beta2_PatchDefinition_To_v1beta1_PatchDefinition(in, out, s) +} + +func autoConvert_v1beta1_PatchSelector_To_v1beta2_PatchSelector(in *PatchSelector, out *v1beta2.PatchSelector, s conversion.Scope) error { + out.APIVersion = in.APIVersion + out.Kind = in.Kind + if err := Convert_v1beta1_PatchSelectorMatch_To_v1beta2_PatchSelectorMatch(&in.MatchResources, &out.MatchResources, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_PatchSelector_To_v1beta2_PatchSelector is an autogenerated conversion function. +func Convert_v1beta1_PatchSelector_To_v1beta2_PatchSelector(in *PatchSelector, out *v1beta2.PatchSelector, s conversion.Scope) error { + return autoConvert_v1beta1_PatchSelector_To_v1beta2_PatchSelector(in, out, s) +} + +func autoConvert_v1beta2_PatchSelector_To_v1beta1_PatchSelector(in *v1beta2.PatchSelector, out *PatchSelector, s conversion.Scope) error { + out.APIVersion = in.APIVersion + out.Kind = in.Kind + if err := Convert_v1beta2_PatchSelectorMatch_To_v1beta1_PatchSelectorMatch(&in.MatchResources, &out.MatchResources, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_PatchSelector_To_v1beta1_PatchSelector is an autogenerated conversion function. +func Convert_v1beta2_PatchSelector_To_v1beta1_PatchSelector(in *v1beta2.PatchSelector, out *PatchSelector, s conversion.Scope) error { + return autoConvert_v1beta2_PatchSelector_To_v1beta1_PatchSelector(in, out, s) +} + +func autoConvert_v1beta1_PatchSelectorMatch_To_v1beta2_PatchSelectorMatch(in *PatchSelectorMatch, out *v1beta2.PatchSelectorMatch, s conversion.Scope) error { + if err := v1.Convert_bool_To_Pointer_bool(&in.ControlPlane, &out.ControlPlane, s); err != nil { + return err + } + if err := v1.Convert_bool_To_Pointer_bool(&in.InfrastructureCluster, &out.InfrastructureCluster, s); err != nil { + return err + } + out.MachineDeploymentClass = (*v1beta2.PatchSelectorMatchMachineDeploymentClass)(unsafe.Pointer(in.MachineDeploymentClass)) + out.MachinePoolClass = (*v1beta2.PatchSelectorMatchMachinePoolClass)(unsafe.Pointer(in.MachinePoolClass)) + return nil +} + +// Convert_v1beta1_PatchSelectorMatch_To_v1beta2_PatchSelectorMatch is an autogenerated conversion function. +func Convert_v1beta1_PatchSelectorMatch_To_v1beta2_PatchSelectorMatch(in *PatchSelectorMatch, out *v1beta2.PatchSelectorMatch, s conversion.Scope) error { + return autoConvert_v1beta1_PatchSelectorMatch_To_v1beta2_PatchSelectorMatch(in, out, s) +} + +func autoConvert_v1beta2_PatchSelectorMatch_To_v1beta1_PatchSelectorMatch(in *v1beta2.PatchSelectorMatch, out *PatchSelectorMatch, s conversion.Scope) error { + if err := v1.Convert_Pointer_bool_To_bool(&in.ControlPlane, &out.ControlPlane, s); err != nil { + return err + } + if err := v1.Convert_Pointer_bool_To_bool(&in.InfrastructureCluster, &out.InfrastructureCluster, s); err != nil { + return err + } + out.MachineDeploymentClass = (*PatchSelectorMatchMachineDeploymentClass)(unsafe.Pointer(in.MachineDeploymentClass)) + out.MachinePoolClass = (*PatchSelectorMatchMachinePoolClass)(unsafe.Pointer(in.MachinePoolClass)) + return nil +} + +// Convert_v1beta2_PatchSelectorMatch_To_v1beta1_PatchSelectorMatch is an autogenerated conversion function. +func Convert_v1beta2_PatchSelectorMatch_To_v1beta1_PatchSelectorMatch(in *v1beta2.PatchSelectorMatch, out *PatchSelectorMatch, s conversion.Scope) error { + return autoConvert_v1beta2_PatchSelectorMatch_To_v1beta1_PatchSelectorMatch(in, out, s) +} + +func autoConvert_v1beta1_PatchSelectorMatchMachineDeploymentClass_To_v1beta2_PatchSelectorMatchMachineDeploymentClass(in *PatchSelectorMatchMachineDeploymentClass, out *v1beta2.PatchSelectorMatchMachineDeploymentClass, s conversion.Scope) error { + out.Names = *(*[]string)(unsafe.Pointer(&in.Names)) + return nil +} + +// Convert_v1beta1_PatchSelectorMatchMachineDeploymentClass_To_v1beta2_PatchSelectorMatchMachineDeploymentClass is an autogenerated conversion function. +func Convert_v1beta1_PatchSelectorMatchMachineDeploymentClass_To_v1beta2_PatchSelectorMatchMachineDeploymentClass(in *PatchSelectorMatchMachineDeploymentClass, out *v1beta2.PatchSelectorMatchMachineDeploymentClass, s conversion.Scope) error { + return autoConvert_v1beta1_PatchSelectorMatchMachineDeploymentClass_To_v1beta2_PatchSelectorMatchMachineDeploymentClass(in, out, s) +} + +func autoConvert_v1beta2_PatchSelectorMatchMachineDeploymentClass_To_v1beta1_PatchSelectorMatchMachineDeploymentClass(in *v1beta2.PatchSelectorMatchMachineDeploymentClass, out *PatchSelectorMatchMachineDeploymentClass, s conversion.Scope) error { + out.Names = *(*[]string)(unsafe.Pointer(&in.Names)) + return nil +} + +// Convert_v1beta2_PatchSelectorMatchMachineDeploymentClass_To_v1beta1_PatchSelectorMatchMachineDeploymentClass is an autogenerated conversion function. +func Convert_v1beta2_PatchSelectorMatchMachineDeploymentClass_To_v1beta1_PatchSelectorMatchMachineDeploymentClass(in *v1beta2.PatchSelectorMatchMachineDeploymentClass, out *PatchSelectorMatchMachineDeploymentClass, s conversion.Scope) error { + return autoConvert_v1beta2_PatchSelectorMatchMachineDeploymentClass_To_v1beta1_PatchSelectorMatchMachineDeploymentClass(in, out, s) +} + +func autoConvert_v1beta1_PatchSelectorMatchMachinePoolClass_To_v1beta2_PatchSelectorMatchMachinePoolClass(in *PatchSelectorMatchMachinePoolClass, out *v1beta2.PatchSelectorMatchMachinePoolClass, s conversion.Scope) error { + out.Names = *(*[]string)(unsafe.Pointer(&in.Names)) + return nil +} + +// Convert_v1beta1_PatchSelectorMatchMachinePoolClass_To_v1beta2_PatchSelectorMatchMachinePoolClass is an autogenerated conversion function. +func Convert_v1beta1_PatchSelectorMatchMachinePoolClass_To_v1beta2_PatchSelectorMatchMachinePoolClass(in *PatchSelectorMatchMachinePoolClass, out *v1beta2.PatchSelectorMatchMachinePoolClass, s conversion.Scope) error { + return autoConvert_v1beta1_PatchSelectorMatchMachinePoolClass_To_v1beta2_PatchSelectorMatchMachinePoolClass(in, out, s) +} + +func autoConvert_v1beta2_PatchSelectorMatchMachinePoolClass_To_v1beta1_PatchSelectorMatchMachinePoolClass(in *v1beta2.PatchSelectorMatchMachinePoolClass, out *PatchSelectorMatchMachinePoolClass, s conversion.Scope) error { + out.Names = *(*[]string)(unsafe.Pointer(&in.Names)) + return nil +} + +// Convert_v1beta2_PatchSelectorMatchMachinePoolClass_To_v1beta1_PatchSelectorMatchMachinePoolClass is an autogenerated conversion function. +func Convert_v1beta2_PatchSelectorMatchMachinePoolClass_To_v1beta1_PatchSelectorMatchMachinePoolClass(in *v1beta2.PatchSelectorMatchMachinePoolClass, out *PatchSelectorMatchMachinePoolClass, s conversion.Scope) error { + return autoConvert_v1beta2_PatchSelectorMatchMachinePoolClass_To_v1beta1_PatchSelectorMatchMachinePoolClass(in, out, s) +} + +func autoConvert_v1beta1_Topology_To_v1beta2_Topology(in *Topology, out *v1beta2.Topology, s conversion.Scope) error { + // WARNING: in.Class requires manual conversion: does not exist in peer-type + // WARNING: in.ClassNamespace requires manual conversion: does not exist in peer-type + out.Version = in.Version + // WARNING: in.RolloutAfter requires manual conversion: does not exist in peer-type + if err := Convert_v1beta1_ControlPlaneTopology_To_v1beta2_ControlPlaneTopology(&in.ControlPlane, &out.ControlPlane, s); err != nil { + return err + } + // WARNING: in.Workers requires manual conversion: inconvertible types (*sigs.k8s.io/cluster-api/api/core/v1beta1.WorkersTopology vs sigs.k8s.io/cluster-api/api/core/v1beta2.WorkersTopology) + if in.Variables != nil { + in, out := &in.Variables, &out.Variables + *out = make([]v1beta2.ClusterVariable, len(*in)) + for i := range *in { + if err := Convert_v1beta1_ClusterVariable_To_v1beta2_ClusterVariable(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Variables = nil + } + return nil +} + +func autoConvert_v1beta2_Topology_To_v1beta1_Topology(in *v1beta2.Topology, out *Topology, s conversion.Scope) error { + // WARNING: in.ClassRef requires manual conversion: does not exist in peer-type + out.Version = in.Version + if err := Convert_v1beta2_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(&in.ControlPlane, &out.ControlPlane, s); err != nil { + return err + } + // WARNING: in.Workers requires manual conversion: inconvertible types (sigs.k8s.io/cluster-api/api/core/v1beta2.WorkersTopology vs *sigs.k8s.io/cluster-api/api/core/v1beta1.WorkersTopology) + if in.Variables != nil { + in, out := &in.Variables, &out.Variables + *out = make([]ClusterVariable, len(*in)) + for i := range *in { + if err := Convert_v1beta2_ClusterVariable_To_v1beta1_ClusterVariable(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Variables = nil + } + return nil +} + +func autoConvert_v1beta1_ValidationRule_To_v1beta2_ValidationRule(in *ValidationRule, out *v1beta2.ValidationRule, s conversion.Scope) error { + out.Rule = in.Rule + out.Message = in.Message + out.MessageExpression = in.MessageExpression + out.Reason = v1beta2.FieldValueErrorReason(in.Reason) + out.FieldPath = in.FieldPath + return nil +} + +// Convert_v1beta1_ValidationRule_To_v1beta2_ValidationRule is an autogenerated conversion function. +func Convert_v1beta1_ValidationRule_To_v1beta2_ValidationRule(in *ValidationRule, out *v1beta2.ValidationRule, s conversion.Scope) error { + return autoConvert_v1beta1_ValidationRule_To_v1beta2_ValidationRule(in, out, s) +} + +func autoConvert_v1beta2_ValidationRule_To_v1beta1_ValidationRule(in *v1beta2.ValidationRule, out *ValidationRule, s conversion.Scope) error { + out.Rule = in.Rule + out.Message = in.Message + out.MessageExpression = in.MessageExpression + out.Reason = FieldValueErrorReason(in.Reason) + out.FieldPath = in.FieldPath + return nil +} + +// Convert_v1beta2_ValidationRule_To_v1beta1_ValidationRule is an autogenerated conversion function. +func Convert_v1beta2_ValidationRule_To_v1beta1_ValidationRule(in *v1beta2.ValidationRule, out *ValidationRule, s conversion.Scope) error { + return autoConvert_v1beta2_ValidationRule_To_v1beta1_ValidationRule(in, out, s) +} + +func autoConvert_v1beta1_VariableSchema_To_v1beta2_VariableSchema(in *VariableSchema, out *v1beta2.VariableSchema, s conversion.Scope) error { + if err := Convert_v1beta1_JSONSchemaProps_To_v1beta2_JSONSchemaProps(&in.OpenAPIV3Schema, &out.OpenAPIV3Schema, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_VariableSchema_To_v1beta2_VariableSchema is an autogenerated conversion function. +func Convert_v1beta1_VariableSchema_To_v1beta2_VariableSchema(in *VariableSchema, out *v1beta2.VariableSchema, s conversion.Scope) error { + return autoConvert_v1beta1_VariableSchema_To_v1beta2_VariableSchema(in, out, s) +} + +func autoConvert_v1beta2_VariableSchema_To_v1beta1_VariableSchema(in *v1beta2.VariableSchema, out *VariableSchema, s conversion.Scope) error { + if err := Convert_v1beta2_JSONSchemaProps_To_v1beta1_JSONSchemaProps(&in.OpenAPIV3Schema, &out.OpenAPIV3Schema, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_VariableSchema_To_v1beta1_VariableSchema is an autogenerated conversion function. +func Convert_v1beta2_VariableSchema_To_v1beta1_VariableSchema(in *v1beta2.VariableSchema, out *VariableSchema, s conversion.Scope) error { + return autoConvert_v1beta2_VariableSchema_To_v1beta1_VariableSchema(in, out, s) +} + +func autoConvert_v1beta1_VariableSchemaMetadata_To_v1beta2_VariableSchemaMetadata(in *VariableSchemaMetadata, out *v1beta2.VariableSchemaMetadata, 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_VariableSchemaMetadata_To_v1beta2_VariableSchemaMetadata is an autogenerated conversion function. +func Convert_v1beta1_VariableSchemaMetadata_To_v1beta2_VariableSchemaMetadata(in *VariableSchemaMetadata, out *v1beta2.VariableSchemaMetadata, s conversion.Scope) error { + return autoConvert_v1beta1_VariableSchemaMetadata_To_v1beta2_VariableSchemaMetadata(in, out, s) +} + +func autoConvert_v1beta2_VariableSchemaMetadata_To_v1beta1_VariableSchemaMetadata(in *v1beta2.VariableSchemaMetadata, out *VariableSchemaMetadata, 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_v1beta2_VariableSchemaMetadata_To_v1beta1_VariableSchemaMetadata is an autogenerated conversion function. +func Convert_v1beta2_VariableSchemaMetadata_To_v1beta1_VariableSchemaMetadata(in *v1beta2.VariableSchemaMetadata, out *VariableSchemaMetadata, s conversion.Scope) error { + return autoConvert_v1beta2_VariableSchemaMetadata_To_v1beta1_VariableSchemaMetadata(in, out, s) +} + +func autoConvert_v1beta1_WorkersClass_To_v1beta2_WorkersClass(in *WorkersClass, out *v1beta2.WorkersClass, s conversion.Scope) error { + if in.MachineDeployments != nil { + in, out := &in.MachineDeployments, &out.MachineDeployments + *out = make([]v1beta2.MachineDeploymentClass, len(*in)) + for i := range *in { + if err := Convert_v1beta1_MachineDeploymentClass_To_v1beta2_MachineDeploymentClass(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.MachineDeployments = nil + } + if in.MachinePools != nil { + in, out := &in.MachinePools, &out.MachinePools + *out = make([]v1beta2.MachinePoolClass, len(*in)) + for i := range *in { + if err := Convert_v1beta1_MachinePoolClass_To_v1beta2_MachinePoolClass(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.MachinePools = nil + } + return nil +} + +// Convert_v1beta1_WorkersClass_To_v1beta2_WorkersClass is an autogenerated conversion function. +func Convert_v1beta1_WorkersClass_To_v1beta2_WorkersClass(in *WorkersClass, out *v1beta2.WorkersClass, s conversion.Scope) error { + return autoConvert_v1beta1_WorkersClass_To_v1beta2_WorkersClass(in, out, s) +} + +func autoConvert_v1beta2_WorkersClass_To_v1beta1_WorkersClass(in *v1beta2.WorkersClass, out *WorkersClass, s conversion.Scope) error { + if in.MachineDeployments != nil { + in, out := &in.MachineDeployments, &out.MachineDeployments + *out = make([]MachineDeploymentClass, len(*in)) + for i := range *in { + if err := Convert_v1beta2_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.MachineDeployments = nil + } + if in.MachinePools != nil { + in, out := &in.MachinePools, &out.MachinePools + *out = make([]MachinePoolClass, len(*in)) + for i := range *in { + if err := Convert_v1beta2_MachinePoolClass_To_v1beta1_MachinePoolClass(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.MachinePools = nil + } + return nil +} + +// Convert_v1beta2_WorkersClass_To_v1beta1_WorkersClass is an autogenerated conversion function. +func Convert_v1beta2_WorkersClass_To_v1beta1_WorkersClass(in *v1beta2.WorkersClass, out *WorkersClass, s conversion.Scope) error { + return autoConvert_v1beta2_WorkersClass_To_v1beta1_WorkersClass(in, out, s) +} + +func autoConvert_v1beta1_WorkersStatus_To_v1beta2_WorkersStatus(in *WorkersStatus, out *v1beta2.WorkersStatus, s conversion.Scope) error { + out.DesiredReplicas = (*int32)(unsafe.Pointer(in.DesiredReplicas)) + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + out.UpToDateReplicas = (*int32)(unsafe.Pointer(in.UpToDateReplicas)) + out.ReadyReplicas = (*int32)(unsafe.Pointer(in.ReadyReplicas)) + out.AvailableReplicas = (*int32)(unsafe.Pointer(in.AvailableReplicas)) + return nil +} + +// Convert_v1beta1_WorkersStatus_To_v1beta2_WorkersStatus is an autogenerated conversion function. +func Convert_v1beta1_WorkersStatus_To_v1beta2_WorkersStatus(in *WorkersStatus, out *v1beta2.WorkersStatus, s conversion.Scope) error { + return autoConvert_v1beta1_WorkersStatus_To_v1beta2_WorkersStatus(in, out, s) +} + +func autoConvert_v1beta2_WorkersStatus_To_v1beta1_WorkersStatus(in *v1beta2.WorkersStatus, out *WorkersStatus, s conversion.Scope) error { + out.DesiredReplicas = (*int32)(unsafe.Pointer(in.DesiredReplicas)) + out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) + out.UpToDateReplicas = (*int32)(unsafe.Pointer(in.UpToDateReplicas)) + out.ReadyReplicas = (*int32)(unsafe.Pointer(in.ReadyReplicas)) + out.AvailableReplicas = (*int32)(unsafe.Pointer(in.AvailableReplicas)) + return nil +} + +// Convert_v1beta2_WorkersStatus_To_v1beta1_WorkersStatus is an autogenerated conversion function. +func Convert_v1beta2_WorkersStatus_To_v1beta1_WorkersStatus(in *v1beta2.WorkersStatus, out *WorkersStatus, s conversion.Scope) error { + return autoConvert_v1beta2_WorkersStatus_To_v1beta1_WorkersStatus(in, out, s) +} + +func autoConvert_v1beta1_WorkersTopology_To_v1beta2_WorkersTopology(in *WorkersTopology, out *v1beta2.WorkersTopology, s conversion.Scope) error { + if in.MachineDeployments != nil { + in, out := &in.MachineDeployments, &out.MachineDeployments + *out = make([]v1beta2.MachineDeploymentTopology, len(*in)) + for i := range *in { + if err := Convert_v1beta1_MachineDeploymentTopology_To_v1beta2_MachineDeploymentTopology(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.MachineDeployments = nil + } + if in.MachinePools != nil { + in, out := &in.MachinePools, &out.MachinePools + *out = make([]v1beta2.MachinePoolTopology, len(*in)) + for i := range *in { + if err := Convert_v1beta1_MachinePoolTopology_To_v1beta2_MachinePoolTopology(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.MachinePools = nil + } + return nil +} + +// Convert_v1beta1_WorkersTopology_To_v1beta2_WorkersTopology is an autogenerated conversion function. +func Convert_v1beta1_WorkersTopology_To_v1beta2_WorkersTopology(in *WorkersTopology, out *v1beta2.WorkersTopology, s conversion.Scope) error { + return autoConvert_v1beta1_WorkersTopology_To_v1beta2_WorkersTopology(in, out, s) +} + +func autoConvert_v1beta2_WorkersTopology_To_v1beta1_WorkersTopology(in *v1beta2.WorkersTopology, out *WorkersTopology, s conversion.Scope) error { + if in.MachineDeployments != nil { + in, out := &in.MachineDeployments, &out.MachineDeployments + *out = make([]MachineDeploymentTopology, len(*in)) + for i := range *in { + if err := Convert_v1beta2_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.MachineDeployments = nil + } + if in.MachinePools != nil { + in, out := &in.MachinePools, &out.MachinePools + *out = make([]MachinePoolTopology, len(*in)) + for i := range *in { + if err := Convert_v1beta2_MachinePoolTopology_To_v1beta1_MachinePoolTopology(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.MachinePools = nil + } + return nil +} + +// Convert_v1beta2_WorkersTopology_To_v1beta1_WorkersTopology is an autogenerated conversion function. +func Convert_v1beta2_WorkersTopology_To_v1beta1_WorkersTopology(in *v1beta2.WorkersTopology, out *WorkersTopology, s conversion.Scope) error { + return autoConvert_v1beta2_WorkersTopology_To_v1beta1_WorkersTopology(in, out, s) +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.deepcopy.go similarity index 94% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/zz_generated.deepcopy.go rename to vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.deepcopy.go index ec25c1dfb0..a1b090669c 100644 --- a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/zz_generated.deepcopy.go +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.deepcopy.go @@ -1992,6 +1992,33 @@ func (in *MachineNamingStrategy) DeepCopy() *MachineNamingStrategy { return out } +// 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 *MachinePoolClass) DeepCopyInto(out *MachinePoolClass) { *out = *in @@ -2076,6 +2103,116 @@ func (in *MachinePoolClassTemplate) DeepCopy() *MachinePoolClassTemplate { return out } +// 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(Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.V1Beta2 != nil { + in, out := &in.V1Beta2, &out.V1Beta2 + *out = new(MachinePoolV1Beta2Status) + (*in).DeepCopyInto(*out) + } +} + +// 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 +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MachinePoolTopology) DeepCopyInto(out *MachinePoolTopology) { *out = *in @@ -2127,6 +2264,43 @@ func (in *MachinePoolTopology) DeepCopy() *MachinePoolTopology { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachinePoolV1Beta2Status) DeepCopyInto(out *MachinePoolV1Beta2Status) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]metav1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ReadyReplicas != nil { + in, out := &in.ReadyReplicas, &out.ReadyReplicas + *out = new(int32) + **out = **in + } + if in.AvailableReplicas != nil { + in, out := &in.AvailableReplicas, &out.AvailableReplicas + *out = new(int32) + **out = **in + } + if in.UpToDateReplicas != nil { + in, out := &in.UpToDateReplicas, &out.UpToDateReplicas + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolV1Beta2Status. +func (in *MachinePoolV1Beta2Status) DeepCopy() *MachinePoolV1Beta2Status { + if in == nil { + return nil + } + out := new(MachinePoolV1Beta2Status) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *MachinePoolVariables) DeepCopyInto(out *MachinePoolVariables) { *out = *in @@ -2417,7 +2591,7 @@ func (in *MachineStatus) DeepCopyInto(out *MachineStatus) { if in.NodeInfo != nil { in, out := &in.NodeInfo, &out.NodeInfo *out = new(v1.NodeSystemInfo) - **out = **in + (*in).DeepCopyInto(*out) } if in.LastUpdated != nil { in, out := &in.LastUpdated, &out.LastUpdated diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/zz_generated.openapi.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.openapi.go similarity index 79% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/zz_generated.openapi.go rename to vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.openapi.go index a3f0529dc3..13a78b2371 100644 --- a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/zz_generated.openapi.go +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.openapi.go @@ -28,104 +28,109 @@ import ( func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { return map[string]common.OpenAPIDefinition{ - "sigs.k8s.io/cluster-api/api/v1beta1.APIEndpoint": schema_sigsk8sio_cluster_api_api_v1beta1_APIEndpoint(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.Bootstrap": schema_sigsk8sio_cluster_api_api_v1beta1_Bootstrap(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.Cluster": schema_sigsk8sio_cluster_api_api_v1beta1_Cluster(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterAvailabilityGate": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterAvailabilityGate(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClass": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClass(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassList": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassList(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassPatch": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassPatch(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassSpec": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassSpec(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassStatus": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassStatus(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassStatusVariable": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassStatusVariable(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassStatusVariableDefinition": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassStatusVariableDefinition(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassV1Beta2Status": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassV1Beta2Status(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassVariable": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassVariable(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassVariableMetadata": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassVariableMetadata(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterControlPlaneStatus": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterControlPlaneStatus(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterList": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterList(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterNetwork": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterNetwork(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterSpec": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterSpec(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterStatus": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterStatus(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterV1Beta2Status": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterV1Beta2Status(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterVariable": schema_sigsk8sio_cluster_api_api_v1beta1_ClusterVariable(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.Condition": schema_sigsk8sio_cluster_api_api_v1beta1_Condition(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ControlPlaneClass": schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneClass(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ControlPlaneClassNamingStrategy": schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneClassNamingStrategy(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ControlPlaneTopology": schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneTopology(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ControlPlaneVariables": schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneVariables(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ExternalPatchDefinition": schema_sigsk8sio_cluster_api_api_v1beta1_ExternalPatchDefinition(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.FailureDomainSpec": schema_sigsk8sio_cluster_api_api_v1beta1_FailureDomainSpec(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.InfrastructureNamingStrategy": schema_sigsk8sio_cluster_api_api_v1beta1_InfrastructureNamingStrategy(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.JSONPatch": schema_sigsk8sio_cluster_api_api_v1beta1_JSONPatch(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.JSONPatchValue": schema_sigsk8sio_cluster_api_api_v1beta1_JSONPatchValue(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.JSONSchemaProps": schema_sigsk8sio_cluster_api_api_v1beta1_JSONSchemaProps(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.LocalObjectTemplate": schema_sigsk8sio_cluster_api_api_v1beta1_LocalObjectTemplate(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.Machine": schema_sigsk8sio_cluster_api_api_v1beta1_Machine(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineAddress": schema_sigsk8sio_cluster_api_api_v1beta1_MachineAddress(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeletionStatus": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeletionStatus(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeployment": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeployment(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentClass": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentClass(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentClassNamingStrategy": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentClassNamingStrategy(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentClassTemplate": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentClassTemplate(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentList": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentList(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentSpec": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentSpec(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentStatus": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentStatus(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentStrategy": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentStrategy(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentTopology": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentTopology(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentV1Beta2Status": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentV1Beta2Status(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentVariables": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentVariables(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDrainRule": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRule(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDrainRuleDrainConfig": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRuleDrainConfig(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDrainRuleList": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRuleList(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDrainRuleMachineSelector": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRuleMachineSelector(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDrainRulePodSelector": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRulePodSelector(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDrainRuleSpec": schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRuleSpec(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheck": schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheck(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckClass": schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckClass(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckList": schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckList(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckSpec": schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckSpec(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckStatus": schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckStatus(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckTopology": schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckTopology(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckV1Beta2Status": schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckV1Beta2Status(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineList": schema_sigsk8sio_cluster_api_api_v1beta1_MachineList(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineNamingStrategy": schema_sigsk8sio_cluster_api_api_v1beta1_MachineNamingStrategy(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachinePoolClass": schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolClass(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachinePoolClassNamingStrategy": schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolClassNamingStrategy(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachinePoolClassTemplate": schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolClassTemplate(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachinePoolTopology": schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolTopology(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachinePoolVariables": schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolVariables(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineReadinessGate": schema_sigsk8sio_cluster_api_api_v1beta1_MachineReadinessGate(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineRollingUpdateDeployment": schema_sigsk8sio_cluster_api_api_v1beta1_MachineRollingUpdateDeployment(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineSet": schema_sigsk8sio_cluster_api_api_v1beta1_MachineSet(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineSetList": schema_sigsk8sio_cluster_api_api_v1beta1_MachineSetList(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineSetSpec": schema_sigsk8sio_cluster_api_api_v1beta1_MachineSetSpec(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineSetStatus": schema_sigsk8sio_cluster_api_api_v1beta1_MachineSetStatus(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineSetV1Beta2Status": schema_sigsk8sio_cluster_api_api_v1beta1_MachineSetV1Beta2Status(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineSpec": schema_sigsk8sio_cluster_api_api_v1beta1_MachineSpec(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineStatus": schema_sigsk8sio_cluster_api_api_v1beta1_MachineStatus(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineTemplateSpec": schema_sigsk8sio_cluster_api_api_v1beta1_MachineTemplateSpec(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.MachineV1Beta2Status": schema_sigsk8sio_cluster_api_api_v1beta1_MachineV1Beta2Status(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.NetworkRanges": schema_sigsk8sio_cluster_api_api_v1beta1_NetworkRanges(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ObjectMeta": schema_sigsk8sio_cluster_api_api_v1beta1_ObjectMeta(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.PatchDefinition": schema_sigsk8sio_cluster_api_api_v1beta1_PatchDefinition(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.PatchSelector": schema_sigsk8sio_cluster_api_api_v1beta1_PatchSelector(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.PatchSelectorMatch": schema_sigsk8sio_cluster_api_api_v1beta1_PatchSelectorMatch(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.PatchSelectorMatchMachineDeploymentClass": schema_sigsk8sio_cluster_api_api_v1beta1_PatchSelectorMatchMachineDeploymentClass(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.PatchSelectorMatchMachinePoolClass": schema_sigsk8sio_cluster_api_api_v1beta1_PatchSelectorMatchMachinePoolClass(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.RemediationStrategy": schema_sigsk8sio_cluster_api_api_v1beta1_RemediationStrategy(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.Topology": schema_sigsk8sio_cluster_api_api_v1beta1_Topology(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.UnhealthyCondition": schema_sigsk8sio_cluster_api_api_v1beta1_UnhealthyCondition(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.ValidationRule": schema_sigsk8sio_cluster_api_api_v1beta1_ValidationRule(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.VariableSchema": schema_sigsk8sio_cluster_api_api_v1beta1_VariableSchema(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.VariableSchemaMetadata": schema_sigsk8sio_cluster_api_api_v1beta1_VariableSchemaMetadata(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.WorkersClass": schema_sigsk8sio_cluster_api_api_v1beta1_WorkersClass(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.WorkersStatus": schema_sigsk8sio_cluster_api_api_v1beta1_WorkersStatus(ref), - "sigs.k8s.io/cluster-api/api/v1beta1.WorkersTopology": schema_sigsk8sio_cluster_api_api_v1beta1_WorkersTopology(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.APIEndpoint": schema_cluster_api_api_core_v1beta1_APIEndpoint(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.Bootstrap": schema_cluster_api_api_core_v1beta1_Bootstrap(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.Cluster": schema_cluster_api_api_core_v1beta1_Cluster(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterAvailabilityGate": schema_cluster_api_api_core_v1beta1_ClusterAvailabilityGate(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClass": schema_cluster_api_api_core_v1beta1_ClusterClass(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassList": schema_cluster_api_api_core_v1beta1_ClusterClassList(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassPatch": schema_cluster_api_api_core_v1beta1_ClusterClassPatch(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassSpec": schema_cluster_api_api_core_v1beta1_ClusterClassSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassStatus": schema_cluster_api_api_core_v1beta1_ClusterClassStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassStatusVariable": schema_cluster_api_api_core_v1beta1_ClusterClassStatusVariable(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassStatusVariableDefinition": schema_cluster_api_api_core_v1beta1_ClusterClassStatusVariableDefinition(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassV1Beta2Status": schema_cluster_api_api_core_v1beta1_ClusterClassV1Beta2Status(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassVariable": schema_cluster_api_api_core_v1beta1_ClusterClassVariable(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassVariableMetadata": schema_cluster_api_api_core_v1beta1_ClusterClassVariableMetadata(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterControlPlaneStatus": schema_cluster_api_api_core_v1beta1_ClusterControlPlaneStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterList": schema_cluster_api_api_core_v1beta1_ClusterList(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterNetwork": schema_cluster_api_api_core_v1beta1_ClusterNetwork(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterSpec": schema_cluster_api_api_core_v1beta1_ClusterSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterStatus": schema_cluster_api_api_core_v1beta1_ClusterStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterV1Beta2Status": schema_cluster_api_api_core_v1beta1_ClusterV1Beta2Status(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterVariable": schema_cluster_api_api_core_v1beta1_ClusterVariable(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.Condition": schema_cluster_api_api_core_v1beta1_Condition(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ControlPlaneClass": schema_cluster_api_api_core_v1beta1_ControlPlaneClass(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ControlPlaneClassNamingStrategy": schema_cluster_api_api_core_v1beta1_ControlPlaneClassNamingStrategy(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ControlPlaneTopology": schema_cluster_api_api_core_v1beta1_ControlPlaneTopology(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ControlPlaneVariables": schema_cluster_api_api_core_v1beta1_ControlPlaneVariables(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ExternalPatchDefinition": schema_cluster_api_api_core_v1beta1_ExternalPatchDefinition(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.FailureDomainSpec": schema_cluster_api_api_core_v1beta1_FailureDomainSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.InfrastructureNamingStrategy": schema_cluster_api_api_core_v1beta1_InfrastructureNamingStrategy(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.JSONPatch": schema_cluster_api_api_core_v1beta1_JSONPatch(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.JSONPatchValue": schema_cluster_api_api_core_v1beta1_JSONPatchValue(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.JSONSchemaProps": schema_cluster_api_api_core_v1beta1_JSONSchemaProps(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.LocalObjectTemplate": schema_cluster_api_api_core_v1beta1_LocalObjectTemplate(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.Machine": schema_cluster_api_api_core_v1beta1_Machine(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineAddress": schema_cluster_api_api_core_v1beta1_MachineAddress(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeletionStatus": schema_cluster_api_api_core_v1beta1_MachineDeletionStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeployment": schema_cluster_api_api_core_v1beta1_MachineDeployment(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentClass": schema_cluster_api_api_core_v1beta1_MachineDeploymentClass(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentClassNamingStrategy": schema_cluster_api_api_core_v1beta1_MachineDeploymentClassNamingStrategy(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentClassTemplate": schema_cluster_api_api_core_v1beta1_MachineDeploymentClassTemplate(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentList": schema_cluster_api_api_core_v1beta1_MachineDeploymentList(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentSpec": schema_cluster_api_api_core_v1beta1_MachineDeploymentSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentStatus": schema_cluster_api_api_core_v1beta1_MachineDeploymentStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentStrategy": schema_cluster_api_api_core_v1beta1_MachineDeploymentStrategy(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentTopology": schema_cluster_api_api_core_v1beta1_MachineDeploymentTopology(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentV1Beta2Status": schema_cluster_api_api_core_v1beta1_MachineDeploymentV1Beta2Status(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentVariables": schema_cluster_api_api_core_v1beta1_MachineDeploymentVariables(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRule": schema_cluster_api_api_core_v1beta1_MachineDrainRule(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRuleDrainConfig": schema_cluster_api_api_core_v1beta1_MachineDrainRuleDrainConfig(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRuleList": schema_cluster_api_api_core_v1beta1_MachineDrainRuleList(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRuleMachineSelector": schema_cluster_api_api_core_v1beta1_MachineDrainRuleMachineSelector(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRulePodSelector": schema_cluster_api_api_core_v1beta1_MachineDrainRulePodSelector(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRuleSpec": schema_cluster_api_api_core_v1beta1_MachineDrainRuleSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheck": schema_cluster_api_api_core_v1beta1_MachineHealthCheck(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckClass": schema_cluster_api_api_core_v1beta1_MachineHealthCheckClass(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckList": schema_cluster_api_api_core_v1beta1_MachineHealthCheckList(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckSpec": schema_cluster_api_api_core_v1beta1_MachineHealthCheckSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckStatus": schema_cluster_api_api_core_v1beta1_MachineHealthCheckStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckTopology": schema_cluster_api_api_core_v1beta1_MachineHealthCheckTopology(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckV1Beta2Status": schema_cluster_api_api_core_v1beta1_MachineHealthCheckV1Beta2Status(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineList": schema_cluster_api_api_core_v1beta1_MachineList(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineNamingStrategy": schema_cluster_api_api_core_v1beta1_MachineNamingStrategy(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePool": schema_cluster_api_api_core_v1beta1_MachinePool(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolClass": schema_cluster_api_api_core_v1beta1_MachinePoolClass(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolClassNamingStrategy": schema_cluster_api_api_core_v1beta1_MachinePoolClassNamingStrategy(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolClassTemplate": schema_cluster_api_api_core_v1beta1_MachinePoolClassTemplate(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolList": schema_cluster_api_api_core_v1beta1_MachinePoolList(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolSpec": schema_cluster_api_api_core_v1beta1_MachinePoolSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolStatus": schema_cluster_api_api_core_v1beta1_MachinePoolStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolTopology": schema_cluster_api_api_core_v1beta1_MachinePoolTopology(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolV1Beta2Status": schema_cluster_api_api_core_v1beta1_MachinePoolV1Beta2Status(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolVariables": schema_cluster_api_api_core_v1beta1_MachinePoolVariables(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineReadinessGate": schema_cluster_api_api_core_v1beta1_MachineReadinessGate(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineRollingUpdateDeployment": schema_cluster_api_api_core_v1beta1_MachineRollingUpdateDeployment(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSet": schema_cluster_api_api_core_v1beta1_MachineSet(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSetList": schema_cluster_api_api_core_v1beta1_MachineSetList(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSetSpec": schema_cluster_api_api_core_v1beta1_MachineSetSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSetStatus": schema_cluster_api_api_core_v1beta1_MachineSetStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSetV1Beta2Status": schema_cluster_api_api_core_v1beta1_MachineSetV1Beta2Status(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSpec": schema_cluster_api_api_core_v1beta1_MachineSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineStatus": schema_cluster_api_api_core_v1beta1_MachineStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineTemplateSpec": schema_cluster_api_api_core_v1beta1_MachineTemplateSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineV1Beta2Status": schema_cluster_api_api_core_v1beta1_MachineV1Beta2Status(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.NetworkRanges": schema_cluster_api_api_core_v1beta1_NetworkRanges(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta": schema_cluster_api_api_core_v1beta1_ObjectMeta(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.PatchDefinition": schema_cluster_api_api_core_v1beta1_PatchDefinition(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.PatchSelector": schema_cluster_api_api_core_v1beta1_PatchSelector(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.PatchSelectorMatch": schema_cluster_api_api_core_v1beta1_PatchSelectorMatch(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.PatchSelectorMatchMachineDeploymentClass": schema_cluster_api_api_core_v1beta1_PatchSelectorMatchMachineDeploymentClass(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.PatchSelectorMatchMachinePoolClass": schema_cluster_api_api_core_v1beta1_PatchSelectorMatchMachinePoolClass(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.RemediationStrategy": schema_cluster_api_api_core_v1beta1_RemediationStrategy(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.Topology": schema_cluster_api_api_core_v1beta1_Topology(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.UnhealthyCondition": schema_cluster_api_api_core_v1beta1_UnhealthyCondition(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.ValidationRule": schema_cluster_api_api_core_v1beta1_ValidationRule(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.VariableSchema": schema_cluster_api_api_core_v1beta1_VariableSchema(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.VariableSchemaMetadata": schema_cluster_api_api_core_v1beta1_VariableSchemaMetadata(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.WorkersClass": schema_cluster_api_api_core_v1beta1_WorkersClass(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.WorkersStatus": schema_cluster_api_api_core_v1beta1_WorkersStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta1.WorkersTopology": schema_cluster_api_api_core_v1beta1_WorkersTopology(ref), } } -func schema_sigsk8sio_cluster_api_api_v1beta1_APIEndpoint(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_APIEndpoint(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -155,7 +160,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_APIEndpoint(ref common.ReferenceCa } } -func schema_sigsk8sio_cluster_api_api_v1beta1_Bootstrap(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_Bootstrap(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -183,7 +188,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_Bootstrap(ref common.ReferenceCall } } -func schema_sigsk8sio_cluster_api_api_v1beta1_Cluster(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_Cluster(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -215,25 +220,25 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_Cluster(ref common.ReferenceCallba SchemaProps: spec.SchemaProps{ Description: "spec is the desired state of Cluster.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterSpec"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ Description: "status is the observed state of Cluster.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterStatus"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterStatus"), }, }, }, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/v1beta1.ClusterSpec", "sigs.k8s.io/cluster-api/api/v1beta1.ClusterStatus"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterSpec", "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterStatus"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterAvailabilityGate(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterAvailabilityGate(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -262,7 +267,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterAvailabilityGate(ref common } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClass(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterClass(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -294,25 +299,25 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClass(ref common.ReferenceC SchemaProps: spec.SchemaProps{ Description: "spec is the desired state of ClusterClass.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassSpec"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ Description: "status is the observed state of ClusterClass.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassStatus"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassStatus"), }, }, }, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassSpec", "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassStatus"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassSpec", "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassStatus"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterClassList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -348,7 +353,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassList(ref common.Refere Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterClass"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClass"), }, }, }, @@ -359,11 +364,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassList(ref common.Refere }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClass"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClass"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassPatch(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterClassPatch(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -400,7 +405,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassPatch(ref common.Refer Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.PatchDefinition"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.PatchDefinition"), }, }, }, @@ -409,7 +414,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassPatch(ref common.Refer "external": { SchemaProps: spec.SchemaProps{ Description: "external defines an external patch. Note: Exactly one of Definitions or External must be set.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ExternalPatchDefinition"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ExternalPatchDefinition"), }, }, }, @@ -417,11 +422,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassPatch(ref common.Refer }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.ExternalPatchDefinition", "sigs.k8s.io/cluster-api/api/v1beta1.PatchDefinition"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.ExternalPatchDefinition", "sigs.k8s.io/cluster-api/api/core/v1beta1.PatchDefinition"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterClassSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -444,7 +449,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassSpec(ref common.Refere Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterAvailabilityGate"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterAvailabilityGate"), }, }, }, @@ -454,27 +459,27 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassSpec(ref common.Refere SchemaProps: spec.SchemaProps{ 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.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.LocalObjectTemplate"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.LocalObjectTemplate"), }, }, "infrastructureNamingStrategy": { SchemaProps: spec.SchemaProps{ Description: "infrastructureNamingStrategy allows changing the naming pattern used when creating the infrastructure object.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.InfrastructureNamingStrategy"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.InfrastructureNamingStrategy"), }, }, "controlPlane": { SchemaProps: spec.SchemaProps{ Description: "controlPlane is a reference to a local struct that holds the details for provisioning the Control Plane for the Cluster.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ControlPlaneClass"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ControlPlaneClass"), }, }, "workers": { SchemaProps: spec.SchemaProps{ 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.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.WorkersClass"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.WorkersClass"), }, }, "variables": { @@ -485,7 +490,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassSpec(ref common.Refere Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassVariable"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassVariable"), }, }, }, @@ -499,7 +504,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassSpec(ref common.Refere Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassPatch"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassPatch"), }, }, }, @@ -509,11 +514,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassSpec(ref common.Refere }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterAvailabilityGate", "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassPatch", "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassVariable", "sigs.k8s.io/cluster-api/api/v1beta1.ControlPlaneClass", "sigs.k8s.io/cluster-api/api/v1beta1.InfrastructureNamingStrategy", "sigs.k8s.io/cluster-api/api/v1beta1.LocalObjectTemplate", "sigs.k8s.io/cluster-api/api/v1beta1.WorkersClass"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterAvailabilityGate", "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassPatch", "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassVariable", "sigs.k8s.io/cluster-api/api/core/v1beta1.ControlPlaneClass", "sigs.k8s.io/cluster-api/api/core/v1beta1.InfrastructureNamingStrategy", "sigs.k8s.io/cluster-api/api/core/v1beta1.LocalObjectTemplate", "sigs.k8s.io/cluster-api/api/core/v1beta1.WorkersClass"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterClassStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -528,7 +533,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassStatus(ref common.Refe Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassStatusVariable"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassStatusVariable"), }, }, }, @@ -542,7 +547,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassStatus(ref common.Refe Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.Condition"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.Condition"), }, }, }, @@ -558,18 +563,18 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassStatus(ref common.Refe "v1beta2": { SchemaProps: spec.SchemaProps{ Description: "v1beta2 groups all the fields that will be added or modified in ClusterClass's status with the V1Beta2 version.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassV1Beta2Status"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassV1Beta2Status"), }, }, }, }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassStatusVariable", "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassV1Beta2Status", "sigs.k8s.io/cluster-api/api/v1beta1.Condition"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassStatusVariable", "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassV1Beta2Status", "sigs.k8s.io/cluster-api/api/core/v1beta1.Condition"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassStatusVariable(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterClassStatusVariable(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -600,7 +605,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassStatusVariable(ref com Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassStatusVariableDefinition"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassStatusVariableDefinition"), }, }, }, @@ -611,11 +616,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassStatusVariable(ref com }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassStatusVariableDefinition"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassStatusVariableDefinition"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassStatusVariableDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterClassStatusVariableDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -642,14 +647,14 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassStatusVariableDefiniti SchemaProps: spec.SchemaProps{ Description: "metadata is the metadata of a variable. It can be used to add additional data for higher level tools to a ClusterClassVariable.\n\nDeprecated: This field is deprecated and is going to be removed in the next apiVersion.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassVariableMetadata"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassVariableMetadata"), }, }, "schema": { SchemaProps: spec.SchemaProps{ Description: "schema defines the schema of the variable.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.VariableSchema"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.VariableSchema"), }, }, }, @@ -657,11 +662,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassStatusVariableDefiniti }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassVariableMetadata", "sigs.k8s.io/cluster-api/api/v1beta1.VariableSchema"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassVariableMetadata", "sigs.k8s.io/cluster-api/api/core/v1beta1.VariableSchema"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterClassV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -698,7 +703,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassV1Beta2Status(ref comm } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassVariable(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterClassVariable(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -725,14 +730,14 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassVariable(ref common.Re SchemaProps: spec.SchemaProps{ Description: "metadata is the metadata of a variable. It can be used to add additional data for higher level tools to a ClusterClassVariable.\n\nDeprecated: This field is deprecated and is going to be removed in the next apiVersion. Please use XMetadata in JSONSchemaProps instead.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassVariableMetadata"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassVariableMetadata"), }, }, "schema": { SchemaProps: spec.SchemaProps{ Description: "schema defines the schema of the variable.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.VariableSchema"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.VariableSchema"), }, }, }, @@ -740,11 +745,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassVariable(ref common.Re }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterClassVariableMetadata", "sigs.k8s.io/cluster-api/api/v1beta1.VariableSchema"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassVariableMetadata", "sigs.k8s.io/cluster-api/api/core/v1beta1.VariableSchema"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassVariableMetadata(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterClassVariableMetadata(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -789,7 +794,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterClassVariableMetadata(ref c } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterControlPlaneStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterControlPlaneStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -837,7 +842,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterControlPlaneStatus(ref comm } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -873,7 +878,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterList(ref common.ReferenceCa Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.Cluster"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.Cluster"), }, }, }, @@ -884,11 +889,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterList(ref common.ReferenceCa }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/v1beta1.Cluster"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.Cluster"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterNetwork(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterNetwork(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -905,13 +910,13 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterNetwork(ref common.Referenc "services": { SchemaProps: spec.SchemaProps{ Description: "services is the network ranges from which service VIPs are allocated.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.NetworkRanges"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.NetworkRanges"), }, }, "pods": { SchemaProps: spec.SchemaProps{ Description: "pods is the network ranges from which Pod networks are allocated.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.NetworkRanges"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.NetworkRanges"), }, }, "serviceDomain": { @@ -925,11 +930,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterNetwork(ref common.Referenc }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.NetworkRanges"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.NetworkRanges"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -946,14 +951,14 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterSpec(ref common.ReferenceCa "clusterNetwork": { SchemaProps: spec.SchemaProps{ Description: "clusterNetwork represents the cluster network configuration.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterNetwork"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterNetwork"), }, }, "controlPlaneEndpoint": { SchemaProps: spec.SchemaProps{ Description: "controlPlaneEndpoint represents the endpoint used to communicate with the control plane.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.APIEndpoint"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.APIEndpoint"), }, }, "controlPlaneRef": { @@ -971,7 +976,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterSpec(ref common.ReferenceCa "topology": { SchemaProps: spec.SchemaProps{ Description: "topology 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.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.Topology"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.Topology"), }, }, "availabilityGates": { @@ -990,7 +995,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterSpec(ref common.ReferenceCa Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterAvailabilityGate"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterAvailabilityGate"), }, }, }, @@ -1000,11 +1005,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterSpec(ref common.ReferenceCa }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference", "sigs.k8s.io/cluster-api/api/v1beta1.APIEndpoint", "sigs.k8s.io/cluster-api/api/v1beta1.ClusterAvailabilityGate", "sigs.k8s.io/cluster-api/api/v1beta1.ClusterNetwork", "sigs.k8s.io/cluster-api/api/v1beta1.Topology"}, + "k8s.io/api/core/v1.ObjectReference", "sigs.k8s.io/cluster-api/api/core/v1beta1.APIEndpoint", "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterAvailabilityGate", "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterNetwork", "sigs.k8s.io/cluster-api/api/core/v1beta1.Topology"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -1020,7 +1025,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterStatus(ref common.Reference Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.FailureDomainSpec"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.FailureDomainSpec"), }, }, }, @@ -1028,14 +1033,14 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterStatus(ref common.Reference }, "failureReason": { SchemaProps: spec.SchemaProps{ - Description: "failureReason indicates that there is a fatal problem reconciling the state, and will be set to a token value suitable for programmatic interpretation.\n\nDeprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Description: "failureReason indicates that there is a fatal problem reconciling the state, and will be set to a token value suitable for programmatic interpretation.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", Type: []string{"string"}, Format: "", }, }, "failureMessage": { SchemaProps: spec.SchemaProps{ - Description: "failureMessage indicates that there is a fatal problem reconciling the state, and will be set to a descriptive error message.\n\nDeprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Description: "failureMessage indicates that there is a fatal problem reconciling the state, and will be set to a descriptive error message.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", Type: []string{"string"}, Format: "", }, @@ -1071,7 +1076,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterStatus(ref common.Reference Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.Condition"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.Condition"), }, }, }, @@ -1087,18 +1092,18 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterStatus(ref common.Reference "v1beta2": { SchemaProps: spec.SchemaProps{ Description: "v1beta2 groups all the fields that will be added or modified in Cluster's status with the V1Beta2 version.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterV1Beta2Status"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterV1Beta2Status"), }, }, }, }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterV1Beta2Status", "sigs.k8s.io/cluster-api/api/v1beta1.Condition", "sigs.k8s.io/cluster-api/api/v1beta1.FailureDomainSpec"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterV1Beta2Status", "sigs.k8s.io/cluster-api/api/core/v1beta1.Condition", "sigs.k8s.io/cluster-api/api/core/v1beta1.FailureDomainSpec"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -1130,24 +1135,24 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterV1Beta2Status(ref common.Re "controlPlane": { SchemaProps: spec.SchemaProps{ Description: "controlPlane groups all the observations about Cluster's ControlPlane current state.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterControlPlaneStatus"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterControlPlaneStatus"), }, }, "workers": { SchemaProps: spec.SchemaProps{ Description: "workers groups all the observations about Cluster's Workers current state.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.WorkersStatus"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.WorkersStatus"), }, }, }, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "sigs.k8s.io/cluster-api/api/v1beta1.ClusterControlPlaneStatus", "sigs.k8s.io/cluster-api/api/v1beta1.WorkersStatus"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterControlPlaneStatus", "sigs.k8s.io/cluster-api/api/core/v1beta1.WorkersStatus"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterVariable(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ClusterVariable(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -1184,7 +1189,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ClusterVariable(ref common.Referen } } -func schema_sigsk8sio_cluster_api_api_v1beta1_Condition(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_Condition(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -1243,7 +1248,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_Condition(ref common.ReferenceCall } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneClass(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ControlPlaneClass(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -1254,7 +1259,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneClass(ref common.Refer SchemaProps: spec.SchemaProps{ Description: "metadata is the metadata applied to the ControlPlane and the Machines of the ControlPlane if the ControlPlaneTemplate referenced is machine based. If not, it is applied only to the ControlPlane. At runtime this metadata is merged with the corresponding metadata from the topology.\n\nThis field is supported if and only if the control plane provider template referenced is Machine based.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ObjectMeta"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta"), }, }, "ref": { @@ -1266,19 +1271,19 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneClass(ref common.Refer "machineInfrastructure": { SchemaProps: spec.SchemaProps{ Description: "machineInfrastructure defines the metadata and infrastructure information for control plane machines.\n\nThis field is supported if and only if the control plane provider template referenced above is Machine based and supports setting replicas.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.LocalObjectTemplate"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.LocalObjectTemplate"), }, }, "machineHealthCheck": { SchemaProps: spec.SchemaProps{ Description: "machineHealthCheck defines a MachineHealthCheck for this ControlPlaneClass. This field is supported if and only if the ControlPlane provider template referenced above is Machine based and supports setting replicas.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckClass"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckClass"), }, }, "namingStrategy": { SchemaProps: spec.SchemaProps{ Description: "namingStrategy allows changing the naming pattern used when creating the control plane provider object.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ControlPlaneClassNamingStrategy"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ControlPlaneClassNamingStrategy"), }, }, "nodeDrainTimeout": { @@ -1315,7 +1320,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneClass(ref common.Refer Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineReadinessGate"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineReadinessGate"), }, }, }, @@ -1326,11 +1331,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneClass(ref common.Refer }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "sigs.k8s.io/cluster-api/api/v1beta1.ControlPlaneClassNamingStrategy", "sigs.k8s.io/cluster-api/api/v1beta1.LocalObjectTemplate", "sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckClass", "sigs.k8s.io/cluster-api/api/v1beta1.MachineReadinessGate", "sigs.k8s.io/cluster-api/api/v1beta1.ObjectMeta"}, + "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "sigs.k8s.io/cluster-api/api/core/v1beta1.ControlPlaneClassNamingStrategy", "sigs.k8s.io/cluster-api/api/core/v1beta1.LocalObjectTemplate", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckClass", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineReadinessGate", "sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneClassNamingStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ControlPlaneClassNamingStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -1350,7 +1355,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneClassNamingStrategy(re } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneTopology(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ControlPlaneTopology(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -1361,7 +1366,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneTopology(ref common.Re SchemaProps: spec.SchemaProps{ Description: "metadata is the metadata applied to the ControlPlane and the Machines of the ControlPlane if the ControlPlaneTemplate referenced by the ClusterClass is machine based. If not, it is applied only to the ControlPlane. At runtime this metadata is merged with the corresponding metadata from the ClusterClass.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ObjectMeta"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta"), }, }, "replicas": { @@ -1374,7 +1379,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneTopology(ref common.Re "machineHealthCheck": { SchemaProps: spec.SchemaProps{ Description: "machineHealthCheck allows to enable, disable and override the MachineHealthCheck configuration in the ClusterClass for this control plane.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckTopology"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckTopology"), }, }, "nodeDrainTimeout": { @@ -1411,7 +1416,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneTopology(ref common.Re Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineReadinessGate"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineReadinessGate"), }, }, }, @@ -1420,18 +1425,18 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneTopology(ref common.Re "variables": { SchemaProps: spec.SchemaProps{ Description: "variables can be used to customize the ControlPlane through patches.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ControlPlaneVariables"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ControlPlaneVariables"), }, }, }, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "sigs.k8s.io/cluster-api/api/v1beta1.ControlPlaneVariables", "sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckTopology", "sigs.k8s.io/cluster-api/api/v1beta1.MachineReadinessGate", "sigs.k8s.io/cluster-api/api/v1beta1.ObjectMeta"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "sigs.k8s.io/cluster-api/api/core/v1beta1.ControlPlaneVariables", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckTopology", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineReadinessGate", "sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneVariables(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ControlPlaneVariables(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -1454,7 +1459,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneVariables(ref common.R Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterVariable"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterVariable"), }, }, }, @@ -1464,11 +1469,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ControlPlaneVariables(ref common.R }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterVariable"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterVariable"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ExternalPatchDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ExternalPatchDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -1518,7 +1523,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ExternalPatchDefinition(ref common } } -func schema_sigsk8sio_cluster_api_api_v1beta1_FailureDomainSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_FailureDomainSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -1554,7 +1559,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_FailureDomainSpec(ref common.Refer } } -func schema_sigsk8sio_cluster_api_api_v1beta1_InfrastructureNamingStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_InfrastructureNamingStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -1574,7 +1579,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_InfrastructureNamingStrategy(ref c } } -func schema_sigsk8sio_cluster_api_api_v1beta1_JSONPatch(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_JSONPatch(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -1606,7 +1611,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_JSONPatch(ref common.ReferenceCall "valueFrom": { SchemaProps: spec.SchemaProps{ Description: "valueFrom defines the value of the patch. Note: Either Value or ValueFrom is required for add and replace operations. Only one of them is allowed to be set at the same time.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.JSONPatchValue"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.JSONPatchValue"), }, }, }, @@ -1614,11 +1619,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_JSONPatch(ref common.ReferenceCall }, }, Dependencies: []string{ - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON", "sigs.k8s.io/cluster-api/api/v1beta1.JSONPatchValue"}, + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON", "sigs.k8s.io/cluster-api/api/core/v1beta1.JSONPatchValue"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_JSONPatchValue(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_JSONPatchValue(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -1645,7 +1650,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_JSONPatchValue(ref common.Referenc } } -func schema_sigsk8sio_cluster_api_api_v1beta1_JSONSchemaProps(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_JSONSchemaProps(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -1681,7 +1686,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_JSONSchemaProps(ref common.Referen Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.JSONSchemaProps"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.JSONSchemaProps"), }, }, }, @@ -1690,7 +1695,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_JSONSchemaProps(ref common.Referen "additionalProperties": { SchemaProps: spec.SchemaProps{ Description: "additionalProperties specifies the schema of values in a map (keys are always strings). NOTE: Can only be set if type is object. NOTE: AdditionalProperties is mutually exclusive with Properties. NOTE: This field uses PreserveUnknownFields and Schemaless, because recursive validation is not possible.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.JSONSchemaProps"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.JSONSchemaProps"), }, }, "maxProperties": { @@ -1725,7 +1730,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_JSONSchemaProps(ref common.Referen "items": { SchemaProps: spec.SchemaProps{ Description: "items specifies fields of an array. NOTE: Can only be set if type is array. NOTE: This field uses PreserveUnknownFields and Schemaless, because recursive validation is not possible.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.JSONSchemaProps"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.JSONSchemaProps"), }, }, "maxItems": { @@ -1847,7 +1852,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_JSONSchemaProps(ref common.Referen Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ValidationRule"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ValidationRule"), }, }, }, @@ -1856,7 +1861,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_JSONSchemaProps(ref common.Referen "x-metadata": { SchemaProps: spec.SchemaProps{ Description: "x-metadata is the metadata of a variable or a nested field within a variable. It can be used to add additional data for higher level tools.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.VariableSchemaMetadata"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.VariableSchemaMetadata"), }, }, "x-kubernetes-int-or-string": { @@ -1874,7 +1879,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_JSONSchemaProps(ref common.Referen Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.JSONSchemaProps"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.JSONSchemaProps"), }, }, }, @@ -1888,7 +1893,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_JSONSchemaProps(ref common.Referen Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.JSONSchemaProps"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.JSONSchemaProps"), }, }, }, @@ -1902,7 +1907,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_JSONSchemaProps(ref common.Referen Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.JSONSchemaProps"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.JSONSchemaProps"), }, }, }, @@ -1911,18 +1916,18 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_JSONSchemaProps(ref common.Referen "not": { SchemaProps: spec.SchemaProps{ Description: "not specifies that the variable must not validate against the subschema. NOTE: This field uses PreserveUnknownFields and Schemaless, because recursive validation is not possible.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.JSONSchemaProps"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.JSONSchemaProps"), }, }, }, }, }, Dependencies: []string{ - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON", "sigs.k8s.io/cluster-api/api/v1beta1.JSONSchemaProps", "sigs.k8s.io/cluster-api/api/v1beta1.ValidationRule", "sigs.k8s.io/cluster-api/api/v1beta1.VariableSchemaMetadata"}, + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON", "sigs.k8s.io/cluster-api/api/core/v1beta1.JSONSchemaProps", "sigs.k8s.io/cluster-api/api/core/v1beta1.ValidationRule", "sigs.k8s.io/cluster-api/api/core/v1beta1.VariableSchemaMetadata"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_LocalObjectTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_LocalObjectTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -1944,7 +1949,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_LocalObjectTemplate(ref common.Ref } } -func schema_sigsk8sio_cluster_api_api_v1beta1_Machine(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_Machine(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -1976,25 +1981,25 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_Machine(ref common.ReferenceCallba SchemaProps: spec.SchemaProps{ Description: "spec is the desired state of Machine.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineSpec"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ Description: "status is the observed state of Machine.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineStatus"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineStatus"), }, }, }, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/v1beta1.MachineSpec", "sigs.k8s.io/cluster-api/api/v1beta1.MachineStatus"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSpec", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineStatus"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineAddress(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineAddress(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2024,7 +2029,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineAddress(ref common.Referenc } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeletionStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDeletionStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2051,7 +2056,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeletionStatus(ref common.R } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeployment(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDeployment(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2083,25 +2088,25 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeployment(ref common.Refer SchemaProps: spec.SchemaProps{ Description: "spec is the desired state of MachineDeployment.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentSpec"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ Description: "status is the observed state of MachineDeployment.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentStatus"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentStatus"), }, }, }, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentSpec", "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentStatus"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentSpec", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentStatus"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentClass(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDeploymentClass(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2120,13 +2125,13 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentClass(ref common. SchemaProps: spec.SchemaProps{ Description: "template is a local struct containing a collection of templates for creation of MachineDeployment objects representing a set of worker nodes.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentClassTemplate"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentClassTemplate"), }, }, "machineHealthCheck": { SchemaProps: spec.SchemaProps{ Description: "machineHealthCheck defines a MachineHealthCheck for this MachineDeploymentClass.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckClass"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckClass"), }, }, "failureDomain": { @@ -2139,7 +2144,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentClass(ref common. "namingStrategy": { SchemaProps: spec.SchemaProps{ Description: "namingStrategy allows changing the naming pattern used when creating the MachineDeployment.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentClassNamingStrategy"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentClassNamingStrategy"), }, }, "nodeDrainTimeout": { @@ -2183,7 +2188,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentClass(ref common. Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineReadinessGate"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineReadinessGate"), }, }, }, @@ -2192,7 +2197,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentClass(ref common. "strategy": { SchemaProps: spec.SchemaProps{ Description: "strategy is the deployment strategy to use to replace existing machines with new ones. NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentStrategy"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentStrategy"), }, }, }, @@ -2200,11 +2205,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentClass(ref common. }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentClassNamingStrategy", "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentClassTemplate", "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentStrategy", "sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckClass", "sigs.k8s.io/cluster-api/api/v1beta1.MachineReadinessGate"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentClassNamingStrategy", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentClassTemplate", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentStrategy", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckClass", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineReadinessGate"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentClassNamingStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDeploymentClassNamingStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2224,7 +2229,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentClassNamingStrate } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentClassTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDeploymentClassTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2235,21 +2240,21 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentClassTemplate(ref SchemaProps: spec.SchemaProps{ Description: "metadata is the metadata applied to the MachineDeployment and the machines of the MachineDeployment. At runtime this metadata is merged with the corresponding metadata from the topology.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ObjectMeta"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta"), }, }, "bootstrap": { SchemaProps: spec.SchemaProps{ Description: "bootstrap contains the bootstrap template reference to be used for the creation of worker Machines.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.LocalObjectTemplate"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.LocalObjectTemplate"), }, }, "infrastructure": { SchemaProps: spec.SchemaProps{ Description: "infrastructure contains the infrastructure template reference to be used for the creation of worker Machines.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.LocalObjectTemplate"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.LocalObjectTemplate"), }, }, }, @@ -2257,11 +2262,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentClassTemplate(ref }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.LocalObjectTemplate", "sigs.k8s.io/cluster-api/api/v1beta1.ObjectMeta"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.LocalObjectTemplate", "sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDeploymentList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2297,7 +2302,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentList(ref common.R Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDeployment"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeployment"), }, }, }, @@ -2308,11 +2313,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentList(ref common.R }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeployment"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeployment"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDeploymentSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2351,19 +2356,19 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentSpec(ref common.R SchemaProps: spec.SchemaProps{ Description: "template describes the machines that will be created.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineTemplateSpec"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineTemplateSpec"), }, }, "strategy": { SchemaProps: spec.SchemaProps{ Description: "strategy is the deployment strategy to use to replace existing machines with new ones.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentStrategy"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentStrategy"), }, }, "machineNamingStrategy": { SchemaProps: spec.SchemaProps{ Description: "machineNamingStrategy allows changing the naming pattern used when creating Machines. Note: InfraMachines & BootstrapConfigs will use the same name as the corresponding Machines.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineNamingStrategy"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineNamingStrategy"), }, }, "minReadySeconds": { @@ -2399,11 +2404,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentSpec(ref common.R }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", "k8s.io/apimachinery/pkg/apis/meta/v1.Time", "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentStrategy", "sigs.k8s.io/cluster-api/api/v1beta1.MachineNamingStrategy", "sigs.k8s.io/cluster-api/api/v1beta1.MachineTemplateSpec"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", "k8s.io/apimachinery/pkg/apis/meta/v1.Time", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentStrategy", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineNamingStrategy", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineTemplateSpec"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDeploymentStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2458,7 +2463,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentStatus(ref common }, "unavailableReplicas": { SchemaProps: spec.SchemaProps{ - Description: "unavailableReplicas is the 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.\n\nDeprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Description: "unavailableReplicas is the 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.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", Default: 0, Type: []string{"integer"}, Format: "int32", @@ -2479,7 +2484,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentStatus(ref common Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.Condition"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.Condition"), }, }, }, @@ -2488,18 +2493,18 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentStatus(ref common "v1beta2": { SchemaProps: spec.SchemaProps{ Description: "v1beta2 groups all the fields that will be added or modified in MachineDeployment's status with the V1Beta2 version.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentV1Beta2Status"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentV1Beta2Status"), }, }, }, }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.Condition", "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentV1Beta2Status"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.Condition", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentV1Beta2Status"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDeploymentStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2516,24 +2521,24 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentStrategy(ref comm "rollingUpdate": { SchemaProps: spec.SchemaProps{ Description: "rollingUpdate is the rolling update config params. Present only if MachineDeploymentStrategyType = RollingUpdate.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineRollingUpdateDeployment"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineRollingUpdateDeployment"), }, }, "remediation": { SchemaProps: spec.SchemaProps{ Description: "remediation controls the strategy of remediating unhealthy machines and how remediating operations should occur during the lifecycle of the dependant MachineSets.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.RemediationStrategy"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.RemediationStrategy"), }, }, }, }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.MachineRollingUpdateDeployment", "sigs.k8s.io/cluster-api/api/v1beta1.RemediationStrategy"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineRollingUpdateDeployment", "sigs.k8s.io/cluster-api/api/core/v1beta1.RemediationStrategy"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentTopology(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDeploymentTopology(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2544,7 +2549,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentTopology(ref comm SchemaProps: spec.SchemaProps{ Description: "metadata is the metadata applied to the MachineDeployment and the machines of the MachineDeployment. At runtime this metadata is merged with the corresponding metadata from the ClusterClass.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ObjectMeta"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta"), }, }, "class": { @@ -2580,7 +2585,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentTopology(ref comm "machineHealthCheck": { SchemaProps: spec.SchemaProps{ Description: "machineHealthCheck allows to enable, disable and override the MachineHealthCheck configuration in the ClusterClass for this MachineDeployment.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckTopology"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckTopology"), }, }, "nodeDrainTimeout": { @@ -2624,7 +2629,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentTopology(ref comm Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineReadinessGate"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineReadinessGate"), }, }, }, @@ -2633,13 +2638,13 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentTopology(ref comm "strategy": { SchemaProps: spec.SchemaProps{ Description: "strategy is the deployment strategy to use to replace existing machines with new ones.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentStrategy"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentStrategy"), }, }, "variables": { SchemaProps: spec.SchemaProps{ Description: "variables can be used to customize the MachineDeployment through patches.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentVariables"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentVariables"), }, }, }, @@ -2647,11 +2652,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentTopology(ref comm }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentStrategy", "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentVariables", "sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckTopology", "sigs.k8s.io/cluster-api/api/v1beta1.MachineReadinessGate", "sigs.k8s.io/cluster-api/api/v1beta1.ObjectMeta"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentStrategy", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentVariables", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckTopology", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineReadinessGate", "sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDeploymentV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2709,7 +2714,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentV1Beta2Status(ref } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentVariables(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDeploymentVariables(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2732,7 +2737,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentVariables(ref com Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterVariable"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterVariable"), }, }, }, @@ -2742,11 +2747,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDeploymentVariables(ref com }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterVariable"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterVariable"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRule(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDrainRule(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2778,7 +2783,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRule(ref common.Refere SchemaProps: spec.SchemaProps{ Description: "spec defines the spec of a MachineDrainRule.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDrainRuleSpec"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRuleSpec"), }, }, }, @@ -2786,11 +2791,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRule(ref common.Refere }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/v1beta1.MachineDrainRuleSpec"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRuleSpec"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRuleDrainConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDrainRuleDrainConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2819,7 +2824,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRuleDrainConfig(ref co } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRuleList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDrainRuleList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2855,7 +2860,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRuleList(ref common.Re Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDrainRule"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRule"), }, }, }, @@ -2866,11 +2871,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRuleList(ref common.Re }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/v1beta1.MachineDrainRule"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRule"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRuleMachineSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDrainRuleMachineSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2897,7 +2902,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRuleMachineSelector(re } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRulePodSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDrainRulePodSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2924,7 +2929,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRulePodSelector(ref co } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRuleSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineDrainRuleSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -2935,7 +2940,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRuleSpec(ref common.Re SchemaProps: spec.SchemaProps{ Description: "drain configures if and how Pods are drained.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDrainRuleDrainConfig"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRuleDrainConfig"), }, }, "machines": { @@ -2951,7 +2956,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRuleSpec(ref common.Re Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDrainRuleMachineSelector"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRuleMachineSelector"), }, }, }, @@ -2970,7 +2975,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRuleSpec(ref common.Re Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDrainRulePodSelector"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRulePodSelector"), }, }, }, @@ -2981,11 +2986,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineDrainRuleSpec(ref common.Re }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDrainRuleDrainConfig", "sigs.k8s.io/cluster-api/api/v1beta1.MachineDrainRuleMachineSelector", "sigs.k8s.io/cluster-api/api/v1beta1.MachineDrainRulePodSelector"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRuleDrainConfig", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRuleMachineSelector", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRulePodSelector"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheck(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineHealthCheck(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3017,25 +3022,25 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheck(ref common.Refe SchemaProps: spec.SchemaProps{ Description: "spec is the specification of machine health check policy", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckSpec"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ Description: "status is the most recently observed status of MachineHealthCheck resource", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckStatus"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckStatus"), }, }, }, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckSpec", "sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckStatus"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckSpec", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckStatus"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckClass(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineHealthCheckClass(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3050,7 +3055,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckClass(ref common Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.UnhealthyCondition"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.UnhealthyCondition"), }, }, }, @@ -3085,11 +3090,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckClass(ref common }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "k8s.io/apimachinery/pkg/util/intstr.IntOrString", "sigs.k8s.io/cluster-api/api/v1beta1.UnhealthyCondition"}, + "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "k8s.io/apimachinery/pkg/util/intstr.IntOrString", "sigs.k8s.io/cluster-api/api/core/v1beta1.UnhealthyCondition"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineHealthCheckList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3125,7 +3130,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckList(ref common. Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheck"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheck"), }, }, }, @@ -3136,11 +3141,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckList(ref common. }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheck"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheck"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineHealthCheckSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3170,7 +3175,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckSpec(ref common. Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.UnhealthyCondition"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.UnhealthyCondition"), }, }, }, @@ -3206,11 +3211,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckSpec(ref common. }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", "k8s.io/apimachinery/pkg/util/intstr.IntOrString", "sigs.k8s.io/cluster-api/api/v1beta1.UnhealthyCondition"}, + "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", "k8s.io/apimachinery/pkg/util/intstr.IntOrString", "sigs.k8s.io/cluster-api/api/core/v1beta1.UnhealthyCondition"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineHealthCheckStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3271,7 +3276,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckStatus(ref commo Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.Condition"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.Condition"), }, }, }, @@ -3280,18 +3285,18 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckStatus(ref commo "v1beta2": { SchemaProps: spec.SchemaProps{ Description: "v1beta2 groups all the fields that will be added or modified in MachineHealthCheck's status with the V1Beta2 version.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckV1Beta2Status"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckV1Beta2Status"), }, }, }, }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.Condition", "sigs.k8s.io/cluster-api/api/v1beta1.MachineHealthCheckV1Beta2Status"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.Condition", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckV1Beta2Status"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckTopology(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineHealthCheckTopology(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3313,7 +3318,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckTopology(ref com Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.UnhealthyCondition"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.UnhealthyCondition"), }, }, }, @@ -3348,11 +3353,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckTopology(ref com }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "k8s.io/apimachinery/pkg/util/intstr.IntOrString", "sigs.k8s.io/cluster-api/api/v1beta1.UnhealthyCondition"}, + "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "k8s.io/apimachinery/pkg/util/intstr.IntOrString", "sigs.k8s.io/cluster-api/api/core/v1beta1.UnhealthyCondition"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineHealthCheckV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3389,7 +3394,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineHealthCheckV1Beta2Status(re } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3425,7 +3430,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineList(ref common.ReferenceCa Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.Machine"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.Machine"), }, }, }, @@ -3436,11 +3441,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineList(ref common.ReferenceCa }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/v1beta1.Machine"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.Machine"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineNamingStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineNamingStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3460,7 +3465,57 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineNamingStrategy(ref common.R } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolClass(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachinePool(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePool is the Schema for the machinepools API.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "spec is the desired state of MachinePool.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status is the observed state of MachinePool.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolSpec", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta1_MachinePoolClass(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3479,7 +3534,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolClass(ref common.Refere SchemaProps: spec.SchemaProps{ Description: "template is a local struct containing a collection of templates for creation of MachinePools objects representing a pool of worker nodes.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachinePoolClassTemplate"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolClassTemplate"), }, }, "failureDomains": { @@ -3500,7 +3555,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolClass(ref common.Refere "namingStrategy": { SchemaProps: spec.SchemaProps{ Description: "namingStrategy allows changing the naming pattern used when creating the MachinePool.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachinePoolClassNamingStrategy"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolClassNamingStrategy"), }, }, "nodeDrainTimeout": { @@ -3533,11 +3588,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolClass(ref common.Refere }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "sigs.k8s.io/cluster-api/api/v1beta1.MachinePoolClassNamingStrategy", "sigs.k8s.io/cluster-api/api/v1beta1.MachinePoolClassTemplate"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolClassNamingStrategy", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolClassTemplate"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolClassNamingStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachinePoolClassNamingStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3557,7 +3612,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolClassNamingStrategy(ref } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolClassTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachinePoolClassTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3568,21 +3623,21 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolClassTemplate(ref commo SchemaProps: spec.SchemaProps{ Description: "metadata is the metadata applied to the MachinePool. At runtime this metadata is merged with the corresponding metadata from the topology.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ObjectMeta"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta"), }, }, "bootstrap": { SchemaProps: spec.SchemaProps{ Description: "bootstrap contains the bootstrap template reference to be used for the creation of the Machines in the MachinePool.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.LocalObjectTemplate"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.LocalObjectTemplate"), }, }, "infrastructure": { SchemaProps: spec.SchemaProps{ Description: "infrastructure contains the infrastructure template reference to be used for the creation of the MachinePool.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.LocalObjectTemplate"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.LocalObjectTemplate"), }, }, }, @@ -3590,11 +3645,259 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolClassTemplate(ref commo }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.LocalObjectTemplate", "sigs.k8s.io/cluster-api/api/v1beta1.ObjectMeta"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.LocalObjectTemplate", "sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolTopology(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachinePoolList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolList contains a list of MachinePool.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "items is the list of MachinePools.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePool"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePool"}, + } +} + +func schema_cluster_api_api_core_v1beta1_MachinePoolSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolSpec defines the desired state of MachinePool.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "clusterName": { + SchemaProps: spec.SchemaProps{ + Description: "clusterName is the name of the Cluster this object belongs to.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "replicas is the number of desired machines. Defaults to 1. This is a pointer to distinguish between explicit zero and not specified.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "template describes the machines that will be created.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineTemplateSpec"), + }, + }, + "minReadySeconds": { + SchemaProps: spec.SchemaProps{ + Description: "minReadySeconds is the 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)", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "providerIDList": { + SchemaProps: spec.SchemaProps{ + 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.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "failureDomains": { + SchemaProps: spec.SchemaProps{ + Description: "failureDomains is the list of failure domains this MachinePool should be attached to.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"clusterName", "template"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineTemplateSpec"}, + } +} + +func schema_cluster_api_api_core_v1beta1_MachinePoolStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolStatus defines the observed state of MachinePool.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nodeRefs": { + SchemaProps: spec.SchemaProps{ + Description: "nodeRefs will point to the corresponding Nodes if it they exist.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ObjectReference"), + }, + }, + }, + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "replicas is the most recently observed number of replicas.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + "readyReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "readyReplicas is the number of ready replicas for this MachinePool. A machine is considered ready when the node has been created and is \"Ready\".", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "availableReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "availableReplicas is the number of available replicas (ready for at least minReadySeconds) for this MachinePool.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "unavailableReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "unavailableReplicas is the 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.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "failureReason": { + SchemaProps: spec.SchemaProps{ + Description: "failureReason indicates that there is a problem reconciling the state, and will be set to a token value suitable for programmatic interpretation.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"string"}, + Format: "", + }, + }, + "failureMessage": { + SchemaProps: spec.SchemaProps{ + Description: "failureMessage indicates that there is a problem reconciling the state, and will be set to a descriptive error message.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"string"}, + Format: "", + }, + }, + "phase": { + SchemaProps: spec.SchemaProps{ + Description: "phase represents the current phase of cluster actuation.", + Type: []string{"string"}, + Format: "", + }, + }, + "bootstrapReady": { + SchemaProps: spec.SchemaProps{ + Description: "bootstrapReady is the state of the bootstrap provider.", + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + "infrastructureReady": { + SchemaProps: spec.SchemaProps{ + Description: "infrastructureReady is the state of the infrastructure provider.", + Default: false, + Type: []string{"boolean"}, + Format: "", + }, + }, + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "observedGeneration is the latest generation observed by the controller.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "conditions define the current service state of the MachinePool.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.Condition"), + }, + }, + }, + }, + }, + "v1beta2": { + SchemaProps: spec.SchemaProps{ + Description: "v1beta2 groups all the fields that will be added or modified in MachinePool's status with the V1Beta2 version.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolV1Beta2Status"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.ObjectReference", "sigs.k8s.io/cluster-api/api/core/v1beta1.Condition", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolV1Beta2Status"}, + } +} + +func schema_cluster_api_api_core_v1beta1_MachinePoolTopology(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3605,7 +3908,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolTopology(ref common.Ref SchemaProps: spec.SchemaProps{ Description: "metadata is the metadata applied to the MachinePool. At runtime this metadata is merged with the corresponding metadata from the ClusterClass.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ObjectMeta"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta"), }, }, "class": { @@ -3674,7 +3977,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolTopology(ref common.Ref "variables": { SchemaProps: spec.SchemaProps{ Description: "variables can be used to customize the MachinePool through patches.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachinePoolVariables"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolVariables"), }, }, }, @@ -3682,11 +3985,69 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolTopology(ref common.Ref }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "sigs.k8s.io/cluster-api/api/v1beta1.MachinePoolVariables", "sigs.k8s.io/cluster-api/api/v1beta1.ObjectMeta"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolVariables", "sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta"}, + } +} + +func schema_cluster_api_api_core_v1beta1_MachinePoolV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolV1Beta2Status groups all the fields that will be added or modified in MachinePoolStatus with the V1Beta2 version. See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions represents the observations of a MachinePool's current state. Known condition types are Available, BootstrapConfigReady, InfrastructureReady, MachinesReady, MachinesUpToDate, ScalingUp, ScalingDown, Remediating, Deleting, Paused.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + "readyReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "readyReplicas is the number of ready replicas for this MachinePool. A machine is considered ready when Machine's Ready condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "availableReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "availableReplicas is the number of available replicas for this MachinePool. A machine is considered available when Machine's Available condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "upToDateReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "upToDateReplicas is the number of up-to-date replicas targeted by this MachinePool. A machine is considered up-to-date when Machine's UpToDate condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Condition"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolVariables(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachinePoolVariables(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3709,7 +4070,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolVariables(ref common.Re Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterVariable"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterVariable"), }, }, }, @@ -3719,11 +4080,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachinePoolVariables(ref common.Re }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.ClusterVariable"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterVariable"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineReadinessGate(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineReadinessGate(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3752,7 +4113,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineReadinessGate(ref common.Re } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineRollingUpdateDeployment(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineRollingUpdateDeployment(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3786,7 +4147,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineRollingUpdateDeployment(ref } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSet(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineSet(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3818,25 +4179,25 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSet(ref common.ReferenceCal SchemaProps: spec.SchemaProps{ Description: "spec is the desired state of MachineSet.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineSetSpec"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSetSpec"), }, }, "status": { SchemaProps: spec.SchemaProps{ Description: "status is the observed state of MachineSet.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineSetStatus"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSetStatus"), }, }, }, }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/v1beta1.MachineSetSpec", "sigs.k8s.io/cluster-api/api/v1beta1.MachineSetStatus"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSetSpec", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSetStatus"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSetList(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineSetList(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3872,7 +4233,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSetList(ref common.Referenc Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineSet"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSet"), }, }, }, @@ -3883,11 +4244,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSetList(ref common.Referenc }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/v1beta1.MachineSet"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSet"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSetSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineSetSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3934,13 +4295,13 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSetSpec(ref common.Referenc SchemaProps: spec.SchemaProps{ Description: "template is the object that describes the machine that will be created if insufficient replicas are detected. Object references to custom resources are treated as templates.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineTemplateSpec"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineTemplateSpec"), }, }, "machineNamingStrategy": { SchemaProps: spec.SchemaProps{ Description: "machineNamingStrategy allows changing the naming pattern used when creating Machines. Note: InfraMachines & BootstrapConfigs will use the same name as the corresponding Machines.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineNamingStrategy"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineNamingStrategy"), }, }, }, @@ -3948,11 +4309,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSetSpec(ref common.Referenc }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", "sigs.k8s.io/cluster-api/api/v1beta1.MachineNamingStrategy", "sigs.k8s.io/cluster-api/api/v1beta1.MachineTemplateSpec"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineNamingStrategy", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineTemplateSpec"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSetStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineSetStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -3976,7 +4337,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSetStatus(ref common.Refere }, "fullyLabeledReplicas": { SchemaProps: spec.SchemaProps{ - Description: "fullyLabeledReplicas is the number of replicas that have labels matching the labels of the machine template of the MachineSet.\n\nDeprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Description: "fullyLabeledReplicas is the number of replicas that have labels matching the labels of the machine template of the MachineSet.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", Default: 0, Type: []string{"integer"}, Format: "int32", @@ -4007,14 +4368,14 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSetStatus(ref common.Refere }, "failureReason": { SchemaProps: spec.SchemaProps{ - 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\nIn 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\nThese 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\nAny 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.\n\nDeprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + 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\nIn 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\nThese 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\nAny 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.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", Type: []string{"string"}, Format: "", }, }, "failureMessage": { SchemaProps: spec.SchemaProps{ - 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\nDeprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + 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\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", Type: []string{"string"}, Format: "", }, @@ -4027,7 +4388,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSetStatus(ref common.Refere Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.Condition"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.Condition"), }, }, }, @@ -4036,18 +4397,18 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSetStatus(ref common.Refere "v1beta2": { SchemaProps: spec.SchemaProps{ Description: "v1beta2 groups all the fields that will be added or modified in MachineSet's status with the V1Beta2 version.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineSetV1Beta2Status"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSetV1Beta2Status"), }, }, }, }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.Condition", "sigs.k8s.io/cluster-api/api/v1beta1.MachineSetV1Beta2Status"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.Condition", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSetV1Beta2Status"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSetV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineSetV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4105,7 +4466,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSetV1Beta2Status(ref common } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4124,7 +4485,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSpec(ref common.ReferenceCa SchemaProps: spec.SchemaProps{ Description: "bootstrap is a reference to a local struct which encapsulates fields to configure the Machine’s bootstrapping mechanism.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.Bootstrap"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.Bootstrap"), }, }, "infrastructureRef": { @@ -4171,7 +4532,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSpec(ref common.ReferenceCa Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineReadinessGate"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineReadinessGate"), }, }, }, @@ -4200,11 +4561,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineSpec(ref common.ReferenceCa }, }, Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "sigs.k8s.io/cluster-api/api/v1beta1.Bootstrap", "sigs.k8s.io/cluster-api/api/v1beta1.MachineReadinessGate"}, + "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Duration", "sigs.k8s.io/cluster-api/api/core/v1beta1.Bootstrap", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineReadinessGate"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4231,14 +4592,14 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineStatus(ref common.Reference }, "failureReason": { SchemaProps: spec.SchemaProps{ - 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\nThis 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\nAny 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.\n\nDeprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + 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\nThis 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\nAny 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.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", Type: []string{"string"}, Format: "", }, }, "failureMessage": { SchemaProps: spec.SchemaProps{ - 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\nThis 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\nAny 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.\n\nDeprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + 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\nThis 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\nAny 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.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", Type: []string{"string"}, Format: "", }, @@ -4251,7 +4612,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineStatus(ref common.Reference Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineAddress"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineAddress"), }, }, }, @@ -4301,7 +4662,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineStatus(ref common.Reference Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.Condition"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.Condition"), }, }, }, @@ -4310,24 +4671,24 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineStatus(ref common.Reference "deletion": { SchemaProps: spec.SchemaProps{ Description: "deletion contains information relating to removal of the Machine. Only present when the Machine has a deletionTimestamp and drain or wait for volume detach started.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDeletionStatus"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeletionStatus"), }, }, "v1beta2": { SchemaProps: spec.SchemaProps{ Description: "v1beta2 groups all the fields that will be added or modified in Machine's status with the V1Beta2 version.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineV1Beta2Status"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineV1Beta2Status"), }, }, }, }, }, Dependencies: []string{ - "k8s.io/api/core/v1.NodeSystemInfo", "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Time", "sigs.k8s.io/cluster-api/api/v1beta1.Condition", "sigs.k8s.io/cluster-api/api/v1beta1.MachineAddress", "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeletionStatus", "sigs.k8s.io/cluster-api/api/v1beta1.MachineV1Beta2Status"}, + "k8s.io/api/core/v1.NodeSystemInfo", "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Time", "sigs.k8s.io/cluster-api/api/core/v1beta1.Condition", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineAddress", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeletionStatus", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineV1Beta2Status"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineTemplateSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineTemplateSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4338,25 +4699,25 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineTemplateSpec(ref common.Ref SchemaProps: spec.SchemaProps{ Description: "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ObjectMeta"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta"), }, }, "spec": { SchemaProps: spec.SchemaProps{ Description: "spec is the 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", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineSpec"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSpec"), }, }, }, }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.MachineSpec", "sigs.k8s.io/cluster-api/api/v1beta1.ObjectMeta"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSpec", "sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_MachineV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_MachineV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4393,7 +4754,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_MachineV1Beta2Status(ref common.Re } } -func schema_sigsk8sio_cluster_api_api_v1beta1_NetworkRanges(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_NetworkRanges(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4422,7 +4783,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_NetworkRanges(ref common.Reference } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ObjectMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ObjectMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4467,7 +4828,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ObjectMeta(ref common.ReferenceCal } } -func schema_sigsk8sio_cluster_api_api_v1beta1_PatchDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_PatchDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4478,7 +4839,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_PatchDefinition(ref common.Referen SchemaProps: spec.SchemaProps{ Description: "selector defines on which templates the patch should be applied.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.PatchSelector"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.PatchSelector"), }, }, "jsonPatches": { @@ -4489,7 +4850,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_PatchDefinition(ref common.Referen Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.JSONPatch"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.JSONPatch"), }, }, }, @@ -4500,11 +4861,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_PatchDefinition(ref common.Referen }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.JSONPatch", "sigs.k8s.io/cluster-api/api/v1beta1.PatchSelector"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.JSONPatch", "sigs.k8s.io/cluster-api/api/core/v1beta1.PatchSelector"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_PatchSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_PatchSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4531,7 +4892,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_PatchSelector(ref common.Reference SchemaProps: spec.SchemaProps{ Description: "matchResources selects templates based on where they are referenced.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.PatchSelectorMatch"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.PatchSelectorMatch"), }, }, }, @@ -4539,11 +4900,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_PatchSelector(ref common.Reference }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.PatchSelectorMatch"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.PatchSelectorMatch"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_PatchSelectorMatch(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_PatchSelectorMatch(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4567,24 +4928,24 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_PatchSelectorMatch(ref common.Refe "machineDeploymentClass": { SchemaProps: spec.SchemaProps{ Description: "machineDeploymentClass selects templates referenced in specific MachineDeploymentClasses in .spec.workers.machineDeployments.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.PatchSelectorMatchMachineDeploymentClass"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.PatchSelectorMatchMachineDeploymentClass"), }, }, "machinePoolClass": { SchemaProps: spec.SchemaProps{ Description: "machinePoolClass selects templates referenced in specific MachinePoolClasses in .spec.workers.machinePools.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.PatchSelectorMatchMachinePoolClass"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.PatchSelectorMatchMachinePoolClass"), }, }, }, }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.PatchSelectorMatchMachineDeploymentClass", "sigs.k8s.io/cluster-api/api/v1beta1.PatchSelectorMatchMachinePoolClass"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.PatchSelectorMatchMachineDeploymentClass", "sigs.k8s.io/cluster-api/api/core/v1beta1.PatchSelectorMatchMachinePoolClass"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_PatchSelectorMatchMachineDeploymentClass(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_PatchSelectorMatchMachineDeploymentClass(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4612,7 +4973,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_PatchSelectorMatchMachineDeploymen } } -func schema_sigsk8sio_cluster_api_api_v1beta1_PatchSelectorMatchMachinePoolClass(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_PatchSelectorMatchMachinePoolClass(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4640,7 +5001,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_PatchSelectorMatchMachinePoolClass } } -func schema_sigsk8sio_cluster_api_api_v1beta1_RemediationStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_RemediationStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4661,7 +5022,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_RemediationStrategy(ref common.Ref } } -func schema_sigsk8sio_cluster_api_api_v1beta1_Topology(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_Topology(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4701,13 +5062,13 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_Topology(ref common.ReferenceCallb SchemaProps: spec.SchemaProps{ Description: "controlPlane describes the cluster control plane.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ControlPlaneTopology"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ControlPlaneTopology"), }, }, "workers": { SchemaProps: spec.SchemaProps{ Description: "workers encapsulates the different constructs that form the worker nodes for the cluster.", - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.WorkersTopology"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.WorkersTopology"), }, }, "variables": { @@ -4726,7 +5087,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_Topology(ref common.ReferenceCallb Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.ClusterVariable"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterVariable"), }, }, }, @@ -4737,11 +5098,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_Topology(ref common.ReferenceCallb }, }, Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Time", "sigs.k8s.io/cluster-api/api/v1beta1.ClusterVariable", "sigs.k8s.io/cluster-api/api/v1beta1.ControlPlaneTopology", "sigs.k8s.io/cluster-api/api/v1beta1.WorkersTopology"}, + "k8s.io/apimachinery/pkg/apis/meta/v1.Time", "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterVariable", "sigs.k8s.io/cluster-api/api/core/v1beta1.ControlPlaneTopology", "sigs.k8s.io/cluster-api/api/core/v1beta1.WorkersTopology"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_UnhealthyCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_UnhealthyCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4779,7 +5140,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_UnhealthyCondition(ref common.Refe } } -func schema_sigsk8sio_cluster_api_api_v1beta1_ValidationRule(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_ValidationRule(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4830,7 +5191,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_ValidationRule(ref common.Referenc } } -func schema_sigsk8sio_cluster_api_api_v1beta1_VariableSchema(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_VariableSchema(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4841,7 +5202,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_VariableSchema(ref common.Referenc SchemaProps: spec.SchemaProps{ Description: "openAPIV3Schema defines the schema of a variable via OpenAPI v3 schema. The schema is a subset of the schema used in Kubernetes CRDs.", Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.JSONSchemaProps"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.JSONSchemaProps"), }, }, }, @@ -4849,11 +5210,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_VariableSchema(ref common.Referenc }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.JSONSchemaProps"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.JSONSchemaProps"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_VariableSchemaMetadata(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_VariableSchemaMetadata(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4898,7 +5259,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_VariableSchemaMetadata(ref common. } } -func schema_sigsk8sio_cluster_api_api_v1beta1_WorkersClass(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_WorkersClass(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -4921,7 +5282,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_WorkersClass(ref common.ReferenceC Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentClass"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentClass"), }, }, }, @@ -4943,7 +5304,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_WorkersClass(ref common.ReferenceC Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachinePoolClass"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolClass"), }, }, }, @@ -4953,11 +5314,11 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_WorkersClass(ref common.ReferenceC }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentClass", "sigs.k8s.io/cluster-api/api/v1beta1.MachinePoolClass"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentClass", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolClass"}, } } -func schema_sigsk8sio_cluster_api_api_v1beta1_WorkersStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_WorkersStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -5005,7 +5366,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_WorkersStatus(ref common.Reference } } -func schema_sigsk8sio_cluster_api_api_v1beta1_WorkersTopology(ref common.ReferenceCallback) common.OpenAPIDefinition { +func schema_cluster_api_api_core_v1beta1_WorkersTopology(ref common.ReferenceCallback) common.OpenAPIDefinition { return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ @@ -5028,7 +5389,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_WorkersTopology(ref common.Referen Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentTopology"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentTopology"), }, }, }, @@ -5050,7 +5411,7 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_WorkersTopology(ref common.Referen Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ Default: map[string]interface{}{}, - Ref: ref("sigs.k8s.io/cluster-api/api/v1beta1.MachinePoolTopology"), + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolTopology"), }, }, }, @@ -5060,6 +5421,6 @@ func schema_sigsk8sio_cluster_api_api_v1beta1_WorkersTopology(ref common.Referen }, }, Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/v1beta1.MachineDeploymentTopology", "sigs.k8s.io/cluster-api/api/v1beta1.MachinePoolTopology"}, + "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentTopology", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolTopology"}, } } diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/cluster_phase_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/cluster_phase_types.go new file mode 100644 index 0000000000..0706e18e80 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/cluster_phase_types.go @@ -0,0 +1,61 @@ +/* +Copyright 2025 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 v1beta2 + +// 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 infrastructure + // object or a control plane object that can start provisioning the control plane endpoint. + ClusterPhaseProvisioning = ClusterPhase("Provisioning") + + // ClusterPhaseProvisioned is the state when its control plane endpoint has been created and configured + // and the infrastructure object is ready (if defined). + // Note: When a cluster reaches this phase parts of the control plane or worker machines might be still provisioning. + 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. + // + // Deprecated: This enum value is deprecated; the Failed phase won't be set anymore by controllers, and it is preserved only + // for conversion from v1beta1 objects; the Failed phase is going to be removed when support for v1beta1 will be dropped. + // Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + ClusterPhaseFailed = ClusterPhase("Failed") + + // ClusterPhaseUnknown is returned if the Cluster state cannot be determined. + ClusterPhaseUnknown = ClusterPhase("Unknown") +) diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/cluster_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/cluster_types.go new file mode 100644 index 0000000000..af09698531 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/cluster_types.go @@ -0,0 +1,1628 @@ +/* +Copyright 2025 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 v1beta2 + +import ( + "cmp" + "fmt" + "net" + "reflect" + "strings" + + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/util/intstr" + + 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" + + // ClusterKind represents the Kind of Cluster. + ClusterKind = "Cluster" +) + +// Cluster's Available condition and corresponding reasons. +const ( + // ClusterAvailableCondition is true if the Cluster is not deleted, and RemoteConnectionProbe, InfrastructureReady, + // ControlPlaneAvailable, WorkersAvailable, TopologyReconciled (if present) conditions are true. + // If conditions are defined in spec.availabilityGates, those conditions must be true as well. + // Note: + // - When summarizing TopologyReconciled, all reasons except TopologyReconcileFailed and ClusterClassNotReconciled will + // be treated as info. This is because even if topology is not fully reconciled, this is an expected temporary state + // and it doesn't impact availability. + // - When summarizing InfrastructureReady, ControlPlaneAvailable, in case the Cluster is deleting, the absence of the + // referenced object won't be considered as an issue. + ClusterAvailableCondition = AvailableCondition + + // ClusterAvailableReason surfaces when the cluster availability criteria is met. + ClusterAvailableReason = AvailableReason + + // ClusterNotAvailableReason surfaces when the cluster availability criteria is not met (and thus the machine is not available). + ClusterNotAvailableReason = NotAvailableReason + + // ClusterAvailableUnknownReason surfaces when at least one cluster availability criteria is unknown + // and no availability criteria is not met. + ClusterAvailableUnknownReason = AvailableUnknownReason + + // ClusterAvailableInternalErrorReason surfaces unexpected error when computing the Available condition. + ClusterAvailableInternalErrorReason = InternalErrorReason +) + +// Cluster's TopologyReconciled condition and corresponding reasons. +const ( + // ClusterTopologyReconciledCondition is true if the topology controller is working properly. + // Note: This condition is added only if the Cluster is referencing a ClusterClass / defining a managed Topology. + ClusterTopologyReconciledCondition = "TopologyReconciled" + + // ClusterTopologyReconcileSucceededReason documents the reconciliation of a Cluster topology succeeded. + ClusterTopologyReconcileSucceededReason = "ReconcileSucceeded" + + // ClusterTopologyReconciledFailedReason documents the reconciliation of a Cluster topology + // failing due to an error. + ClusterTopologyReconciledFailedReason = "ReconcileFailed" + + // ClusterTopologyReconciledControlPlaneUpgradePendingReason documents reconciliation of a Cluster topology + // not yet completed because Control Plane is not yet updated to match the desired topology spec. + ClusterTopologyReconciledControlPlaneUpgradePendingReason = "ControlPlaneUpgradePending" + + // ClusterTopologyReconciledMachineDeploymentsCreatePendingReason documents reconciliation of a Cluster topology + // not yet completed because at least one of the MachineDeployments is yet to be created. + // This generally happens because new MachineDeployment creations are held off while the ControlPlane is not stable. + ClusterTopologyReconciledMachineDeploymentsCreatePendingReason = "MachineDeploymentsCreatePending" + + // ClusterTopologyReconciledMachineDeploymentsUpgradePendingReason documents reconciliation of a Cluster topology + // not yet completed because at least one of the MachineDeployments is not yet updated to match the desired topology spec. + ClusterTopologyReconciledMachineDeploymentsUpgradePendingReason = "MachineDeploymentsUpgradePending" + + // ClusterTopologyReconciledMachineDeploymentsUpgradeDeferredReason documents reconciliation of a Cluster topology + // not yet completed because the upgrade for at least one of the MachineDeployments has been deferred. + ClusterTopologyReconciledMachineDeploymentsUpgradeDeferredReason = "MachineDeploymentsUpgradeDeferred" + + // ClusterTopologyReconciledMachinePoolsUpgradePendingReason documents reconciliation of a Cluster topology + // not yet completed because at least one of the MachinePools is not yet updated to match the desired topology spec. + ClusterTopologyReconciledMachinePoolsUpgradePendingReason = "MachinePoolsUpgradePending" + + // ClusterTopologyReconciledMachinePoolsCreatePendingReason documents reconciliation of a Cluster topology + // not yet completed because at least one of the MachinePools is yet to be created. + // This generally happens because new MachinePool creations are held off while the ControlPlane is not stable. + ClusterTopologyReconciledMachinePoolsCreatePendingReason = "MachinePoolsCreatePending" + + // ClusterTopologyReconciledMachinePoolsUpgradeDeferredReason documents reconciliation of a Cluster topology + // not yet completed because the upgrade for at least one of the MachinePools has been deferred. + ClusterTopologyReconciledMachinePoolsUpgradeDeferredReason = "MachinePoolsUpgradeDeferred" + + // ClusterTopologyReconciledHookBlockingReason documents reconciliation of a Cluster topology + // not yet completed because at least one of the lifecycle hooks is blocking. + ClusterTopologyReconciledHookBlockingReason = "LifecycleHookBlocking" + + // ClusterTopologyReconciledClusterClassNotReconciledReason documents reconciliation of a Cluster topology not + // yet completed because the ClusterClass has not reconciled yet. If this condition persists there may be an issue + // with the ClusterClass surfaced in the ClusterClass status or controller logs. + ClusterTopologyReconciledClusterClassNotReconciledReason = "ClusterClassNotReconciled" + + // ClusterTopologyReconciledDeletingReason surfaces when the Cluster is deleting because the + // DeletionTimestamp is set. + ClusterTopologyReconciledDeletingReason = DeletingReason + + // ClusterTopologyReconcilePausedReason surfaces when the Cluster is paused. + ClusterTopologyReconcilePausedReason = PausedReason +) + +// Cluster's InfrastructureReady condition and corresponding reasons. +const ( + // ClusterInfrastructureReadyCondition mirrors Cluster's infrastructure Ready condition. + ClusterInfrastructureReadyCondition = InfrastructureReadyCondition + + // ClusterInfrastructureReadyReason surfaces when the cluster infrastructure is ready. + ClusterInfrastructureReadyReason = ReadyReason + + // ClusterInfrastructureNotReadyReason surfaces when the cluster infrastructure is not ready. + ClusterInfrastructureNotReadyReason = NotReadyReason + + // ClusterInfrastructureInvalidConditionReportedReason surfaces a infrastructure Ready condition (read from an infra cluster object) which is invalid + // (e.g. its status is missing). + ClusterInfrastructureInvalidConditionReportedReason = InvalidConditionReportedReason + + // ClusterInfrastructureInternalErrorReason surfaces unexpected failures when reading an infra cluster object. + ClusterInfrastructureInternalErrorReason = InternalErrorReason + + // ClusterInfrastructureDoesNotExistReason surfaces when a referenced infrastructure object does not exist. + // Note: this could happen when creating the Cluster. However, this state should be treated as an error if it lasts indefinitely. + ClusterInfrastructureDoesNotExistReason = ObjectDoesNotExistReason + + // ClusterInfrastructureDeletedReason surfaces when a referenced infrastructure object has been deleted. + // Note: controllers can't identify if the infrastructure object was deleted by the controller itself, e.g. + // during the deletion workflow, or by a users. + ClusterInfrastructureDeletedReason = ObjectDeletedReason +) + +// Cluster's ControlPlaneInitialized condition and corresponding reasons. +const ( + // ClusterControlPlaneInitializedCondition is true when the Cluster's control plane is functional enough + // to accept requests. This information is usually used as a signal for starting all the provisioning operations + // that depends on a functional API server, but do not require a full HA control plane to exists. + // Note: Once set to true, this condition will never change. + ClusterControlPlaneInitializedCondition = "ControlPlaneInitialized" + + // ClusterControlPlaneInitializedReason surfaces when the cluster control plane is initialized. + ClusterControlPlaneInitializedReason = "Initialized" + + // ClusterControlPlaneNotInitializedReason surfaces when the cluster control plane is not yet initialized. + ClusterControlPlaneNotInitializedReason = "NotInitialized" + + // ClusterControlPlaneInitializedInternalErrorReason surfaces unexpected failures when computing the + // ControlPlaneInitialized condition. + ClusterControlPlaneInitializedInternalErrorReason = InternalErrorReason +) + +// Cluster's ControlPlaneAvailable condition and corresponding reasons. +const ( + // ClusterControlPlaneAvailableCondition is a mirror of Cluster's control plane Available condition. + ClusterControlPlaneAvailableCondition = "ControlPlaneAvailable" + + // ClusterControlPlaneAvailableReason surfaces when the cluster control plane is available. + ClusterControlPlaneAvailableReason = AvailableReason + + // ClusterControlPlaneNotAvailableReason surfaces when the cluster control plane is not available. + ClusterControlPlaneNotAvailableReason = NotAvailableReason + + // ClusterControlPlaneInvalidConditionReportedReason surfaces a control plane Available condition (read from a control plane object) which is invalid. + // (e.g. its status is missing). + ClusterControlPlaneInvalidConditionReportedReason = InvalidConditionReportedReason + + // ClusterControlPlaneInternalErrorReason surfaces unexpected failures when reading a control plane object. + ClusterControlPlaneInternalErrorReason = InternalErrorReason + + // ClusterControlPlaneDoesNotExistReason surfaces when a referenced control plane object does not exist. + // Note: this could happen when creating the Cluster. However, this state should be treated as an error if it lasts indefinitely. + ClusterControlPlaneDoesNotExistReason = ObjectDoesNotExistReason + + // ClusterControlPlaneDeletedReason surfaces when a referenced control plane object has been deleted. + // Note: controllers can't identify if the control plane object was deleted by the controller itself, e.g. + // during the deletion workflow, or by a users. + ClusterControlPlaneDeletedReason = ObjectDeletedReason +) + +// Cluster's WorkersAvailable condition and corresponding reasons. +const ( + // ClusterWorkersAvailableCondition is the summary of MachineDeployment and MachinePool's Available conditions. + // Note: Stand-alone MachineSets and stand-alone Machines are not included in this condition. + ClusterWorkersAvailableCondition = "WorkersAvailable" + + // ClusterWorkersAvailableReason surfaces when all MachineDeployment and MachinePool's Available conditions are true. + ClusterWorkersAvailableReason = AvailableReason + + // ClusterWorkersNotAvailableReason surfaces when at least one of the MachineDeployment and MachinePool's Available + // conditions is false. + ClusterWorkersNotAvailableReason = NotAvailableReason + + // ClusterWorkersAvailableUnknownReason surfaces when at least one of the MachineDeployment and MachinePool's Available + // conditions is unknown and none of those Available conditions is false. + ClusterWorkersAvailableUnknownReason = AvailableUnknownReason + + // ClusterWorkersAvailableNoWorkersReason surfaces when no MachineDeployment and MachinePool exist for the Cluster. + ClusterWorkersAvailableNoWorkersReason = "NoWorkers" + + // ClusterWorkersAvailableInternalErrorReason surfaces unexpected failures when listing MachineDeployment and MachinePool + // or aggregating conditions from those objects. + ClusterWorkersAvailableInternalErrorReason = InternalErrorReason +) + +// Cluster's ControlPlaneMachinesReady condition and corresponding reasons. +const ( + // ClusterControlPlaneMachinesReadyCondition surfaces detail of issues on control plane machines, if any. + ClusterControlPlaneMachinesReadyCondition = "ControlPlaneMachinesReady" + + // ClusterControlPlaneMachinesReadyReason surfaces when all control plane machine's Ready conditions are true. + ClusterControlPlaneMachinesReadyReason = ReadyReason + + // ClusterControlPlaneMachinesNotReadyReason surfaces when at least one of control plane machine's Ready conditions is false. + ClusterControlPlaneMachinesNotReadyReason = NotReadyReason + + // ClusterControlPlaneMachinesReadyUnknownReason surfaces when at least one of control plane machine's Ready conditions is unknown + // and none of control plane machine's Ready conditions is false. + ClusterControlPlaneMachinesReadyUnknownReason = ReadyUnknownReason + + // ClusterControlPlaneMachinesReadyNoReplicasReason surfaces when no control plane machines exist for the Cluster. + ClusterControlPlaneMachinesReadyNoReplicasReason = NoReplicasReason + + // ClusterControlPlaneMachinesReadyInternalErrorReason surfaces unexpected failures when listing control plane machines + // or aggregating control plane machine's conditions. + ClusterControlPlaneMachinesReadyInternalErrorReason = InternalErrorReason +) + +// Cluster's WorkerMachinesReady condition and corresponding reasons. +const ( + // ClusterWorkerMachinesReadyCondition surfaces detail of issues on the worker machines, if any. + ClusterWorkerMachinesReadyCondition = "WorkerMachinesReady" + + // ClusterWorkerMachinesReadyReason surfaces when all the worker machine's Ready conditions are true. + ClusterWorkerMachinesReadyReason = ReadyReason + + // ClusterWorkerMachinesNotReadyReason surfaces when at least one of the worker machine's Ready conditions is false. + ClusterWorkerMachinesNotReadyReason = NotReadyReason + + // ClusterWorkerMachinesReadyUnknownReason surfaces when at least one of the worker machine's Ready conditions is unknown + // and none of the worker machine's Ready conditions is false. + ClusterWorkerMachinesReadyUnknownReason = ReadyUnknownReason + + // ClusterWorkerMachinesReadyNoReplicasReason surfaces when no worker machines exist for the Cluster. + ClusterWorkerMachinesReadyNoReplicasReason = NoReplicasReason + + // ClusterWorkerMachinesReadyInternalErrorReason surfaces unexpected failures when listing worker machines + // or aggregating worker machine's conditions. + ClusterWorkerMachinesReadyInternalErrorReason = InternalErrorReason +) + +// Cluster's ControlPlaneMachinesUpToDate condition and corresponding reasons. +const ( + // ClusterControlPlaneMachinesUpToDateCondition surfaces details of control plane machines not up to date, if any. + // Note: New machines are considered 10s after machine creation. This gives time to the machine's owner controller to recognize the new machine and add the UpToDate condition. + ClusterControlPlaneMachinesUpToDateCondition = "ControlPlaneMachinesUpToDate" + + // ClusterControlPlaneMachinesUpToDateReason surfaces when all the control plane machine's UpToDate conditions are true. + ClusterControlPlaneMachinesUpToDateReason = UpToDateReason + + // ClusterControlPlaneMachinesNotUpToDateReason surfaces when at least one of the control plane machine's UpToDate conditions is false. + ClusterControlPlaneMachinesNotUpToDateReason = NotUpToDateReason + + // ClusterControlPlaneMachinesUpToDateUnknownReason surfaces when at least one of the control plane machine's UpToDate conditions is unknown + // and none of the control plane machine's UpToDate conditions is false. + ClusterControlPlaneMachinesUpToDateUnknownReason = UpToDateUnknownReason + + // ClusterControlPlaneMachinesUpToDateNoReplicasReason surfaces when no control plane machines exist for the Cluster. + ClusterControlPlaneMachinesUpToDateNoReplicasReason = NoReplicasReason + + // ClusterControlPlaneMachinesUpToDateInternalErrorReason surfaces unexpected failures when listing control plane machines + // or aggregating status. + ClusterControlPlaneMachinesUpToDateInternalErrorReason = InternalErrorReason +) + +// Cluster's WorkerMachinesUpToDate condition and corresponding reasons. +const ( + // ClusterWorkerMachinesUpToDateCondition surfaces details of worker machines not up to date, if any. + // Note: New machines are considered 10s after machine creation. This gives time to the machine's owner controller to recognize the new machine and add the UpToDate condition. + ClusterWorkerMachinesUpToDateCondition = "WorkerMachinesUpToDate" + + // ClusterWorkerMachinesUpToDateReason surfaces when all the worker machine's UpToDate conditions are true. + ClusterWorkerMachinesUpToDateReason = UpToDateReason + + // ClusterWorkerMachinesNotUpToDateReason surfaces when at least one of the worker machine's UpToDate conditions is false. + ClusterWorkerMachinesNotUpToDateReason = NotUpToDateReason + + // ClusterWorkerMachinesUpToDateUnknownReason surfaces when at least one of the worker machine's UpToDate conditions is unknown + // and none of the worker machine's UpToDate conditions is false. + ClusterWorkerMachinesUpToDateUnknownReason = UpToDateUnknownReason + + // ClusterWorkerMachinesUpToDateNoReplicasReason surfaces when no worker machines exist for the Cluster. + ClusterWorkerMachinesUpToDateNoReplicasReason = NoReplicasReason + + // ClusterWorkerMachinesUpToDateInternalErrorReason surfaces unexpected failures when listing worker machines + // or aggregating status. + ClusterWorkerMachinesUpToDateInternalErrorReason = InternalErrorReason +) + +// Cluster's RemoteConnectionProbe condition and corresponding reasons. +const ( + // ClusterRemoteConnectionProbeCondition is true when control plane can be reached; in case of connection problems. + // The condition turns to false only if the cluster cannot be reached for 50s after the first connection problem + // is detected (or whatever period is defined in the --remote-connection-grace-period flag). + ClusterRemoteConnectionProbeCondition = "RemoteConnectionProbe" + + // ClusterRemoteConnectionProbeFailedReason surfaces issues with the connection to the workload cluster. + ClusterRemoteConnectionProbeFailedReason = "ProbeFailed" + + // ClusterRemoteConnectionProbeSucceededReason is used to report a working connection with the workload cluster. + ClusterRemoteConnectionProbeSucceededReason = "ProbeSucceeded" +) + +// Cluster's RollingOut condition and corresponding reasons. +const ( + // ClusterRollingOutCondition is the summary of `RollingOut` conditions from ControlPlane, MachineDeployments + // and MachinePools. + ClusterRollingOutCondition = RollingOutCondition + + // ClusterRollingOutReason surfaces when at least one of the Cluster's control plane, MachineDeployments, + // or MachinePools are rolling out. + ClusterRollingOutReason = RollingOutReason + + // ClusterNotRollingOutReason surfaces when none of the Cluster's control plane, MachineDeployments, + // or MachinePools are rolling out. + ClusterNotRollingOutReason = NotRollingOutReason + + // ClusterRollingOutUnknownReason surfaces when one of the Cluster's control plane, MachineDeployments, + // or MachinePools rolling out condition is unknown, and none true. + ClusterRollingOutUnknownReason = "RollingOutUnknown" + + // ClusterRollingOutInternalErrorReason surfaces unexpected failures when listing machines + // or computing the RollingOut condition. + ClusterRollingOutInternalErrorReason = InternalErrorReason +) + +// Cluster's ScalingUp condition and corresponding reasons. +const ( + // ClusterScalingUpCondition is the summary of `ScalingUp` conditions from ControlPlane, MachineDeployments, + // MachinePools and stand-alone MachineSets. + ClusterScalingUpCondition = ScalingUpCondition + + // ClusterScalingUpReason surfaces when at least one of the Cluster's control plane, MachineDeployments, + // MachinePools and stand-alone MachineSets are scaling up. + ClusterScalingUpReason = ScalingUpReason + + // ClusterNotScalingUpReason surfaces when none of the Cluster's control plane, MachineDeployments, + // MachinePools and stand-alone MachineSets are scaling up. + ClusterNotScalingUpReason = NotScalingUpReason + + // ClusterScalingUpUnknownReason surfaces when one of the Cluster's control plane, MachineDeployments, + // MachinePools and stand-alone MachineSets scaling up condition is unknown, and none true. + ClusterScalingUpUnknownReason = "ScalingUpUnknown" + + // ClusterScalingUpInternalErrorReason surfaces unexpected failures when listing machines + // or computing the ScalingUp condition. + ClusterScalingUpInternalErrorReason = InternalErrorReason +) + +// Cluster's ScalingDown condition and corresponding reasons. +const ( + // ClusterScalingDownCondition is the summary of `ScalingDown` conditions from ControlPlane, MachineDeployments, + // MachinePools and stand-alone MachineSets. + ClusterScalingDownCondition = ScalingDownCondition + + // ClusterScalingDownReason surfaces when at least one of the Cluster's control plane, MachineDeployments, + // MachinePools and stand-alone MachineSets are scaling down. + ClusterScalingDownReason = ScalingDownReason + + // ClusterNotScalingDownReason surfaces when none of the Cluster's control plane, MachineDeployments, + // MachinePools and stand-alone MachineSets are scaling down. + ClusterNotScalingDownReason = NotScalingDownReason + + // ClusterScalingDownUnknownReason surfaces when one of the Cluster's control plane, MachineDeployments, + // MachinePools and stand-alone MachineSets scaling down condition is unknown, and none true. + ClusterScalingDownUnknownReason = "ScalingDownUnknown" + + // ClusterScalingDownInternalErrorReason surfaces unexpected failures when listing machines + // or computing the ScalingDown condition. + ClusterScalingDownInternalErrorReason = InternalErrorReason +) + +// Cluster's Remediating condition and corresponding reasons. +const ( + // ClusterRemediatingCondition surfaces details about ongoing remediation of the controlled machines, if any. + ClusterRemediatingCondition = RemediatingCondition + + // ClusterRemediatingReason surfaces when the Cluster has at least one machine with HealthCheckSucceeded set to false + // and with the OwnerRemediated condition set to false. + ClusterRemediatingReason = RemediatingReason + + // ClusterNotRemediatingReason surfaces when the Cluster does not have any machine with HealthCheckSucceeded set to false + // and with the OwnerRemediated condition set to false. + ClusterNotRemediatingReason = NotRemediatingReason + + // ClusterRemediatingInternalErrorReason surfaces unexpected failures when computing the Remediating condition. + ClusterRemediatingInternalErrorReason = InternalErrorReason +) + +// Cluster's Deleting condition and corresponding reasons. +const ( + // ClusterDeletingCondition surfaces details about ongoing deletion of the cluster. + ClusterDeletingCondition = DeletingCondition + + // ClusterNotDeletingReason surfaces when the Cluster is not deleting because the + // DeletionTimestamp is not set. + ClusterNotDeletingReason = NotDeletingReason + + // ClusterDeletingWaitingForBeforeDeleteHookReason surfaces when the Cluster deletion + // waits for the ClusterDelete hooks to allow deletion to complete. + ClusterDeletingWaitingForBeforeDeleteHookReason = "WaitingForBeforeDeleteHook" + + // ClusterDeletingWaitingForWorkersDeletionReason surfaces when the Cluster deletion + // waits for the workers Machines and the object controlling those machines (MachinePools, MachineDeployments, MachineSets) + // to be deleted. + ClusterDeletingWaitingForWorkersDeletionReason = "WaitingForWorkersDeletion" + + // ClusterDeletingWaitingForControlPlaneDeletionReason surfaces when the Cluster deletion + // waits for the ControlPlane to be deleted. + ClusterDeletingWaitingForControlPlaneDeletionReason = "WaitingForControlPlaneDeletion" + + // ClusterDeletingWaitingForInfrastructureDeletionReason surfaces when the Cluster deletion + // waits for the InfraCluster to be deleted. + ClusterDeletingWaitingForInfrastructureDeletionReason = "WaitingForInfrastructureDeletion" + + // ClusterDeletingDeletionCompletedReason surfaces when the Cluster deletion has been completed. + // This reason is set right after the `cluster.cluster.x-k8s.io` finalizer is removed. + // This means that the object will go away (i.e. be removed from etcd), except if there are other + // finalizers on the Cluster object. + ClusterDeletingDeletionCompletedReason = DeletionCompletedReason + + // ClusterDeletingInternalErrorReason surfaces unexpected failures when deleting a cluster. + ClusterDeletingInternalErrorReason = InternalErrorReason +) + +// ClusterSpec defines the desired state of Cluster. +// +kubebuilder:validation:MinProperties=1 +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"` + + // clusterNetwork represents the cluster network configuration. + // +optional + ClusterNetwork ClusterNetwork `json:"clusterNetwork,omitempty,omitzero"` + + // controlPlaneEndpoint represents the endpoint used to communicate with the control plane. + // +optional + ControlPlaneEndpoint APIEndpoint `json:"controlPlaneEndpoint,omitempty,omitzero"` + + // controlPlaneRef is an optional reference to a provider-specific resource that holds + // the details for provisioning the Control Plane for a Cluster. + // +optional + ControlPlaneRef ContractVersionedObjectReference `json:"controlPlaneRef,omitempty,omitzero"` + + // infrastructureRef is a reference to a provider-specific resource that holds the details + // for provisioning infrastructure for a cluster in said provider. + // +optional + InfrastructureRef ContractVersionedObjectReference `json:"infrastructureRef,omitempty,omitzero"` + + // topology 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,omitzero"` + + // availabilityGates specifies additional conditions to include when evaluating Cluster Available condition. + // + // If this field is not defined and the Cluster implements a managed topology, availabilityGates + // from the corresponding ClusterClass will be used, if any. + // + // +optional + // +listType=map + // +listMapKey=conditionType + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=32 + AvailabilityGates []ClusterAvailabilityGate `json:"availabilityGates,omitempty"` +} + +// ConditionPolarity defines the polarity for a metav1.Condition. +// +kubebuilder:validation:Enum=Positive;Negative +type ConditionPolarity string + +const ( + // PositivePolarityCondition describe a condition with positive polarity, a condition + // where the normal state is True. e.g. NetworkReady. + PositivePolarityCondition ConditionPolarity = "Positive" + + // NegativePolarityCondition describe a condition with negative polarity, a condition + // where the normal state is False. e.g. MemoryPressure. + NegativePolarityCondition ConditionPolarity = "Negative" +) + +// ClusterAvailabilityGate contains the type of a Cluster condition to be used as availability gate. +type ClusterAvailabilityGate struct { + // conditionType refers to a condition with matching type in the Cluster's condition list. + // If the conditions doesn't exist, it will be treated as unknown. + // Note: Both Cluster API conditions or conditions added by 3rd party controllers can be used as availability gates. + // +required + // +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$` + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=316 + ConditionType string `json:"conditionType,omitempty"` + + // polarity of the conditionType specified in this availabilityGate. + // Valid values are Positive, Negative and omitted. + // When omitted, the default behaviour will be Positive. + // A positive polarity means that the condition should report a true status under normal conditions. + // A negative polarity means that the condition should report a false status under normal conditions. + // +optional + Polarity ConditionPolarity `json:"polarity,omitempty"` +} + +// Topology encapsulates the information of the managed resources. +type Topology struct { + // classRef is the ref to the ClusterClass that should be used for the topology. + // +required + ClassRef ClusterClassRef `json:"classRef,omitempty,omitzero"` + + // version is the Kubernetes version of the cluster. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + Version string `json:"version,omitempty"` + + // controlPlane describes the cluster control plane. + // +optional + ControlPlane ControlPlaneTopology `json:"controlPlane,omitempty,omitzero"` + + // workers encapsulates the different constructs that form the worker nodes + // for the cluster. + // +optional + Workers WorkersTopology `json:"workers,omitempty,omitzero"` + + // variables can be used to customize the Cluster through + // patches. They must comply to the corresponding + // VariableClasses defined in the ClusterClass. + // +optional + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=1000 + Variables []ClusterVariable `json:"variables,omitempty"` +} + +// IsDefined returns true if the Topology is defined. +func (r *Topology) IsDefined() bool { + return !reflect.DeepEqual(r, &Topology{}) +} + +// ClusterClassRef is the ref to the ClusterClass that should be used for the topology. +type ClusterClassRef struct { + // name is the name of the ClusterClass that should be used for the topology. + // name must be a valid ClusterClass name and because of that be at most 253 characters in length + // and it must consist only of lower case alphanumeric characters, hyphens (-) and periods (.), and must start + // and end with an alphanumeric character. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$` + Name string `json:"name,omitempty"` + + // namespace is the namespace of the ClusterClass that should be used for the topology. + // If namespace is empty or not set, it is defaulted to the namespace of the Cluster object. + // namespace must be a valid namespace name and because of that be at most 63 characters in length + // and it must consist only of lower case alphanumeric characters or hyphens (-), and must start + // and end with an alphanumeric character. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$` + Namespace string `json:"namespace,omitempty"` +} + +// ControlPlaneTopology specifies the parameters for the control plane nodes in the cluster. +// +kubebuilder:validation:MinProperties=1 +type ControlPlaneTopology struct { + // metadata is the metadata applied to the ControlPlane and the Machines of the ControlPlane + // if the ControlPlaneTemplate referenced by the ClusterClass is machine based. If not, it + // is applied only to the ControlPlane. + // At runtime this metadata is merged with the corresponding metadata from the ClusterClass. + // +optional + Metadata ObjectMeta `json:"metadata,omitempty,omitzero"` + + // replicas is the number of control plane nodes. + // If the value is not set, 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"` + + // healthCheck allows to enable, disable and override control plane health check + // configuration from the ClusterClass for this control plane. + // +optional + HealthCheck ControlPlaneTopologyHealthCheck `json:"healthCheck,omitempty,omitzero"` + + // deletion contains configuration options for Machine deletion. + // +optional + Deletion ControlPlaneTopologyMachineDeletionSpec `json:"deletion,omitempty,omitzero"` + + // readinessGates specifies additional conditions to include when evaluating Machine Ready condition. + // + // This field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready + // computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine. + // + // If this field is not defined, readinessGates from the corresponding ControlPlaneClass will be used, if any. + // + // NOTE: Specific control plane provider implementations might automatically extend the list of readinessGates; + // e.g. the kubeadm control provider adds ReadinessGates for the APIServerPodHealthy, SchedulerPodHealthy conditions, etc. + // +optional + // +listType=map + // +listMapKey=conditionType + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=32 + ReadinessGates []MachineReadinessGate `json:"readinessGates,omitempty"` + + // variables can be used to customize the ControlPlane through patches. + // +optional + Variables ControlPlaneVariables `json:"variables,omitempty,omitzero"` +} + +// ControlPlaneTopologyHealthCheck defines a MachineHealthCheck for control plane machines. +// +kubebuilder:validation:MinProperties=1 +type ControlPlaneTopologyHealthCheck struct { + // enabled controls if a MachineHealthCheck should be created for the target machines. + // + // If false: No MachineHealthCheck will be created. + // + // If not set(default): A MachineHealthCheck will be created if it is defined here or + // in the associated ClusterClass. If no MachineHealthCheck is defined then none will be created. + // + // If true: A MachineHealthCheck is guaranteed to be created. Cluster validation will + // block if `enable` is true and no MachineHealthCheck definition is available. + // +optional + Enabled *bool `json:"enabled,omitempty"` + + // checks are the checks that are used to evaluate if a Machine is healthy. + // + // If one of checks and remediation fields are set, the system assumes that an healthCheck override is defined, + // and as a consequence the checks and remediation fields from Cluster will be used instead of the + // corresponding fields in ClusterClass. + // + // Independent of this configuration the MachineHealthCheck controller will always + // flag Machines with `cluster.x-k8s.io/remediate-machine` annotation and + // Machines with deleted Nodes as unhealthy. + // + // Furthermore, if checks.nodeStartupTimeoutSeconds is not set it + // is defaulted to 10 minutes and evaluated accordingly. + // + // +optional + Checks ControlPlaneTopologyHealthCheckChecks `json:"checks,omitempty,omitzero"` + + // remediation configures if and how remediations are triggered if a Machine is unhealthy. + // + // If one of checks and remediation fields are set, the system assumes that an healthCheck override is defined, + // and as a consequence the checks and remediation fields from cluster will be used instead of the + // corresponding fields in ClusterClass. + // + // If an health check override is defined and remediation or remediation.triggerIf is not set, + // remediation will always be triggered for unhealthy Machines. + // + // If an health check override is defined and remediation or remediation.templateRef is not set, + // the OwnerRemediated condition will be set on unhealthy Machines to trigger remediation via + // the owner of the Machines, for example a MachineSet or a KubeadmControlPlane. + // + // +optional + Remediation ControlPlaneTopologyHealthCheckRemediation `json:"remediation,omitempty,omitzero"` +} + +// IsDefined returns true if one of checks and remediation are not zero. +func (m *ControlPlaneTopologyHealthCheck) IsDefined() bool { + return !reflect.ValueOf(m.Checks).IsZero() || !reflect.ValueOf(m.Remediation).IsZero() +} + +// ControlPlaneTopologyHealthCheckChecks are the checks that are used to evaluate if a control plane Machine is healthy. +// +kubebuilder:validation:MinProperties=1 +type ControlPlaneTopologyHealthCheckChecks struct { + // nodeStartupTimeoutSeconds allows to set the maximum time for MachineHealthCheck + // to consider a Machine unhealthy if a corresponding Node isn't associated + // through a `Spec.ProviderID` field. + // + // The duration set in this field is compared to the greatest of: + // - Cluster's infrastructure ready condition timestamp (if and when available) + // - Control Plane's initialized condition timestamp (if and when available) + // - Machine's infrastructure ready condition timestamp (if and when available) + // - Machine's metadata creation timestamp + // + // Defaults to 10 minutes. + // If you wish to disable this feature, set the value explicitly to 0. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeStartupTimeoutSeconds *int32 `json:"nodeStartupTimeoutSeconds,omitempty"` + + // unhealthyNodeConditions contains a list of 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. + // + // +optional + // +listType=atomic + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=100 + UnhealthyNodeConditions []UnhealthyNodeCondition `json:"unhealthyNodeConditions,omitempty"` +} + +// ControlPlaneTopologyHealthCheckRemediation configures if and how remediations are triggered if a control plane Machine is unhealthy. +// +kubebuilder:validation:MinProperties=1 +type ControlPlaneTopologyHealthCheckRemediation struct { + // triggerIf configures if remediations are triggered. + // If this field is not set, remediations are always triggered. + // +optional + TriggerIf ControlPlaneTopologyHealthCheckRemediationTriggerIf `json:"triggerIf,omitempty,omitzero"` + + // templateRef 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 + TemplateRef MachineHealthCheckRemediationTemplateReference `json:"templateRef,omitempty,omitzero"` +} + +// ControlPlaneTopologyHealthCheckRemediationTriggerIf configures if remediations are triggered. +// +kubebuilder:validation:MinProperties=1 +type ControlPlaneTopologyHealthCheckRemediationTriggerIf struct { + // unhealthyLessThanOrEqualTo specifies that remediations are only triggered if the number of + // unhealthy Machines is less than or equal to the configured value. + // unhealthyInRange takes precedence if set. + // + // +optional + UnhealthyLessThanOrEqualTo *intstr.IntOrString `json:"unhealthyLessThanOrEqualTo,omitempty"` + + // unhealthyInRange specifies that remediations are only triggered if the number of + // unhealthy Machines is in the configured range. + // Takes precedence over unhealthyLessThanOrEqualTo. + // 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]+\]$ + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=32 + UnhealthyInRange string `json:"unhealthyInRange,omitempty"` +} + +// ControlPlaneTopologyMachineDeletionSpec contains configuration options for Machine deletion. +// +kubebuilder:validation:MinProperties=1 +type ControlPlaneTopologyMachineDeletionSpec struct { + // nodeDrainTimeoutSeconds 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: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` + // +optional + // +kubebuilder:validation:Minimum=0 + NodeDrainTimeoutSeconds *int32 `json:"nodeDrainTimeoutSeconds,omitempty"` + + // nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes + // to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeVolumeDetachTimeoutSeconds *int32 `json:"nodeVolumeDetachTimeoutSeconds,omitempty"` + + // nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine + // hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely. + // Defaults to 10 seconds. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeDeletionTimeoutSeconds *int32 `json:"nodeDeletionTimeoutSeconds,omitempty"` +} + +// WorkersTopology represents the different sets of worker nodes in the cluster. +// +kubebuilder:validation:MinProperties=1 +type WorkersTopology struct { + // machineDeployments is a list of machine deployments in the cluster. + // +optional + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=2000 + MachineDeployments []MachineDeploymentTopology `json:"machineDeployments,omitempty"` + + // machinePools is a list of machine pools in the cluster. + // +optional + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=2000 + MachinePools []MachinePoolTopology `json:"machinePools,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 MachineDeployment and the machines of the MachineDeployment. + // At runtime this metadata is merged with the corresponding metadata from the ClusterClass. + // +optional + Metadata ObjectMeta `json:"metadata,omitempty,omitzero"` + + // 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. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + Class string `json:"class,omitempty"` + + // 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. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$` + Name string `json:"name,omitempty"` + + // failureDomain is the failure domain the machines will be created in. + // Must match a key in the FailureDomains map stored on the cluster object. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + FailureDomain string `json:"failureDomain,omitempty"` + + // 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 1) + // 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"` + + // healthCheck allows to enable, disable and override MachineDeployment health check + // configuration from the ClusterClass for this MachineDeployment. + // +optional + HealthCheck MachineDeploymentTopologyHealthCheck `json:"healthCheck,omitempty,omitzero"` + + // deletion contains configuration options for Machine deletion. + // +optional + Deletion MachineDeploymentTopologyMachineDeletionSpec `json:"deletion,omitempty,omitzero"` + + // 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 + // +kubebuilder:validation:Minimum=0 + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` + + // readinessGates specifies additional conditions to include when evaluating Machine Ready condition. + // + // This field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready + // computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine. + // + // If this field is not defined, readinessGates from the corresponding MachineDeploymentClass will be used, if any. + // + // +optional + // +listType=map + // +listMapKey=conditionType + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=32 + ReadinessGates []MachineReadinessGate `json:"readinessGates,omitempty"` + + // rollout allows you to configure the behaviour of rolling updates to the MachineDeployment Machines. + // It allows you to define the strategy used during rolling replacements. + // +optional + Rollout MachineDeploymentTopologyRolloutSpec `json:"rollout,omitempty,omitzero"` + + // variables can be used to customize the MachineDeployment through patches. + // +optional + Variables MachineDeploymentVariables `json:"variables,omitempty,omitzero"` +} + +// MachineDeploymentTopologyHealthCheck defines a MachineHealthCheck for MachineDeployment machines. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentTopologyHealthCheck struct { + // enabled controls if a MachineHealthCheck should be created for the target machines. + // + // If false: No MachineHealthCheck will be created. + // + // If not set(default): A MachineHealthCheck will be created if it is defined here or + // in the associated ClusterClass. If no MachineHealthCheck is defined then none will be created. + // + // If true: A MachineHealthCheck is guaranteed to be created. Cluster validation will + // block if `enable` is true and no MachineHealthCheck definition is available. + // +optional + Enabled *bool `json:"enabled,omitempty"` + + // checks are the checks that are used to evaluate if a Machine is healthy. + // + // If one of checks and remediation fields are set, the system assumes that an healthCheck override is defined, + // and as a consequence the checks and remediation fields from Cluster will be used instead of the + // corresponding fields in ClusterClass. + // + // Independent of this configuration the MachineHealthCheck controller will always + // flag Machines with `cluster.x-k8s.io/remediate-machine` annotation and + // Machines with deleted Nodes as unhealthy. + // + // Furthermore, if checks.nodeStartupTimeoutSeconds is not set it + // is defaulted to 10 minutes and evaluated accordingly. + // + // +optional + Checks MachineDeploymentTopologyHealthCheckChecks `json:"checks,omitempty,omitzero"` + + // remediation configures if and how remediations are triggered if a Machine is unhealthy. + // + // If one of checks and remediation fields are set, the system assumes that an healthCheck override is defined, + // and as a consequence the checks and remediation fields from cluster will be used instead of the + // corresponding fields in ClusterClass. + // + // If an health check override is defined and remediation or remediation.triggerIf is not set, + // remediation will always be triggered for unhealthy Machines. + // + // If an health check override is defined and remediation or remediation.templateRef is not set, + // the OwnerRemediated condition will be set on unhealthy Machines to trigger remediation via + // the owner of the Machines, for example a MachineSet or a KubeadmControlPlane. + // + // +optional + Remediation MachineDeploymentTopologyHealthCheckRemediation `json:"remediation,omitempty,omitzero"` +} + +// IsDefined returns true if one of checks and remediation are not zero. +func (m *MachineDeploymentTopologyHealthCheck) IsDefined() bool { + return !reflect.ValueOf(m.Checks).IsZero() || !reflect.ValueOf(m.Remediation).IsZero() +} + +// MachineDeploymentTopologyHealthCheckChecks are the checks that are used to evaluate if a MachineDeployment Machine is healthy. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentTopologyHealthCheckChecks struct { + // nodeStartupTimeoutSeconds allows to set the maximum time for MachineHealthCheck + // to consider a Machine unhealthy if a corresponding Node isn't associated + // through a `Spec.ProviderID` field. + // + // The duration set in this field is compared to the greatest of: + // - Cluster's infrastructure ready condition timestamp (if and when available) + // - Control Plane's initialized condition timestamp (if and when available) + // - Machine's infrastructure ready condition timestamp (if and when available) + // - Machine's metadata creation timestamp + // + // Defaults to 10 minutes. + // If you wish to disable this feature, set the value explicitly to 0. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeStartupTimeoutSeconds *int32 `json:"nodeStartupTimeoutSeconds,omitempty"` + + // unhealthyNodeConditions contains a list of 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. + // + // +optional + // +listType=atomic + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=100 + UnhealthyNodeConditions []UnhealthyNodeCondition `json:"unhealthyNodeConditions,omitempty"` +} + +// MachineDeploymentTopologyHealthCheckRemediation configures if and how remediations are triggered if a MachineDeployment Machine is unhealthy. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentTopologyHealthCheckRemediation struct { + // maxInFlight determines how many in flight remediations should happen at the same time. + // + // Remediation only happens on the MachineSet with the most current revision, while + // older MachineSets (usually present during rollout operations) aren't allowed to remediate. + // + // Note: In general (independent of remediations), unhealthy machines are always + // prioritized during scale down operations over healthy ones. + // + // MaxInFlight can be set to a fixed number or a percentage. + // Example: when this is set to 20%, the MachineSet controller deletes at most 20% of + // the desired replicas. + // + // If not set, remediation is limited to all machines (bounded by replicas) + // under the active MachineSet's management. + // + // +optional + MaxInFlight *intstr.IntOrString `json:"maxInFlight,omitempty"` + + // triggerIf configures if remediations are triggered. + // If this field is not set, remediations are always triggered. + // +optional + TriggerIf MachineDeploymentTopologyHealthCheckRemediationTriggerIf `json:"triggerIf,omitempty,omitzero"` + + // templateRef 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 + TemplateRef MachineHealthCheckRemediationTemplateReference `json:"templateRef,omitempty,omitzero"` +} + +// MachineDeploymentTopologyHealthCheckRemediationTriggerIf configures if remediations are triggered. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentTopologyHealthCheckRemediationTriggerIf struct { + // unhealthyLessThanOrEqualTo specifies that remediations are only triggered if the number of + // unhealthy Machines is less than or equal to the configured value. + // unhealthyInRange takes precedence if set. + // + // +optional + UnhealthyLessThanOrEqualTo *intstr.IntOrString `json:"unhealthyLessThanOrEqualTo,omitempty"` + + // unhealthyInRange specifies that remediations are only triggered if the number of + // unhealthy Machines is in the configured range. + // Takes precedence over unhealthyLessThanOrEqualTo. + // 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]+\]$ + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=32 + UnhealthyInRange string `json:"unhealthyInRange,omitempty"` +} + +// MachineDeploymentTopologyMachineDeletionSpec contains configuration options for Machine deletion. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentTopologyMachineDeletionSpec struct { + // order defines the order in which Machines are deleted when downscaling. + // Defaults to "Random". Valid values are "Random, "Newest", "Oldest" + // +optional + Order MachineSetDeletionOrder `json:"order,omitempty"` + + // nodeDrainTimeoutSeconds 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: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` + // +optional + // +kubebuilder:validation:Minimum=0 + NodeDrainTimeoutSeconds *int32 `json:"nodeDrainTimeoutSeconds,omitempty"` + + // nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes + // to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeVolumeDetachTimeoutSeconds *int32 `json:"nodeVolumeDetachTimeoutSeconds,omitempty"` + + // nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine + // hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely. + // Defaults to 10 seconds. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeDeletionTimeoutSeconds *int32 `json:"nodeDeletionTimeoutSeconds,omitempty"` +} + +// MachineDeploymentTopologyRolloutSpec defines the rollout behavior. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentTopologyRolloutSpec struct { + // strategy specifies how to roll out control plane Machines. + // +optional + Strategy MachineDeploymentTopologyRolloutStrategy `json:"strategy,omitempty,omitzero"` +} + +// MachineDeploymentTopologyRolloutStrategy describes how to replace existing machines +// with new ones. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentTopologyRolloutStrategy struct { + // type of rollout. Allowed values are RollingUpdate and OnDelete. + // Default is RollingUpdate. + // +required + Type MachineDeploymentRolloutStrategyType `json:"type,omitempty"` + + // rollingUpdate is the rolling update config params. Present only if + // type = RollingUpdate. + // +optional + RollingUpdate MachineDeploymentTopologyRolloutStrategyRollingUpdate `json:"rollingUpdate,omitempty,omitzero"` +} + +// MachineDeploymentTopologyRolloutStrategyRollingUpdate is used to control the desired behavior of rolling update. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentTopologyRolloutStrategyRollingUpdate struct { + // maxUnavailable is 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"` + + // maxSurge is 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"` +} + +// MachinePoolTopology specifies the different parameters for a pool of worker nodes in the topology. +// This pool of nodes is managed by a MachinePool object whose lifecycle is managed by the Cluster controller. +type MachinePoolTopology struct { + // metadata is the metadata applied to the MachinePool. + // At runtime this metadata is merged with the corresponding metadata from the ClusterClass. + // +optional + Metadata ObjectMeta `json:"metadata,omitempty,omitzero"` + + // class is the name of the MachinePoolClass used to create the pool of worker nodes. + // This should match one of the deployment classes defined in the ClusterClass object + // mentioned in the `Cluster.Spec.Class` field. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + Class string `json:"class,omitempty"` + + // name is the unique identifier for this MachinePoolTopology. + // The value is used with other unique identifiers to create a MachinePool's Name + // (e.g. cluster's name, etc). In case the name is greater than the allowed maximum length, + // the values are hashed together. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$` + Name string `json:"name,omitempty"` + + // failureDomains is the list of failure domains the machine pool will be created in. + // Must match a key in the FailureDomains map stored on the cluster object. + // +optional + // +listType=atomic + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=100 + // +kubebuilder:validation:items:MinLength=1 + // +kubebuilder:validation:items:MaxLength=256 + FailureDomains []string `json:"failureDomains,omitempty"` + + // deletion contains configuration options for Machine deletion. + // +optional + Deletion MachinePoolTopologyMachineDeletionSpec `json:"deletion,omitempty,omitzero"` + + // minReadySeconds is the minimum number of seconds for which a newly created machine pool should + // be ready. + // Defaults to 0 (machine will be considered available as soon as it + // is ready) + // +optional + // +kubebuilder:validation:Minimum=0 + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` + + // replicas is the number of nodes belonging to this pool. + // If the value is nil, the MachinePool is created without the number of Replicas (defaulting to 1) + // 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"` + + // variables can be used to customize the MachinePool through patches. + // +optional + Variables MachinePoolVariables `json:"variables,omitempty,omitzero"` +} + +// MachinePoolTopologyMachineDeletionSpec contains configuration options for Machine deletion. +// +kubebuilder:validation:MinProperties=1 +type MachinePoolTopologyMachineDeletionSpec struct { + // nodeDrainTimeoutSeconds 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: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` + // +optional + // +kubebuilder:validation:Minimum=0 + NodeDrainTimeoutSeconds *int32 `json:"nodeDrainTimeoutSeconds,omitempty"` + + // nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes + // to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeVolumeDetachTimeoutSeconds *int32 `json:"nodeVolumeDetachTimeoutSeconds,omitempty"` + + // nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the MachinePool + // hosts after the MachinePool is marked for deletion. A duration of 0 will retry deletion indefinitely. + // Defaults to 10 seconds. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeDeletionTimeoutSeconds *int32 `json:"nodeDeletionTimeoutSeconds,omitempty"` +} + +// ClusterVariable can be used to customize the Cluster through patches. Each ClusterVariable is associated with a +// Variable definition in the ClusterClass `status` variables. +type ClusterVariable struct { + // name of the variable. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + Name string `json:"name,omitempty"` + + // value of the variable. + // Note: the value will be validated against the schema of the corresponding ClusterClassVariable + // from the ClusterClass. + // Note: We have to use apiextensionsv1.JSON instead of a custom JSON type, because controller-tools has a + // hard-coded schema for apiextensionsv1.JSON which cannot be produced by another type via controller-tools, + // i.e. it is not possible to have no type field. + // Ref: https://github.com/kubernetes-sigs/controller-tools/blob/d0e03a142d0ecdd5491593e941ee1d6b5d91dba6/pkg/crd/known_types.go#L106-L111 + // +required + Value apiextensionsv1.JSON `json:"value,omitempty,omitzero"` +} + +// ControlPlaneVariables can be used to provide variables for the ControlPlane. +// +kubebuilder:validation:MinProperties=1 +type ControlPlaneVariables struct { + // overrides can be used to override Cluster level variables. + // +optional + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=1000 + Overrides []ClusterVariable `json:"overrides,omitempty"` +} + +// MachineDeploymentVariables can be used to provide variables for a specific MachineDeployment. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentVariables struct { + // overrides can be used to override Cluster level variables. + // +optional + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=1000 + Overrides []ClusterVariable `json:"overrides,omitempty"` +} + +// MachinePoolVariables can be used to provide variables for a specific MachinePool. +// +kubebuilder:validation:MinProperties=1 +type MachinePoolVariables struct { + // overrides can be used to override Cluster level variables. + // +optional + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=1000 + Overrides []ClusterVariable `json:"overrides,omitempty"` +} + +// ClusterNetwork specifies the different networking +// parameters for a cluster. +// +kubebuilder:validation:MinProperties=1 +type ClusterNetwork struct { + // apiServerPort specifies the port the API Server should bind to. + // Defaults to 6443. + // +optional + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=65535 + APIServerPort int32 `json:"apiServerPort,omitempty"` + + // services is the network ranges from which service VIPs are allocated. + // +optional + Services NetworkRanges `json:"services,omitempty,omitzero"` + + // pods is the network ranges from which Pod networks are allocated. + // +optional + Pods NetworkRanges `json:"pods,omitempty,omitzero"` + + // serviceDomain is the domain name for services. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 + ServiceDomain string `json:"serviceDomain,omitempty"` +} + +// NetworkRanges represents ranges of network addresses. +type NetworkRanges struct { + // cidrBlocks is a list of CIDR blocks. + // +required + // +listType=atomic + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=100 + // +kubebuilder:validation:items:MinLength=1 + // +kubebuilder:validation:items:MaxLength=43 + CIDRBlocks []string `json:"cidrBlocks,omitempty"` +} + +func (n NetworkRanges) String() string { + if len(n.CIDRBlocks) == 0 { + return "" + } + return strings.Join(n.CIDRBlocks, ",") +} + +// ClusterStatus defines the observed state of Cluster. +// +kubebuilder:validation:MinProperties=1 +type ClusterStatus struct { + // conditions represents the observations of a Cluster's current state. + // Known condition types are Available, InfrastructureReady, ControlPlaneInitialized, ControlPlaneAvailable, WorkersAvailable, MachinesReady + // MachinesUpToDate, RemoteConnectionProbe, ScalingUp, ScalingDown, Remediating, Deleting, Paused. + // Additionally, a TopologyReconciled condition will be added in case the Cluster is referencing a ClusterClass / defining a managed Topology. + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=32 + Conditions []metav1.Condition `json:"conditions,omitempty"` + + // initialization provides observations of the Cluster initialization process. + // NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial Cluster provisioning. + // +optional + Initialization ClusterInitializationStatus `json:"initialization,omitempty,omitzero"` + + // controlPlane groups all the observations about Cluster's ControlPlane current state. + // +optional + ControlPlane *ClusterControlPlaneStatus `json:"controlPlane,omitempty"` + + // workers groups all the observations about Cluster's Workers current state. + // +optional + Workers *WorkersStatus `json:"workers,omitempty"` + + // failureDomains is a slice of failure domain objects synced from the infrastructure provider. + // +optional + // +listType=map + // +listMapKey=name + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=100 + FailureDomains []FailureDomain `json:"failureDomains,omitempty"` + + // phase represents the current phase of cluster actuation. + // +optional + // +kubebuilder:validation:Enum=Pending;Provisioning;Provisioned;Deleting;Failed;Unknown + Phase string `json:"phase,omitempty"` + + // observedGeneration is the latest generation observed by the controller. + // +optional + // +kubebuilder:validation:Minimum=1 + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. + // +optional + Deprecated *ClusterDeprecatedStatus `json:"deprecated,omitempty"` +} + +// ClusterInitializationStatus provides observations of the Cluster initialization process. +// NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial Cluster provisioning. +// +kubebuilder:validation:MinProperties=1 +type ClusterInitializationStatus struct { + // infrastructureProvisioned is true when the infrastructure provider reports that Cluster's infrastructure is fully provisioned. + // NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. + // The value of this field is never updated after provisioning is completed. + // +optional + InfrastructureProvisioned *bool `json:"infrastructureProvisioned,omitempty"` + + // controlPlaneInitialized denotes when the control plane is functional enough to accept requests. + // This information is usually used as a signal for starting all the provisioning operations that depends on + // a functional API server, but do not require a full HA control plane to exists, like e.g. join worker Machines, + // install core addons like CNI, CPI, CSI etc. + // NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. + // The value of this field is never updated after initialization is completed. + // +optional + ControlPlaneInitialized *bool `json:"controlPlaneInitialized,omitempty"` +} + +// ClusterDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type ClusterDeprecatedStatus struct { + // v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. + // +optional + V1Beta1 *ClusterV1Beta1DeprecatedStatus `json:"v1beta1,omitempty"` +} + +// ClusterV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type ClusterV1Beta1DeprecatedStatus struct { + // conditions defines current service state of the cluster. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + Conditions Conditions `json:"conditions,omitempty"` + + // failureReason indicates that there is a fatal problem reconciling the + // state, and will be set to a token value suitable for + // programmatic interpretation. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +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. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=10240 + FailureMessage *string `json:"failureMessage,omitempty"` //nolint:kubeapilinter // field will be removed when v1beta1 is removed +} + +// ClusterControlPlaneStatus groups all the observations about control plane current state. +type ClusterControlPlaneStatus struct { + // desiredReplicas is the total number of desired control plane machines in this cluster. + // +optional + DesiredReplicas *int32 `json:"desiredReplicas,omitempty"` + + // replicas is the total number of control plane machines in this cluster. + // NOTE: replicas also includes machines still being provisioned or being deleted. + // +optional + Replicas *int32 `json:"replicas,omitempty"` + + // upToDateReplicas is the number of up-to-date control plane machines in this cluster. A machine is considered up-to-date when Machine's UpToDate condition is true. + // +optional + UpToDateReplicas *int32 `json:"upToDateReplicas,omitempty"` + + // readyReplicas is the total number of ready control plane machines in this cluster. A machine is considered ready when Machine's Ready condition is true. + // +optional + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + + // availableReplicas is the total number of available control plane machines in this cluster. A machine is considered available when Machine's Available condition is true. + // +optional + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` +} + +// WorkersStatus groups all the observations about workers current state. +type WorkersStatus struct { + // desiredReplicas is the total number of desired worker machines in this cluster. + // +optional + DesiredReplicas *int32 `json:"desiredReplicas,omitempty"` + + // replicas is the total number of worker machines in this cluster. + // NOTE: replicas also includes machines still being provisioned or being deleted. + // +optional + Replicas *int32 `json:"replicas,omitempty"` + + // upToDateReplicas is the number of up-to-date worker machines in this cluster. A machine is considered up-to-date when Machine's UpToDate condition is true. + // +optional + UpToDateReplicas *int32 `json:"upToDateReplicas,omitempty"` + + // readyReplicas is the total number of ready worker machines in this cluster. A machine is considered ready when Machine's Ready condition is true. + // +optional + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + + // availableReplicas is the total number of available worker machines in this cluster. A machine is considered available when Machine's Available condition is true. + // +optional + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` +} + +// 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 + } +} + +// APIEndpoint represents a reachable Kubernetes API endpoint. +// +kubebuilder:validation:MinProperties=1 +type APIEndpoint struct { + // host is the hostname on which the API server is serving. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=512 + Host string `json:"host,omitempty"` + + // port is the port on which the API server is serving. + // +optional + // +kubebuilder:validation:Minimum=1 + // +kubebuilder:validation:Maximum=65535 + Port int32 `json:"port,omitempty"` +} + +// 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)) +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=clusters,shortName=cl,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="ClusterClass",type="string",JSONPath=".spec.topology.classRef.name",description="ClusterClass of this Cluster, empty if the Cluster is not using a ClusterClass" +// +kubebuilder:printcolumn:name="Available",type="string",JSONPath=`.status.conditions[?(@.type=="Available")].status`,description="Cluster pass all availability checks" +// +kubebuilder:printcolumn:name="CP Desired",type=integer,JSONPath=".status.controlPlane.desiredReplicas",description="The desired number of control plane machines" +// +kubebuilder:printcolumn:name="CP Current",type="integer",JSONPath=".status.controlPlane.replicas",description="The number of control plane machines",priority=10 +// +kubebuilder:printcolumn:name="CP Ready",type="integer",JSONPath=".status.controlPlane.readyReplicas",description="The number of control plane machines with Ready condition true",priority=10 +// +kubebuilder:printcolumn:name="CP Available",type=integer,JSONPath=".status.controlPlane.availableReplicas",description="The number of control plane machines with Available condition true" +// +kubebuilder:printcolumn:name="CP Up-to-date",type=integer,JSONPath=".status.controlPlane.upToDateReplicas",description="The number of control plane machines with UpToDate condition true" +// +kubebuilder:printcolumn:name="W Desired",type=integer,JSONPath=".status.workers.desiredReplicas",description="The desired number of worker machines" +// +kubebuilder:printcolumn:name="W Current",type="integer",JSONPath=".status.workers.replicas",description="The number of worker machines",priority=10 +// +kubebuilder:printcolumn:name="W Ready",type="integer",JSONPath=".status.workers.readyReplicas",description="The number of worker machines with Ready condition true",priority=10 +// +kubebuilder:printcolumn:name="W Available",type=integer,JSONPath=".status.workers.availableReplicas",description="The number of worker machines with Available condition true" +// +kubebuilder:printcolumn:name="W Up-to-date",type=integer,JSONPath=".status.workers.upToDateReplicas",description="The number of worker machines with UpToDate condition true" +// +kubebuilder:printcolumn:name="Paused",type="string",JSONPath=`.status.conditions[?(@.type=="Paused")].status`,description="Reconciliation paused",priority=10 +// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Cluster status such as Pending/Provisioning/Provisioned/Deleting/Failed" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Cluster" +// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.topology.version",description="Kubernetes version associated with this Cluster" + +// Cluster is the Schema for the clusters API. +type Cluster struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec is the desired state of Cluster. + // +required + Spec ClusterSpec `json:"spec,omitempty,omitzero"` + // status is the observed state of Cluster. + // +optional + Status ClusterStatus `json:"status,omitempty,omitzero"` +} + +// GetClassKey returns the namespaced name for the class associated with this object. +func (c *Cluster) GetClassKey() types.NamespacedName { + if !c.Spec.Topology.IsDefined() { + return types.NamespacedName{} + } + + namespace := cmp.Or(c.Spec.Topology.ClassRef.Namespace, c.Namespace) + return types.NamespacedName{Namespace: namespace, Name: c.Spec.Topology.ClassRef.Name} +} + +// GetV1Beta1Conditions returns the set of conditions for this object. +func (c *Cluster) GetV1Beta1Conditions() Conditions { + if c.Status.Deprecated == nil || c.Status.Deprecated.V1Beta1 == nil { + return nil + } + return c.Status.Deprecated.V1Beta1.Conditions +} + +// SetV1Beta1Conditions sets the conditions on this object. +func (c *Cluster) SetV1Beta1Conditions(conditions Conditions) { + if c.Status.Deprecated == nil { + c.Status.Deprecated = &ClusterDeprecatedStatus{} + } + if c.Status.Deprecated.V1Beta1 == nil { + c.Status.Deprecated.V1Beta1 = &ClusterV1Beta1DeprecatedStatus{} + } + c.Status.Deprecated.V1Beta1.Conditions = conditions +} + +// GetConditions returns the set of conditions for this object. +func (c *Cluster) GetConditions() []metav1.Condition { + return c.Status.Conditions +} + +// SetConditions sets conditions for an API object. +func (c *Cluster) SetConditions(conditions []metav1.Condition) { + c.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// ClusterList contains a list of Cluster. +type ClusterList struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + // items is the list of Clusters. + Items []Cluster `json:"items"` +} + +func init() { + objectTypes = append(objectTypes, &Cluster{}, &ClusterList{}) +} + +// FailureDomain is the Schema for Cluster API failure domains. +// It allows controllers to understand how many failure domains a cluster can optionally span across. +type FailureDomain struct { + // name is the name of the failure domain. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + Name string `json:"name,omitempty"` + + // controlPlane determines if this failure domain is suitable for use by control plane machines. + // +optional + ControlPlane *bool `json:"controlPlane,omitempty"` + + // 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/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/clusterclass_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/clusterclass_types.go new file mode 100644 index 0000000000..80d78f3585 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/clusterclass_types.go @@ -0,0 +1,1647 @@ +/* +Copyright 2025 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 v1beta2 + +import ( + "reflect" + + corev1 "k8s.io/api/core/v1" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/intstr" +) + +// ClusterClassKind represents the Kind of ClusterClass. +const ClusterClassKind = "ClusterClass" + +// ClusterClass VariablesReady condition and corresponding reasons. +const ( + // ClusterClassVariablesReadyCondition is true if the ClusterClass variables, including both inline and external + // variables, have been successfully reconciled and thus ready to be used to default and validate variables on Clusters using + // this ClusterClass. + ClusterClassVariablesReadyCondition = "VariablesReady" + + // ClusterClassVariablesReadyReason surfaces that the variables are ready. + ClusterClassVariablesReadyReason = "VariablesReady" + + // ClusterClassVariablesReadyVariableDiscoveryFailedReason surfaces that variable discovery failed. + ClusterClassVariablesReadyVariableDiscoveryFailedReason = "VariableDiscoveryFailed" +) + +// ClusterClass RefVersionsUpToDate condition and corresponding reasons. +const ( + // ClusterClassRefVersionsUpToDateCondition documents if the references in the ClusterClass are + // up-to-date (i.e. they are using the latest apiVersion of the current Cluster API contract from + // the corresponding CRD). + ClusterClassRefVersionsUpToDateCondition = "RefVersionsUpToDate" + + // ClusterClassRefVersionsUpToDateReason surfaces that the references in the ClusterClass are + // up-to-date (i.e. they are using the latest apiVersion of the current Cluster API contract from + // the corresponding CRD). + ClusterClassRefVersionsUpToDateReason = "RefVersionsUpToDate" + + // ClusterClassRefVersionsNotUpToDateReason surfaces that the references in the ClusterClass are not + // up-to-date (i.e. they are not using the latest apiVersion of the current Cluster API contract from + // the corresponding CRD). + ClusterClassRefVersionsNotUpToDateReason = "RefVersionsNotUpToDate" + + // ClusterClassRefVersionsUpToDateInternalErrorReason surfaces that an unexpected error occurred when validating + // if the references are up-to-date. + ClusterClassRefVersionsUpToDateInternalErrorReason = InternalErrorReason +) + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=clusterclasses,shortName=cc,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Paused",type="string",JSONPath=`.status.conditions[?(@.type=="Paused")].status`,description="Reconciliation paused",priority=10 +// +kubebuilder:printcolumn:name="Variables Ready",type="string",JSONPath=`.status.conditions[?(@.type=="VariablesReady")].status`,description="Variables ready" +// +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. +// NOTE: This CRD can only be used if the ClusterTopology feature gate is enabled. +type ClusterClass struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec is the desired state of ClusterClass. + // +required + Spec ClusterClassSpec `json:"spec,omitempty,omitzero"` + // status is the observed state of ClusterClass. + // +optional + Status ClusterClassStatus `json:"status,omitempty,omitzero"` +} + +// ClusterClassSpec describes the desired state of the ClusterClass. +type ClusterClassSpec struct { + // availabilityGates specifies additional conditions to include when evaluating Cluster Available condition. + // + // NOTE: If a Cluster is using this ClusterClass, and this Cluster defines a custom list of availabilityGates, + // such list overrides availabilityGates defined in this field. + // +optional + // +listType=map + // +listMapKey=conditionType + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=32 + AvailabilityGates []ClusterAvailabilityGate `json:"availabilityGates,omitempty"` + + // infrastructure is a reference to a local struct that holds the details + // for provisioning the infrastructure cluster for the Cluster. + // +required + Infrastructure InfrastructureClass `json:"infrastructure,omitempty,omitzero"` + + // controlPlane is a reference to a local struct that holds the details + // for provisioning the Control Plane for the Cluster. + // +required + ControlPlane ControlPlaneClass `json:"controlPlane,omitempty,omitzero"` + + // 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,omitzero"` + + // variables defines the variables which can be configured + // in the Cluster topology and are then used in patches. + // +optional + // +listType=atomic + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=1000 + Variables []ClusterClassVariable `json:"variables,omitempty"` + + // patches defines the patches which are applied to customize + // referenced templates of a ClusterClass. + // Note: Patches will be applied in the order of the array. + // +optional + // +listType=atomic + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=1000 + Patches []ClusterClassPatch `json:"patches,omitempty"` +} + +// InfrastructureClass defines the class for the infrastructure cluster. +type InfrastructureClass struct { + // templateRef contains the reference to a provider-specific infrastructure cluster template. + // +required + TemplateRef ClusterClassTemplateReference `json:"templateRef,omitempty,omitzero"` + + // naming allows changing the naming pattern used when creating the infrastructure cluster object. + // +optional + Naming InfrastructureClassNamingSpec `json:"naming,omitempty,omitzero"` +} + +// ControlPlaneClass defines the class for the control plane. +type ControlPlaneClass struct { + // metadata is the metadata applied to the ControlPlane and the Machines of the ControlPlane + // if the ControlPlaneTemplate referenced is machine based. If not, it is applied only to 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. + // +optional + Metadata ObjectMeta `json:"metadata,omitempty,omitzero"` + + // templateRef contains the reference to a provider-specific control plane template. + // +required + TemplateRef ClusterClassTemplateReference `json:"templateRef,omitempty,omitzero"` + + // machineInfrastructure 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 ControlPlaneClassMachineInfrastructureTemplate `json:"machineInfrastructure,omitempty,omitzero"` + + // healthCheck defines a MachineHealthCheck for this ControlPlaneClass. + // This field is supported if and only if the ControlPlane provider template + // referenced above is Machine based and supports setting replicas. + // +optional + HealthCheck ControlPlaneClassHealthCheck `json:"healthCheck,omitempty,omitzero"` + + // naming allows changing the naming pattern used when creating the control plane provider object. + // +optional + Naming ControlPlaneClassNamingSpec `json:"naming,omitempty,omitzero"` + + // deletion contains configuration options for Machine deletion. + // +optional + Deletion ControlPlaneClassMachineDeletionSpec `json:"deletion,omitempty,omitzero"` + + // readinessGates specifies additional conditions to include when evaluating Machine Ready condition. + // + // This field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready + // computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine. + // + // NOTE: If a Cluster defines a custom list of readinessGates for the control plane, + // such list overrides readinessGates defined in this field. + // NOTE: Specific control plane provider implementations might automatically extend the list of readinessGates; + // e.g. the kubeadm control provider adds ReadinessGates for the APIServerPodHealthy, SchedulerPodHealthy conditions, etc. + // +optional + // +listType=map + // +listMapKey=conditionType + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=32 + ReadinessGates []MachineReadinessGate `json:"readinessGates,omitempty"` +} + +// ControlPlaneClassHealthCheck defines a MachineHealthCheck for control plane machines. +// +kubebuilder:validation:MinProperties=1 +type ControlPlaneClassHealthCheck struct { + // checks are the checks that are used to evaluate if a Machine is healthy. + // + // Independent of this configuration the MachineHealthCheck controller will always + // flag Machines with `cluster.x-k8s.io/remediate-machine` annotation and + // Machines with deleted Nodes as unhealthy. + // + // Furthermore, if checks.nodeStartupTimeoutSeconds is not set it + // is defaulted to 10 minutes and evaluated accordingly. + // + // +optional + Checks ControlPlaneClassHealthCheckChecks `json:"checks,omitempty,omitzero"` + + // remediation configures if and how remediations are triggered if a Machine is unhealthy. + // + // If remediation or remediation.triggerIf is not set, + // remediation will always be triggered for unhealthy Machines. + // + // If remediation or remediation.templateRef is not set, + // the OwnerRemediated condition will be set on unhealthy Machines to trigger remediation via + // the owner of the Machines, for example a MachineSet or a KubeadmControlPlane. + // + // +optional + Remediation ControlPlaneClassHealthCheckRemediation `json:"remediation,omitempty,omitzero"` +} + +// IsDefined returns true if one of checks and remediation are not zero. +func (m *ControlPlaneClassHealthCheck) IsDefined() bool { + return !reflect.ValueOf(m.Checks).IsZero() || !reflect.ValueOf(m.Remediation).IsZero() +} + +// ControlPlaneClassHealthCheckChecks are the checks that are used to evaluate if a control plane Machine is healthy. +// +kubebuilder:validation:MinProperties=1 +type ControlPlaneClassHealthCheckChecks struct { + // nodeStartupTimeoutSeconds allows to set the maximum time for MachineHealthCheck + // to consider a Machine unhealthy if a corresponding Node isn't associated + // through a `Spec.ProviderID` field. + // + // The duration set in this field is compared to the greatest of: + // - Cluster's infrastructure ready condition timestamp (if and when available) + // - Control Plane's initialized condition timestamp (if and when available) + // - Machine's infrastructure ready condition timestamp (if and when available) + // - Machine's metadata creation timestamp + // + // Defaults to 10 minutes. + // If you wish to disable this feature, set the value explicitly to 0. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeStartupTimeoutSeconds *int32 `json:"nodeStartupTimeoutSeconds,omitempty"` + + // unhealthyNodeConditions contains a list of 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. + // + // +optional + // +listType=atomic + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=100 + UnhealthyNodeConditions []UnhealthyNodeCondition `json:"unhealthyNodeConditions,omitempty"` +} + +// ControlPlaneClassHealthCheckRemediation configures if and how remediations are triggered if a control plane Machine is unhealthy. +// +kubebuilder:validation:MinProperties=1 +type ControlPlaneClassHealthCheckRemediation struct { + // triggerIf configures if remediations are triggered. + // If this field is not set, remediations are always triggered. + // +optional + TriggerIf ControlPlaneClassHealthCheckRemediationTriggerIf `json:"triggerIf,omitempty,omitzero"` + + // templateRef 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 + TemplateRef MachineHealthCheckRemediationTemplateReference `json:"templateRef,omitempty,omitzero"` +} + +// ControlPlaneClassHealthCheckRemediationTriggerIf configures if remediations are triggered. +// +kubebuilder:validation:MinProperties=1 +type ControlPlaneClassHealthCheckRemediationTriggerIf struct { + // unhealthyLessThanOrEqualTo specifies that remediations are only triggered if the number of + // unhealthy Machines is less than or equal to the configured value. + // unhealthyInRange takes precedence if set. + // + // +optional + UnhealthyLessThanOrEqualTo *intstr.IntOrString `json:"unhealthyLessThanOrEqualTo,omitempty"` + + // unhealthyInRange specifies that remediations are only triggered if the number of + // unhealthy Machines is in the configured range. + // Takes precedence over unhealthyLessThanOrEqualTo. + // 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]+\]$ + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=32 + UnhealthyInRange string `json:"unhealthyInRange,omitempty"` +} + +// ControlPlaneClassMachineDeletionSpec contains configuration options for Machine deletion. +// +kubebuilder:validation:MinProperties=1 +type ControlPlaneClassMachineDeletionSpec struct { + // nodeDrainTimeoutSeconds 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: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` + // NOTE: This value can be overridden while defining a Cluster.Topology. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeDrainTimeoutSeconds *int32 `json:"nodeDrainTimeoutSeconds,omitempty"` + + // nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes + // to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. + // NOTE: This value can be overridden while defining a Cluster.Topology. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeVolumeDetachTimeoutSeconds *int32 `json:"nodeVolumeDetachTimeoutSeconds,omitempty"` + + // nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine + // hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely. + // Defaults to 10 seconds. + // NOTE: This value can be overridden while defining a Cluster.Topology. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeDeletionTimeoutSeconds *int32 `json:"nodeDeletionTimeoutSeconds,omitempty"` +} + +// ControlPlaneClassNamingSpec defines the naming strategy for control plane objects. +// +kubebuilder:validation:MinProperties=1 +type ControlPlaneClassNamingSpec struct { + // template defines the template to use for generating the name of the ControlPlane object. + // If not defined, it will fallback to `{{ .cluster.name }}-{{ .random }}`. + // If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will + // get concatenated with a random suffix of length 5. + // The templating mechanism provides the following arguments: + // * `.cluster.name`: The name of the cluster object. + // * `.random`: A random alphanumeric string, without vowels, of length 5. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=1024 + Template string `json:"template,omitempty"` +} + +// InfrastructureClassNamingSpec defines the naming strategy for infrastructure objects. +// +kubebuilder:validation:MinProperties=1 +type InfrastructureClassNamingSpec struct { + // template defines the template to use for generating the name of the Infrastructure object. + // If not defined, it will fallback to `{{ .cluster.name }}-{{ .random }}`. + // If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will + // get concatenated with a random suffix of length 5. + // The templating mechanism provides the following arguments: + // * `.cluster.name`: The name of the cluster object. + // * `.random`: A random alphanumeric string, without vowels, of length 5. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=1024 + Template string `json:"template,omitempty"` +} + +// WorkersClass is a collection of deployment classes. +// +kubebuilder:validation:MinProperties=1 +type WorkersClass struct { + // machineDeployments is a list of machine deployment classes that can be used to create + // a set of worker nodes. + // +optional + // +listType=map + // +listMapKey=class + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=100 + MachineDeployments []MachineDeploymentClass `json:"machineDeployments,omitempty"` + + // machinePools is a list of machine pool classes that can be used to create + // a set of worker nodes. + // +optional + // +listType=map + // +listMapKey=class + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=100 + MachinePools []MachinePoolClass `json:"machinePools,omitempty"` +} + +// MachineDeploymentClass serves as a template to define a set of worker nodes of the cluster +// provisioned using the `ClusterClass`. +type MachineDeploymentClass struct { + // metadata is the metadata applied to the MachineDeployment and the machines of the MachineDeployment. + // At runtime this metadata is merged with the corresponding metadata from the topology. + // +optional + Metadata ObjectMeta `json:"metadata,omitempty,omitzero"` + + // 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. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + Class string `json:"class,omitempty"` + + // bootstrap contains the bootstrap template reference to be used + // for the creation of worker Machines. + // +required + Bootstrap MachineDeploymentClassBootstrapTemplate `json:"bootstrap,omitempty,omitzero"` + + // infrastructure contains the infrastructure template reference to be used + // for the creation of worker Machines. + // +required + Infrastructure MachineDeploymentClassInfrastructureTemplate `json:"infrastructure,omitempty,omitzero"` + + // healthCheck defines a MachineHealthCheck for this MachineDeploymentClass. + // +optional + HealthCheck MachineDeploymentClassHealthCheck `json:"healthCheck,omitempty,omitzero"` + + // failureDomain is the failure domain the machines will be created in. + // Must match the name of a FailureDomain from the Cluster status. + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + FailureDomain string `json:"failureDomain,omitempty"` + + // naming allows changing the naming pattern used when creating the MachineDeployment. + // +optional + Naming MachineDeploymentClassNamingSpec `json:"naming,omitempty,omitzero"` + + // deletion contains configuration options for Machine deletion. + // +optional + Deletion MachineDeploymentClassMachineDeletionSpec `json:"deletion,omitempty,omitzero"` + + // 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) + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass. + // +optional + // +kubebuilder:validation:Minimum=0 + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` + + // readinessGates specifies additional conditions to include when evaluating Machine Ready condition. + // + // This field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready + // computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine. + // + // NOTE: If a Cluster defines a custom list of readinessGates for a MachineDeployment using this MachineDeploymentClass, + // such list overrides readinessGates defined in this field. + // +optional + // +listType=map + // +listMapKey=conditionType + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=32 + ReadinessGates []MachineReadinessGate `json:"readinessGates,omitempty"` + + // rollout allows you to configure the behaviour of rolling updates to the MachineDeployment Machines. + // It allows you to define the strategy used during rolling replacements. + // +optional + Rollout MachineDeploymentClassRolloutSpec `json:"rollout,omitempty,omitzero"` +} + +// MachineDeploymentClassHealthCheck defines a MachineHealthCheck for MachineDeployment machines. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentClassHealthCheck struct { + // checks are the checks that are used to evaluate if a Machine is healthy. + // + // Independent of this configuration the MachineHealthCheck controller will always + // flag Machines with `cluster.x-k8s.io/remediate-machine` annotation and + // Machines with deleted Nodes as unhealthy. + // + // Furthermore, if checks.nodeStartupTimeoutSeconds is not set it + // is defaulted to 10 minutes and evaluated accordingly. + // + // +optional + Checks MachineDeploymentClassHealthCheckChecks `json:"checks,omitempty,omitzero"` + + // remediation configures if and how remediations are triggered if a Machine is unhealthy. + // + // If remediation or remediation.triggerIf is not set, + // remediation will always be triggered for unhealthy Machines. + // + // If remediation or remediation.templateRef is not set, + // the OwnerRemediated condition will be set on unhealthy Machines to trigger remediation via + // the owner of the Machines, for example a MachineSet or a KubeadmControlPlane. + // + // +optional + Remediation MachineDeploymentClassHealthCheckRemediation `json:"remediation,omitempty,omitzero"` +} + +// IsDefined returns true if one of checks and remediation are not zero. +func (m *MachineDeploymentClassHealthCheck) IsDefined() bool { + return !reflect.ValueOf(m.Checks).IsZero() || !reflect.ValueOf(m.Remediation).IsZero() +} + +// MachineDeploymentClassHealthCheckChecks are the checks that are used to evaluate if a MachineDeployment Machine is healthy. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentClassHealthCheckChecks struct { + // nodeStartupTimeoutSeconds allows to set the maximum time for MachineHealthCheck + // to consider a Machine unhealthy if a corresponding Node isn't associated + // through a `Spec.ProviderID` field. + // + // The duration set in this field is compared to the greatest of: + // - Cluster's infrastructure ready condition timestamp (if and when available) + // - Control Plane's initialized condition timestamp (if and when available) + // - Machine's infrastructure ready condition timestamp (if and when available) + // - Machine's metadata creation timestamp + // + // Defaults to 10 minutes. + // If you wish to disable this feature, set the value explicitly to 0. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeStartupTimeoutSeconds *int32 `json:"nodeStartupTimeoutSeconds,omitempty"` + + // unhealthyNodeConditions contains a list of 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. + // + // +optional + // +listType=atomic + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=100 + UnhealthyNodeConditions []UnhealthyNodeCondition `json:"unhealthyNodeConditions,omitempty"` +} + +// MachineDeploymentClassHealthCheckRemediation configures if and how remediations are triggered if a MachineDeployment Machine is unhealthy. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentClassHealthCheckRemediation struct { + // maxInFlight determines how many in flight remediations should happen at the same time. + // + // Remediation only happens on the MachineSet with the most current revision, while + // older MachineSets (usually present during rollout operations) aren't allowed to remediate. + // + // Note: In general (independent of remediations), unhealthy machines are always + // prioritized during scale down operations over healthy ones. + // + // MaxInFlight can be set to a fixed number or a percentage. + // Example: when this is set to 20%, the MachineSet controller deletes at most 20% of + // the desired replicas. + // + // If not set, remediation is limited to all machines (bounded by replicas) + // under the active MachineSet's management. + // + // +optional + MaxInFlight *intstr.IntOrString `json:"maxInFlight,omitempty"` + + // triggerIf configures if remediations are triggered. + // If this field is not set, remediations are always triggered. + // +optional + TriggerIf MachineDeploymentClassHealthCheckRemediationTriggerIf `json:"triggerIf,omitempty,omitzero"` + + // templateRef 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 + TemplateRef MachineHealthCheckRemediationTemplateReference `json:"templateRef,omitempty,omitzero"` +} + +// MachineDeploymentClassHealthCheckRemediationTriggerIf configures if remediations are triggered. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentClassHealthCheckRemediationTriggerIf struct { + // unhealthyLessThanOrEqualTo specifies that remediations are only triggered if the number of + // unhealthy Machines is less than or equal to the configured value. + // unhealthyInRange takes precedence if set. + // + // +optional + UnhealthyLessThanOrEqualTo *intstr.IntOrString `json:"unhealthyLessThanOrEqualTo,omitempty"` + + // unhealthyInRange specifies that remediations are only triggered if the number of + // unhealthy Machines is in the configured range. + // Takes precedence over unhealthyLessThanOrEqualTo. + // 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]+\]$ + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=32 + UnhealthyInRange string `json:"unhealthyInRange,omitempty"` +} + +// MachineDeploymentClassMachineDeletionSpec contains configuration options for Machine deletion. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentClassMachineDeletionSpec struct { + // order defines the order in which Machines are deleted when downscaling. + // Defaults to "Random". Valid values are "Random, "Newest", "Oldest" + // +optional + Order MachineSetDeletionOrder `json:"order,omitempty"` + + // nodeDrainTimeoutSeconds 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: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeDrainTimeoutSeconds *int32 `json:"nodeDrainTimeoutSeconds,omitempty"` + + // nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes + // to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeVolumeDetachTimeoutSeconds *int32 `json:"nodeVolumeDetachTimeoutSeconds,omitempty"` + + // nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine + // hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely. + // Defaults to 10 seconds. + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeDeletionTimeoutSeconds *int32 `json:"nodeDeletionTimeoutSeconds,omitempty"` +} + +// MachineDeploymentClassNamingSpec defines the naming strategy for machine deployment objects. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentClassNamingSpec struct { + // template defines the template to use for generating the name of the MachineDeployment object. + // If not defined, it will fallback to `{{ .cluster.name }}-{{ .machineDeployment.topologyName }}-{{ .random }}`. + // If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will + // get concatenated with a random suffix of length 5. + // The templating mechanism provides the following arguments: + // * `.cluster.name`: The name of the cluster object. + // * `.random`: A random alphanumeric string, without vowels, of length 5. + // * `.machineDeployment.topologyName`: The name of the MachineDeployment topology (Cluster.spec.topology.workers.machineDeployments[].name). + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=1024 + Template string `json:"template,omitempty"` +} + +// MachineDeploymentClassRolloutSpec defines the rollout behavior. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentClassRolloutSpec struct { + // strategy specifies how to roll out control plane Machines. + // +optional + Strategy MachineDeploymentClassRolloutStrategy `json:"strategy,omitempty,omitzero"` +} + +// MachineDeploymentClassRolloutStrategy describes how to replace existing machines +// with new ones. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentClassRolloutStrategy struct { + // type of rollout. Allowed values are RollingUpdate and OnDelete. + // Default is RollingUpdate. + // +required + Type MachineDeploymentRolloutStrategyType `json:"type,omitempty"` + + // rollingUpdate is the rolling update config params. Present only if + // type = RollingUpdate. + // +optional + RollingUpdate MachineDeploymentClassRolloutStrategyRollingUpdate `json:"rollingUpdate,omitempty,omitzero"` +} + +// MachineDeploymentClassRolloutStrategyRollingUpdate is used to control the desired behavior of rolling update. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentClassRolloutStrategyRollingUpdate struct { + // maxUnavailable is 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"` + + // maxSurge is 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"` +} + +// MachinePoolClass serves as a template to define a pool of worker nodes of the cluster +// provisioned using `ClusterClass`. +type MachinePoolClass struct { + // metadata is the metadata applied to the MachinePool. + // At runtime this metadata is merged with the corresponding metadata from the topology. + // +optional + Metadata ObjectMeta `json:"metadata,omitempty,omitzero"` + + // class denotes a type of machine pool present in the cluster, + // this name MUST be unique within a ClusterClass and can be referenced + // in the Cluster to create a managed MachinePool. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + Class string `json:"class,omitempty"` + + // bootstrap contains the bootstrap template reference to be used + // for the creation of the Machines in the MachinePool. + // +required + Bootstrap MachinePoolClassBootstrapTemplate `json:"bootstrap,omitempty,omitzero"` + + // infrastructure contains the infrastructure template reference to be used + // for the creation of the MachinePool. + // +required + Infrastructure MachinePoolClassInfrastructureTemplate `json:"infrastructure,omitempty,omitzero"` + + // failureDomains is the list of failure domains the MachinePool should be attached to. + // Must match a key in the FailureDomains map stored on the cluster object. + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass. + // +optional + // +listType=atomic + // +kubebuilder:validation:MaxItems=100 + // +kubebuilder:validation:items:MinLength=1 + // +kubebuilder:validation:items:MaxLength=256 + FailureDomains []string `json:"failureDomains,omitempty"` + + // naming allows changing the naming pattern used when creating the MachinePool. + // +optional + Naming MachinePoolClassNamingSpec `json:"naming,omitempty,omitzero"` + + // deletion contains configuration options for Machine deletion. + // +optional + Deletion MachinePoolClassMachineDeletionSpec `json:"deletion,omitempty,omitzero"` + + // minReadySeconds is the minimum number of seconds for which a newly created machine pool should + // be ready. + // Defaults to 0 (machine will be considered available as soon as it + // is ready) + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass. + // +optional + // +kubebuilder:validation:Minimum=0 + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` +} + +// MachinePoolClassMachineDeletionSpec contains configuration options for Machine deletion. +// +kubebuilder:validation:MinProperties=1 +type MachinePoolClassMachineDeletionSpec struct { + // nodeDrainTimeoutSeconds 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: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeDrainTimeoutSeconds *int32 `json:"nodeDrainTimeoutSeconds,omitempty"` + + // nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes + // to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeVolumeDetachTimeoutSeconds *int32 `json:"nodeVolumeDetachTimeoutSeconds,omitempty"` + + // nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine + // hosts after the Machine Pool is marked for deletion. A duration of 0 will retry deletion indefinitely. + // Defaults to 10 seconds. + // NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeDeletionTimeoutSeconds *int32 `json:"nodeDeletionTimeoutSeconds,omitempty"` +} + +// MachinePoolClassNamingSpec defines the naming strategy for MachinePool objects. +// +kubebuilder:validation:MinProperties=1 +type MachinePoolClassNamingSpec struct { + // template defines the template to use for generating the name of the MachinePool object. + // If not defined, it will fallback to `{{ .cluster.name }}-{{ .machinePool.topologyName }}-{{ .random }}`. + // If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will + // get concatenated with a random suffix of length 5. + // The templating mechanism provides the following arguments: + // * `.cluster.name`: The name of the cluster object. + // * `.random`: A random alphanumeric string, without vowels, of length 5. + // * `.machinePool.topologyName`: The name of the MachinePool topology (Cluster.spec.topology.workers.machinePools[].name). + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=1024 + Template string `json:"template,omitempty"` +} + +// ClusterClassVariable defines a variable which can +// be configured in the Cluster topology and used in patches. +type ClusterClassVariable struct { + // name of the variable. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + Name string `json:"name,omitempty"` + + // required specifies if the variable is required. + // Note: this applies to the variable as a whole and thus the + // top-level object defined in the schema. If nested fields are + // required, this will be specified inside the schema. + // +required + Required *bool `json:"required,omitempty"` + + // deprecatedV1Beta1Metadata is the metadata of a variable. + // It can be used to add additional data for higher level tools to + // a ClusterClassVariable. + // + // Deprecated: This field is deprecated and will be removed when support for v1beta1 will be dropped. Please use XMetadata in JSONSchemaProps instead. + // + // +optional + DeprecatedV1Beta1Metadata ClusterClassVariableMetadata `json:"deprecatedV1Beta1Metadata,omitempty,omitzero"` + + // schema defines the schema of the variable. + // +required + Schema VariableSchema `json:"schema,omitempty,omitzero"` +} + +// ClusterClassVariableMetadata is the metadata of a variable. +// It can be used to add additional data for higher level tools to +// a ClusterClassVariable. +// +// Deprecated: This struct is deprecated and is going to be removed in the next apiVersion. +// +kubebuilder:validation:MinProperties=1 +type ClusterClassVariableMetadata struct { + // labels is a map of string keys and values that can be used to organize and categorize + // (scope and select) variables. + // +optional + Labels map[string]string `json:"labels,omitempty"` + + // annotations is an unstructured key value map that can be used to store and + // retrieve arbitrary metadata. + // They are not queryable. + // +optional + Annotations map[string]string `json:"annotations,omitempty"` +} + +// VariableSchema defines the schema of a variable. +type VariableSchema struct { + // openAPIV3Schema defines the schema of a variable via OpenAPI v3 + // schema. The schema is a subset of the schema used in + // Kubernetes CRDs. + // +required + OpenAPIV3Schema JSONSchemaProps `json:"openAPIV3Schema,omitempty,omitzero"` +} + +// Adapted from https://github.com/kubernetes/apiextensions-apiserver/blob/v0.28.5/pkg/apis/apiextensions/v1/types_jsonschema.go#L40 + +// JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/). +// This struct has been initially copied from apiextensionsv1.JSONSchemaProps, but all fields +// which are not supported in CAPI have been removed. +// +kubebuilder:validation:MinProperties=1 +type JSONSchemaProps struct { + // description is a human-readable description of this variable. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=4096 + Description string `json:"description,omitempty"` + + // example is an example for this variable. + // +optional + Example *apiextensionsv1.JSON `json:"example,omitempty"` + + // type is the type of the variable. + // Valid values are: object, array, string, integer, number or boolean. + // +optional + // +kubebuilder:validation:Enum=object;array;string;integer;number;boolean + Type string `json:"type,omitempty"` + + // properties specifies fields of an object. + // NOTE: Can only be set if type is object. + // NOTE: Properties is mutually exclusive with AdditionalProperties. + // NOTE: This field uses PreserveUnknownFields and Schemaless, + // because recursive validation is not possible. + // +optional + // +kubebuilder:pruning:PreserveUnknownFields + // +kubebuilder:validation:Schemaless + Properties map[string]JSONSchemaProps `json:"properties,omitempty"` + + // additionalProperties specifies the schema of values in a map (keys are always strings). + // NOTE: Can only be set if type is object. + // NOTE: AdditionalProperties is mutually exclusive with Properties. + // NOTE: This field uses PreserveUnknownFields and Schemaless, + // because recursive validation is not possible. + // +optional + // +kubebuilder:pruning:PreserveUnknownFields + // +kubebuilder:validation:Schemaless + AdditionalProperties *JSONSchemaProps `json:"additionalProperties,omitempty"` + + // maxProperties is the maximum amount of entries in a map or properties in an object. + // NOTE: Can only be set if type is object. + // +optional + MaxProperties *int64 `json:"maxProperties,omitempty"` + + // minProperties is the minimum amount of entries in a map or properties in an object. + // NOTE: Can only be set if type is object. + // +optional + MinProperties *int64 `json:"minProperties,omitempty"` + + // required specifies which fields of an object are required. + // NOTE: Can only be set if type is object. + // +optional + // +listType=atomic + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=1000 + // +kubebuilder:validation:items:MinLength=1 + // +kubebuilder:validation:items:MaxLength=256 + Required []string `json:"required,omitempty"` + + // items specifies fields of an array. + // NOTE: Can only be set if type is array. + // NOTE: This field uses PreserveUnknownFields and Schemaless, + // because recursive validation is not possible. + // +optional + // +kubebuilder:pruning:PreserveUnknownFields + // +kubebuilder:validation:Schemaless + Items *JSONSchemaProps `json:"items,omitempty"` + + // maxItems is the max length of an array variable. + // NOTE: Can only be set if type is array. + // +optional + MaxItems *int64 `json:"maxItems,omitempty"` + + // minItems is the min length of an array variable. + // NOTE: Can only be set if type is array. + // +optional + MinItems *int64 `json:"minItems,omitempty"` + + // uniqueItems specifies if items in an array must be unique. + // NOTE: Can only be set if type is array. + // +optional + UniqueItems *bool `json:"uniqueItems,omitempty"` + + // format is an OpenAPI v3 format string. Unknown formats are ignored. + // For a list of supported formats please see: (of the k8s.io/apiextensions-apiserver version we're currently using) + // https://github.com/kubernetes/apiextensions-apiserver/blob/master/pkg/apiserver/validation/formats.go + // NOTE: Can only be set if type is string. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=32 + Format string `json:"format,omitempty"` + + // maxLength is the max length of a string variable. + // NOTE: Can only be set if type is string. + // +optional + MaxLength *int64 `json:"maxLength,omitempty"` + + // minLength is the min length of a string variable. + // NOTE: Can only be set if type is string. + // +optional + MinLength *int64 `json:"minLength,omitempty"` + + // pattern is the regex which a string variable must match. + // NOTE: Can only be set if type is string. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=512 + Pattern string `json:"pattern,omitempty"` + + // maximum is the maximum of an integer or number variable. + // If ExclusiveMaximum is false, the variable is valid if it is lower than, or equal to, the value of Maximum. + // If ExclusiveMaximum is true, the variable is valid if it is strictly lower than the value of Maximum. + // NOTE: Can only be set if type is integer or number. + // +optional + Maximum *int64 `json:"maximum,omitempty"` + + // exclusiveMaximum specifies if the Maximum is exclusive. + // NOTE: Can only be set if type is integer or number. + // +optional + ExclusiveMaximum *bool `json:"exclusiveMaximum,omitempty"` + + // minimum is the minimum of an integer or number variable. + // If ExclusiveMinimum is false, the variable is valid if it is greater than, or equal to, the value of Minimum. + // If ExclusiveMinimum is true, the variable is valid if it is strictly greater than the value of Minimum. + // NOTE: Can only be set if type is integer or number. + // +optional + Minimum *int64 `json:"minimum,omitempty"` + + // exclusiveMinimum specifies if the Minimum is exclusive. + // NOTE: Can only be set if type is integer or number. + // +optional + ExclusiveMinimum *bool `json:"exclusiveMinimum,omitempty"` + + // x-kubernetes-preserve-unknown-fields allows setting fields in a variable object + // which are not defined in the variable schema. This affects fields recursively, + // except if nested properties or additionalProperties are specified in the schema. + // +optional + XPreserveUnknownFields *bool `json:"x-kubernetes-preserve-unknown-fields,omitempty"` + + // enum is the list of valid values of the variable. + // NOTE: Can be set for all types. + // +optional + // +listType=atomic + // +kubebuilder:validation:MaxItems=100 + Enum []apiextensionsv1.JSON `json:"enum,omitempty"` + + // default is the default value of the variable. + // NOTE: Can be set for all types. + // +optional + Default *apiextensionsv1.JSON `json:"default,omitempty"` + + // x-kubernetes-validations describes a list of validation rules written in the CEL expression language. + // +optional + // +listType=map + // +listMapKey=rule + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=100 + XValidations []ValidationRule `json:"x-kubernetes-validations,omitempty"` + + // x-metadata is the metadata of a variable or a nested field within a variable. + // It can be used to add additional data for higher level tools. + // +optional + XMetadata VariableSchemaMetadata `json:"x-metadata,omitempty,omitzero"` + + // x-kubernetes-int-or-string specifies that this value is + // either an integer or a string. If this is true, an empty + // type is allowed and type as child of anyOf is permitted + // if following one of the following patterns: + // + // 1) anyOf: + // - type: integer + // - type: string + // 2) allOf: + // - anyOf: + // - type: integer + // - type: string + // - ... zero or more + // +optional + XIntOrString *bool `json:"x-kubernetes-int-or-string,omitempty"` + + // allOf specifies that the variable must validate against all of the subschemas in the array. + // NOTE: This field uses PreserveUnknownFields and Schemaless, + // because recursive validation is not possible. + // +optional + // +kubebuilder:pruning:PreserveUnknownFields + // +kubebuilder:validation:Schemaless + AllOf []JSONSchemaProps `json:"allOf,omitempty"` + + // oneOf specifies that the variable must validate against exactly one of the subschemas in the array. + // NOTE: This field uses PreserveUnknownFields and Schemaless, + // because recursive validation is not possible. + // +optional + // +kubebuilder:pruning:PreserveUnknownFields + // +kubebuilder:validation:Schemaless + OneOf []JSONSchemaProps `json:"oneOf,omitempty"` + + // anyOf specifies that the variable must validate against one or more of the subschemas in the array. + // NOTE: This field uses PreserveUnknownFields and Schemaless, + // because recursive validation is not possible. + // +optional + // +kubebuilder:pruning:PreserveUnknownFields + // +kubebuilder:validation:Schemaless + AnyOf []JSONSchemaProps `json:"anyOf,omitempty"` + + // not specifies that the variable must not validate against the subschema. + // NOTE: This field uses PreserveUnknownFields and Schemaless, + // because recursive validation is not possible. + // +optional + // +kubebuilder:pruning:PreserveUnknownFields + // +kubebuilder:validation:Schemaless + Not *JSONSchemaProps `json:"not,omitempty"` +} + +// VariableSchemaMetadata is the metadata of a variable or a nested field within a variable. +// It can be used to add additional data for higher level tools. +// +kubebuilder:validation:MinProperties=1 +type VariableSchemaMetadata struct { + // labels is a map of string keys and values that can be used to organize and categorize + // (scope and select) variables. + // +optional + Labels map[string]string `json:"labels,omitempty"` + + // annotations is an unstructured key value map that can be used to store and + // retrieve arbitrary metadata. + // They are not queryable. + // +optional + Annotations map[string]string `json:"annotations,omitempty"` +} + +// ValidationRule describes a validation rule written in the CEL expression language. +type ValidationRule struct { + // rule represents the expression which will be evaluated by CEL. + // ref: https://github.com/google/cel-spec + // The Rule is scoped to the location of the x-kubernetes-validations extension in the schema. + // The `self` variable in the CEL expression is bound to the scoped value. + // If the Rule is scoped to an object with properties, the accessible properties of the object are field selectable + // via `self.field` and field presence can be checked via `has(self.field)`. + // If the Rule is scoped to an object with additionalProperties (i.e. a map) the value of the map + // are accessible via `self[mapKey]`, map containment can be checked via `mapKey in self` and all entries of the map + // are accessible via CEL macros and functions such as `self.all(...)`. + // If the Rule is scoped to an array, the elements of the array are accessible via `self[i]` and also by macros and + // functions. + // If the Rule is scoped to a scalar, `self` is bound to the scalar value. + // Examples: + // - Rule scoped to a map of objects: {"rule": "self.components['Widget'].priority < 10"} + // - Rule scoped to a list of integers: {"rule": "self.values.all(value, value >= 0 && value < 100)"} + // - Rule scoped to a string value: {"rule": "self.startsWith('kube')"} + // + // Unknown data preserved in custom resources via x-kubernetes-preserve-unknown-fields is not accessible in CEL + // expressions. This includes: + // - Unknown field values that are preserved by object schemas with x-kubernetes-preserve-unknown-fields. + // - Object properties where the property schema is of an "unknown type". An "unknown type" is recursively defined as: + // - A schema with no type and x-kubernetes-preserve-unknown-fields set to true + // - An array where the items schema is of an "unknown type" + // - An object where the additionalProperties schema is of an "unknown type" + // + // Only property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. + // Accessible property names are escaped according to the following rules when accessed in the expression: + // - '__' escapes to '__underscores__' + // - '.' escapes to '__dot__' + // - '-' escapes to '__dash__' + // - '/' escapes to '__slash__' + // - Property names that exactly match a CEL RESERVED keyword escape to '__{keyword}__'. The keywords are: + // "true", "false", "null", "in", "as", "break", "const", "continue", "else", "for", "function", "if", + // "import", "let", "loop", "package", "namespace", "return". + // Examples: + // - Rule accessing a property named "namespace": {"rule": "self.__namespace__ > 0"} + // - Rule accessing a property named "x-prop": {"rule": "self.x__dash__prop > 0"} + // - Rule accessing a property named "redact__d": {"rule": "self.redact__underscores__d > 0"} + // + // + // If `rule` makes use of the `oldSelf` variable it is implicitly a + // `transition rule`. + // + // By default, the `oldSelf` variable is the same type as `self`. + // + // Transition rules by default are applied only on UPDATE requests and are + // skipped if an old value could not be found. + // + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=4096 + Rule string `json:"rule,omitempty"` + // message represents the message displayed when validation fails. The message is required if the Rule contains + // line breaks. The message must not contain line breaks. + // If unset, the message is "failed rule: {Rule}". + // e.g. "must be a URL with the host matching spec.host" + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=512 + Message string `json:"message,omitempty"` + // messageExpression declares a CEL expression that evaluates to the validation failure message that is returned when this rule fails. + // Since messageExpression is used as a failure message, it must evaluate to a string. + // If both message and messageExpression are present on a rule, then messageExpression will be used if validation + // fails. If messageExpression results in a runtime error, the validation failure message is produced + // as if the messageExpression field were unset. If messageExpression evaluates to an empty string, a string with only spaces, or a string + // that contains line breaks, then the validation failure message will also be produced as if the messageExpression field were unset. + // messageExpression has access to all the same variables as the rule; the only difference is the return type. + // Example: + // "x must be less than max ("+string(self.max)+")" + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=1024 + MessageExpression string `json:"messageExpression,omitempty"` + // reason provides a machine-readable validation failure reason that is returned to the caller when a request fails this validation rule. + // The currently supported reasons are: "FieldValueInvalid", "FieldValueForbidden", "FieldValueRequired", "FieldValueDuplicate". + // If not set, default to use "FieldValueInvalid". + // All future added reasons must be accepted by clients when reading this value and unknown reasons should be treated as FieldValueInvalid. + // +optional + // +kubebuilder:validation:Enum=FieldValueInvalid;FieldValueForbidden;FieldValueRequired;FieldValueDuplicate + // +kubebuilder:default=FieldValueInvalid + // +default=ref(sigs.k8s.io/cluster-api/api/core/v1beta2.FieldValueInvalid) + Reason FieldValueErrorReason `json:"reason,omitempty"` + // fieldPath represents the field path returned when the validation fails. + // It must be a relative JSON path (i.e. with array notation) scoped to the location of this x-kubernetes-validations extension in the schema and refer to an existing field. + // e.g. when validation checks if a specific attribute `foo` under a map `testMap`, the fieldPath could be set to `.testMap.foo` + // If the validation checks two lists must have unique attributes, the fieldPath could be set to either of the list: e.g. `.testList` + // It does not support list numeric index. + // It supports child operation to refer to an existing field currently. Refer to [JSONPath support in Kubernetes](https://kubernetes.io/docs/reference/kubectl/jsonpath/) for more info. + // Numeric index of array is not supported. + // For field name which contains special characters, use `['specialName']` to refer the field name. + // e.g. for attribute `foo.34$` appears in a list `testList`, the fieldPath could be set to `.testList['foo.34$']` + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=512 + FieldPath string `json:"fieldPath,omitempty"` +} + +// FieldValueErrorReason is a machine-readable value providing more detail about why a field failed the validation. +type FieldValueErrorReason string + +const ( + // FieldValueRequired is used to report required values that are not + // provided (e.g. empty strings, null values, or empty arrays). + FieldValueRequired FieldValueErrorReason = "FieldValueRequired" + // FieldValueDuplicate is used to report collisions of values that must be + // unique (e.g. unique IDs). + FieldValueDuplicate FieldValueErrorReason = "FieldValueDuplicate" + // FieldValueInvalid is used to report malformed values (e.g. failed regex + // match, too long, out of bounds). + FieldValueInvalid FieldValueErrorReason = "FieldValueInvalid" + // FieldValueForbidden is used to report valid (as per formatting rules) + // values which would be accepted under some conditions, but which are not + // permitted by the current conditions (such as security policy). + FieldValueForbidden FieldValueErrorReason = "FieldValueForbidden" +) + +// ClusterClassPatch defines a patch which is applied to customize the referenced templates. +type ClusterClassPatch struct { + // name of the patch. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + Name string `json:"name,omitempty"` + + // description is a human-readable description of this patch. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=1024 + Description string `json:"description,omitempty"` + + // enabledIf is a Go template to be used to calculate if a patch should be enabled. + // It can reference variables defined in .spec.variables and builtin variables. + // The patch will be enabled if the template evaluates to `true`, otherwise it will + // be disabled. + // If EnabledIf is not set, the patch will be enabled per default. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + EnabledIf string `json:"enabledIf,omitempty"` + + // definitions define inline patches. + // Note: Patches will be applied in the order of the array. + // Note: Exactly one of Definitions or External must be set. + // +optional + // +listType=atomic + // +kubebuilder:validation:MaxItems=100 + Definitions []PatchDefinition `json:"definitions,omitempty"` + + // external defines an external patch. + // Note: Exactly one of Definitions or External must be set. + // +optional + External *ExternalPatchDefinition `json:"external,omitempty"` +} + +// PatchDefinition defines a patch which is applied to customize the referenced templates. +type PatchDefinition struct { + // selector defines on which templates the patch should be applied. + // +required + Selector PatchSelector `json:"selector,omitempty,omitzero"` + + // jsonPatches defines the patches which should be applied on the templates + // matching the selector. + // Note: Patches will be applied in the order of the array. + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=100 + // +required + // +listType=atomic + JSONPatches []JSONPatch `json:"jsonPatches,omitempty"` +} + +// PatchSelector defines on which templates the patch should be applied. +// Note: Matching on APIVersion and Kind is mandatory, to enforce that the patches are +// written for the correct version. The version of the references in the ClusterClass may +// be automatically updated during reconciliation if there is a newer version for the same contract. +// Note: The results of selection based on the individual fields are ANDed. +type PatchSelector struct { + // apiVersion filters templates by apiVersion. + // apiVersion must be fully qualified domain name followed by / and a version. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=317 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[a-z]([-a-z0-9]*[a-z0-9])?$` + APIVersion string `json:"apiVersion,omitempty"` + + // kind filters templates by kind. + // kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:Pattern=`^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$` + Kind string `json:"kind,omitempty"` + + // matchResources selects templates based on where they are referenced. + // +required + MatchResources PatchSelectorMatch `json:"matchResources,omitempty,omitzero"` +} + +// PatchSelectorMatch selects templates based on where they are referenced. +// Note: The selector must match at least one template. +// Note: The results of selection based on the individual fields are ORed. +// +kubebuilder:validation:MinProperties=1 +type PatchSelectorMatch struct { + // controlPlane selects templates referenced in .spec.ControlPlane. + // Note: this will match the controlPlane and also the controlPlane + // machineInfrastructure (depending on the kind and apiVersion). + // +optional + ControlPlane *bool `json:"controlPlane,omitempty"` + + // infrastructureCluster selects templates referenced in .spec.infrastructure. + // +optional + InfrastructureCluster *bool `json:"infrastructureCluster,omitempty"` + + // machineDeploymentClass selects templates referenced in specific MachineDeploymentClasses in + // .spec.workers.machineDeployments. + // +optional + MachineDeploymentClass *PatchSelectorMatchMachineDeploymentClass `json:"machineDeploymentClass,omitempty"` + + // machinePoolClass selects templates referenced in specific MachinePoolClasses in + // .spec.workers.machinePools. + // +optional + MachinePoolClass *PatchSelectorMatchMachinePoolClass `json:"machinePoolClass,omitempty"` +} + +// PatchSelectorMatchMachineDeploymentClass selects templates referenced +// in specific MachineDeploymentClasses in .spec.workers.machineDeployments. +type PatchSelectorMatchMachineDeploymentClass struct { + // names selects templates by class names. + // +optional + // +listType=atomic + // +kubebuilder:validation:MaxItems=100 + // +kubebuilder:validation:items:MinLength=1 + // +kubebuilder:validation:items:MaxLength=256 + Names []string `json:"names,omitempty"` +} + +// PatchSelectorMatchMachinePoolClass selects templates referenced +// in specific MachinePoolClasses in .spec.workers.machinePools. +type PatchSelectorMatchMachinePoolClass struct { + // names selects templates by class names. + // +optional + // +listType=atomic + // +kubebuilder:validation:MaxItems=100 + // +kubebuilder:validation:items:MinLength=1 + // +kubebuilder:validation:items:MaxLength=256 + Names []string `json:"names,omitempty"` +} + +// JSONPatch defines a JSON patch. +type JSONPatch struct { + // op defines the operation of the patch. + // Note: Only `add`, `replace` and `remove` are supported. + // +required + // +kubebuilder:validation:Enum=add;replace;remove + Op string `json:"op,omitempty"` + + // path defines the path of the patch. + // Note: Only the spec of a template can be patched, thus the path has to start with /spec/. + // Note: For now the only allowed array modifications are `append` and `prepend`, i.e.: + // * for op: `add`: only index 0 (prepend) and - (append) are allowed + // * for op: `replace` or `remove`: no indexes are allowed + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=512 + Path string `json:"path,omitempty"` + + // value defines the value of the patch. + // Note: Either Value or ValueFrom is required for add and replace + // operations. Only one of them is allowed to be set at the same time. + // Note: We have to use apiextensionsv1.JSON instead of our JSON type, + // because controller-tools has a hard-coded schema for apiextensionsv1.JSON + // which cannot be produced by another type (unset type field). + // Ref: https://github.com/kubernetes-sigs/controller-tools/blob/d0e03a142d0ecdd5491593e941ee1d6b5d91dba6/pkg/crd/known_types.go#L106-L111 + // +optional + Value *apiextensionsv1.JSON `json:"value,omitempty"` + + // valueFrom defines the value of the patch. + // Note: Either Value or ValueFrom is required for add and replace + // operations. Only one of them is allowed to be set at the same time. + // +optional + ValueFrom *JSONPatchValue `json:"valueFrom,omitempty"` +} + +// JSONPatchValue defines the value of a patch. +// Note: Only one of the fields is allowed to be set at the same time. +type JSONPatchValue struct { + // variable is the variable to be used as value. + // Variable can be one of the variables defined in .spec.variables or a builtin variable. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + Variable string `json:"variable,omitempty"` + + // template is the Go template to be used to calculate the value. + // A template can reference variables defined in .spec.variables and builtin variables. + // Note: The template must evaluate to a valid YAML or JSON value. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=10240 + Template string `json:"template,omitempty"` +} + +// ExternalPatchDefinition defines an external patch. +// Note: At least one of GeneratePatchesExtension or ValidateTopologyExtension must be set. +type ExternalPatchDefinition struct { + // generatePatchesExtension references an extension which is called to generate patches. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=512 + GeneratePatchesExtension string `json:"generatePatchesExtension,omitempty"` + + // validateTopologyExtension references an extension which is called to validate the topology. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=512 + ValidateTopologyExtension string `json:"validateTopologyExtension,omitempty"` + + // discoverVariablesExtension references an extension which is called to discover variables. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=512 + DiscoverVariablesExtension string `json:"discoverVariablesExtension,omitempty"` + + // settings defines key value pairs to be passed to the extensions. + // Values defined here take precedence over the values defined in the + // corresponding ExtensionConfig. + // +optional + Settings map[string]string `json:"settings,omitempty"` +} + +// ControlPlaneClassMachineInfrastructureTemplate defines the template for a MachineInfrastructure of a ControlPlane. +type ControlPlaneClassMachineInfrastructureTemplate struct { + // templateRef is a required reference to the template for a MachineInfrastructure of a ControlPlane. + // +required + TemplateRef ClusterClassTemplateReference `json:"templateRef,omitempty,omitzero"` +} + +// MachineDeploymentClassBootstrapTemplate defines the BootstrapTemplate for a MachineDeployment. +type MachineDeploymentClassBootstrapTemplate struct { + // templateRef is a required reference to the BootstrapTemplate for a MachineDeployment. + // +required + TemplateRef ClusterClassTemplateReference `json:"templateRef,omitempty,omitzero"` +} + +// MachineDeploymentClassInfrastructureTemplate defines the InfrastructureTemplate for a MachineDeployment. +type MachineDeploymentClassInfrastructureTemplate struct { + // templateRef is a required reference to the InfrastructureTemplate for a MachineDeployment. + // +required + TemplateRef ClusterClassTemplateReference `json:"templateRef,omitempty,omitzero"` +} + +// MachinePoolClassBootstrapTemplate defines the BootstrapTemplate for a MachinePool. +type MachinePoolClassBootstrapTemplate struct { + // templateRef is a required reference to the BootstrapTemplate for a MachinePool. + // +required + TemplateRef ClusterClassTemplateReference `json:"templateRef,omitempty,omitzero"` +} + +// MachinePoolClassInfrastructureTemplate defines the InfrastructureTemplate for a MachinePool. +type MachinePoolClassInfrastructureTemplate struct { + // templateRef is a required reference to the InfrastructureTemplate for a MachinePool. + // +required + TemplateRef ClusterClassTemplateReference `json:"templateRef,omitempty,omitzero"` +} + +// ClusterClassTemplateReference is a reference to a ClusterClass template. +type ClusterClassTemplateReference struct { + // kind of the template. + // kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:Pattern=`^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$` + Kind string `json:"kind,omitempty"` + + // name of the template. + // name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$` + Name string `json:"name,omitempty"` + + // apiVersion of the template. + // apiVersion must be fully qualified domain name followed by / and a version. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=317 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[a-z]([-a-z0-9]*[a-z0-9])?$` + APIVersion string `json:"apiVersion,omitempty"` +} + +// IsDefined returns true if the ClusterClassTemplateReference is set. +func (r *ClusterClassTemplateReference) IsDefined() bool { + if r == nil { + return false + } + return r.Kind != "" || r.Name != "" || r.APIVersion != "" +} + +// ToObjectReference returns an object reference for the ClusterClassTemplateReference in a given namespace. +func (r *ClusterClassTemplateReference) ToObjectReference(namespace string) *corev1.ObjectReference { + if r == nil || !r.IsDefined() { + return nil + } + return &corev1.ObjectReference{ + APIVersion: r.APIVersion, + Kind: r.Kind, + Namespace: namespace, + Name: r.Name, + } +} + +// GroupVersionKind gets the GroupVersionKind for a ClusterClassTemplateReference. +func (r *ClusterClassTemplateReference) GroupVersionKind() schema.GroupVersionKind { + return schema.FromAPIVersionAndKind(r.APIVersion, r.Kind) +} + +// ClusterClassStatus defines the observed state of the ClusterClass. +// +kubebuilder:validation:MinProperties=1 +type ClusterClassStatus struct { + // conditions represents the observations of a ClusterClass's current state. + // Known condition types are VariablesReady, RefVersionsUpToDate, Paused. + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=32 + Conditions []metav1.Condition `json:"conditions,omitempty"` + + // variables is a list of ClusterClassStatusVariable that are defined for the ClusterClass. + // +optional + // +listType=atomic + // +kubebuilder:validation:MaxItems=1000 + Variables []ClusterClassStatusVariable `json:"variables,omitempty"` + + // observedGeneration is the latest generation observed by the controller. + // +optional + // +kubebuilder:validation:Minimum=1 + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. + // +optional + Deprecated *ClusterClassDeprecatedStatus `json:"deprecated,omitempty"` +} + +// ClusterClassDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type ClusterClassDeprecatedStatus struct { + // v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. + // +optional + V1Beta1 *ClusterClassV1Beta1DeprecatedStatus `json:"v1beta1,omitempty"` +} + +// ClusterClassV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type ClusterClassV1Beta1DeprecatedStatus struct { + // conditions defines current observed state of the ClusterClass. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + Conditions Conditions `json:"conditions,omitempty"` +} + +// ClusterClassStatusVariable defines a variable which appears in the status of a ClusterClass. +type ClusterClassStatusVariable struct { + // name is the name of the variable. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + Name string `json:"name,omitempty"` + + // definitionsConflict specifies whether or not there are conflicting definitions for a single variable name. + // +optional + DefinitionsConflict *bool `json:"definitionsConflict,omitempty"` + + // definitions is a list of definitions for a variable. + // +required + // +listType=atomic + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=100 + Definitions []ClusterClassStatusVariableDefinition `json:"definitions,omitempty"` +} + +// ClusterClassStatusVariableDefinition defines a variable which appears in the status of a ClusterClass. +type ClusterClassStatusVariableDefinition struct { + // from specifies the origin of the variable definition. + // This will be `inline` for variables defined in the ClusterClass or the name of a patch defined in the ClusterClass + // for variables discovered from a DiscoverVariables runtime extensions. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + From string `json:"from,omitempty"` + + // required specifies if the variable is required. + // Note: this applies to the variable as a whole and thus the + // top-level object defined in the schema. If nested fields are + // required, this will be specified inside the schema. + // +required + Required *bool `json:"required,omitempty"` + + // deprecatedV1Beta1Metadata is the metadata of a variable. + // It can be used to add additional data for higher level tools to + // a ClusterClassVariable. + // + // Deprecated: This field is deprecated and will be removed when support for v1beta1 will be dropped. Please use XMetadata in JSONSchemaProps instead. + // + // +optional + DeprecatedV1Beta1Metadata ClusterClassVariableMetadata `json:"deprecatedV1Beta1Metadata,omitempty,omitzero"` + + // schema defines the schema of the variable. + // +required + Schema VariableSchema `json:"schema,omitempty,omitzero"` +} + +// GetV1Beta1Conditions returns the set of conditions for this object. +func (c *ClusterClass) GetV1Beta1Conditions() Conditions { + if c.Status.Deprecated == nil || c.Status.Deprecated.V1Beta1 == nil { + return nil + } + return c.Status.Deprecated.V1Beta1.Conditions +} + +// SetV1Beta1Conditions sets the conditions on this object. +func (c *ClusterClass) SetV1Beta1Conditions(conditions Conditions) { + if c.Status.Deprecated == nil { + c.Status.Deprecated = &ClusterClassDeprecatedStatus{} + } + if c.Status.Deprecated.V1Beta1 == nil { + c.Status.Deprecated.V1Beta1 = &ClusterClassV1Beta1DeprecatedStatus{} + } + c.Status.Deprecated.V1Beta1.Conditions = conditions +} + +// GetConditions returns the set of conditions for this object. +func (c *ClusterClass) GetConditions() []metav1.Condition { + return c.Status.Conditions +} + +// SetConditions sets conditions for an API object. +func (c *ClusterClass) SetConditions(conditions []metav1.Condition) { + c.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// ClusterClassList contains a list of Cluster. +type ClusterClassList struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + // items is the list of ClusterClasses. + Items []ClusterClass `json:"items"` +} + +func init() { + objectTypes = append(objectTypes, &ClusterClass{}, &ClusterClassList{}) +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/common_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/common_types.go new file mode 100644 index 0000000000..55c37a288b --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/common_types.go @@ -0,0 +1,403 @@ +/* +Copyright 2025 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 v1beta2 + +import ( + corev1 "k8s.io/api/core/v1" + apivalidation "k8s.io/apimachinery/pkg/api/validation" + metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/validation/field" +) + +const ( + // ClusterNameLabel is the label set on machines linked to a cluster and + // external objects(bootstrap and infrastructure providers). + ClusterNameLabel = "cluster.x-k8s.io/cluster-name" + + // ClusterTopologyOwnedLabel is the label set on all the object which are managed as part of a ClusterTopology. + ClusterTopologyOwnedLabel = "topology.cluster.x-k8s.io/owned" + + // ClusterTopologyMachineDeploymentNameLabel is the label set on the generated MachineDeployment objects + // to track the name of the MachineDeployment topology it represents. + ClusterTopologyMachineDeploymentNameLabel = "topology.cluster.x-k8s.io/deployment-name" + + // ClusterTopologyHoldUpgradeSequenceAnnotation can be used to hold the entire MachineDeployment upgrade sequence. + // If the annotation is set on a MachineDeployment topology in Cluster.spec.topology.workers, the Kubernetes upgrade + // for this MachineDeployment topology and all subsequent ones is deferred. + // Examples: + // - If you want to pause upgrade after CP upgrade, this annotation should be applied to the first MachineDeployment + // in the list of MachineDeployments in Cluster.spec.topology. The upgrade will not be completed until the annotation + // is removed and all MachineDeployments are upgraded. + // - If you want to pause upgrade after the 50th MachineDeployment, this annotation should be applied to the 51st + // MachineDeployment in the list. + ClusterTopologyHoldUpgradeSequenceAnnotation = "topology.cluster.x-k8s.io/hold-upgrade-sequence" + + // ClusterTopologyDeferUpgradeAnnotation can be used to defer the Kubernetes upgrade of a single MachineDeployment topology. + // If the annotation is set on a MachineDeployment topology in Cluster.spec.topology.workers, the Kubernetes upgrade + // for this MachineDeployment topology is deferred. It doesn't affect other MachineDeployment topologies. + // Example: + // - If you want to defer the upgrades of the 3rd and 5th MachineDeployments of the list, set the annotation on them. + // The upgrade process will upgrade MachineDeployment in position 1,2, (skip 3), 4, (skip 5), 6 etc. The upgrade + // will not be completed until the annotation is removed and all MachineDeployments are upgraded. + ClusterTopologyDeferUpgradeAnnotation = "topology.cluster.x-k8s.io/defer-upgrade" + + // ClusterTopologyUpgradeConcurrencyAnnotation can be set as top-level annotation on the Cluster object of + // a classy Cluster to define the maximum concurrency while upgrading MachineDeployments. + ClusterTopologyUpgradeConcurrencyAnnotation = "topology.cluster.x-k8s.io/upgrade-concurrency" + + // ClusterTopologyMachinePoolNameLabel is the label set on the generated MachinePool objects + // to track the name of the MachinePool topology it represents. + ClusterTopologyMachinePoolNameLabel = "topology.cluster.x-k8s.io/pool-name" + + // ClusterTopologyUnsafeUpdateClassNameAnnotation can be used to disable the webhook check on + // update that disallows a pre-existing Cluster to be populated with Topology information and Class. + ClusterTopologyUnsafeUpdateClassNameAnnotation = "unsafe.topology.cluster.x-k8s.io/disable-update-class-name-check" + + // ClusterTopologyUnsafeUpdateVersionAnnotation can be used to disable the webhook checks on + // update that disallows updating the .topology.spec.version on certain conditions. + ClusterTopologyUnsafeUpdateVersionAnnotation = "unsafe.topology.cluster.x-k8s.io/disable-update-version-check" + + // ProviderNameLabel 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. + ProviderNameLabel = "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" + + // LabelsFromMachineAnnotation is the annotation set on nodes to track the labels originated from machines. + LabelsFromMachineAnnotation = "cluster.x-k8s.io/labels-from-machine" + + // AnnotationsFromMachineAnnotation is the annotation set on nodes to track the annotations that originated from machines. + AnnotationsFromMachineAnnotation = "cluster.x-k8s.io/annotations-from-machine" + + // 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" + + // DisableMachineCreateAnnotation is an annotation that can be used to signal a MachineSet to stop creating new machines. + // It is utilized in the OnDelete rollout strategy to allow the MachineDeployment controller to scale down + // older MachineSets when Machines are deleted and add the new replicas to the latest MachineSet. + DisableMachineCreateAnnotation = "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" + + // RemediateMachineAnnotation request the MachineHealthCheck reconciler to mark a Machine as unhealthy. CAPI builtin remediation will prioritize Machines with the annotation to be remediated. + RemediateMachineAnnotation = "cluster.x-k8s.io/remediate-machine" + + // MachineSetSkipPreflightChecksAnnotation is the annotation used to provide a comma-separated list of + // preflight checks that should be skipped during the MachineSet reconciliation. + // Supported items are: + // - KubeadmVersion (skips the kubeadm version skew preflight check) + // - KubernetesVersion (skips the kubernetes version skew preflight check) + // - ControlPlaneStable (skips checking that the control plane is neither provisioning nor upgrading) + // - All (skips all preflight checks) + // Example: "machineset.cluster.x-k8s.io/skip-preflight-checks": "ControlPlaneStable,KubernetesVersion". + // Note: The annotation can also be set on a MachineDeployment as MachineDeployment annotations are synced to + // the MachineSet. + MachineSetSkipPreflightChecksAnnotation = "machineset.cluster.x-k8s.io/skip-preflight-checks" + + // ClusterSecretType defines the type of secret created by core components. + // Note: This is used by core CAPI, CAPBK, and KCP to determine whether a secret is created by the controllers + // themselves or supplied by the user (e.g. bring your own certificates). + 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" + + // TopologyDryRunAnnotation is an annotation that gets set on objects by the topology controller + // only during a server side dry run apply operation. It is used for validating + // update webhooks for objects which get updated by template rotation (e.g. InfrastructureMachineTemplate). + // When the annotation is set and the admission request is a dry run, the webhook should + // skip validation due to immutability. By that the request will succeed (without + // any changes to the actual object because it is a dry run) and the topology controller + // will receive the resulting object. + TopologyDryRunAnnotation = "topology.cluster.x-k8s.io/dry-run" + + // ReplicasManagedByAnnotation is an annotation that indicates external (non-Cluster API) management of infra scaling. + // The practical effect of this is that the capi "replica" count should be passively derived from the number of observed infra machines, + // instead of being a source of truth for eventual consistency. + // This annotation can be used to inform MachinePool status during in-progress scaling scenarios. + ReplicasManagedByAnnotation = "cluster.x-k8s.io/replicas-managed-by" + + // AutoscalerMinSizeAnnotation defines the minimum node group size. + // The annotation is used by autoscaler. + // The annotation is copied from kubernetes/autoscaler. + // Ref:https://github.com/kubernetes/autoscaler/blob/d8336cca37dbfa5d1cb7b7e453bd511172d6e5e7/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_utils.go#L256-L259 + // Note: With the Kubernetes autoscaler it is possible to use different annotations by configuring a different + // "Cluster API group" than "cluster.x-k8s.io" via the "CAPI_GROUP" environment variable. + // We only handle the default group in our implementation. + // Note: It can be used by setting as top level annotation on MachineDeployment and MachineSets. + AutoscalerMinSizeAnnotation = "cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size" + + // AutoscalerMaxSizeAnnotation defines the maximum node group size. + // The annotations is used by the autoscaler. + // The annotation definition is copied from kubernetes/autoscaler. + // Ref:https://github.com/kubernetes/autoscaler/blob/d8336cca37dbfa5d1cb7b7e453bd511172d6e5e7/cluster-autoscaler/cloudprovider/clusterapi/clusterapi_utils.go#L264-L267 + // Note: With the Kubernetes autoscaler it is possible to use different annotations by configuring a different + // "Cluster API group" than "cluster.x-k8s.io" via the "CAPI_GROUP" environment variable. + // We only handle the default group in our implementation. + // Note: It can be used by setting as top level annotation on MachineDeployment and MachineSets. + AutoscalerMaxSizeAnnotation = "cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size" + + // VariableDefinitionFromInline indicates a patch or variable was defined in the `.spec` of a ClusterClass + // rather than from an external patch extension. + VariableDefinitionFromInline = "inline" + + // CRDMigrationObservedGenerationAnnotation indicates on a CRD for which generation CRD migration is completed. + CRDMigrationObservedGenerationAnnotation = "crd-migration.cluster.x-k8s.io/observed-generation" + + // BeforeClusterUpgradeHookAnnotationPrefix annotation specifies the prefix we search each annotation + // for during the before-upgrade lifecycle hook to block propagating the new version to the control plane. + // This hook can be used to execute pre-upgrade add-on tasks and block upgrades of the ControlPlane and Workers. + // Note: While the upgrade is blocked changes made to the Cluster Topology will be delayed propagating to the underlying + // objects while the object is waiting for upgrade. + BeforeClusterUpgradeHookAnnotationPrefix = "before-upgrade.hook.cluster.cluster.x-k8s.io" +) + +// MachineSetPreflightCheck defines a valid MachineSet preflight check. +type MachineSetPreflightCheck string + +const ( + // MachineSetPreflightCheckAll can be used to represent all the MachineSet preflight checks. + MachineSetPreflightCheckAll MachineSetPreflightCheck = "All" + + // MachineSetPreflightCheckKubeadmVersionSkew is the name of the preflight check + // that verifies if the machine being created or remediated for the MachineSet conforms to the kubeadm version + // skew policy that requires the machine to be at the same minor version as the control plane. + // The preflight check is only run if a ControlPlane is used (controlPlaneRef must exist in the Cluster), + // the ControlPlane has a version, the MachineSet has a version and the MachineSet uses the Kubeadm bootstrap + // provider. + MachineSetPreflightCheckKubeadmVersionSkew MachineSetPreflightCheck = "KubeadmVersionSkew" + + // MachineSetPreflightCheckKubernetesVersionSkew is the name of the preflight check that verifies + // if the machines being created or remediated for the MachineSet conform to the Kubernetes version skew policy + // that requires the machines to be at a version that is not more than 2 (< v1.28) or 3 (>= v1.28) minor + // lower than the ControlPlane version. + // The preflight check is only run if a ControlPlane is used (controlPlaneRef must exist in the Cluster), + // the ControlPlane has a version and the MachineSet has a version. + MachineSetPreflightCheckKubernetesVersionSkew MachineSetPreflightCheck = "KubernetesVersionSkew" + + // MachineSetPreflightCheckControlPlaneIsStable is the name of the preflight check + // that verifies if the control plane is not provisioning and not upgrading. + // For Clusters with a managed topology it also checks if a control plane upgrade is pending. + // The preflight check is only run if a ControlPlane is used (controlPlaneRef must exist in the Cluster) + // and the ControlPlane has a version. + MachineSetPreflightCheckControlPlaneIsStable MachineSetPreflightCheck = "ControlPlaneIsStable" + + // MachineSetPreflightCheckControlPlaneVersionSkew is the name of the preflight check + // that verifies if the machine being created or remediated for the MachineSet has exactly the same version + // as the control plane. + // The idea behind this check is that it doesn't make sense to create a Machine with an old version, if we already + // know based on the control plane version that the Machine has to be replaced soon. + // The preflight check is only run if the Cluster has a managed topology, a ControlPlane is used (controlPlaneRef + // must exist in the Cluster), the ControlPlane has a version and the MachineSet has a version. + MachineSetPreflightCheckControlPlaneVersionSkew MachineSetPreflightCheck = "ControlPlaneVersionSkew" +) + +// NodeOutdatedRevisionTaint can be added to Nodes at rolling updates in general triggered by updating MachineDeployment +// This taint is used to prevent unnecessary pod churn, i.e., as the first node is drained, pods previously running on +// that node are scheduled onto nodes who have yet to be replaced, but will be torn down soon. +var NodeOutdatedRevisionTaint = corev1.Taint{ + Key: "node.cluster.x-k8s.io/outdated-revision", + Effect: corev1.TaintEffectPreferNoSchedule, +} + +// NodeUninitializedTaint can be added to Nodes at creation by the bootstrap provider, e.g. the +// KubeadmBootstrap provider will add the taint. +// This taint is used to prevent workloads to be scheduled on Nodes before the node is initialized by Cluster API. +// As of today the Node initialization consists of syncing labels from Machines to Nodes. Once the labels +// have been initially synced the taint is removed from the Node. +var NodeUninitializedTaint = corev1.Taint{ + Key: "node.cluster.x-k8s.io/uninitialized", + Effect: corev1.TaintEffectNoSchedule, +} + +const ( + // TemplateSuffix is the object kind suffix used by template types. + TemplateSuffix = "Template" +) + +// MachineAddressType describes a valid MachineAddress type. +// +kubebuilder:validation:Enum=Hostname;ExternalIP;InternalIP;ExternalDNS;InternalDNS +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 { + // type is the machine address type, one of Hostname, ExternalIP, InternalIP, ExternalDNS or InternalDNS. + // +required + Type MachineAddressType `json:"type,omitempty"` + + // address is the machine address. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + Address string `json:"address,omitempty"` +} + +// MachineAddresses is a slice of MachineAddress items to be used by infrastructure providers. +// +kubebuilder:validation:MaxItems=32 +// +listType=atomic +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. +// +kubebuilder:validation:MinProperties=1 +type ObjectMeta struct { + // labels is a 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"` +} + +// Validate validates the labels and annotations in ObjectMeta. +func (metadata *ObjectMeta) Validate(parent *field.Path) field.ErrorList { + allErrs := metav1validation.ValidateLabels( + metadata.Labels, + parent.Child("labels"), + ) + allErrs = append(allErrs, apivalidation.ValidateAnnotations( + metadata.Annotations, + parent.Child("annotations"), + )...) + return allErrs +} + +// ContractVersionedObjectReference is a reference to a resource for which the version is inferred from contract labels. +type ContractVersionedObjectReference struct { + // kind of the resource being referenced. + // kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:Pattern=`^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$` + Kind string `json:"kind,omitempty"` + + // name of the resource being referenced. + // name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$` + Name string `json:"name,omitempty"` + + // apiGroup is the group of the resource being referenced. + // apiGroup must be fully qualified domain name. + // The corresponding version for this reference will be looked up from the contract + // labels of the corresponding CRD of the resource being referenced. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$` + APIGroup string `json:"apiGroup,omitempty"` +} + +// IsDefined returns true if the ContractVersionedObjectReference is set. +func (r *ContractVersionedObjectReference) IsDefined() bool { + if r == nil { + return false + } + return r.Kind != "" || r.Name != "" || r.APIGroup != "" +} + +// GroupKind returns the GroupKind of the reference. +func (r *ContractVersionedObjectReference) GroupKind() schema.GroupKind { + return schema.GroupKind{ + Group: r.APIGroup, + Kind: r.Kind, + } +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/condition_consts.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/condition_consts.go new file mode 100644 index 0000000000..23abc6c2ba --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/condition_consts.go @@ -0,0 +1,215 @@ +/* +Copyright 2025 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 v1beta2 + +// Conditions types that are used across different objects. +const ( + // AvailableCondition reports if an object is available. + // Note: This condition type is defined to ensure consistent naming of conditions across objects. + // Please use object specific variants of this condition which provides more details for each context where + // the same condition type exists. + AvailableCondition = "Available" + + // ReadyCondition reports if an object is ready. + // Note: This condition type is defined to ensure consistent naming of conditions across objects. + // Please use object specific variants of this condition which provides more details for each context where + // the same condition type exists. + ReadyCondition = "Ready" + + // BootstrapConfigReadyCondition reports if an object's bootstrap config is ready. + // Note: This condition type is defined to ensure consistent naming of conditions across objects. + // Please use object specific variants of this condition which provides more details for each context where + // the same condition type exists. + BootstrapConfigReadyCondition = "BootstrapConfigReady" + + // InfrastructureReadyCondition reports if an object's infrastructure is ready. + // Note: This condition type is defined to ensure consistent naming of conditions across objects. + // Please use object specific variants of this condition which provides more details for each context where + // the same condition type exists. + InfrastructureReadyCondition = "InfrastructureReady" + + // MachinesReadyCondition surfaces detail of issues on the controlled machines, if any. + // Note: This condition type is defined to ensure consistent naming of conditions across objects. + // Please use object specific variants of this condition which provides more details for each context where + // the same condition type exists. + MachinesReadyCondition = "MachinesReady" + + // MachinesUpToDateCondition surfaces details of controlled machines not up to date, if any. + // Note: This condition type is defined to ensure consistent naming of conditions across objects. + // Please use object specific variants of this condition which provides more details for each context where + // the same condition type exists. + MachinesUpToDateCondition = "MachinesUpToDate" + + // RollingOutCondition reports if an object is rolling out changes to machines; Cluster API usually + // rolls out changes to machines by replacing not up-to-date machines with new ones. + // Note: This condition type is defined to ensure consistent naming of conditions across objects. + // Please use object specific variants of this condition which provides more details for each context where + // the same condition type exists. + RollingOutCondition = "RollingOut" + + // ScalingUpCondition reports if an object is scaling up. + // Note: This condition type is defined to ensure consistent naming of conditions across objects. + // Please use object specific variants of this condition which provides more details for each context where + // the same condition type exists. + ScalingUpCondition = "ScalingUp" + + // ScalingDownCondition reports if an object is scaling down. + // Note: This condition type is defined to ensure consistent naming of conditions across objects. + // Please use object specific variants of this condition which provides more details for each context where + // the same condition type exists. + ScalingDownCondition = "ScalingDown" + + // RemediatingCondition surfaces details about ongoing remediation of the controlled machines, if any. + // Note: This condition type is defined to ensure consistent naming of conditions across objects. + // Please use object specific variants of this condition which provides more details for each context where + // the same condition type exists. + RemediatingCondition = "Remediating" + + // DeletingCondition surfaces details about progress of the object deletion workflow. + // Note: This condition type is defined to ensure consistent naming of conditions across objects. + // Please use object specific variants of this condition which provides more details for each context where + // the same condition type exists. + DeletingCondition = "Deleting" + + // PausedCondition reports if reconciliation for an object or the cluster is paused. + // Note: This condition type is defined to ensure consistent naming of conditions across objects. + // Please use object specific variants of this condition which provides more details for each context where + // the same condition type exists. + PausedCondition = "Paused" +) + +// Reasons that are used across different objects. +const ( + // AvailableReason applies to a condition surfacing object availability. + AvailableReason = "Available" + + // NotAvailableReason applies to a condition surfacing object not satisfying availability criteria. + NotAvailableReason = "NotAvailable" + + // AvailableUnknownReason applies to a condition surfacing object availability unknown. + AvailableUnknownReason = "AvailableUnknown" + + // ReadyReason applies to a condition surfacing object readiness. + ReadyReason = "Ready" + + // NotReadyReason applies to a condition surfacing object not satisfying readiness criteria. + NotReadyReason = "NotReady" + + // ReadyUnknownReason applies to a condition surfacing object readiness unknown. + ReadyUnknownReason = "ReadyUnknown" + + // UpToDateReason applies to a condition surfacing object up-tp-date. + UpToDateReason = "UpToDate" + + // NotUpToDateReason applies to a condition surfacing object not up-tp-date. + NotUpToDateReason = "NotUpToDate" + + // UpToDateUnknownReason applies to a condition surfacing object up-tp-date unknown. + UpToDateUnknownReason = "UpToDateUnknown" + + // RollingOutReason surfaces when an object is rolling out. + RollingOutReason = "RollingOut" + + // NotRollingOutReason surfaces when an object is not rolling out. + NotRollingOutReason = "NotRollingOut" + + // ScalingUpReason surfaces when an object is scaling up. + ScalingUpReason = "ScalingUp" + + // NotScalingUpReason surfaces when an object is not scaling up. + NotScalingUpReason = "NotScalingUp" + + // ScalingDownReason surfaces when an object is scaling down. + ScalingDownReason = "ScalingDown" + + // NotScalingDownReason surfaces when an object is not scaling down. + NotScalingDownReason = "NotScalingDown" + + // RemediatingReason surfaces when an object owns at least one machine with HealthCheckSucceeded + // set to false and with the OwnerRemediated condition set to false by the MachineHealthCheck controller. + RemediatingReason = "Remediating" + + // NotRemediatingReason surfaces when an object does not own any machines with HealthCheckSucceeded + // set to false and with the OwnerRemediated condition set to false by the MachineHealthCheck controller. + NotRemediatingReason = "NotRemediating" + + // NoReplicasReason surfaces when an object that manage replicas does not have any. + NoReplicasReason = "NoReplicas" + + // WaitingForReplicasSetReason surfaces when the replica field of an object is not set. + WaitingForReplicasSetReason = "WaitingForReplicasSet" + + // InvalidConditionReportedReason applies to a condition, usually read from an external object, that is invalid + // (e.g. its status is missing). + InvalidConditionReportedReason = "InvalidConditionReported" + + // InternalErrorReason surfaces unexpected errors reporting by controllers. + // In most cases, it will be required to look at controllers logs to properly triage those issues. + InternalErrorReason = "InternalError" + + // ObjectDoesNotExistReason surfaces when a referenced object does not exist. + ObjectDoesNotExistReason = "ObjectDoesNotExist" + + // ObjectDeletedReason surfaces when a referenced object has been deleted. + // Note: controllers can't identify if the object was deleted by the controller itself, e.g. + // during the deletion workflow, or by a users. + ObjectDeletedReason = "ObjectDeleted" + + // NotPausedReason surfaces when an object is not paused. + NotPausedReason = "NotPaused" + + // PausedReason surfaces when an object is paused. + PausedReason = "Paused" + + // ConnectionDownReason surfaces that the connection to the workload cluster is down. + ConnectionDownReason = "ConnectionDown" + + // NotDeletingReason surfaces when an object is not deleting because the + // DeletionTimestamp is not set. + NotDeletingReason = "NotDeleting" + + // DeletingReason surfaces when an object is deleting because the + // DeletionTimestamp is set. This reason is used if none of the more specific reasons apply. + DeletingReason = "Deleting" + + // DeletionCompletedReason surfaces when the deletion process has been completed. + // This reason is set right after the corresponding finalizer is removed. + // This means that the object will go away (i.e. be removed from etcd), except if there are other + // finalizers on the object. + DeletionCompletedReason = "DeletionCompleted" + + // InspectionFailedReason applies to a condition when inspection of the underlying object failed. + InspectionFailedReason = "InspectionFailed" + + // WaitingForClusterInfrastructureReadyReason documents an infra Machine waiting for the cluster + // infrastructure to be ready. + WaitingForClusterInfrastructureReadyReason = "WaitingForClusterInfrastructureReady" + + // WaitingForControlPlaneInitializedReason documents an infra Machine waiting + // for the control plane to be initialized. + WaitingForControlPlaneInitializedReason = "WaitingForControlPlaneInitialized" + + // WaitingForBootstrapDataReason documents an infra Machine waiting for the bootstrap + // data to be ready before starting to create the Machine's infrastructure. + WaitingForBootstrapDataReason = "WaitingForBootstrapData" + + // ProvisionedReason documents an object or a piece of infrastructure being provisioned. + ProvisionedReason = "Provisioned" + + // NotProvisionedReason documents an object or a piece of infrastructure is not provisioned. + NotProvisionedReason = "NotProvisioned" +) diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/condition_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/condition_types.go new file mode 100644 index 0000000000..c609b34c7e --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/condition_types.go @@ -0,0 +1,88 @@ +/* +Copyright 2025 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 v1beta2 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// ConditionSeverity expresses the severity of a Condition Type failing. +// +kubebuilder:validation:MaxLength=32 +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 = "" +) + +// ConditionType is a valid value for Condition.Type. +// +kubebuilder:validation:MinLength=1 +// +kubebuilder:validation:MaxLength=256 +type ConditionType string + +// 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"` //nolint:kubeapilinter // the Condition type will be removed when v1beta1 is removed + + // lastTransitionTime is the 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"` + + // reason is 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 be empty. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + Reason string `json:"reason,omitempty"` + + // message is a human readable message indicating details about the transition. + // This field may be empty. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=10240 + Message string `json:"message,omitempty"` +} + +// Conditions provide observations of the operational state of a Cluster API resource. +type Conditions []Condition diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/conversion.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/conversion.go new file mode 100644 index 0000000000..ad42bde84b --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/conversion.go @@ -0,0 +1,106 @@ +/* +Copyright 2025 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 v1beta2 + +import ( + "math" + "time" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/utils/ptr" +) + +func (*Cluster) Hub() {} +func (*ClusterClass) Hub() {} +func (*Machine) Hub() {} +func (*MachineSet) Hub() {} +func (*MachineDeployment) Hub() {} +func (*MachineHealthCheck) Hub() {} +func (*MachinePool) Hub() {} +func (*MachineDrainRule) Hub() {} + +// ConvertToSeconds takes *metav1.Duration and returns a *int32. +// Durations longer than MaxInt32 are capped. +// NOTE: this is a util function intended only for usage in API conversions. +func ConvertToSeconds(in *metav1.Duration) *int32 { + if in == nil { + return nil + } + seconds := math.Trunc(in.Seconds()) + if seconds > math.MaxInt32 { + return ptr.To[int32](math.MaxInt32) + } + return ptr.To(int32(seconds)) +} + +// ConvertFromSeconds takes *int32 and returns a *metav1.Duration. +// Durations longer than MaxInt32 are capped. +// NOTE: this is a util function intended only for usage in API conversions. +func ConvertFromSeconds(in *int32) *metav1.Duration { + if in == nil { + return nil + } + return ptr.To(metav1.Duration{Duration: time.Duration(*in) * time.Second}) +} + +func Convert_bool_To_Pointer_bool(in bool, hasRestored bool, restoredIn *bool, out **bool) { + // If the value is false, convert to *false only if the value was *false before (we know it was intentionally set to false). + // In all the other cases we do not know if the value was intentionally set to false, so convert to nil. + if !in { + if hasRestored && restoredIn != nil && !*restoredIn { + *out = ptr.To(false) + return + } + *out = nil + return + } + + // Otherwise, if the value is true, convert to *true. + *out = ptr.To(true) +} + +func Convert_int32_To_Pointer_int32(in int32, hasRestored bool, restoredIn *int32, out **int32) { + // If the value is 0, convert to *0 only if the value was *0 before (we know it was intentionally set to 0). + // In all the other cases we do not know if the value was intentionally set to 0, so convert to nil. + if in == 0 { + if hasRestored && restoredIn != nil && *restoredIn == 0 { + *out = ptr.To[int32](0) + return + } + *out = nil + return + } + + // Otherwise, if the value is not 0, convert to *value. + *out = ptr.To(in) +} + +func Convert_Duration_To_Pointer_int32(in metav1.Duration, hasRestored bool, restoredIn *int32, out **int32) { + // If the value is 0s, convert to *0 only if the value was *0 before (we know it was intentionally set to 0). + // In all the other cases we do not know if the value was intentionally set to 0, so convert to nil. + if in.Nanoseconds() == 0 { + if hasRestored && restoredIn != nil && *restoredIn == 0 { + *out = ptr.To[int32](0) + return + } + *out = nil + return + } + + // Otherwise, if the value is not 0, convert to *value. + *out = ConvertToSeconds(&in) +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/doc.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/doc.go similarity index 72% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/doc.go rename to vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/doc.go index 38da784101..504212fb6d 100644 --- a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/doc.go +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Kubernetes Authors. +Copyright 2025 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,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package v1beta1 contains the v1beta1 API implementation. +// Package v1beta2 contains API Schema definitions for the cluster v1beta2 API group // +k8s:openapi-gen=true -package v1beta1 +// +kubebuilder:object:generate=true +// +groupName=cluster.x-k8s.io +package v1beta2 diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/groupversion_info.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/groupversion_info.go new file mode 100644 index 0000000000..3695797c11 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/groupversion_info.go @@ -0,0 +1,51 @@ +/* +Copyright 2025 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 v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var ( + // GroupVersion is group version used to register these objects. + GroupVersion = schema.GroupVersion{Group: "cluster.x-k8s.io", Version: "v1beta2"} + + // schemeBuilder is used to add go types to the GroupVersionKind scheme. + schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = schemeBuilder.AddToScheme + + objectTypes = []runtime.Object{} + + // GroupVersionInfrastructure is the recommended group version for infrastructure objects. + GroupVersionInfrastructure = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1beta2"} + + // GroupVersionBootstrap is the recommended group version for bootstrap objects. + GroupVersionBootstrap = schema.GroupVersion{Group: "bootstrap.cluster.x-k8s.io", Version: "v1beta2"} + + // GroupVersionControlPlane is the recommended group version for controlplane objects. + GroupVersionControlPlane = schema.GroupVersion{Group: "controlplane.cluster.x-k8s.io", Version: "v1beta2"} +) + +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(GroupVersion, objectTypes...) + metav1.AddToGroupVersion(scheme, GroupVersion) + return nil +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machine_phase_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machine_phase_types.go new file mode 100644 index 0000000000..1ca9551564 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machine_phase_types.go @@ -0,0 +1,69 @@ +/* +Copyright 2025 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 v1beta2 + +// 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. + // + // Deprecated: This enum value is deprecated; the Failed phase won't be set anymore by controllers, and it is preserved only + // for conversion from v1beta1 objects; the Failed phase is going to be removed when support for v1beta1 will be dropped. + // Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + MachinePhaseFailed = MachinePhase("Failed") + + // MachinePhaseUnknown is returned if the Machine state cannot be determined. + MachinePhaseUnknown = MachinePhase("Unknown") +) diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machine_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machine_types.go new file mode 100644 index 0000000000..a60f736ba2 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machine_types.go @@ -0,0 +1,802 @@ +/* +Copyright 2025 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 v1beta2 + +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" + + // MachineControlPlaneLabel is the label set on machines or related objects that are part of a control plane. + MachineControlPlaneLabel = "cluster.x-k8s.io/control-plane" + + // ExcludeNodeDrainingAnnotation annotation explicitly skips node draining if set. + ExcludeNodeDrainingAnnotation = "machine.cluster.x-k8s.io/exclude-node-draining" + + // ExcludeWaitForNodeVolumeDetachAnnotation annotation explicitly skips the waiting for node volume detaching if set. + ExcludeWaitForNodeVolumeDetachAnnotation = "machine.cluster.x-k8s.io/exclude-wait-for-node-volume-detach" + + // MachineSetNameLabel is the label set on machines if they're controlled by MachineSet. + // Note: The value of this label may be a hash if the MachineSet name is longer than 63 characters. + MachineSetNameLabel = "cluster.x-k8s.io/set-name" + + // MachineDeploymentNameLabel is the label set on machines if they're controlled by MachineDeployment. + MachineDeploymentNameLabel = "cluster.x-k8s.io/deployment-name" + + // MachinePoolNameLabel is the label indicating the name of the MachinePool a Machine is controlled by. + // Note: The value of this label may be a hash if the MachinePool name is longer than 63 characters. + MachinePoolNameLabel = "cluster.x-k8s.io/pool-name" + + // MachineControlPlaneNameLabel is the label set on machines if they're controlled by a ControlPlane. + // Note: The value of this label may be a hash if the control plane name is longer than 63 characters. + MachineControlPlaneNameLabel = "cluster.x-k8s.io/control-plane-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. + // + // Notes for Machines managed by KCP (starting with Cluster API v1.8.2): + // * KCP adds its own pre-terminate hook on all Machines it controls. This is done to ensure it can later remove + // the etcd member right before Machine termination (i.e. before InfraMachine deletion). + // * Starting with Kubernetes v1.31 the KCP pre-terminate hook will wait for all other pre-terminate hooks to finish to + // ensure it runs last (thus ensuring that kubelet is still working while other pre-terminate hooks run). This is only done + // for v1.31 or above because the kubeadm ControlPlaneKubeletLocalMode was introduced with kubeadm 1.31. This feature configures + // the kubelet to communicate with the local apiserver. Only because of that the kubelet immediately starts failing after the etcd + // member is removed. We need the ControlPlaneKubeletLocalMode feature with 1.31 to adhere to the kubelet skew policy. + PreTerminateDeleteHookAnnotationPrefix = "pre-terminate.delete.hook.machine.cluster.x-k8s.io" + + // MachineCertificatesExpiryDateAnnotation annotation specifies the expiry date of the machine certificates in RFC3339 format. + // This annotation can be used on control plane machines to trigger rollout before certificates expire. + // This annotation can be set on BootstrapConfig or Machine objects. The value set on the Machine object takes precedence. + // This annotation can only be used on Control Plane Machines. + MachineCertificatesExpiryDateAnnotation = "machine.cluster.x-k8s.io/certificates-expiry" + + // NodeRoleLabelPrefix is one of the CAPI managed Node label prefixes. + NodeRoleLabelPrefix = "node-role.kubernetes.io" + // NodeRestrictionLabelDomain is one of the CAPI managed Node label domains. + NodeRestrictionLabelDomain = "node-restriction.kubernetes.io" + // ManagedNodeLabelDomain is one of the CAPI managed Node label domains. + ManagedNodeLabelDomain = "node.cluster.x-k8s.io" + + // ManagedNodeAnnotationDomain is one of the CAPI managed Node annotation domains. + ManagedNodeAnnotationDomain = "node.cluster.x-k8s.io" +) + +// Machine's Available condition and corresponding reasons. +const ( + // MachineAvailableCondition is true if the machine is Ready for at least MinReadySeconds, as defined by the Machine's MinReadySeconds field. + // Note: MinReadySeconds is assumed 0 until it will be implemented in v1beta2 API. + MachineAvailableCondition = AvailableCondition + + // MachineWaitingForMinReadySecondsReason surfaces when a machine is ready for less than MinReadySeconds (and thus not yet available). + MachineWaitingForMinReadySecondsReason = "WaitingForMinReadySeconds" + + // MachineAvailableReason surfaces when a machine is ready for at least MinReadySeconds. + // Note: MinReadySeconds is assumed 0 until it will be implemented in v1beta2 API. + MachineAvailableReason = AvailableReason + + // MachineAvailableInternalErrorReason surfaces unexpected error when computing the Available condition. + MachineAvailableInternalErrorReason = InternalErrorReason +) + +// Machine's Ready condition and corresponding reasons. +const ( + // MachineReadyCondition is true if the Machine's deletionTimestamp is not set, Machine's BootstrapConfigReady, InfrastructureReady, + // NodeHealthy and HealthCheckSucceeded (if present) conditions are true; if other conditions are defined in spec.readinessGates, + // these conditions must be true as well. + // Note: + // - When summarizing the Deleting condition: + // - Details about Pods stuck in draining or volumes waiting for detach are dropped, in order to improve readability & reduce flickering + // of the condition that bubbles up to the owning resources/ to the Cluster (it also makes it more likely this condition might be aggregated with + // conditions reported by other machines). + // - If deletion is in progress for more than 15m, this surfaces on the summary condition (hint about a possible stale deletion). + // - if drain is in progress for more than 5 minutes, a summery of what is blocking drain also surfaces in the message. + // - When summarizing BootstrapConfigReady, InfrastructureReady, NodeHealthy, in case the Machine is deleting, the absence of the + // referenced object won't be considered as an issue. + MachineReadyCondition = ReadyCondition + + // MachineReadyReason surfaces when the machine readiness criteria is met. + MachineReadyReason = ReadyReason + + // MachineNotReadyReason surfaces when the machine readiness criteria is not met. + // Note: when a machine is not ready, it is also not available. + MachineNotReadyReason = NotReadyReason + + // MachineReadyUnknownReason surfaces when at least one machine readiness criteria is unknown + // and no machine readiness criteria is not met. + MachineReadyUnknownReason = ReadyUnknownReason + + // MachineReadyInternalErrorReason surfaces unexpected error when computing the Ready condition. + MachineReadyInternalErrorReason = InternalErrorReason +) + +// Machine's UpToDate condition and corresponding reasons. +// Note: UpToDate condition is set by the controller owning the machine. +const ( + // MachineUpToDateCondition is true if the Machine spec matches the spec of the Machine's owner resource, e.g. KubeadmControlPlane or MachineDeployment. + // The Machine's owner (e.g. MachineDeployment) is authoritative to set their owned Machine's UpToDate conditions based on its current spec. + // NOTE: The Machine's owner might use this condition to surface also other use cases when Machine is considered not up to date, e.g. when MachineDeployment spec.rolloutAfter + // is expired and the Machine needs to be rolled out. + MachineUpToDateCondition = "UpToDate" + + // MachineUpToDateReason surface when a Machine spec matches the spec of the Machine's owner resource, e.g. KubeadmControlPlane or MachineDeployment. + MachineUpToDateReason = "UpToDate" + + // MachineNotUpToDateReason surface when a Machine spec does not match the spec of the Machine's owner resource, e.g. KubeadmControlPlane or MachineDeployment. + MachineNotUpToDateReason = "NotUpToDate" +) + +// Machine's BootstrapConfigReady condition and corresponding reasons. +// Note: when possible, BootstrapConfigReady condition will use reasons surfaced from the underlying bootstrap config object. +const ( + // MachineBootstrapConfigReadyCondition condition mirrors the corresponding Ready condition from the Machine's BootstrapConfig resource. + MachineBootstrapConfigReadyCondition = BootstrapConfigReadyCondition + + // MachineBootstrapDataSecretProvidedReason surfaces when a bootstrap data secret is provided (not originated + // from a BoostrapConfig object referenced from the machine). + MachineBootstrapDataSecretProvidedReason = "DataSecretProvided" + + // MachineBootstrapConfigReadyReason surfaces when the machine bootstrap config is ready. + MachineBootstrapConfigReadyReason = ReadyReason + + // MachineBootstrapConfigNotReadyReason surfaces when the machine bootstrap config is not ready. + MachineBootstrapConfigNotReadyReason = NotReadyReason + + // MachineBootstrapConfigInvalidConditionReportedReason surfaces a BootstrapConfig Ready condition (read from a bootstrap config object) which is invalid. + // (e.g. its status is missing). + MachineBootstrapConfigInvalidConditionReportedReason = InvalidConditionReportedReason + + // MachineBootstrapConfigInternalErrorReason surfaces unexpected failures when reading a BootstrapConfig object. + MachineBootstrapConfigInternalErrorReason = InternalErrorReason + + // MachineBootstrapConfigDoesNotExistReason surfaces when a referenced bootstrap config object does not exist. + // Note: this could happen when creating the machine. However, this state should be treated as an error if it lasts indefinitely. + MachineBootstrapConfigDoesNotExistReason = ObjectDoesNotExistReason + + // MachineBootstrapConfigDeletedReason surfaces when a referenced bootstrap config object has been deleted. + // Note: controllers can't identify if the bootstrap config object was deleted the controller itself, e.g. + // during the deletion workflow, or by a users. + MachineBootstrapConfigDeletedReason = ObjectDeletedReason +) + +// Machine's InfrastructureReady condition and corresponding reasons. +// Note: when possible, InfrastructureReady condition will use reasons surfaced from the underlying infra machine object. +const ( + // MachineInfrastructureReadyCondition mirrors the corresponding Ready condition from the Machine's infrastructure resource. + MachineInfrastructureReadyCondition = InfrastructureReadyCondition + + // MachineInfrastructureReadyReason surfaces when the machine infrastructure is ready. + MachineInfrastructureReadyReason = ReadyReason + + // MachineInfrastructureNotReadyReason surfaces when the machine infrastructure is not ready. + MachineInfrastructureNotReadyReason = NotReadyReason + + // MachineInfrastructureInvalidConditionReportedReason surfaces a infrastructure Ready condition (read from an infra machine object) which is invalid. + // (e.g. its status is missing). + MachineInfrastructureInvalidConditionReportedReason = InvalidConditionReportedReason + + // MachineInfrastructureInternalErrorReason surfaces unexpected failures when reading an infra machine object. + MachineInfrastructureInternalErrorReason = InternalErrorReason + + // MachineInfrastructureDoesNotExistReason surfaces when a referenced infrastructure object does not exist. + // Note: this could happen when creating the machine. However, this state should be treated as an error if it lasts indefinitely. + MachineInfrastructureDoesNotExistReason = ObjectDoesNotExistReason + + // MachineInfrastructureDeletedReason surfaces when a referenced infrastructure object has been deleted. + // Note: controllers can't identify if the infrastructure object was deleted by the controller itself, e.g. + // during the deletion workflow, or by a users. + MachineInfrastructureDeletedReason = ObjectDeletedReason +) + +// Machine's NodeHealthy and NodeReady conditions and corresponding reasons. +// Note: when possible, NodeHealthy and NodeReady conditions will use reasons surfaced from the underlying node. +const ( + // MachineNodeHealthyCondition is true if the Machine's Node is ready and it does not report MemoryPressure, DiskPressure and PIDPressure. + MachineNodeHealthyCondition = "NodeHealthy" + + // MachineNodeReadyCondition is true if the Machine's Node is ready. + MachineNodeReadyCondition = "NodeReady" + + // MachineNodeReadyReason surfaces when Machine's Node Ready condition is true. + MachineNodeReadyReason = "NodeReady" + + // MachineNodeNotReadyReason surfaces when Machine's Node Ready condition is false. + MachineNodeNotReadyReason = "NodeNotReady" + + // MachineNodeReadyUnknownReason surfaces when Machine's Node Ready condition is unknown. + MachineNodeReadyUnknownReason = "NodeReadyUnknown" + + // MachineNodeHealthyReason surfaces when all the node conditions report healthy state. + MachineNodeHealthyReason = "NodeHealthy" + + // MachineNodeNotHealthyReason surfaces when at least one node conditions report not healthy state. + MachineNodeNotHealthyReason = "NodeNotHealthy" + + // MachineNodeHealthUnknownReason surfaces when at least one node conditions report healthy state unknown + // and no node conditions report not healthy state. + MachineNodeHealthUnknownReason = "NodeHealthyUnknown" + + // MachineNodeInternalErrorReason surfaces unexpected failures when reading a Node object. + MachineNodeInternalErrorReason = InternalErrorReason + + // MachineNodeDoesNotExistReason surfaces when the node hosted on the machine does not exist. + // Note: this could happen when creating the machine. However, this state should be treated as an error if it lasts indefinitely. + MachineNodeDoesNotExistReason = "NodeDoesNotExist" + + // MachineNodeDeletedReason surfaces when the node hosted on the machine has been deleted. + // Note: controllers can't identify if the Node was deleted by the controller itself, e.g. + // during the deletion workflow, or by a users. + MachineNodeDeletedReason = "NodeDeleted" + + // MachineNodeInspectionFailedReason documents a failure when inspecting the status of a Node. + MachineNodeInspectionFailedReason = InspectionFailedReason + + // MachineNodeConnectionDownReason surfaces that the connection to the workload cluster is down. + MachineNodeConnectionDownReason = ConnectionDownReason +) + +// Machine's HealthCheckSucceeded condition and corresponding reasons. +// Note: HealthCheckSucceeded condition is set by the MachineHealthCheck controller. +const ( + // MachineHealthCheckSucceededCondition is true if MHC instances targeting this machine report the Machine + // is healthy according to the definition of healthy present in the spec of the MachineHealthCheck object. + MachineHealthCheckSucceededCondition = "HealthCheckSucceeded" + + // MachineHealthCheckSucceededReason surfaces when a machine passes all the health checks defined by a MachineHealthCheck object. + MachineHealthCheckSucceededReason = "HealthCheckSucceeded" + + // MachineHealthCheckUnhealthyNodeReason surfaces when the node hosted on the machine does not pass the health checks + // defined by a MachineHealthCheck object. + MachineHealthCheckUnhealthyNodeReason = "UnhealthyNode" + + // MachineHealthCheckNodeStartupTimeoutReason surfaces when the node hosted on the machine does not appear within + // the timeout defined by a MachineHealthCheck object. + MachineHealthCheckNodeStartupTimeoutReason = "NodeStartupTimeout" + + // MachineHealthCheckNodeDeletedReason surfaces when a MachineHealthCheck detects that the node hosted on the + // machine has been deleted while the Machine is still running. + MachineHealthCheckNodeDeletedReason = "NodeDeleted" + + // MachineHealthCheckHasRemediateAnnotationReason surfaces when a MachineHealthCheck detects that a Machine was + // marked for remediation via the `cluster.x-k8s.io/remediate-machine` annotation. + MachineHealthCheckHasRemediateAnnotationReason = "HasRemediateAnnotation" +) + +// Machine's OwnerRemediated conditions and corresponding reasons. +// Note: OwnerRemediated condition is initially set by the MachineHealthCheck controller; then it is up to the Machine's +// owner controller to update or delete this condition. +const ( + // MachineOwnerRemediatedCondition is only present if MHC instances targeting this machine + // determine that the controller owning this machine should perform remediation. + MachineOwnerRemediatedCondition = "OwnerRemediated" + + // MachineOwnerRemediatedWaitingForRemediationReason surfaces the machine is waiting for the owner controller + // to start remediation. + MachineOwnerRemediatedWaitingForRemediationReason = "WaitingForRemediation" +) + +// Machine's ExternallyRemediated conditions and corresponding reasons. +// Note: ExternallyRemediated condition is initially set by the MachineHealthCheck controller; then it is up to the external +// remediation controller to update or delete this condition. +const ( + // MachineExternallyRemediatedCondition is only present if MHC instances targeting this machine + // determine that an external controller should perform remediation. + MachineExternallyRemediatedCondition = "ExternallyRemediated" + + // MachineExternallyRemediatedWaitingForRemediationReason surfaces the machine is waiting for the + // external remediation controller to start remediation. + MachineExternallyRemediatedWaitingForRemediationReason = "WaitingForRemediation" + + // MachineExternallyRemediatedRemediationTemplateNotFoundReason surfaces that the MachineHealthCheck cannot + // find the template for an external remediation request. + MachineExternallyRemediatedRemediationTemplateNotFoundReason = "RemediationTemplateNotFound" + + // MachineExternallyRemediatedRemediationRequestCreationFailedReason surfaces that the MachineHealthCheck cannot + // create a request for the external remediation controller. + MachineExternallyRemediatedRemediationRequestCreationFailedReason = "RemediationRequestCreationFailed" +) + +// Machine's Deleting condition and corresponding reasons. +const ( + // MachineDeletingCondition surfaces details about progress in the machine deletion workflow. + MachineDeletingCondition = DeletingCondition + + // MachineNotDeletingReason surfaces when the Machine is not deleting because the + // DeletionTimestamp is not set. + MachineNotDeletingReason = NotDeletingReason + + // MachineDeletingReason surfaces when the Machine is deleting because the + // DeletionTimestamp is set. This reason is used if none of the more specific reasons apply. + MachineDeletingReason = DeletingReason + + // MachineDeletingInternalErrorReason surfaces unexpected failures when deleting a Machine. + MachineDeletingInternalErrorReason = InternalErrorReason + + // MachineDeletingWaitingForPreDrainHookReason surfaces when the Machine deletion + // waits for pre-drain hooks to complete. I.e. it waits until there are no annotations + // with the `pre-drain.delete.hook.machine.cluster.x-k8s.io` prefix on the Machine anymore. + MachineDeletingWaitingForPreDrainHookReason = "WaitingForPreDrainHook" + + // MachineDeletingDrainingNodeReason surfaces when the Machine deletion is draining the Node. + MachineDeletingDrainingNodeReason = "DrainingNode" + + // MachineDeletingWaitingForVolumeDetachReason surfaces when the Machine deletion is + // waiting for volumes to detach from the Node. + MachineDeletingWaitingForVolumeDetachReason = "WaitingForVolumeDetach" + + // MachineDeletingWaitingForPreTerminateHookReason surfaces when the Machine deletion + // waits for pre-terminate hooks to complete. I.e. it waits until there are no annotations + // with the `pre-terminate.delete.hook.machine.cluster.x-k8s.io` prefix on the Machine anymore. + MachineDeletingWaitingForPreTerminateHookReason = "WaitingForPreTerminateHook" + + // MachineDeletingWaitingForInfrastructureDeletionReason surfaces when the Machine deletion + // waits for InfraMachine deletion to complete. + MachineDeletingWaitingForInfrastructureDeletionReason = "WaitingForInfrastructureDeletion" + + // MachineDeletingWaitingForBootstrapDeletionReason surfaces when the Machine deletion + // waits for BootstrapConfig deletion to complete. + MachineDeletingWaitingForBootstrapDeletionReason = "WaitingForBootstrapDeletion" + + // MachineDeletingDeletingNodeReason surfaces when the Machine deletion is + // deleting the Node. + MachineDeletingDeletingNodeReason = "DeletingNode" + + // MachineDeletingDeletionCompletedReason surfaces when the Machine deletion has been completed. + // This reason is set right after the `machine.cluster.x-k8s.io` finalizer is removed. + // This means that the object will go away (i.e. be removed from etcd), except if there are other + // finalizers on the Machine object. + MachineDeletingDeletionCompletedReason = DeletionCompletedReason +) + +// MachineSpec defines the desired state of Machine. +type MachineSpec struct { + // clusterName is the name of the Cluster this object belongs to. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + ClusterName string `json:"clusterName,omitempty"` + + // bootstrap is a reference to a local struct which encapsulates + // fields to configure the Machine’s bootstrapping mechanism. + // +required + Bootstrap Bootstrap `json:"bootstrap,omitempty,omitzero"` + + // infrastructureRef is a required reference to a custom resource + // offered by an infrastructure provider. + // +required + InfrastructureRef ContractVersionedObjectReference `json:"infrastructureRef,omitempty,omitzero"` + + // version defines the desired Kubernetes version. + // This field is meant to be optionally used by bootstrap providers. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + 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 + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=512 + ProviderID string `json:"providerID,omitempty"` + + // failureDomain is the failure domain the machine will be created in. + // Must match the name of a FailureDomain from the Cluster status. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + FailureDomain string `json:"failureDomain,omitempty"` + + // minReadySeconds is the minimum number of seconds for which a Machine should be ready before considering it available. + // Defaults to 0 (Machine will be considered available as soon as the Machine is ready) + // +optional + // +kubebuilder:validation:Minimum=0 + MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` + + // readinessGates specifies additional conditions to include when evaluating Machine Ready condition. + // + // This field can be used e.g. by Cluster API control plane providers to extend the semantic of the + // Ready condition for the Machine they control, like the kubeadm control provider adding ReadinessGates + // for the APIServerPodHealthy, SchedulerPodHealthy conditions, etc. + // + // Another example are external controllers, e.g. responsible to install special software/hardware on the Machines; + // they can include the status of those components with a new condition and add this condition to ReadinessGates. + // + // NOTE: In case readinessGates conditions start with the APIServer, ControllerManager, Scheduler prefix, and all those + // readiness gates condition are reporting the same message, when computing the Machine's Ready condition those + // readinessGates will be replaced by a single entry reporting "Control plane components: " + message. + // This helps to improve readability of conditions bubbling up to the Machine's owner resource / to the Cluster). + // +optional + // +listType=map + // +listMapKey=conditionType + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=32 + ReadinessGates []MachineReadinessGate `json:"readinessGates,omitempty"` + + // deletion contains configuration options for Machine deletion. + // +optional + Deletion MachineDeletionSpec `json:"deletion,omitempty,omitzero"` +} + +// MachineDeletionSpec contains configuration options for Machine deletion. +// +kubebuilder:validation:MinProperties=1 +type MachineDeletionSpec struct { + // nodeDrainTimeoutSeconds 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: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` + // +optional + // +kubebuilder:validation:Minimum=0 + NodeDrainTimeoutSeconds *int32 `json:"nodeDrainTimeoutSeconds,omitempty"` + + // nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes + // to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeVolumeDetachTimeoutSeconds *int32 `json:"nodeVolumeDetachTimeoutSeconds,omitempty"` + + // nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine + // hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely. + // Defaults to 10 seconds. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeDeletionTimeoutSeconds *int32 `json:"nodeDeletionTimeoutSeconds,omitempty"` +} + +// MachineReadinessGate contains the type of a Machine condition to be used as a readiness gate. +type MachineReadinessGate struct { + // conditionType refers to a condition with matching type in the Machine's condition list. + // If the conditions doesn't exist, it will be treated as unknown. + // Note: Both Cluster API conditions or conditions added by 3rd party controllers can be used as readiness gates. + // +required + // +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$` + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=316 + ConditionType string `json:"conditionType,omitempty"` + + // polarity of the conditionType specified in this readinessGate. + // Valid values are Positive, Negative and omitted. + // When omitted, the default behaviour will be Positive. + // A positive polarity means that the condition should report a true status under normal conditions. + // A negative polarity means that the condition should report a false status under normal conditions. + // +optional + Polarity ConditionPolarity `json:"polarity,omitempty"` +} + +// MachineStatus defines the observed state of Machine. +// +kubebuilder:validation:MinProperties=1 +type MachineStatus struct { + // conditions represents the observations of a Machine's current state. + // Known condition types are Available, Ready, UpToDate, BootstrapConfigReady, InfrastructureReady, NodeReady, + // NodeHealthy, Deleting, Paused. + // If a MachineHealthCheck is targeting this machine, also HealthCheckSucceeded, OwnerRemediated conditions are added. + // Additionally control plane Machines controlled by KubeadmControlPlane will have following additional conditions: + // APIServerPodHealthy, ControllerManagerPodHealthy, SchedulerPodHealthy, EtcdPodHealthy, EtcdMemberHealthy. + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=32 + Conditions []metav1.Condition `json:"conditions,omitempty"` + + // initialization provides observations of the Machine initialization process. + // NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial Machine provisioning. + // +optional + Initialization MachineInitializationStatus `json:"initialization,omitempty,omitzero"` + + // nodeRef will point to the corresponding Node if it exists. + // +optional + NodeRef MachineNodeReference `json:"nodeRef,omitempty,omitzero"` + + // 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,omitzero"` + + // 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. + // +optional + // +kubebuilder:validation:Enum=Pending;Provisioning;Provisioned;Running;Deleting;Deleted;Failed;Unknown + Phase string `json:"phase,omitempty"` + + // certificatesExpiryDate is the expiry date of the machine certificates. + // This value is only set for control plane machines. + // +optional + CertificatesExpiryDate metav1.Time `json:"certificatesExpiryDate,omitempty,omitzero"` + + // observedGeneration is the latest generation observed by the controller. + // +optional + // +kubebuilder:validation:Minimum=1 + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // deletion contains information relating to removal of the Machine. + // Only present when the Machine has a deletionTimestamp and drain or wait for volume detach started. + // +optional + Deletion *MachineDeletionStatus `json:"deletion,omitempty"` + + // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. + // +optional + Deprecated *MachineDeprecatedStatus `json:"deprecated,omitempty"` +} + +// MachineNodeReference is a reference to the node running on the machine. +type MachineNodeReference struct { + // name of the node. + // name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$` + Name string `json:"name,omitempty"` +} + +// IsDefined returns true if the MachineNodeReference is set. +func (r *MachineNodeReference) IsDefined() bool { + if r == nil { + return false + } + return r.Name != "" +} + +// MachineInitializationStatus provides observations of the Machine initialization process. +// NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial Machine provisioning. +// +kubebuilder:validation:MinProperties=1 +type MachineInitializationStatus struct { + // infrastructureProvisioned is true when the infrastructure provider reports that Machine's infrastructure is fully provisioned. + // NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. + // The value of this field is never updated after provisioning is completed. + // +optional + InfrastructureProvisioned *bool `json:"infrastructureProvisioned,omitempty"` + + // bootstrapDataSecretCreated is true when the bootstrap provider reports that the Machine's boostrap secret is created. + // NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. + // The value of this field is never updated after provisioning is completed. + // +optional + BootstrapDataSecretCreated *bool `json:"bootstrapDataSecretCreated,omitempty"` +} + +// MachineDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachineDeprecatedStatus struct { + // v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + V1Beta1 *MachineV1Beta1DeprecatedStatus `json:"v1beta1,omitempty"` +} + +// MachineV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachineV1Beta1DeprecatedStatus struct { + // conditions defines current service state of the Machine. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + Conditions Conditions `json:"conditions,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. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +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. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=10240 + FailureMessage *string `json:"failureMessage,omitempty"` //nolint:kubeapilinter // field will be removed when v1beta1 is removed +} + +// MachineDeletionStatus is the deletion state of the Machine. +type MachineDeletionStatus struct { + // nodeDrainStartTime is the time when the drain of the node started and is used to determine + // if the nodeDrainTimeoutSeconds is exceeded. + // Only present when the Machine has a deletionTimestamp and draining the node had been started. + // +optional + NodeDrainStartTime metav1.Time `json:"nodeDrainStartTime,omitempty,omitzero"` + + // waitForNodeVolumeDetachStartTime is the time when waiting for volume detachment started + // and is used to determine if the nodeVolumeDetachTimeoutSeconds is exceeded. + // Detaching volumes from nodes is usually done by CSI implementations and the current state + // is observed from the node's `.Status.VolumesAttached` field. + // Only present when the Machine has a deletionTimestamp and waiting for volume detachments had been started. + // +optional + WaitForNodeVolumeDetachStartTime metav1.Time `json:"waitForNodeVolumeDetachStartTime,omitempty,omitzero"` +} + +// 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 + } +} + +// 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 ContractVersionedObjectReference `json:"configRef,omitempty,omitzero"` + + // dataSecretName is the name of the secret that stores the bootstrap data script. + // If nil, the Machine should remain in the Pending state. + // +optional + // +kubebuilder:validation:MinLength=0 + // +kubebuilder:validation:MaxLength=253 + DataSecretName *string `json:"dataSecretName,omitempty"` +} + +// +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="Node Name",type="string",JSONPath=".status.nodeRef.name",description="Node name associated with this machine" +// +kubebuilder:printcolumn:name="Provider ID",type="string",JSONPath=".spec.providerID",description="Provider ID",priority=10 +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=`.status.conditions[?(@.type=="Ready")].status`,description="Machine pass all readiness checks" +// +kubebuilder:printcolumn:name="Available",type="string",JSONPath=`.status.conditions[?(@.type=="Available")].status`,description="Machine is Ready for at least MinReadySeconds" +// +kubebuilder:printcolumn:name="Up-to-date",type="string",JSONPath=`.status.conditions[?(@.type=="UpToDate")].status`,description=" Machine spec matches the spec of the Machine's owner resource, e.g. MachineDeployment" +// +kubebuilder:printcolumn:name="Internal-IP",type="string",JSONPath=`.status.addresses[?(@.type=="InternalIP")].address`,description="Internal IP of the machine",priority=10 +// +kubebuilder:printcolumn:name="External-IP",type="string",JSONPath=`.status.addresses[?(@.type=="ExternalIP")].address`,description="External IP of the machine",priority=10 +// +kubebuilder:printcolumn:name="OS-Image",type="string",JSONPath=`.status.nodeInfo.osImage`,description="OS Image reported by the node",priority=10 +// +kubebuilder:printcolumn:name="Paused",type="string",JSONPath=`.status.conditions[?(@.type=="Paused")].status`,description="Reconciliation paused",priority=10 +// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Machine status such as Terminating/Pending/Running/Failed etc" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Machine" +// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version",description="Kubernetes version associated with this Machine" + +// Machine is the Schema for the machines API. +type Machine struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec is the desired state of Machine. + // +required + Spec MachineSpec `json:"spec,omitempty,omitzero"` + // status is the observed state of Machine. + // +optional + Status MachineStatus `json:"status,omitempty,omitzero"` +} + +// GetV1Beta1Conditions returns the set of conditions for this object. +func (m *Machine) GetV1Beta1Conditions() Conditions { + if m.Status.Deprecated == nil || m.Status.Deprecated.V1Beta1 == nil { + return nil + } + return m.Status.Deprecated.V1Beta1.Conditions +} + +// SetV1Beta1Conditions sets the conditions on this object. +func (m *Machine) SetV1Beta1Conditions(conditions Conditions) { + if m.Status.Deprecated == nil { + m.Status.Deprecated = &MachineDeprecatedStatus{} + } + if m.Status.Deprecated.V1Beta1 == nil { + m.Status.Deprecated.V1Beta1 = &MachineV1Beta1DeprecatedStatus{} + } + m.Status.Deprecated.V1Beta1.Conditions = conditions +} + +// GetConditions returns the set of conditions for this object. +func (m *Machine) GetConditions() []metav1.Condition { + return m.Status.Conditions +} + +// SetConditions sets conditions for an API object. +func (m *Machine) SetConditions(conditions []metav1.Condition) { + m.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// MachineList contains a list of Machine. +type MachineList struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + // items is the list of Machines. + Items []Machine `json:"items"` +} + +func init() { + objectTypes = append(objectTypes, &Machine{}, &MachineList{}) +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machinedeployment_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machinedeployment_types.go new file mode 100644 index 0000000000..b7182c278e --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machinedeployment_types.go @@ -0,0 +1,648 @@ +/* +Copyright 2025 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 v1beta2 + +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" + + // MachineDeploymentFinalizer is the finalizer used by the MachineDeployment controller to + // ensure ordered cleanup of corresponding MachineSets when a MachineDeployment is being deleted. + MachineDeploymentFinalizer = "cluster.x-k8s.io/machinedeployment" +) + +// MachineDeploymentRolloutStrategyType defines the type of MachineDeployment rollout strategies. +// +kubebuilder:validation:Enum=RollingUpdate;OnDelete +type MachineDeploymentRolloutStrategyType 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 MachineDeploymentRolloutStrategyType = "RollingUpdate" + + // OnDeleteMachineDeploymentStrategyType replaces old MachineSets when the deletion of the associated machines are completed. + OnDeleteMachineDeploymentStrategyType MachineDeploymentRolloutStrategyType = "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" + + // 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" + + // MachineDeploymentUniqueLabel is used to uniquely identify the Machines of a MachineSet. + // The MachineDeployment controller will set this label on a MachineSet when it is created. + // The label is also applied to the Machines of the MachineSet and used in the MachineSet selector. + // Note: For the lifetime of the MachineSet the label's value has to stay the same, otherwise the + // MachineSet selector would no longer match its Machines. + // Note: In previous Cluster API versions (< v1.4.0), the label value was the hash of the full machine template. + // With the introduction of in-place mutation the machine template of the MachineSet can change. + // Because of that it is impossible that the label's value to always be the hash of the full machine template. + // (Because the hash changes when the machine template changes). + // As a result, we use the hash of the machine template while ignoring all in-place mutable fields, i.e. the + // machine template with only fields that could trigger a rollout for the machine-template-hash, making it + // independent of the changes to any in-place mutable fields. + // A random string is appended at the end of the label value (label value format is "-")) + // to distinguish duplicate MachineSets that have the exact same spec but were created as a result of rolloutAfter. + MachineDeploymentUniqueLabel = "machine-template-hash" +) + +// MachineDeployment's Available condition and corresponding reasons. +const ( + // MachineDeploymentAvailableCondition is true if the MachineDeployment is not deleted, and it has minimum + // availability according to parameters specified in the deployment strategy, e.g. If using RollingUpgrade strategy, + // availableReplicas must be greater or equal than desired replicas - MaxUnavailable replicas. + MachineDeploymentAvailableCondition = AvailableCondition + + // MachineDeploymentAvailableWaitingForReplicasSetReason surfaces when the .spec.replicas + // field of the MachineDeployment is not set. + MachineDeploymentAvailableWaitingForReplicasSetReason = WaitingForReplicasSetReason + + // MachineDeploymentAvailableWaitingForAvailableReplicasSetReason surfaces when the .status.v1beta2.availableReplicas + // field of the MachineDeployment is not set. + MachineDeploymentAvailableWaitingForAvailableReplicasSetReason = "WaitingForAvailableReplicasSet" + + // MachineDeploymentAvailableReason surfaces when a Deployment is available. + MachineDeploymentAvailableReason = AvailableReason + + // MachineDeploymentNotAvailableReason surfaces when a Deployment is not available. + MachineDeploymentNotAvailableReason = NotAvailableReason + + // MachineDeploymentAvailableInternalErrorReason surfaces unexpected failures when computing the Available condition. + MachineDeploymentAvailableInternalErrorReason = InternalErrorReason +) + +// MachineDeployment's MachinesReady condition and corresponding reasons. +const ( + // MachineDeploymentMachinesReadyCondition surfaces detail of issues on the controlled machines, if any. + MachineDeploymentMachinesReadyCondition = MachinesReadyCondition + + // MachineDeploymentMachinesReadyReason surfaces when all the controlled machine's Ready conditions are true. + MachineDeploymentMachinesReadyReason = ReadyReason + + // MachineDeploymentMachinesNotReadyReason surfaces when at least one of the controlled machine's Ready conditions is false. + MachineDeploymentMachinesNotReadyReason = NotReadyReason + + // MachineDeploymentMachinesReadyUnknownReason surfaces when at least one of the controlled machine's Ready conditions is unknown + // and none of the controlled machine's Ready conditions is false. + MachineDeploymentMachinesReadyUnknownReason = ReadyUnknownReason + + // MachineDeploymentMachinesReadyNoReplicasReason surfaces when no machines exist for the MachineDeployment. + MachineDeploymentMachinesReadyNoReplicasReason = NoReplicasReason + + // MachineDeploymentMachinesReadyInternalErrorReason surfaces unexpected failures when listing machines + // or aggregating machine's conditions. + MachineDeploymentMachinesReadyInternalErrorReason = InternalErrorReason +) + +// MachineDeployment's MachinesUpToDate condition and corresponding reasons. +const ( + // MachineDeploymentMachinesUpToDateCondition surfaces details of controlled machines not up to date, if any. + // Note: New machines are considered 10s after machine creation. This gives time to the machine's owner controller to recognize the new machine and add the UpToDate condition. + MachineDeploymentMachinesUpToDateCondition = MachinesUpToDateCondition + + // MachineDeploymentMachinesUpToDateReason surfaces when all the controlled machine's UpToDate conditions are true. + MachineDeploymentMachinesUpToDateReason = UpToDateReason + + // MachineDeploymentMachinesNotUpToDateReason surfaces when at least one of the controlled machine's UpToDate conditions is false. + MachineDeploymentMachinesNotUpToDateReason = NotUpToDateReason + + // MachineDeploymentMachinesUpToDateUnknownReason surfaces when at least one of the controlled machine's UpToDate conditions is unknown + // and none of the controlled machine's UpToDate conditions is false. + MachineDeploymentMachinesUpToDateUnknownReason = UpToDateUnknownReason + + // MachineDeploymentMachinesUpToDateNoReplicasReason surfaces when no machines exist for the MachineDeployment. + MachineDeploymentMachinesUpToDateNoReplicasReason = NoReplicasReason + + // MachineDeploymentMachinesUpToDateInternalErrorReason surfaces unexpected failures when listing machines + // or aggregating status. + MachineDeploymentMachinesUpToDateInternalErrorReason = InternalErrorReason +) + +// MachineDeployment's RollingOut condition and corresponding reasons. +const ( + // MachineDeploymentRollingOutCondition is true if there is at least one machine not up-to-date. + MachineDeploymentRollingOutCondition = RollingOutCondition + + // MachineDeploymentRollingOutReason surfaces when there is at least one machine not up-to-date. + MachineDeploymentRollingOutReason = RollingOutReason + + // MachineDeploymentNotRollingOutReason surfaces when all the machines are up-to-date. + MachineDeploymentNotRollingOutReason = NotRollingOutReason + + // MachineDeploymentRollingOutInternalErrorReason surfaces unexpected failures when listing machines. + MachineDeploymentRollingOutInternalErrorReason = InternalErrorReason +) + +// MachineDeployment's ScalingUp condition and corresponding reasons. +const ( + // MachineDeploymentScalingUpCondition is true if actual replicas < desired replicas. + MachineDeploymentScalingUpCondition = ScalingUpCondition + + // MachineDeploymentScalingUpReason surfaces when actual replicas < desired replicas. + MachineDeploymentScalingUpReason = ScalingUpReason + + // MachineDeploymentNotScalingUpReason surfaces when actual replicas >= desired replicas. + MachineDeploymentNotScalingUpReason = NotScalingUpReason + + // MachineDeploymentScalingUpInternalErrorReason surfaces unexpected failures when listing machines. + MachineDeploymentScalingUpInternalErrorReason = InternalErrorReason + + // MachineDeploymentScalingUpWaitingForReplicasSetReason surfaces when the .spec.replicas + // field of the MachineDeployment is not set. + MachineDeploymentScalingUpWaitingForReplicasSetReason = WaitingForReplicasSetReason +) + +// MachineDeployment's ScalingDown condition and corresponding reasons. +const ( + // MachineDeploymentScalingDownCondition is true if actual replicas > desired replicas. + MachineDeploymentScalingDownCondition = ScalingDownCondition + + // MachineDeploymentScalingDownReason surfaces when actual replicas > desired replicas. + MachineDeploymentScalingDownReason = ScalingDownReason + + // MachineDeploymentNotScalingDownReason surfaces when actual replicas <= desired replicas. + MachineDeploymentNotScalingDownReason = NotScalingDownReason + + // MachineDeploymentScalingDownInternalErrorReason surfaces unexpected failures when listing machines. + MachineDeploymentScalingDownInternalErrorReason = InternalErrorReason + + // MachineDeploymentScalingDownWaitingForReplicasSetReason surfaces when the .spec.replicas + // field of the MachineDeployment is not set. + MachineDeploymentScalingDownWaitingForReplicasSetReason = WaitingForReplicasSetReason +) + +// MachineDeployment's Remediating condition and corresponding reasons. +const ( + // MachineDeploymentRemediatingCondition surfaces details about ongoing remediation of the controlled machines, if any. + MachineDeploymentRemediatingCondition = RemediatingCondition + + // MachineDeploymentRemediatingReason surfaces when the MachineDeployment has at least one machine with HealthCheckSucceeded set to false + // and with the OwnerRemediated condition set to false. + MachineDeploymentRemediatingReason = RemediatingReason + + // MachineDeploymentNotRemediatingReason surfaces when the MachineDeployment does not have any machine with HealthCheckSucceeded set to false + // and with the OwnerRemediated condition set to false. + MachineDeploymentNotRemediatingReason = NotRemediatingReason + + // MachineDeploymentRemediatingInternalErrorReason surfaces unexpected failures when computing the Remediating condition. + MachineDeploymentRemediatingInternalErrorReason = InternalErrorReason +) + +// MachineDeployment's Deleting condition and corresponding reasons. +const ( + // MachineDeploymentDeletingCondition surfaces details about ongoing deletion of the controlled machines. + MachineDeploymentDeletingCondition = DeletingCondition + + // MachineDeploymentNotDeletingReason surfaces when the MachineDeployment is not deleting because the + // DeletionTimestamp is not set. + MachineDeploymentNotDeletingReason = NotDeletingReason + + // MachineDeploymentDeletingReason surfaces when the MachineDeployment is deleting because the + // DeletionTimestamp is set. + MachineDeploymentDeletingReason = DeletingReason + + // MachineDeploymentDeletingInternalErrorReason surfaces unexpected failures when deleting a MachineDeployment. + MachineDeploymentDeletingInternalErrorReason = InternalErrorReason +) + +// MachineDeploymentSpec defines the desired state of MachineDeployment. +type MachineDeploymentSpec struct { + // clusterName is the name of the Cluster this object belongs to. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + ClusterName string `json:"clusterName,omitempty"` + + // replicas is the number of desired machines. + // This is a pointer to distinguish between explicit zero and not specified. + // + // Defaults to: + // * if the Kubernetes autoscaler min size and max size annotations are set: + // - if it's a new MachineDeployment, use min size + // - if the replicas field of the old MachineDeployment is < min size, use min size + // - if the replicas field of the old MachineDeployment is > max size, use max size + // - if the replicas field of the old MachineDeployment is in the (min size, max size) range, keep the value from the oldMD + // * otherwise use 1 + // Note: Defaulting will be run whenever the replicas field is not set: + // * A new MachineDeployment is created with replicas not set. + // * On an existing MachineDeployment the replicas field was first set and is now unset. + // Those cases are especially relevant for the following Kubernetes autoscaler use cases: + // * A new MachineDeployment is created and replicas should be managed by the autoscaler + // * An existing MachineDeployment which initially wasn't controlled by the autoscaler + // should be later controlled by the autoscaler + // +optional + Replicas *int32 `json:"replicas,omitempty"` + + // rollout allows you to configure the behaviour of rolling updates to the MachineDeployment Machines. + // It allows you to require that all Machines are replaced after a certain time, + // and allows you to define the strategy used during rolling replacements. + // +optional + Rollout MachineDeploymentRolloutSpec `json:"rollout,omitempty,omitzero"` + + // selector is the 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. + // +required + Selector metav1.LabelSelector `json:"selector,omitempty,omitzero"` + + // template describes the machines that will be created. + // +required + Template MachineTemplateSpec `json:"template,omitempty,omitzero"` + + // machineNaming allows changing the naming pattern used when creating Machines. + // Note: InfraMachines & BootstrapConfigs will use the same name as the corresponding Machines. + // +optional + MachineNaming MachineNamingSpec `json:"machineNaming,omitempty,omitzero"` + + // remediation controls how unhealthy Machines are remediated. + // +optional + Remediation MachineDeploymentRemediationSpec `json:"remediation,omitempty,omitzero"` + + // deletion contains configuration options for MachineDeployment deletion. + // +optional + Deletion MachineDeploymentDeletionSpec `json:"deletion,omitempty,omitzero"` + + // paused indicates that the deployment is paused. + // +optional + Paused *bool `json:"paused,omitempty"` +} + +// MachineDeploymentRolloutSpec defines the rollout behavior. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentRolloutSpec struct { + // after is a field to indicate a rollout should be performed + // after the specified time even if no changes have been made to the + // MachineDeployment. + // Example: In the YAML the time can be specified in the RFC3339 format. + // To specify the rolloutAfter target as March 9, 2023, at 9 am UTC + // use "2023-03-09T09:00:00Z". + // +optional + After metav1.Time `json:"after,omitempty,omitzero"` + + // strategy specifies how to roll out control plane Machines. + // +optional + Strategy MachineDeploymentRolloutStrategy `json:"strategy,omitempty,omitzero"` +} + +// MachineDeploymentRolloutStrategy describes how to replace existing machines +// with new ones. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentRolloutStrategy struct { + // type of rollout. Allowed values are RollingUpdate and OnDelete. + // Default is RollingUpdate. + // +required + Type MachineDeploymentRolloutStrategyType `json:"type,omitempty"` + + // rollingUpdate is the rolling update config params. Present only if + // type = RollingUpdate. + // +optional + RollingUpdate MachineDeploymentRolloutStrategyRollingUpdate `json:"rollingUpdate,omitempty,omitzero"` +} + +// MachineDeploymentRolloutStrategyRollingUpdate is used to control the desired behavior of rolling update. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentRolloutStrategyRollingUpdate struct { + // maxUnavailable is 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"` + + // maxSurge is 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"` +} + +// MachineDeploymentRemediationSpec controls how unhealthy Machines are remediated. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentRemediationSpec struct { + // maxInFlight determines how many in flight remediations should happen at the same time. + // + // Remediation only happens on the MachineSet with the most current revision, while + // older MachineSets (usually present during rollout operations) aren't allowed to remediate. + // + // Note: In general (independent of remediations), unhealthy machines are always + // prioritized during scale down operations over healthy ones. + // + // MaxInFlight can be set to a fixed number or a percentage. + // Example: when this is set to 20%, the MachineSet controller deletes at most 20% of + // the desired replicas. + // + // If not set, remediation is limited to all machines (bounded by replicas) + // under the active MachineSet's management. + // + // +optional + MaxInFlight *intstr.IntOrString `json:"maxInFlight,omitempty"` +} + +// MachineNamingSpec allows changing the naming pattern used when creating +// Machines. +// Note: InfraMachines & BootstrapConfigs will use the same name as the corresponding Machines. +// +kubebuilder:validation:MinProperties=1 +type MachineNamingSpec struct { + // template defines the template to use for generating the names of the + // Machine objects. + // If not defined, it will fallback to `{{ .machineSet.name }}-{{ .random }}`. + // If the generated name string exceeds 63 characters, it will be trimmed to + // 58 characters and will + // get concatenated with a random suffix of length 5. + // Length of the template string must not exceed 256 characters. + // The template allows the following variables `.cluster.name`, + // `.machineSet.name` and `.random`. + // The variable `.cluster.name` retrieves the name of the cluster object + // that owns the Machines being created. + // The variable `.machineSet.name` retrieves the name of the MachineSet + // object that owns the Machines being created. + // The variable `.random` is substituted with random alphanumeric string, + // without vowels, of length 5. This variable is required part of the + // template. If not provided, validation will fail. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=256 + Template string `json:"template,omitempty"` +} + +// MachineDeploymentDeletionSpec contains configuration options for MachineDeployment deletion. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentDeletionSpec struct { + // order defines the order in which Machines are deleted when downscaling. + // Defaults to "Random". Valid values are "Random, "Newest", "Oldest" + // +optional + Order MachineSetDeletionOrder `json:"order,omitempty"` +} + +// MachineDeploymentStatus defines the observed state of MachineDeployment. +// +kubebuilder:validation:MinProperties=1 +type MachineDeploymentStatus struct { + // conditions represents the observations of a MachineDeployment's current state. + // Known condition types are Available, MachinesReady, MachinesUpToDate, ScalingUp, ScalingDown, Remediating, Deleting, Paused. + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=32 + Conditions []metav1.Condition `json:"conditions,omitempty"` + + // observedGeneration is the generation observed by the deployment controller. + // +optional + // +kubebuilder:validation:Minimum=1 + 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 + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=4096 + Selector string `json:"selector,omitempty"` + + // replicas is the total number of non-terminated machines targeted by this deployment + // (their labels match the selector). + // +optional + Replicas *int32 `json:"replicas,omitempty"` + + // readyReplicas is the number of ready replicas for this MachineDeployment. A machine is considered ready when Machine's Ready condition is true. + // +optional + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + + // availableReplicas is the number of available replicas for this MachineDeployment. A machine is considered available when Machine's Available condition is true. + // +optional + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + + // upToDateReplicas is the number of up-to-date replicas targeted by this deployment. A machine is considered up-to-date when Machine's UpToDate condition is true. + // +optional + UpToDateReplicas *int32 `json:"upToDateReplicas,omitempty"` + + // phase represents the current phase of a MachineDeployment (ScalingUp, ScalingDown, Running, Failed, or Unknown). + // +optional + // +kubebuilder:validation:Enum=ScalingUp;ScalingDown;Running;Failed;Unknown + Phase string `json:"phase,omitempty"` + + // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. + // +optional + Deprecated *MachineDeploymentDeprecatedStatus `json:"deprecated,omitempty"` +} + +// MachineDeploymentDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachineDeploymentDeprecatedStatus struct { + // v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. + // +optional + V1Beta1 *MachineDeploymentV1Beta1DeprecatedStatus `json:"v1beta1,omitempty"` +} + +// MachineDeploymentV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachineDeploymentV1Beta1DeprecatedStatus struct { + // conditions defines current service state of the MachineDeployment. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + Conditions Conditions `json:"conditions,omitempty"` + + // updatedReplicas is the total number of non-terminated machines targeted by this deployment + // that have the desired template spec. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + UpdatedReplicas int32 `json:"updatedReplicas"` //nolint:kubeapilinter // field will be removed when v1beta1 is removed + + // readyReplicas is the total number of ready machines targeted by this deployment. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + ReadyReplicas int32 `json:"readyReplicas"` //nolint:kubeapilinter // field will be removed when v1beta1 is removed + + // availableReplicas is the total number of available machines (ready for at least minReadySeconds) + // targeted by this deployment. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + AvailableReplicas int32 `json:"availableReplicas"` //nolint:kubeapilinter // field will be removed when v1beta1 is removed + + // unavailableReplicas is the 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. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + UnavailableReplicas int32 `json:"unavailableReplicas"` //nolint:kubeapilinter // field will be removed when v1beta1 is removed +} + +// 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. + // + // Deprecated: This enum value is deprecated; the Failed phase won't be set anymore by controllers, and it is preserved only + // for conversion from v1beta1 objects; the Failed phase is going to be removed when support for v1beta1 will be dropped. + // Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + 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="Available",type="string",JSONPath=`.status.conditions[?(@.type=="Available")].status`,description="Cluster pass all availability checks" +// +kubebuilder:printcolumn:name="Desired",type=integer,JSONPath=".spec.replicas",description="The desired number of machines" +// +kubebuilder:printcolumn:name="Current",type="integer",JSONPath=".status.replicas",description="The number of machines" +// +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="The number of machines with Ready condition true" +// +kubebuilder:printcolumn:name="Available",type=integer,JSONPath=".status.availableReplicas",description="The number of machines with Available condition true" +// +kubebuilder:printcolumn:name="Up-to-date",type=integer,JSONPath=".status.upToDateReplicas",description="The number of machines with UpToDate condition true" +// +kubebuilder:printcolumn:name="Paused",type="string",JSONPath=`.status.conditions[?(@.type=="Paused")].status`,description="Reconciliation paused",priority=10 +// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="MachineDeployment status such as ScalingUp/ScalingDown/Running/Failed/Unknown" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachineDeployment" +// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.template.spec.version",description="Kubernetes version associated with this MachineDeployment" + +// MachineDeployment is the Schema for the machinedeployments API. +type MachineDeployment struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec is the desired state of MachineDeployment. + // +required + Spec MachineDeploymentSpec `json:"spec,omitempty,omitzero"` + // status is the observed state of MachineDeployment. + // +optional + Status MachineDeploymentStatus `json:"status,omitempty,omitzero"` +} + +// +kubebuilder:object:root=true + +// MachineDeploymentList contains a list of MachineDeployment. +type MachineDeploymentList struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + // items is the list of MachineDeployments. + Items []MachineDeployment `json:"items"` +} + +func init() { + objectTypes = append(objectTypes, &MachineDeployment{}, &MachineDeploymentList{}) +} + +// GetV1Beta1Conditions returns the set of conditions for the machinedeployment. +func (m *MachineDeployment) GetV1Beta1Conditions() Conditions { + if m.Status.Deprecated == nil || m.Status.Deprecated.V1Beta1 == nil { + return nil + } + return m.Status.Deprecated.V1Beta1.Conditions +} + +// SetV1Beta1Conditions updates the set of conditions on the machinedeployment. +func (m *MachineDeployment) SetV1Beta1Conditions(conditions Conditions) { + if m.Status.Deprecated == nil { + m.Status.Deprecated = &MachineDeploymentDeprecatedStatus{} + } + if m.Status.Deprecated.V1Beta1 == nil { + m.Status.Deprecated.V1Beta1 = &MachineDeploymentV1Beta1DeprecatedStatus{} + } + m.Status.Deprecated.V1Beta1.Conditions = conditions +} + +// GetConditions returns the set of conditions for this object. +func (m *MachineDeployment) GetConditions() []metav1.Condition { + return m.Status.Conditions +} + +// SetConditions sets conditions for an API object. +func (m *MachineDeployment) SetConditions(conditions []metav1.Condition) { + m.Status.Conditions = conditions +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machinedrainrules_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machinedrainrules_types.go new file mode 100644 index 0000000000..baac401f0d --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machinedrainrules_types.go @@ -0,0 +1,235 @@ +/* +Copyright 2025 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 v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +const ( + // PodDrainLabel is the label that can be set on Pods in workload clusters to ensure a Pod is not drained. + // The only valid values are "skip" and "wait-completed". + // This label takes precedence over MachineDrainRules defined in the management cluster. + PodDrainLabel = "cluster.x-k8s.io/drain" +) + +// MachineDrainRuleDrainBehavior defines the drain behavior. Can be either "Drain", "Skip", or "WaitCompleted". +// +kubebuilder:validation:Enum=Drain;Skip;WaitCompleted +type MachineDrainRuleDrainBehavior string + +const ( + // MachineDrainRuleDrainBehaviorDrain means a Pod should be drained. + MachineDrainRuleDrainBehaviorDrain MachineDrainRuleDrainBehavior = "Drain" + + // MachineDrainRuleDrainBehaviorSkip means the drain for a Pod should be skipped. + MachineDrainRuleDrainBehaviorSkip MachineDrainRuleDrainBehavior = "Skip" + + // MachineDrainRuleDrainBehaviorWaitCompleted means the Pod should not be evicted, + // but overall drain should wait until the Pod completes. + MachineDrainRuleDrainBehaviorWaitCompleted MachineDrainRuleDrainBehavior = "WaitCompleted" +) + +// MachineDrainRuleSpec defines the spec of a MachineDrainRule. +type MachineDrainRuleSpec struct { + // drain configures if and how Pods are drained. + // +required + Drain MachineDrainRuleDrainConfig `json:"drain,omitempty,omitzero"` + + // machines defines to which Machines this MachineDrainRule should be applied. + // + // If machines is not set, the MachineDrainRule applies to all Machines in the Namespace. + // If machines contains multiple selectors, the results are ORed. + // Within a single Machine selector the results of selector and clusterSelector are ANDed. + // Machines will be selected from all Clusters in the Namespace unless otherwise + // restricted with the clusterSelector. + // + // Example: Selects control plane Machines in all Clusters or + // Machines with label "os" == "linux" in Clusters with label + // "stage" == "production". + // + // - selector: + // matchExpressions: + // - key: cluster.x-k8s.io/control-plane + // operator: Exists + // - selector: + // matchLabels: + // os: linux + // clusterSelector: + // matchExpressions: + // - key: stage + // operator: In + // values: + // - production + // + // +optional + // +listType=atomic + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=32 + // +kubebuilder:validation:XValidation:rule="self.all(x, self.exists_one(y, x == y))",message="entries in machines must be unique" + Machines []MachineDrainRuleMachineSelector `json:"machines,omitempty"` + + // pods defines to which Pods this MachineDrainRule should be applied. + // + // If pods is not set, the MachineDrainRule applies to all Pods in all Namespaces. + // If pods contains multiple selectors, the results are ORed. + // Within a single Pod selector the results of selector and namespaceSelector are ANDed. + // Pods will be selected from all Namespaces unless otherwise + // restricted with the namespaceSelector. + // + // Example: Selects Pods with label "app" == "logging" in all Namespaces or + // Pods with label "app" == "prometheus" in the "monitoring" + // Namespace. + // + // - selector: + // matchExpressions: + // - key: app + // operator: In + // values: + // - logging + // - selector: + // matchLabels: + // app: prometheus + // namespaceSelector: + // matchLabels: + // kubernetes.io/metadata.name: monitoring + // + // +optional + // +listType=atomic + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=32 + // +kubebuilder:validation:XValidation:rule="self.all(x, self.exists_one(y, x == y))",message="entries in pods must be unique" + Pods []MachineDrainRulePodSelector `json:"pods,omitempty"` +} + +// MachineDrainRuleDrainConfig configures if and how Pods are drained. +type MachineDrainRuleDrainConfig struct { + // behavior defines the drain behavior. + // Can be either "Drain", "Skip", or "WaitCompleted". + // "Drain" means that the Pods to which this MachineDrainRule applies will be drained. + // If behavior is set to "Drain" the order in which Pods are drained can be configured + // with the order field. When draining Pods of a Node the Pods will be grouped by order + // and one group after another will be drained (by increasing order). Cluster API will + // wait until all Pods of a group are terminated / removed from the Node before starting + // with the next group. + // "Skip" means that the Pods to which this MachineDrainRule applies will be skipped during drain. + // "WaitCompleted" means that the pods to which this MachineDrainRule applies will never be evicted + // and we wait for them to be completed, it is enforced that pods marked with this behavior always have Order=0. + // +required + Behavior MachineDrainRuleDrainBehavior `json:"behavior,omitempty"` + + // order defines the order in which Pods are drained. + // Pods with higher order are drained after Pods with lower order. + // order can only be set if behavior is set to "Drain". + // If order is not set, 0 will be used. + // Valid values for order are from -2147483648 to 2147483647 (inclusive). + // +optional + Order *int32 `json:"order,omitempty"` +} + +// MachineDrainRuleMachineSelector defines to which Machines this MachineDrainRule should be applied. +// +kubebuilder:validation:MinProperties=1 +type MachineDrainRuleMachineSelector struct { + // selector is a label selector which selects Machines by their labels. + // This field follows standard label selector semantics; if not present or + // empty, it selects all Machines. + // + // If clusterSelector is also set, then the selector as a whole selects + // Machines matching selector belonging to Clusters selected by clusterSelector. + // If clusterSelector is not set, it selects all Machines matching selector in + // all Clusters. + // +optional + Selector *metav1.LabelSelector `json:"selector,omitempty"` + + // clusterSelector is a label selector which selects Machines by the labels of + // their Clusters. + // This field follows standard label selector semantics; if not present or + // empty, it selects Machines of all Clusters. + // + // If selector is also set, then the selector as a whole selects + // Machines matching selector belonging to Clusters selected by clusterSelector. + // If selector is not set, it selects all Machines belonging to Clusters + // selected by clusterSelector. + // +optional + ClusterSelector *metav1.LabelSelector `json:"clusterSelector,omitempty"` +} + +// MachineDrainRulePodSelector defines to which Pods this MachineDrainRule should be applied. +// +kubebuilder:validation:MinProperties=1 +type MachineDrainRulePodSelector struct { + // selector is a label selector which selects Pods by their labels. + // This field follows standard label selector semantics; if not present or + // empty, it selects all Pods. + // + // If namespaceSelector is also set, then the selector as a whole selects + // Pods matching selector in Namespaces selected by namespaceSelector. + // If namespaceSelector is not set, it selects all Pods matching selector in + // all Namespaces. + // +optional + Selector *metav1.LabelSelector `json:"selector,omitempty"` + + // namespaceSelector is a label selector which selects Pods by the labels of + // their Namespaces. + // This field follows standard label selector semantics; if not present or + // empty, it selects Pods of all Namespaces. + // + // If selector is also set, then the selector as a whole selects + // Pods matching selector in Namespaces selected by namespaceSelector. + // If selector is not set, it selects all Pods in Namespaces selected by + // namespaceSelector. + // +optional + NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=machinedrainrules,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Behavior",type="string",JSONPath=".spec.drain.behavior",description="Drain behavior" +// +kubebuilder:printcolumn:name="Order",type="string",JSONPath=".spec.drain.order",description="Drain order" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of the MachineDrainRule" + +// MachineDrainRule is the Schema for the MachineDrainRule API. +type MachineDrainRule struct { + metav1.TypeMeta `json:",inline"` + + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +required + metav1.ObjectMeta `json:"metadata"` + + // spec defines the spec of a MachineDrainRule. + // +required + Spec MachineDrainRuleSpec `json:"spec,omitempty,omitzero"` +} + +// +kubebuilder:object:root=true + +// MachineDrainRuleList contains a list of MachineDrainRules. +type MachineDrainRuleList struct { + metav1.TypeMeta `json:",inline"` + + // metadata is the standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds + // +required + metav1.ListMeta `json:"metadata"` + + // items contains the items of the MachineDrainRuleList. + Items []MachineDrainRule `json:"items"` +} + +func init() { + objectTypes = append(objectTypes, &MachineDrainRule{}, &MachineDrainRuleList{}) +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machinehealthcheck_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machinehealthcheck_types.go new file mode 100644 index 0000000000..9a7e31cae4 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machinehealthcheck_types.go @@ -0,0 +1,372 @@ +/* +Copyright 2025 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 v1beta2 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/util/intstr" +) + +// MachineHealthCheck's RemediationAllowed condition and corresponding reasons. +const ( + // MachineHealthCheckRemediationAllowedCondition surfaces whether the MachineHealthCheck is + // allowed to remediate any Machines or whether it is blocked from remediating any further. + MachineHealthCheckRemediationAllowedCondition = "RemediationAllowed" + + // MachineHealthCheckTooManyUnhealthyReason is the reason used when too many Machines are unhealthy and + // the MachineHealthCheck is blocked from making any further remediation. + MachineHealthCheckTooManyUnhealthyReason = "TooManyUnhealthy" + + // MachineHealthCheckRemediationAllowedReason is the reason used when the number of unhealthy machine + // is within the limits defined by the MachineHealthCheck, and thus remediation is allowed. + MachineHealthCheckRemediationAllowedReason = "RemediationAllowed" +) + +var ( + // DefaultNodeStartupTimeoutSeconds is the time allowed for a node to start up. + // Can be made longer as part of spec if required for particular provider. + // 10 minutes should allow the instance to start and the node to join the + // cluster on most providers. + DefaultNodeStartupTimeoutSeconds = int32(600) +) + +// MachineHealthCheckSpec defines the desired state of MachineHealthCheck. +type MachineHealthCheckSpec struct { + // clusterName is the name of the Cluster this object belongs to. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + ClusterName string `json:"clusterName,omitempty"` + + // selector is a label selector to match machines whose health will be exercised + // +required + Selector metav1.LabelSelector `json:"selector,omitempty,omitzero"` + + // checks are the checks that are used to evaluate if a Machine is healthy. + // + // Independent of this configuration the MachineHealthCheck controller will always + // flag Machines with `cluster.x-k8s.io/remediate-machine` annotation and + // Machines with deleted Nodes as unhealthy. + // + // Furthermore, if checks.nodeStartupTimeoutSeconds is not set it + // is defaulted to 10 minutes and evaluated accordingly. + // + // +optional + Checks MachineHealthCheckChecks `json:"checks,omitempty,omitzero"` + + // remediation configures if and how remediations are triggered if a Machine is unhealthy. + // + // If remediation or remediation.triggerIf is not set, + // remediation will always be triggered for unhealthy Machines. + // + // If remediation or remediation.templateRef is not set, + // the OwnerRemediated condition will be set on unhealthy Machines to trigger remediation via + // the owner of the Machines, for example a MachineSet or a KubeadmControlPlane. + // + // +optional + Remediation MachineHealthCheckRemediation `json:"remediation,omitempty,omitzero"` +} + +// MachineHealthCheckChecks are the checks that are used to evaluate if a Machine is healthy. +// +kubebuilder:validation:MinProperties=1 +type MachineHealthCheckChecks struct { + // nodeStartupTimeoutSeconds allows to set the maximum time for MachineHealthCheck + // to consider a Machine unhealthy if a corresponding Node isn't associated + // through a `Spec.ProviderID` field. + // + // The duration set in this field is compared to the greatest of: + // - Cluster's infrastructure ready condition timestamp (if and when available) + // - Control Plane's initialized condition timestamp (if and when available) + // - Machine's infrastructure ready condition timestamp (if and when available) + // - Machine's metadata creation timestamp + // + // Defaults to 10 minutes. + // If you wish to disable this feature, set the value explicitly to 0. + // +optional + // +kubebuilder:validation:Minimum=0 + NodeStartupTimeoutSeconds *int32 `json:"nodeStartupTimeoutSeconds,omitempty"` + + // unhealthyNodeConditions contains a list of 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. + // + // +optional + // +listType=atomic + // +kubebuilder:validation:MinItems=1 + // +kubebuilder:validation:MaxItems=100 + UnhealthyNodeConditions []UnhealthyNodeCondition `json:"unhealthyNodeConditions,omitempty"` +} + +// MachineHealthCheckRemediation configures if and how remediations are triggered if a Machine is unhealthy. +// +kubebuilder:validation:MinProperties=1 +type MachineHealthCheckRemediation struct { + // triggerIf configures if remediations are triggered. + // If this field is not set, remediations are always triggered. + // +optional + TriggerIf MachineHealthCheckRemediationTriggerIf `json:"triggerIf,omitempty,omitzero"` + + // templateRef 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 + TemplateRef MachineHealthCheckRemediationTemplateReference `json:"templateRef,omitempty,omitzero"` +} + +// MachineHealthCheckRemediationTriggerIf configures if remediations are triggered. +// +kubebuilder:validation:MinProperties=1 +type MachineHealthCheckRemediationTriggerIf struct { + // unhealthyLessThanOrEqualTo specifies that remediations are only triggered if the number of + // unhealthy Machines is less than or equal to the configured value. + // unhealthyInRange takes precedence if set. + // + // +optional + UnhealthyLessThanOrEqualTo *intstr.IntOrString `json:"unhealthyLessThanOrEqualTo,omitempty"` + + // unhealthyInRange specifies that remediations are only triggered if the number of + // unhealthy Machines is in the configured range. + // Takes precedence over unhealthyLessThanOrEqualTo. + // 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]+\]$ + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=32 + UnhealthyInRange string `json:"unhealthyInRange,omitempty"` +} + +// MachineHealthCheckRemediationTemplateReference is a reference to a remediation template. +type MachineHealthCheckRemediationTemplateReference struct { + // kind of the remediation template. + // kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:Pattern=`^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$` + Kind string `json:"kind,omitempty"` + + // name of the remediation template. + // name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$` + Name string `json:"name,omitempty"` + + // apiVersion of the remediation template. + // apiVersion must be fully qualified domain name followed by / and a version. + // NOTE: This field must be kept in sync with the APIVersion of the remediation template. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=317 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*\/[a-z]([-a-z0-9]*[a-z0-9])?$` + APIVersion string `json:"apiVersion,omitempty"` +} + +// IsDefined returns true if the MachineHealthCheckRemediationTemplateReference is set. +func (r *MachineHealthCheckRemediationTemplateReference) IsDefined() bool { + if r == nil { + return false + } + return r.Kind != "" || r.Name != "" || r.APIVersion != "" +} + +// ToObjectReference returns an object reference for the MachineHealthCheckRemediationTemplateReference in a given namespace. +func (r *MachineHealthCheckRemediationTemplateReference) ToObjectReference(namespace string) *corev1.ObjectReference { + if r == nil { + return nil + } + return &corev1.ObjectReference{ + APIVersion: r.APIVersion, + Kind: r.Kind, + Namespace: namespace, + Name: r.Name, + } +} + +// GroupVersionKind gets the GroupVersionKind for a MachineHealthCheckRemediationTemplateReference. +func (r *MachineHealthCheckRemediationTemplateReference) GroupVersionKind() schema.GroupVersionKind { + return schema.FromAPIVersionAndKind(r.APIVersion, r.Kind) +} + +// UnhealthyNodeCondition 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 UnhealthyNodeCondition struct { + // type of Node condition + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MinLength=1 + // +required + Type corev1.NodeConditionType `json:"type,omitempty"` + + // status of the condition, one of True, False, Unknown. + // +kubebuilder:validation:Type=string + // +kubebuilder:validation:MinLength=1 + // +required + Status corev1.ConditionStatus `json:"status,omitempty"` + + // timeoutSeconds is the duration that a node must be in a given status for, + // after which the node is considered unhealthy. + // For example, with a value of "1h", the node must match the status + // for at least 1 hour before being considered unhealthy. + // +required + // +kubebuilder:validation:Minimum=0 + TimeoutSeconds *int32 `json:"timeoutSeconds,omitempty"` +} + +// MachineHealthCheckStatus defines the observed state of MachineHealthCheck. +// +kubebuilder:validation:MinProperties=1 +type MachineHealthCheckStatus struct { + // conditions represents the observations of a MachineHealthCheck's current state. + // Known condition types are RemediationAllowed, Paused. + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=32 + Conditions []metav1.Condition `json:"conditions,omitempty"` + + // expectedMachines is the total number of machines counted by this machine health check + // +kubebuilder:validation:Minimum=0 + // +optional + ExpectedMachines *int32 `json:"expectedMachines,omitempty"` + + // currentHealthy is the total number of healthy machines counted by this machine health check + // +kubebuilder:validation:Minimum=0 + // +optional + 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 + // +optional + RemediationsAllowed *int32 `json:"remediationsAllowed,omitempty"` + + // observedGeneration is the latest generation observed by the controller. + // +optional + // +kubebuilder:validation:Minimum=1 + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // targets shows the current list of machines the machine health check is watching + // +optional + // +listType=atomic + // +kubebuilder:validation:MaxItems=10000 + // +kubebuilder:validation:items:MinLength=1 + // +kubebuilder:validation:items:MaxLength=253 + Targets []string `json:"targets,omitempty"` + + // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. + // +optional + Deprecated *MachineHealthCheckDeprecatedStatus `json:"deprecated,omitempty"` +} + +// MachineHealthCheckDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachineHealthCheckDeprecatedStatus struct { + // v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. + // +optional + V1Beta1 *MachineHealthCheckV1Beta1DeprecatedStatus `json:"v1beta1,omitempty"` +} + +// MachineHealthCheckV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachineHealthCheckV1Beta1DeprecatedStatus struct { + // conditions defines current service state of the MachineHealthCheck. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + Conditions Conditions `json:"conditions,omitempty"` +} + +// +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="Replicas",type="integer",JSONPath=".status.expectedMachines",description="Number of machines currently monitored" +// +kubebuilder:printcolumn:name="Healthy",type="integer",JSONPath=".status.currentHealthy",description="Current observed healthy machines" +// +kubebuilder:printcolumn:name="Paused",type="string",JSONPath=`.status.conditions[?(@.type=="Paused")].status`,description="Reconciliation paused",priority=10 +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachineHealthCheck" + +// MachineHealthCheck is the Schema for the machinehealthchecks API. +type MachineHealthCheck struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec is the specification of machine health check policy + // +required + Spec MachineHealthCheckSpec `json:"spec,omitempty,omitzero"` + + // status is the most recently observed status of MachineHealthCheck resource + // +optional + Status MachineHealthCheckStatus `json:"status,omitempty,omitzero"` +} + +// GetV1Beta1Conditions returns the set of conditions for this object. +func (m *MachineHealthCheck) GetV1Beta1Conditions() Conditions { + if m.Status.Deprecated == nil || m.Status.Deprecated.V1Beta1 == nil { + return nil + } + return m.Status.Deprecated.V1Beta1.Conditions +} + +// SetV1Beta1Conditions sets the conditions on this object. +func (m *MachineHealthCheck) SetV1Beta1Conditions(conditions Conditions) { + if m.Status.Deprecated == nil { + m.Status.Deprecated = &MachineHealthCheckDeprecatedStatus{} + } + if m.Status.Deprecated.V1Beta1 == nil { + m.Status.Deprecated.V1Beta1 = &MachineHealthCheckV1Beta1DeprecatedStatus{} + } + m.Status.Deprecated.V1Beta1.Conditions = conditions +} + +// GetConditions returns the set of conditions for this object. +func (m *MachineHealthCheck) GetConditions() []metav1.Condition { + return m.Status.Conditions +} + +// SetConditions sets conditions for an API object. +func (m *MachineHealthCheck) SetConditions(conditions []metav1.Condition) { + m.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// MachineHealthCheckList contains a list of MachineHealthCheck. +type MachineHealthCheckList struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + // items is the list of MachineHealthChecks. + Items []MachineHealthCheck `json:"items"` +} + +func init() { + objectTypes = append(objectTypes, &MachineHealthCheck{}, &MachineHealthCheckList{}) +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machinepool_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machinepool_types.go new file mode 100644 index 0000000000..a6d16aff14 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machinepool_types.go @@ -0,0 +1,398 @@ +/* +Copyright 2025 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 v1beta2 + +import ( + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + capierrors "sigs.k8s.io/cluster-api/errors" +) + +const ( + // MachinePoolFinalizer is used to ensure deletion of dependencies (nodes, infra). + MachinePoolFinalizer = "machinepool.cluster.x-k8s.io" +) + +/* +NOTE: we are commenting const for MachinePool's V1Beta2 conditions and reasons because not yet implemented for the 1.9 CAPI release. +However, we are keeping the v1beta2 struct in the MachinePool struct because the code that will collect conditions and replica +counters at cluster level is already implemented. + +// Conditions that will be used for the MachinePool object in v1Beta2 API version. +const ( + // MachinePoolAvailableCondition is true when InfrastructureReady and available replicas >= desired replicas. + MachinePoolAvailableCondition = clusterv1.AvailableCondition + + // MachinePoolBootstrapConfigReadyCondition mirrors the corresponding condition from the MachinePool's BootstrapConfig resource. + MachinePoolBootstrapConfigReadyCondition = clusterv1.BootstrapConfigReadyCondition + + // MachinePoolInfrastructureReadyCondition mirrors the corresponding condition from the MachinePool's Infrastructure resource. + MachinePoolInfrastructureReadyCondition = clusterv1.InfrastructureReadyCondition + + // MachinePoolMachinesReadyCondition surfaces detail of issues on the controlled machines, if any. + MachinePoolMachinesReadyCondition = clusterv1.MachinesReadyCondition + + // MachinePoolMachinesUpToDateCondition surfaces details of controlled machines not up to date, if any. + MachinePoolMachinesUpToDateCondition = clusterv1.MachinesUpToDateCondition + + // MachinePoolScalingUpCondition is true if available replicas < desired replicas. + MachinePoolScalingUpCondition = clusterv1.ScalingUpCondition + + // MachinePoolScalingDownCondition is true if replicas > desired replicas. + MachinePoolScalingDownCondition = clusterv1.ScalingDownCondition + + // MachinePoolRemediatingCondition surfaces details about ongoing remediation of the controlled machines, if any. + MachinePoolRemediatingCondition = clusterv1.RemediatingCondition + + // MachinePoolDeletingCondition surfaces details about ongoing deletion of the controlled machines. + MachinePoolDeletingCondition = clusterv1.DeletingCondition +). +*/ + +// MachinePoolSpec defines the desired state of MachinePool. +type MachinePoolSpec struct { + // clusterName is the name of the Cluster this object belongs to. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + ClusterName string `json:"clusterName,omitempty"` + + // replicas is the number of desired machines. Defaults to 1. + // This is a pointer to distinguish between explicit zero and not specified. + // +optional + Replicas *int32 `json:"replicas,omitempty"` + + // template describes the machines that will be created. + // +required + Template MachineTemplateSpec `json:"template,omitempty,omitzero"` + + // 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 + // +listType=atomic + // +kubebuilder:validation:MaxItems=10000 + // +kubebuilder:validation:items:MinLength=1 + // +kubebuilder:validation:items:MaxLength=512 + ProviderIDList []string `json:"providerIDList,omitempty"` + + // failureDomains is the list of failure domains this MachinePool should be attached to. + // +optional + // +listType=atomic + // +kubebuilder:validation:MaxItems=100 + // +kubebuilder:validation:items:MinLength=1 + // +kubebuilder:validation:items:MaxLength=256 + FailureDomains []string `json:"failureDomains,omitempty"` +} + +// MachinePoolStatus defines the observed state of MachinePool. +// +kubebuilder:validation:MinProperties=1 +type MachinePoolStatus struct { + // conditions represents the observations of a MachinePool's current state. + // Known condition types are Available, BootstrapConfigReady, InfrastructureReady, MachinesReady, MachinesUpToDate, + // ScalingUp, ScalingDown, Remediating, Deleting, Paused. + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=32 + Conditions []metav1.Condition `json:"conditions,omitempty"` + + // initialization provides observations of the MachinePool initialization process. + // NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial MachinePool provisioning. + // +optional + Initialization MachinePoolInitializationStatus `json:"initialization,omitempty,omitzero"` + + // nodeRefs will point to the corresponding Nodes if it they exist. + // +optional + // +listType=atomic + // +kubebuilder:validation:MaxItems=10000 + NodeRefs []corev1.ObjectReference `json:"nodeRefs,omitempty"` + + // replicas is the most recently observed number of replicas. + // +optional + Replicas *int32 `json:"replicas,omitempty"` + + // readyReplicas is the number of ready replicas for this MachinePool. A machine is considered ready when Machine's Ready condition is true. + // +optional + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + + // availableReplicas is the number of available replicas for this MachinePool. A machine is considered available when Machine's Available condition is true. + // +optional + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + + // upToDateReplicas is the number of up-to-date replicas targeted by this MachinePool. A machine is considered up-to-date when Machine's UpToDate condition is true. + // +optional + UpToDateReplicas *int32 `json:"upToDateReplicas,omitempty"` + + // phase represents the current phase of cluster actuation. + // +optional + // +kubebuilder:validation:Enum=Pending;Provisioning;Provisioned;Running;ScalingUp;ScalingDown;Scaling;Deleting;Failed;Unknown + Phase string `json:"phase,omitempty"` + + // observedGeneration is the latest generation observed by the controller. + // +optional + // +kubebuilder:validation:Minimum=1 + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. + // +optional + Deprecated *MachinePoolDeprecatedStatus `json:"deprecated,omitempty"` +} + +// MachinePoolInitializationStatus provides observations of the MachinePool initialization process. +// NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial MachinePool provisioning. +// +kubebuilder:validation:MinProperties=1 +type MachinePoolInitializationStatus struct { + // infrastructureProvisioned is true when the infrastructure provider reports that MachinePool's infrastructure is fully provisioned. + // NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. + // The value of this field is never updated after provisioning is completed. + // +optional + InfrastructureProvisioned *bool `json:"infrastructureProvisioned,omitempty"` + + // bootstrapDataSecretCreated is true when the bootstrap provider reports that the MachinePool's boostrap secret is created. + // NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. + // The value of this field is never updated after provisioning is completed. + // +optional + BootstrapDataSecretCreated *bool `json:"bootstrapDataSecretCreated,omitempty"` +} + +// MachinePoolDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachinePoolDeprecatedStatus struct { + // v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. + // +optional + V1Beta1 *MachinePoolV1Beta1DeprecatedStatus `json:"v1beta1,omitempty"` +} + +// MachinePoolV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachinePoolV1Beta1DeprecatedStatus struct { + // conditions define the current service state of the MachinePool. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + Conditions Conditions `json:"conditions,omitempty"` + + // failureReason indicates that there is a problem reconciling the state, and + // will be set to a token value suitable for programmatic interpretation. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +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. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=10240 + FailureMessage *string `json:"failureMessage,omitempty"` //nolint:kubeapilinter // field will be removed when v1beta1 is removed + + // readyReplicas is the number of ready replicas for this MachinePool. A machine is considered ready when the node has been created and is "Ready". + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + ReadyReplicas int32 `json:"readyReplicas,omitempty"` //nolint:kubeapilinter // field will be removed when v1beta1 is removed + + // availableReplicas is the number of available replicas (ready for at least minReadySeconds) for this MachinePool. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + AvailableReplicas int32 `json:"availableReplicas,omitempty"` //nolint:kubeapilinter // field will be removed when v1beta1 is removed + + // unavailableReplicas is the 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. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"` //nolint:kubeapilinter // field will be removed when v1beta1 is removed +} + +// 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") + + // MachinePoolPhaseScaling is the MachinePool state when the + // MachinePool infrastructure is scaling. + // This phase value is appropriate to indicate an active state of scaling by an external autoscaler. + MachinePoolPhaseScaling = MachinePoolPhase("Scaling") + + // 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. + // + // Deprecated: This enum value is deprecated; the Failed phase won't be set anymore by controllers, and it is preserved only + // for conversion from v1beta1 objects; the Failed phase is going to be removed when support for v1beta1 will be dropped. + // Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + 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, + MachinePoolPhaseScaling, + 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="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" +// +kubebuilder:printcolumn:name="Desired",type=integer,JSONPath=".spec.replicas",description="The desired number of machines" +// +kubebuilder:printcolumn:name="Current",type="integer",JSONPath=".status.replicas",description="The number of machines" +// +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="The number of machines with Ready condition true" +// +kubebuilder:printcolumn:name="Available",type=integer,JSONPath=".status.availableReplicas",description="The number of machines with Available condition true" +// +kubebuilder:printcolumn:name="Up-to-date",type=integer,JSONPath=".status.upToDateReplicas",description="The number of machines with UpToDate condition true" +// +kubebuilder:printcolumn:name="Paused",type="string",JSONPath=`.status.conditions[?(@.type=="Paused")].status`,description="Reconciliation paused",priority=10 +// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="MachinePool status such as Terminating/Pending/Provisioning/Running/Failed etc" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachinePool" +// +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. +// NOTE: This CRD can only be used if the MachinePool feature gate is enabled. +type MachinePool struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec is the desired state of MachinePool. + // +required + Spec MachinePoolSpec `json:"spec,omitempty,omitzero"` + // status is the observed state of MachinePool. + // +optional + Status MachinePoolStatus `json:"status,omitempty,omitzero"` +} + +// GetV1Beta1Conditions returns the set of conditions for this object. +func (m *MachinePool) GetV1Beta1Conditions() Conditions { + if m.Status.Deprecated == nil || m.Status.Deprecated.V1Beta1 == nil { + return nil + } + return m.Status.Deprecated.V1Beta1.Conditions +} + +// SetV1Beta1Conditions sets the conditions on this object. +func (m *MachinePool) SetV1Beta1Conditions(conditions Conditions) { + if m.Status.Deprecated == nil { + m.Status.Deprecated = &MachinePoolDeprecatedStatus{} + } + if m.Status.Deprecated.V1Beta1 == nil { + m.Status.Deprecated.V1Beta1 = &MachinePoolV1Beta1DeprecatedStatus{} + } + m.Status.Deprecated.V1Beta1.Conditions = conditions +} + +// GetConditions returns the set of conditions for this object. +func (m *MachinePool) GetConditions() []metav1.Condition { + return m.Status.Conditions +} + +// SetConditions sets conditions for an API object. +func (m *MachinePool) SetConditions(conditions []metav1.Condition) { + m.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// MachinePoolList contains a list of MachinePool. +type MachinePoolList struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + // items is the list of MachinePools. + Items []MachinePool `json:"items"` +} + +func init() { + objectTypes = append(objectTypes, &MachinePool{}, &MachinePoolList{}) +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machineset_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machineset_types.go new file mode 100644 index 0000000000..8a5a92db7d --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/machineset_types.go @@ -0,0 +1,499 @@ +/* +Copyright 2025 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 v1beta2 + +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" + + // MachineSetFinalizer is the finalizer used by the MachineSet controller to + // ensure ordered cleanup of corresponding Machines when a Machineset is being deleted. + MachineSetFinalizer = "cluster.x-k8s.io/machineset" +) + +// MachineSetSpec defines the desired state of MachineSet. +type MachineSetSpec struct { + // clusterName is the name of the Cluster this object belongs to. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + ClusterName string `json:"clusterName,omitempty"` + + // replicas is the number of desired replicas. + // This is a pointer to distinguish between explicit zero and unspecified. + // + // Defaults to: + // * if the Kubernetes autoscaler min size and max size annotations are set: + // - if it's a new MachineSet, use min size + // - if the replicas field of the old MachineSet is < min size, use min size + // - if the replicas field of the old MachineSet is > max size, use max size + // - if the replicas field of the old MachineSet is in the (min size, max size) range, keep the value from the oldMS + // * otherwise use 1 + // Note: Defaulting will be run whenever the replicas field is not set: + // * A new MachineSet is created with replicas not set. + // * On an existing MachineSet the replicas field was first set and is now unset. + // Those cases are especially relevant for the following Kubernetes autoscaler use cases: + // * A new MachineSet is created and replicas should be managed by the autoscaler + // * An existing MachineSet which initially wasn't controlled by the autoscaler + // should be later controlled by the autoscaler + // +optional + Replicas *int32 `json:"replicas,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 + // +required + Selector metav1.LabelSelector `json:"selector,omitempty,omitzero"` + + // template is the object that describes the machine that will be created if + // insufficient replicas are detected. + // Object references to custom resources are treated as templates. + // +required + Template MachineTemplateSpec `json:"template,omitempty,omitzero"` + + // machineNaming allows changing the naming pattern used when creating Machines. + // Note: InfraMachines & BootstrapConfigs will use the same name as the corresponding Machines. + // +optional + MachineNaming MachineNamingSpec `json:"machineNaming,omitempty,omitzero"` + + // deletion contains configuration options for MachineSet deletion. + // +optional + Deletion MachineSetDeletionSpec `json:"deletion,omitempty,omitzero"` +} + +// MachineSetDeletionSpec contains configuration options for MachineSet deletion. +// +kubebuilder:validation:MinProperties=1 +type MachineSetDeletionSpec struct { + // order defines the order in which Machines are deleted when downscaling. + // Defaults to "Random". Valid values are "Random, "Newest", "Oldest" + // +optional + Order MachineSetDeletionOrder `json:"order,omitempty"` +} + +// MachineSet's ScalingUp condition and corresponding reasons. +const ( + // MachineSetScalingUpCondition is true if actual replicas < desired replicas. + // Note: In case a MachineSet preflight check is preventing scale up, this will surface in the condition message. + MachineSetScalingUpCondition = ScalingUpCondition + + // MachineSetScalingUpReason surfaces when actual replicas < desired replicas. + MachineSetScalingUpReason = ScalingUpReason + + // MachineSetNotScalingUpReason surfaces when actual replicas >= desired replicas. + MachineSetNotScalingUpReason = NotScalingUpReason + + // MachineSetScalingUpInternalErrorReason surfaces unexpected failures when listing machines. + MachineSetScalingUpInternalErrorReason = InternalErrorReason + + // MachineSetScalingUpWaitingForReplicasSetReason surfaces when the .spec.replicas + // field of the MachineSet is not set. + MachineSetScalingUpWaitingForReplicasSetReason = WaitingForReplicasSetReason +) + +// MachineSet's ScalingDown condition and corresponding reasons. +const ( + // MachineSetScalingDownCondition is true if actual replicas > desired replicas. + MachineSetScalingDownCondition = ScalingDownCondition + + // MachineSetScalingDownReason surfaces when actual replicas > desired replicas. + MachineSetScalingDownReason = ScalingDownReason + + // MachineSetNotScalingDownReason surfaces when actual replicas <= desired replicas. + MachineSetNotScalingDownReason = NotScalingDownReason + + // MachineSetScalingDownInternalErrorReason surfaces unexpected failures when listing machines. + MachineSetScalingDownInternalErrorReason = InternalErrorReason + + // MachineSetScalingDownWaitingForReplicasSetReason surfaces when the .spec.replicas + // field of the MachineSet is not set. + MachineSetScalingDownWaitingForReplicasSetReason = WaitingForReplicasSetReason +) + +// MachineSet's MachinesReady condition and corresponding reasons. +// Note: Reason's could also be derived from the aggregation of machine's Ready conditions. +const ( + // MachineSetMachinesReadyCondition surfaces detail of issues on the controlled machines, if any. + MachineSetMachinesReadyCondition = MachinesReadyCondition + + // MachineSetMachinesReadyReason surfaces when all the controlled machine's Ready conditions are true. + MachineSetMachinesReadyReason = ReadyReason + + // MachineSetMachinesNotReadyReason surfaces when at least one of the controlled machine's Ready conditions is false. + MachineSetMachinesNotReadyReason = NotReadyReason + + // MachineSetMachinesReadyUnknownReason surfaces when at least one of the controlled machine's Ready conditions is unknown + // and none of the controlled machine's Ready conditions is false. + MachineSetMachinesReadyUnknownReason = ReadyUnknownReason + + // MachineSetMachinesReadyNoReplicasReason surfaces when no machines exist for the MachineSet. + MachineSetMachinesReadyNoReplicasReason = NoReplicasReason + + // MachineSetMachinesReadyInternalErrorReason surfaces unexpected failures when listing machines + // or aggregating machine's conditions. + MachineSetMachinesReadyInternalErrorReason = InternalErrorReason +) + +// MachineSet's MachinesUpToDate condition and corresponding reasons. +// Note: Reason's could also be derived from the aggregation of machine's MachinesUpToDate conditions. +const ( + // MachineSetMachinesUpToDateCondition surfaces details of controlled machines not up to date, if any. + // Note: New machines are considered 10s after machine creation. This gives time to the machine's owner controller to recognize the new machine and add the UpToDate condition. + MachineSetMachinesUpToDateCondition = MachinesUpToDateCondition + + // MachineSetMachinesUpToDateReason surfaces when all the controlled machine's UpToDate conditions are true. + MachineSetMachinesUpToDateReason = UpToDateReason + + // MachineSetMachinesNotUpToDateReason surfaces when at least one of the controlled machine's UpToDate conditions is false. + MachineSetMachinesNotUpToDateReason = NotUpToDateReason + + // MachineSetMachinesUpToDateUnknownReason surfaces when at least one of the controlled machine's UpToDate conditions is unknown + // and none of the controlled machine's UpToDate conditions is false. + MachineSetMachinesUpToDateUnknownReason = UpToDateUnknownReason + + // MachineSetMachinesUpToDateNoReplicasReason surfaces when no machines exist for the MachineSet. + MachineSetMachinesUpToDateNoReplicasReason = NoReplicasReason + + // MachineSetMachinesUpToDateInternalErrorReason surfaces unexpected failures when listing machines + // or aggregating status. + MachineSetMachinesUpToDateInternalErrorReason = InternalErrorReason +) + +// MachineSet's Remediating condition and corresponding reasons. +const ( + // MachineSetRemediatingCondition surfaces details about ongoing remediation of the controlled machines, if any. + MachineSetRemediatingCondition = RemediatingCondition + + // MachineSetRemediatingReason surfaces when the MachineSet has at least one machine with HealthCheckSucceeded set to false + // and with the OwnerRemediated condition set to false. + MachineSetRemediatingReason = RemediatingReason + + // MachineSetNotRemediatingReason surfaces when the MachineSet does not have any machine with HealthCheckSucceeded set to false + // and with the OwnerRemediated condition set to false. + MachineSetNotRemediatingReason = NotRemediatingReason + + // MachineSetRemediatingInternalErrorReason surfaces unexpected failures when computing the Remediating condition. + MachineSetRemediatingInternalErrorReason = InternalErrorReason +) + +// Reasons that will be used for the OwnerRemediated condition set by MachineHealthCheck on MachineSet controlled machines +// being remediated in v1Beta2 API version. +const ( + // MachineSetMachineCannotBeRemediatedReason surfaces when remediation of a MachineSet machine can't be started. + MachineSetMachineCannotBeRemediatedReason = "CannotBeRemediated" + + // MachineSetMachineRemediationDeferredReason surfaces when remediation of a MachineSet machine must be deferred. + MachineSetMachineRemediationDeferredReason = "RemediationDeferred" + + // MachineSetMachineRemediationMachineDeletingReason surfaces when remediation of a MachineSet machine + // has been completed by deleting the unhealthy machine. + // Note: After an unhealthy machine is deleted, a new one is created by the MachineSet as part of the + // regular reconcile loop that ensures the correct number of replicas exist. + MachineSetMachineRemediationMachineDeletingReason = "MachineDeleting" +) + +// MachineSet's Deleting condition and corresponding reasons. +const ( + // MachineSetDeletingCondition surfaces details about ongoing deletion of the controlled machines. + MachineSetDeletingCondition = DeletingCondition + + // MachineSetNotDeletingReason surfaces when the MachineSet is not deleting because the + // DeletionTimestamp is not set. + MachineSetNotDeletingReason = NotDeletingReason + + // MachineSetDeletingReason surfaces when the MachineSet is deleting because the + // DeletionTimestamp is set. + MachineSetDeletingReason = DeletingReason + + // MachineSetDeletingInternalErrorReason surfaces unexpected failures when deleting a MachineSet. + MachineSetDeletingInternalErrorReason = InternalErrorReason +) + +// MachineTemplateSpec describes the data needed to create a Machine from a template. +type MachineTemplateSpec struct { + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + ObjectMeta `json:"metadata,omitempty,omitzero"` + + // spec is the 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 + // +required + Spec MachineSpec `json:"spec,omitempty,omitzero"` +} + +// MachineSetDeletionOrder defines how priority is assigned to nodes to delete when +// downscaling a MachineSet. Defaults to "Random". +// +kubebuilder:validation:Enum=Random;Newest;Oldest +type MachineSetDeletionOrder string + +const ( + // RandomMachineSetDeletionOrder 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 + // or NodeHealthy type of Status.Conditions is not true). + // Finally, it picks Machines at random to delete. + RandomMachineSetDeletionOrder MachineSetDeletionOrder = "Random" + + // NewestMachineSetDeletionOrder 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 + // or NodeHealthy type of Status.Conditions is not true). + // It then prioritizes the newest Machines for deletion based on the Machine's CreationTimestamp. + NewestMachineSetDeletionOrder MachineSetDeletionOrder = "Newest" + + // OldestMachineSetDeletionOrder 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 + // or NodeHealthy type of Status.Conditions is not true). + // It then prioritizes the oldest Machines for deletion based on the Machine's CreationTimestamp. + OldestMachineSetDeletionOrder MachineSetDeletionOrder = "Oldest" +) + +// MachineSetStatus defines the observed state of MachineSet. +// +kubebuilder:validation:MinProperties=1 +type MachineSetStatus struct { + // conditions represents the observations of a MachineSet's current state. + // Known condition types are MachinesReady, MachinesUpToDate, ScalingUp, ScalingDown, Remediating, Deleting, Paused. + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=32 + Conditions []metav1.Condition `json:"conditions,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 + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=4096 + Selector string `json:"selector,omitempty"` + + // replicas is the most recently observed number of replicas. + // +optional + Replicas *int32 `json:"replicas,omitempty"` + + // readyReplicas is the number of ready replicas for this MachineSet. A machine is considered ready when Machine's Ready condition is true. + // +optional + ReadyReplicas *int32 `json:"readyReplicas,omitempty"` + + // availableReplicas is the number of available replicas for this MachineSet. A machine is considered available when Machine's Available condition is true. + // +optional + AvailableReplicas *int32 `json:"availableReplicas,omitempty"` + + // upToDateReplicas is the number of up-to-date replicas for this MachineSet. A machine is considered up-to-date when Machine's UpToDate condition is true. + // +optional + UpToDateReplicas *int32 `json:"upToDateReplicas,omitempty"` + + // observedGeneration reflects the generation of the most recently observed MachineSet. + // +optional + // +kubebuilder:validation:Minimum=1 + ObservedGeneration int64 `json:"observedGeneration,omitempty"` + + // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. + // +optional + Deprecated *MachineSetDeprecatedStatus `json:"deprecated,omitempty"` +} + +// MachineSetDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachineSetDeprecatedStatus struct { + // v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. + // +optional + V1Beta1 *MachineSetV1Beta1DeprecatedStatus `json:"v1beta1,omitempty"` +} + +// MachineSetV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type MachineSetV1Beta1DeprecatedStatus struct { + // conditions defines current service state of the MachineSet. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + Conditions Conditions `json:"conditions,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. + // + // 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. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + FailureReason *capierrors.MachineSetStatusError `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. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=10240 + FailureMessage *string `json:"failureMessage,omitempty"` //nolint:kubeapilinter // field will be removed when v1beta1 is removed + + // fullyLabeledReplicas is the number of replicas that have labels matching the labels of the machine template of the MachineSet. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + FullyLabeledReplicas int32 `json:"fullyLabeledReplicas"` //nolint:kubeapilinter // field will be removed when v1beta1 is removed + + // readyReplicas is the number of ready replicas for this MachineSet. A machine is considered ready when the node has been created and is "Ready". + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + ReadyReplicas int32 `json:"readyReplicas"` //nolint:kubeapilinter // field will be removed when v1beta1 is removed + + // availableReplicas is the number of available replicas (ready for at least minReadySeconds) for this MachineSet. + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + AvailableReplicas int32 `json:"availableReplicas"` //nolint:kubeapilinter // field will be removed when v1beta1 is removed +} + +// 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, metav1validation.LabelSelectorValidationOptions{}, 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="Desired",type=integer,JSONPath=".spec.replicas",description="The desired number of machines" +// +kubebuilder:printcolumn:name="Current",type="integer",JSONPath=".status.replicas",description="The number of machines" +// +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="The number of machines with Ready condition true" +// +kubebuilder:printcolumn:name="Available",type=integer,JSONPath=".status.availableReplicas",description="The number of machines with Available condition true" +// +kubebuilder:printcolumn:name="Up-to-date",type=integer,JSONPath=".status.upToDateReplicas",description="The number of machines with UpToDate condition true" +// +kubebuilder:printcolumn:name="Paused",type="string",JSONPath=`.status.conditions[?(@.type=="Paused")].status`,description="Reconciliation paused",priority=10 +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachineSet" +// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.template.spec.version",description="Kubernetes version associated with this MachineSet" + +// MachineSet is the Schema for the machinesets API. +type MachineSet struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec is the desired state of MachineSet. + // +required + Spec MachineSetSpec `json:"spec,omitempty,omitzero"` + // status is the observed state of MachineSet. + // +optional + Status MachineSetStatus `json:"status,omitempty,omitzero"` +} + +// GetV1Beta1Conditions returns the set of conditions for the MachineSet. +func (m *MachineSet) GetV1Beta1Conditions() Conditions { + if m.Status.Deprecated == nil || m.Status.Deprecated.V1Beta1 == nil { + return nil + } + return m.Status.Deprecated.V1Beta1.Conditions +} + +// SetV1Beta1Conditions updates the set of conditions on the MachineSet. +func (m *MachineSet) SetV1Beta1Conditions(conditions Conditions) { + if m.Status.Deprecated == nil { + m.Status.Deprecated = &MachineSetDeprecatedStatus{} + } + if m.Status.Deprecated.V1Beta1 == nil { + m.Status.Deprecated.V1Beta1 = &MachineSetV1Beta1DeprecatedStatus{} + } + m.Status.Deprecated.V1Beta1.Conditions = conditions +} + +// GetConditions returns the set of conditions for this object. +func (m *MachineSet) GetConditions() []metav1.Condition { + return m.Status.Conditions +} + +// SetConditions sets conditions for an API object. +func (m *MachineSet) SetConditions(conditions []metav1.Condition) { + m.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// MachineSetList contains a list of MachineSet. +type MachineSetList struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + // items is the list of MachineSets. + Items []MachineSet `json:"items"` +} + +func init() { + objectTypes = append(objectTypes, &MachineSet{}, &MachineSetList{}) +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/v1beta1_condition_consts.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/v1beta1_condition_consts.go new file mode 100644 index 0000000000..aef565c0aa --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/v1beta1_condition_consts.go @@ -0,0 +1,367 @@ +/* +Copyright 2025 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 v1beta2 + +// Common ConditionTypes used by Cluster API objects. +const ( + // ReadyV1Beta1Condition defines the Ready condition type that summarizes the operational state of a Cluster API object. + ReadyV1Beta1Condition ConditionType = "Ready" +) + +// Common ConditionReason used by Cluster API objects. +const ( + // DeletingV1Beta1Reason (Severity=Info) documents a condition not in Status=True because the underlying object it is currently being deleted. + DeletingV1Beta1Reason = "Deleting" + + // DeletionFailedV1Beta1Reason (Severity=Warning) documents a condition not in Status=True because the underlying object + // encountered problems during deletion. This is a warning because the reconciler will retry deletion. + DeletionFailedV1Beta1Reason = "DeletionFailed" + + // DeletedV1Beta1Reason (Severity=Info) documents a condition not in Status=True because the underlying object was deleted. + DeletedV1Beta1Reason = "Deleted" + + // IncorrectExternalRefV1Beta1Reason (Severity=Error) documents a CAPI object with an incorrect external object reference. + IncorrectExternalRefV1Beta1Reason = "IncorrectExternalRef" +) + +const ( + // InfrastructureReadyV1Beta1Condition 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. + InfrastructureReadyV1Beta1Condition ConditionType = "InfrastructureReady" + + // WaitingForInfrastructureFallbackV1Beta1Reason (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. + WaitingForInfrastructureFallbackV1Beta1Reason = "WaitingForInfrastructure" +) + +// Conditions and condition Reasons for the ClusterClass object. +const ( + // ClusterClassVariablesReconciledV1Beta1Condition reports if the ClusterClass variables, including both inline and external + // variables, have been successfully reconciled. + // This signals that the ClusterClass is ready to be used to default and validate variables on Clusters using + // this ClusterClass. + ClusterClassVariablesReconciledV1Beta1Condition ConditionType = "VariablesReconciled" + + // VariableDiscoveryFailedV1Beta1Reason (Severity=Error) documents a ClusterClass with VariableDiscovery extensions that + // failed. + VariableDiscoveryFailedV1Beta1Reason = "VariableDiscoveryFailed" +) + +// Conditions and condition Reasons for the Cluster object. + +const ( + // ControlPlaneInitializedV1Beta1Condition reports if the cluster's control plane has been initialized such that the + // cluster's apiserver is reachable. If no Control Plane provider is in use this condition reports that 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. + ControlPlaneInitializedV1Beta1Condition ConditionType = "ControlPlaneInitialized" + + // MissingNodeRefV1Beta1Reason (Severity=Info) documents a cluster waiting for at least one control plane Machine to have + // its node reference populated. + MissingNodeRefV1Beta1Reason = "MissingNodeRef" + + // WaitingForControlPlaneProviderInitializedV1Beta1Reason (Severity=Info) documents a cluster waiting for the control plane + // provider to report successful control plane initialization. + WaitingForControlPlaneProviderInitializedV1Beta1Reason = "WaitingForControlPlaneProviderInitialized" + + // ControlPlaneReadyV1Beta1Condition 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 implement the Ready condition yet. + ControlPlaneReadyV1Beta1Condition ConditionType = "ControlPlaneReady" + + // WaitingForControlPlaneFallbackV1Beta1Reason (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. + WaitingForControlPlaneFallbackV1Beta1Reason = "WaitingForControlPlane" + + // WaitingForControlPlaneAvailableV1Beta1Reason (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. + WaitingForControlPlaneAvailableV1Beta1Reason = "WaitingForControlPlaneAvailable" +) + +// Conditions and condition Reasons for the Machine object. + +const ( + // BootstrapReadyV1Beta1Condition 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. + BootstrapReadyV1Beta1Condition ConditionType = "BootstrapReady" + + // WaitingForDataSecretFallbackV1Beta1Reason (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. + WaitingForDataSecretFallbackV1Beta1Reason = "WaitingForDataSecret" + + // DrainingSucceededV1Beta1Condition provide evidence of the status of the node drain operation which happens during the machine + // deletion process. + DrainingSucceededV1Beta1Condition ConditionType = "DrainingSucceeded" + + // DrainingV1Beta1Reason (Severity=Info) documents a machine node being drained. + DrainingV1Beta1Reason = "Draining" + + // DrainingFailedV1Beta1Reason (Severity=Warning) documents a machine node drain operation failed. + DrainingFailedV1Beta1Reason = "DrainingFailed" + + // PreDrainDeleteHookSucceededV1Beta1Condition reports a machine waiting for a PreDrainDeleteHook before being delete. + PreDrainDeleteHookSucceededV1Beta1Condition ConditionType = "PreDrainDeleteHookSucceeded" + + // PreTerminateDeleteHookSucceededV1Beta1Condition reports a machine waiting for a PreDrainDeleteHook before being delete. + PreTerminateDeleteHookSucceededV1Beta1Condition ConditionType = "PreTerminateDeleteHookSucceeded" + + // WaitingExternalHookV1Beta1Reason (Severity=Info) provide evidence that we are waiting for an external hook to complete. + WaitingExternalHookV1Beta1Reason = "WaitingExternalHook" + + // VolumeDetachSucceededV1Beta1Condition reports a machine waiting for volumes to be detached. + VolumeDetachSucceededV1Beta1Condition ConditionType = "VolumeDetachSucceeded" + + // WaitingForVolumeDetachV1Beta1Reason (Severity=Info) provide evidence that a machine node waiting for volumes to be attached. + WaitingForVolumeDetachV1Beta1Reason = "WaitingForVolumeDetach" +) + +const ( + // MachineHealthCheckSucceededV1Beta1Condition 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. + MachineHealthCheckSucceededV1Beta1Condition ConditionType = "HealthCheckSucceeded" + + // MachineHasFailureV1Beta1Reason is the reason used when a machine has either a FailureReason or a FailureMessage set on its status. + MachineHasFailureV1Beta1Reason = "MachineHasFailure" + + // HasRemediateMachineAnnotationV1Beta1Reason is the reason that get's set at the MachineHealthCheckSucceededCondition when a machine + // has the RemediateMachineAnnotation set. + HasRemediateMachineAnnotationV1Beta1Reason = "HasRemediateMachineAnnotation" + + // NodeStartupTimeoutV1Beta1Reason is the reason used when a machine's node does not appear within the specified timeout. + NodeStartupTimeoutV1Beta1Reason = "NodeStartupTimeout" + + // UnhealthyNodeConditionV1Beta1Reason is the reason used when a machine's node has one of the MachineHealthCheck's unhealthy conditions. + UnhealthyNodeConditionV1Beta1Reason = "UnhealthyNode" +) + +const ( + // MachineOwnerRemediatedV1Beta1Condition is set on machines that have failed a healthcheck by the MachineHealthCheck controller. + // MachineOwnerRemediatedV1Beta1Condition is set to False after a health check fails, but should be changed to True by the owning controller after remediation succeeds. + MachineOwnerRemediatedV1Beta1Condition ConditionType = "OwnerRemediated" + + // WaitingForRemediationV1Beta1Reason is the reason used when a machine fails a health check and remediation is needed. + WaitingForRemediationV1Beta1Reason = "WaitingForRemediation" + + // RemediationFailedV1Beta1Reason is the reason used when a remediation owner fails to remediate an unhealthy machine. + RemediationFailedV1Beta1Reason = "RemediationFailed" + + // RemediationInProgressV1Beta1Reason is the reason used when an unhealthy machine is being remediated by the remediation owner. + RemediationInProgressV1Beta1Reason = "RemediationInProgress" + + // ExternalRemediationTemplateAvailableV1Beta1Condition is set on machinehealthchecks when MachineHealthCheck controller uses external remediation. + // ExternalRemediationTemplateAvailableV1Beta1Condition is set to false if external remediation template is not found. + ExternalRemediationTemplateAvailableV1Beta1Condition ConditionType = "ExternalRemediationTemplateAvailable" + + // ExternalRemediationTemplateNotFoundV1Beta1Reason is the reason used when a machine health check fails to find external remediation template. + ExternalRemediationTemplateNotFoundV1Beta1Reason = "ExternalRemediationTemplateNotFound" + + // ExternalRemediationRequestAvailableV1Beta1Condition is set on machinehealthchecks when MachineHealthCheck controller uses external remediation. + // ExternalRemediationRequestAvailableV1Beta1Condition is set to false if creating external remediation request fails. + ExternalRemediationRequestAvailableV1Beta1Condition ConditionType = "ExternalRemediationRequestAvailable" + + // ExternalRemediationRequestCreationFailedV1Beta1Reason is the reason used when a machine health check fails to create external remediation request. + ExternalRemediationRequestCreationFailedV1Beta1Reason = "ExternalRemediationRequestCreationFailed" +) + +// Conditions and condition Reasons for the Machine's Node object. +const ( + // MachineNodeHealthyV1Beta1Condition 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 and NodePIDPressure) are in a healthy state, it will be set to True. + MachineNodeHealthyV1Beta1Condition ConditionType = "NodeHealthy" + + // WaitingForNodeRefV1Beta1Reason (Severity=Info) documents a machine.spec.providerId is not assigned yet. + WaitingForNodeRefV1Beta1Reason = "WaitingForNodeRef" + + // NodeProvisioningV1Beta1Reason (Severity=Info) documents machine in the process of provisioning a node. + // NB. provisioning --> NodeRef == "". + NodeProvisioningV1Beta1Reason = "NodeProvisioning" + + // NodeNotFoundV1Beta1Reason (Severity=Error) documents a machine's node has previously been observed but is now gone. + // NB. provisioned --> NodeRef != "". + NodeNotFoundV1Beta1Reason = "NodeNotFound" + + // NodeConditionsFailedV1Beta1Reason (Severity=Warning) documents a node is not in a healthy state due to the failed state of at least 1 Kubelet condition. + NodeConditionsFailedV1Beta1Reason = "NodeConditionsFailed" + + // NodeInspectionFailedV1Beta1Reason documents a failure in inspecting the node. + // This reason is used when the Machine controller is unable to list Nodes to find + // the corresponding Node for a Machine by ProviderID. + NodeInspectionFailedV1Beta1Reason = "NodeInspectionFailed" +) + +// Conditions and condition Reasons for the MachineHealthCheck object. + +const ( + // RemediationAllowedV1Beta1Condition 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. + RemediationAllowedV1Beta1Condition ConditionType = "RemediationAllowed" + + // TooManyUnhealthyV1Beta1Reason is the reason used when too many Machines are unhealthy and the MachineHealthCheck is blocked + // from making any further remediations. + TooManyUnhealthyV1Beta1Reason = "TooManyUnhealthy" +) + +// Conditions and condition Reasons for MachineDeployments. + +const ( + // MachineDeploymentAvailableV1Beta1Condition means the MachineDeployment is available, that is, at least the minimum available + // machines required (i.e. Spec.Replicas-MaxUnavailable when spec.rollout.strategy.type = RollingUpdate) are up and running for at least minReadySeconds. + MachineDeploymentAvailableV1Beta1Condition ConditionType = "Available" + + // MachineSetReadyV1Beta1Condition reports a summary of current status of the MachineSet owned by the MachineDeployment. + MachineSetReadyV1Beta1Condition ConditionType = "MachineSetReady" + + // WaitingForMachineSetFallbackV1Beta1Reason (Severity=Info) documents a MachineDeployment waiting for the underlying MachineSet + // to be available. + // NOTE: This reason is used only as a fallback when the MachineSet object is not reporting its own ready condition. + WaitingForMachineSetFallbackV1Beta1Reason = "WaitingForMachineSet" + + // WaitingForAvailableMachinesV1Beta1Reason (Severity=Warning) reflects the fact that the required minimum number of machines for a machinedeployment are not available. + WaitingForAvailableMachinesV1Beta1Reason = "WaitingForAvailableMachines" +) + +// Conditions and condition Reasons for MachineSets. + +const ( + // MachinesCreatedV1Beta1Condition documents that the machines controlled by the MachineSet are created. + // When this condition is false, it indicates that there was an error when cloning the infrastructure/bootstrap template or + // when generating the machine object. + MachinesCreatedV1Beta1Condition ConditionType = "MachinesCreated" + + // MachinesReadyV1Beta1Condition reports an aggregate of current status of the machines controlled by the MachineSet. + MachinesReadyV1Beta1Condition ConditionType = "MachinesReady" + + // PreflightCheckFailedV1Beta1Reason (Severity=Error) documents a MachineSet failing preflight checks + // to create machine(s). + PreflightCheckFailedV1Beta1Reason = "PreflightCheckFailed" + + // BootstrapTemplateCloningFailedV1Beta1Reason (Severity=Error) documents a MachineSet failing to + // clone the bootstrap template. + BootstrapTemplateCloningFailedV1Beta1Reason = "BootstrapTemplateCloningFailed" + + // InfrastructureTemplateCloningFailedV1Beta1Reason (Severity=Error) documents a MachineSet failing to + // clone the infrastructure template. + InfrastructureTemplateCloningFailedV1Beta1Reason = "InfrastructureTemplateCloningFailed" + + // MachineCreationFailedV1Beta1Reason (Severity=Error) documents a MachineSet failing to + // generate a machine object. + MachineCreationFailedV1Beta1Reason = "MachineCreationFailed" + + // ResizedV1Beta1Condition documents a MachineSet is resizing the set of controlled machines. + ResizedV1Beta1Condition ConditionType = "Resized" + + // ScalingUpV1Beta1Reason (Severity=Info) documents a MachineSet is increasing the number of replicas. + ScalingUpV1Beta1Reason = "ScalingUp" + + // ScalingDownV1Beta1Reason (Severity=Info) documents a MachineSet is decreasing the number of replicas. + ScalingDownV1Beta1Reason = "ScalingDown" +) + +// Conditions and condition reasons for Clusters with a managed Topology. +const ( + // TopologyReconciledV1Beta1Condition provides evidence about the reconciliation of a Cluster topology into + // the managed objects of the Cluster. + // Status false means that for any reason, the values defined in Cluster.spec.topology are not yet applied to + // managed objects on the Cluster; status true means that Cluster.spec.topology have been applied to + // the objects in the Cluster (but this does not imply those objects are already reconciled to the spec provided). + TopologyReconciledV1Beta1Condition ConditionType = "TopologyReconciled" + + // TopologyReconcileFailedV1Beta1Reason (Severity=Error) documents the reconciliation of a Cluster topology + // failing due to an error. + TopologyReconcileFailedV1Beta1Reason = "TopologyReconcileFailed" + + // TopologyReconciledControlPlaneUpgradePendingV1Beta1Reason (Severity=Info) documents reconciliation of a Cluster topology + // not yet completed because Control Plane is not yet updated to match the desired topology spec. + TopologyReconciledControlPlaneUpgradePendingV1Beta1Reason = "ControlPlaneUpgradePending" + + // TopologyReconciledMachineDeploymentsCreatePendingV1Beta1Reason (Severity=Info) documents reconciliation of a Cluster topology + // not yet completed because at least one of the MachineDeployments is yet to be created. + // This generally happens because new MachineDeployment creations are held off while the ControlPlane is not stable. + TopologyReconciledMachineDeploymentsCreatePendingV1Beta1Reason = "MachineDeploymentsCreatePending" + + // TopologyReconciledMachineDeploymentsUpgradePendingV1Beta1Reason (Severity=Info) documents reconciliation of a Cluster topology + // not yet completed because at least one of the MachineDeployments is not yet updated to match the desired topology spec. + TopologyReconciledMachineDeploymentsUpgradePendingV1Beta1Reason = "MachineDeploymentsUpgradePending" + + // TopologyReconciledMachineDeploymentsUpgradeDeferredV1Beta1Reason (Severity=Info) documents reconciliation of a Cluster topology + // not yet completed because the upgrade for at least one of the MachineDeployments has been deferred. + TopologyReconciledMachineDeploymentsUpgradeDeferredV1Beta1Reason = "MachineDeploymentsUpgradeDeferred" + + // TopologyReconciledMachinePoolsUpgradePendingV1Beta1Reason (Severity=Info) documents reconciliation of a Cluster topology + // not yet completed because at least one of the MachinePools is not yet updated to match the desired topology spec. + TopologyReconciledMachinePoolsUpgradePendingV1Beta1Reason = "MachinePoolsUpgradePending" + + // TopologyReconciledMachinePoolsCreatePendingV1Beta1Reason (Severity=Info) documents reconciliation of a Cluster topology + // not yet completed because at least one of the MachinePools is yet to be created. + // This generally happens because new MachinePool creations are held off while the ControlPlane is not stable. + TopologyReconciledMachinePoolsCreatePendingV1Beta1Reason = "MachinePoolsCreatePending" + + // TopologyReconciledMachinePoolsUpgradeDeferredV1Beta1Reason (Severity=Info) documents reconciliation of a Cluster topology + // not yet completed because the upgrade for at least one of the MachinePools has been deferred. + TopologyReconciledMachinePoolsUpgradeDeferredV1Beta1Reason = "MachinePoolsUpgradeDeferred" + + // TopologyReconciledHookBlockingV1Beta1Reason (Severity=Info) documents reconciliation of a Cluster topology + // not yet completed because at least one of the lifecycle hooks is blocking. + TopologyReconciledHookBlockingV1Beta1Reason = "LifecycleHookBlocking" + + // TopologyReconciledClusterClassNotReconciledV1Beta1Reason (Severity=Info) documents reconciliation of a Cluster topology not + // yet completed because the ClusterClass has not reconciled yet. If this condition persists there may be an issue + // with the ClusterClass surfaced in the ClusterClass status or controller logs. + TopologyReconciledClusterClassNotReconciledV1Beta1Reason = "ClusterClassNotReconciled" + + // TopologyReconciledPausedV1Beta1Reason (Severity=Info) surfaces when the Cluster is paused. + TopologyReconciledPausedV1Beta1Reason = "Paused" +) + +// Conditions and condition reasons for ClusterClass. +const ( + // ClusterClassRefVersionsUpToDateV1Beta1Condition documents if the references in the ClusterClass are + // up-to-date (i.e. they are using the latest apiVersion of the current Cluster API contract from + // the corresponding CRD). + ClusterClassRefVersionsUpToDateV1Beta1Condition ConditionType = "RefVersionsUpToDate" + + // ClusterClassOutdatedRefVersionsV1Beta1Reason (Severity=Warning) that the references in the ClusterClass are not + // up-to-date (i.e. they are not using the latest apiVersion of the current Cluster API contract from + // the corresponding CRD). + ClusterClassOutdatedRefVersionsV1Beta1Reason = "OutdatedRefVersions" + + // ClusterClassRefVersionsUpToDateInternalErrorV1Beta1Reason (Severity=Warning) surfaces that an unexpected error occurred when validating + // if the references are up-to-date. + ClusterClassRefVersionsUpToDateInternalErrorV1Beta1Reason = "InternalError" +) + +// Conditions and condition Reasons for the MachinePool object. + +const ( + // ReplicasReadyV1Beta1Condition reports an aggregate of current status of the replicas controlled by the MachinePool. + ReplicasReadyV1Beta1Condition ConditionType = "ReplicasReady" + + // WaitingForReplicasReadyV1Beta1Reason (Severity=Info) documents a machinepool waiting for the required replicas + // to be ready. + WaitingForReplicasReadyV1Beta1Reason = "WaitingForReplicasReady" +) diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/zz_generated.deepcopy.go new file mode 100644 index 0000000000..49d1f66552 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/zz_generated.deepcopy.go @@ -0,0 +1,3843 @@ +//go: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 v1beta2 + +import ( + corev1 "k8s.io/api/core/v1" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + "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 + out.ConfigRef = in.ConfigRef + 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 *ClusterAvailabilityGate) DeepCopyInto(out *ClusterAvailabilityGate) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAvailabilityGate. +func (in *ClusterAvailabilityGate) DeepCopy() *ClusterAvailabilityGate { + if in == nil { + return nil + } + out := new(ClusterAvailabilityGate) + in.DeepCopyInto(out) + return out +} + +// 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) + in.Status.DeepCopyInto(&out.Status) +} + +// 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 *ClusterClassDeprecatedStatus) DeepCopyInto(out *ClusterClassDeprecatedStatus) { + *out = *in + if in.V1Beta1 != nil { + in, out := &in.V1Beta1, &out.V1Beta1 + *out = new(ClusterClassV1Beta1DeprecatedStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClassDeprecatedStatus. +func (in *ClusterClassDeprecatedStatus) DeepCopy() *ClusterClassDeprecatedStatus { + if in == nil { + return nil + } + out := new(ClusterClassDeprecatedStatus) + in.DeepCopyInto(out) + return out +} + +// 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 *ClusterClassPatch) DeepCopyInto(out *ClusterClassPatch) { + *out = *in + if in.Definitions != nil { + in, out := &in.Definitions, &out.Definitions + *out = make([]PatchDefinition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.External != nil { + in, out := &in.External, &out.External + *out = new(ExternalPatchDefinition) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClassPatch. +func (in *ClusterClassPatch) DeepCopy() *ClusterClassPatch { + if in == nil { + return nil + } + out := new(ClusterClassPatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterClassRef) DeepCopyInto(out *ClusterClassRef) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClassRef. +func (in *ClusterClassRef) DeepCopy() *ClusterClassRef { + if in == nil { + return nil + } + out := new(ClusterClassRef) + in.DeepCopyInto(out) + return out +} + +// 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 + if in.AvailabilityGates != nil { + in, out := &in.AvailabilityGates, &out.AvailabilityGates + *out = make([]ClusterAvailabilityGate, len(*in)) + copy(*out, *in) + } + out.Infrastructure = in.Infrastructure + in.ControlPlane.DeepCopyInto(&out.ControlPlane) + in.Workers.DeepCopyInto(&out.Workers) + if in.Variables != nil { + in, out := &in.Variables, &out.Variables + *out = make([]ClusterClassVariable, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Patches != nil { + in, out := &in.Patches, &out.Patches + *out = make([]ClusterClassPatch, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// 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 *ClusterClassStatus) DeepCopyInto(out *ClusterClassStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Variables != nil { + in, out := &in.Variables, &out.Variables + *out = make([]ClusterClassStatusVariable, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Deprecated != nil { + in, out := &in.Deprecated, &out.Deprecated + *out = new(ClusterClassDeprecatedStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClassStatus. +func (in *ClusterClassStatus) DeepCopy() *ClusterClassStatus { + if in == nil { + return nil + } + out := new(ClusterClassStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterClassStatusVariable) DeepCopyInto(out *ClusterClassStatusVariable) { + *out = *in + if in.DefinitionsConflict != nil { + in, out := &in.DefinitionsConflict, &out.DefinitionsConflict + *out = new(bool) + **out = **in + } + if in.Definitions != nil { + in, out := &in.Definitions, &out.Definitions + *out = make([]ClusterClassStatusVariableDefinition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClassStatusVariable. +func (in *ClusterClassStatusVariable) DeepCopy() *ClusterClassStatusVariable { + if in == nil { + return nil + } + out := new(ClusterClassStatusVariable) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterClassStatusVariableDefinition) DeepCopyInto(out *ClusterClassStatusVariableDefinition) { + *out = *in + if in.Required != nil { + in, out := &in.Required, &out.Required + *out = new(bool) + **out = **in + } + in.DeprecatedV1Beta1Metadata.DeepCopyInto(&out.DeprecatedV1Beta1Metadata) + in.Schema.DeepCopyInto(&out.Schema) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClassStatusVariableDefinition. +func (in *ClusterClassStatusVariableDefinition) DeepCopy() *ClusterClassStatusVariableDefinition { + if in == nil { + return nil + } + out := new(ClusterClassStatusVariableDefinition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterClassTemplateReference) DeepCopyInto(out *ClusterClassTemplateReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClassTemplateReference. +func (in *ClusterClassTemplateReference) DeepCopy() *ClusterClassTemplateReference { + if in == nil { + return nil + } + out := new(ClusterClassTemplateReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterClassV1Beta1DeprecatedStatus) DeepCopyInto(out *ClusterClassV1Beta1DeprecatedStatus) { + *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 ClusterClassV1Beta1DeprecatedStatus. +func (in *ClusterClassV1Beta1DeprecatedStatus) DeepCopy() *ClusterClassV1Beta1DeprecatedStatus { + if in == nil { + return nil + } + out := new(ClusterClassV1Beta1DeprecatedStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterClassVariable) DeepCopyInto(out *ClusterClassVariable) { + *out = *in + if in.Required != nil { + in, out := &in.Required, &out.Required + *out = new(bool) + **out = **in + } + in.DeprecatedV1Beta1Metadata.DeepCopyInto(&out.DeprecatedV1Beta1Metadata) + in.Schema.DeepCopyInto(&out.Schema) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClassVariable. +func (in *ClusterClassVariable) DeepCopy() *ClusterClassVariable { + if in == nil { + return nil + } + out := new(ClusterClassVariable) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterClassVariableMetadata) DeepCopyInto(out *ClusterClassVariableMetadata) { + *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 ClusterClassVariableMetadata. +func (in *ClusterClassVariableMetadata) DeepCopy() *ClusterClassVariableMetadata { + if in == nil { + return nil + } + out := new(ClusterClassVariableMetadata) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterControlPlaneStatus) DeepCopyInto(out *ClusterControlPlaneStatus) { + *out = *in + if in.DesiredReplicas != nil { + in, out := &in.DesiredReplicas, &out.DesiredReplicas + *out = new(int32) + **out = **in + } + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.UpToDateReplicas != nil { + in, out := &in.UpToDateReplicas, &out.UpToDateReplicas + *out = new(int32) + **out = **in + } + if in.ReadyReplicas != nil { + in, out := &in.ReadyReplicas, &out.ReadyReplicas + *out = new(int32) + **out = **in + } + if in.AvailableReplicas != nil { + in, out := &in.AvailableReplicas, &out.AvailableReplicas + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterControlPlaneStatus. +func (in *ClusterControlPlaneStatus) DeepCopy() *ClusterControlPlaneStatus { + if in == nil { + return nil + } + out := new(ClusterControlPlaneStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterDeprecatedStatus) DeepCopyInto(out *ClusterDeprecatedStatus) { + *out = *in + if in.V1Beta1 != nil { + in, out := &in.V1Beta1, &out.V1Beta1 + *out = new(ClusterV1Beta1DeprecatedStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterDeprecatedStatus. +func (in *ClusterDeprecatedStatus) DeepCopy() *ClusterDeprecatedStatus { + if in == nil { + return nil + } + out := new(ClusterDeprecatedStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterInitializationStatus) DeepCopyInto(out *ClusterInitializationStatus) { + *out = *in + if in.InfrastructureProvisioned != nil { + in, out := &in.InfrastructureProvisioned, &out.InfrastructureProvisioned + *out = new(bool) + **out = **in + } + if in.ControlPlaneInitialized != nil { + in, out := &in.ControlPlaneInitialized, &out.ControlPlaneInitialized + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterInitializationStatus. +func (in *ClusterInitializationStatus) DeepCopy() *ClusterInitializationStatus { + if in == nil { + return nil + } + out := new(ClusterInitializationStatus) + 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 + in.Services.DeepCopyInto(&out.Services) + in.Pods.DeepCopyInto(&out.Pods) +} + +// 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.Paused != nil { + in, out := &in.Paused, &out.Paused + *out = new(bool) + **out = **in + } + in.ClusterNetwork.DeepCopyInto(&out.ClusterNetwork) + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint + out.ControlPlaneRef = in.ControlPlaneRef + out.InfrastructureRef = in.InfrastructureRef + in.Topology.DeepCopyInto(&out.Topology) + if in.AvailabilityGates != nil { + in, out := &in.AvailabilityGates, &out.AvailabilityGates + *out = make([]ClusterAvailabilityGate, len(*in)) + copy(*out, *in) + } +} + +// 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.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.Initialization.DeepCopyInto(&out.Initialization) + if in.ControlPlane != nil { + in, out := &in.ControlPlane, &out.ControlPlane + *out = new(ClusterControlPlaneStatus) + (*in).DeepCopyInto(*out) + } + if in.Workers != nil { + in, out := &in.Workers, &out.Workers + *out = new(WorkersStatus) + (*in).DeepCopyInto(*out) + } + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make([]FailureDomain, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Deprecated != nil { + in, out := &in.Deprecated, &out.Deprecated + *out = new(ClusterDeprecatedStatus) + (*in).DeepCopyInto(*out) + } +} + +// 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 *ClusterV1Beta1DeprecatedStatus) DeepCopyInto(out *ClusterV1Beta1DeprecatedStatus) { + *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]) + } + } + 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 + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterV1Beta1DeprecatedStatus. +func (in *ClusterV1Beta1DeprecatedStatus) DeepCopy() *ClusterV1Beta1DeprecatedStatus { + if in == nil { + return nil + } + out := new(ClusterV1Beta1DeprecatedStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterVariable) DeepCopyInto(out *ClusterVariable) { + *out = *in + in.Value.DeepCopyInto(&out.Value) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterVariable. +func (in *ClusterVariable) DeepCopy() *ClusterVariable { + if in == nil { + return nil + } + out := new(ClusterVariable) + 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 *ContractVersionedObjectReference) DeepCopyInto(out *ContractVersionedObjectReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContractVersionedObjectReference. +func (in *ContractVersionedObjectReference) DeepCopy() *ContractVersionedObjectReference { + if in == nil { + return nil + } + out := new(ContractVersionedObjectReference) + 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) + out.TemplateRef = in.TemplateRef + out.MachineInfrastructure = in.MachineInfrastructure + in.HealthCheck.DeepCopyInto(&out.HealthCheck) + out.Naming = in.Naming + in.Deletion.DeepCopyInto(&out.Deletion) + if in.ReadinessGates != nil { + in, out := &in.ReadinessGates, &out.ReadinessGates + *out = make([]MachineReadinessGate, len(*in)) + copy(*out, *in) + } +} + +// 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 *ControlPlaneClassHealthCheck) DeepCopyInto(out *ControlPlaneClassHealthCheck) { + *out = *in + in.Checks.DeepCopyInto(&out.Checks) + in.Remediation.DeepCopyInto(&out.Remediation) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneClassHealthCheck. +func (in *ControlPlaneClassHealthCheck) DeepCopy() *ControlPlaneClassHealthCheck { + if in == nil { + return nil + } + out := new(ControlPlaneClassHealthCheck) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneClassHealthCheckChecks) DeepCopyInto(out *ControlPlaneClassHealthCheckChecks) { + *out = *in + if in.NodeStartupTimeoutSeconds != nil { + in, out := &in.NodeStartupTimeoutSeconds, &out.NodeStartupTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.UnhealthyNodeConditions != nil { + in, out := &in.UnhealthyNodeConditions, &out.UnhealthyNodeConditions + *out = make([]UnhealthyNodeCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneClassHealthCheckChecks. +func (in *ControlPlaneClassHealthCheckChecks) DeepCopy() *ControlPlaneClassHealthCheckChecks { + if in == nil { + return nil + } + out := new(ControlPlaneClassHealthCheckChecks) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneClassHealthCheckRemediation) DeepCopyInto(out *ControlPlaneClassHealthCheckRemediation) { + *out = *in + in.TriggerIf.DeepCopyInto(&out.TriggerIf) + out.TemplateRef = in.TemplateRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneClassHealthCheckRemediation. +func (in *ControlPlaneClassHealthCheckRemediation) DeepCopy() *ControlPlaneClassHealthCheckRemediation { + if in == nil { + return nil + } + out := new(ControlPlaneClassHealthCheckRemediation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneClassHealthCheckRemediationTriggerIf) DeepCopyInto(out *ControlPlaneClassHealthCheckRemediationTriggerIf) { + *out = *in + if in.UnhealthyLessThanOrEqualTo != nil { + in, out := &in.UnhealthyLessThanOrEqualTo, &out.UnhealthyLessThanOrEqualTo + *out = new(intstr.IntOrString) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneClassHealthCheckRemediationTriggerIf. +func (in *ControlPlaneClassHealthCheckRemediationTriggerIf) DeepCopy() *ControlPlaneClassHealthCheckRemediationTriggerIf { + if in == nil { + return nil + } + out := new(ControlPlaneClassHealthCheckRemediationTriggerIf) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneClassMachineDeletionSpec) DeepCopyInto(out *ControlPlaneClassMachineDeletionSpec) { + *out = *in + if in.NodeDrainTimeoutSeconds != nil { + in, out := &in.NodeDrainTimeoutSeconds, &out.NodeDrainTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.NodeVolumeDetachTimeoutSeconds != nil { + in, out := &in.NodeVolumeDetachTimeoutSeconds, &out.NodeVolumeDetachTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.NodeDeletionTimeoutSeconds != nil { + in, out := &in.NodeDeletionTimeoutSeconds, &out.NodeDeletionTimeoutSeconds + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneClassMachineDeletionSpec. +func (in *ControlPlaneClassMachineDeletionSpec) DeepCopy() *ControlPlaneClassMachineDeletionSpec { + if in == nil { + return nil + } + out := new(ControlPlaneClassMachineDeletionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneClassMachineInfrastructureTemplate) DeepCopyInto(out *ControlPlaneClassMachineInfrastructureTemplate) { + *out = *in + out.TemplateRef = in.TemplateRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneClassMachineInfrastructureTemplate. +func (in *ControlPlaneClassMachineInfrastructureTemplate) DeepCopy() *ControlPlaneClassMachineInfrastructureTemplate { + if in == nil { + return nil + } + out := new(ControlPlaneClassMachineInfrastructureTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneClassNamingSpec) DeepCopyInto(out *ControlPlaneClassNamingSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneClassNamingSpec. +func (in *ControlPlaneClassNamingSpec) DeepCopy() *ControlPlaneClassNamingSpec { + if in == nil { + return nil + } + out := new(ControlPlaneClassNamingSpec) + 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 + } + in.HealthCheck.DeepCopyInto(&out.HealthCheck) + in.Deletion.DeepCopyInto(&out.Deletion) + if in.ReadinessGates != nil { + in, out := &in.ReadinessGates, &out.ReadinessGates + *out = make([]MachineReadinessGate, len(*in)) + copy(*out, *in) + } + in.Variables.DeepCopyInto(&out.Variables) +} + +// 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 *ControlPlaneTopologyHealthCheck) DeepCopyInto(out *ControlPlaneTopologyHealthCheck) { + *out = *in + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + in.Checks.DeepCopyInto(&out.Checks) + in.Remediation.DeepCopyInto(&out.Remediation) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneTopologyHealthCheck. +func (in *ControlPlaneTopologyHealthCheck) DeepCopy() *ControlPlaneTopologyHealthCheck { + if in == nil { + return nil + } + out := new(ControlPlaneTopologyHealthCheck) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneTopologyHealthCheckChecks) DeepCopyInto(out *ControlPlaneTopologyHealthCheckChecks) { + *out = *in + if in.NodeStartupTimeoutSeconds != nil { + in, out := &in.NodeStartupTimeoutSeconds, &out.NodeStartupTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.UnhealthyNodeConditions != nil { + in, out := &in.UnhealthyNodeConditions, &out.UnhealthyNodeConditions + *out = make([]UnhealthyNodeCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneTopologyHealthCheckChecks. +func (in *ControlPlaneTopologyHealthCheckChecks) DeepCopy() *ControlPlaneTopologyHealthCheckChecks { + if in == nil { + return nil + } + out := new(ControlPlaneTopologyHealthCheckChecks) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneTopologyHealthCheckRemediation) DeepCopyInto(out *ControlPlaneTopologyHealthCheckRemediation) { + *out = *in + in.TriggerIf.DeepCopyInto(&out.TriggerIf) + out.TemplateRef = in.TemplateRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneTopologyHealthCheckRemediation. +func (in *ControlPlaneTopologyHealthCheckRemediation) DeepCopy() *ControlPlaneTopologyHealthCheckRemediation { + if in == nil { + return nil + } + out := new(ControlPlaneTopologyHealthCheckRemediation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneTopologyHealthCheckRemediationTriggerIf) DeepCopyInto(out *ControlPlaneTopologyHealthCheckRemediationTriggerIf) { + *out = *in + if in.UnhealthyLessThanOrEqualTo != nil { + in, out := &in.UnhealthyLessThanOrEqualTo, &out.UnhealthyLessThanOrEqualTo + *out = new(intstr.IntOrString) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneTopologyHealthCheckRemediationTriggerIf. +func (in *ControlPlaneTopologyHealthCheckRemediationTriggerIf) DeepCopy() *ControlPlaneTopologyHealthCheckRemediationTriggerIf { + if in == nil { + return nil + } + out := new(ControlPlaneTopologyHealthCheckRemediationTriggerIf) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneTopologyMachineDeletionSpec) DeepCopyInto(out *ControlPlaneTopologyMachineDeletionSpec) { + *out = *in + if in.NodeDrainTimeoutSeconds != nil { + in, out := &in.NodeDrainTimeoutSeconds, &out.NodeDrainTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.NodeVolumeDetachTimeoutSeconds != nil { + in, out := &in.NodeVolumeDetachTimeoutSeconds, &out.NodeVolumeDetachTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.NodeDeletionTimeoutSeconds != nil { + in, out := &in.NodeDeletionTimeoutSeconds, &out.NodeDeletionTimeoutSeconds + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneTopologyMachineDeletionSpec. +func (in *ControlPlaneTopologyMachineDeletionSpec) DeepCopy() *ControlPlaneTopologyMachineDeletionSpec { + if in == nil { + return nil + } + out := new(ControlPlaneTopologyMachineDeletionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneVariables) DeepCopyInto(out *ControlPlaneVariables) { + *out = *in + if in.Overrides != nil { + in, out := &in.Overrides, &out.Overrides + *out = make([]ClusterVariable, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneVariables. +func (in *ControlPlaneVariables) DeepCopy() *ControlPlaneVariables { + if in == nil { + return nil + } + out := new(ControlPlaneVariables) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ExternalPatchDefinition) DeepCopyInto(out *ExternalPatchDefinition) { + *out = *in + if in.Settings != nil { + in, out := &in.Settings, &out.Settings + *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 ExternalPatchDefinition. +func (in *ExternalPatchDefinition) DeepCopy() *ExternalPatchDefinition { + if in == nil { + return nil + } + out := new(ExternalPatchDefinition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FailureDomain) DeepCopyInto(out *FailureDomain) { + *out = *in + if in.ControlPlane != nil { + in, out := &in.ControlPlane, &out.ControlPlane + *out = new(bool) + **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 FailureDomain. +func (in *FailureDomain) DeepCopy() *FailureDomain { + if in == nil { + return nil + } + out := new(FailureDomain) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InfrastructureClass) DeepCopyInto(out *InfrastructureClass) { + *out = *in + out.TemplateRef = in.TemplateRef + out.Naming = in.Naming +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InfrastructureClass. +func (in *InfrastructureClass) DeepCopy() *InfrastructureClass { + if in == nil { + return nil + } + out := new(InfrastructureClass) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InfrastructureClassNamingSpec) DeepCopyInto(out *InfrastructureClassNamingSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InfrastructureClassNamingSpec. +func (in *InfrastructureClassNamingSpec) DeepCopy() *InfrastructureClassNamingSpec { + if in == nil { + return nil + } + out := new(InfrastructureClassNamingSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JSONPatch) DeepCopyInto(out *JSONPatch) { + *out = *in + if in.Value != nil { + in, out := &in.Value, &out.Value + *out = new(apiextensionsv1.JSON) + (*in).DeepCopyInto(*out) + } + if in.ValueFrom != nil { + in, out := &in.ValueFrom, &out.ValueFrom + *out = new(JSONPatchValue) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JSONPatch. +func (in *JSONPatch) DeepCopy() *JSONPatch { + if in == nil { + return nil + } + out := new(JSONPatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JSONPatchValue) DeepCopyInto(out *JSONPatchValue) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JSONPatchValue. +func (in *JSONPatchValue) DeepCopy() *JSONPatchValue { + if in == nil { + return nil + } + out := new(JSONPatchValue) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *JSONSchemaProps) DeepCopyInto(out *JSONSchemaProps) { + *out = *in + if in.Example != nil { + in, out := &in.Example, &out.Example + *out = new(apiextensionsv1.JSON) + (*in).DeepCopyInto(*out) + } + if in.Properties != nil { + in, out := &in.Properties, &out.Properties + *out = make(map[string]JSONSchemaProps, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.AdditionalProperties != nil { + in, out := &in.AdditionalProperties, &out.AdditionalProperties + *out = new(JSONSchemaProps) + (*in).DeepCopyInto(*out) + } + if in.MaxProperties != nil { + in, out := &in.MaxProperties, &out.MaxProperties + *out = new(int64) + **out = **in + } + if in.MinProperties != nil { + in, out := &in.MinProperties, &out.MinProperties + *out = new(int64) + **out = **in + } + if in.Required != nil { + in, out := &in.Required, &out.Required + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = new(JSONSchemaProps) + (*in).DeepCopyInto(*out) + } + if in.MaxItems != nil { + in, out := &in.MaxItems, &out.MaxItems + *out = new(int64) + **out = **in + } + if in.MinItems != nil { + in, out := &in.MinItems, &out.MinItems + *out = new(int64) + **out = **in + } + if in.UniqueItems != nil { + in, out := &in.UniqueItems, &out.UniqueItems + *out = new(bool) + **out = **in + } + if in.MaxLength != nil { + in, out := &in.MaxLength, &out.MaxLength + *out = new(int64) + **out = **in + } + if in.MinLength != nil { + in, out := &in.MinLength, &out.MinLength + *out = new(int64) + **out = **in + } + if in.Maximum != nil { + in, out := &in.Maximum, &out.Maximum + *out = new(int64) + **out = **in + } + if in.ExclusiveMaximum != nil { + in, out := &in.ExclusiveMaximum, &out.ExclusiveMaximum + *out = new(bool) + **out = **in + } + if in.Minimum != nil { + in, out := &in.Minimum, &out.Minimum + *out = new(int64) + **out = **in + } + if in.ExclusiveMinimum != nil { + in, out := &in.ExclusiveMinimum, &out.ExclusiveMinimum + *out = new(bool) + **out = **in + } + if in.XPreserveUnknownFields != nil { + in, out := &in.XPreserveUnknownFields, &out.XPreserveUnknownFields + *out = new(bool) + **out = **in + } + if in.Enum != nil { + in, out := &in.Enum, &out.Enum + *out = make([]apiextensionsv1.JSON, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Default != nil { + in, out := &in.Default, &out.Default + *out = new(apiextensionsv1.JSON) + (*in).DeepCopyInto(*out) + } + if in.XValidations != nil { + in, out := &in.XValidations, &out.XValidations + *out = make([]ValidationRule, len(*in)) + copy(*out, *in) + } + in.XMetadata.DeepCopyInto(&out.XMetadata) + if in.XIntOrString != nil { + in, out := &in.XIntOrString, &out.XIntOrString + *out = new(bool) + **out = **in + } + if in.AllOf != nil { + in, out := &in.AllOf, &out.AllOf + *out = make([]JSONSchemaProps, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.OneOf != nil { + in, out := &in.OneOf, &out.OneOf + *out = make([]JSONSchemaProps, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.AnyOf != nil { + in, out := &in.AnyOf, &out.AnyOf + *out = make([]JSONSchemaProps, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Not != nil { + in, out := &in.Not, &out.Not + *out = new(JSONSchemaProps) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JSONSchemaProps. +func (in *JSONSchemaProps) DeepCopy() *JSONSchemaProps { + if in == nil { + return nil + } + out := new(JSONSchemaProps) + 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 *MachineDeletionSpec) DeepCopyInto(out *MachineDeletionSpec) { + *out = *in + if in.NodeDrainTimeoutSeconds != nil { + in, out := &in.NodeDrainTimeoutSeconds, &out.NodeDrainTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.NodeVolumeDetachTimeoutSeconds != nil { + in, out := &in.NodeVolumeDetachTimeoutSeconds, &out.NodeVolumeDetachTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.NodeDeletionTimeoutSeconds != nil { + in, out := &in.NodeDeletionTimeoutSeconds, &out.NodeDeletionTimeoutSeconds + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeletionSpec. +func (in *MachineDeletionSpec) DeepCopy() *MachineDeletionSpec { + if in == nil { + return nil + } + out := new(MachineDeletionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeletionStatus) DeepCopyInto(out *MachineDeletionStatus) { + *out = *in + in.NodeDrainStartTime.DeepCopyInto(&out.NodeDrainStartTime) + in.WaitForNodeVolumeDetachStartTime.DeepCopyInto(&out.WaitForNodeVolumeDetachStartTime) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeletionStatus. +func (in *MachineDeletionStatus) DeepCopy() *MachineDeletionStatus { + if in == nil { + return nil + } + out := new(MachineDeletionStatus) + 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.Metadata.DeepCopyInto(&out.Metadata) + out.Bootstrap = in.Bootstrap + out.Infrastructure = in.Infrastructure + in.HealthCheck.DeepCopyInto(&out.HealthCheck) + out.Naming = in.Naming + in.Deletion.DeepCopyInto(&out.Deletion) + if in.MinReadySeconds != nil { + in, out := &in.MinReadySeconds, &out.MinReadySeconds + *out = new(int32) + **out = **in + } + if in.ReadinessGates != nil { + in, out := &in.ReadinessGates, &out.ReadinessGates + *out = make([]MachineReadinessGate, len(*in)) + copy(*out, *in) + } + in.Rollout.DeepCopyInto(&out.Rollout) +} + +// 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 *MachineDeploymentClassBootstrapTemplate) DeepCopyInto(out *MachineDeploymentClassBootstrapTemplate) { + *out = *in + out.TemplateRef = in.TemplateRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClassBootstrapTemplate. +func (in *MachineDeploymentClassBootstrapTemplate) DeepCopy() *MachineDeploymentClassBootstrapTemplate { + if in == nil { + return nil + } + out := new(MachineDeploymentClassBootstrapTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentClassHealthCheck) DeepCopyInto(out *MachineDeploymentClassHealthCheck) { + *out = *in + in.Checks.DeepCopyInto(&out.Checks) + in.Remediation.DeepCopyInto(&out.Remediation) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClassHealthCheck. +func (in *MachineDeploymentClassHealthCheck) DeepCopy() *MachineDeploymentClassHealthCheck { + if in == nil { + return nil + } + out := new(MachineDeploymentClassHealthCheck) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentClassHealthCheckChecks) DeepCopyInto(out *MachineDeploymentClassHealthCheckChecks) { + *out = *in + if in.NodeStartupTimeoutSeconds != nil { + in, out := &in.NodeStartupTimeoutSeconds, &out.NodeStartupTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.UnhealthyNodeConditions != nil { + in, out := &in.UnhealthyNodeConditions, &out.UnhealthyNodeConditions + *out = make([]UnhealthyNodeCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClassHealthCheckChecks. +func (in *MachineDeploymentClassHealthCheckChecks) DeepCopy() *MachineDeploymentClassHealthCheckChecks { + if in == nil { + return nil + } + out := new(MachineDeploymentClassHealthCheckChecks) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentClassHealthCheckRemediation) DeepCopyInto(out *MachineDeploymentClassHealthCheckRemediation) { + *out = *in + if in.MaxInFlight != nil { + in, out := &in.MaxInFlight, &out.MaxInFlight + *out = new(intstr.IntOrString) + **out = **in + } + in.TriggerIf.DeepCopyInto(&out.TriggerIf) + out.TemplateRef = in.TemplateRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClassHealthCheckRemediation. +func (in *MachineDeploymentClassHealthCheckRemediation) DeepCopy() *MachineDeploymentClassHealthCheckRemediation { + if in == nil { + return nil + } + out := new(MachineDeploymentClassHealthCheckRemediation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentClassHealthCheckRemediationTriggerIf) DeepCopyInto(out *MachineDeploymentClassHealthCheckRemediationTriggerIf) { + *out = *in + if in.UnhealthyLessThanOrEqualTo != nil { + in, out := &in.UnhealthyLessThanOrEqualTo, &out.UnhealthyLessThanOrEqualTo + *out = new(intstr.IntOrString) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClassHealthCheckRemediationTriggerIf. +func (in *MachineDeploymentClassHealthCheckRemediationTriggerIf) DeepCopy() *MachineDeploymentClassHealthCheckRemediationTriggerIf { + if in == nil { + return nil + } + out := new(MachineDeploymentClassHealthCheckRemediationTriggerIf) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentClassInfrastructureTemplate) DeepCopyInto(out *MachineDeploymentClassInfrastructureTemplate) { + *out = *in + out.TemplateRef = in.TemplateRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClassInfrastructureTemplate. +func (in *MachineDeploymentClassInfrastructureTemplate) DeepCopy() *MachineDeploymentClassInfrastructureTemplate { + if in == nil { + return nil + } + out := new(MachineDeploymentClassInfrastructureTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentClassMachineDeletionSpec) DeepCopyInto(out *MachineDeploymentClassMachineDeletionSpec) { + *out = *in + if in.NodeDrainTimeoutSeconds != nil { + in, out := &in.NodeDrainTimeoutSeconds, &out.NodeDrainTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.NodeVolumeDetachTimeoutSeconds != nil { + in, out := &in.NodeVolumeDetachTimeoutSeconds, &out.NodeVolumeDetachTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.NodeDeletionTimeoutSeconds != nil { + in, out := &in.NodeDeletionTimeoutSeconds, &out.NodeDeletionTimeoutSeconds + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClassMachineDeletionSpec. +func (in *MachineDeploymentClassMachineDeletionSpec) DeepCopy() *MachineDeploymentClassMachineDeletionSpec { + if in == nil { + return nil + } + out := new(MachineDeploymentClassMachineDeletionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentClassNamingSpec) DeepCopyInto(out *MachineDeploymentClassNamingSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClassNamingSpec. +func (in *MachineDeploymentClassNamingSpec) DeepCopy() *MachineDeploymentClassNamingSpec { + if in == nil { + return nil + } + out := new(MachineDeploymentClassNamingSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentClassRolloutSpec) DeepCopyInto(out *MachineDeploymentClassRolloutSpec) { + *out = *in + in.Strategy.DeepCopyInto(&out.Strategy) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClassRolloutSpec. +func (in *MachineDeploymentClassRolloutSpec) DeepCopy() *MachineDeploymentClassRolloutSpec { + if in == nil { + return nil + } + out := new(MachineDeploymentClassRolloutSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentClassRolloutStrategy) DeepCopyInto(out *MachineDeploymentClassRolloutStrategy) { + *out = *in + in.RollingUpdate.DeepCopyInto(&out.RollingUpdate) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClassRolloutStrategy. +func (in *MachineDeploymentClassRolloutStrategy) DeepCopy() *MachineDeploymentClassRolloutStrategy { + if in == nil { + return nil + } + out := new(MachineDeploymentClassRolloutStrategy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentClassRolloutStrategyRollingUpdate) DeepCopyInto(out *MachineDeploymentClassRolloutStrategyRollingUpdate) { + *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 + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClassRolloutStrategyRollingUpdate. +func (in *MachineDeploymentClassRolloutStrategyRollingUpdate) DeepCopy() *MachineDeploymentClassRolloutStrategyRollingUpdate { + if in == nil { + return nil + } + out := new(MachineDeploymentClassRolloutStrategyRollingUpdate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentDeletionSpec) DeepCopyInto(out *MachineDeploymentDeletionSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentDeletionSpec. +func (in *MachineDeploymentDeletionSpec) DeepCopy() *MachineDeploymentDeletionSpec { + if in == nil { + return nil + } + out := new(MachineDeploymentDeletionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentDeprecatedStatus) DeepCopyInto(out *MachineDeploymentDeprecatedStatus) { + *out = *in + if in.V1Beta1 != nil { + in, out := &in.V1Beta1, &out.V1Beta1 + *out = new(MachineDeploymentV1Beta1DeprecatedStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentDeprecatedStatus. +func (in *MachineDeploymentDeprecatedStatus) DeepCopy() *MachineDeploymentDeprecatedStatus { + if in == nil { + return nil + } + out := new(MachineDeploymentDeprecatedStatus) + 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 *MachineDeploymentRemediationSpec) DeepCopyInto(out *MachineDeploymentRemediationSpec) { + *out = *in + if in.MaxInFlight != nil { + in, out := &in.MaxInFlight, &out.MaxInFlight + *out = new(intstr.IntOrString) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentRemediationSpec. +func (in *MachineDeploymentRemediationSpec) DeepCopy() *MachineDeploymentRemediationSpec { + if in == nil { + return nil + } + out := new(MachineDeploymentRemediationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentRolloutSpec) DeepCopyInto(out *MachineDeploymentRolloutSpec) { + *out = *in + in.After.DeepCopyInto(&out.After) + in.Strategy.DeepCopyInto(&out.Strategy) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentRolloutSpec. +func (in *MachineDeploymentRolloutSpec) DeepCopy() *MachineDeploymentRolloutSpec { + if in == nil { + return nil + } + out := new(MachineDeploymentRolloutSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentRolloutStrategy) DeepCopyInto(out *MachineDeploymentRolloutStrategy) { + *out = *in + in.RollingUpdate.DeepCopyInto(&out.RollingUpdate) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentRolloutStrategy. +func (in *MachineDeploymentRolloutStrategy) DeepCopy() *MachineDeploymentRolloutStrategy { + if in == nil { + return nil + } + out := new(MachineDeploymentRolloutStrategy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentRolloutStrategyRollingUpdate) DeepCopyInto(out *MachineDeploymentRolloutStrategyRollingUpdate) { + *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 + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentRolloutStrategyRollingUpdate. +func (in *MachineDeploymentRolloutStrategyRollingUpdate) DeepCopy() *MachineDeploymentRolloutStrategyRollingUpdate { + if in == nil { + return nil + } + out := new(MachineDeploymentRolloutStrategyRollingUpdate) + in.DeepCopyInto(out) + return out +} + +// 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.Rollout.DeepCopyInto(&out.Rollout) + in.Selector.DeepCopyInto(&out.Selector) + in.Template.DeepCopyInto(&out.Template) + out.MachineNaming = in.MachineNaming + in.Remediation.DeepCopyInto(&out.Remediation) + out.Deletion = in.Deletion + if in.Paused != nil { + in, out := &in.Paused, &out.Paused + *out = new(bool) + **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([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.ReadyReplicas != nil { + in, out := &in.ReadyReplicas, &out.ReadyReplicas + *out = new(int32) + **out = **in + } + if in.AvailableReplicas != nil { + in, out := &in.AvailableReplicas, &out.AvailableReplicas + *out = new(int32) + **out = **in + } + if in.UpToDateReplicas != nil { + in, out := &in.UpToDateReplicas, &out.UpToDateReplicas + *out = new(int32) + **out = **in + } + if in.Deprecated != nil { + in, out := &in.Deprecated, &out.Deprecated + *out = new(MachineDeploymentDeprecatedStatus) + (*in).DeepCopyInto(*out) + } +} + +// 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 *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 + } + in.HealthCheck.DeepCopyInto(&out.HealthCheck) + in.Deletion.DeepCopyInto(&out.Deletion) + if in.MinReadySeconds != nil { + in, out := &in.MinReadySeconds, &out.MinReadySeconds + *out = new(int32) + **out = **in + } + if in.ReadinessGates != nil { + in, out := &in.ReadinessGates, &out.ReadinessGates + *out = make([]MachineReadinessGate, len(*in)) + copy(*out, *in) + } + in.Rollout.DeepCopyInto(&out.Rollout) + in.Variables.DeepCopyInto(&out.Variables) +} + +// 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 *MachineDeploymentTopologyHealthCheck) DeepCopyInto(out *MachineDeploymentTopologyHealthCheck) { + *out = *in + if in.Enabled != nil { + in, out := &in.Enabled, &out.Enabled + *out = new(bool) + **out = **in + } + in.Checks.DeepCopyInto(&out.Checks) + in.Remediation.DeepCopyInto(&out.Remediation) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentTopologyHealthCheck. +func (in *MachineDeploymentTopologyHealthCheck) DeepCopy() *MachineDeploymentTopologyHealthCheck { + if in == nil { + return nil + } + out := new(MachineDeploymentTopologyHealthCheck) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentTopologyHealthCheckChecks) DeepCopyInto(out *MachineDeploymentTopologyHealthCheckChecks) { + *out = *in + if in.NodeStartupTimeoutSeconds != nil { + in, out := &in.NodeStartupTimeoutSeconds, &out.NodeStartupTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.UnhealthyNodeConditions != nil { + in, out := &in.UnhealthyNodeConditions, &out.UnhealthyNodeConditions + *out = make([]UnhealthyNodeCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentTopologyHealthCheckChecks. +func (in *MachineDeploymentTopologyHealthCheckChecks) DeepCopy() *MachineDeploymentTopologyHealthCheckChecks { + if in == nil { + return nil + } + out := new(MachineDeploymentTopologyHealthCheckChecks) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentTopologyHealthCheckRemediation) DeepCopyInto(out *MachineDeploymentTopologyHealthCheckRemediation) { + *out = *in + if in.MaxInFlight != nil { + in, out := &in.MaxInFlight, &out.MaxInFlight + *out = new(intstr.IntOrString) + **out = **in + } + in.TriggerIf.DeepCopyInto(&out.TriggerIf) + out.TemplateRef = in.TemplateRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentTopologyHealthCheckRemediation. +func (in *MachineDeploymentTopologyHealthCheckRemediation) DeepCopy() *MachineDeploymentTopologyHealthCheckRemediation { + if in == nil { + return nil + } + out := new(MachineDeploymentTopologyHealthCheckRemediation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentTopologyHealthCheckRemediationTriggerIf) DeepCopyInto(out *MachineDeploymentTopologyHealthCheckRemediationTriggerIf) { + *out = *in + if in.UnhealthyLessThanOrEqualTo != nil { + in, out := &in.UnhealthyLessThanOrEqualTo, &out.UnhealthyLessThanOrEqualTo + *out = new(intstr.IntOrString) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentTopologyHealthCheckRemediationTriggerIf. +func (in *MachineDeploymentTopologyHealthCheckRemediationTriggerIf) DeepCopy() *MachineDeploymentTopologyHealthCheckRemediationTriggerIf { + if in == nil { + return nil + } + out := new(MachineDeploymentTopologyHealthCheckRemediationTriggerIf) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentTopologyMachineDeletionSpec) DeepCopyInto(out *MachineDeploymentTopologyMachineDeletionSpec) { + *out = *in + if in.NodeDrainTimeoutSeconds != nil { + in, out := &in.NodeDrainTimeoutSeconds, &out.NodeDrainTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.NodeVolumeDetachTimeoutSeconds != nil { + in, out := &in.NodeVolumeDetachTimeoutSeconds, &out.NodeVolumeDetachTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.NodeDeletionTimeoutSeconds != nil { + in, out := &in.NodeDeletionTimeoutSeconds, &out.NodeDeletionTimeoutSeconds + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentTopologyMachineDeletionSpec. +func (in *MachineDeploymentTopologyMachineDeletionSpec) DeepCopy() *MachineDeploymentTopologyMachineDeletionSpec { + if in == nil { + return nil + } + out := new(MachineDeploymentTopologyMachineDeletionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentTopologyRolloutSpec) DeepCopyInto(out *MachineDeploymentTopologyRolloutSpec) { + *out = *in + in.Strategy.DeepCopyInto(&out.Strategy) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentTopologyRolloutSpec. +func (in *MachineDeploymentTopologyRolloutSpec) DeepCopy() *MachineDeploymentTopologyRolloutSpec { + if in == nil { + return nil + } + out := new(MachineDeploymentTopologyRolloutSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentTopologyRolloutStrategy) DeepCopyInto(out *MachineDeploymentTopologyRolloutStrategy) { + *out = *in + in.RollingUpdate.DeepCopyInto(&out.RollingUpdate) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentTopologyRolloutStrategy. +func (in *MachineDeploymentTopologyRolloutStrategy) DeepCopy() *MachineDeploymentTopologyRolloutStrategy { + if in == nil { + return nil + } + out := new(MachineDeploymentTopologyRolloutStrategy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentTopologyRolloutStrategyRollingUpdate) DeepCopyInto(out *MachineDeploymentTopologyRolloutStrategyRollingUpdate) { + *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 + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentTopologyRolloutStrategyRollingUpdate. +func (in *MachineDeploymentTopologyRolloutStrategyRollingUpdate) DeepCopy() *MachineDeploymentTopologyRolloutStrategyRollingUpdate { + if in == nil { + return nil + } + out := new(MachineDeploymentTopologyRolloutStrategyRollingUpdate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentV1Beta1DeprecatedStatus) DeepCopyInto(out *MachineDeploymentV1Beta1DeprecatedStatus) { + *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 MachineDeploymentV1Beta1DeprecatedStatus. +func (in *MachineDeploymentV1Beta1DeprecatedStatus) DeepCopy() *MachineDeploymentV1Beta1DeprecatedStatus { + if in == nil { + return nil + } + out := new(MachineDeploymentV1Beta1DeprecatedStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeploymentVariables) DeepCopyInto(out *MachineDeploymentVariables) { + *out = *in + if in.Overrides != nil { + in, out := &in.Overrides, &out.Overrides + *out = make([]ClusterVariable, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentVariables. +func (in *MachineDeploymentVariables) DeepCopy() *MachineDeploymentVariables { + if in == nil { + return nil + } + out := new(MachineDeploymentVariables) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDeprecatedStatus) DeepCopyInto(out *MachineDeprecatedStatus) { + *out = *in + if in.V1Beta1 != nil { + in, out := &in.V1Beta1, &out.V1Beta1 + *out = new(MachineV1Beta1DeprecatedStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeprecatedStatus. +func (in *MachineDeprecatedStatus) DeepCopy() *MachineDeprecatedStatus { + if in == nil { + return nil + } + out := new(MachineDeprecatedStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDrainRule) DeepCopyInto(out *MachineDrainRule) { + *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 MachineDrainRule. +func (in *MachineDrainRule) DeepCopy() *MachineDrainRule { + if in == nil { + return nil + } + out := new(MachineDrainRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineDrainRule) 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 *MachineDrainRuleDrainConfig) DeepCopyInto(out *MachineDrainRuleDrainConfig) { + *out = *in + if in.Order != nil { + in, out := &in.Order, &out.Order + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDrainRuleDrainConfig. +func (in *MachineDrainRuleDrainConfig) DeepCopy() *MachineDrainRuleDrainConfig { + if in == nil { + return nil + } + out := new(MachineDrainRuleDrainConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDrainRuleList) DeepCopyInto(out *MachineDrainRuleList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]MachineDrainRule, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDrainRuleList. +func (in *MachineDrainRuleList) DeepCopy() *MachineDrainRuleList { + if in == nil { + return nil + } + out := new(MachineDrainRuleList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *MachineDrainRuleList) 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 *MachineDrainRuleMachineSelector) DeepCopyInto(out *MachineDrainRuleMachineSelector) { + *out = *in + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(v1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.ClusterSelector != nil { + in, out := &in.ClusterSelector, &out.ClusterSelector + *out = new(v1.LabelSelector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDrainRuleMachineSelector. +func (in *MachineDrainRuleMachineSelector) DeepCopy() *MachineDrainRuleMachineSelector { + if in == nil { + return nil + } + out := new(MachineDrainRuleMachineSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDrainRulePodSelector) DeepCopyInto(out *MachineDrainRulePodSelector) { + *out = *in + if in.Selector != nil { + in, out := &in.Selector, &out.Selector + *out = new(v1.LabelSelector) + (*in).DeepCopyInto(*out) + } + if in.NamespaceSelector != nil { + in, out := &in.NamespaceSelector, &out.NamespaceSelector + *out = new(v1.LabelSelector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDrainRulePodSelector. +func (in *MachineDrainRulePodSelector) DeepCopy() *MachineDrainRulePodSelector { + if in == nil { + return nil + } + out := new(MachineDrainRulePodSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineDrainRuleSpec) DeepCopyInto(out *MachineDrainRuleSpec) { + *out = *in + in.Drain.DeepCopyInto(&out.Drain) + if in.Machines != nil { + in, out := &in.Machines, &out.Machines + *out = make([]MachineDrainRuleMachineSelector, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Pods != nil { + in, out := &in.Pods, &out.Pods + *out = make([]MachineDrainRulePodSelector, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDrainRuleSpec. +func (in *MachineDrainRuleSpec) DeepCopy() *MachineDrainRuleSpec { + if in == nil { + return nil + } + out := new(MachineDrainRuleSpec) + 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 *MachineHealthCheckChecks) DeepCopyInto(out *MachineHealthCheckChecks) { + *out = *in + if in.NodeStartupTimeoutSeconds != nil { + in, out := &in.NodeStartupTimeoutSeconds, &out.NodeStartupTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.UnhealthyNodeConditions != nil { + in, out := &in.UnhealthyNodeConditions, &out.UnhealthyNodeConditions + *out = make([]UnhealthyNodeCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckChecks. +func (in *MachineHealthCheckChecks) DeepCopy() *MachineHealthCheckChecks { + if in == nil { + return nil + } + out := new(MachineHealthCheckChecks) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineHealthCheckDeprecatedStatus) DeepCopyInto(out *MachineHealthCheckDeprecatedStatus) { + *out = *in + if in.V1Beta1 != nil { + in, out := &in.V1Beta1, &out.V1Beta1 + *out = new(MachineHealthCheckV1Beta1DeprecatedStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckDeprecatedStatus. +func (in *MachineHealthCheckDeprecatedStatus) DeepCopy() *MachineHealthCheckDeprecatedStatus { + if in == nil { + return nil + } + out := new(MachineHealthCheckDeprecatedStatus) + in.DeepCopyInto(out) + return out +} + +// 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 *MachineHealthCheckRemediation) DeepCopyInto(out *MachineHealthCheckRemediation) { + *out = *in + in.TriggerIf.DeepCopyInto(&out.TriggerIf) + out.TemplateRef = in.TemplateRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckRemediation. +func (in *MachineHealthCheckRemediation) DeepCopy() *MachineHealthCheckRemediation { + if in == nil { + return nil + } + out := new(MachineHealthCheckRemediation) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineHealthCheckRemediationTemplateReference) DeepCopyInto(out *MachineHealthCheckRemediationTemplateReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckRemediationTemplateReference. +func (in *MachineHealthCheckRemediationTemplateReference) DeepCopy() *MachineHealthCheckRemediationTemplateReference { + if in == nil { + return nil + } + out := new(MachineHealthCheckRemediationTemplateReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineHealthCheckRemediationTriggerIf) DeepCopyInto(out *MachineHealthCheckRemediationTriggerIf) { + *out = *in + if in.UnhealthyLessThanOrEqualTo != nil { + in, out := &in.UnhealthyLessThanOrEqualTo, &out.UnhealthyLessThanOrEqualTo + *out = new(intstr.IntOrString) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckRemediationTriggerIf. +func (in *MachineHealthCheckRemediationTriggerIf) DeepCopy() *MachineHealthCheckRemediationTriggerIf { + if in == nil { + return nil + } + out := new(MachineHealthCheckRemediationTriggerIf) + in.DeepCopyInto(out) + return out +} + +// 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) + in.Checks.DeepCopyInto(&out.Checks) + in.Remediation.DeepCopyInto(&out.Remediation) +} + +// 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.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.ExpectedMachines != nil { + in, out := &in.ExpectedMachines, &out.ExpectedMachines + *out = new(int32) + **out = **in + } + if in.CurrentHealthy != nil { + in, out := &in.CurrentHealthy, &out.CurrentHealthy + *out = new(int32) + **out = **in + } + if in.RemediationsAllowed != nil { + in, out := &in.RemediationsAllowed, &out.RemediationsAllowed + *out = new(int32) + **out = **in + } + if in.Targets != nil { + in, out := &in.Targets, &out.Targets + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Deprecated != nil { + in, out := &in.Deprecated, &out.Deprecated + *out = new(MachineHealthCheckDeprecatedStatus) + (*in).DeepCopyInto(*out) + } +} + +// 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 *MachineHealthCheckV1Beta1DeprecatedStatus) DeepCopyInto(out *MachineHealthCheckV1Beta1DeprecatedStatus) { + *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 MachineHealthCheckV1Beta1DeprecatedStatus. +func (in *MachineHealthCheckV1Beta1DeprecatedStatus) DeepCopy() *MachineHealthCheckV1Beta1DeprecatedStatus { + if in == nil { + return nil + } + out := new(MachineHealthCheckV1Beta1DeprecatedStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineInitializationStatus) DeepCopyInto(out *MachineInitializationStatus) { + *out = *in + if in.InfrastructureProvisioned != nil { + in, out := &in.InfrastructureProvisioned, &out.InfrastructureProvisioned + *out = new(bool) + **out = **in + } + if in.BootstrapDataSecretCreated != nil { + in, out := &in.BootstrapDataSecretCreated, &out.BootstrapDataSecretCreated + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineInitializationStatus. +func (in *MachineInitializationStatus) DeepCopy() *MachineInitializationStatus { + if in == nil { + return nil + } + out := new(MachineInitializationStatus) + 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 *MachineNamingSpec) DeepCopyInto(out *MachineNamingSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineNamingSpec. +func (in *MachineNamingSpec) DeepCopy() *MachineNamingSpec { + if in == nil { + return nil + } + out := new(MachineNamingSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineNodeReference) DeepCopyInto(out *MachineNodeReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineNodeReference. +func (in *MachineNodeReference) DeepCopy() *MachineNodeReference { + if in == nil { + return nil + } + out := new(MachineNodeReference) + in.DeepCopyInto(out) + return out +} + +// 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 *MachinePoolClass) DeepCopyInto(out *MachinePoolClass) { + *out = *in + in.Metadata.DeepCopyInto(&out.Metadata) + out.Bootstrap = in.Bootstrap + out.Infrastructure = in.Infrastructure + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.Naming = in.Naming + in.Deletion.DeepCopyInto(&out.Deletion) + if in.MinReadySeconds != nil { + in, out := &in.MinReadySeconds, &out.MinReadySeconds + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolClass. +func (in *MachinePoolClass) DeepCopy() *MachinePoolClass { + if in == nil { + return nil + } + out := new(MachinePoolClass) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachinePoolClassBootstrapTemplate) DeepCopyInto(out *MachinePoolClassBootstrapTemplate) { + *out = *in + out.TemplateRef = in.TemplateRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolClassBootstrapTemplate. +func (in *MachinePoolClassBootstrapTemplate) DeepCopy() *MachinePoolClassBootstrapTemplate { + if in == nil { + return nil + } + out := new(MachinePoolClassBootstrapTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachinePoolClassInfrastructureTemplate) DeepCopyInto(out *MachinePoolClassInfrastructureTemplate) { + *out = *in + out.TemplateRef = in.TemplateRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolClassInfrastructureTemplate. +func (in *MachinePoolClassInfrastructureTemplate) DeepCopy() *MachinePoolClassInfrastructureTemplate { + if in == nil { + return nil + } + out := new(MachinePoolClassInfrastructureTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachinePoolClassMachineDeletionSpec) DeepCopyInto(out *MachinePoolClassMachineDeletionSpec) { + *out = *in + if in.NodeDrainTimeoutSeconds != nil { + in, out := &in.NodeDrainTimeoutSeconds, &out.NodeDrainTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.NodeVolumeDetachTimeoutSeconds != nil { + in, out := &in.NodeVolumeDetachTimeoutSeconds, &out.NodeVolumeDetachTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.NodeDeletionTimeoutSeconds != nil { + in, out := &in.NodeDeletionTimeoutSeconds, &out.NodeDeletionTimeoutSeconds + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolClassMachineDeletionSpec. +func (in *MachinePoolClassMachineDeletionSpec) DeepCopy() *MachinePoolClassMachineDeletionSpec { + if in == nil { + return nil + } + out := new(MachinePoolClassMachineDeletionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachinePoolClassNamingSpec) DeepCopyInto(out *MachinePoolClassNamingSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolClassNamingSpec. +func (in *MachinePoolClassNamingSpec) DeepCopy() *MachinePoolClassNamingSpec { + if in == nil { + return nil + } + out := new(MachinePoolClassNamingSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachinePoolDeprecatedStatus) DeepCopyInto(out *MachinePoolDeprecatedStatus) { + *out = *in + if in.V1Beta1 != nil { + in, out := &in.V1Beta1, &out.V1Beta1 + *out = new(MachinePoolV1Beta1DeprecatedStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolDeprecatedStatus. +func (in *MachinePoolDeprecatedStatus) DeepCopy() *MachinePoolDeprecatedStatus { + if in == nil { + return nil + } + out := new(MachinePoolDeprecatedStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachinePoolInitializationStatus) DeepCopyInto(out *MachinePoolInitializationStatus) { + *out = *in + if in.InfrastructureProvisioned != nil { + in, out := &in.InfrastructureProvisioned, &out.InfrastructureProvisioned + *out = new(bool) + **out = **in + } + if in.BootstrapDataSecretCreated != nil { + in, out := &in.BootstrapDataSecretCreated, &out.BootstrapDataSecretCreated + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolInitializationStatus. +func (in *MachinePoolInitializationStatus) DeepCopy() *MachinePoolInitializationStatus { + if in == nil { + return nil + } + out := new(MachinePoolInitializationStatus) + in.DeepCopyInto(out) + return out +} + +// 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.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.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.Initialization.DeepCopyInto(&out.Initialization) + if in.NodeRefs != nil { + in, out := &in.NodeRefs, &out.NodeRefs + *out = make([]corev1.ObjectReference, len(*in)) + copy(*out, *in) + } + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.ReadyReplicas != nil { + in, out := &in.ReadyReplicas, &out.ReadyReplicas + *out = new(int32) + **out = **in + } + if in.AvailableReplicas != nil { + in, out := &in.AvailableReplicas, &out.AvailableReplicas + *out = new(int32) + **out = **in + } + if in.UpToDateReplicas != nil { + in, out := &in.UpToDateReplicas, &out.UpToDateReplicas + *out = new(int32) + **out = **in + } + if in.Deprecated != nil { + in, out := &in.Deprecated, &out.Deprecated + *out = new(MachinePoolDeprecatedStatus) + (*in).DeepCopyInto(*out) + } +} + +// 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 +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachinePoolTopology) DeepCopyInto(out *MachinePoolTopology) { + *out = *in + in.Metadata.DeepCopyInto(&out.Metadata) + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.Deletion.DeepCopyInto(&out.Deletion) + if in.MinReadySeconds != nil { + in, out := &in.MinReadySeconds, &out.MinReadySeconds + *out = new(int32) + **out = **in + } + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + in.Variables.DeepCopyInto(&out.Variables) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolTopology. +func (in *MachinePoolTopology) DeepCopy() *MachinePoolTopology { + if in == nil { + return nil + } + out := new(MachinePoolTopology) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachinePoolTopologyMachineDeletionSpec) DeepCopyInto(out *MachinePoolTopologyMachineDeletionSpec) { + *out = *in + if in.NodeDrainTimeoutSeconds != nil { + in, out := &in.NodeDrainTimeoutSeconds, &out.NodeDrainTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.NodeVolumeDetachTimeoutSeconds != nil { + in, out := &in.NodeVolumeDetachTimeoutSeconds, &out.NodeVolumeDetachTimeoutSeconds + *out = new(int32) + **out = **in + } + if in.NodeDeletionTimeoutSeconds != nil { + in, out := &in.NodeDeletionTimeoutSeconds, &out.NodeDeletionTimeoutSeconds + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolTopologyMachineDeletionSpec. +func (in *MachinePoolTopologyMachineDeletionSpec) DeepCopy() *MachinePoolTopologyMachineDeletionSpec { + if in == nil { + return nil + } + out := new(MachinePoolTopologyMachineDeletionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachinePoolV1Beta1DeprecatedStatus) DeepCopyInto(out *MachinePoolV1Beta1DeprecatedStatus) { + *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]) + } + } + 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 + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolV1Beta1DeprecatedStatus. +func (in *MachinePoolV1Beta1DeprecatedStatus) DeepCopy() *MachinePoolV1Beta1DeprecatedStatus { + if in == nil { + return nil + } + out := new(MachinePoolV1Beta1DeprecatedStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachinePoolVariables) DeepCopyInto(out *MachinePoolVariables) { + *out = *in + if in.Overrides != nil { + in, out := &in.Overrides, &out.Overrides + *out = make([]ClusterVariable, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolVariables. +func (in *MachinePoolVariables) DeepCopy() *MachinePoolVariables { + if in == nil { + return nil + } + out := new(MachinePoolVariables) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineReadinessGate) DeepCopyInto(out *MachineReadinessGate) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineReadinessGate. +func (in *MachineReadinessGate) DeepCopy() *MachineReadinessGate { + if in == nil { + return nil + } + out := new(MachineReadinessGate) + 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 *MachineSetDeletionSpec) DeepCopyInto(out *MachineSetDeletionSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetDeletionSpec. +func (in *MachineSetDeletionSpec) DeepCopy() *MachineSetDeletionSpec { + if in == nil { + return nil + } + out := new(MachineSetDeletionSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MachineSetDeprecatedStatus) DeepCopyInto(out *MachineSetDeprecatedStatus) { + *out = *in + if in.V1Beta1 != nil { + in, out := &in.V1Beta1, &out.V1Beta1 + *out = new(MachineSetV1Beta1DeprecatedStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetDeprecatedStatus. +func (in *MachineSetDeprecatedStatus) DeepCopy() *MachineSetDeprecatedStatus { + if in == nil { + return nil + } + out := new(MachineSetDeprecatedStatus) + in.DeepCopyInto(out) + return out +} + +// 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) + out.MachineNaming = in.MachineNaming + out.Deletion = in.Deletion +} + +// 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.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.ReadyReplicas != nil { + in, out := &in.ReadyReplicas, &out.ReadyReplicas + *out = new(int32) + **out = **in + } + if in.AvailableReplicas != nil { + in, out := &in.AvailableReplicas, &out.AvailableReplicas + *out = new(int32) + **out = **in + } + if in.UpToDateReplicas != nil { + in, out := &in.UpToDateReplicas, &out.UpToDateReplicas + *out = new(int32) + **out = **in + } + if in.Deprecated != nil { + in, out := &in.Deprecated, &out.Deprecated + *out = new(MachineSetDeprecatedStatus) + (*in).DeepCopyInto(*out) + } +} + +// 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 *MachineSetV1Beta1DeprecatedStatus) DeepCopyInto(out *MachineSetV1Beta1DeprecatedStatus) { + *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]) + } + } + 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 MachineSetV1Beta1DeprecatedStatus. +func (in *MachineSetV1Beta1DeprecatedStatus) DeepCopy() *MachineSetV1Beta1DeprecatedStatus { + if in == nil { + return nil + } + out := new(MachineSetV1Beta1DeprecatedStatus) + 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.MinReadySeconds != nil { + in, out := &in.MinReadySeconds, &out.MinReadySeconds + *out = new(int32) + **out = **in + } + if in.ReadinessGates != nil { + in, out := &in.ReadinessGates, &out.ReadinessGates + *out = make([]MachineReadinessGate, len(*in)) + copy(*out, *in) + } + in.Deletion.DeepCopyInto(&out.Deletion) +} + +// 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.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + in.Initialization.DeepCopyInto(&out.Initialization) + out.NodeRef = in.NodeRef + if in.NodeInfo != nil { + in, out := &in.NodeInfo, &out.NodeInfo + *out = new(corev1.NodeSystemInfo) + (*in).DeepCopyInto(*out) + } + in.LastUpdated.DeepCopyInto(&out.LastUpdated) + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make(MachineAddresses, len(*in)) + copy(*out, *in) + } + in.CertificatesExpiryDate.DeepCopyInto(&out.CertificatesExpiryDate) + if in.Deletion != nil { + in, out := &in.Deletion, &out.Deletion + *out = new(MachineDeletionStatus) + (*in).DeepCopyInto(*out) + } + if in.Deprecated != nil { + in, out := &in.Deprecated, &out.Deprecated + *out = new(MachineDeprecatedStatus) + (*in).DeepCopyInto(*out) + } +} + +// 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 *MachineV1Beta1DeprecatedStatus) DeepCopyInto(out *MachineV1Beta1DeprecatedStatus) { + *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]) + } + } + 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 + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineV1Beta1DeprecatedStatus. +func (in *MachineV1Beta1DeprecatedStatus) DeepCopy() *MachineV1Beta1DeprecatedStatus { + if in == nil { + return nil + } + out := new(MachineV1Beta1DeprecatedStatus) + 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 *PatchDefinition) DeepCopyInto(out *PatchDefinition) { + *out = *in + in.Selector.DeepCopyInto(&out.Selector) + if in.JSONPatches != nil { + in, out := &in.JSONPatches, &out.JSONPatches + *out = make([]JSONPatch, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PatchDefinition. +func (in *PatchDefinition) DeepCopy() *PatchDefinition { + if in == nil { + return nil + } + out := new(PatchDefinition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PatchSelector) DeepCopyInto(out *PatchSelector) { + *out = *in + in.MatchResources.DeepCopyInto(&out.MatchResources) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PatchSelector. +func (in *PatchSelector) DeepCopy() *PatchSelector { + if in == nil { + return nil + } + out := new(PatchSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PatchSelectorMatch) DeepCopyInto(out *PatchSelectorMatch) { + *out = *in + if in.ControlPlane != nil { + in, out := &in.ControlPlane, &out.ControlPlane + *out = new(bool) + **out = **in + } + if in.InfrastructureCluster != nil { + in, out := &in.InfrastructureCluster, &out.InfrastructureCluster + *out = new(bool) + **out = **in + } + if in.MachineDeploymentClass != nil { + in, out := &in.MachineDeploymentClass, &out.MachineDeploymentClass + *out = new(PatchSelectorMatchMachineDeploymentClass) + (*in).DeepCopyInto(*out) + } + if in.MachinePoolClass != nil { + in, out := &in.MachinePoolClass, &out.MachinePoolClass + *out = new(PatchSelectorMatchMachinePoolClass) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PatchSelectorMatch. +func (in *PatchSelectorMatch) DeepCopy() *PatchSelectorMatch { + if in == nil { + return nil + } + out := new(PatchSelectorMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PatchSelectorMatchMachineDeploymentClass) DeepCopyInto(out *PatchSelectorMatchMachineDeploymentClass) { + *out = *in + if in.Names != nil { + in, out := &in.Names, &out.Names + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PatchSelectorMatchMachineDeploymentClass. +func (in *PatchSelectorMatchMachineDeploymentClass) DeepCopy() *PatchSelectorMatchMachineDeploymentClass { + if in == nil { + return nil + } + out := new(PatchSelectorMatchMachineDeploymentClass) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PatchSelectorMatchMachinePoolClass) DeepCopyInto(out *PatchSelectorMatchMachinePoolClass) { + *out = *in + if in.Names != nil { + in, out := &in.Names, &out.Names + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PatchSelectorMatchMachinePoolClass. +func (in *PatchSelectorMatchMachinePoolClass) DeepCopy() *PatchSelectorMatchMachinePoolClass { + if in == nil { + return nil + } + out := new(PatchSelectorMatchMachinePoolClass) + 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 + out.ClassRef = in.ClassRef + in.ControlPlane.DeepCopyInto(&out.ControlPlane) + in.Workers.DeepCopyInto(&out.Workers) + if in.Variables != nil { + in, out := &in.Variables, &out.Variables + *out = make([]ClusterVariable, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// 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 *UnhealthyNodeCondition) DeepCopyInto(out *UnhealthyNodeCondition) { + *out = *in + if in.TimeoutSeconds != nil { + in, out := &in.TimeoutSeconds, &out.TimeoutSeconds + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UnhealthyNodeCondition. +func (in *UnhealthyNodeCondition) DeepCopy() *UnhealthyNodeCondition { + if in == nil { + return nil + } + out := new(UnhealthyNodeCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ValidationRule) DeepCopyInto(out *ValidationRule) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValidationRule. +func (in *ValidationRule) DeepCopy() *ValidationRule { + if in == nil { + return nil + } + out := new(ValidationRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VariableSchema) DeepCopyInto(out *VariableSchema) { + *out = *in + in.OpenAPIV3Schema.DeepCopyInto(&out.OpenAPIV3Schema) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VariableSchema. +func (in *VariableSchema) DeepCopy() *VariableSchema { + if in == nil { + return nil + } + out := new(VariableSchema) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VariableSchemaMetadata) DeepCopyInto(out *VariableSchemaMetadata) { + *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 VariableSchemaMetadata. +func (in *VariableSchemaMetadata) DeepCopy() *VariableSchemaMetadata { + if in == nil { + return nil + } + out := new(VariableSchemaMetadata) + 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]) + } + } + if in.MachinePools != nil { + in, out := &in.MachinePools, &out.MachinePools + *out = make([]MachinePoolClass, 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 *WorkersStatus) DeepCopyInto(out *WorkersStatus) { + *out = *in + if in.DesiredReplicas != nil { + in, out := &in.DesiredReplicas, &out.DesiredReplicas + *out = new(int32) + **out = **in + } + if in.Replicas != nil { + in, out := &in.Replicas, &out.Replicas + *out = new(int32) + **out = **in + } + if in.UpToDateReplicas != nil { + in, out := &in.UpToDateReplicas, &out.UpToDateReplicas + *out = new(int32) + **out = **in + } + if in.ReadyReplicas != nil { + in, out := &in.ReadyReplicas, &out.ReadyReplicas + *out = new(int32) + **out = **in + } + if in.AvailableReplicas != nil { + in, out := &in.AvailableReplicas, &out.AvailableReplicas + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkersStatus. +func (in *WorkersStatus) DeepCopy() *WorkersStatus { + if in == nil { + return nil + } + out := new(WorkersStatus) + 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]) + } + } + if in.MachinePools != nil { + in, out := &in.MachinePools, &out.MachinePools + *out = make([]MachinePoolTopology, 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/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/zz_generated.openapi.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/zz_generated.openapi.go new file mode 100644 index 0000000000..6ada26c78c --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta2/zz_generated.openapi.go @@ -0,0 +1,6838 @@ +//go:build !ignore_autogenerated +// +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 openapi-gen. DO NOT EDIT. + +package v1beta2 + +import ( + common "k8s.io/kube-openapi/pkg/common" + spec "k8s.io/kube-openapi/pkg/validation/spec" +) + +func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenAPIDefinition { + return map[string]common.OpenAPIDefinition{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.APIEndpoint": schema_cluster_api_api_core_v1beta2_APIEndpoint(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.Bootstrap": schema_cluster_api_api_core_v1beta2_Bootstrap(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.Cluster": schema_cluster_api_api_core_v1beta2_Cluster(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterAvailabilityGate": schema_cluster_api_api_core_v1beta2_ClusterAvailabilityGate(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClass": schema_cluster_api_api_core_v1beta2_ClusterClass(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassDeprecatedStatus": schema_cluster_api_api_core_v1beta2_ClusterClassDeprecatedStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassList": schema_cluster_api_api_core_v1beta2_ClusterClassList(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassPatch": schema_cluster_api_api_core_v1beta2_ClusterClassPatch(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassRef": schema_cluster_api_api_core_v1beta2_ClusterClassRef(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassSpec": schema_cluster_api_api_core_v1beta2_ClusterClassSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassStatus": schema_cluster_api_api_core_v1beta2_ClusterClassStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassStatusVariable": schema_cluster_api_api_core_v1beta2_ClusterClassStatusVariable(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassStatusVariableDefinition": schema_cluster_api_api_core_v1beta2_ClusterClassStatusVariableDefinition(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassTemplateReference": schema_cluster_api_api_core_v1beta2_ClusterClassTemplateReference(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassV1Beta1DeprecatedStatus": schema_cluster_api_api_core_v1beta2_ClusterClassV1Beta1DeprecatedStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassVariable": schema_cluster_api_api_core_v1beta2_ClusterClassVariable(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassVariableMetadata": schema_cluster_api_api_core_v1beta2_ClusterClassVariableMetadata(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterControlPlaneStatus": schema_cluster_api_api_core_v1beta2_ClusterControlPlaneStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterDeprecatedStatus": schema_cluster_api_api_core_v1beta2_ClusterDeprecatedStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterInitializationStatus": schema_cluster_api_api_core_v1beta2_ClusterInitializationStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterList": schema_cluster_api_api_core_v1beta2_ClusterList(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterNetwork": schema_cluster_api_api_core_v1beta2_ClusterNetwork(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterSpec": schema_cluster_api_api_core_v1beta2_ClusterSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterStatus": schema_cluster_api_api_core_v1beta2_ClusterStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterV1Beta1DeprecatedStatus": schema_cluster_api_api_core_v1beta2_ClusterV1Beta1DeprecatedStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterVariable": schema_cluster_api_api_core_v1beta2_ClusterVariable(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.Condition": schema_cluster_api_api_core_v1beta2_Condition(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ContractVersionedObjectReference": schema_cluster_api_api_core_v1beta2_ContractVersionedObjectReference(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClass": schema_cluster_api_api_core_v1beta2_ControlPlaneClass(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassHealthCheck": schema_cluster_api_api_core_v1beta2_ControlPlaneClassHealthCheck(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassHealthCheckChecks": schema_cluster_api_api_core_v1beta2_ControlPlaneClassHealthCheckChecks(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassHealthCheckRemediation": schema_cluster_api_api_core_v1beta2_ControlPlaneClassHealthCheckRemediation(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassHealthCheckRemediationTriggerIf": schema_cluster_api_api_core_v1beta2_ControlPlaneClassHealthCheckRemediationTriggerIf(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassMachineDeletionSpec": schema_cluster_api_api_core_v1beta2_ControlPlaneClassMachineDeletionSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassMachineInfrastructureTemplate": schema_cluster_api_api_core_v1beta2_ControlPlaneClassMachineInfrastructureTemplate(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassNamingSpec": schema_cluster_api_api_core_v1beta2_ControlPlaneClassNamingSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopology": schema_cluster_api_api_core_v1beta2_ControlPlaneTopology(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopologyHealthCheck": schema_cluster_api_api_core_v1beta2_ControlPlaneTopologyHealthCheck(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopologyHealthCheckChecks": schema_cluster_api_api_core_v1beta2_ControlPlaneTopologyHealthCheckChecks(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopologyHealthCheckRemediation": schema_cluster_api_api_core_v1beta2_ControlPlaneTopologyHealthCheckRemediation(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopologyHealthCheckRemediationTriggerIf": schema_cluster_api_api_core_v1beta2_ControlPlaneTopologyHealthCheckRemediationTriggerIf(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopologyMachineDeletionSpec": schema_cluster_api_api_core_v1beta2_ControlPlaneTopologyMachineDeletionSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneVariables": schema_cluster_api_api_core_v1beta2_ControlPlaneVariables(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ExternalPatchDefinition": schema_cluster_api_api_core_v1beta2_ExternalPatchDefinition(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.FailureDomain": schema_cluster_api_api_core_v1beta2_FailureDomain(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.InfrastructureClass": schema_cluster_api_api_core_v1beta2_InfrastructureClass(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.InfrastructureClassNamingSpec": schema_cluster_api_api_core_v1beta2_InfrastructureClassNamingSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.JSONPatch": schema_cluster_api_api_core_v1beta2_JSONPatch(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.JSONPatchValue": schema_cluster_api_api_core_v1beta2_JSONPatchValue(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.JSONSchemaProps": schema_cluster_api_api_core_v1beta2_JSONSchemaProps(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.Machine": schema_cluster_api_api_core_v1beta2_Machine(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineAddress": schema_cluster_api_api_core_v1beta2_MachineAddress(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeletionSpec": schema_cluster_api_api_core_v1beta2_MachineDeletionSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeletionStatus": schema_cluster_api_api_core_v1beta2_MachineDeletionStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeployment": schema_cluster_api_api_core_v1beta2_MachineDeployment(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClass": schema_cluster_api_api_core_v1beta2_MachineDeploymentClass(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassBootstrapTemplate": schema_cluster_api_api_core_v1beta2_MachineDeploymentClassBootstrapTemplate(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassHealthCheck": schema_cluster_api_api_core_v1beta2_MachineDeploymentClassHealthCheck(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassHealthCheckChecks": schema_cluster_api_api_core_v1beta2_MachineDeploymentClassHealthCheckChecks(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassHealthCheckRemediation": schema_cluster_api_api_core_v1beta2_MachineDeploymentClassHealthCheckRemediation(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassHealthCheckRemediationTriggerIf": schema_cluster_api_api_core_v1beta2_MachineDeploymentClassHealthCheckRemediationTriggerIf(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassInfrastructureTemplate": schema_cluster_api_api_core_v1beta2_MachineDeploymentClassInfrastructureTemplate(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassMachineDeletionSpec": schema_cluster_api_api_core_v1beta2_MachineDeploymentClassMachineDeletionSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassNamingSpec": schema_cluster_api_api_core_v1beta2_MachineDeploymentClassNamingSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassRolloutSpec": schema_cluster_api_api_core_v1beta2_MachineDeploymentClassRolloutSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassRolloutStrategy": schema_cluster_api_api_core_v1beta2_MachineDeploymentClassRolloutStrategy(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassRolloutStrategyRollingUpdate": schema_cluster_api_api_core_v1beta2_MachineDeploymentClassRolloutStrategyRollingUpdate(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentDeletionSpec": schema_cluster_api_api_core_v1beta2_MachineDeploymentDeletionSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentDeprecatedStatus": schema_cluster_api_api_core_v1beta2_MachineDeploymentDeprecatedStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentList": schema_cluster_api_api_core_v1beta2_MachineDeploymentList(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentRemediationSpec": schema_cluster_api_api_core_v1beta2_MachineDeploymentRemediationSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentRolloutSpec": schema_cluster_api_api_core_v1beta2_MachineDeploymentRolloutSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentRolloutStrategy": schema_cluster_api_api_core_v1beta2_MachineDeploymentRolloutStrategy(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentRolloutStrategyRollingUpdate": schema_cluster_api_api_core_v1beta2_MachineDeploymentRolloutStrategyRollingUpdate(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentSpec": schema_cluster_api_api_core_v1beta2_MachineDeploymentSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentStatus": schema_cluster_api_api_core_v1beta2_MachineDeploymentStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopology": schema_cluster_api_api_core_v1beta2_MachineDeploymentTopology(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyHealthCheck": schema_cluster_api_api_core_v1beta2_MachineDeploymentTopologyHealthCheck(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyHealthCheckChecks": schema_cluster_api_api_core_v1beta2_MachineDeploymentTopologyHealthCheckChecks(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyHealthCheckRemediation": schema_cluster_api_api_core_v1beta2_MachineDeploymentTopologyHealthCheckRemediation(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyHealthCheckRemediationTriggerIf": schema_cluster_api_api_core_v1beta2_MachineDeploymentTopologyHealthCheckRemediationTriggerIf(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyMachineDeletionSpec": schema_cluster_api_api_core_v1beta2_MachineDeploymentTopologyMachineDeletionSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyRolloutSpec": schema_cluster_api_api_core_v1beta2_MachineDeploymentTopologyRolloutSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyRolloutStrategy": schema_cluster_api_api_core_v1beta2_MachineDeploymentTopologyRolloutStrategy(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyRolloutStrategyRollingUpdate": schema_cluster_api_api_core_v1beta2_MachineDeploymentTopologyRolloutStrategyRollingUpdate(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentV1Beta1DeprecatedStatus": schema_cluster_api_api_core_v1beta2_MachineDeploymentV1Beta1DeprecatedStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentVariables": schema_cluster_api_api_core_v1beta2_MachineDeploymentVariables(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeprecatedStatus": schema_cluster_api_api_core_v1beta2_MachineDeprecatedStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDrainRule": schema_cluster_api_api_core_v1beta2_MachineDrainRule(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDrainRuleDrainConfig": schema_cluster_api_api_core_v1beta2_MachineDrainRuleDrainConfig(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDrainRuleList": schema_cluster_api_api_core_v1beta2_MachineDrainRuleList(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDrainRuleMachineSelector": schema_cluster_api_api_core_v1beta2_MachineDrainRuleMachineSelector(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDrainRulePodSelector": schema_cluster_api_api_core_v1beta2_MachineDrainRulePodSelector(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDrainRuleSpec": schema_cluster_api_api_core_v1beta2_MachineDrainRuleSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheck": schema_cluster_api_api_core_v1beta2_MachineHealthCheck(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckChecks": schema_cluster_api_api_core_v1beta2_MachineHealthCheckChecks(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckDeprecatedStatus": schema_cluster_api_api_core_v1beta2_MachineHealthCheckDeprecatedStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckList": schema_cluster_api_api_core_v1beta2_MachineHealthCheckList(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckRemediation": schema_cluster_api_api_core_v1beta2_MachineHealthCheckRemediation(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckRemediationTemplateReference": schema_cluster_api_api_core_v1beta2_MachineHealthCheckRemediationTemplateReference(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckRemediationTriggerIf": schema_cluster_api_api_core_v1beta2_MachineHealthCheckRemediationTriggerIf(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckSpec": schema_cluster_api_api_core_v1beta2_MachineHealthCheckSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckStatus": schema_cluster_api_api_core_v1beta2_MachineHealthCheckStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckV1Beta1DeprecatedStatus": schema_cluster_api_api_core_v1beta2_MachineHealthCheckV1Beta1DeprecatedStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineInitializationStatus": schema_cluster_api_api_core_v1beta2_MachineInitializationStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineList": schema_cluster_api_api_core_v1beta2_MachineList(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineNamingSpec": schema_cluster_api_api_core_v1beta2_MachineNamingSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineNodeReference": schema_cluster_api_api_core_v1beta2_MachineNodeReference(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePool": schema_cluster_api_api_core_v1beta2_MachinePool(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolClass": schema_cluster_api_api_core_v1beta2_MachinePoolClass(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolClassBootstrapTemplate": schema_cluster_api_api_core_v1beta2_MachinePoolClassBootstrapTemplate(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolClassInfrastructureTemplate": schema_cluster_api_api_core_v1beta2_MachinePoolClassInfrastructureTemplate(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolClassMachineDeletionSpec": schema_cluster_api_api_core_v1beta2_MachinePoolClassMachineDeletionSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolClassNamingSpec": schema_cluster_api_api_core_v1beta2_MachinePoolClassNamingSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolDeprecatedStatus": schema_cluster_api_api_core_v1beta2_MachinePoolDeprecatedStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolInitializationStatus": schema_cluster_api_api_core_v1beta2_MachinePoolInitializationStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolList": schema_cluster_api_api_core_v1beta2_MachinePoolList(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolSpec": schema_cluster_api_api_core_v1beta2_MachinePoolSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolStatus": schema_cluster_api_api_core_v1beta2_MachinePoolStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolTopology": schema_cluster_api_api_core_v1beta2_MachinePoolTopology(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolTopologyMachineDeletionSpec": schema_cluster_api_api_core_v1beta2_MachinePoolTopologyMachineDeletionSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolV1Beta1DeprecatedStatus": schema_cluster_api_api_core_v1beta2_MachinePoolV1Beta1DeprecatedStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolVariables": schema_cluster_api_api_core_v1beta2_MachinePoolVariables(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineReadinessGate": schema_cluster_api_api_core_v1beta2_MachineReadinessGate(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSet": schema_cluster_api_api_core_v1beta2_MachineSet(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSetDeletionSpec": schema_cluster_api_api_core_v1beta2_MachineSetDeletionSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSetDeprecatedStatus": schema_cluster_api_api_core_v1beta2_MachineSetDeprecatedStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSetList": schema_cluster_api_api_core_v1beta2_MachineSetList(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSetSpec": schema_cluster_api_api_core_v1beta2_MachineSetSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSetStatus": schema_cluster_api_api_core_v1beta2_MachineSetStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSetV1Beta1DeprecatedStatus": schema_cluster_api_api_core_v1beta2_MachineSetV1Beta1DeprecatedStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSpec": schema_cluster_api_api_core_v1beta2_MachineSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineStatus": schema_cluster_api_api_core_v1beta2_MachineStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineTemplateSpec": schema_cluster_api_api_core_v1beta2_MachineTemplateSpec(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineV1Beta1DeprecatedStatus": schema_cluster_api_api_core_v1beta2_MachineV1Beta1DeprecatedStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.NetworkRanges": schema_cluster_api_api_core_v1beta2_NetworkRanges(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ObjectMeta": schema_cluster_api_api_core_v1beta2_ObjectMeta(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.PatchDefinition": schema_cluster_api_api_core_v1beta2_PatchDefinition(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.PatchSelector": schema_cluster_api_api_core_v1beta2_PatchSelector(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.PatchSelectorMatch": schema_cluster_api_api_core_v1beta2_PatchSelectorMatch(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.PatchSelectorMatchMachineDeploymentClass": schema_cluster_api_api_core_v1beta2_PatchSelectorMatchMachineDeploymentClass(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.PatchSelectorMatchMachinePoolClass": schema_cluster_api_api_core_v1beta2_PatchSelectorMatchMachinePoolClass(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.Topology": schema_cluster_api_api_core_v1beta2_Topology(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.UnhealthyNodeCondition": schema_cluster_api_api_core_v1beta2_UnhealthyNodeCondition(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.ValidationRule": schema_cluster_api_api_core_v1beta2_ValidationRule(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.VariableSchema": schema_cluster_api_api_core_v1beta2_VariableSchema(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.VariableSchemaMetadata": schema_cluster_api_api_core_v1beta2_VariableSchemaMetadata(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.WorkersClass": schema_cluster_api_api_core_v1beta2_WorkersClass(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.WorkersStatus": schema_cluster_api_api_core_v1beta2_WorkersStatus(ref), + "sigs.k8s.io/cluster-api/api/core/v1beta2.WorkersTopology": schema_cluster_api_api_core_v1beta2_WorkersTopology(ref), + } +} + +func schema_cluster_api_api_core_v1beta2_APIEndpoint(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "APIEndpoint represents a reachable Kubernetes API endpoint.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "host": { + SchemaProps: spec.SchemaProps{ + Description: "host is the hostname on which the API server is serving.", + Type: []string{"string"}, + Format: "", + }, + }, + "port": { + SchemaProps: spec.SchemaProps{ + Description: "port is the port on which the API server is serving.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_Bootstrap(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Bootstrap encapsulates fields to configure the Machine’s bootstrapping mechanism.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "configRef": { + SchemaProps: spec.SchemaProps{ + 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.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ContractVersionedObjectReference"), + }, + }, + "dataSecretName": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ContractVersionedObjectReference"}, + } +} + +func schema_cluster_api_api_core_v1beta2_Cluster(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Cluster is the Schema for the clusters API.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "spec is the desired state of Cluster.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status is the observed state of Cluster.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterStatus"), + }, + }, + }, + Required: []string{"spec"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterAvailabilityGate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterAvailabilityGate contains the type of a Cluster condition to be used as availability gate.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditionType": { + SchemaProps: spec.SchemaProps{ + Description: "conditionType refers to a condition with matching type in the Cluster's condition list. If the conditions doesn't exist, it will be treated as unknown. Note: Both Cluster API conditions or conditions added by 3rd party controllers can be used as availability gates.", + Type: []string{"string"}, + Format: "", + }, + }, + "polarity": { + SchemaProps: spec.SchemaProps{ + Description: "polarity of the conditionType specified in this availabilityGate. Valid values are Positive, Negative and omitted. When omitted, the default behaviour will be Positive. A positive polarity means that the condition should report a true status under normal conditions. A negative polarity means that the condition should report a false status under normal conditions.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"conditionType"}, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterClass(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterClass is a template which can be used to create managed topologies. NOTE: This CRD can only be used if the ClusterTopology feature gate is enabled.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "spec is the desired state of ClusterClass.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status is the observed state of ClusterClass.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassStatus"), + }, + }, + }, + Required: []string{"spec"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterClassDeprecatedStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterClassDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "v1beta1": { + SchemaProps: spec.SchemaProps{ + Description: "v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassV1Beta1DeprecatedStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassV1Beta1DeprecatedStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterClassList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterClassList contains a list of Cluster.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "items is the list of ClusterClasses.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClass"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClass"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterClassPatch(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterClassPatch defines a patch which is applied to customize the referenced templates.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name of the patch.", + Type: []string{"string"}, + Format: "", + }, + }, + "description": { + SchemaProps: spec.SchemaProps{ + Description: "description is a human-readable description of this patch.", + Type: []string{"string"}, + Format: "", + }, + }, + "enabledIf": { + SchemaProps: spec.SchemaProps{ + Description: "enabledIf is a Go template to be used to calculate if a patch should be enabled. It can reference variables defined in .spec.variables and builtin variables. The patch will be enabled if the template evaluates to `true`, otherwise it will be disabled. If EnabledIf is not set, the patch will be enabled per default.", + Type: []string{"string"}, + Format: "", + }, + }, + "definitions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "definitions define inline patches. Note: Patches will be applied in the order of the array. Note: Exactly one of Definitions or External must be set.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.PatchDefinition"), + }, + }, + }, + }, + }, + "external": { + SchemaProps: spec.SchemaProps{ + Description: "external defines an external patch. Note: Exactly one of Definitions or External must be set.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ExternalPatchDefinition"), + }, + }, + }, + Required: []string{"name"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ExternalPatchDefinition", "sigs.k8s.io/cluster-api/api/core/v1beta2.PatchDefinition"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterClassRef(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterClassRef is the ref to the ClusterClass that should be used for the topology.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is the name of the ClusterClass that should be used for the topology. name must be a valid ClusterClass name and because of that be at most 253 characters in length and it must consist only of lower case alphanumeric characters, hyphens (-) and periods (.), and must start and end with an alphanumeric character.", + Type: []string{"string"}, + Format: "", + }, + }, + "namespace": { + SchemaProps: spec.SchemaProps{ + Description: "namespace is the namespace of the ClusterClass that should be used for the topology. If namespace is empty or not set, it is defaulted to the namespace of the Cluster object. namespace must be a valid namespace name and because of that be at most 63 characters in length and it must consist only of lower case alphanumeric characters or hyphens (-), and must start and end with an alphanumeric character.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name"}, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterClassSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterClassSpec describes the desired state of the ClusterClass.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "availabilityGates": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "conditionType", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "availabilityGates specifies additional conditions to include when evaluating Cluster Available condition.\n\nNOTE: If a Cluster is using this ClusterClass, and this Cluster defines a custom list of availabilityGates, such list overrides availabilityGates defined in this field.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterAvailabilityGate"), + }, + }, + }, + }, + }, + "infrastructure": { + SchemaProps: spec.SchemaProps{ + Description: "infrastructure is a reference to a local struct that holds the details for provisioning the infrastructure cluster for the Cluster.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.InfrastructureClass"), + }, + }, + "controlPlane": { + SchemaProps: spec.SchemaProps{ + Description: "controlPlane is a reference to a local struct that holds the details for provisioning the Control Plane for the Cluster.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClass"), + }, + }, + "workers": { + SchemaProps: spec.SchemaProps{ + 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.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.WorkersClass"), + }, + }, + "variables": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "variables defines the variables which can be configured in the Cluster topology and are then used in patches.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassVariable"), + }, + }, + }, + }, + }, + "patches": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "patches defines the patches which are applied to customize referenced templates of a ClusterClass. Note: Patches will be applied in the order of the array.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassPatch"), + }, + }, + }, + }, + }, + }, + Required: []string{"infrastructure", "controlPlane"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterAvailabilityGate", "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassPatch", "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassVariable", "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClass", "sigs.k8s.io/cluster-api/api/core/v1beta2.InfrastructureClass", "sigs.k8s.io/cluster-api/api/core/v1beta2.WorkersClass"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterClassStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterClassStatus defines the observed state of the ClusterClass.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions represents the observations of a ClusterClass's current state. Known condition types are VariablesReady, RefVersionsUpToDate, Paused.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + "variables": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "variables is a list of ClusterClassStatusVariable that are defined for the ClusterClass.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassStatusVariable"), + }, + }, + }, + }, + }, + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "observedGeneration is the latest generation observed by the controller.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "deprecated": { + SchemaProps: spec.SchemaProps{ + Description: "deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassDeprecatedStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassDeprecatedStatus", "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassStatusVariable"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterClassStatusVariable(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterClassStatusVariable defines a variable which appears in the status of a ClusterClass.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is the name of the variable.", + Type: []string{"string"}, + Format: "", + }, + }, + "definitionsConflict": { + SchemaProps: spec.SchemaProps{ + Description: "definitionsConflict specifies whether or not there are conflicting definitions for a single variable name.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "definitions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "definitions is a list of definitions for a variable.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassStatusVariableDefinition"), + }, + }, + }, + }, + }, + }, + Required: []string{"name", "definitions"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassStatusVariableDefinition"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterClassStatusVariableDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterClassStatusVariableDefinition defines a variable which appears in the status of a ClusterClass.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "from": { + SchemaProps: spec.SchemaProps{ + Description: "from specifies the origin of the variable definition. This will be `inline` for variables defined in the ClusterClass or the name of a patch defined in the ClusterClass for variables discovered from a DiscoverVariables runtime extensions.", + Type: []string{"string"}, + Format: "", + }, + }, + "required": { + SchemaProps: spec.SchemaProps{ + Description: "required specifies if the variable is required. Note: this applies to the variable as a whole and thus the top-level object defined in the schema. If nested fields are required, this will be specified inside the schema.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "deprecatedV1Beta1Metadata": { + SchemaProps: spec.SchemaProps{ + Description: "deprecatedV1Beta1Metadata is the metadata of a variable. It can be used to add additional data for higher level tools to a ClusterClassVariable.\n\nDeprecated: This field is deprecated and will be removed when support for v1beta1 will be dropped. Please use XMetadata in JSONSchemaProps instead.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassVariableMetadata"), + }, + }, + "schema": { + SchemaProps: spec.SchemaProps{ + Description: "schema defines the schema of the variable.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.VariableSchema"), + }, + }, + }, + Required: []string{"from", "required", "schema"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassVariableMetadata", "sigs.k8s.io/cluster-api/api/core/v1beta2.VariableSchema"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterClassTemplateReference(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterClassTemplateReference is a reference to a ClusterClass template.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "kind of the template. kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character.", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name of the template. name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "apiVersion of the template. apiVersion must be fully qualified domain name followed by / and a version.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"kind", "name", "apiVersion"}, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterClassV1Beta1DeprecatedStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterClassV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "conditions defines current observed state of the ClusterClass.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.Condition"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.Condition"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterClassVariable(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterClassVariable defines a variable which can be configured in the Cluster topology and used in patches.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name of the variable.", + Type: []string{"string"}, + Format: "", + }, + }, + "required": { + SchemaProps: spec.SchemaProps{ + Description: "required specifies if the variable is required. Note: this applies to the variable as a whole and thus the top-level object defined in the schema. If nested fields are required, this will be specified inside the schema.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "deprecatedV1Beta1Metadata": { + SchemaProps: spec.SchemaProps{ + Description: "deprecatedV1Beta1Metadata is the metadata of a variable. It can be used to add additional data for higher level tools to a ClusterClassVariable.\n\nDeprecated: This field is deprecated and will be removed when support for v1beta1 will be dropped. Please use XMetadata in JSONSchemaProps instead.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassVariableMetadata"), + }, + }, + "schema": { + SchemaProps: spec.SchemaProps{ + Description: "schema defines the schema of the variable.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.VariableSchema"), + }, + }, + }, + Required: []string{"name", "required", "schema"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassVariableMetadata", "sigs.k8s.io/cluster-api/api/core/v1beta2.VariableSchema"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterClassVariableMetadata(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterClassVariableMetadata is the metadata of a variable. It can be used to add additional data for higher level tools to a ClusterClassVariable.\n\nDeprecated: This struct is deprecated and is going to be removed in the next apiVersion.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "labels": { + SchemaProps: spec.SchemaProps{ + Description: "labels is a map of string keys and values that can be used to organize and categorize (scope and select) variables.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "annotations": { + SchemaProps: spec.SchemaProps{ + Description: "annotations is an unstructured key value map that can be used to store and retrieve arbitrary metadata. They are not queryable.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterControlPlaneStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterControlPlaneStatus groups all the observations about control plane current state.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "desiredReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "desiredReplicas is the total number of desired control plane machines in this cluster.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "replicas is the total number of control plane machines in this cluster. NOTE: replicas also includes machines still being provisioned or being deleted.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "upToDateReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "upToDateReplicas is the number of up-to-date control plane machines in this cluster. A machine is considered up-to-date when Machine's UpToDate condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "readyReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "readyReplicas is the total number of ready control plane machines in this cluster. A machine is considered ready when Machine's Ready condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "availableReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "availableReplicas is the total number of available control plane machines in this cluster. A machine is considered available when Machine's Available condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterDeprecatedStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "v1beta1": { + SchemaProps: spec.SchemaProps{ + Description: "v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterV1Beta1DeprecatedStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterV1Beta1DeprecatedStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterInitializationStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterInitializationStatus provides observations of the Cluster initialization process. NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial Cluster provisioning.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "infrastructureProvisioned": { + SchemaProps: spec.SchemaProps{ + Description: "infrastructureProvisioned is true when the infrastructure provider reports that Cluster's infrastructure is fully provisioned. NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. The value of this field is never updated after provisioning is completed.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "controlPlaneInitialized": { + SchemaProps: spec.SchemaProps{ + Description: "controlPlaneInitialized denotes when the control plane is functional enough to accept requests. This information is usually used as a signal for starting all the provisioning operations that depends on a functional API server, but do not require a full HA control plane to exists, like e.g. join worker Machines, install core addons like CNI, CPI, CSI etc. NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. The value of this field is never updated after initialization is completed.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterList contains a list of Cluster.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "items is the list of Clusters.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.Cluster"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta2.Cluster"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterNetwork(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterNetwork specifies the different networking parameters for a cluster.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "apiServerPort": { + SchemaProps: spec.SchemaProps{ + Description: "apiServerPort specifies the port the API Server should bind to. Defaults to 6443.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "services": { + SchemaProps: spec.SchemaProps{ + Description: "services is the network ranges from which service VIPs are allocated.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.NetworkRanges"), + }, + }, + "pods": { + SchemaProps: spec.SchemaProps{ + Description: "pods is the network ranges from which Pod networks are allocated.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.NetworkRanges"), + }, + }, + "serviceDomain": { + SchemaProps: spec.SchemaProps{ + Description: "serviceDomain is the domain name for services.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.NetworkRanges"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterSpec defines the desired state of Cluster.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "paused": { + SchemaProps: spec.SchemaProps{ + Description: "paused can be used to prevent controllers from processing the Cluster and all its associated objects.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "clusterNetwork": { + SchemaProps: spec.SchemaProps{ + Description: "clusterNetwork represents the cluster network configuration.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterNetwork"), + }, + }, + "controlPlaneEndpoint": { + SchemaProps: spec.SchemaProps{ + Description: "controlPlaneEndpoint represents the endpoint used to communicate with the control plane.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.APIEndpoint"), + }, + }, + "controlPlaneRef": { + SchemaProps: spec.SchemaProps{ + Description: "controlPlaneRef is an optional reference to a provider-specific resource that holds the details for provisioning the Control Plane for a Cluster.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ContractVersionedObjectReference"), + }, + }, + "infrastructureRef": { + SchemaProps: spec.SchemaProps{ + Description: "infrastructureRef is a reference to a provider-specific resource that holds the details for provisioning infrastructure for a cluster in said provider.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ContractVersionedObjectReference"), + }, + }, + "topology": { + SchemaProps: spec.SchemaProps{ + Description: "topology 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.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.Topology"), + }, + }, + "availabilityGates": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "conditionType", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "availabilityGates specifies additional conditions to include when evaluating Cluster Available condition.\n\nIf this field is not defined and the Cluster implements a managed topology, availabilityGates from the corresponding ClusterClass will be used, if any.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterAvailabilityGate"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.APIEndpoint", "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterAvailabilityGate", "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterNetwork", "sigs.k8s.io/cluster-api/api/core/v1beta2.ContractVersionedObjectReference", "sigs.k8s.io/cluster-api/api/core/v1beta2.Topology"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterStatus defines the observed state of Cluster.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions represents the observations of a Cluster's current state. Known condition types are Available, InfrastructureReady, ControlPlaneInitialized, ControlPlaneAvailable, WorkersAvailable, MachinesReady MachinesUpToDate, RemoteConnectionProbe, ScalingUp, ScalingDown, Remediating, Deleting, Paused. Additionally, a TopologyReconciled condition will be added in case the Cluster is referencing a ClusterClass / defining a managed Topology.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + "initialization": { + SchemaProps: spec.SchemaProps{ + Description: "initialization provides observations of the Cluster initialization process. NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial Cluster provisioning.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterInitializationStatus"), + }, + }, + "controlPlane": { + SchemaProps: spec.SchemaProps{ + Description: "controlPlane groups all the observations about Cluster's ControlPlane current state.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterControlPlaneStatus"), + }, + }, + "workers": { + SchemaProps: spec.SchemaProps{ + Description: "workers groups all the observations about Cluster's Workers current state.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.WorkersStatus"), + }, + }, + "failureDomains": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "failureDomains is a slice of failure domain objects synced from the infrastructure provider.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.FailureDomain"), + }, + }, + }, + }, + }, + "phase": { + SchemaProps: spec.SchemaProps{ + Description: "phase represents the current phase of cluster actuation.", + Type: []string{"string"}, + Format: "", + }, + }, + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "observedGeneration is the latest generation observed by the controller.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "deprecated": { + SchemaProps: spec.SchemaProps{ + Description: "deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterDeprecatedStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterControlPlaneStatus", "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterDeprecatedStatus", "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterInitializationStatus", "sigs.k8s.io/cluster-api/api/core/v1beta2.FailureDomain", "sigs.k8s.io/cluster-api/api/core/v1beta2.WorkersStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterV1Beta1DeprecatedStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "conditions defines current service state of the cluster.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.Condition"), + }, + }, + }, + }, + }, + "failureReason": { + SchemaProps: spec.SchemaProps{ + Description: "failureReason indicates that there is a fatal problem reconciling the state, and will be set to a token value suitable for programmatic interpretation.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"string"}, + Format: "", + }, + }, + "failureMessage": { + SchemaProps: spec.SchemaProps{ + Description: "failureMessage indicates that there is a fatal problem reconciling the state, and will be set to a descriptive error message.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.Condition"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ClusterVariable(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ClusterVariable can be used to customize the Cluster through patches. Each ClusterVariable is associated with a Variable definition in the ClusterClass `status` variables.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name of the variable.", + Type: []string{"string"}, + Format: "", + }, + }, + "value": { + SchemaProps: spec.SchemaProps{ + Description: "value of the variable. Note: the value will be validated against the schema of the corresponding ClusterClassVariable from the ClusterClass. Note: We have to use apiextensionsv1.JSON instead of a custom JSON type, because controller-tools has a hard-coded schema for apiextensionsv1.JSON which cannot be produced by another type via controller-tools, i.e. it is not possible to have no type field. Ref: https://github.com/kubernetes-sigs/controller-tools/blob/d0e03a142d0ecdd5491593e941ee1d6b5d91dba6/pkg/crd/known_types.go#L106-L111", + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON"), + }, + }, + }, + Required: []string{"name", "value"}, + }, + }, + Dependencies: []string{ + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON"}, + } +} + +func schema_cluster_api_api_core_v1beta2_Condition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Condition defines an observation of a Cluster API resource operational state.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + 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.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status of the condition, one of True, False, Unknown.", + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + "severity": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "lastTransitionTime": { + SchemaProps: spec.SchemaProps{ + Description: "lastTransitionTime is the 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.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "reason": { + SchemaProps: spec.SchemaProps{ + Description: "reason is 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 be empty.", + Type: []string{"string"}, + Format: "", + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "message is a human readable message indicating details about the transition. This field may be empty.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"type", "status", "lastTransitionTime"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ContractVersionedObjectReference(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ContractVersionedObjectReference is a reference to a resource for which the version is inferred from contract labels.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "kind of the resource being referenced. kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character.", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name of the resource being referenced. name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.", + Type: []string{"string"}, + Format: "", + }, + }, + "apiGroup": { + SchemaProps: spec.SchemaProps{ + Description: "apiGroup is the group of the resource being referenced. apiGroup must be fully qualified domain name. The corresponding version for this reference will be looked up from the contract labels of the corresponding CRD of the resource being referenced.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"kind", "name", "apiGroup"}, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_ControlPlaneClass(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneClass defines the class for the control plane.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the metadata applied to the ControlPlane and the Machines of the ControlPlane if the ControlPlaneTemplate referenced is machine based. If not, it is applied only to the ControlPlane. At runtime this metadata is merged with the corresponding metadata from the topology.\n\nThis field is supported if and only if the control plane provider template referenced is Machine based.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ObjectMeta"), + }, + }, + "templateRef": { + SchemaProps: spec.SchemaProps{ + Description: "templateRef contains the reference to a provider-specific control plane template.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassTemplateReference"), + }, + }, + "machineInfrastructure": { + SchemaProps: spec.SchemaProps{ + Description: "machineInfrastructure defines the metadata and infrastructure information for control plane machines.\n\nThis field is supported if and only if the control plane provider template referenced above is Machine based and supports setting replicas.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassMachineInfrastructureTemplate"), + }, + }, + "healthCheck": { + SchemaProps: spec.SchemaProps{ + Description: "healthCheck defines a MachineHealthCheck for this ControlPlaneClass. This field is supported if and only if the ControlPlane provider template referenced above is Machine based and supports setting replicas.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassHealthCheck"), + }, + }, + "naming": { + SchemaProps: spec.SchemaProps{ + Description: "naming allows changing the naming pattern used when creating the control plane provider object.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassNamingSpec"), + }, + }, + "deletion": { + SchemaProps: spec.SchemaProps{ + Description: "deletion contains configuration options for Machine deletion.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassMachineDeletionSpec"), + }, + }, + "readinessGates": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "conditionType", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "readinessGates specifies additional conditions to include when evaluating Machine Ready condition.\n\nThis field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine.\n\nNOTE: If a Cluster defines a custom list of readinessGates for the control plane, such list overrides readinessGates defined in this field. NOTE: Specific control plane provider implementations might automatically extend the list of readinessGates; e.g. the kubeadm control provider adds ReadinessGates for the APIServerPodHealthy, SchedulerPodHealthy conditions, etc.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineReadinessGate"), + }, + }, + }, + }, + }, + }, + Required: []string{"templateRef"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassTemplateReference", "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassHealthCheck", "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassMachineDeletionSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassMachineInfrastructureTemplate", "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassNamingSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineReadinessGate", "sigs.k8s.io/cluster-api/api/core/v1beta2.ObjectMeta"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ControlPlaneClassHealthCheck(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneClassHealthCheck defines a MachineHealthCheck for control plane machines.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "checks": { + SchemaProps: spec.SchemaProps{ + Description: "checks are the checks that are used to evaluate if a Machine is healthy.\n\nIndependent of this configuration the MachineHealthCheck controller will always flag Machines with `cluster.x-k8s.io/remediate-machine` annotation and Machines with deleted Nodes as unhealthy.\n\nFurthermore, if checks.nodeStartupTimeoutSeconds is not set it is defaulted to 10 minutes and evaluated accordingly.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassHealthCheckChecks"), + }, + }, + "remediation": { + SchemaProps: spec.SchemaProps{ + Description: "remediation configures if and how remediations are triggered if a Machine is unhealthy.\n\nIf remediation or remediation.triggerIf is not set, remediation will always be triggered for unhealthy Machines.\n\nIf remediation or remediation.templateRef is not set, the OwnerRemediated condition will be set on unhealthy Machines to trigger remediation via the owner of the Machines, for example a MachineSet or a KubeadmControlPlane.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassHealthCheckRemediation"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassHealthCheckChecks", "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassHealthCheckRemediation"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ControlPlaneClassHealthCheckChecks(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneClassHealthCheckChecks are the checks that are used to evaluate if a control plane Machine is healthy.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nodeStartupTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeStartupTimeoutSeconds allows to set the maximum time for MachineHealthCheck to consider a Machine unhealthy if a corresponding Node isn't associated through a `Spec.ProviderID` field.\n\nThe duration set in this field is compared to the greatest of: - Cluster's infrastructure ready condition timestamp (if and when available) - Control Plane's initialized condition timestamp (if and when available) - Machine's infrastructure ready condition timestamp (if and when available) - Machine's metadata creation timestamp\n\nDefaults to 10 minutes. If you wish to disable this feature, set the value explicitly to 0.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "unhealthyNodeConditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "unhealthyNodeConditions contains a list of 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.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.UnhealthyNodeCondition"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.UnhealthyNodeCondition"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ControlPlaneClassHealthCheckRemediation(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneClassHealthCheckRemediation configures if and how remediations are triggered if a control plane Machine is unhealthy.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "triggerIf": { + SchemaProps: spec.SchemaProps{ + Description: "triggerIf configures if remediations are triggered. If this field is not set, remediations are always triggered.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassHealthCheckRemediationTriggerIf"), + }, + }, + "templateRef": { + SchemaProps: spec.SchemaProps{ + Description: "templateRef is a reference to a remediation template provided by an infrastructure provider.\n\nThis 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.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckRemediationTemplateReference"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneClassHealthCheckRemediationTriggerIf", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckRemediationTemplateReference"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ControlPlaneClassHealthCheckRemediationTriggerIf(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneClassHealthCheckRemediationTriggerIf configures if remediations are triggered.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "unhealthyLessThanOrEqualTo": { + SchemaProps: spec.SchemaProps{ + Description: "unhealthyLessThanOrEqualTo specifies that remediations are only triggered if the number of unhealthy Machines is less than or equal to the configured value. unhealthyInRange takes precedence if set.", + Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), + }, + }, + "unhealthyInRange": { + SchemaProps: spec.SchemaProps{ + Description: "unhealthyInRange specifies that remediations are only triggered if the number of unhealthy Machines is in the configured range. Takes precedence over unhealthyLessThanOrEqualTo. 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", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ControlPlaneClassMachineDeletionSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneClassMachineDeletionSpec contains configuration options for Machine deletion.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nodeDrainTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeDrainTimeoutSeconds 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: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` NOTE: This value can be overridden while defining a Cluster.Topology.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "nodeVolumeDetachTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. NOTE: This value can be overridden while defining a Cluster.Topology.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "nodeDeletionTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely. Defaults to 10 seconds. NOTE: This value can be overridden while defining a Cluster.Topology.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_ControlPlaneClassMachineInfrastructureTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneClassMachineInfrastructureTemplate defines the template for a MachineInfrastructure of a ControlPlane.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "templateRef": { + SchemaProps: spec.SchemaProps{ + Description: "templateRef is a required reference to the template for a MachineInfrastructure of a ControlPlane.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassTemplateReference"), + }, + }, + }, + Required: []string{"templateRef"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassTemplateReference"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ControlPlaneClassNamingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneClassNamingSpec defines the naming strategy for control plane objects.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "template": { + SchemaProps: spec.SchemaProps{ + Description: "template defines the template to use for generating the name of the ControlPlane object. If not defined, it will fallback to `{{ .cluster.name }}-{{ .random }}`. If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will get concatenated with a random suffix of length 5. The templating mechanism provides the following arguments: * `.cluster.name`: The name of the cluster object. * `.random`: A random alphanumeric string, without vowels, of length 5.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_ControlPlaneTopology(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneTopology specifies the parameters for the control plane nodes in the cluster.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the metadata applied to the ControlPlane and the Machines of the ControlPlane if the ControlPlaneTemplate referenced by the ClusterClass is machine based. If not, it is applied only to the ControlPlane. At runtime this metadata is merged with the corresponding metadata from the ClusterClass.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ObjectMeta"), + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "replicas is the number of control plane nodes. If the value is not set, 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.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "healthCheck": { + SchemaProps: spec.SchemaProps{ + Description: "healthCheck allows to enable, disable and override control plane health check configuration from the ClusterClass for this control plane.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopologyHealthCheck"), + }, + }, + "deletion": { + SchemaProps: spec.SchemaProps{ + Description: "deletion contains configuration options for Machine deletion.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopologyMachineDeletionSpec"), + }, + }, + "readinessGates": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "conditionType", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "readinessGates specifies additional conditions to include when evaluating Machine Ready condition.\n\nThis field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine.\n\nIf this field is not defined, readinessGates from the corresponding ControlPlaneClass will be used, if any.\n\nNOTE: Specific control plane provider implementations might automatically extend the list of readinessGates; e.g. the kubeadm control provider adds ReadinessGates for the APIServerPodHealthy, SchedulerPodHealthy conditions, etc.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineReadinessGate"), + }, + }, + }, + }, + }, + "variables": { + SchemaProps: spec.SchemaProps{ + Description: "variables can be used to customize the ControlPlane through patches.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneVariables"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopologyHealthCheck", "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopologyMachineDeletionSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneVariables", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineReadinessGate", "sigs.k8s.io/cluster-api/api/core/v1beta2.ObjectMeta"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ControlPlaneTopologyHealthCheck(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneTopologyHealthCheck defines a MachineHealthCheck for control plane machines.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "enabled": { + SchemaProps: spec.SchemaProps{ + Description: "enabled controls if a MachineHealthCheck should be created for the target machines.\n\nIf false: No MachineHealthCheck will be created.\n\nIf not set(default): A MachineHealthCheck will be created if it is defined here or\n in the associated ClusterClass. If no MachineHealthCheck is defined then none will be created.\n\nIf true: A MachineHealthCheck is guaranteed to be created. Cluster validation will block if `enable` is true and no MachineHealthCheck definition is available.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "checks": { + SchemaProps: spec.SchemaProps{ + Description: "checks are the checks that are used to evaluate if a Machine is healthy.\n\nIf one of checks and remediation fields are set, the system assumes that an healthCheck override is defined, and as a consequence the checks and remediation fields from Cluster will be used instead of the corresponding fields in ClusterClass.\n\nIndependent of this configuration the MachineHealthCheck controller will always flag Machines with `cluster.x-k8s.io/remediate-machine` annotation and Machines with deleted Nodes as unhealthy.\n\nFurthermore, if checks.nodeStartupTimeoutSeconds is not set it is defaulted to 10 minutes and evaluated accordingly.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopologyHealthCheckChecks"), + }, + }, + "remediation": { + SchemaProps: spec.SchemaProps{ + Description: "remediation configures if and how remediations are triggered if a Machine is unhealthy.\n\nIf one of checks and remediation fields are set, the system assumes that an healthCheck override is defined, and as a consequence the checks and remediation fields from cluster will be used instead of the corresponding fields in ClusterClass.\n\nIf an health check override is defined and remediation or remediation.triggerIf is not set, remediation will always be triggered for unhealthy Machines.\n\nIf an health check override is defined and remediation or remediation.templateRef is not set, the OwnerRemediated condition will be set on unhealthy Machines to trigger remediation via the owner of the Machines, for example a MachineSet or a KubeadmControlPlane.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopologyHealthCheckRemediation"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopologyHealthCheckChecks", "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopologyHealthCheckRemediation"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ControlPlaneTopologyHealthCheckChecks(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneTopologyHealthCheckChecks are the checks that are used to evaluate if a control plane Machine is healthy.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nodeStartupTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeStartupTimeoutSeconds allows to set the maximum time for MachineHealthCheck to consider a Machine unhealthy if a corresponding Node isn't associated through a `Spec.ProviderID` field.\n\nThe duration set in this field is compared to the greatest of: - Cluster's infrastructure ready condition timestamp (if and when available) - Control Plane's initialized condition timestamp (if and when available) - Machine's infrastructure ready condition timestamp (if and when available) - Machine's metadata creation timestamp\n\nDefaults to 10 minutes. If you wish to disable this feature, set the value explicitly to 0.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "unhealthyNodeConditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "unhealthyNodeConditions contains a list of 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.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.UnhealthyNodeCondition"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.UnhealthyNodeCondition"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ControlPlaneTopologyHealthCheckRemediation(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneTopologyHealthCheckRemediation configures if and how remediations are triggered if a control plane Machine is unhealthy.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "triggerIf": { + SchemaProps: spec.SchemaProps{ + Description: "triggerIf configures if remediations are triggered. If this field is not set, remediations are always triggered.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopologyHealthCheckRemediationTriggerIf"), + }, + }, + "templateRef": { + SchemaProps: spec.SchemaProps{ + Description: "templateRef is a reference to a remediation template provided by an infrastructure provider.\n\nThis 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.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckRemediationTemplateReference"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopologyHealthCheckRemediationTriggerIf", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckRemediationTemplateReference"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ControlPlaneTopologyHealthCheckRemediationTriggerIf(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneTopologyHealthCheckRemediationTriggerIf configures if remediations are triggered.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "unhealthyLessThanOrEqualTo": { + SchemaProps: spec.SchemaProps{ + Description: "unhealthyLessThanOrEqualTo specifies that remediations are only triggered if the number of unhealthy Machines is less than or equal to the configured value. unhealthyInRange takes precedence if set.", + Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), + }, + }, + "unhealthyInRange": { + SchemaProps: spec.SchemaProps{ + Description: "unhealthyInRange specifies that remediations are only triggered if the number of unhealthy Machines is in the configured range. Takes precedence over unhealthyLessThanOrEqualTo. 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", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ControlPlaneTopologyMachineDeletionSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneTopologyMachineDeletionSpec contains configuration options for Machine deletion.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nodeDrainTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeDrainTimeoutSeconds 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: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout`", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "nodeVolumeDetachTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "nodeDeletionTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely. Defaults to 10 seconds.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_ControlPlaneVariables(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ControlPlaneVariables can be used to provide variables for the ControlPlane.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "overrides": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "overrides can be used to override Cluster level variables.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterVariable"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterVariable"}, + } +} + +func schema_cluster_api_api_core_v1beta2_ExternalPatchDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ExternalPatchDefinition defines an external patch. Note: At least one of GeneratePatchesExtension or ValidateTopologyExtension must be set.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "generatePatchesExtension": { + SchemaProps: spec.SchemaProps{ + Description: "generatePatchesExtension references an extension which is called to generate patches.", + Type: []string{"string"}, + Format: "", + }, + }, + "validateTopologyExtension": { + SchemaProps: spec.SchemaProps{ + Description: "validateTopologyExtension references an extension which is called to validate the topology.", + Type: []string{"string"}, + Format: "", + }, + }, + "discoverVariablesExtension": { + SchemaProps: spec.SchemaProps{ + Description: "discoverVariablesExtension references an extension which is called to discover variables.", + Type: []string{"string"}, + Format: "", + }, + }, + "settings": { + SchemaProps: spec.SchemaProps{ + Description: "settings defines key value pairs to be passed to the extensions. Values defined here take precedence over the values defined in the corresponding ExtensionConfig.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_FailureDomain(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "FailureDomain is the Schema for Cluster API failure domains. It allows controllers to understand how many failure domains a cluster can optionally span across.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is the name of the failure domain.", + Type: []string{"string"}, + Format: "", + }, + }, + "controlPlane": { + SchemaProps: spec.SchemaProps{ + Description: "controlPlane determines if this failure domain is suitable for use by control plane machines.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "attributes": { + SchemaProps: spec.SchemaProps{ + Description: "attributes is a free form map of attributes an infrastructure provider might use or require.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"name"}, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_InfrastructureClass(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "InfrastructureClass defines the class for the infrastructure cluster.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "templateRef": { + SchemaProps: spec.SchemaProps{ + Description: "templateRef contains the reference to a provider-specific infrastructure cluster template.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassTemplateReference"), + }, + }, + "naming": { + SchemaProps: spec.SchemaProps{ + Description: "naming allows changing the naming pattern used when creating the infrastructure cluster object.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.InfrastructureClassNamingSpec"), + }, + }, + }, + Required: []string{"templateRef"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassTemplateReference", "sigs.k8s.io/cluster-api/api/core/v1beta2.InfrastructureClassNamingSpec"}, + } +} + +func schema_cluster_api_api_core_v1beta2_InfrastructureClassNamingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "InfrastructureClassNamingSpec defines the naming strategy for infrastructure objects.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "template": { + SchemaProps: spec.SchemaProps{ + Description: "template defines the template to use for generating the name of the Infrastructure object. If not defined, it will fallback to `{{ .cluster.name }}-{{ .random }}`. If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will get concatenated with a random suffix of length 5. The templating mechanism provides the following arguments: * `.cluster.name`: The name of the cluster object. * `.random`: A random alphanumeric string, without vowels, of length 5.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_JSONPatch(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "JSONPatch defines a JSON patch.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "op": { + SchemaProps: spec.SchemaProps{ + Description: "op defines the operation of the patch. Note: Only `add`, `replace` and `remove` are supported.", + Type: []string{"string"}, + Format: "", + }, + }, + "path": { + SchemaProps: spec.SchemaProps{ + Description: "path defines the path of the patch. Note: Only the spec of a template can be patched, thus the path has to start with /spec/. Note: For now the only allowed array modifications are `append` and `prepend`, i.e.: * for op: `add`: only index 0 (prepend) and - (append) are allowed * for op: `replace` or `remove`: no indexes are allowed", + Type: []string{"string"}, + Format: "", + }, + }, + "value": { + SchemaProps: spec.SchemaProps{ + Description: "value defines the value of the patch. Note: Either Value or ValueFrom is required for add and replace operations. Only one of them is allowed to be set at the same time. Note: We have to use apiextensionsv1.JSON instead of our JSON type, because controller-tools has a hard-coded schema for apiextensionsv1.JSON which cannot be produced by another type (unset type field). Ref: https://github.com/kubernetes-sigs/controller-tools/blob/d0e03a142d0ecdd5491593e941ee1d6b5d91dba6/pkg/crd/known_types.go#L106-L111", + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON"), + }, + }, + "valueFrom": { + SchemaProps: spec.SchemaProps{ + Description: "valueFrom defines the value of the patch. Note: Either Value or ValueFrom is required for add and replace operations. Only one of them is allowed to be set at the same time.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.JSONPatchValue"), + }, + }, + }, + Required: []string{"op", "path"}, + }, + }, + Dependencies: []string{ + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON", "sigs.k8s.io/cluster-api/api/core/v1beta2.JSONPatchValue"}, + } +} + +func schema_cluster_api_api_core_v1beta2_JSONPatchValue(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "JSONPatchValue defines the value of a patch. Note: Only one of the fields is allowed to be set at the same time.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "variable": { + SchemaProps: spec.SchemaProps{ + Description: "variable is the variable to be used as value. Variable can be one of the variables defined in .spec.variables or a builtin variable.", + Type: []string{"string"}, + Format: "", + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "template is the Go template to be used to calculate the value. A template can reference variables defined in .spec.variables and builtin variables. Note: The template must evaluate to a valid YAML or JSON value.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_JSONSchemaProps(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/). This struct has been initially copied from apiextensionsv1.JSONSchemaProps, but all fields which are not supported in CAPI have been removed.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "description": { + SchemaProps: spec.SchemaProps{ + Description: "description is a human-readable description of this variable.", + Type: []string{"string"}, + Format: "", + }, + }, + "example": { + SchemaProps: spec.SchemaProps{ + Description: "example is an example for this variable.", + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON"), + }, + }, + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type is the type of the variable. Valid values are: object, array, string, integer, number or boolean.", + Type: []string{"string"}, + Format: "", + }, + }, + "properties": { + SchemaProps: spec.SchemaProps{ + Description: "properties specifies fields of an object. NOTE: Can only be set if type is object. NOTE: Properties is mutually exclusive with AdditionalProperties. NOTE: This field uses PreserveUnknownFields and Schemaless, because recursive validation is not possible.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.JSONSchemaProps"), + }, + }, + }, + }, + }, + "additionalProperties": { + SchemaProps: spec.SchemaProps{ + Description: "additionalProperties specifies the schema of values in a map (keys are always strings). NOTE: Can only be set if type is object. NOTE: AdditionalProperties is mutually exclusive with Properties. NOTE: This field uses PreserveUnknownFields and Schemaless, because recursive validation is not possible.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.JSONSchemaProps"), + }, + }, + "maxProperties": { + SchemaProps: spec.SchemaProps{ + Description: "maxProperties is the maximum amount of entries in a map or properties in an object. NOTE: Can only be set if type is object.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "minProperties": { + SchemaProps: spec.SchemaProps{ + Description: "minProperties is the minimum amount of entries in a map or properties in an object. NOTE: Can only be set if type is object.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "required": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "required specifies which fields of an object are required. NOTE: Can only be set if type is object.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "items specifies fields of an array. NOTE: Can only be set if type is array. NOTE: This field uses PreserveUnknownFields and Schemaless, because recursive validation is not possible.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.JSONSchemaProps"), + }, + }, + "maxItems": { + SchemaProps: spec.SchemaProps{ + Description: "maxItems is the max length of an array variable. NOTE: Can only be set if type is array.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "minItems": { + SchemaProps: spec.SchemaProps{ + Description: "minItems is the min length of an array variable. NOTE: Can only be set if type is array.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "uniqueItems": { + SchemaProps: spec.SchemaProps{ + Description: "uniqueItems specifies if items in an array must be unique. NOTE: Can only be set if type is array.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "format": { + SchemaProps: spec.SchemaProps{ + Description: "format is an OpenAPI v3 format string. Unknown formats are ignored. For a list of supported formats please see: (of the k8s.io/apiextensions-apiserver version we're currently using) https://github.com/kubernetes/apiextensions-apiserver/blob/master/pkg/apiserver/validation/formats.go NOTE: Can only be set if type is string.", + Type: []string{"string"}, + Format: "", + }, + }, + "maxLength": { + SchemaProps: spec.SchemaProps{ + Description: "maxLength is the max length of a string variable. NOTE: Can only be set if type is string.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "minLength": { + SchemaProps: spec.SchemaProps{ + Description: "minLength is the min length of a string variable. NOTE: Can only be set if type is string.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "pattern": { + SchemaProps: spec.SchemaProps{ + Description: "pattern is the regex which a string variable must match. NOTE: Can only be set if type is string.", + Type: []string{"string"}, + Format: "", + }, + }, + "maximum": { + SchemaProps: spec.SchemaProps{ + Description: "maximum is the maximum of an integer or number variable. If ExclusiveMaximum is false, the variable is valid if it is lower than, or equal to, the value of Maximum. If ExclusiveMaximum is true, the variable is valid if it is strictly lower than the value of Maximum. NOTE: Can only be set if type is integer or number.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "exclusiveMaximum": { + SchemaProps: spec.SchemaProps{ + Description: "exclusiveMaximum specifies if the Maximum is exclusive. NOTE: Can only be set if type is integer or number.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "minimum": { + SchemaProps: spec.SchemaProps{ + Description: "minimum is the minimum of an integer or number variable. If ExclusiveMinimum is false, the variable is valid if it is greater than, or equal to, the value of Minimum. If ExclusiveMinimum is true, the variable is valid if it is strictly greater than the value of Minimum. NOTE: Can only be set if type is integer or number.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "exclusiveMinimum": { + SchemaProps: spec.SchemaProps{ + Description: "exclusiveMinimum specifies if the Minimum is exclusive. NOTE: Can only be set if type is integer or number.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "x-kubernetes-preserve-unknown-fields": { + SchemaProps: spec.SchemaProps{ + Description: "x-kubernetes-preserve-unknown-fields allows setting fields in a variable object which are not defined in the variable schema. This affects fields recursively, except if nested properties or additionalProperties are specified in the schema.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "enum": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "enum is the list of valid values of the variable. NOTE: Can be set for all types.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON"), + }, + }, + }, + }, + }, + "default": { + SchemaProps: spec.SchemaProps{ + Description: "default is the default value of the variable. NOTE: Can be set for all types.", + Ref: ref("k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON"), + }, + }, + "x-kubernetes-validations": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "rule", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "x-kubernetes-validations describes a list of validation rules written in the CEL expression language.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ValidationRule"), + }, + }, + }, + }, + }, + "x-metadata": { + SchemaProps: spec.SchemaProps{ + Description: "x-metadata is the metadata of a variable or a nested field within a variable. It can be used to add additional data for higher level tools.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.VariableSchemaMetadata"), + }, + }, + "x-kubernetes-int-or-string": { + SchemaProps: spec.SchemaProps{ + Description: "x-kubernetes-int-or-string specifies that this value is either an integer or a string. If this is true, an empty type is allowed and type as child of anyOf is permitted if following one of the following patterns:\n\n1) anyOf:\n - type: integer\n - type: string\n2) allOf:\n - anyOf:\n - type: integer\n - type: string\n - ... zero or more", + Type: []string{"boolean"}, + Format: "", + }, + }, + "allOf": { + SchemaProps: spec.SchemaProps{ + Description: "allOf specifies that the variable must validate against all of the subschemas in the array. NOTE: This field uses PreserveUnknownFields and Schemaless, because recursive validation is not possible.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.JSONSchemaProps"), + }, + }, + }, + }, + }, + "oneOf": { + SchemaProps: spec.SchemaProps{ + Description: "oneOf specifies that the variable must validate against exactly one of the subschemas in the array. NOTE: This field uses PreserveUnknownFields and Schemaless, because recursive validation is not possible.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.JSONSchemaProps"), + }, + }, + }, + }, + }, + "anyOf": { + SchemaProps: spec.SchemaProps{ + Description: "anyOf specifies that the variable must validate against one or more of the subschemas in the array. NOTE: This field uses PreserveUnknownFields and Schemaless, because recursive validation is not possible.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.JSONSchemaProps"), + }, + }, + }, + }, + }, + "not": { + SchemaProps: spec.SchemaProps{ + Description: "not specifies that the variable must not validate against the subschema. NOTE: This field uses PreserveUnknownFields and Schemaless, because recursive validation is not possible.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.JSONSchemaProps"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON", "sigs.k8s.io/cluster-api/api/core/v1beta2.JSONSchemaProps", "sigs.k8s.io/cluster-api/api/core/v1beta2.ValidationRule", "sigs.k8s.io/cluster-api/api/core/v1beta2.VariableSchemaMetadata"}, + } +} + +func schema_cluster_api_api_core_v1beta2_Machine(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Machine is the Schema for the machines API.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "spec is the desired state of Machine.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status is the observed state of Machine.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineStatus"), + }, + }, + }, + Required: []string{"spec"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineAddress(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineAddress contains information for the node's address.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type is the machine address type, one of Hostname, ExternalIP, InternalIP, ExternalDNS or InternalDNS.", + Type: []string{"string"}, + Format: "", + }, + }, + "address": { + SchemaProps: spec.SchemaProps{ + Description: "address is the machine address.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"type", "address"}, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeletionSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeletionSpec contains configuration options for Machine deletion.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nodeDrainTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeDrainTimeoutSeconds 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: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout`", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "nodeVolumeDetachTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "nodeDeletionTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely. Defaults to 10 seconds.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeletionStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeletionStatus is the deletion state of the Machine.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nodeDrainStartTime": { + SchemaProps: spec.SchemaProps{ + Description: "nodeDrainStartTime is the time when the drain of the node started and is used to determine if the nodeDrainTimeoutSeconds is exceeded. Only present when the Machine has a deletionTimestamp and draining the node had been started.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "waitForNodeVolumeDetachStartTime": { + SchemaProps: spec.SchemaProps{ + Description: "waitForNodeVolumeDetachStartTime is the time when waiting for volume detachment started and is used to determine if the nodeVolumeDetachTimeoutSeconds is exceeded. Detaching volumes from nodes is usually done by CSI implementations and the current state is observed from the node's `.Status.VolumesAttached` field. Only present when the Machine has a deletionTimestamp and waiting for volume detachments had been started.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Time"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeployment(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeployment is the Schema for the machinedeployments API.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "spec is the desired state of MachineDeployment.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status is the observed state of MachineDeployment.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentStatus"), + }, + }, + }, + Required: []string{"spec"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentClass(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentClass serves as a template to define a set of worker nodes of the cluster provisioned using the `ClusterClass`.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the metadata applied to the MachineDeployment and the machines of the MachineDeployment. At runtime this metadata is merged with the corresponding metadata from the topology.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ObjectMeta"), + }, + }, + "class": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "bootstrap": { + SchemaProps: spec.SchemaProps{ + Description: "bootstrap contains the bootstrap template reference to be used for the creation of worker Machines.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassBootstrapTemplate"), + }, + }, + "infrastructure": { + SchemaProps: spec.SchemaProps{ + Description: "infrastructure contains the infrastructure template reference to be used for the creation of worker Machines.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassInfrastructureTemplate"), + }, + }, + "healthCheck": { + SchemaProps: spec.SchemaProps{ + Description: "healthCheck defines a MachineHealthCheck for this MachineDeploymentClass.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassHealthCheck"), + }, + }, + "failureDomain": { + SchemaProps: spec.SchemaProps{ + Description: "failureDomain is the failure domain the machines will be created in. Must match the name of a FailureDomain from the Cluster status. NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.", + Type: []string{"string"}, + Format: "", + }, + }, + "naming": { + SchemaProps: spec.SchemaProps{ + Description: "naming allows changing the naming pattern used when creating the MachineDeployment.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassNamingSpec"), + }, + }, + "deletion": { + SchemaProps: spec.SchemaProps{ + Description: "deletion contains configuration options for Machine deletion.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassMachineDeletionSpec"), + }, + }, + "minReadySeconds": { + SchemaProps: spec.SchemaProps{ + 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) NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "readinessGates": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "conditionType", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "readinessGates specifies additional conditions to include when evaluating Machine Ready condition.\n\nThis field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine.\n\nNOTE: If a Cluster defines a custom list of readinessGates for a MachineDeployment using this MachineDeploymentClass, such list overrides readinessGates defined in this field.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineReadinessGate"), + }, + }, + }, + }, + }, + "rollout": { + SchemaProps: spec.SchemaProps{ + Description: "rollout allows you to configure the behaviour of rolling updates to the MachineDeployment Machines. It allows you to define the strategy used during rolling replacements.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassRolloutSpec"), + }, + }, + }, + Required: []string{"class", "bootstrap", "infrastructure"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassBootstrapTemplate", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassHealthCheck", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassInfrastructureTemplate", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassMachineDeletionSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassNamingSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassRolloutSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineReadinessGate", "sigs.k8s.io/cluster-api/api/core/v1beta2.ObjectMeta"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentClassBootstrapTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentClassBootstrapTemplate defines the BootstrapTemplate for a MachineDeployment.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "templateRef": { + SchemaProps: spec.SchemaProps{ + Description: "templateRef is a required reference to the BootstrapTemplate for a MachineDeployment.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassTemplateReference"), + }, + }, + }, + Required: []string{"templateRef"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassTemplateReference"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentClassHealthCheck(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentClassHealthCheck defines a MachineHealthCheck for MachineDeployment machines.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "checks": { + SchemaProps: spec.SchemaProps{ + Description: "checks are the checks that are used to evaluate if a Machine is healthy.\n\nIndependent of this configuration the MachineHealthCheck controller will always flag Machines with `cluster.x-k8s.io/remediate-machine` annotation and Machines with deleted Nodes as unhealthy.\n\nFurthermore, if checks.nodeStartupTimeoutSeconds is not set it is defaulted to 10 minutes and evaluated accordingly.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassHealthCheckChecks"), + }, + }, + "remediation": { + SchemaProps: spec.SchemaProps{ + Description: "remediation configures if and how remediations are triggered if a Machine is unhealthy.\n\nIf remediation or remediation.triggerIf is not set, remediation will always be triggered for unhealthy Machines.\n\nIf remediation or remediation.templateRef is not set, the OwnerRemediated condition will be set on unhealthy Machines to trigger remediation via the owner of the Machines, for example a MachineSet or a KubeadmControlPlane.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassHealthCheckRemediation"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassHealthCheckChecks", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassHealthCheckRemediation"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentClassHealthCheckChecks(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentClassHealthCheckChecks are the checks that are used to evaluate if a MachineDeployment Machine is healthy.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nodeStartupTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeStartupTimeoutSeconds allows to set the maximum time for MachineHealthCheck to consider a Machine unhealthy if a corresponding Node isn't associated through a `Spec.ProviderID` field.\n\nThe duration set in this field is compared to the greatest of: - Cluster's infrastructure ready condition timestamp (if and when available) - Control Plane's initialized condition timestamp (if and when available) - Machine's infrastructure ready condition timestamp (if and when available) - Machine's metadata creation timestamp\n\nDefaults to 10 minutes. If you wish to disable this feature, set the value explicitly to 0.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "unhealthyNodeConditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "unhealthyNodeConditions contains a list of 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.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.UnhealthyNodeCondition"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.UnhealthyNodeCondition"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentClassHealthCheckRemediation(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentClassHealthCheckRemediation configures if and how remediations are triggered if a MachineDeployment Machine is unhealthy.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "maxInFlight": { + SchemaProps: spec.SchemaProps{ + Description: "maxInFlight determines how many in flight remediations should happen at the same time.\n\nRemediation only happens on the MachineSet with the most current revision, while older MachineSets (usually present during rollout operations) aren't allowed to remediate.\n\nNote: In general (independent of remediations), unhealthy machines are always prioritized during scale down operations over healthy ones.\n\nMaxInFlight can be set to a fixed number or a percentage. Example: when this is set to 20%, the MachineSet controller deletes at most 20% of the desired replicas.\n\nIf not set, remediation is limited to all machines (bounded by replicas) under the active MachineSet's management.", + Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), + }, + }, + "triggerIf": { + SchemaProps: spec.SchemaProps{ + Description: "triggerIf configures if remediations are triggered. If this field is not set, remediations are always triggered.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassHealthCheckRemediationTriggerIf"), + }, + }, + "templateRef": { + SchemaProps: spec.SchemaProps{ + Description: "templateRef is a reference to a remediation template provided by an infrastructure provider.\n\nThis 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.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckRemediationTemplateReference"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/util/intstr.IntOrString", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassHealthCheckRemediationTriggerIf", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckRemediationTemplateReference"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentClassHealthCheckRemediationTriggerIf(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentClassHealthCheckRemediationTriggerIf configures if remediations are triggered.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "unhealthyLessThanOrEqualTo": { + SchemaProps: spec.SchemaProps{ + Description: "unhealthyLessThanOrEqualTo specifies that remediations are only triggered if the number of unhealthy Machines is less than or equal to the configured value. unhealthyInRange takes precedence if set.", + Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), + }, + }, + "unhealthyInRange": { + SchemaProps: spec.SchemaProps{ + Description: "unhealthyInRange specifies that remediations are only triggered if the number of unhealthy Machines is in the configured range. Takes precedence over unhealthyLessThanOrEqualTo. 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", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentClassInfrastructureTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentClassInfrastructureTemplate defines the InfrastructureTemplate for a MachineDeployment.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "templateRef": { + SchemaProps: spec.SchemaProps{ + Description: "templateRef is a required reference to the InfrastructureTemplate for a MachineDeployment.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassTemplateReference"), + }, + }, + }, + Required: []string{"templateRef"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassTemplateReference"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentClassMachineDeletionSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentClassMachineDeletionSpec contains configuration options for Machine deletion.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "order": { + SchemaProps: spec.SchemaProps{ + Description: "order defines the order in which Machines are deleted when downscaling. Defaults to \"Random\". Valid values are \"Random, \"Newest\", \"Oldest\"", + Type: []string{"string"}, + Format: "", + }, + }, + "nodeDrainTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeDrainTimeoutSeconds 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: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "nodeVolumeDetachTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "nodeDeletionTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely. Defaults to 10 seconds. NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentClassNamingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentClassNamingSpec defines the naming strategy for machine deployment objects.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "template": { + SchemaProps: spec.SchemaProps{ + Description: "template defines the template to use for generating the name of the MachineDeployment object. If not defined, it will fallback to `{{ .cluster.name }}-{{ .machineDeployment.topologyName }}-{{ .random }}`. If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will get concatenated with a random suffix of length 5. The templating mechanism provides the following arguments: * `.cluster.name`: The name of the cluster object. * `.random`: A random alphanumeric string, without vowels, of length 5. * `.machineDeployment.topologyName`: The name of the MachineDeployment topology (Cluster.spec.topology.workers.machineDeployments[].name).", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentClassRolloutSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentClassRolloutSpec defines the rollout behavior.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "strategy": { + SchemaProps: spec.SchemaProps{ + Description: "strategy specifies how to roll out control plane Machines.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassRolloutStrategy"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassRolloutStrategy"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentClassRolloutStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentClassRolloutStrategy describes how to replace existing machines with new ones.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type of rollout. Allowed values are RollingUpdate and OnDelete. Default is RollingUpdate.", + Type: []string{"string"}, + Format: "", + }, + }, + "rollingUpdate": { + SchemaProps: spec.SchemaProps{ + Description: "rollingUpdate is the rolling update config params. Present only if type = RollingUpdate.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassRolloutStrategyRollingUpdate"), + }, + }, + }, + Required: []string{"type"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClassRolloutStrategyRollingUpdate"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentClassRolloutStrategyRollingUpdate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentClassRolloutStrategyRollingUpdate is used to control the desired behavior of rolling update.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "maxUnavailable": { + SchemaProps: spec.SchemaProps{ + Description: "maxUnavailable is 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.", + Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), + }, + }, + "maxSurge": { + SchemaProps: spec.SchemaProps{ + Description: "maxSurge is 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.", + Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentDeletionSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentDeletionSpec contains configuration options for MachineDeployment deletion.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "order": { + SchemaProps: spec.SchemaProps{ + Description: "order defines the order in which Machines are deleted when downscaling. Defaults to \"Random\". Valid values are \"Random, \"Newest\", \"Oldest\"", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentDeprecatedStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "v1beta1": { + SchemaProps: spec.SchemaProps{ + Description: "v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentV1Beta1DeprecatedStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentV1Beta1DeprecatedStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentList contains a list of MachineDeployment.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "items is the list of MachineDeployments.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeployment"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeployment"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentRemediationSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentRemediationSpec controls how unhealthy Machines are remediated.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "maxInFlight": { + SchemaProps: spec.SchemaProps{ + Description: "maxInFlight determines how many in flight remediations should happen at the same time.\n\nRemediation only happens on the MachineSet with the most current revision, while older MachineSets (usually present during rollout operations) aren't allowed to remediate.\n\nNote: In general (independent of remediations), unhealthy machines are always prioritized during scale down operations over healthy ones.\n\nMaxInFlight can be set to a fixed number or a percentage. Example: when this is set to 20%, the MachineSet controller deletes at most 20% of the desired replicas.\n\nIf not set, remediation is limited to all machines (bounded by replicas) under the active MachineSet's management.", + Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentRolloutSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentRolloutSpec defines the rollout behavior.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "after": { + SchemaProps: spec.SchemaProps{ + Description: "after is a field to indicate a rollout should be performed after the specified time even if no changes have been made to the MachineDeployment. Example: In the YAML the time can be specified in the RFC3339 format. To specify the rolloutAfter target as March 9, 2023, at 9 am UTC use \"2023-03-09T09:00:00Z\".", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "strategy": { + SchemaProps: spec.SchemaProps{ + Description: "strategy specifies how to roll out control plane Machines.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentRolloutStrategy"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Time", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentRolloutStrategy"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentRolloutStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentRolloutStrategy describes how to replace existing machines with new ones.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type of rollout. Allowed values are RollingUpdate and OnDelete. Default is RollingUpdate.", + Type: []string{"string"}, + Format: "", + }, + }, + "rollingUpdate": { + SchemaProps: spec.SchemaProps{ + Description: "rollingUpdate is the rolling update config params. Present only if type = RollingUpdate.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentRolloutStrategyRollingUpdate"), + }, + }, + }, + Required: []string{"type"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentRolloutStrategyRollingUpdate"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentRolloutStrategyRollingUpdate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentRolloutStrategyRollingUpdate is used to control the desired behavior of rolling update.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "maxUnavailable": { + SchemaProps: spec.SchemaProps{ + Description: "maxUnavailable is 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.", + Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), + }, + }, + "maxSurge": { + SchemaProps: spec.SchemaProps{ + Description: "maxSurge is 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.", + Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentSpec defines the desired state of MachineDeployment.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "clusterName": { + SchemaProps: spec.SchemaProps{ + Description: "clusterName is the name of the Cluster this object belongs to.", + Type: []string{"string"}, + Format: "", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "replicas is the number of desired machines. This is a pointer to distinguish between explicit zero and not specified.\n\nDefaults to: * if the Kubernetes autoscaler min size and max size annotations are set:\n - if it's a new MachineDeployment, use min size\n - if the replicas field of the old MachineDeployment is < min size, use min size\n - if the replicas field of the old MachineDeployment is > max size, use max size\n - if the replicas field of the old MachineDeployment is in the (min size, max size) range, keep the value from the oldMD\n* otherwise use 1 Note: Defaulting will be run whenever the replicas field is not set: * A new MachineDeployment is created with replicas not set. * On an existing MachineDeployment the replicas field was first set and is now unset. Those cases are especially relevant for the following Kubernetes autoscaler use cases: * A new MachineDeployment is created and replicas should be managed by the autoscaler * An existing MachineDeployment which initially wasn't controlled by the autoscaler\n should be later controlled by the autoscaler", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "rollout": { + SchemaProps: spec.SchemaProps{ + Description: "rollout allows you to configure the behaviour of rolling updates to the MachineDeployment Machines. It allows you to require that all Machines are replaced after a certain time, and allows you to define the strategy used during rolling replacements.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentRolloutSpec"), + }, + }, + "selector": { + SchemaProps: spec.SchemaProps{ + Description: "selector is the 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.", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "template describes the machines that will be created.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineTemplateSpec"), + }, + }, + "machineNaming": { + SchemaProps: spec.SchemaProps{ + Description: "machineNaming allows changing the naming pattern used when creating Machines. Note: InfraMachines & BootstrapConfigs will use the same name as the corresponding Machines.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineNamingSpec"), + }, + }, + "remediation": { + SchemaProps: spec.SchemaProps{ + Description: "remediation controls how unhealthy Machines are remediated.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentRemediationSpec"), + }, + }, + "deletion": { + SchemaProps: spec.SchemaProps{ + Description: "deletion contains configuration options for MachineDeployment deletion.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentDeletionSpec"), + }, + }, + "paused": { + SchemaProps: spec.SchemaProps{ + Description: "paused indicates that the deployment is paused.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + Required: []string{"clusterName", "selector", "template"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentDeletionSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentRemediationSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentRolloutSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineNamingSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineTemplateSpec"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentStatus defines the observed state of MachineDeployment.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions represents the observations of a MachineDeployment's current state. Known condition types are Available, MachinesReady, MachinesUpToDate, ScalingUp, ScalingDown, Remediating, Deleting, Paused.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "observedGeneration is the generation observed by the deployment controller.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "selector": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "replicas is the total number of non-terminated machines targeted by this deployment (their labels match the selector).", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "readyReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "readyReplicas is the number of ready replicas for this MachineDeployment. A machine is considered ready when Machine's Ready condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "availableReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "availableReplicas is the number of available replicas for this MachineDeployment. A machine is considered available when Machine's Available condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "upToDateReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "upToDateReplicas is the number of up-to-date replicas targeted by this deployment. A machine is considered up-to-date when Machine's UpToDate condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "phase": { + SchemaProps: spec.SchemaProps{ + Description: "phase represents the current phase of a MachineDeployment (ScalingUp, ScalingDown, Running, Failed, or Unknown).", + Type: []string{"string"}, + Format: "", + }, + }, + "deprecated": { + SchemaProps: spec.SchemaProps{ + Description: "deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentDeprecatedStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentDeprecatedStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentTopology(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + 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.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the metadata applied to the MachineDeployment and the machines of the MachineDeployment. At runtime this metadata is merged with the corresponding metadata from the ClusterClass.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ObjectMeta"), + }, + }, + "class": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "failureDomain": { + SchemaProps: spec.SchemaProps{ + Description: "failureDomain is the failure domain the machines will be created in. Must match a key in the FailureDomains map stored on the cluster object.", + Type: []string{"string"}, + Format: "", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + 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 1) and it's assumed that an external entity (like cluster autoscaler) is responsible for the management of this value.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "healthCheck": { + SchemaProps: spec.SchemaProps{ + Description: "healthCheck allows to enable, disable and override MachineDeployment health check configuration from the ClusterClass for this MachineDeployment.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyHealthCheck"), + }, + }, + "deletion": { + SchemaProps: spec.SchemaProps{ + Description: "deletion contains configuration options for Machine deletion.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyMachineDeletionSpec"), + }, + }, + "minReadySeconds": { + SchemaProps: spec.SchemaProps{ + 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)", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "readinessGates": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "conditionType", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "readinessGates specifies additional conditions to include when evaluating Machine Ready condition.\n\nThis field can be used e.g. to instruct the machine controller to include in the computation for Machine's ready computation a condition, managed by an external controllers, reporting the status of special software/hardware installed on the Machine.\n\nIf this field is not defined, readinessGates from the corresponding MachineDeploymentClass will be used, if any.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineReadinessGate"), + }, + }, + }, + }, + }, + "rollout": { + SchemaProps: spec.SchemaProps{ + Description: "rollout allows you to configure the behaviour of rolling updates to the MachineDeployment Machines. It allows you to define the strategy used during rolling replacements.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyRolloutSpec"), + }, + }, + "variables": { + SchemaProps: spec.SchemaProps{ + Description: "variables can be used to customize the MachineDeployment through patches.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentVariables"), + }, + }, + }, + Required: []string{"class", "name"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyHealthCheck", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyMachineDeletionSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyRolloutSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentVariables", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineReadinessGate", "sigs.k8s.io/cluster-api/api/core/v1beta2.ObjectMeta"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentTopologyHealthCheck(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentTopologyHealthCheck defines a MachineHealthCheck for MachineDeployment machines.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "enabled": { + SchemaProps: spec.SchemaProps{ + Description: "enabled controls if a MachineHealthCheck should be created for the target machines.\n\nIf false: No MachineHealthCheck will be created.\n\nIf not set(default): A MachineHealthCheck will be created if it is defined here or\n in the associated ClusterClass. If no MachineHealthCheck is defined then none will be created.\n\nIf true: A MachineHealthCheck is guaranteed to be created. Cluster validation will block if `enable` is true and no MachineHealthCheck definition is available.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "checks": { + SchemaProps: spec.SchemaProps{ + Description: "checks are the checks that are used to evaluate if a Machine is healthy.\n\nIf one of checks and remediation fields are set, the system assumes that an healthCheck override is defined, and as a consequence the checks and remediation fields from Cluster will be used instead of the corresponding fields in ClusterClass.\n\nIndependent of this configuration the MachineHealthCheck controller will always flag Machines with `cluster.x-k8s.io/remediate-machine` annotation and Machines with deleted Nodes as unhealthy.\n\nFurthermore, if checks.nodeStartupTimeoutSeconds is not set it is defaulted to 10 minutes and evaluated accordingly.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyHealthCheckChecks"), + }, + }, + "remediation": { + SchemaProps: spec.SchemaProps{ + Description: "remediation configures if and how remediations are triggered if a Machine is unhealthy.\n\nIf one of checks and remediation fields are set, the system assumes that an healthCheck override is defined, and as a consequence the checks and remediation fields from cluster will be used instead of the corresponding fields in ClusterClass.\n\nIf an health check override is defined and remediation or remediation.triggerIf is not set, remediation will always be triggered for unhealthy Machines.\n\nIf an health check override is defined and remediation or remediation.templateRef is not set, the OwnerRemediated condition will be set on unhealthy Machines to trigger remediation via the owner of the Machines, for example a MachineSet or a KubeadmControlPlane.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyHealthCheckRemediation"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyHealthCheckChecks", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyHealthCheckRemediation"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentTopologyHealthCheckChecks(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentTopologyHealthCheckChecks are the checks that are used to evaluate if a MachineDeployment Machine is healthy.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nodeStartupTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeStartupTimeoutSeconds allows to set the maximum time for MachineHealthCheck to consider a Machine unhealthy if a corresponding Node isn't associated through a `Spec.ProviderID` field.\n\nThe duration set in this field is compared to the greatest of: - Cluster's infrastructure ready condition timestamp (if and when available) - Control Plane's initialized condition timestamp (if and when available) - Machine's infrastructure ready condition timestamp (if and when available) - Machine's metadata creation timestamp\n\nDefaults to 10 minutes. If you wish to disable this feature, set the value explicitly to 0.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "unhealthyNodeConditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "unhealthyNodeConditions contains a list of 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.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.UnhealthyNodeCondition"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.UnhealthyNodeCondition"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentTopologyHealthCheckRemediation(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentTopologyHealthCheckRemediation configures if and how remediations are triggered if a MachineDeployment Machine is unhealthy.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "maxInFlight": { + SchemaProps: spec.SchemaProps{ + Description: "maxInFlight determines how many in flight remediations should happen at the same time.\n\nRemediation only happens on the MachineSet with the most current revision, while older MachineSets (usually present during rollout operations) aren't allowed to remediate.\n\nNote: In general (independent of remediations), unhealthy machines are always prioritized during scale down operations over healthy ones.\n\nMaxInFlight can be set to a fixed number or a percentage. Example: when this is set to 20%, the MachineSet controller deletes at most 20% of the desired replicas.\n\nIf not set, remediation is limited to all machines (bounded by replicas) under the active MachineSet's management.", + Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), + }, + }, + "triggerIf": { + SchemaProps: spec.SchemaProps{ + Description: "triggerIf configures if remediations are triggered. If this field is not set, remediations are always triggered.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyHealthCheckRemediationTriggerIf"), + }, + }, + "templateRef": { + SchemaProps: spec.SchemaProps{ + Description: "templateRef is a reference to a remediation template provided by an infrastructure provider.\n\nThis 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.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckRemediationTemplateReference"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/util/intstr.IntOrString", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyHealthCheckRemediationTriggerIf", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckRemediationTemplateReference"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentTopologyHealthCheckRemediationTriggerIf(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentTopologyHealthCheckRemediationTriggerIf configures if remediations are triggered.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "unhealthyLessThanOrEqualTo": { + SchemaProps: spec.SchemaProps{ + Description: "unhealthyLessThanOrEqualTo specifies that remediations are only triggered if the number of unhealthy Machines is less than or equal to the configured value. unhealthyInRange takes precedence if set.", + Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), + }, + }, + "unhealthyInRange": { + SchemaProps: spec.SchemaProps{ + Description: "unhealthyInRange specifies that remediations are only triggered if the number of unhealthy Machines is in the configured range. Takes precedence over unhealthyLessThanOrEqualTo. 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", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentTopologyMachineDeletionSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentTopologyMachineDeletionSpec contains configuration options for Machine deletion.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "order": { + SchemaProps: spec.SchemaProps{ + Description: "order defines the order in which Machines are deleted when downscaling. Defaults to \"Random\". Valid values are \"Random, \"Newest\", \"Oldest\"", + Type: []string{"string"}, + Format: "", + }, + }, + "nodeDrainTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeDrainTimeoutSeconds 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: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout`", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "nodeVolumeDetachTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "nodeDeletionTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine hosts after the Machine is marked for deletion. A duration of 0 will retry deletion indefinitely. Defaults to 10 seconds.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentTopologyRolloutSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentTopologyRolloutSpec defines the rollout behavior.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "strategy": { + SchemaProps: spec.SchemaProps{ + Description: "strategy specifies how to roll out control plane Machines.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyRolloutStrategy"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyRolloutStrategy"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentTopologyRolloutStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentTopologyRolloutStrategy describes how to replace existing machines with new ones.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type of rollout. Allowed values are RollingUpdate and OnDelete. Default is RollingUpdate.", + Type: []string{"string"}, + Format: "", + }, + }, + "rollingUpdate": { + SchemaProps: spec.SchemaProps{ + Description: "rollingUpdate is the rolling update config params. Present only if type = RollingUpdate.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyRolloutStrategyRollingUpdate"), + }, + }, + }, + Required: []string{"type"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopologyRolloutStrategyRollingUpdate"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentTopologyRolloutStrategyRollingUpdate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentTopologyRolloutStrategyRollingUpdate is used to control the desired behavior of rolling update.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "maxUnavailable": { + SchemaProps: spec.SchemaProps{ + Description: "maxUnavailable is 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.", + Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), + }, + }, + "maxSurge": { + SchemaProps: spec.SchemaProps{ + Description: "maxSurge is 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.", + Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentV1Beta1DeprecatedStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "conditions defines current service state of the MachineDeployment.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.Condition"), + }, + }, + }, + }, + }, + "updatedReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "updatedReplicas is the total number of non-terminated machines targeted by this deployment that have the desired template spec.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + "readyReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "readyReplicas is the total number of ready machines targeted by this deployment.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + "availableReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "availableReplicas is the total number of available machines (ready for at least minReadySeconds) targeted by this deployment.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + "unavailableReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "unavailableReplicas is the 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.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.Condition"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeploymentVariables(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeploymentVariables can be used to provide variables for a specific MachineDeployment.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "overrides": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "overrides can be used to override Cluster level variables.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterVariable"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterVariable"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDeprecatedStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "v1beta1": { + SchemaProps: spec.SchemaProps{ + Description: "v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineV1Beta1DeprecatedStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineV1Beta1DeprecatedStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDrainRule(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDrainRule is the Schema for the MachineDrainRule API.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "spec defines the spec of a MachineDrainRule.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDrainRuleSpec"), + }, + }, + }, + Required: []string{"metadata", "spec"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDrainRuleSpec"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDrainRuleDrainConfig(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDrainRuleDrainConfig configures if and how Pods are drained.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "behavior": { + SchemaProps: spec.SchemaProps{ + Description: "behavior defines the drain behavior. Can be either \"Drain\", \"Skip\", or \"WaitCompleted\". \"Drain\" means that the Pods to which this MachineDrainRule applies will be drained. If behavior is set to \"Drain\" the order in which Pods are drained can be configured with the order field. When draining Pods of a Node the Pods will be grouped by order and one group after another will be drained (by increasing order). Cluster API will wait until all Pods of a group are terminated / removed from the Node before starting with the next group. \"Skip\" means that the Pods to which this MachineDrainRule applies will be skipped during drain. \"WaitCompleted\" means that the pods to which this MachineDrainRule applies will never be evicted and we wait for them to be completed, it is enforced that pods marked with this behavior always have Order=0.", + Type: []string{"string"}, + Format: "", + }, + }, + "order": { + SchemaProps: spec.SchemaProps{ + Description: "order defines the order in which Pods are drained. Pods with higher order are drained after Pods with lower order. order can only be set if behavior is set to \"Drain\". If order is not set, 0 will be used. Valid values for order are from -2147483648 to 2147483647 (inclusive).", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + Required: []string{"behavior"}, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDrainRuleList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDrainRuleList contains a list of MachineDrainRules.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "items contains the items of the MachineDrainRuleList.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDrainRule"), + }, + }, + }, + }, + }, + }, + Required: []string{"metadata", "items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDrainRule"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDrainRuleMachineSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDrainRuleMachineSelector defines to which Machines this MachineDrainRule should be applied.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "selector": { + SchemaProps: spec.SchemaProps{ + Description: "selector is a label selector which selects Machines by their labels. This field follows standard label selector semantics; if not present or empty, it selects all Machines.\n\nIf clusterSelector is also set, then the selector as a whole selects Machines matching selector belonging to Clusters selected by clusterSelector. If clusterSelector is not set, it selects all Machines matching selector in all Clusters.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), + }, + }, + "clusterSelector": { + SchemaProps: spec.SchemaProps{ + Description: "clusterSelector is a label selector which selects Machines by the labels of their Clusters. This field follows standard label selector semantics; if not present or empty, it selects Machines of all Clusters.\n\nIf selector is also set, then the selector as a whole selects Machines matching selector belonging to Clusters selected by clusterSelector. If selector is not set, it selects all Machines belonging to Clusters selected by clusterSelector.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDrainRulePodSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDrainRulePodSelector defines to which Pods this MachineDrainRule should be applied.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "selector": { + SchemaProps: spec.SchemaProps{ + Description: "selector is a label selector which selects Pods by their labels. This field follows standard label selector semantics; if not present or empty, it selects all Pods.\n\nIf namespaceSelector is also set, then the selector as a whole selects Pods matching selector in Namespaces selected by namespaceSelector. If namespaceSelector is not set, it selects all Pods matching selector in all Namespaces.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), + }, + }, + "namespaceSelector": { + SchemaProps: spec.SchemaProps{ + Description: "namespaceSelector is a label selector which selects Pods by the labels of their Namespaces. This field follows standard label selector semantics; if not present or empty, it selects Pods of all Namespaces.\n\nIf selector is also set, then the selector as a whole selects Pods matching selector in Namespaces selected by namespaceSelector. If selector is not set, it selects all Pods in Namespaces selected by namespaceSelector.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineDrainRuleSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineDrainRuleSpec defines the spec of a MachineDrainRule.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "drain": { + SchemaProps: spec.SchemaProps{ + Description: "drain configures if and how Pods are drained.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDrainRuleDrainConfig"), + }, + }, + "machines": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "machines defines to which Machines this MachineDrainRule should be applied.\n\nIf machines is not set, the MachineDrainRule applies to all Machines in the Namespace. If machines contains multiple selectors, the results are ORed. Within a single Machine selector the results of selector and clusterSelector are ANDed. Machines will be selected from all Clusters in the Namespace unless otherwise restricted with the clusterSelector.\n\nExample: Selects control plane Machines in all Clusters or\n Machines with label \"os\" == \"linux\" in Clusters with label\n \"stage\" == \"production\".\n\n - selector:\n matchExpressions:\n - key: cluster.x-k8s.io/control-plane\n operator: Exists\n - selector:\n matchLabels:\n os: linux\n clusterSelector:\n matchExpressions:\n - key: stage\n operator: In\n values:\n - production", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDrainRuleMachineSelector"), + }, + }, + }, + }, + }, + "pods": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "pods defines to which Pods this MachineDrainRule should be applied.\n\nIf pods is not set, the MachineDrainRule applies to all Pods in all Namespaces. If pods contains multiple selectors, the results are ORed. Within a single Pod selector the results of selector and namespaceSelector are ANDed. Pods will be selected from all Namespaces unless otherwise restricted with the namespaceSelector.\n\nExample: Selects Pods with label \"app\" == \"logging\" in all Namespaces or\n Pods with label \"app\" == \"prometheus\" in the \"monitoring\"\n Namespace.\n\n - selector:\n matchExpressions:\n - key: app\n operator: In\n values:\n - logging\n - selector:\n matchLabels:\n app: prometheus\n namespaceSelector:\n matchLabels:\n kubernetes.io/metadata.name: monitoring", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDrainRulePodSelector"), + }, + }, + }, + }, + }, + }, + Required: []string{"drain"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDrainRuleDrainConfig", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDrainRuleMachineSelector", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDrainRulePodSelector"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineHealthCheck(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineHealthCheck is the Schema for the machinehealthchecks API.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "spec is the specification of machine health check policy", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status is the most recently observed status of MachineHealthCheck resource", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckStatus"), + }, + }, + }, + Required: []string{"spec"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineHealthCheckChecks(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineHealthCheckChecks are the checks that are used to evaluate if a Machine is healthy.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nodeStartupTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeStartupTimeoutSeconds allows to set the maximum time for MachineHealthCheck to consider a Machine unhealthy if a corresponding Node isn't associated through a `Spec.ProviderID` field.\n\nThe duration set in this field is compared to the greatest of: - Cluster's infrastructure ready condition timestamp (if and when available) - Control Plane's initialized condition timestamp (if and when available) - Machine's infrastructure ready condition timestamp (if and when available) - Machine's metadata creation timestamp\n\nDefaults to 10 minutes. If you wish to disable this feature, set the value explicitly to 0.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "unhealthyNodeConditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "unhealthyNodeConditions contains a list of 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.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.UnhealthyNodeCondition"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.UnhealthyNodeCondition"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineHealthCheckDeprecatedStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineHealthCheckDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "v1beta1": { + SchemaProps: spec.SchemaProps{ + Description: "v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckV1Beta1DeprecatedStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckV1Beta1DeprecatedStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineHealthCheckList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineHealthCheckList contains a list of MachineHealthCheck.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "items is the list of MachineHealthChecks.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheck"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheck"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineHealthCheckRemediation(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineHealthCheckRemediation configures if and how remediations are triggered if a Machine is unhealthy.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "triggerIf": { + SchemaProps: spec.SchemaProps{ + Description: "triggerIf configures if remediations are triggered. If this field is not set, remediations are always triggered.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckRemediationTriggerIf"), + }, + }, + "templateRef": { + SchemaProps: spec.SchemaProps{ + Description: "templateRef is a reference to a remediation template provided by an infrastructure provider.\n\nThis 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.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckRemediationTemplateReference"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckRemediationTemplateReference", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckRemediationTriggerIf"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineHealthCheckRemediationTemplateReference(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineHealthCheckRemediationTemplateReference is a reference to a remediation template.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "kind of the remediation template. kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character.", + Type: []string{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name of the remediation template. name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.", + Type: []string{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "apiVersion of the remediation template. apiVersion must be fully qualified domain name followed by / and a version. NOTE: This field must be kept in sync with the APIVersion of the remediation template.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"kind", "name", "apiVersion"}, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineHealthCheckRemediationTriggerIf(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineHealthCheckRemediationTriggerIf configures if remediations are triggered.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "unhealthyLessThanOrEqualTo": { + SchemaProps: spec.SchemaProps{ + Description: "unhealthyLessThanOrEqualTo specifies that remediations are only triggered if the number of unhealthy Machines is less than or equal to the configured value. unhealthyInRange takes precedence if set.", + Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), + }, + }, + "unhealthyInRange": { + SchemaProps: spec.SchemaProps{ + Description: "unhealthyInRange specifies that remediations are only triggered if the number of unhealthy Machines is in the configured range. Takes precedence over unhealthyLessThanOrEqualTo. 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", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineHealthCheckSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineHealthCheckSpec defines the desired state of MachineHealthCheck.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "clusterName": { + SchemaProps: spec.SchemaProps{ + Description: "clusterName is the name of the Cluster this object belongs to.", + Type: []string{"string"}, + Format: "", + }, + }, + "selector": { + SchemaProps: spec.SchemaProps{ + Description: "selector is a label selector to match machines whose health will be exercised", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), + }, + }, + "checks": { + SchemaProps: spec.SchemaProps{ + Description: "checks are the checks that are used to evaluate if a Machine is healthy.\n\nIndependent of this configuration the MachineHealthCheck controller will always flag Machines with `cluster.x-k8s.io/remediate-machine` annotation and Machines with deleted Nodes as unhealthy.\n\nFurthermore, if checks.nodeStartupTimeoutSeconds is not set it is defaulted to 10 minutes and evaluated accordingly.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckChecks"), + }, + }, + "remediation": { + SchemaProps: spec.SchemaProps{ + Description: "remediation configures if and how remediations are triggered if a Machine is unhealthy.\n\nIf remediation or remediation.triggerIf is not set, remediation will always be triggered for unhealthy Machines.\n\nIf remediation or remediation.templateRef is not set, the OwnerRemediated condition will be set on unhealthy Machines to trigger remediation via the owner of the Machines, for example a MachineSet or a KubeadmControlPlane.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckRemediation"), + }, + }, + }, + Required: []string{"clusterName", "selector"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckChecks", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckRemediation"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineHealthCheckStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineHealthCheckStatus defines the observed state of MachineHealthCheck.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions represents the observations of a MachineHealthCheck's current state. Known condition types are RemediationAllowed, Paused.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + "expectedMachines": { + SchemaProps: spec.SchemaProps{ + Description: "expectedMachines is the total number of machines counted by this machine health check", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "currentHealthy": { + SchemaProps: spec.SchemaProps{ + Description: "currentHealthy is the total number of healthy machines counted by this machine health check", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "remediationsAllowed": { + SchemaProps: spec.SchemaProps{ + Description: "remediationsAllowed is the number of further remediations allowed by this machine health check before maxUnhealthy short circuiting will be applied", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "observedGeneration is the latest generation observed by the controller.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "targets": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "targets shows the current list of machines the machine health check is watching", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "deprecated": { + SchemaProps: spec.SchemaProps{ + Description: "deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckDeprecatedStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineHealthCheckDeprecatedStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineHealthCheckV1Beta1DeprecatedStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineHealthCheckV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "conditions defines current service state of the MachineHealthCheck.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.Condition"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.Condition"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineInitializationStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineInitializationStatus provides observations of the Machine initialization process. NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial Machine provisioning.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "infrastructureProvisioned": { + SchemaProps: spec.SchemaProps{ + Description: "infrastructureProvisioned is true when the infrastructure provider reports that Machine's infrastructure is fully provisioned. NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. The value of this field is never updated after provisioning is completed.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "bootstrapDataSecretCreated": { + SchemaProps: spec.SchemaProps{ + Description: "bootstrapDataSecretCreated is true when the bootstrap provider reports that the Machine's boostrap secret is created. NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. The value of this field is never updated after provisioning is completed.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineList contains a list of Machine.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "items is the list of Machines.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.Machine"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta2.Machine"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineNamingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineNamingSpec allows changing the naming pattern used when creating Machines. Note: InfraMachines & BootstrapConfigs will use the same name as the corresponding Machines.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "template": { + SchemaProps: spec.SchemaProps{ + Description: "template defines the template to use for generating the names of the Machine objects. If not defined, it will fallback to `{{ .machineSet.name }}-{{ .random }}`. If the generated name string exceeds 63 characters, it will be trimmed to 58 characters and will get concatenated with a random suffix of length 5. Length of the template string must not exceed 256 characters. The template allows the following variables `.cluster.name`, `.machineSet.name` and `.random`. The variable `.cluster.name` retrieves the name of the cluster object that owns the Machines being created. The variable `.machineSet.name` retrieves the name of the MachineSet object that owns the Machines being created. The variable `.random` is substituted with random alphanumeric string, without vowels, of length 5. This variable is required part of the template. If not provided, validation will fail.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineNodeReference(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineNodeReference is a reference to the node running on the machine.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name of the node. name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"name"}, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_MachinePool(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePool is the Schema for the machinepools API. NOTE: This CRD can only be used if the MachinePool feature gate is enabled.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "spec is the desired state of MachinePool.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status is the observed state of MachinePool.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolStatus"), + }, + }, + }, + Required: []string{"spec"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachinePoolClass(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolClass serves as a template to define a pool of worker nodes of the cluster provisioned using `ClusterClass`.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the metadata applied to the MachinePool. At runtime this metadata is merged with the corresponding metadata from the topology.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ObjectMeta"), + }, + }, + "class": { + SchemaProps: spec.SchemaProps{ + Description: "class denotes a type of machine pool present in the cluster, this name MUST be unique within a ClusterClass and can be referenced in the Cluster to create a managed MachinePool.", + Type: []string{"string"}, + Format: "", + }, + }, + "bootstrap": { + SchemaProps: spec.SchemaProps{ + Description: "bootstrap contains the bootstrap template reference to be used for the creation of the Machines in the MachinePool.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolClassBootstrapTemplate"), + }, + }, + "infrastructure": { + SchemaProps: spec.SchemaProps{ + Description: "infrastructure contains the infrastructure template reference to be used for the creation of the MachinePool.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolClassInfrastructureTemplate"), + }, + }, + "failureDomains": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "failureDomains is the list of failure domains the MachinePool should be attached to. Must match a key in the FailureDomains map stored on the cluster object. NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "naming": { + SchemaProps: spec.SchemaProps{ + Description: "naming allows changing the naming pattern used when creating the MachinePool.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolClassNamingSpec"), + }, + }, + "deletion": { + SchemaProps: spec.SchemaProps{ + Description: "deletion contains configuration options for Machine deletion.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolClassMachineDeletionSpec"), + }, + }, + "minReadySeconds": { + SchemaProps: spec.SchemaProps{ + Description: "minReadySeconds is the minimum number of seconds for which a newly created machine pool should be ready. Defaults to 0 (machine will be considered available as soon as it is ready) NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + Required: []string{"class", "bootstrap", "infrastructure"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolClassBootstrapTemplate", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolClassInfrastructureTemplate", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolClassMachineDeletionSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolClassNamingSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.ObjectMeta"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachinePoolClassBootstrapTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolClassBootstrapTemplate defines the BootstrapTemplate for a MachinePool.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "templateRef": { + SchemaProps: spec.SchemaProps{ + Description: "templateRef is a required reference to the BootstrapTemplate for a MachinePool.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassTemplateReference"), + }, + }, + }, + Required: []string{"templateRef"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassTemplateReference"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachinePoolClassInfrastructureTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolClassInfrastructureTemplate defines the InfrastructureTemplate for a MachinePool.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "templateRef": { + SchemaProps: spec.SchemaProps{ + Description: "templateRef is a required reference to the InfrastructureTemplate for a MachinePool.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassTemplateReference"), + }, + }, + }, + Required: []string{"templateRef"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassTemplateReference"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachinePoolClassMachineDeletionSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolClassMachineDeletionSpec contains configuration options for Machine deletion.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nodeDrainTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeDrainTimeoutSeconds 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: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout` NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "nodeVolumeDetachTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations. NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "nodeDeletionTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the Machine hosts after the Machine Pool is marked for deletion. A duration of 0 will retry deletion indefinitely. Defaults to 10 seconds. NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_MachinePoolClassNamingSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolClassNamingSpec defines the naming strategy for MachinePool objects.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "template": { + SchemaProps: spec.SchemaProps{ + Description: "template defines the template to use for generating the name of the MachinePool object. If not defined, it will fallback to `{{ .cluster.name }}-{{ .machinePool.topologyName }}-{{ .random }}`. If the templated string exceeds 63 characters, it will be trimmed to 58 characters and will get concatenated with a random suffix of length 5. The templating mechanism provides the following arguments: * `.cluster.name`: The name of the cluster object. * `.random`: A random alphanumeric string, without vowels, of length 5. * `.machinePool.topologyName`: The name of the MachinePool topology (Cluster.spec.topology.workers.machinePools[].name).", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_MachinePoolDeprecatedStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "v1beta1": { + SchemaProps: spec.SchemaProps{ + Description: "v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolV1Beta1DeprecatedStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolV1Beta1DeprecatedStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachinePoolInitializationStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolInitializationStatus provides observations of the MachinePool initialization process. NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial MachinePool provisioning.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "infrastructureProvisioned": { + SchemaProps: spec.SchemaProps{ + Description: "infrastructureProvisioned is true when the infrastructure provider reports that MachinePool's infrastructure is fully provisioned. NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. The value of this field is never updated after provisioning is completed.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "bootstrapDataSecretCreated": { + SchemaProps: spec.SchemaProps{ + Description: "bootstrapDataSecretCreated is true when the bootstrap provider reports that the MachinePool's boostrap secret is created. NOTE: this field is part of the Cluster API contract, and it is used to orchestrate provisioning. The value of this field is never updated after provisioning is completed.", + Type: []string{"boolean"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_MachinePoolList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolList contains a list of MachinePool.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "items is the list of MachinePools.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePool"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePool"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachinePoolSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolSpec defines the desired state of MachinePool.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "clusterName": { + SchemaProps: spec.SchemaProps{ + Description: "clusterName is the name of the Cluster this object belongs to.", + Type: []string{"string"}, + Format: "", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "replicas is the number of desired machines. Defaults to 1. This is a pointer to distinguish between explicit zero and not specified.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "template describes the machines that will be created.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineTemplateSpec"), + }, + }, + "providerIDList": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + 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.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "failureDomains": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "failureDomains is the list of failure domains this MachinePool should be attached to.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"clusterName", "template"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineTemplateSpec"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachinePoolStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolStatus defines the observed state of MachinePool.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions represents the observations of a MachinePool's current state. Known condition types are Available, BootstrapConfigReady, InfrastructureReady, MachinesReady, MachinesUpToDate, ScalingUp, ScalingDown, Remediating, Deleting, Paused.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + "initialization": { + SchemaProps: spec.SchemaProps{ + Description: "initialization provides observations of the MachinePool initialization process. NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial MachinePool provisioning.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolInitializationStatus"), + }, + }, + "nodeRefs": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "nodeRefs will point to the corresponding Nodes if it they exist.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/api/core/v1.ObjectReference"), + }, + }, + }, + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "replicas is the most recently observed number of replicas.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "readyReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "readyReplicas is the number of ready replicas for this MachinePool. A machine is considered ready when Machine's Ready condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "availableReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "availableReplicas is the number of available replicas for this MachinePool. A machine is considered available when Machine's Available condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "upToDateReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "upToDateReplicas is the number of up-to-date replicas targeted by this MachinePool. A machine is considered up-to-date when Machine's UpToDate condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "phase": { + SchemaProps: spec.SchemaProps{ + Description: "phase represents the current phase of cluster actuation.", + Type: []string{"string"}, + Format: "", + }, + }, + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "observedGeneration is the latest generation observed by the controller.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "deprecated": { + SchemaProps: spec.SchemaProps{ + Description: "deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolDeprecatedStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.ObjectReference", "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolDeprecatedStatus", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolInitializationStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachinePoolTopology(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolTopology specifies the different parameters for a pool of worker nodes in the topology. This pool of nodes is managed by a MachinePool object whose lifecycle is managed by the Cluster controller.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the metadata applied to the MachinePool. At runtime this metadata is merged with the corresponding metadata from the ClusterClass.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ObjectMeta"), + }, + }, + "class": { + SchemaProps: spec.SchemaProps{ + Description: "class is the name of the MachinePoolClass used to create the pool 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{"string"}, + Format: "", + }, + }, + "name": { + SchemaProps: spec.SchemaProps{ + Description: "name is the unique identifier for this MachinePoolTopology. The value is used with other unique identifiers to create a MachinePool'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{"string"}, + Format: "", + }, + }, + "failureDomains": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "failureDomains is the list of failure domains the machine pool will be created in. Must match a key in the FailureDomains map stored on the cluster object.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "deletion": { + SchemaProps: spec.SchemaProps{ + Description: "deletion contains configuration options for Machine deletion.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolTopologyMachineDeletionSpec"), + }, + }, + "minReadySeconds": { + SchemaProps: spec.SchemaProps{ + Description: "minReadySeconds is the minimum number of seconds for which a newly created machine pool should be ready. Defaults to 0 (machine will be considered available as soon as it is ready)", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "replicas is the number of nodes belonging to this pool. If the value is nil, the MachinePool is created without the number of Replicas (defaulting to 1) and it's assumed that an external entity (like cluster autoscaler) is responsible for the management of this value.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "variables": { + SchemaProps: spec.SchemaProps{ + Description: "variables can be used to customize the MachinePool through patches.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolVariables"), + }, + }, + }, + Required: []string{"class", "name"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolTopologyMachineDeletionSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolVariables", "sigs.k8s.io/cluster-api/api/core/v1beta2.ObjectMeta"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachinePoolTopologyMachineDeletionSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolTopologyMachineDeletionSpec contains configuration options for Machine deletion.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "nodeDrainTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeDrainTimeoutSeconds 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: nodeDrainTimeoutSeconds is different from `kubectl drain --timeout`", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "nodeVolumeDetachTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeVolumeDetachTimeoutSeconds is the total amount of time that the controller will spend on waiting for all volumes to be detached. The default value is 0, meaning that the volumes can be detached without any time limitations.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "nodeDeletionTimeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "nodeDeletionTimeoutSeconds defines how long the controller will attempt to delete the Node that the MachinePool hosts after the MachinePool is marked for deletion. A duration of 0 will retry deletion indefinitely. Defaults to 10 seconds.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_MachinePoolV1Beta1DeprecatedStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "conditions define the current service state of the MachinePool.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.Condition"), + }, + }, + }, + }, + }, + "failureReason": { + SchemaProps: spec.SchemaProps{ + Description: "failureReason indicates that there is a problem reconciling the state, and will be set to a token value suitable for programmatic interpretation.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"string"}, + Format: "", + }, + }, + "failureMessage": { + SchemaProps: spec.SchemaProps{ + Description: "failureMessage indicates that there is a problem reconciling the state, and will be set to a descriptive error message.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"string"}, + Format: "", + }, + }, + "readyReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "readyReplicas is the number of ready replicas for this MachinePool. A machine is considered ready when the node has been created and is \"Ready\".\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "availableReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "availableReplicas is the number of available replicas (ready for at least minReadySeconds) for this MachinePool.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "unavailableReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "unavailableReplicas is the 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.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.Condition"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachinePoolVariables(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachinePoolVariables can be used to provide variables for a specific MachinePool.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "overrides": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "overrides can be used to override Cluster level variables.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterVariable"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterVariable"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineReadinessGate(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineReadinessGate contains the type of a Machine condition to be used as a readiness gate.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditionType": { + SchemaProps: spec.SchemaProps{ + Description: "conditionType refers to a condition with matching type in the Machine's condition list. If the conditions doesn't exist, it will be treated as unknown. Note: Both Cluster API conditions or conditions added by 3rd party controllers can be used as readiness gates.", + Type: []string{"string"}, + Format: "", + }, + }, + "polarity": { + SchemaProps: spec.SchemaProps{ + Description: "polarity of the conditionType specified in this readinessGate. Valid values are Positive, Negative and omitted. When omitted, the default behaviour will be Positive. A positive polarity means that the condition should report a true status under normal conditions. A negative polarity means that the condition should report a false status under normal conditions.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"conditionType"}, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineSet(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineSet is the Schema for the machinesets API.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "spec is the desired state of MachineSet.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSetSpec"), + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status is the observed state of MachineSet.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSetStatus"), + }, + }, + }, + Required: []string{"spec"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSetSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSetStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineSetDeletionSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineSetDeletionSpec contains configuration options for MachineSet deletion.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "order": { + SchemaProps: spec.SchemaProps{ + Description: "order defines the order in which Machines are deleted when downscaling. Defaults to \"Random\". Valid values are \"Random, \"Newest\", \"Oldest\"", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineSetDeprecatedStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineSetDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "v1beta1": { + SchemaProps: spec.SchemaProps{ + Description: "v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSetV1Beta1DeprecatedStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSetV1Beta1DeprecatedStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineSetList(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineSetList contains a list of MachineSet.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "kind": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "apiVersion": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard list's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta"), + }, + }, + "items": { + SchemaProps: spec.SchemaProps{ + Description: "items is the list of MachineSets.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSet"), + }, + }, + }, + }, + }, + }, + Required: []string{"items"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSet"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineSetSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineSetSpec defines the desired state of MachineSet.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "clusterName": { + SchemaProps: spec.SchemaProps{ + Description: "clusterName is the name of the Cluster this object belongs to.", + Type: []string{"string"}, + Format: "", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "replicas is the number of desired replicas. This is a pointer to distinguish between explicit zero and unspecified.\n\nDefaults to: * if the Kubernetes autoscaler min size and max size annotations are set:\n - if it's a new MachineSet, use min size\n - if the replicas field of the old MachineSet is < min size, use min size\n - if the replicas field of the old MachineSet is > max size, use max size\n - if the replicas field of the old MachineSet is in the (min size, max size) range, keep the value from the oldMS\n* otherwise use 1 Note: Defaulting will be run whenever the replicas field is not set: * A new MachineSet is created with replicas not set. * On an existing MachineSet the replicas field was first set and is now unset. Those cases are especially relevant for the following Kubernetes autoscaler use cases: * A new MachineSet is created and replicas should be managed by the autoscaler * An existing MachineSet which initially wasn't controlled by the autoscaler\n should be later controlled by the autoscaler", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "selector": { + SchemaProps: spec.SchemaProps{ + 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", + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector"), + }, + }, + "template": { + SchemaProps: spec.SchemaProps{ + Description: "template is the object that describes the machine that will be created if insufficient replicas are detected. Object references to custom resources are treated as templates.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineTemplateSpec"), + }, + }, + "machineNaming": { + SchemaProps: spec.SchemaProps{ + Description: "machineNaming allows changing the naming pattern used when creating Machines. Note: InfraMachines & BootstrapConfigs will use the same name as the corresponding Machines.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineNamingSpec"), + }, + }, + "deletion": { + SchemaProps: spec.SchemaProps{ + Description: "deletion contains configuration options for MachineSet deletion.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSetDeletionSpec"), + }, + }, + }, + Required: []string{"clusterName", "selector", "template"}, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.LabelSelector", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineNamingSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSetDeletionSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineTemplateSpec"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineSetStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineSetStatus defines the observed state of MachineSet.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions represents the observations of a MachineSet's current state. Known condition types are MachinesReady, MachinesUpToDate, ScalingUp, ScalingDown, Remediating, Deleting, Paused.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + "selector": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "replicas is the most recently observed number of replicas.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "readyReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "readyReplicas is the number of ready replicas for this MachineSet. A machine is considered ready when Machine's Ready condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "availableReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "availableReplicas is the number of available replicas for this MachineSet. A machine is considered available when Machine's Available condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "upToDateReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "upToDateReplicas is the number of up-to-date replicas for this MachineSet. A machine is considered up-to-date when Machine's UpToDate condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "observedGeneration reflects the generation of the most recently observed MachineSet.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "deprecated": { + SchemaProps: spec.SchemaProps{ + Description: "deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSetDeprecatedStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSetDeprecatedStatus"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineSetV1Beta1DeprecatedStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineSetV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "conditions defines current service state of the MachineSet.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.Condition"), + }, + }, + }, + }, + }, + "failureReason": { + SchemaProps: spec.SchemaProps{ + 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\nIn 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\nThese 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\nAny 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.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"string"}, + Format: "", + }, + }, + "failureMessage": { + SchemaProps: spec.SchemaProps{ + 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\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"string"}, + Format: "", + }, + }, + "fullyLabeledReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "fullyLabeledReplicas is the number of replicas that have labels matching the labels of the machine template of the MachineSet.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + "readyReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "readyReplicas is the number of ready replicas for this MachineSet. A machine is considered ready when the node has been created and is \"Ready\".\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + "availableReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "availableReplicas is the number of available replicas (ready for at least minReadySeconds) for this MachineSet.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Default: 0, + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.Condition"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineSpec defines the desired state of Machine.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "clusterName": { + SchemaProps: spec.SchemaProps{ + Description: "clusterName is the name of the Cluster this object belongs to.", + Type: []string{"string"}, + Format: "", + }, + }, + "bootstrap": { + SchemaProps: spec.SchemaProps{ + Description: "bootstrap is a reference to a local struct which encapsulates fields to configure the Machine’s bootstrapping mechanism.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.Bootstrap"), + }, + }, + "infrastructureRef": { + SchemaProps: spec.SchemaProps{ + Description: "infrastructureRef is a required reference to a custom resource offered by an infrastructure provider.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ContractVersionedObjectReference"), + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "version defines the desired Kubernetes version. This field is meant to be optionally used by bootstrap providers.", + Type: []string{"string"}, + Format: "", + }, + }, + "providerID": { + SchemaProps: spec.SchemaProps{ + 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{"string"}, + Format: "", + }, + }, + "failureDomain": { + SchemaProps: spec.SchemaProps{ + Description: "failureDomain is the failure domain the machine will be created in. Must match the name of a FailureDomain from the Cluster status.", + Type: []string{"string"}, + Format: "", + }, + }, + "minReadySeconds": { + SchemaProps: spec.SchemaProps{ + Description: "minReadySeconds is the minimum number of seconds for which a Machine should be ready before considering it available. Defaults to 0 (Machine will be considered available as soon as the Machine is ready)", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "readinessGates": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "conditionType", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "readinessGates specifies additional conditions to include when evaluating Machine Ready condition.\n\nThis field can be used e.g. by Cluster API control plane providers to extend the semantic of the Ready condition for the Machine they control, like the kubeadm control provider adding ReadinessGates for the APIServerPodHealthy, SchedulerPodHealthy conditions, etc.\n\nAnother example are external controllers, e.g. responsible to install special software/hardware on the Machines; they can include the status of those components with a new condition and add this condition to ReadinessGates.\n\nNOTE: In case readinessGates conditions start with the APIServer, ControllerManager, Scheduler prefix, and all those readiness gates condition are reporting the same message, when computing the Machine's Ready condition those readinessGates will be replaced by a single entry reporting \"Control plane components: \" + message. This helps to improve readability of conditions bubbling up to the Machine's owner resource / to the Cluster).", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineReadinessGate"), + }, + }, + }, + }, + }, + "deletion": { + SchemaProps: spec.SchemaProps{ + Description: "deletion contains configuration options for Machine deletion.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeletionSpec"), + }, + }, + }, + Required: []string{"clusterName", "bootstrap", "infrastructureRef"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.Bootstrap", "sigs.k8s.io/cluster-api/api/core/v1beta2.ContractVersionedObjectReference", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeletionSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineReadinessGate"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineStatus defines the observed state of Machine.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "type", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "conditions represents the observations of a Machine's current state. Known condition types are Available, Ready, UpToDate, BootstrapConfigReady, InfrastructureReady, NodeReady, NodeHealthy, Deleting, Paused. If a MachineHealthCheck is targeting this machine, also HealthCheckSucceeded, OwnerRemediated conditions are added. Additionally control plane Machines controlled by KubeadmControlPlane will have following additional conditions: APIServerPodHealthy, ControllerManagerPodHealthy, SchedulerPodHealthy, EtcdPodHealthy, EtcdMemberHealthy.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Condition"), + }, + }, + }, + }, + }, + "initialization": { + SchemaProps: spec.SchemaProps{ + Description: "initialization provides observations of the Machine initialization process. NOTE: Fields in this struct are part of the Cluster API contract and are used to orchestrate initial Machine provisioning.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineInitializationStatus"), + }, + }, + "nodeRef": { + SchemaProps: spec.SchemaProps{ + Description: "nodeRef will point to the corresponding Node if it exists.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineNodeReference"), + }, + }, + "nodeInfo": { + SchemaProps: spec.SchemaProps{ + Description: "nodeInfo is a set of ids/uuids to uniquely identify the node. More info: https://kubernetes.io/docs/concepts/nodes/node/#info", + Ref: ref("k8s.io/api/core/v1.NodeSystemInfo"), + }, + }, + "lastUpdated": { + SchemaProps: spec.SchemaProps{ + Description: "lastUpdated identifies when the phase of the Machine last transitioned.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "addresses": { + SchemaProps: spec.SchemaProps{ + Description: "addresses is a list of addresses assigned to the machine. This field is copied from the infrastructure provider reference.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineAddress"), + }, + }, + }, + }, + }, + "phase": { + SchemaProps: spec.SchemaProps{ + Description: "phase represents the current phase of machine actuation.", + Type: []string{"string"}, + Format: "", + }, + }, + "certificatesExpiryDate": { + SchemaProps: spec.SchemaProps{ + Description: "certificatesExpiryDate is the expiry date of the machine certificates. This value is only set for control plane machines.", + Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), + }, + }, + "observedGeneration": { + SchemaProps: spec.SchemaProps{ + Description: "observedGeneration is the latest generation observed by the controller.", + Type: []string{"integer"}, + Format: "int64", + }, + }, + "deletion": { + SchemaProps: spec.SchemaProps{ + Description: "deletion contains information relating to removal of the Machine. Only present when the Machine has a deletionTimestamp and drain or wait for volume detach started.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeletionStatus"), + }, + }, + "deprecated": { + SchemaProps: spec.SchemaProps{ + Description: "deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeprecatedStatus"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "k8s.io/api/core/v1.NodeSystemInfo", "k8s.io/apimachinery/pkg/apis/meta/v1.Condition", "k8s.io/apimachinery/pkg/apis/meta/v1.Time", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineAddress", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeletionStatus", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeprecatedStatus", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineInitializationStatus", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineNodeReference"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineTemplateSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineTemplateSpec describes the data needed to create a Machine from a template.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "metadata": { + SchemaProps: spec.SchemaProps{ + Description: "metadata is the standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ObjectMeta"), + }, + }, + "spec": { + SchemaProps: spec.SchemaProps{ + Description: "spec is the 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", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSpec"), + }, + }, + }, + Required: []string{"spec"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineSpec", "sigs.k8s.io/cluster-api/api/core/v1beta2.ObjectMeta"}, + } +} + +func schema_cluster_api_api_core_v1beta2_MachineV1Beta1DeprecatedStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "MachineV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "conditions": { + SchemaProps: spec.SchemaProps{ + Description: "conditions defines current service state of the Machine.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.Condition"), + }, + }, + }, + }, + }, + "failureReason": { + SchemaProps: spec.SchemaProps{ + 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\nThis 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\nAny 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.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"string"}, + Format: "", + }, + }, + "failureMessage": { + SchemaProps: spec.SchemaProps{ + 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\nThis 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\nAny 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.\n\nDeprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details.", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.Condition"}, + } +} + +func schema_cluster_api_api_core_v1beta2_NetworkRanges(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "NetworkRanges represents ranges of network addresses.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "cidrBlocks": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "cidrBlocks is a list of CIDR blocks.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + Required: []string{"cidrBlocks"}, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_ObjectMeta(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "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.\n\nObjectMeta 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.\n\nDuring 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.\n\nIn 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.\n\nIn future versions, controller-tools@v2 might allow overriding the type and validation for embedded types. When that happens, this hack should be revisited.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "labels": { + SchemaProps: spec.SchemaProps{ + Description: "labels is a 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: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "annotations": { + SchemaProps: spec.SchemaProps{ + 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: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_PatchDefinition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PatchDefinition defines a patch which is applied to customize the referenced templates.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "selector": { + SchemaProps: spec.SchemaProps{ + Description: "selector defines on which templates the patch should be applied.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.PatchSelector"), + }, + }, + "jsonPatches": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "jsonPatches defines the patches which should be applied on the templates matching the selector. Note: Patches will be applied in the order of the array.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.JSONPatch"), + }, + }, + }, + }, + }, + }, + Required: []string{"selector", "jsonPatches"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.JSONPatch", "sigs.k8s.io/cluster-api/api/core/v1beta2.PatchSelector"}, + } +} + +func schema_cluster_api_api_core_v1beta2_PatchSelector(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PatchSelector defines on which templates the patch should be applied. Note: Matching on APIVersion and Kind is mandatory, to enforce that the patches are written for the correct version. The version of the references in the ClusterClass may be automatically updated during reconciliation if there is a newer version for the same contract. Note: The results of selection based on the individual fields are ANDed.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "apiVersion": { + SchemaProps: spec.SchemaProps{ + Description: "apiVersion filters templates by apiVersion. apiVersion must be fully qualified domain name followed by / and a version.", + Type: []string{"string"}, + Format: "", + }, + }, + "kind": { + SchemaProps: spec.SchemaProps{ + Description: "kind filters templates by kind. kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character.", + Type: []string{"string"}, + Format: "", + }, + }, + "matchResources": { + SchemaProps: spec.SchemaProps{ + Description: "matchResources selects templates based on where they are referenced.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.PatchSelectorMatch"), + }, + }, + }, + Required: []string{"apiVersion", "kind", "matchResources"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.PatchSelectorMatch"}, + } +} + +func schema_cluster_api_api_core_v1beta2_PatchSelectorMatch(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PatchSelectorMatch selects templates based on where they are referenced. Note: The selector must match at least one template. Note: The results of selection based on the individual fields are ORed.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "controlPlane": { + SchemaProps: spec.SchemaProps{ + Description: "controlPlane selects templates referenced in .spec.ControlPlane. Note: this will match the controlPlane and also the controlPlane machineInfrastructure (depending on the kind and apiVersion).", + Type: []string{"boolean"}, + Format: "", + }, + }, + "infrastructureCluster": { + SchemaProps: spec.SchemaProps{ + Description: "infrastructureCluster selects templates referenced in .spec.infrastructure.", + Type: []string{"boolean"}, + Format: "", + }, + }, + "machineDeploymentClass": { + SchemaProps: spec.SchemaProps{ + Description: "machineDeploymentClass selects templates referenced in specific MachineDeploymentClasses in .spec.workers.machineDeployments.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.PatchSelectorMatchMachineDeploymentClass"), + }, + }, + "machinePoolClass": { + SchemaProps: spec.SchemaProps{ + Description: "machinePoolClass selects templates referenced in specific MachinePoolClasses in .spec.workers.machinePools.", + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.PatchSelectorMatchMachinePoolClass"), + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.PatchSelectorMatchMachineDeploymentClass", "sigs.k8s.io/cluster-api/api/core/v1beta2.PatchSelectorMatchMachinePoolClass"}, + } +} + +func schema_cluster_api_api_core_v1beta2_PatchSelectorMatchMachineDeploymentClass(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PatchSelectorMatchMachineDeploymentClass selects templates referenced in specific MachineDeploymentClasses in .spec.workers.machineDeployments.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "names": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "names selects templates by class names.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_PatchSelectorMatchMachinePoolClass(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "PatchSelectorMatchMachinePoolClass selects templates referenced in specific MachinePoolClasses in .spec.workers.machinePools.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "names": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-type": "atomic", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "names selects templates by class names.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_Topology(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "Topology encapsulates the information of the managed resources.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "classRef": { + SchemaProps: spec.SchemaProps{ + Description: "classRef is the ref to the ClusterClass that should be used for the topology.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassRef"), + }, + }, + "version": { + SchemaProps: spec.SchemaProps{ + Description: "version is the Kubernetes version of the cluster.", + Type: []string{"string"}, + Format: "", + }, + }, + "controlPlane": { + SchemaProps: spec.SchemaProps{ + Description: "controlPlane describes the cluster control plane.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopology"), + }, + }, + "workers": { + SchemaProps: spec.SchemaProps{ + Description: "workers encapsulates the different constructs that form the worker nodes for the cluster.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.WorkersTopology"), + }, + }, + "variables": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "variables can be used to customize the Cluster through patches. They must comply to the corresponding VariableClasses defined in the ClusterClass.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterVariable"), + }, + }, + }, + }, + }, + }, + Required: []string{"classRef", "version"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterClassRef", "sigs.k8s.io/cluster-api/api/core/v1beta2.ClusterVariable", "sigs.k8s.io/cluster-api/api/core/v1beta2.ControlPlaneTopology", "sigs.k8s.io/cluster-api/api/core/v1beta2.WorkersTopology"}, + } +} + +func schema_cluster_api_api_core_v1beta2_UnhealthyNodeCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "UnhealthyNodeCondition 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: []string{"object"}, + Properties: map[string]spec.Schema{ + "type": { + SchemaProps: spec.SchemaProps{ + Description: "type of Node condition", + Type: []string{"string"}, + Format: "", + }, + }, + "status": { + SchemaProps: spec.SchemaProps{ + Description: "status of the condition, one of True, False, Unknown.", + Type: []string{"string"}, + Format: "", + }, + }, + "timeoutSeconds": { + SchemaProps: spec.SchemaProps{ + Description: "timeoutSeconds is the duration that a node must be in a given status for, after which the node is considered unhealthy. For example, with a value of \"1h\", the node must match the status for at least 1 hour before being considered unhealthy.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + Required: []string{"type", "status", "timeoutSeconds"}, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_ValidationRule(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "ValidationRule describes a validation rule written in the CEL expression language.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "rule": { + SchemaProps: spec.SchemaProps{ + Description: "rule represents the expression which will be evaluated by CEL. ref: https://github.com/google/cel-spec The Rule is scoped to the location of the x-kubernetes-validations extension in the schema. The `self` variable in the CEL expression is bound to the scoped value. If the Rule is scoped to an object with properties, the accessible properties of the object are field selectable via `self.field` and field presence can be checked via `has(self.field)`. If the Rule is scoped to an object with additionalProperties (i.e. a map) the value of the map are accessible via `self[mapKey]`, map containment can be checked via `mapKey in self` and all entries of the map are accessible via CEL macros and functions such as `self.all(...)`. If the Rule is scoped to an array, the elements of the array are accessible via `self[i]` and also by macros and functions. If the Rule is scoped to a scalar, `self` is bound to the scalar value. Examples: - Rule scoped to a map of objects: {\"rule\": \"self.components['Widget'].priority < 10\"} - Rule scoped to a list of integers: {\"rule\": \"self.values.all(value, value >= 0 && value < 100)\"} - Rule scoped to a string value: {\"rule\": \"self.startsWith('kube')\"}\n\nUnknown data preserved in custom resources via x-kubernetes-preserve-unknown-fields is not accessible in CEL expressions. This includes: - Unknown field values that are preserved by object schemas with x-kubernetes-preserve-unknown-fields. - Object properties where the property schema is of an \"unknown type\". An \"unknown type\" is recursively defined as:\n - A schema with no type and x-kubernetes-preserve-unknown-fields set to true\n - An array where the items schema is of an \"unknown type\"\n - An object where the additionalProperties schema is of an \"unknown type\"\n\nOnly property names of the form `[a-zA-Z_.-/][a-zA-Z0-9_.-/]*` are accessible. Accessible property names are escaped according to the following rules when accessed in the expression: - '__' escapes to '__underscores__' - '.' escapes to '__dot__' - '-' escapes to '__dash__' - '/' escapes to '__slash__' - Property names that exactly match a CEL RESERVED keyword escape to '__{keyword}__'. The keywords are:\n\t \"true\", \"false\", \"null\", \"in\", \"as\", \"break\", \"const\", \"continue\", \"else\", \"for\", \"function\", \"if\",\n\t \"import\", \"let\", \"loop\", \"package\", \"namespace\", \"return\".\nExamples:\n - Rule accessing a property named \"namespace\": {\"rule\": \"self.__namespace__ > 0\"}\n - Rule accessing a property named \"x-prop\": {\"rule\": \"self.x__dash__prop > 0\"}\n - Rule accessing a property named \"redact__d\": {\"rule\": \"self.redact__underscores__d > 0\"}\n\nIf `rule` makes use of the `oldSelf` variable it is implicitly a `transition rule`.\n\nBy default, the `oldSelf` variable is the same type as `self`.\n\nTransition rules by default are applied only on UPDATE requests and are skipped if an old value could not be found.", + Type: []string{"string"}, + Format: "", + }, + }, + "message": { + SchemaProps: spec.SchemaProps{ + Description: "message represents the message displayed when validation fails. The message is required if the Rule contains line breaks. The message must not contain line breaks. If unset, the message is \"failed rule: {Rule}\". e.g. \"must be a URL with the host matching spec.host\"", + Type: []string{"string"}, + Format: "", + }, + }, + "messageExpression": { + SchemaProps: spec.SchemaProps{ + Description: "messageExpression declares a CEL expression that evaluates to the validation failure message that is returned when this rule fails. Since messageExpression is used as a failure message, it must evaluate to a string. If both message and messageExpression are present on a rule, then messageExpression will be used if validation fails. If messageExpression results in a runtime error, the validation failure message is produced as if the messageExpression field were unset. If messageExpression evaluates to an empty string, a string with only spaces, or a string that contains line breaks, then the validation failure message will also be produced as if the messageExpression field were unset. messageExpression has access to all the same variables as the rule; the only difference is the return type. Example: \"x must be less than max (\"+string(self.max)+\")\"", + Type: []string{"string"}, + Format: "", + }, + }, + "reason": { + SchemaProps: spec.SchemaProps{ + Description: "reason provides a machine-readable validation failure reason that is returned to the caller when a request fails this validation rule. The currently supported reasons are: \"FieldValueInvalid\", \"FieldValueForbidden\", \"FieldValueRequired\", \"FieldValueDuplicate\". If not set, default to use \"FieldValueInvalid\". All future added reasons must be accepted by clients when reading this value and unknown reasons should be treated as FieldValueInvalid.", + Default: FieldValueInvalid, + Type: []string{"string"}, + Format: "", + }, + }, + "fieldPath": { + SchemaProps: spec.SchemaProps{ + Description: "fieldPath represents the field path returned when the validation fails. It must be a relative JSON path (i.e. with array notation) scoped to the location of this x-kubernetes-validations extension in the schema and refer to an existing field. e.g. when validation checks if a specific attribute `foo` under a map `testMap`, the fieldPath could be set to `.testMap.foo` If the validation checks two lists must have unique attributes, the fieldPath could be set to either of the list: e.g. `.testList` It does not support list numeric index. It supports child operation to refer to an existing field currently. Refer to [JSONPath support in Kubernetes](https://kubernetes.io/docs/reference/kubectl/jsonpath/) for more info. Numeric index of array is not supported. For field name which contains special characters, use `['specialName']` to refer the field name. e.g. for attribute `foo.34$` appears in a list `testList`, the fieldPath could be set to `.testList['foo.34$']`", + Type: []string{"string"}, + Format: "", + }, + }, + }, + Required: []string{"rule"}, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_VariableSchema(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VariableSchema defines the schema of a variable.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "openAPIV3Schema": { + SchemaProps: spec.SchemaProps{ + Description: "openAPIV3Schema defines the schema of a variable via OpenAPI v3 schema. The schema is a subset of the schema used in Kubernetes CRDs.", + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.JSONSchemaProps"), + }, + }, + }, + Required: []string{"openAPIV3Schema"}, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.JSONSchemaProps"}, + } +} + +func schema_cluster_api_api_core_v1beta2_VariableSchemaMetadata(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "VariableSchemaMetadata is the metadata of a variable or a nested field within a variable. It can be used to add additional data for higher level tools.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "labels": { + SchemaProps: spec.SchemaProps{ + Description: "labels is a map of string keys and values that can be used to organize and categorize (scope and select) variables.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + "annotations": { + SchemaProps: spec.SchemaProps{ + Description: "annotations is an unstructured key value map that can be used to store and retrieve arbitrary metadata. They are not queryable.", + Type: []string{"object"}, + AdditionalProperties: &spec.SchemaOrBool{ + Allows: true, + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: "", + Type: []string{"string"}, + Format: "", + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_WorkersClass(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "WorkersClass is a collection of deployment classes.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "machineDeployments": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "class", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "machineDeployments is a list of machine deployment classes that can be used to create a set of worker nodes.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClass"), + }, + }, + }, + }, + }, + "machinePools": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "class", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "machinePools is a list of machine pool classes that can be used to create a set of worker nodes.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolClass"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentClass", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolClass"}, + } +} + +func schema_cluster_api_api_core_v1beta2_WorkersStatus(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "WorkersStatus groups all the observations about workers current state.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "desiredReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "desiredReplicas is the total number of desired worker machines in this cluster.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "replicas": { + SchemaProps: spec.SchemaProps{ + Description: "replicas is the total number of worker machines in this cluster. NOTE: replicas also includes machines still being provisioned or being deleted.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "upToDateReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "upToDateReplicas is the number of up-to-date worker machines in this cluster. A machine is considered up-to-date when Machine's UpToDate condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "readyReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "readyReplicas is the total number of ready worker machines in this cluster. A machine is considered ready when Machine's Ready condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + "availableReplicas": { + SchemaProps: spec.SchemaProps{ + Description: "availableReplicas is the total number of available worker machines in this cluster. A machine is considered available when Machine's Available condition is true.", + Type: []string{"integer"}, + Format: "int32", + }, + }, + }, + }, + }, + } +} + +func schema_cluster_api_api_core_v1beta2_WorkersTopology(ref common.ReferenceCallback) common.OpenAPIDefinition { + return common.OpenAPIDefinition{ + Schema: spec.Schema{ + SchemaProps: spec.SchemaProps{ + Description: "WorkersTopology represents the different sets of worker nodes in the cluster.", + Type: []string{"object"}, + Properties: map[string]spec.Schema{ + "machineDeployments": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "machineDeployments is a list of machine deployments in the cluster.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopology"), + }, + }, + }, + }, + }, + "machinePools": { + VendorExtensible: spec.VendorExtensible{ + Extensions: spec.Extensions{ + "x-kubernetes-list-map-keys": []interface{}{ + "name", + }, + "x-kubernetes-list-type": "map", + }, + }, + SchemaProps: spec.SchemaProps{ + Description: "machinePools is a list of machine pools in the cluster.", + Type: []string{"array"}, + Items: &spec.SchemaOrArray{ + Schema: &spec.Schema{ + SchemaProps: spec.SchemaProps{ + Default: map[string]interface{}{}, + Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolTopology"), + }, + }, + }, + }, + }, + }, + }, + }, + Dependencies: []string{ + "sigs.k8s.io/cluster-api/api/core/v1beta2.MachineDeploymentTopology", "sigs.k8s.io/cluster-api/api/core/v1beta2.MachinePoolTopology"}, + } +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/.import-restrictions b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/.import-restrictions new file mode 100644 index 0000000000..f6f10b3ff5 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/.import-restrictions @@ -0,0 +1,5 @@ +rules: + - selectorRegexp: sigs[.]k8s[.]io/controller-runtime + allowedPrefixes: + - "sigs.k8s.io/controller-runtime/pkg/conversion" + forbiddenPrefixes: [] diff --git a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/condition_consts.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/condition_consts.go similarity index 100% rename from vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/condition_consts.go rename to vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/condition_consts.go diff --git a/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/conversion.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/conversion.go new file mode 100644 index 0000000000..3ea24dff09 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/conversion.go @@ -0,0 +1,169 @@ +/* +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" + apimachineryconversion "k8s.io/apimachinery/pkg/conversion" + "k8s.io/utils/ptr" + "sigs.k8s.io/controller-runtime/pkg/conversion" + + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" + ipamv1 "sigs.k8s.io/cluster-api/api/ipam/v1beta2" +) + +func (src *IPAddress) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*ipamv1.IPAddress) + + return Convert_v1beta1_IPAddress_To_v1beta2_IPAddress(src, dst, nil) +} + +func (dst *IPAddress) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*ipamv1.IPAddress) + + return Convert_v1beta2_IPAddress_To_v1beta1_IPAddress(src, dst, nil) +} + +func (src *IPAddressClaim) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*ipamv1.IPAddressClaim) + + return Convert_v1beta1_IPAddressClaim_To_v1beta2_IPAddressClaim(src, dst, nil) +} + +func (dst *IPAddressClaim) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*ipamv1.IPAddressClaim) + + return Convert_v1beta2_IPAddressClaim_To_v1beta1_IPAddressClaim(src, dst, nil) +} + +func Convert_v1beta2_IPAddressClaimStatus_To_v1beta1_IPAddressClaimStatus(in *ipamv1.IPAddressClaimStatus, out *IPAddressClaimStatus, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_IPAddressClaimStatus_To_v1beta1_IPAddressClaimStatus(in, out, s); err != nil { + return err + } + + // Reset conditions from autogenerated conversions + // NOTE: v1beta2 conditions should not be automatically be converted into legacy conditions (v1beta1). + out.Conditions = nil + + // Retrieve legacy conditions (v1beta1) from the deprecated field. + if in.Deprecated != nil && in.Deprecated.V1Beta1 != nil { + if in.Deprecated.V1Beta1.Conditions != nil { + clusterv1beta1.Convert_v1beta2_Deprecated_V1Beta1_Conditions_To_v1beta1_Conditions(&in.Deprecated.V1Beta1.Conditions, &out.Conditions) + } + } + + // Move new conditions (v1beta2) to the v1beta2 field. + if in.Conditions == nil { + return nil + } + out.V1Beta2 = &IPAddressClaimV1Beta2Status{} + out.V1Beta2.Conditions = in.Conditions + return nil +} + +func Convert_v1beta1_IPAddressClaimStatus_To_v1beta2_IPAddressClaimStatus(in *IPAddressClaimStatus, out *ipamv1.IPAddressClaimStatus, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_IPAddressClaimStatus_To_v1beta2_IPAddressClaimStatus(in, out, s); err != nil { + return err + } + + // Reset conditions from autogenerated conversions + // NOTE: v1beta1 conditions should not be automatically be converted into v1beta2 conditions. + out.Conditions = nil + + // Retrieve new conditions (v1beta2) from the v1beta2 field. + if in.V1Beta2 != nil { + out.Conditions = in.V1Beta2.Conditions + } + + // Move legacy conditions (v1beta1) to the deprecated field. + if in.Conditions == nil { + return nil + } + if out.Deprecated == nil { + out.Deprecated = &ipamv1.IPAddressClaimDeprecatedStatus{} + } + if out.Deprecated.V1Beta1 == nil { + out.Deprecated.V1Beta1 = &ipamv1.IPAddressClaimV1Beta1DeprecatedStatus{} + } + if in.Conditions != nil { + clusterv1beta1.Convert_v1beta1_Conditions_To_v1beta2_Deprecated_V1Beta1_Conditions(&in.Conditions, &out.Deprecated.V1Beta1.Conditions) + } + return nil +} + +func Convert_v1_TypedLocalObjectReference_To_v1beta2_IPPoolReference(in *corev1.TypedLocalObjectReference, out *ipamv1.IPPoolReference, _ apimachineryconversion.Scope) error { + out.Kind = in.Kind + out.Name = in.Name + out.APIGroup = ptr.Deref(in.APIGroup, "") + return nil +} + +func Convert_v1beta2_IPPoolReference_To_v1_TypedLocalObjectReference(in *ipamv1.IPPoolReference, out *corev1.TypedLocalObjectReference, _ apimachineryconversion.Scope) error { + out.Kind = in.Kind + out.Name = in.Name + if in.APIGroup != "" { + out.APIGroup = ptr.To(in.APIGroup) + } + return nil +} + +func Convert_v1_LocalObjectReference_To_v1beta2_IPAddressReference(in *corev1.LocalObjectReference, out *ipamv1.IPAddressReference, _ apimachineryconversion.Scope) error { + out.Name = in.Name + return nil +} + +func Convert_v1beta2_IPAddressReference_To_v1_LocalObjectReference(in *ipamv1.IPAddressReference, out *corev1.LocalObjectReference, _ apimachineryconversion.Scope) error { + out.Name = in.Name + return nil +} + +func Convert_v1_LocalObjectReference_To_v1beta2_IPAddressClaimReference(in *corev1.LocalObjectReference, out *ipamv1.IPAddressClaimReference, _ apimachineryconversion.Scope) error { + out.Name = in.Name + return nil +} + +func Convert_v1beta2_IPAddressClaimReference_To_v1_LocalObjectReference(in *ipamv1.IPAddressClaimReference, out *corev1.LocalObjectReference, _ apimachineryconversion.Scope) error { + out.Name = in.Name + return nil +} + +func Convert_v1beta1_IPAddressSpec_To_v1beta2_IPAddressSpec(in *IPAddressSpec, out *ipamv1.IPAddressSpec, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta1_IPAddressSpec_To_v1beta2_IPAddressSpec(in, out, s); err != nil { + return err + } + out.Prefix = ptr.To(int32(in.Prefix)) + return nil +} + +func Convert_v1beta2_IPAddressSpec_To_v1beta1_IPAddressSpec(in *ipamv1.IPAddressSpec, out *IPAddressSpec, s apimachineryconversion.Scope) error { + if err := autoConvert_v1beta2_IPAddressSpec_To_v1beta1_IPAddressSpec(in, out, s); err != nil { + return err + } + out.Prefix = int(ptr.Deref(in.Prefix, 0)) + return nil +} + +// Implement local conversion func because conversion-gen is not aware of conversion func in other packages (see https://github.com/kubernetes/code-generator/issues/94) + +func Convert_v1_Condition_To_v1beta1_Condition(in *metav1.Condition, out *clusterv1beta1.Condition, s apimachineryconversion.Scope) error { + return clusterv1beta1.Convert_v1_Condition_To_v1beta1_Condition(in, out, s) +} + +func Convert_v1beta1_Condition_To_v1_Condition(in *clusterv1beta1.Condition, out *metav1.Condition, s apimachineryconversion.Scope) error { + return clusterv1beta1.Convert_v1beta1_Condition_To_v1_Condition(in, out, s) +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/doc.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/doc.go new file mode 100644 index 0000000000..acfb16f1e9 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/doc.go @@ -0,0 +1,23 @@ +/* +Copyright 2022 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 v1beta1 IPAM API. +// +k8s:conversion-gen=sigs.k8s.io/cluster-api/api/ipam/v1beta2 +// +kubebuilder:object:generate=true +// +groupName=ipam.cluster.x-k8s.io +// +// Deprecated: This package is deprecated and is going to be removed when support for v1beta1 will be dropped. +package v1beta1 diff --git a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/groupversion_info.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/groupversion_info.go similarity index 93% rename from vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/groupversion_info.go rename to vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/groupversion_info.go index e01b1ad461..6c4c4451dd 100644 --- a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/groupversion_info.go +++ b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/groupversion_info.go @@ -14,9 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +kubebuilder:object:generate=true -// +groupName=ipam.cluster.x-k8s.io - package v1beta1 import ( @@ -35,6 +32,9 @@ var ( // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = schemeBuilder.AddToScheme + // localSchemeBuilder is used for type conversions. + localSchemeBuilder = &schemeBuilder + objectTypes = []runtime.Object{} ) diff --git a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/ipaddress_types.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/ipaddress_types.go similarity index 98% rename from vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/ipaddress_types.go rename to vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/ipaddress_types.go index 8410bf08f7..7cf6a49c86 100644 --- a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/ipaddress_types.go +++ b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/ipaddress_types.go @@ -50,7 +50,7 @@ type IPAddressSpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=ipaddresses,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion +// +kubebuilder:deprecatedversion // +kubebuilder:printcolumn:name="Address",type="string",JSONPath=".spec.address",description="Address" // +kubebuilder:printcolumn:name="Pool Name",type="string",JSONPath=".spec.poolRef.name",description="Name of the pool the address is from" // +kubebuilder:printcolumn:name="Pool Kind",type="string",JSONPath=".spec.poolRef.kind",description="Kind of the pool the address is from" diff --git a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/ipaddressclaim_types.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/ipaddressclaim_types.go similarity index 93% rename from vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/ipaddressclaim_types.go rename to vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/ipaddressclaim_types.go index 635df232c6..8a6a44a2e6 100644 --- a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/ipaddressclaim_types.go +++ b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/ipaddressclaim_types.go @@ -20,7 +20,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" ) // IPAddressClaimSpec is the desired state of an IPAddressClaim. @@ -44,7 +44,7 @@ type IPAddressClaimStatus struct { // conditions summarises the current state of the IPAddressClaim // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1beta1.Conditions `json:"conditions,omitempty"` // v1beta2 groups all the fields that will be added or modified in IPAddressClaim's status with the V1Beta2 version. // +optional @@ -65,7 +65,7 @@ type IPAddressClaimV1Beta2Status struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=ipaddressclaims,scope=Namespaced,categories=cluster-api // +kubebuilder:subresource:status -// +kubebuilder:storageversion +// +kubebuilder:deprecatedversion // +kubebuilder:printcolumn:name="Pool Name",type="string",JSONPath=".spec.poolRef.name",description="Name of the pool to allocate an address from" // +kubebuilder:printcolumn:name="Pool Kind",type="string",JSONPath=".spec.poolRef.kind",description="Kind of the pool to allocate an address from" // +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of IPAdressClaim" @@ -87,12 +87,12 @@ type IPAddressClaim struct { } // GetConditions returns the set of conditions for this object. -func (m *IPAddressClaim) GetConditions() clusterv1.Conditions { +func (m *IPAddressClaim) GetConditions() clusterv1beta1.Conditions { return m.Status.Conditions } // SetConditions sets the conditions on this object. -func (m *IPAddressClaim) SetConditions(conditions clusterv1.Conditions) { +func (m *IPAddressClaim) SetConditions(conditions clusterv1beta1.Conditions) { m.Status.Conditions = conditions } diff --git a/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/zz_generated.conversion.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/zz_generated.conversion.go new file mode 100644 index 0000000000..c777ace2be --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/zz_generated.conversion.go @@ -0,0 +1,383 @@ +//go:build !ignore_autogenerated +// +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 v1beta1 + +import ( + corev1 "k8s.io/api/core/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" + corev1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" + v1beta2 "sigs.k8s.io/cluster-api/api/ipam/v1beta2" +) + +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((*IPAddress)(nil), (*v1beta2.IPAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_IPAddress_To_v1beta2_IPAddress(a.(*IPAddress), b.(*v1beta2.IPAddress), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.IPAddress)(nil), (*IPAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_IPAddress_To_v1beta1_IPAddress(a.(*v1beta2.IPAddress), b.(*IPAddress), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*IPAddressClaim)(nil), (*v1beta2.IPAddressClaim)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_IPAddressClaim_To_v1beta2_IPAddressClaim(a.(*IPAddressClaim), b.(*v1beta2.IPAddressClaim), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.IPAddressClaim)(nil), (*IPAddressClaim)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_IPAddressClaim_To_v1beta1_IPAddressClaim(a.(*v1beta2.IPAddressClaim), b.(*IPAddressClaim), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*IPAddressClaimList)(nil), (*v1beta2.IPAddressClaimList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_IPAddressClaimList_To_v1beta2_IPAddressClaimList(a.(*IPAddressClaimList), b.(*v1beta2.IPAddressClaimList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.IPAddressClaimList)(nil), (*IPAddressClaimList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_IPAddressClaimList_To_v1beta1_IPAddressClaimList(a.(*v1beta2.IPAddressClaimList), b.(*IPAddressClaimList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*IPAddressClaimSpec)(nil), (*v1beta2.IPAddressClaimSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_IPAddressClaimSpec_To_v1beta2_IPAddressClaimSpec(a.(*IPAddressClaimSpec), b.(*v1beta2.IPAddressClaimSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.IPAddressClaimSpec)(nil), (*IPAddressClaimSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_IPAddressClaimSpec_To_v1beta1_IPAddressClaimSpec(a.(*v1beta2.IPAddressClaimSpec), b.(*IPAddressClaimSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*IPAddressList)(nil), (*v1beta2.IPAddressList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_IPAddressList_To_v1beta2_IPAddressList(a.(*IPAddressList), b.(*v1beta2.IPAddressList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta2.IPAddressList)(nil), (*IPAddressList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_IPAddressList_To_v1beta1_IPAddressList(a.(*v1beta2.IPAddressList), b.(*IPAddressList), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1.Condition)(nil), (*corev1beta1.Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_Condition_To_v1beta1_Condition(a.(*v1.Condition), b.(*corev1beta1.Condition), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*corev1.LocalObjectReference)(nil), (*v1beta2.IPAddressClaimReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_LocalObjectReference_To_v1beta2_IPAddressClaimReference(a.(*corev1.LocalObjectReference), b.(*v1beta2.IPAddressClaimReference), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*corev1.LocalObjectReference)(nil), (*v1beta2.IPAddressReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_LocalObjectReference_To_v1beta2_IPAddressReference(a.(*corev1.LocalObjectReference), b.(*v1beta2.IPAddressReference), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*corev1.TypedLocalObjectReference)(nil), (*v1beta2.IPPoolReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1_TypedLocalObjectReference_To_v1beta2_IPPoolReference(a.(*corev1.TypedLocalObjectReference), b.(*v1beta2.IPPoolReference), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*corev1beta1.Condition)(nil), (*v1.Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Condition_To_v1_Condition(a.(*corev1beta1.Condition), b.(*v1.Condition), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*IPAddressClaimStatus)(nil), (*v1beta2.IPAddressClaimStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_IPAddressClaimStatus_To_v1beta2_IPAddressClaimStatus(a.(*IPAddressClaimStatus), b.(*v1beta2.IPAddressClaimStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*IPAddressSpec)(nil), (*v1beta2.IPAddressSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_IPAddressSpec_To_v1beta2_IPAddressSpec(a.(*IPAddressSpec), b.(*v1beta2.IPAddressSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.IPAddressClaimReference)(nil), (*corev1.LocalObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_IPAddressClaimReference_To_v1_LocalObjectReference(a.(*v1beta2.IPAddressClaimReference), b.(*corev1.LocalObjectReference), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.IPAddressClaimStatus)(nil), (*IPAddressClaimStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_IPAddressClaimStatus_To_v1beta1_IPAddressClaimStatus(a.(*v1beta2.IPAddressClaimStatus), b.(*IPAddressClaimStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.IPAddressReference)(nil), (*corev1.LocalObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_IPAddressReference_To_v1_LocalObjectReference(a.(*v1beta2.IPAddressReference), b.(*corev1.LocalObjectReference), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.IPAddressSpec)(nil), (*IPAddressSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_IPAddressSpec_To_v1beta1_IPAddressSpec(a.(*v1beta2.IPAddressSpec), b.(*IPAddressSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta2.IPPoolReference)(nil), (*corev1.TypedLocalObjectReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta2_IPPoolReference_To_v1_TypedLocalObjectReference(a.(*v1beta2.IPPoolReference), b.(*corev1.TypedLocalObjectReference), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1beta1_IPAddress_To_v1beta2_IPAddress(in *IPAddress, out *v1beta2.IPAddress, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_IPAddressSpec_To_v1beta2_IPAddressSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_IPAddress_To_v1beta2_IPAddress is an autogenerated conversion function. +func Convert_v1beta1_IPAddress_To_v1beta2_IPAddress(in *IPAddress, out *v1beta2.IPAddress, s conversion.Scope) error { + return autoConvert_v1beta1_IPAddress_To_v1beta2_IPAddress(in, out, s) +} + +func autoConvert_v1beta2_IPAddress_To_v1beta1_IPAddress(in *v1beta2.IPAddress, out *IPAddress, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta2_IPAddressSpec_To_v1beta1_IPAddressSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_IPAddress_To_v1beta1_IPAddress is an autogenerated conversion function. +func Convert_v1beta2_IPAddress_To_v1beta1_IPAddress(in *v1beta2.IPAddress, out *IPAddress, s conversion.Scope) error { + return autoConvert_v1beta2_IPAddress_To_v1beta1_IPAddress(in, out, s) +} + +func autoConvert_v1beta1_IPAddressClaim_To_v1beta2_IPAddressClaim(in *IPAddressClaim, out *v1beta2.IPAddressClaim, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_IPAddressClaimSpec_To_v1beta2_IPAddressClaimSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_IPAddressClaimStatus_To_v1beta2_IPAddressClaimStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_IPAddressClaim_To_v1beta2_IPAddressClaim is an autogenerated conversion function. +func Convert_v1beta1_IPAddressClaim_To_v1beta2_IPAddressClaim(in *IPAddressClaim, out *v1beta2.IPAddressClaim, s conversion.Scope) error { + return autoConvert_v1beta1_IPAddressClaim_To_v1beta2_IPAddressClaim(in, out, s) +} + +func autoConvert_v1beta2_IPAddressClaim_To_v1beta1_IPAddressClaim(in *v1beta2.IPAddressClaim, out *IPAddressClaim, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta2_IPAddressClaimSpec_To_v1beta1_IPAddressClaimSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta2_IPAddressClaimStatus_To_v1beta1_IPAddressClaimStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_IPAddressClaim_To_v1beta1_IPAddressClaim is an autogenerated conversion function. +func Convert_v1beta2_IPAddressClaim_To_v1beta1_IPAddressClaim(in *v1beta2.IPAddressClaim, out *IPAddressClaim, s conversion.Scope) error { + return autoConvert_v1beta2_IPAddressClaim_To_v1beta1_IPAddressClaim(in, out, s) +} + +func autoConvert_v1beta1_IPAddressClaimList_To_v1beta2_IPAddressClaimList(in *IPAddressClaimList, out *v1beta2.IPAddressClaimList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta2.IPAddressClaim, len(*in)) + for i := range *in { + if err := Convert_v1beta1_IPAddressClaim_To_v1beta2_IPAddressClaim(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_IPAddressClaimList_To_v1beta2_IPAddressClaimList is an autogenerated conversion function. +func Convert_v1beta1_IPAddressClaimList_To_v1beta2_IPAddressClaimList(in *IPAddressClaimList, out *v1beta2.IPAddressClaimList, s conversion.Scope) error { + return autoConvert_v1beta1_IPAddressClaimList_To_v1beta2_IPAddressClaimList(in, out, s) +} + +func autoConvert_v1beta2_IPAddressClaimList_To_v1beta1_IPAddressClaimList(in *v1beta2.IPAddressClaimList, out *IPAddressClaimList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IPAddressClaim, len(*in)) + for i := range *in { + if err := Convert_v1beta2_IPAddressClaim_To_v1beta1_IPAddressClaim(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta2_IPAddressClaimList_To_v1beta1_IPAddressClaimList is an autogenerated conversion function. +func Convert_v1beta2_IPAddressClaimList_To_v1beta1_IPAddressClaimList(in *v1beta2.IPAddressClaimList, out *IPAddressClaimList, s conversion.Scope) error { + return autoConvert_v1beta2_IPAddressClaimList_To_v1beta1_IPAddressClaimList(in, out, s) +} + +func autoConvert_v1beta1_IPAddressClaimSpec_To_v1beta2_IPAddressClaimSpec(in *IPAddressClaimSpec, out *v1beta2.IPAddressClaimSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + if err := Convert_v1_TypedLocalObjectReference_To_v1beta2_IPPoolReference(&in.PoolRef, &out.PoolRef, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_IPAddressClaimSpec_To_v1beta2_IPAddressClaimSpec is an autogenerated conversion function. +func Convert_v1beta1_IPAddressClaimSpec_To_v1beta2_IPAddressClaimSpec(in *IPAddressClaimSpec, out *v1beta2.IPAddressClaimSpec, s conversion.Scope) error { + return autoConvert_v1beta1_IPAddressClaimSpec_To_v1beta2_IPAddressClaimSpec(in, out, s) +} + +func autoConvert_v1beta2_IPAddressClaimSpec_To_v1beta1_IPAddressClaimSpec(in *v1beta2.IPAddressClaimSpec, out *IPAddressClaimSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + if err := Convert_v1beta2_IPPoolReference_To_v1_TypedLocalObjectReference(&in.PoolRef, &out.PoolRef, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta2_IPAddressClaimSpec_To_v1beta1_IPAddressClaimSpec is an autogenerated conversion function. +func Convert_v1beta2_IPAddressClaimSpec_To_v1beta1_IPAddressClaimSpec(in *v1beta2.IPAddressClaimSpec, out *IPAddressClaimSpec, s conversion.Scope) error { + return autoConvert_v1beta2_IPAddressClaimSpec_To_v1beta1_IPAddressClaimSpec(in, out, s) +} + +func autoConvert_v1beta1_IPAddressClaimStatus_To_v1beta2_IPAddressClaimStatus(in *IPAddressClaimStatus, out *v1beta2.IPAddressClaimStatus, s conversion.Scope) error { + if err := Convert_v1_LocalObjectReference_To_v1beta2_IPAddressReference(&in.AddressRef, &out.AddressRef, s); err != nil { + return err + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + if err := Convert_v1beta1_Condition_To_v1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + // WARNING: in.V1Beta2 requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta2_IPAddressClaimStatus_To_v1beta1_IPAddressClaimStatus(in *v1beta2.IPAddressClaimStatus, out *IPAddressClaimStatus, s conversion.Scope) error { + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(corev1beta1.Conditions, len(*in)) + for i := range *in { + if err := Convert_v1_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + if err := Convert_v1beta2_IPAddressReference_To_v1_LocalObjectReference(&in.AddressRef, &out.AddressRef, s); err != nil { + return err + } + // WARNING: in.Deprecated requires manual conversion: does not exist in peer-type + return nil +} + +func autoConvert_v1beta1_IPAddressList_To_v1beta2_IPAddressList(in *IPAddressList, out *v1beta2.IPAddressList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta2.IPAddress, len(*in)) + for i := range *in { + if err := Convert_v1beta1_IPAddress_To_v1beta2_IPAddress(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_IPAddressList_To_v1beta2_IPAddressList is an autogenerated conversion function. +func Convert_v1beta1_IPAddressList_To_v1beta2_IPAddressList(in *IPAddressList, out *v1beta2.IPAddressList, s conversion.Scope) error { + return autoConvert_v1beta1_IPAddressList_To_v1beta2_IPAddressList(in, out, s) +} + +func autoConvert_v1beta2_IPAddressList_To_v1beta1_IPAddressList(in *v1beta2.IPAddressList, out *IPAddressList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IPAddress, len(*in)) + for i := range *in { + if err := Convert_v1beta2_IPAddress_To_v1beta1_IPAddress(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta2_IPAddressList_To_v1beta1_IPAddressList is an autogenerated conversion function. +func Convert_v1beta2_IPAddressList_To_v1beta1_IPAddressList(in *v1beta2.IPAddressList, out *IPAddressList, s conversion.Scope) error { + return autoConvert_v1beta2_IPAddressList_To_v1beta1_IPAddressList(in, out, s) +} + +func autoConvert_v1beta1_IPAddressSpec_To_v1beta2_IPAddressSpec(in *IPAddressSpec, out *v1beta2.IPAddressSpec, s conversion.Scope) error { + if err := Convert_v1_LocalObjectReference_To_v1beta2_IPAddressClaimReference(&in.ClaimRef, &out.ClaimRef, s); err != nil { + return err + } + if err := Convert_v1_TypedLocalObjectReference_To_v1beta2_IPPoolReference(&in.PoolRef, &out.PoolRef, s); err != nil { + return err + } + out.Address = in.Address + // WARNING: in.Prefix requires manual conversion: inconvertible types (int vs *int32) + out.Gateway = in.Gateway + return nil +} + +func autoConvert_v1beta2_IPAddressSpec_To_v1beta1_IPAddressSpec(in *v1beta2.IPAddressSpec, out *IPAddressSpec, s conversion.Scope) error { + if err := Convert_v1beta2_IPAddressClaimReference_To_v1_LocalObjectReference(&in.ClaimRef, &out.ClaimRef, s); err != nil { + return err + } + if err := Convert_v1beta2_IPPoolReference_To_v1_TypedLocalObjectReference(&in.PoolRef, &out.PoolRef, s); err != nil { + return err + } + out.Address = in.Address + // WARNING: in.Prefix requires manual conversion: inconvertible types (*int32 vs int) + out.Gateway = in.Gateway + return nil +} diff --git a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/zz_generated.deepcopy.go similarity index 98% rename from vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/zz_generated.deepcopy.go rename to vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/zz_generated.deepcopy.go index 338a238c26..a4f0ecf51a 100644 --- a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/zz_generated.deepcopy.go +++ b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/zz_generated.deepcopy.go @@ -23,7 +23,7 @@ package v1beta1 import ( "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" + corev1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -133,7 +133,7 @@ func (in *IPAddressClaimStatus) DeepCopyInto(out *IPAddressClaimStatus) { out.AddressRef = in.AddressRef if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions - *out = make(apiv1beta1.Conditions, len(*in)) + *out = make(corev1beta1.Conditions, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } diff --git a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/doc.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/conversion.go similarity index 80% rename from vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/doc.go rename to vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/conversion.go index 81c65d7f34..c743eabcec 100644 --- a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/doc.go +++ b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/conversion.go @@ -1,5 +1,5 @@ /* -Copyright 2022 The Kubernetes Authors. +Copyright 2025 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,5 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package v1beta1 contains API Schema definitions for the v1beta1 IPAM API. -package v1beta1 +package v1beta2 + +func (*IPAddress) Hub() {} +func (*IPAddressClaim) Hub() {} diff --git a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/conversion.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/doc.go similarity index 72% rename from vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/conversion.go rename to vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/doc.go index 64f6e9d8d8..714e2eeb9b 100644 --- a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/conversion.go +++ b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Kubernetes Authors. +Copyright 2025 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,9 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1beta1 - -func (*IPAddress) Hub() {} -func (*IPAddressList) Hub() {} -func (*IPAddressClaim) Hub() {} -func (*IPAddressClaimList) Hub() {} +// Package v1beta2 contains API Schema definitions for the v1beta2 IPAM API. +// +kubebuilder:object:generate=true +// +groupName=ipam.cluster.x-k8s.io +package v1beta2 diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/groupversion_info.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/groupversion_info.go similarity index 80% rename from vendor/sigs.k8s.io/cluster-api/api/v1beta1/groupversion_info.go rename to vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/groupversion_info.go index 95968743c6..d477a32300 100644 --- a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/groupversion_info.go +++ b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/groupversion_info.go @@ -1,5 +1,5 @@ /* -Copyright 2021 The Kubernetes Authors. +Copyright 2025 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,10 +14,7 @@ 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 +package v1beta2 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -27,7 +24,7 @@ import ( var ( // GroupVersion is group version used to register these objects. - GroupVersion = schema.GroupVersion{Group: "cluster.x-k8s.io", Version: "v1beta1"} + GroupVersion = schema.GroupVersion{Group: "ipam.cluster.x-k8s.io", Version: "v1beta2"} // schemeBuilder is used to add go types to the GroupVersionKind scheme. schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) diff --git a/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/ipaddress_types.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/ipaddress_types.go new file mode 100644 index 0000000000..5d88adea68 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/ipaddress_types.go @@ -0,0 +1,126 @@ +/* +Copyright 2025 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 v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// IPAddressSpec is the desired state of an IPAddress. +type IPAddressSpec struct { + // claimRef is a reference to the claim this IPAddress was created for. + // +required + ClaimRef IPAddressClaimReference `json:"claimRef,omitempty,omitzero"` + + // poolRef is a reference to the pool that this IPAddress was created from. + // +required + PoolRef IPPoolReference `json:"poolRef,omitempty,omitzero"` + + // address is the IP address. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=39 + Address string `json:"address,omitempty"` + + // prefix is the prefix of the address. + // +required + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=128 + Prefix *int32 `json:"prefix,omitempty"` + + // gateway is the network gateway of the network the address is from. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=39 + Gateway string `json:"gateway,omitempty"` +} + +// IPAddressClaimReference is a reference to an IPAddressClaim. +type IPAddressClaimReference struct { + // name of the IPAddressClaim. + // name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$` + Name string `json:"name,omitempty"` +} + +// IPPoolReference is a reference to an IPPool. +type IPPoolReference struct { + // name of the IPPool. + // name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$` + Name string `json:"name,omitempty"` + + // kind of the IPPool. + // kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + // +kubebuilder:validation:Pattern=`^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$` + Kind string `json:"kind,omitempty"` + + // apiGroup of the IPPool. + // apiGroup must be fully qualified domain name. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$` + APIGroup string `json:"apiGroup,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=ipaddresses,scope=Namespaced,categories=cluster-api +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Address",type="string",JSONPath=".spec.address",description="Address" +// +kubebuilder:printcolumn:name="Pool Name",type="string",JSONPath=".spec.poolRef.name",description="Name of the pool the address is from" +// +kubebuilder:printcolumn:name="Pool Kind",type="string",JSONPath=".spec.poolRef.kind",description="Kind of the pool the address is from" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of IPAdress" + +// IPAddress is the Schema for the ipaddress API. +type IPAddress struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec is the desired state of IPAddress. + // +required + Spec IPAddressSpec `json:"spec,omitempty,omitzero"` +} + +// +kubebuilder:object:root=true + +// IPAddressList is a list of IPAddress. +type IPAddressList struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + // items is the list of IPAddresses. + Items []IPAddress `json:"items"` +} + +func init() { + objectTypes = append(objectTypes, &IPAddress{}, &IPAddressList{}) +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/ipaddressclaim_types.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/ipaddressclaim_types.go new file mode 100644 index 0000000000..c702770b07 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/ipaddressclaim_types.go @@ -0,0 +1,174 @@ +/* +Copyright 2025 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 v1beta2 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// IPAddressClaim's Ready condition and corresponding reasons. +const ( + // IPAddressClaimReadyCondition is true if the IPAddressClaim allocation succeeded. + IPAddressClaimReadyCondition = clusterv1.ReadyCondition + + // IPAddressClaimReadyAllocationFailedReason is the reason used when allocating an IP address for a claim fails. + // More details should be provided in the condition's message. + // When the IP pool is full, [PoolExhaustedReason] should be used for better visibility instead. + IPAddressClaimReadyAllocationFailedReason = "AllocationFailed" + + // IPAddressClaimReadyPoolNotReadyReason is the reason used when the referenced IP pool is not ready. + IPAddressClaimReadyPoolNotReadyReason = "PoolNotReady" + + // IPAddressClaimReadyPoolExhaustedReason is the reason used when an IP pool referenced by an [IPAddressClaim] is full and no address + // can be allocated for the claim. + IPAddressClaimReadyPoolExhaustedReason = "PoolExhausted" +) + +// IPAddressClaimSpec is the desired state of an IPAddressClaim. +type IPAddressClaimSpec struct { + // clusterName is the name of the Cluster this object belongs to. + // +optional + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=63 + ClusterName string `json:"clusterName,omitempty"` + + // poolRef is a reference to the pool from which an IP address should be created. + // +required + PoolRef IPPoolReference `json:"poolRef,omitempty,omitzero"` +} + +// IPAddressClaimStatus is the observed status of a IPAddressClaim. +// +kubebuilder:validation:MinProperties=1 +type IPAddressClaimStatus struct { + // conditions represents the observations of a IPAddressClaim's current state. + // Known condition types are Ready. + // +optional + // +listType=map + // +listMapKey=type + // +kubebuilder:validation:MaxItems=32 + Conditions []metav1.Condition `json:"conditions,omitempty"` + + // addressRef is a reference to the address that was created for this claim. + // +optional + AddressRef IPAddressReference `json:"addressRef,omitempty,omitzero"` + + // deprecated groups all the status fields that are deprecated and will be removed when all the nested field are removed. + // +optional + Deprecated *IPAddressClaimDeprecatedStatus `json:"deprecated,omitempty"` +} + +// IPAddressReference is a reference to an IPAddress. +type IPAddressReference struct { + // name of the IPAddress. + // name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character. + // +required + // +kubebuilder:validation:MinLength=1 + // +kubebuilder:validation:MaxLength=253 + // +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$` + Name string `json:"name,omitempty"` +} + +// IPAddressClaimDeprecatedStatus groups all the status fields that are deprecated and will be removed in a future version. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type IPAddressClaimDeprecatedStatus struct { + // v1beta1 groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. + // +optional + V1Beta1 *IPAddressClaimV1Beta1DeprecatedStatus `json:"v1beta1,omitempty"` +} + +// IPAddressClaimV1Beta1DeprecatedStatus groups all the status fields that are deprecated and will be removed when support for v1beta1 will be dropped. +// See https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more context. +type IPAddressClaimV1Beta1DeprecatedStatus struct { + // conditions summarises the current state of the IPAddressClaim + // + // Deprecated: This field is deprecated and is going to be removed when support for v1beta1 will be dropped. Please see https://github.com/kubernetes-sigs/cluster-api/blob/main/docs/proposals/20240916-improve-status-in-CAPI-resources.md for more details. + // + // +optional + Conditions clusterv1.Conditions `json:"conditions,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=ipaddressclaims,scope=Namespaced,categories=cluster-api +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:printcolumn:name="Pool Name",type="string",JSONPath=".spec.poolRef.name",description="Name of the pool to allocate an address from" +// +kubebuilder:printcolumn:name="Pool Kind",type="string",JSONPath=".spec.poolRef.kind",description="Kind of the pool to allocate an address from" +// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of IPAdressClaim" + +// IPAddressClaim is the Schema for the ipaddressclaim API. +type IPAddressClaim struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + metav1.ObjectMeta `json:"metadata,omitempty"` + + // spec is the desired state of IPAddressClaim. + // +required + Spec IPAddressClaimSpec `json:"spec,omitempty,omitzero"` + // status is the observed state of IPAddressClaim. + // +optional + Status IPAddressClaimStatus `json:"status,omitempty,omitzero"` +} + +// GetV1Beta1Conditions returns the set of conditions for this object. +func (m *IPAddressClaim) GetV1Beta1Conditions() clusterv1.Conditions { + if m.Status.Deprecated == nil || m.Status.Deprecated.V1Beta1 == nil { + return nil + } + return m.Status.Deprecated.V1Beta1.Conditions +} + +// SetV1Beta1Conditions sets the conditions on this object. +func (m *IPAddressClaim) SetV1Beta1Conditions(conditions clusterv1.Conditions) { + if m.Status.Deprecated == nil { + m.Status.Deprecated = &IPAddressClaimDeprecatedStatus{} + } + if m.Status.Deprecated.V1Beta1 == nil { + m.Status.Deprecated.V1Beta1 = &IPAddressClaimV1Beta1DeprecatedStatus{} + } + m.Status.Deprecated.V1Beta1.Conditions = conditions +} + +// GetConditions returns the set of conditions for this object. +func (m *IPAddressClaim) GetConditions() []metav1.Condition { + return m.Status.Conditions +} + +// SetConditions sets conditions for an API object. +func (m *IPAddressClaim) SetConditions(conditions []metav1.Condition) { + m.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// IPAddressClaimList is a list of IPAddressClaims. +type IPAddressClaimList struct { + metav1.TypeMeta `json:",inline"` + // metadata is the standard list's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#lists-and-simple-kinds + // +optional + metav1.ListMeta `json:"metadata,omitempty"` + // items is the list of IPAddressClaims. + Items []IPAddressClaim `json:"items"` +} + +func init() { + objectTypes = append(objectTypes, &IPAddressClaim{}, &IPAddressClaimList{}) +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/v1beta1_condition_consts.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/v1beta1_condition_consts.go new file mode 100644 index 0000000000..d915330a31 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/v1beta1_condition_consts.go @@ -0,0 +1,32 @@ +/* +Copyright 2025 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 v1beta2 + +// These reasons are intended to be used with failed Ready conditions on an [IPAddressClaim]. +const ( + // AllocationFailedV1Beta1Reason is the reason used when allocating an IP address for a claim fails. More details should be + // provided in the condition's message. + // When the IP pool is full, [PoolExhaustedReason] should be used for better visibility instead. + AllocationFailedV1Beta1Reason = "AllocationFailed" + + // PoolNotReadyV1Beta1Reason is the reason used when the referenced IP pool is not ready. + PoolNotReadyV1Beta1Reason = "PoolNotReady" + + // PoolExhaustedV1Beta1Reason is the reason used when an IP pool referenced by an [IPAddressClaim] is full and no address + // can be allocated for the claim. + PoolExhaustedV1Beta1Reason = "PoolExhausted" +) diff --git a/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/zz_generated.deepcopy.go new file mode 100644 index 0000000000..721f13a61b --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta2/zz_generated.deepcopy.go @@ -0,0 +1,297 @@ +//go: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 v1beta2 + +import ( + "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + corev1beta2 "sigs.k8s.io/cluster-api/api/core/v1beta2" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPAddress) DeepCopyInto(out *IPAddress) { + *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 IPAddress. +func (in *IPAddress) DeepCopy() *IPAddress { + if in == nil { + return nil + } + out := new(IPAddress) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IPAddress) 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 *IPAddressClaim) DeepCopyInto(out *IPAddressClaim) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + out.Spec = in.Spec + in.Status.DeepCopyInto(&out.Status) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressClaim. +func (in *IPAddressClaim) DeepCopy() *IPAddressClaim { + if in == nil { + return nil + } + out := new(IPAddressClaim) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IPAddressClaim) 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 *IPAddressClaimDeprecatedStatus) DeepCopyInto(out *IPAddressClaimDeprecatedStatus) { + *out = *in + if in.V1Beta1 != nil { + in, out := &in.V1Beta1, &out.V1Beta1 + *out = new(IPAddressClaimV1Beta1DeprecatedStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressClaimDeprecatedStatus. +func (in *IPAddressClaimDeprecatedStatus) DeepCopy() *IPAddressClaimDeprecatedStatus { + if in == nil { + return nil + } + out := new(IPAddressClaimDeprecatedStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPAddressClaimList) DeepCopyInto(out *IPAddressClaimList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IPAddressClaim, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressClaimList. +func (in *IPAddressClaimList) DeepCopy() *IPAddressClaimList { + if in == nil { + return nil + } + out := new(IPAddressClaimList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IPAddressClaimList) 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 *IPAddressClaimReference) DeepCopyInto(out *IPAddressClaimReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressClaimReference. +func (in *IPAddressClaimReference) DeepCopy() *IPAddressClaimReference { + if in == nil { + return nil + } + out := new(IPAddressClaimReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPAddressClaimSpec) DeepCopyInto(out *IPAddressClaimSpec) { + *out = *in + out.PoolRef = in.PoolRef +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressClaimSpec. +func (in *IPAddressClaimSpec) DeepCopy() *IPAddressClaimSpec { + if in == nil { + return nil + } + out := new(IPAddressClaimSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPAddressClaimStatus) DeepCopyInto(out *IPAddressClaimStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]v1.Condition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + out.AddressRef = in.AddressRef + if in.Deprecated != nil { + in, out := &in.Deprecated, &out.Deprecated + *out = new(IPAddressClaimDeprecatedStatus) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressClaimStatus. +func (in *IPAddressClaimStatus) DeepCopy() *IPAddressClaimStatus { + if in == nil { + return nil + } + out := new(IPAddressClaimStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPAddressClaimV1Beta1DeprecatedStatus) DeepCopyInto(out *IPAddressClaimV1Beta1DeprecatedStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(corev1beta2.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressClaimV1Beta1DeprecatedStatus. +func (in *IPAddressClaimV1Beta1DeprecatedStatus) DeepCopy() *IPAddressClaimV1Beta1DeprecatedStatus { + if in == nil { + return nil + } + out := new(IPAddressClaimV1Beta1DeprecatedStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPAddressList) DeepCopyInto(out *IPAddressList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]IPAddress, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressList. +func (in *IPAddressList) DeepCopy() *IPAddressList { + if in == nil { + return nil + } + out := new(IPAddressList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *IPAddressList) 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 *IPAddressReference) DeepCopyInto(out *IPAddressReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressReference. +func (in *IPAddressReference) DeepCopy() *IPAddressReference { + if in == nil { + return nil + } + out := new(IPAddressReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPAddressSpec) DeepCopyInto(out *IPAddressSpec) { + *out = *in + out.ClaimRef = in.ClaimRef + out.PoolRef = in.PoolRef + if in.Prefix != nil { + in, out := &in.Prefix, &out.Prefix + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressSpec. +func (in *IPAddressSpec) DeepCopy() *IPAddressSpec { + if in == nil { + return nil + } + out := new(IPAddressSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IPPoolReference) DeepCopyInto(out *IPPoolReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPPoolReference. +func (in *IPPoolReference) DeepCopy() *IPPoolReference { + if in == nil { + return nil + } + out := new(IPPoolReference) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/.import-restrictions b/vendor/sigs.k8s.io/cluster-api/api/v1beta1/.import-restrictions deleted file mode 100644 index a2e1dfd081..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/v1beta1/.import-restrictions +++ /dev/null @@ -1,5 +0,0 @@ -rules: - - selectorRegexp: sigs[.]k8s[.]io/controller-runtime - allowedPrefixes: [] - forbiddenPrefixes: - - "sigs.k8s.io/controller-runtime" diff --git a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/.import-restrictions b/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/.import-restrictions deleted file mode 100644 index a2e1dfd081..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1/.import-restrictions +++ /dev/null @@ -1,5 +0,0 @@ -rules: - - selectorRegexp: sigs[.]k8s[.]io/controller-runtime - allowedPrefixes: [] - forbiddenPrefixes: - - "sigs.k8s.io/controller-runtime" diff --git a/vendor/sigs.k8s.io/cluster-api/util/conversion/conversion.go b/vendor/sigs.k8s.io/cluster-api/util/conversion/conversion.go new file mode 100644 index 0000000000..916d77c1f5 --- /dev/null +++ b/vendor/sigs.k8s.io/cluster-api/util/conversion/conversion.go @@ -0,0 +1,218 @@ +/* +Copyright 2019 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 conversion implements conversion utilities. +package conversion + +import ( + "math/rand" + "testing" + + "github.com/google/go-cmp/cmp" + "github.com/onsi/gomega" + "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" + apiequality "k8s.io/apimachinery/pkg/api/equality" + metafuzzer "k8s.io/apimachinery/pkg/apis/meta/fuzzer" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" + "k8s.io/apimachinery/pkg/util/intstr" + "k8s.io/apimachinery/pkg/util/json" + "k8s.io/client-go/kubernetes/scheme" + "k8s.io/utils/ptr" + "sigs.k8s.io/controller-runtime/pkg/conversion" + "sigs.k8s.io/randfill" +) + +const ( + // DataAnnotation is the annotation that conversion webhooks + // use to retain the data in case of down-conversion from the hub. + DataAnnotation = "cluster.x-k8s.io/conversion-data" +) + +// MarshalData stores the source object as json data in the destination object annotations map. +// It ignores the metadata of the source object. +func MarshalData(src metav1.Object, dst metav1.Object) error { + u, err := runtime.DefaultUnstructuredConverter.ToUnstructured(src) + if err != nil { + return err + } + delete(u, "metadata") + + data, err := json.Marshal(u) + if err != nil { + return err + } + annotations := dst.GetAnnotations() + if annotations == nil { + annotations = map[string]string{} + } + annotations[DataAnnotation] = string(data) + dst.SetAnnotations(annotations) + return nil +} + +// UnmarshalData tries to retrieve the data from the annotation and unmarshals it into the object passed as input. +func UnmarshalData(from metav1.Object, to interface{}) (bool, error) { + annotations := from.GetAnnotations() + data, ok := annotations[DataAnnotation] + if !ok { + return false, nil + } + if err := json.Unmarshal([]byte(data), to); err != nil { + return false, err + } + delete(annotations, DataAnnotation) + from.SetAnnotations(annotations) + return true, nil +} + +// GetFuzzer returns a new fuzzer to be used for testing. +func GetFuzzer(scheme *runtime.Scheme, funcs ...fuzzer.FuzzerFuncs) *randfill.Filler { + funcs = append([]fuzzer.FuzzerFuncs{ + metafuzzer.Funcs, + func(_ runtimeserializer.CodecFactory) []interface{} { + return []interface{}{ + // Custom fuzzer for metav1.Time pointers which weren't + // fuzzed and always resulted in `nil` values. + // This implementation is somewhat similar to the one provided + // in the metafuzzer.Funcs. + func(input **metav1.Time, c randfill.Continue) { + if c.Bool() { + // Leave the Time sometimes nil to also get coverage for this case. + return + } + if c.Bool() { + // Set the Time sometimes empty to also get coverage for this case. + *input = &metav1.Time{} + return + } + var sec, nsec uint32 + c.Fill(&sec) + c.Fill(&nsec) + fuzzed := metav1.Unix(int64(sec), int64(nsec)).Rfc3339Copy() + *input = &metav1.Time{Time: fuzzed.Time} + }, + // Custom fuzzer for intstr.IntOrString which does not get fuzzed otherwise. + func(in **intstr.IntOrString, c randfill.Continue) { + if c.Bool() { + // Leave the IntOrString sometimes nil to also get coverage for this case. + return + } + if c.Bool() { + // Set the IntOrString sometimes empty to also get coverage for this case. + *in = &intstr.IntOrString{} + return + } + *in = ptr.To(intstr.FromInt32(c.Int31n(50))) + }, + } + }, + }, funcs...) + return fuzzer.FuzzerFor( + fuzzer.MergeFuzzerFuncs(funcs...), + rand.NewSource(rand.Int63()), //nolint:gosec + runtimeserializer.NewCodecFactory(scheme), + ) +} + +// FuzzTestFuncInput contains input parameters +// for the FuzzTestFunc function. +type FuzzTestFuncInput struct { + Scheme *runtime.Scheme + + Hub conversion.Hub + HubAfterMutation func(conversion.Hub) + + Spoke conversion.Convertible + SpokeAfterMutation func(convertible conversion.Convertible) + SkipSpokeAnnotationCleanup bool + + FuzzerFuncs []fuzzer.FuzzerFuncs +} + +// FuzzTestFunc returns a new testing function to be used in tests to make sure conversions between +// the Hub version of an object and an older version aren't lossy. +func FuzzTestFunc(input FuzzTestFuncInput) func(*testing.T) { + if input.Scheme == nil { + input.Scheme = scheme.Scheme + } + + return func(t *testing.T) { + t.Helper() + t.Run("spoke-hub-spoke", func(t *testing.T) { + g := gomega.NewWithT(t) + fuzzer := GetFuzzer(input.Scheme, input.FuzzerFuncs...) + + for range 10000 { + // Create the spoke and fuzz it + spokeBefore := input.Spoke.DeepCopyObject().(conversion.Convertible) + fuzzer.Fill(spokeBefore) + + // First convert spoke to hub + hubCopy := input.Hub.DeepCopyObject().(conversion.Hub) + g.Expect(spokeBefore.ConvertTo(hubCopy)).To(gomega.Succeed()) + + // Convert hub back to spoke and check if the resulting spoke is equal to the spoke before the round trip + spokeAfter := input.Spoke.DeepCopyObject().(conversion.Convertible) + g.Expect(spokeAfter.ConvertFrom(hubCopy)).To(gomega.Succeed()) + + // Remove data annotation eventually added by ConvertFrom for avoiding data loss in hub-spoke-hub round trips + // NOTE: There are use case when we want to skip this operation, e.g. if the spoke object does not have ObjectMeta (e.g. kubeadm types). + if !input.SkipSpokeAnnotationCleanup { + metaAfter := spokeAfter.(metav1.Object) + delete(metaAfter.GetAnnotations(), DataAnnotation) + } + + if input.SpokeAfterMutation != nil { + input.SpokeAfterMutation(spokeAfter) + } + + if !apiequality.Semantic.DeepEqual(spokeBefore, spokeAfter) { + diff := cmp.Diff(spokeBefore, spokeAfter) + g.Expect(false).To(gomega.BeTrue(), diff) + } + } + }) + t.Run("hub-spoke-hub", func(t *testing.T) { + g := gomega.NewWithT(t) + fuzzer := GetFuzzer(input.Scheme, input.FuzzerFuncs...) + + for range 10000 { + // Create the hub and fuzz it + hubBefore := input.Hub.DeepCopyObject().(conversion.Hub) + fuzzer.Fill(hubBefore) + + // First convert hub to spoke + dstCopy := input.Spoke.DeepCopyObject().(conversion.Convertible) + g.Expect(dstCopy.ConvertFrom(hubBefore)).To(gomega.Succeed()) + + // Convert spoke back to hub and check if the resulting hub is equal to the hub before the round trip + hubAfter := input.Hub.DeepCopyObject().(conversion.Hub) + g.Expect(dstCopy.ConvertTo(hubAfter)).To(gomega.Succeed()) + + if input.HubAfterMutation != nil { + input.HubAfterMutation(hubAfter) + } + + if !apiequality.Semantic.DeepEqual(hubBefore, hubAfter) { + diff := cmp.Diff(hubBefore, hubAfter) + g.Expect(false).To(gomega.BeTrue(), diff) + } + } + }) + } +}