diff --git a/cmd/vsphere/main.go b/cmd/vsphere/main.go index 23f6bc06a2..caf2d24ce7 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/api/ipam/v1beta1" //nolint:staticcheck + ipamv1 "sigs.k8s.io/cluster-api/api/ipam/v1beta2" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client/config" @@ -188,8 +188,8 @@ func main() { klog.Fatal(err) } - if err := ipamv1beta1.AddToScheme(mgr.GetScheme()); err != nil { - klog.Fatalf("unable to add ipamv1beta1 to scheme: %v", err) + if err := ipamv1.AddToScheme(mgr.GetScheme()); err != nil { + klog.Fatalf("unable to add ipamv1 to scheme: %v", err) } if err := capimachine.AddWithActuator(mgr, machineActuator, defaultMutableGate); err != nil { diff --git a/pkg/controller/vsphere/actuator_test.go b/pkg/controller/vsphere/actuator_test.go index 8193dad593..5dcda7cebe 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/api/ipam/v1beta1" //nolint:staticcheck + ipamv1 "sigs.k8s.io/cluster-api/api/ipam/v1beta2" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/envtest" "sigs.k8s.io/controller-runtime/pkg/manager" @@ -36,7 +36,7 @@ func init() { panic(err) } - if err := ipamv1beta1.AddToScheme(scheme.Scheme); err != nil { + if err := ipamv1.AddToScheme(scheme.Scheme); err != nil { panic(err) } } diff --git a/pkg/controller/vsphere/reconciler.go b/pkg/controller/vsphere/reconciler.go index 74240b3b73..530f10347f 100644 --- a/pkg/controller/vsphere/reconciler.go +++ b/pkg/controller/vsphere/reconciler.go @@ -779,7 +779,7 @@ func getAddressesFromPool(configIdx int, networkConfig machinev1.NetworkDeviceSp return nil, "", fmt.Errorf("error retrieving bound IP address: %w", err) } ipAddressSpec := ipAddress.Spec - addresses = append(addresses, fmt.Sprintf("%s/%d", ipAddressSpec.Address, ipAddressSpec.Prefix)) + addresses = append(addresses, fmt.Sprintf("%s/%d", ipAddressSpec.Address, *ipAddressSpec.Prefix)) if len(ipAddressSpec.Gateway) > 0 { gateway = ipAddressSpec.Gateway } diff --git a/pkg/controller/vsphere/reconciler_test.go b/pkg/controller/vsphere/reconciler_test.go index 1444b7c6e0..5cd93cde87 100644 --- a/pkg/controller/vsphere/reconciler_test.go +++ b/pkg/controller/vsphere/reconciler_test.go @@ -41,6 +41,7 @@ import ( apimachinerytypes "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/kubernetes/scheme" vsphere "k8s.io/cloud-provider-vsphere/pkg/common/config" + "k8s.io/utils/ptr" runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" @@ -48,7 +49,7 @@ import ( "github.com/openshift/api/features" machinev1 "github.com/openshift/api/machine/v1beta1" - ipamv1beta1 "sigs.k8s.io/cluster-api/api/ipam/v1beta1" //nolint:staticcheck + ipamv1 "sigs.k8s.io/cluster-api/api/ipam/v1beta2" machinecontroller "github.com/openshift/machine-api-operator/pkg/controller/machine" "github.com/openshift/machine-api-operator/pkg/controller/vsphere/session" @@ -913,39 +914,39 @@ func testStaticIPsWithSimulator(t *testing.T, model *simulator.Model, server *si }, } - ipAddressClaim := ipamv1beta1.IPAddressClaim{ + ipAddressClaim := ipamv1.IPAddressClaim{ ObjectMeta: metav1.ObjectMeta{ Name: "test-claim-0-0", Namespace: "openshift-machine-api", }, - Spec: ipamv1beta1.IPAddressClaimSpec{ - PoolRef: corev1.TypedLocalObjectReference{ + Spec: ipamv1.IPAddressClaimSpec{ + PoolRef: ipamv1.IPPoolReference{ Name: "test-pool", - APIGroup: &poolGroup, + APIGroup: poolGroup, Kind: "ippools", }, }, - Status: ipamv1beta1.IPAddressClaimStatus{ - AddressRef: corev1.LocalObjectReference{ + Status: ipamv1.IPAddressClaimStatus{ + AddressRef: ipamv1.IPAddressReference{ Name: "test-test-0", }, }, } - ipAddress := ipamv1beta1.IPAddress{ + ipAddress := ipamv1.IPAddress{ ObjectMeta: metav1.ObjectMeta{ Name: "test-test-0", Namespace: "openshift-machine-api", }, - Spec: ipamv1beta1.IPAddressSpec{ - ClaimRef: corev1.LocalObjectReference{ + Spec: ipamv1.IPAddressSpec{ + ClaimRef: ipamv1.IPAddressClaimReference{ Name: "test-test-0", }, - PoolRef: corev1.TypedLocalObjectReference{ + PoolRef: ipamv1.IPPoolReference{ Name: "test-pool", }, Address: "192.168.1.11", - Prefix: 24, + Prefix: ptr.To(int32(24)), Gateway: "192.168.1.1", }, } @@ -2156,7 +2157,7 @@ func TestDelete(t *testing.T) { t.Fatalf("cannot add scheme: %v", err) } - if err := ipamv1beta1.AddToScheme(scheme.Scheme); err != nil { + if err := ipamv1.AddToScheme(scheme.Scheme); err != nil { t.Fatalf("cannot add scheme: %v", err) } @@ -2601,53 +2602,53 @@ func TestCreate(t *testing.T) { }, } - ipAddressClaimTest3 := &ipamv1beta1.IPAddressClaim{ + ipAddressClaimTest3 := &ipamv1.IPAddressClaim{ ObjectMeta: metav1.ObjectMeta{ Name: "test-3-claim-0-0", Namespace: namespace, }, - Spec: ipamv1beta1.IPAddressClaimSpec{ - PoolRef: corev1.TypedLocalObjectReference{ + Spec: ipamv1.IPAddressClaimSpec{ + PoolRef: ipamv1.IPPoolReference{ Name: "test-3-pool", - APIGroup: &poolGroup, + APIGroup: poolGroup, Kind: "ippools", }, }, - Status: ipamv1beta1.IPAddressClaimStatus{ - AddressRef: corev1.LocalObjectReference{ + Status: ipamv1.IPAddressClaimStatus{ + AddressRef: ipamv1.IPAddressReference{ Name: "test-test-0", }, }, } - ipAddressClaimNoAddress := &ipamv1beta1.IPAddressClaim{ + ipAddressClaimNoAddress := &ipamv1.IPAddressClaim{ ObjectMeta: metav1.ObjectMeta{ Name: "test-claim-0-0", Namespace: namespace, }, - Spec: ipamv1beta1.IPAddressClaimSpec{ - PoolRef: corev1.TypedLocalObjectReference{ + Spec: ipamv1.IPAddressClaimSpec{ + PoolRef: ipamv1.IPPoolReference{ Name: "test-pool", - APIGroup: &poolGroup, + APIGroup: poolGroup, Kind: "ippools", }, }, } - ipAddress := &ipamv1beta1.IPAddress{ + ipAddress := &ipamv1.IPAddress{ ObjectMeta: metav1.ObjectMeta{ Name: "test-test-0", Namespace: namespace, }, - Spec: ipamv1beta1.IPAddressSpec{ - ClaimRef: corev1.LocalObjectReference{ + Spec: ipamv1.IPAddressSpec{ + ClaimRef: ipamv1.IPAddressClaimReference{ Name: "test-test-0", }, - PoolRef: corev1.TypedLocalObjectReference{ + PoolRef: ipamv1.IPPoolReference{ Name: "test-pool", }, Address: "192.168.1.11", - Prefix: 24, + Prefix: ptr.To(int32(24)), Gateway: "192.168.1.1", }, } @@ -2659,8 +2660,8 @@ func TestCreate(t *testing.T) { providerSpec machinev1.VSphereMachineProviderSpec labels map[string]string notConnectedToVCenter bool - ipAddressClaim *ipamv1beta1.IPAddressClaim - ipAddress *ipamv1beta1.IPAddress + ipAddressClaim *ipamv1.IPAddressClaim + ipAddress *ipamv1.IPAddress featureGatesEnabled map[string]bool }{ { @@ -2957,7 +2958,7 @@ func TestCreate(t *testing.T) { Namespace: machine.Namespace, Name: tc.ipAddressClaim.Name, } - ipAddressClaim := &ipamv1beta1.IPAddressClaim{} + ipAddressClaim := &ipamv1.IPAddressClaim{} err = client.Get(context.Background(), claimKey, ipAddressClaim) if err != nil { t.Fatal(err) diff --git a/pkg/util/ipam/util.go b/pkg/util/ipam/util.go index 81a616e15c..8258d4df9b 100644 --- a/pkg/util/ipam/util.go +++ b/pkg/util/ipam/util.go @@ -5,9 +5,8 @@ import ( "fmt" machinev1 "github.com/openshift/api/machine/v1beta1" - ipamv1beta1 "sigs.k8s.io/cluster-api/api/ipam/v1beta1" //nolint:staticcheck + ipamv1 "sigs.k8s.io/cluster-api/api/ipam/v1beta2" - corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/sets" @@ -21,12 +20,12 @@ func EnsureIPAddressClaim( runtimeClient client.Client, claimName string, machine *machinev1.Machine, - pool machinev1.AddressesFromPool) (*ipamv1beta1.IPAddressClaim, error) { + pool machinev1.AddressesFromPool) (*ipamv1.IPAddressClaim, error) { claimKey := client.ObjectKey{ Namespace: machine.Namespace, Name: claimName, } - ipAddressClaim := &ipamv1beta1.IPAddressClaim{} + ipAddressClaim := &ipamv1.IPAddressClaim{} if err := runtimeClient.Get(ctx, claimKey, ipAddressClaim); err == nil { // If we found a claim, make sure it has owner field set. if len(ipAddressClaim.OwnerReferences) == 0 { @@ -41,7 +40,7 @@ func EnsureIPAddressClaim( klog.Infof("creating IPAddressClaim %s", claimName) gv := machinev1.SchemeGroupVersion machineRef := metav1.NewControllerRef(machine, gv.WithKind("Machine")) - ipAddressClaim = &ipamv1beta1.IPAddressClaim{ + ipAddressClaim = &ipamv1.IPAddressClaim{ ObjectMeta: metav1.ObjectMeta{ OwnerReferences: []metav1.OwnerReference{ *machineRef, @@ -52,9 +51,9 @@ func EnsureIPAddressClaim( Name: claimName, Namespace: machine.Namespace, }, - Spec: ipamv1beta1.IPAddressClaimSpec{ - PoolRef: corev1.TypedLocalObjectReference{ - APIGroup: &pool.Group, + Spec: ipamv1.IPAddressClaimSpec{ + PoolRef: ipamv1.IPPoolReference{ + APIGroup: pool.Group, Kind: pool.Resource, Name: pool.Name, }, @@ -72,7 +71,7 @@ func AdoptOrphanClaim( runtimeClient client.Client, claimName string, machine *machinev1.Machine, - ipAddressClaim *ipamv1beta1.IPAddressClaim) error { + ipAddressClaim *ipamv1.IPAddressClaim) error { gv := machinev1.SchemeGroupVersion machineRef := metav1.NewControllerRef(machine, gv.WithKind("Machine")) ipAddressClaim.OwnerReferences = []metav1.OwnerReference{ @@ -90,7 +89,7 @@ func AdoptOrphanClaim( func CountOutstandingIPAddressClaimsForMachine( ctx context.Context, runtimeClient client.Client, - ipAddressClaims []ipamv1beta1.IPAddressClaim) int { + ipAddressClaims []ipamv1.IPAddressClaim) int { fulfilledClaimCount := 0 for _, claim := range ipAddressClaims { @@ -107,13 +106,13 @@ func RetrieveBoundIPAddress( ctx context.Context, runtimeClient client.Client, machine *machinev1.Machine, - claimName string) (*ipamv1beta1.IPAddress, error) { + claimName string) (*ipamv1.IPAddress, error) { claimKey := client.ObjectKey{ Namespace: machine.Namespace, Name: claimName, } - ipAddressClaim := &ipamv1beta1.IPAddressClaim{} + ipAddressClaim := &ipamv1.IPAddressClaim{} if err := runtimeClient.Get(ctx, claimKey, ipAddressClaim); err != nil { return nil, fmt.Errorf("unable to get IPAddressClaim: %w", err) } @@ -122,7 +121,7 @@ func RetrieveBoundIPAddress( return nil, fmt.Errorf("no IPAddress is bound to claim %s", claimName) } - ipAddress := &ipamv1beta1.IPAddress{} + ipAddress := &ipamv1.IPAddress{} addressKey := client.ObjectKey{ Namespace: machine.Namespace, Name: ipAddressClaim.Status.AddressRef.Name, @@ -137,7 +136,7 @@ func RemoveFinalizersForIPAddressClaims( ctx context.Context, runtimeClient client.Client, machine machinev1.Machine) error { - ipAddressClaimList := &ipamv1beta1.IPAddressClaimList{} + ipAddressClaimList := &ipamv1.IPAddressClaimList{} if err := runtimeClient.List(ctx, ipAddressClaimList, client.InNamespace(machine.Namespace)); err != nil { return fmt.Errorf("unable to list IPAddressClaims: %w", err) } @@ -183,7 +182,7 @@ func HasOutstandingIPAddressClaims( machine *machinev1.Machine, networkDevices []machinev1.NetworkDeviceSpec, ) (int, error) { - var associatedClaims []ipamv1beta1.IPAddressClaim + var associatedClaims []ipamv1.IPAddressClaim for deviceIdx, networkDevice := range networkDevices { for poolIdx, addressPool := range networkDevice.AddressesFromPools { claimName := GetIPAddressClaimName(machine, deviceIdx, poolIdx) diff --git a/third_party/cluster-api/crd/ipam.cluster.x-k8s.io_ipaddressclaims.yaml b/third_party/cluster-api/crd/ipam.cluster.x-k8s.io_ipaddressclaims.yaml index f05f04474d..c7b5a44702 100644 --- a/third_party/cluster-api/crd/ipam.cluster.x-k8s.io_ipaddressclaims.yaml +++ b/third_party/cluster-api/crd/ipam.cluster.x-k8s.io_ipaddressclaims.yaml @@ -3,282 +3,603 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.1 + controller-gen.kubebuilder.io/version: v0.19.0 name: ipaddressclaims.ipam.cluster.x-k8s.io spec: group: ipam.cluster.x-k8s.io names: categories: - - cluster-api + - cluster-api kind: IPAddressClaim listKind: IPAddressClaimList plural: ipaddressclaims singular: ipaddressclaim scope: Namespaced versions: - - additionalPrinterColumns: - - description: Name of the pool to allocate an address from - jsonPath: .spec.poolRef.name - name: Pool Name - type: string - - description: Kind of the pool to allocate an address from - jsonPath: .spec.poolRef.kind - name: Pool Kind - type: string - - description: Time duration since creation of IPAdressClaim - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: IPAddressClaim is the Schema for the ipaddressclaim API. - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: IPAddressClaimSpec is the desired state of an IPAddressClaim. - properties: - poolRef: - description: PoolRef is a reference to the pool from which an IP address - should be created. - properties: - apiGroup: - description: |- - APIGroup is the group for the resource being referenced. - If APIGroup is not specified, the specified Kind must be in the core API group. - For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - required: - - kind - - name - type: object - x-kubernetes-map-type: atomic - required: - - poolRef - type: object - status: - description: IPAddressClaimStatus is the observed status of a IPAddressClaim. - properties: - addressRef: - description: AddressRef is a reference to the address that was created - for this claim. - properties: - name: - default: "" - description: |- - Name of the referent. - This field is effectively required, but due to backwards compatibility is - allowed to be empty. Instances of this type with an empty value here are - almost certainly wrong. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - type: object - x-kubernetes-map-type: atomic - conditions: - description: Conditions summarises the current state of the IPAddressClaim - items: - description: Condition defines an observation of a Cluster API resource - operational state. + - additionalPrinterColumns: + - description: Name of the pool to allocate an address from + jsonPath: .spec.poolRef.name + name: Pool Name + type: string + - description: Kind of the pool to allocate an address from + jsonPath: .spec.poolRef.kind + name: Pool Kind + type: string + - description: Time duration since creation of IPAdressClaim + jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: IPAddressClaim is the Schema for the ipaddressclaim API. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: spec is the desired state of IPAddressClaim. + properties: + poolRef: + description: poolRef is a reference to the pool from which an IP address + should be created. properties: - lastTransitionTime: + apiGroup: description: |- - Last time the condition transitioned from one status to another. - This should be when the underlying condition changed. If that is not known, then using the time when - the API field changed is acceptable. - format: date-time + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string - message: - description: |- - A human readable message indicating details about the transition. - This field may be empty. + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced type: string - reason: + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + required: + - poolRef + type: object + status: + description: status is the observed state of IPAddressClaim. + properties: + addressRef: + description: addressRef is a reference to the address that was created + for this claim. + properties: + name: + default: "" description: |- - The reason for the condition's last transition in CamelCase. - The specific API may choose whether or not this field is considered a guaranteed API. - This field may be empty. + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string - severity: + type: object + x-kubernetes-map-type: atomic + conditions: + description: conditions summarises the current state of the IPAddressClaim + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + 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. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This field may be empty. + maxLength: 10240 + minLength: 1 + type: string + reason: + 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. + maxLength: 256 + minLength: 1 + type: string + severity: + description: |- + severity provides an explicit classification of Reason code, so the users or machines can immediately + understand the current situation and act accordingly. + The Severity field MUST be set only when Status=False. + maxLength: 32 + type: string + status: + description: status of the condition, one of True, False, Unknown. + type: string + type: + description: |- + type of condition in CamelCase or in foo.example.com/CamelCase. + Many .condition.type values are consistent across resources like Available, but because arbitrary conditions + can be useful (see .node.status.conditions), the ability to deconflict is important. + maxLength: 256 + minLength: 1 + type: string + required: + - lastTransitionTime + - status + - type + type: object + type: array + type: object + type: object + served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: Name of the pool to allocate an address from + jsonPath: .spec.poolRef.name + name: Pool Name + type: string + - description: Kind of the pool to allocate an address from + jsonPath: .spec.poolRef.kind + name: Pool Kind + type: string + - description: Time duration since creation of IPAdressClaim + jsonPath: .metadata.creationTimestamp + name: Age + type: date + deprecated: true + name: v1beta1 + schema: + openAPIV3Schema: + description: IPAddressClaim is the Schema for the ipaddressclaim API. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: spec is the desired state of IPAddressClaim. + properties: + clusterName: + description: clusterName is the name of the Cluster this object belongs + to. + maxLength: 63 + minLength: 1 + type: string + poolRef: + description: poolRef is a reference to the pool from which an IP address + should be created. + properties: + apiGroup: 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. + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. type: string - status: - description: Status of the condition, one of True, False, Unknown. + kind: + description: Kind is the type of resource being referenced type: string - type: - description: |- - Type of condition in CamelCase or in foo.example.com/CamelCase. - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions - can be useful (see .node.status.conditions), the ability to deconflict is important. + name: + description: Name is the name of resource being referenced type: string required: - - lastTransitionTime - - status - - type + - kind + - name type: object - type: array - type: object - type: object - served: true - storage: false - subresources: - status: {} - - additionalPrinterColumns: - - description: Name of the pool to allocate an address from - jsonPath: .spec.poolRef.name - name: Pool Name - type: string - - description: Kind of the pool to allocate an address from - jsonPath: .spec.poolRef.kind - name: Pool Kind - type: string - - description: Time duration since creation of IPAdressClaim - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1beta1 - schema: - openAPIV3Schema: - description: IPAddressClaim is the Schema for the ipaddressclaim API. - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: IPAddressClaimSpec is the desired state of an IPAddressClaim. - properties: - clusterName: - description: ClusterName is the name of the Cluster this object belongs - to. - type: string - poolRef: - description: PoolRef is a reference to the pool from which an IP address - should be created. - properties: - apiGroup: - description: |- - APIGroup is the group for the resource being referenced. - If APIGroup is not specified, the specified Kind must be in the core API group. - For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - required: - - kind - - name - type: object - x-kubernetes-map-type: atomic - required: - - poolRef - type: object - status: - description: IPAddressClaimStatus is the observed status of a IPAddressClaim. - properties: - addressRef: - description: AddressRef is a reference to the address that was created - for this claim. - properties: - name: - default: "" - description: |- - Name of the referent. - This field is effectively required, but due to backwards compatibility is - allowed to be empty. Instances of this type with an empty value here are - almost certainly wrong. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - type: object - x-kubernetes-map-type: atomic - conditions: - description: Conditions summarises the current state of the IPAddressClaim - items: - description: Condition defines an observation of a Cluster API resource - operational state. + x-kubernetes-map-type: atomic + required: + - poolRef + type: object + status: + description: status is the observed state of IPAddressClaim. + properties: + addressRef: + description: addressRef is a reference to the address that was created + for this claim. properties: - lastTransitionTime: + name: + default: "" description: |- - Last time the condition transitioned from one status to another. - This should be when the underlying condition changed. If that is not known, then using the time when - the API field changed is acceptable. - format: date-time + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string - message: + type: object + x-kubernetes-map-type: atomic + conditions: + description: conditions summarises the current state of the IPAddressClaim + items: + description: Condition defines an observation of a Cluster API resource + operational state. + properties: + lastTransitionTime: + 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. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This field may be empty. + maxLength: 10240 + minLength: 1 + type: string + reason: + 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. + maxLength: 256 + minLength: 1 + type: string + severity: + description: |- + severity provides an explicit classification of Reason code, so the users or machines can immediately + understand the current situation and act accordingly. + The Severity field MUST be set only when Status=False. + maxLength: 32 + type: string + status: + description: status of the condition, one of True, False, Unknown. + type: string + type: + description: |- + type of condition in CamelCase or in foo.example.com/CamelCase. + Many .condition.type values are consistent across resources like Available, but because arbitrary conditions + can be useful (see .node.status.conditions), the ability to deconflict is important. + maxLength: 256 + minLength: 1 + type: string + required: + - lastTransitionTime + - status + - type + type: object + type: array + v1beta2: + description: v1beta2 groups all the fields that will be added or modified + in IPAddressClaim's status with the V1Beta2 version. + properties: + conditions: + description: conditions represents the observations of a IPAddressClaim's + current state. + items: + description: Condition contains details for one aspect of the + current state of this API Resource. + properties: + lastTransitionTime: + 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. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, + Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + 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])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 32 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + type: object + type: object + type: object + served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: Name of the pool to allocate an address from + jsonPath: .spec.poolRef.name + name: Pool Name + type: string + - description: Kind of the pool to allocate an address from + jsonPath: .spec.poolRef.kind + name: Pool Kind + type: string + - description: Time duration since creation of IPAdressClaim + jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1beta2 + schema: + openAPIV3Schema: + description: IPAddressClaim is the Schema for the ipaddressclaim API. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: spec is the desired state of IPAddressClaim. + properties: + clusterName: + description: clusterName is the name of the Cluster this object belongs + to. + maxLength: 63 + minLength: 1 + type: string + poolRef: + description: poolRef is a reference to the pool from which an IP address + should be created. + properties: + apiGroup: description: |- - A human readable message indicating details about the transition. - This field may be empty. + apiGroup of the IPPool. + apiGroup must be fully qualified domain name. + maxLength: 253 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string - reason: + kind: description: |- - The reason for the condition's last transition in CamelCase. - The specific API may choose whether or not this field is considered a guaranteed API. - This field may be empty. + kind of the IPPool. + kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character. + maxLength: 63 + minLength: 1 + pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ type: string - severity: + name: 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. + name of the IPPool. + name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character. + maxLength: 253 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string - status: - description: Status of the condition, one of True, False, Unknown. - type: string - type: + required: + - apiGroup + - kind + - name + type: object + required: + - poolRef + type: object + status: + description: status is the observed state of IPAddressClaim. + minProperties: 1 + properties: + addressRef: + description: addressRef is a reference to the address that was created + for this claim. + properties: + name: 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. + name of the IPAddress. + name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character. + maxLength: 253 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ type: string required: - - lastTransitionTime - - status - - type + - name + type: object + conditions: + description: |- + conditions represents the observations of a IPAddressClaim's current state. + Known condition types are Ready. + items: + description: Condition contains details for one aspect of the current + state of this API Resource. + properties: + lastTransitionTime: + 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. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: |- + reason contains a programmatic identifier indicating the reason for the condition's last transition. + Producers of specific condition types may define expected values and meanings for this field, + and whether the values are considered a guaranteed API. + The value should be a CamelCase string. + This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - "True" + - "False" + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. + maxLength: 316 + 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])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + maxItems: 32 + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + deprecated: + description: deprecated groups all the status fields that are deprecated + and will be removed when all the nested field are removed. + properties: + v1beta1: + description: v1beta1 groups all the status fields that are deprecated + and will be removed when support for v1beta1 will be dropped. + properties: + conditions: + description: |- + 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. + items: + description: Condition defines an observation of a Cluster + API resource operational state. + properties: + lastTransitionTime: + 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. + format: date-time + type: string + message: + description: |- + message is a human readable message indicating details about the transition. + This field may be empty. + maxLength: 10240 + minLength: 1 + type: string + reason: + 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. + maxLength: 256 + minLength: 1 + type: string + severity: + description: |- + severity provides an explicit classification of Reason code, so the users or machines can immediately + understand the current situation and act accordingly. + The Severity field MUST be set only when Status=False. + maxLength: 32 + type: string + status: + description: status of the condition, one of True, False, + Unknown. + type: string + type: + description: |- + type of condition in CamelCase or in foo.example.com/CamelCase. + Many .condition.type values are consistent across resources like Available, but because arbitrary conditions + can be useful (see .node.status.conditions), the ability to deconflict is important. + maxLength: 256 + minLength: 1 + type: string + required: + - lastTransitionTime + - status + - type + type: object + type: array + type: object type: object - type: array - type: object - type: object - served: true - storage: true - subresources: - status: {} + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} \ No newline at end of file diff --git a/third_party/cluster-api/crd/ipam.cluster.x-k8s.io_ipaddresses.yaml b/third_party/cluster-api/crd/ipam.cluster.x-k8s.io_ipaddresses.yaml index b25fee0ab1..9c28b449fc 100644 --- a/third_party/cluster-api/crd/ipam.cluster.x-k8s.io_ipaddresses.yaml +++ b/third_party/cluster-api/crd/ipam.cluster.x-k8s.io_ipaddresses.yaml @@ -3,212 +3,340 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.16.1 + controller-gen.kubebuilder.io/version: v0.19.0 name: ipaddresses.ipam.cluster.x-k8s.io spec: group: ipam.cluster.x-k8s.io names: categories: - - cluster-api + - cluster-api kind: IPAddress listKind: IPAddressList plural: ipaddresses singular: ipaddress scope: Namespaced versions: - - additionalPrinterColumns: - - description: Address - jsonPath: .spec.address - name: Address - type: string - - description: Name of the pool the address is from - jsonPath: .spec.poolRef.name - name: Pool Name - type: string - - description: Kind of the pool the address is from - jsonPath: .spec.poolRef.kind - name: Pool Kind - type: string - - description: Time duration since creation of IPAdress - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: IPAddress is the Schema for the ipaddress API. - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: IPAddressSpec is the desired state of an IPAddress. - properties: - address: - description: Address is the IP address. - type: string - claimRef: - description: ClaimRef is a reference to the claim this IPAddress was - created for. - properties: - name: - default: "" - description: |- - Name of the referent. - This field is effectively required, but due to backwards compatibility is - allowed to be empty. Instances of this type with an empty value here are - almost certainly wrong. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - type: object - x-kubernetes-map-type: atomic - gateway: - description: Gateway is the network gateway of the network the address - is from. - type: string - poolRef: - description: PoolRef is a reference to the pool that this IPAddress - was created from. - properties: - apiGroup: - description: |- - APIGroup is the group for the resource being referenced. - If APIGroup is not specified, the specified Kind must be in the core API group. - For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - required: - - kind - - name - type: object - x-kubernetes-map-type: atomic - prefix: - description: Prefix is the prefix of the address. - type: integer - required: - - address - - claimRef - - poolRef - - prefix - type: object - type: object - served: true - storage: false - subresources: {} - - additionalPrinterColumns: - - description: Address - jsonPath: .spec.address - name: Address - type: string - - description: Name of the pool the address is from - jsonPath: .spec.poolRef.name - name: Pool Name - type: string - - description: Kind of the pool the address is from - jsonPath: .spec.poolRef.kind - name: Pool Kind - type: string - - description: Time duration since creation of IPAdress - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1beta1 - schema: - openAPIV3Schema: - description: IPAddress is the Schema for the ipaddress API. - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: IPAddressSpec is the desired state of an IPAddress. - properties: - address: - description: Address is the IP address. - type: string - claimRef: - description: ClaimRef is a reference to the claim this IPAddress was - created for. - properties: - name: - default: "" - description: |- - Name of the referent. - This field is effectively required, but due to backwards compatibility is - allowed to be empty. Instances of this type with an empty value here are - almost certainly wrong. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - type: object - x-kubernetes-map-type: atomic - gateway: - description: Gateway is the network gateway of the network the address - is from. - type: string - poolRef: - description: PoolRef is a reference to the pool that this IPAddress - was created from. - properties: - apiGroup: - description: |- - APIGroup is the group for the resource being referenced. - If APIGroup is not specified, the specified Kind must be in the core API group. - For any other third-party types, APIGroup is required. - type: string - kind: - description: Kind is the type of resource being referenced - type: string - name: - description: Name is the name of resource being referenced - type: string - required: - - kind - - name - type: object - x-kubernetes-map-type: atomic - prefix: - description: Prefix is the prefix of the address. - type: integer - required: - - address - - claimRef - - poolRef - - prefix - type: object - type: object - served: true - storage: true - subresources: {} + - additionalPrinterColumns: + - description: Address + jsonPath: .spec.address + name: Address + type: string + - description: Name of the pool the address is from + jsonPath: .spec.poolRef.name + name: Pool Name + type: string + - description: Kind of the pool the address is from + jsonPath: .spec.poolRef.kind + name: Pool Kind + type: string + - description: Time duration since creation of IPAdress + jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: IPAddress is the Schema for the ipaddress API. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: spec is the desired state of IPAddress. + properties: + address: + description: address is the IP address. + maxLength: 39 + minLength: 1 + type: string + claimRef: + description: claimRef is a reference to the claim this IPAddress was + created for. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + gateway: + description: gateway is the network gateway of the network the address + is from. + maxLength: 39 + minLength: 1 + type: string + poolRef: + description: poolRef is a reference to the pool that this IPAddress + was created from. + properties: + apiGroup: + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + prefix: + description: prefix is the prefix of the address. + type: integer + required: + - address + - claimRef + - poolRef + - prefix + type: object + type: object + served: true + storage: false + subresources: {} + - additionalPrinterColumns: + - description: Address + jsonPath: .spec.address + name: Address + type: string + - description: Name of the pool the address is from + jsonPath: .spec.poolRef.name + name: Pool Name + type: string + - description: Kind of the pool the address is from + jsonPath: .spec.poolRef.kind + name: Pool Kind + type: string + - description: Time duration since creation of IPAdress + jsonPath: .metadata.creationTimestamp + name: Age + type: date + deprecated: true + name: v1beta1 + schema: + openAPIV3Schema: + description: IPAddress is the Schema for the ipaddress API. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: spec is the desired state of IPAddress. + properties: + address: + description: address is the IP address. + maxLength: 39 + minLength: 1 + type: string + claimRef: + description: claimRef is a reference to the claim this IPAddress was + created for. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + type: string + type: object + x-kubernetes-map-type: atomic + gateway: + description: gateway is the network gateway of the network the address + is from. + maxLength: 39 + minLength: 1 + type: string + poolRef: + description: poolRef is a reference to the pool that this IPAddress + was created from. + properties: + apiGroup: + description: |- + APIGroup is the group for the resource being referenced. + If APIGroup is not specified, the specified Kind must be in the core API group. + For any other third-party types, APIGroup is required. + type: string + kind: + description: Kind is the type of resource being referenced + type: string + name: + description: Name is the name of resource being referenced + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + prefix: + description: prefix is the prefix of the address. + type: integer + required: + - address + - claimRef + - poolRef + - prefix + type: object + type: object + served: true + storage: false + subresources: {} + - additionalPrinterColumns: + - description: Address + jsonPath: .spec.address + name: Address + type: string + - description: Name of the pool the address is from + jsonPath: .spec.poolRef.name + name: Pool Name + type: string + - description: Kind of the pool the address is from + jsonPath: .spec.poolRef.kind + name: Pool Kind + type: string + - description: Time duration since creation of IPAdress + jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1beta2 + schema: + openAPIV3Schema: + description: IPAddress is the Schema for the ipaddress API. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: spec is the desired state of IPAddress. + properties: + address: + description: address is the IP address. + maxLength: 39 + minLength: 1 + type: string + claimRef: + description: claimRef is a reference to the claim this IPAddress was + created for. + properties: + name: + description: |- + name of the IPAddressClaim. + name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character. + maxLength: 253 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string + required: + - name + type: object + gateway: + description: gateway is the network gateway of the network the address + is from. + maxLength: 39 + minLength: 1 + type: string + poolRef: + description: poolRef is a reference to the pool that this IPAddress + was created from. + properties: + apiGroup: + description: |- + apiGroup of the IPPool. + apiGroup must be fully qualified domain name. + maxLength: 253 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string + kind: + description: |- + kind of the IPPool. + kind must consist of alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character. + maxLength: 63 + minLength: 1 + pattern: ^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$ + type: string + name: + description: |- + name of the IPPool. + name must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character. + maxLength: 253 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string + required: + - apiGroup + - kind + - name + type: object + prefix: + description: prefix is the prefix of the address. + format: int32 + maximum: 128 + minimum: 0 + type: integer + required: + - address + - claimRef + - poolRef + - prefix + type: object + required: + - spec + type: object + served: true + storage: true + subresources: {} \ No newline at end of file diff --git a/vendor/k8s.io/apimachinery/pkg/api/apitesting/close.go b/vendor/k8s.io/apimachinery/pkg/api/apitesting/close.go deleted file mode 100644 index dfb5657eb9..0000000000 --- a/vendor/k8s.io/apimachinery/pkg/api/apitesting/close.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -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 deleted file mode 100644 index 542b0aa275..0000000000 --- a/vendor/k8s.io/apimachinery/pkg/api/apitesting/codec.go +++ /dev/null @@ -1,116 +0,0 @@ -/* -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 deleted file mode 100644 index a12370886f..0000000000 --- a/vendor/k8s.io/apimachinery/pkg/api/apitesting/fuzzer/fuzzer.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -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 deleted file mode 100644 index facff57bba..0000000000 --- a/vendor/k8s.io/apimachinery/pkg/api/apitesting/fuzzer/valuefuzz.go +++ /dev/null @@ -1,86 +0,0 @@ -/* -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 deleted file mode 100644 index c263f1450d..0000000000 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/fuzzer/fuzzer.go +++ /dev/null @@ -1,339 +0,0 @@ -/* -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/modules.txt b/vendor/modules.txt index 6241587675..d96ec5f2bb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -2197,8 +2197,6 @@ 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 @@ -2213,7 +2211,6 @@ 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 @@ -3489,12 +3486,9 @@ 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.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/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 deleted file mode 100644 index f6f10b3ff5..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/.import-restrictions +++ /dev/null @@ -1,5 +0,0 @@ -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/core/v1beta1/cluster_phase_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/cluster_phase_types.go deleted file mode 100644 index 68777cf757..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/cluster_phase_types.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -// ClusterPhase is a string representation of a Cluster Phase. -// -// This type is a high-level indicator of the status of the Cluster as it is provisioned, -// from the API user’s perspective. -// -// The value should not be interpreted by any software components as a reliable indication -// of the actual state of the Cluster, and controllers should not use the Cluster Phase field -// value when making decisions about what action to take. -// -// Controllers should always look at the actual state of the Cluster’s fields to make those decisions. -type ClusterPhase string - -const ( - // ClusterPhasePending is the first state a Cluster is assigned by - // Cluster API Cluster controller after being created. - ClusterPhasePending = ClusterPhase("Pending") - - // ClusterPhaseProvisioning is the state when the Cluster has a 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. - 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/v1beta1/cluster_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/cluster_types.go deleted file mode 100644 index c6ff0853b1..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/cluster_types.go +++ /dev/null @@ -1,1318 +0,0 @@ -/* -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 ( - "cmp" - "fmt" - "net" - "strings" - - "github.com/pkg/errors" - 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/types" - "k8s.io/utils/ptr" - - 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 that will be used in v1Beta2 API version. -const ( - // ClusterAvailableV1Beta2Condition 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. - ClusterAvailableV1Beta2Condition = AvailableV1Beta2Condition - - // ClusterAvailableV1Beta2Reason surfaces when the cluster availability criteria is met. - ClusterAvailableV1Beta2Reason = AvailableV1Beta2Reason - - // ClusterNotAvailableV1Beta2Reason surfaces when the cluster availability criteria is not met (and thus the machine is not available). - ClusterNotAvailableV1Beta2Reason = NotAvailableV1Beta2Reason - - // ClusterAvailableUnknownV1Beta2Reason surfaces when at least one cluster availability criteria is unknown - // and no availability criteria is not met. - ClusterAvailableUnknownV1Beta2Reason = AvailableUnknownV1Beta2Reason - - // ClusterAvailableInternalErrorV1Beta2Reason surfaces unexpected error when computing the Available condition. - ClusterAvailableInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// Cluster's TopologyReconciled condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // ClusterTopologyReconciledV1Beta2Condition 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. - ClusterTopologyReconciledV1Beta2Condition = "TopologyReconciled" - - // ClusterTopologyReconcileSucceededV1Beta2Reason documents the reconciliation of a Cluster topology succeeded. - ClusterTopologyReconcileSucceededV1Beta2Reason = "ReconcileSucceeded" - - // ClusterTopologyReconciledFailedV1Beta2Reason documents the reconciliation of a Cluster topology - // failing due to an error. - ClusterTopologyReconciledFailedV1Beta2Reason = "ReconcileFailed" - - // ClusterTopologyReconciledControlPlaneUpgradePendingV1Beta2Reason documents reconciliation of a Cluster topology - // not yet completed because Control Plane is not yet updated to match the desired topology spec. - ClusterTopologyReconciledControlPlaneUpgradePendingV1Beta2Reason = "ControlPlaneUpgradePending" - - // ClusterTopologyReconciledMachineDeploymentsCreatePendingV1Beta2Reason 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. - ClusterTopologyReconciledMachineDeploymentsCreatePendingV1Beta2Reason = "MachineDeploymentsCreatePending" - - // ClusterTopologyReconciledMachineDeploymentsUpgradePendingV1Beta2Reason 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. - ClusterTopologyReconciledMachineDeploymentsUpgradePendingV1Beta2Reason = "MachineDeploymentsUpgradePending" - - // ClusterTopologyReconciledMachineDeploymentsUpgradeDeferredV1Beta2Reason documents reconciliation of a Cluster topology - // not yet completed because the upgrade for at least one of the MachineDeployments has been deferred. - ClusterTopologyReconciledMachineDeploymentsUpgradeDeferredV1Beta2Reason = "MachineDeploymentsUpgradeDeferred" - - // ClusterTopologyReconciledMachinePoolsUpgradePendingV1Beta2Reason 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. - ClusterTopologyReconciledMachinePoolsUpgradePendingV1Beta2Reason = "MachinePoolsUpgradePending" - - // ClusterTopologyReconciledMachinePoolsCreatePendingV1Beta2Reason 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. - ClusterTopologyReconciledMachinePoolsCreatePendingV1Beta2Reason = "MachinePoolsCreatePending" - - // ClusterTopologyReconciledMachinePoolsUpgradeDeferredV1Beta2Reason documents reconciliation of a Cluster topology - // not yet completed because the upgrade for at least one of the MachinePools has been deferred. - ClusterTopologyReconciledMachinePoolsUpgradeDeferredV1Beta2Reason = "MachinePoolsUpgradeDeferred" - - // ClusterTopologyReconciledHookBlockingV1Beta2Reason documents reconciliation of a Cluster topology - // not yet completed because at least one of the lifecycle hooks is blocking. - ClusterTopologyReconciledHookBlockingV1Beta2Reason = "LifecycleHookBlocking" - - // ClusterTopologyReconciledClusterClassNotReconciledV1Beta2Reason 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. - ClusterTopologyReconciledClusterClassNotReconciledV1Beta2Reason = "ClusterClassNotReconciled" - - // ClusterTopologyReconciledDeletingV1Beta2Reason surfaces when the Cluster is deleting because the - // DeletionTimestamp is set. - ClusterTopologyReconciledDeletingV1Beta2Reason = DeletingV1Beta2Reason - - // ClusterTopologyReconcilePausedV1Beta2Reason surfaces when the Cluster is paused. - ClusterTopologyReconcilePausedV1Beta2Reason = PausedV1Beta2Reason -) - -// Cluster's InfrastructureReady condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // ClusterInfrastructureReadyV1Beta2Condition mirrors Cluster's infrastructure Ready condition. - ClusterInfrastructureReadyV1Beta2Condition = InfrastructureReadyV1Beta2Condition - - // ClusterInfrastructureReadyV1Beta2Reason surfaces when the cluster infrastructure is ready. - ClusterInfrastructureReadyV1Beta2Reason = ReadyV1Beta2Reason - - // ClusterInfrastructureNotReadyV1Beta2Reason surfaces when the cluster infrastructure is not ready. - ClusterInfrastructureNotReadyV1Beta2Reason = NotReadyV1Beta2Reason - - // ClusterInfrastructureInvalidConditionReportedV1Beta2Reason surfaces a infrastructure Ready condition (read from an infra cluster object) which is invalid - // (e.g. its status is missing). - ClusterInfrastructureInvalidConditionReportedV1Beta2Reason = InvalidConditionReportedV1Beta2Reason - - // ClusterInfrastructureInternalErrorV1Beta2Reason surfaces unexpected failures when reading an infra cluster object. - ClusterInfrastructureInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason - - // ClusterInfrastructureDoesNotExistV1Beta2Reason 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. - ClusterInfrastructureDoesNotExistV1Beta2Reason = ObjectDoesNotExistV1Beta2Reason - - // ClusterInfrastructureDeletedV1Beta2Reason 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. - ClusterInfrastructureDeletedV1Beta2Reason = ObjectDeletedV1Beta2Reason -) - -// Cluster's ControlPlaneInitialized condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // ClusterControlPlaneInitializedV1Beta2Condition 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. - ClusterControlPlaneInitializedV1Beta2Condition = "ControlPlaneInitialized" - - // ClusterControlPlaneInitializedV1Beta2Reason surfaces when the cluster control plane is initialized. - ClusterControlPlaneInitializedV1Beta2Reason = "Initialized" - - // ClusterControlPlaneNotInitializedV1Beta2Reason surfaces when the cluster control plane is not yet initialized. - ClusterControlPlaneNotInitializedV1Beta2Reason = "NotInitialized" - - // ClusterControlPlaneInitializedInternalErrorV1Beta2Reason surfaces unexpected failures when computing the - // ControlPlaneInitialized condition. - ClusterControlPlaneInitializedInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// Cluster's ControlPlaneAvailable condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // ClusterControlPlaneAvailableV1Beta2Condition is a mirror of Cluster's control plane Available condition. - ClusterControlPlaneAvailableV1Beta2Condition = "ControlPlaneAvailable" - - // ClusterControlPlaneAvailableV1Beta2Reason surfaces when the cluster control plane is available. - ClusterControlPlaneAvailableV1Beta2Reason = AvailableV1Beta2Reason - - // ClusterControlPlaneNotAvailableV1Beta2Reason surfaces when the cluster control plane is not available. - ClusterControlPlaneNotAvailableV1Beta2Reason = NotAvailableV1Beta2Reason - - // ClusterControlPlaneInvalidConditionReportedV1Beta2Reason surfaces a control plane Available condition (read from a control plane object) which is invalid. - // (e.g. its status is missing). - ClusterControlPlaneInvalidConditionReportedV1Beta2Reason = InvalidConditionReportedV1Beta2Reason - - // ClusterControlPlaneInternalErrorV1Beta2Reason surfaces unexpected failures when reading a control plane object. - ClusterControlPlaneInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason - - // ClusterControlPlaneDoesNotExistV1Beta2Reason 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. - ClusterControlPlaneDoesNotExistV1Beta2Reason = ObjectDoesNotExistV1Beta2Reason - - // ClusterControlPlaneDeletedV1Beta2Reason 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. - ClusterControlPlaneDeletedV1Beta2Reason = ObjectDeletedV1Beta2Reason -) - -// Cluster's WorkersAvailable condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // ClusterWorkersAvailableV1Beta2Condition is the summary of MachineDeployment and MachinePool's Available conditions. - // Note: Stand-alone MachineSets and stand-alone Machines are not included in this condition. - ClusterWorkersAvailableV1Beta2Condition = "WorkersAvailable" - - // ClusterWorkersAvailableV1Beta2Reason surfaces when all MachineDeployment and MachinePool's Available conditions are true. - ClusterWorkersAvailableV1Beta2Reason = AvailableV1Beta2Reason - - // ClusterWorkersNotAvailableV1Beta2Reason surfaces when at least one of the MachineDeployment and MachinePool's Available - // conditions is false. - ClusterWorkersNotAvailableV1Beta2Reason = NotAvailableV1Beta2Reason - - // ClusterWorkersAvailableUnknownV1Beta2Reason surfaces when at least one of the MachineDeployment and MachinePool's Available - // conditions is unknown and none of those Available conditions is false. - ClusterWorkersAvailableUnknownV1Beta2Reason = AvailableUnknownV1Beta2Reason - - // ClusterWorkersAvailableNoWorkersV1Beta2Reason surfaces when no MachineDeployment and MachinePool exist for the Cluster. - ClusterWorkersAvailableNoWorkersV1Beta2Reason = "NoWorkers" - - // ClusterWorkersAvailableInternalErrorV1Beta2Reason surfaces unexpected failures when listing MachineDeployment and MachinePool - // or aggregating conditions from those objects. - ClusterWorkersAvailableInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// Cluster's ControlPlaneMachinesReady condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // ClusterControlPlaneMachinesReadyV1Beta2Condition surfaces detail of issues on control plane machines, if any. - ClusterControlPlaneMachinesReadyV1Beta2Condition = "ControlPlaneMachinesReady" - - // ClusterControlPlaneMachinesReadyV1Beta2Reason surfaces when all control plane machine's Ready conditions are true. - ClusterControlPlaneMachinesReadyV1Beta2Reason = ReadyV1Beta2Reason - - // ClusterControlPlaneMachinesNotReadyV1Beta2Reason surfaces when at least one of control plane machine's Ready conditions is false. - ClusterControlPlaneMachinesNotReadyV1Beta2Reason = NotReadyV1Beta2Reason - - // ClusterControlPlaneMachinesReadyUnknownV1Beta2Reason 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. - ClusterControlPlaneMachinesReadyUnknownV1Beta2Reason = ReadyUnknownV1Beta2Reason - - // ClusterControlPlaneMachinesReadyNoReplicasV1Beta2Reason surfaces when no control plane machines exist for the Cluster. - ClusterControlPlaneMachinesReadyNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason - - // ClusterControlPlaneMachinesReadyInternalErrorV1Beta2Reason surfaces unexpected failures when listing control plane machines - // or aggregating control plane machine's conditions. - ClusterControlPlaneMachinesReadyInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// Cluster's WorkerMachinesReady condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // ClusterWorkerMachinesReadyV1Beta2Condition surfaces detail of issues on the worker machines, if any. - ClusterWorkerMachinesReadyV1Beta2Condition = "WorkerMachinesReady" - - // ClusterWorkerMachinesReadyV1Beta2Reason surfaces when all the worker machine's Ready conditions are true. - ClusterWorkerMachinesReadyV1Beta2Reason = ReadyV1Beta2Reason - - // ClusterWorkerMachinesNotReadyV1Beta2Reason surfaces when at least one of the worker machine's Ready conditions is false. - ClusterWorkerMachinesNotReadyV1Beta2Reason = NotReadyV1Beta2Reason - - // ClusterWorkerMachinesReadyUnknownV1Beta2Reason 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. - ClusterWorkerMachinesReadyUnknownV1Beta2Reason = ReadyUnknownV1Beta2Reason - - // ClusterWorkerMachinesReadyNoReplicasV1Beta2Reason surfaces when no worker machines exist for the Cluster. - ClusterWorkerMachinesReadyNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason - - // ClusterWorkerMachinesReadyInternalErrorV1Beta2Reason surfaces unexpected failures when listing worker machines - // or aggregating worker machine's conditions. - ClusterWorkerMachinesReadyInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// Cluster's ControlPlaneMachinesUpToDate condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // ClusterControlPlaneMachinesUpToDateV1Beta2Condition 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. - ClusterControlPlaneMachinesUpToDateV1Beta2Condition = "ControlPlaneMachinesUpToDate" - - // ClusterControlPlaneMachinesUpToDateV1Beta2Reason surfaces when all the control plane machine's UpToDate conditions are true. - ClusterControlPlaneMachinesUpToDateV1Beta2Reason = UpToDateV1Beta2Reason - - // ClusterControlPlaneMachinesNotUpToDateV1Beta2Reason surfaces when at least one of the control plane machine's UpToDate conditions is false. - ClusterControlPlaneMachinesNotUpToDateV1Beta2Reason = NotUpToDateV1Beta2Reason - - // ClusterControlPlaneMachinesUpToDateUnknownV1Beta2Reason 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. - ClusterControlPlaneMachinesUpToDateUnknownV1Beta2Reason = UpToDateUnknownV1Beta2Reason - - // ClusterControlPlaneMachinesUpToDateNoReplicasV1Beta2Reason surfaces when no control plane machines exist for the Cluster. - ClusterControlPlaneMachinesUpToDateNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason - - // ClusterControlPlaneMachinesUpToDateInternalErrorV1Beta2Reason surfaces unexpected failures when listing control plane machines - // or aggregating status. - ClusterControlPlaneMachinesUpToDateInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// Cluster's WorkerMachinesUpToDate condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // ClusterWorkerMachinesUpToDateV1Beta2Condition 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. - ClusterWorkerMachinesUpToDateV1Beta2Condition = "WorkerMachinesUpToDate" - - // ClusterWorkerMachinesUpToDateV1Beta2Reason surfaces when all the worker machine's UpToDate conditions are true. - ClusterWorkerMachinesUpToDateV1Beta2Reason = UpToDateV1Beta2Reason - - // ClusterWorkerMachinesNotUpToDateV1Beta2Reason surfaces when at least one of the worker machine's UpToDate conditions is false. - ClusterWorkerMachinesNotUpToDateV1Beta2Reason = NotUpToDateV1Beta2Reason - - // ClusterWorkerMachinesUpToDateUnknownV1Beta2Reason 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. - ClusterWorkerMachinesUpToDateUnknownV1Beta2Reason = UpToDateUnknownV1Beta2Reason - - // ClusterWorkerMachinesUpToDateNoReplicasV1Beta2Reason surfaces when no worker machines exist for the Cluster. - ClusterWorkerMachinesUpToDateNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason - - // ClusterWorkerMachinesUpToDateInternalErrorV1Beta2Reason surfaces unexpected failures when listing worker machines - // or aggregating status. - ClusterWorkerMachinesUpToDateInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// Cluster's RemoteConnectionProbe condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // ClusterRemoteConnectionProbeV1Beta2Condition 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). - ClusterRemoteConnectionProbeV1Beta2Condition = "RemoteConnectionProbe" - - // ClusterRemoteConnectionProbeFailedV1Beta2Reason surfaces issues with the connection to the workload cluster. - ClusterRemoteConnectionProbeFailedV1Beta2Reason = "ProbeFailed" - - // ClusterRemoteConnectionProbeSucceededV1Beta2Reason is used to report a working connection with the workload cluster. - ClusterRemoteConnectionProbeSucceededV1Beta2Reason = "ProbeSucceeded" -) - -// Cluster's RollingOut condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // ClusterRollingOutV1Beta2Condition is the summary of `RollingOut` conditions from ControlPlane, MachineDeployments - // and MachinePools. - ClusterRollingOutV1Beta2Condition = RollingOutV1Beta2Condition - - // ClusterRollingOutV1Beta2Reason surfaces when at least one of the Cluster's control plane, MachineDeployments, - // or MachinePools are rolling out. - ClusterRollingOutV1Beta2Reason = RollingOutV1Beta2Reason - - // ClusterNotRollingOutV1Beta2Reason surfaces when none of the Cluster's control plane, MachineDeployments, - // or MachinePools are rolling out. - ClusterNotRollingOutV1Beta2Reason = NotRollingOutV1Beta2Reason - - // ClusterRollingOutUnknownV1Beta2Reason surfaces when one of the Cluster's control plane, MachineDeployments, - // or MachinePools rolling out condition is unknown, and none true. - ClusterRollingOutUnknownV1Beta2Reason = "RollingOutUnknown" - - // ClusterRollingOutInternalErrorV1Beta2Reason surfaces unexpected failures when listing machines - // or computing the RollingOut condition. - ClusterRollingOutInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// Cluster's ScalingUp condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // ClusterScalingUpV1Beta2Condition is the summary of `ScalingUp` conditions from ControlPlane, MachineDeployments, - // MachinePools and stand-alone MachineSets. - ClusterScalingUpV1Beta2Condition = ScalingUpV1Beta2Condition - - // ClusterScalingUpV1Beta2Reason surfaces when at least one of the Cluster's control plane, MachineDeployments, - // MachinePools and stand-alone MachineSets are scaling up. - ClusterScalingUpV1Beta2Reason = ScalingUpV1Beta2Reason - - // ClusterNotScalingUpV1Beta2Reason surfaces when none of the Cluster's control plane, MachineDeployments, - // MachinePools and stand-alone MachineSets are scaling up. - ClusterNotScalingUpV1Beta2Reason = NotScalingUpV1Beta2Reason - - // ClusterScalingUpUnknownV1Beta2Reason surfaces when one of the Cluster's control plane, MachineDeployments, - // MachinePools and stand-alone MachineSets scaling up condition is unknown, and none true. - ClusterScalingUpUnknownV1Beta2Reason = "ScalingUpUnknown" - - // ClusterScalingUpInternalErrorV1Beta2Reason surfaces unexpected failures when listing machines - // or computing the ScalingUp condition. - ClusterScalingUpInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// Cluster's ScalingDown condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // ClusterScalingDownV1Beta2Condition is the summary of `ScalingDown` conditions from ControlPlane, MachineDeployments, - // MachinePools and stand-alone MachineSets. - ClusterScalingDownV1Beta2Condition = ScalingDownV1Beta2Condition - - // ClusterScalingDownV1Beta2Reason surfaces when at least one of the Cluster's control plane, MachineDeployments, - // MachinePools and stand-alone MachineSets are scaling down. - ClusterScalingDownV1Beta2Reason = ScalingDownV1Beta2Reason - - // ClusterNotScalingDownV1Beta2Reason surfaces when none of the Cluster's control plane, MachineDeployments, - // MachinePools and stand-alone MachineSets are scaling down. - ClusterNotScalingDownV1Beta2Reason = NotScalingDownV1Beta2Reason - - // ClusterScalingDownUnknownV1Beta2Reason surfaces when one of the Cluster's control plane, MachineDeployments, - // MachinePools and stand-alone MachineSets scaling down condition is unknown, and none true. - ClusterScalingDownUnknownV1Beta2Reason = "ScalingDownUnknown" - - // ClusterScalingDownInternalErrorV1Beta2Reason surfaces unexpected failures when listing machines - // or computing the ScalingDown condition. - ClusterScalingDownInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// Cluster's Remediating condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // ClusterRemediatingV1Beta2Condition surfaces details about ongoing remediation of the controlled machines, if any. - ClusterRemediatingV1Beta2Condition = RemediatingV1Beta2Condition - - // ClusterRemediatingV1Beta2Reason surfaces when the Cluster has at least one machine with HealthCheckSucceeded set to false - // and with the OwnerRemediated condition set to false. - ClusterRemediatingV1Beta2Reason = RemediatingV1Beta2Reason - - // ClusterNotRemediatingV1Beta2Reason surfaces when the Cluster does not have any machine with HealthCheckSucceeded set to false - // and with the OwnerRemediated condition set to false. - ClusterNotRemediatingV1Beta2Reason = NotRemediatingV1Beta2Reason - - // ClusterRemediatingInternalErrorV1Beta2Reason surfaces unexpected failures when computing the Remediating condition. - ClusterRemediatingInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// Cluster's Deleting condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // ClusterDeletingV1Beta2Condition surfaces details about ongoing deletion of the cluster. - ClusterDeletingV1Beta2Condition = DeletingV1Beta2Condition - - // ClusterNotDeletingV1Beta2Reason surfaces when the Cluster is not deleting because the - // DeletionTimestamp is not set. - ClusterNotDeletingV1Beta2Reason = NotDeletingV1Beta2Reason - - // ClusterDeletingWaitingForBeforeDeleteHookV1Beta2Reason surfaces when the Cluster deletion - // waits for the ClusterDelete hooks to allow deletion to complete. - ClusterDeletingWaitingForBeforeDeleteHookV1Beta2Reason = "WaitingForBeforeDeleteHook" - - // ClusterDeletingWaitingForWorkersDeletionV1Beta2Reason surfaces when the Cluster deletion - // waits for the workers Machines and the object controlling those machines (MachinePools, MachineDeployments, MachineSets) - // to be deleted. - ClusterDeletingWaitingForWorkersDeletionV1Beta2Reason = "WaitingForWorkersDeletion" - - // ClusterDeletingWaitingForControlPlaneDeletionV1Beta2Reason surfaces when the Cluster deletion - // waits for the ControlPlane to be deleted. - ClusterDeletingWaitingForControlPlaneDeletionV1Beta2Reason = "WaitingForControlPlaneDeletion" - - // ClusterDeletingWaitingForInfrastructureDeletionV1Beta2Reason surfaces when the Cluster deletion - // waits for the InfraCluster to be deleted. - ClusterDeletingWaitingForInfrastructureDeletionV1Beta2Reason = "WaitingForInfrastructureDeletion" - - // ClusterDeletingDeletionCompletedV1Beta2Reason 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. - ClusterDeletingDeletionCompletedV1Beta2Reason = DeletionCompletedV1Beta2Reason - - // ClusterDeletingInternalErrorV1Beta2Reason surfaces unexpected failures when deleting a cluster. - ClusterDeletingInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// ClusterSpec defines the desired state of Cluster. -type ClusterSpec struct { - // paused can be used to prevent controllers from processing the Cluster and all its associated objects. - // +optional - Paused bool `json:"paused,omitempty"` - - // clusterNetwork represents the cluster network configuration. - // +optional - ClusterNetwork *ClusterNetwork `json:"clusterNetwork,omitempty"` - - // controlPlaneEndpoint represents the endpoint used to communicate with the control plane. - // +optional - ControlPlaneEndpoint APIEndpoint `json:"controlPlaneEndpoint,omitempty"` - - // controlPlaneRef is an optional reference to a provider-specific resource that holds - // the details for provisioning the Control Plane for a Cluster. - // +optional - ControlPlaneRef *corev1.ObjectReference `json:"controlPlaneRef,omitempty"` - - // infrastructureRef is a reference to a provider-specific resource that holds the details - // for provisioning infrastructure for a cluster in said provider. - // +optional - InfrastructureRef *corev1.ObjectReference `json:"infrastructureRef,omitempty"` - - // 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"` - - // 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. - // - // NOTE: this field is considered only for computing v1beta2 conditions. - // +optional - // +listType=map - // +listMapKey=conditionType - // +kubebuilder:validation:MaxItems=32 - AvailabilityGates []ClusterAvailabilityGate `json:"availabilityGates,omitempty"` -} - -// ConditionPolarity defines the polarity for a metav1.Condition. -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"` - - // 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. - // +kubebuilder:validation:Enum=Positive;Negative - // +optional - Polarity ConditionPolarity `json:"polarity,omitempty"` -} - -// Topology encapsulates the information of the managed resources. -type Topology struct { - // class is the name of the ClusterClass object to create the topology. - // +required - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=253 - Class string `json:"class"` - - // classNamespace is the namespace of the ClusterClass that should be used for the topology. - // If classNamespace is empty or not set, it is defaulted to the namespace of the Cluster object. - // classNamespace 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])?$` - ClassNamespace string `json:"classNamespace,omitempty"` - - // version is the Kubernetes version of the cluster. - // +required - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=256 - Version string `json:"version"` - - // rolloutAfter performs a rollout of the entire cluster one component at a time, - // control plane first and then machine deployments. - // - // Deprecated: This field has no function and is going to be removed in the next apiVersion. - // - // +optional - RolloutAfter *metav1.Time `json:"rolloutAfter,omitempty"` - - // controlPlane describes the cluster control plane. - // +optional - ControlPlane ControlPlaneTopology `json:"controlPlane,omitempty"` - - // workers encapsulates the different constructs that form the worker nodes - // for the cluster. - // +optional - Workers *WorkersTopology `json:"workers,omitempty"` - - // 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:MaxItems=1000 - Variables []ClusterVariable `json:"variables,omitempty"` -} - -// ControlPlaneTopology specifies the parameters for the control plane nodes in the cluster. -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"` - - // replicas is the number of control plane nodes. - // If the value is nil, the ControlPlane object is created without the number of Replicas - // and it's assumed that the control plane controller does not implement support for this field. - // When specified against a control plane provider that lacks support for this field, this value will be ignored. - // +optional - Replicas *int32 `json:"replicas,omitempty"` - - // machineHealthCheck allows to enable, disable and override - // the MachineHealthCheck configuration in the ClusterClass for this control plane. - // +optional - MachineHealthCheck *MachineHealthCheckTopology `json:"machineHealthCheck,omitempty"` - - // nodeDrainTimeout is the total amount of time that the controller will spend on draining a node. - // The default value is 0, meaning that the node can be drained without any time limitations. - // NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` - // +optional - NodeDrainTimeout *metav1.Duration `json:"nodeDrainTimeout,omitempty"` - - // nodeVolumeDetachTimeout 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 - NodeVolumeDetachTimeout *metav1.Duration `json:"nodeVolumeDetachTimeout,omitempty"` - - // nodeDeletionTimeout 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 - NodeDeletionTimeout *metav1.Duration `json:"nodeDeletionTimeout,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 ControlPlaneClass will be used, if any. - // - // NOTE: This field is considered only for computing v1beta2 conditions. - // 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:MaxItems=32 - ReadinessGates []MachineReadinessGate `json:"readinessGates,omitempty"` - - // variables can be used to customize the ControlPlane through patches. - // +optional - Variables *ControlPlaneVariables `json:"variables,omitempty"` -} - -// WorkersTopology represents the different sets of worker nodes in the cluster. -type WorkersTopology struct { - // machineDeployments is a list of machine deployments in the cluster. - // +optional - // +listType=map - // +listMapKey=name - // +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: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"` - - // 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"` - - // 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 - Name string `json:"name"` - - // 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"` - - // machineHealthCheck allows to enable, disable and override - // the MachineHealthCheck configuration in the ClusterClass for this MachineDeployment. - // +optional - MachineHealthCheck *MachineHealthCheckTopology `json:"machineHealthCheck,omitempty"` - - // nodeDrainTimeout is the total amount of time that the controller will spend on draining a node. - // The default value is 0, meaning that the node can be drained without any time limitations. - // NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` - // +optional - NodeDrainTimeout *metav1.Duration `json:"nodeDrainTimeout,omitempty"` - - // nodeVolumeDetachTimeout 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 - NodeVolumeDetachTimeout *metav1.Duration `json:"nodeVolumeDetachTimeout,omitempty"` - - // nodeDeletionTimeout 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 - NodeDeletionTimeout *metav1.Duration `json:"nodeDeletionTimeout,omitempty"` - - // minReadySeconds is the minimum number of seconds for which a newly created machine should - // be ready. - // Defaults to 0 (machine will be considered available as soon as it - // is ready) - // +optional - MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` - - // 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. - // - // NOTE: This field is considered only for computing v1beta2 conditions. - // +optional - // +listType=map - // +listMapKey=conditionType - // +kubebuilder:validation:MaxItems=32 - ReadinessGates []MachineReadinessGate `json:"readinessGates,omitempty"` - - // strategy is the deployment strategy to use to replace existing machines with - // new ones. - // +optional - Strategy *MachineDeploymentStrategy `json:"strategy,omitempty"` - - // variables can be used to customize the MachineDeployment through patches. - // +optional - Variables *MachineDeploymentVariables `json:"variables,omitempty"` -} - -// MachineHealthCheckTopology defines a MachineHealthCheck for a group of machines. -type MachineHealthCheckTopology struct { - // enable 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 - Enable *bool `json:"enable,omitempty"` - - // MachineHealthCheckClass defines a MachineHealthCheck for a group of machines. - // If specified (any field is set), it entirely overrides the MachineHealthCheckClass defined in ClusterClass. - MachineHealthCheckClass `json:",inline"` -} - -// 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"` - - // 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"` - - // 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 - Name string `json:"name"` - - // 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 - // +kubebuilder:validation:MaxItems=100 - // +kubebuilder:validation:items:MinLength=1 - // +kubebuilder:validation:items:MaxLength=256 - FailureDomains []string `json:"failureDomains,omitempty"` - - // nodeDrainTimeout is the total amount of time that the controller will spend on draining a node. - // The default value is 0, meaning that the node can be drained without any time limitations. - // NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` - // +optional - NodeDrainTimeout *metav1.Duration `json:"nodeDrainTimeout,omitempty"` - - // nodeVolumeDetachTimeout 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 - NodeVolumeDetachTimeout *metav1.Duration `json:"nodeVolumeDetachTimeout,omitempty"` - - // nodeDeletionTimeout 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 - NodeDeletionTimeout *metav1.Duration `json:"nodeDeletionTimeout,omitempty"` - - // 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 - 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"` -} - -// 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"` - - // definitionFrom specifies where the definition of this Variable is from. - // - // Deprecated: This field is deprecated, must not be set anymore and is going to be removed in the next apiVersion. - // - // +optional - // +kubebuilder:validation:MaxLength=256 - DefinitionFrom string `json:"definitionFrom,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"` -} - -// ControlPlaneVariables can be used to provide variables for the ControlPlane. -type ControlPlaneVariables struct { - // overrides can be used to override Cluster level variables. - // +optional - // +listType=map - // +listMapKey=name - // +kubebuilder:validation:MaxItems=1000 - Overrides []ClusterVariable `json:"overrides,omitempty"` -} - -// MachineDeploymentVariables can be used to provide variables for a specific MachineDeployment. -type MachineDeploymentVariables struct { - // overrides can be used to override Cluster level variables. - // +optional - // +listType=map - // +listMapKey=name - // +kubebuilder:validation:MaxItems=1000 - Overrides []ClusterVariable `json:"overrides,omitempty"` -} - -// MachinePoolVariables can be used to provide variables for a specific MachinePool. -type MachinePoolVariables struct { - // overrides can be used to override Cluster level variables. - // +optional - // +listType=map - // +listMapKey=name - // +kubebuilder:validation:MaxItems=1000 - Overrides []ClusterVariable `json:"overrides,omitempty"` -} - -// ClusterNetwork specifies the different networking -// parameters for a cluster. -type ClusterNetwork struct { - // apiServerPort specifies the port the API Server should bind to. - // Defaults to 6443. - // +optional - APIServerPort *int32 `json:"apiServerPort,omitempty"` - - // services is the network ranges from which service VIPs are allocated. - // +optional - Services *NetworkRanges `json:"services,omitempty"` - - // pods is the network ranges from which Pod networks are allocated. - // +optional - Pods *NetworkRanges `json:"pods,omitempty"` - - // 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 - // +kubebuilder:validation:MaxItems=100 - // +kubebuilder:validation:items:MinLength=1 - // +kubebuilder:validation:items:MaxLength=43 - CIDRBlocks []string `json:"cidrBlocks"` -} - -func (n NetworkRanges) String() string { - if len(n.CIDRBlocks) == 0 { - return "" - } - return strings.Join(n.CIDRBlocks, ",") -} - -// ClusterStatus defines the observed state of Cluster. -type ClusterStatus struct { - // failureDomains is a slice of failure domain objects synced from the infrastructure provider. - // +optional - FailureDomains FailureDomains `json:"failureDomains,omitempty"` - - // failureReason indicates that there is a fatal problem reconciling the - // state, and will be set to a token value suitable for - // programmatic interpretation. - // - // 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"` - - // phase represents the current phase of cluster actuation. - // +optional - // +kubebuilder:validation:Enum=Pending;Provisioning;Provisioned;Deleting;Failed;Unknown - Phase string `json:"phase,omitempty"` - - // infrastructureReady is the state of the infrastructure provider. - // +optional - InfrastructureReady bool `json:"infrastructureReady"` - - // controlPlaneReady denotes if the control plane became ready during initial provisioning - // to receive requests. - // 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. Please use conditions - // to check the operational state of the control plane. - // +optional - ControlPlaneReady bool `json:"controlPlaneReady"` - - // conditions defines current service state of the cluster. - // +optional - Conditions Conditions `json:"conditions,omitempty"` - - // observedGeneration is the latest generation observed by the controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // v1beta2 groups all the fields that will be added or modified in Cluster's status with the V1Beta2 version. - // +optional - V1Beta2 *ClusterV1Beta2Status `json:"v1beta2,omitempty"` -} - -// ClusterV1Beta2Status groups all the fields that will be added or modified in Cluster 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 ClusterV1Beta2Status 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"` - - // 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"` -} - -// 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. -type APIEndpoint struct { - // host is the hostname on which the API server is serving. - // TODO: Can't set MinLength=1 for now, because this struct is not always used in pointer fields so today we have cases where host is set to an empty string. - // +required - // +kubebuilder:validation:MaxLength=512 - Host string `json:"host"` - - // port is the port on which the API server is serving. - // +required - Port int32 `json:"port"` -} - -// IsZero returns true if both host and port are zero values. -func (v APIEndpoint) IsZero() bool { - return v.Host == "" && v.Port == 0 -} - -// IsValid returns true if both host and port are non-zero values. -func (v APIEndpoint) IsValid() bool { - return v.Host != "" && v.Port != 0 -} - -// String returns a formatted version HOST:PORT of this APIEndpoint. -func (v APIEndpoint) String() string { - return net.JoinHostPort(v.Host, fmt.Sprintf("%d", v.Port)) -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=clusters,shortName=cl,scope=Namespaced,categories=cluster-api -// +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" -// +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. - // +optional - Spec ClusterSpec `json:"spec,omitempty"` - // status is the observed state of Cluster. - // +optional - Status ClusterStatus `json:"status,omitempty"` -} - -// GetClassKey returns the namespaced name for the class associated with this object. -func (c *Cluster) GetClassKey() types.NamespacedName { - if c.Spec.Topology == nil { - return types.NamespacedName{} - } - - namespace := cmp.Or(c.Spec.Topology.ClassNamespace, c.Namespace) - return types.NamespacedName{Namespace: namespace, Name: c.Spec.Topology.Class} -} - -// GetConditions returns the set of conditions for this object. -func (c *Cluster) GetConditions() Conditions { - return c.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (c *Cluster) SetConditions(conditions Conditions) { - c.Status.Conditions = conditions -} - -// GetV1Beta2Conditions returns the set of conditions for this object. -func (c *Cluster) GetV1Beta2Conditions() []metav1.Condition { - if c.Status.V1Beta2 == nil { - return nil - } - return c.Status.V1Beta2.Conditions -} - -// SetV1Beta2Conditions sets conditions for an API object. -func (c *Cluster) SetV1Beta2Conditions(conditions []metav1.Condition) { - if c.Status.V1Beta2 == nil { - c.Status.V1Beta2 = &ClusterV1Beta2Status{} - } - c.Status.V1Beta2.Conditions = conditions -} - -// GetIPFamily returns a ClusterIPFamily from the configuration provided. -// -// Deprecated: IPFamily is not a concept in Kubernetes. It was originally introduced in CAPI for CAPD. -// IPFamily will be dropped in a future release. More details at https://github.com/kubernetes-sigs/cluster-api/issues/7521 -func (c *Cluster) GetIPFamily() (ClusterIPFamily, error) { - var podCIDRs, serviceCIDRs []string - if c.Spec.ClusterNetwork != nil { - if c.Spec.ClusterNetwork.Pods != nil { - podCIDRs = c.Spec.ClusterNetwork.Pods.CIDRBlocks - } - if c.Spec.ClusterNetwork.Services != nil { - serviceCIDRs = c.Spec.ClusterNetwork.Services.CIDRBlocks - } - } - if len(podCIDRs) == 0 && len(serviceCIDRs) == 0 { - return IPv4IPFamily, nil - } - - podsIPFamily, err := ipFamilyForCIDRStrings(podCIDRs) - if err != nil { - return InvalidIPFamily, fmt.Errorf("pods: %s", err) - } - if len(serviceCIDRs) == 0 { - return podsIPFamily, nil - } - - servicesIPFamily, err := ipFamilyForCIDRStrings(serviceCIDRs) - if err != nil { - return InvalidIPFamily, fmt.Errorf("services: %s", err) - } - if len(podCIDRs) == 0 { - return servicesIPFamily, nil - } - - if podsIPFamily == DualStackIPFamily { - return DualStackIPFamily, nil - } else if podsIPFamily != servicesIPFamily { - return InvalidIPFamily, errors.New("pods and services IP family mismatch") - } - - return podsIPFamily, nil -} - -func ipFamilyForCIDRStrings(cidrs []string) (ClusterIPFamily, error) { - if len(cidrs) > 2 { - return InvalidIPFamily, errors.New("too many CIDRs specified") - } - var foundIPv4 bool - var foundIPv6 bool - for _, cidr := range cidrs { - ip, _, err := net.ParseCIDR(cidr) - if err != nil { - return InvalidIPFamily, fmt.Errorf("could not parse CIDR: %s", err) - } - if ip.To4() != nil { - foundIPv4 = true - } else { - foundIPv6 = true - } - } - switch { - case foundIPv4 && foundIPv6: - return DualStackIPFamily, nil - case foundIPv4: - return IPv4IPFamily, nil - case foundIPv6: - return IPv6IPFamily, nil - default: - return InvalidIPFamily, nil - } -} - -// ClusterIPFamily defines the types of supported IP families. -type ClusterIPFamily int - -// Define the ClusterIPFamily constants. -const ( - InvalidIPFamily ClusterIPFamily = iota - IPv4IPFamily - IPv6IPFamily - DualStackIPFamily -) - -func (f ClusterIPFamily) String() string { - return [...]string{"InvalidIPFamily", "IPv4IPFamily", "IPv6IPFamily", "DualStackIPFamily"}[f] -} - -// +kubebuilder:object:root=true - -// ClusterList contains a list of Cluster. -type ClusterList struct { - metav1.TypeMeta `json:",inline"` - // 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{}) -} - -// FailureDomains is a slice of FailureDomains. -type FailureDomains map[string]FailureDomainSpec - -// FilterControlPlane returns a FailureDomain slice containing only the domains suitable to be used -// for control plane nodes. -func (in FailureDomains) FilterControlPlane() FailureDomains { - res := make(FailureDomains) - for id, spec := range in { - if spec.ControlPlane { - res[id] = spec - } - } - return res -} - -// GetIDs returns a slice containing the ids for failure domains. -func (in FailureDomains) GetIDs() []*string { - ids := make([]*string, 0, len(in)) - for id := range in { - ids = append(ids, ptr.To(id)) - } - return ids -} - -// FailureDomainSpec is the Schema for Cluster API failure domains. -// It allows controllers to understand how many failure domains a cluster can optionally span across. -type FailureDomainSpec struct { - // controlPlane determines if this failure domain is suitable for use by control plane machines. - // +optional - ControlPlane bool `json:"controlPlane,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/v1beta1/clusterclass_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/clusterclass_types.go deleted file mode 100644 index 058507504f..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/clusterclass_types.go +++ /dev/null @@ -1,1261 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - "reflect" - - 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/util/intstr" -) - -// ClusterClassKind represents the Kind of ClusterClass. -const ClusterClassKind = "ClusterClass" - -// ClusterClass VariablesReady condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // ClusterClassVariablesReadyV1Beta2Condition 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. - ClusterClassVariablesReadyV1Beta2Condition = "VariablesReady" - - // ClusterClassVariablesReadyV1Beta2Reason surfaces that the variables are ready. - ClusterClassVariablesReadyV1Beta2Reason = "VariablesReady" - - // ClusterClassVariablesReadyVariableDiscoveryFailedV1Beta2Reason surfaces that variable discovery failed. - ClusterClassVariablesReadyVariableDiscoveryFailedV1Beta2Reason = "VariableDiscoveryFailed" -) - -// ClusterClass RefVersionsUpToDate condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // ClusterClassRefVersionsUpToDateV1Beta2Condition 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). - ClusterClassRefVersionsUpToDateV1Beta2Condition = "RefVersionsUpToDate" - - // ClusterClassRefVersionsUpToDateV1Beta2Reason 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). - ClusterClassRefVersionsUpToDateV1Beta2Reason = "RefVersionsUpToDate" - - // ClusterClassRefVersionsNotUpToDateV1Beta2Reason 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). - ClusterClassRefVersionsNotUpToDateV1Beta2Reason = "RefVersionsNotUpToDate" - - // ClusterClassRefVersionsUpToDateInternalErrorV1Beta2Reason surfaces that an unexpected error occurred when validating - // if the references are up-to-date. - ClusterClassRefVersionsUpToDateInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=clusterclasses,shortName=cc,scope=Namespaced,categories=cluster-api -// +kubebuilder:deprecatedversion -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of ClusterClass" - -// ClusterClass is a template which can be used to create managed topologies. -type ClusterClass struct { - metav1.TypeMeta `json:",inline"` - // 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. - // +optional - Spec ClusterClassSpec `json:"spec,omitempty"` - // status is the observed state of ClusterClass. - // +optional - Status ClusterClassStatus `json:"status,omitempty"` -} - -// ClusterClassSpec describes the desired state of the ClusterClass. -type ClusterClassSpec struct { - // availabilityGates specifies additional conditions to include when evaluating Cluster Available condition. - // - // NOTE: this field is considered only for computing v1beta2 conditions. - // 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:MaxItems=32 - AvailabilityGates []ClusterAvailabilityGate `json:"availabilityGates,omitempty"` - - // 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. - // +optional - Infrastructure LocalObjectTemplate `json:"infrastructure,omitempty"` - - // infrastructureNamingStrategy allows changing the naming pattern used when creating the infrastructure object. - // +optional - InfrastructureNamingStrategy *InfrastructureNamingStrategy `json:"infrastructureNamingStrategy,omitempty"` - - // controlPlane is a reference to a local struct that holds the details - // for provisioning the Control Plane for the Cluster. - // +optional - ControlPlane ControlPlaneClass `json:"controlPlane,omitempty"` - - // workers describes the worker nodes for the cluster. - // It is a collection of node types which can be used to create - // the worker nodes of the cluster. - // +optional - Workers WorkersClass `json:"workers,omitempty"` - - // variables defines the variables which can be configured - // in the Cluster topology and are then used in patches. - // +optional - // +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 - // +kubebuilder:validation:MaxItems=1000 - Patches []ClusterClassPatch `json:"patches,omitempty"` -} - -// 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"` - - // LocalObjectTemplate contains the reference to the control plane provider. - LocalObjectTemplate `json:",inline"` - - // 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 *LocalObjectTemplate `json:"machineInfrastructure,omitempty"` - - // 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. - // +optional - MachineHealthCheck *MachineHealthCheckClass `json:"machineHealthCheck,omitempty"` - - // namingStrategy allows changing the naming pattern used when creating the control plane provider object. - // +optional - NamingStrategy *ControlPlaneClassNamingStrategy `json:"namingStrategy,omitempty"` - - // nodeDrainTimeout is the total amount of time that the controller will spend on draining a node. - // The default value is 0, meaning that the node can be drained without any time limitations. - // NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` - // NOTE: This value can be overridden while defining a Cluster.Topology. - // +optional - NodeDrainTimeout *metav1.Duration `json:"nodeDrainTimeout,omitempty"` - - // nodeVolumeDetachTimeout 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 - NodeVolumeDetachTimeout *metav1.Duration `json:"nodeVolumeDetachTimeout,omitempty"` - - // nodeDeletionTimeout 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 - NodeDeletionTimeout *metav1.Duration `json:"nodeDeletionTimeout,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: This field is considered only for computing v1beta2 conditions. - // 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:MaxItems=32 - ReadinessGates []MachineReadinessGate `json:"readinessGates,omitempty"` -} - -// ControlPlaneClassNamingStrategy defines the naming strategy for control plane objects. -type ControlPlaneClassNamingStrategy 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"` -} - -// InfrastructureNamingStrategy defines the naming strategy for infrastructure objects. -type InfrastructureNamingStrategy 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. -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: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: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 { - // 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"` - - // template is a local struct containing a collection of templates for creation of - // MachineDeployment objects representing a set of worker nodes. - // +required - Template MachineDeploymentClassTemplate `json:"template"` - - // machineHealthCheck defines a MachineHealthCheck for this MachineDeploymentClass. - // +optional - MachineHealthCheck *MachineHealthCheckClass `json:"machineHealthCheck,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. - // 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"` - - // namingStrategy allows changing the naming pattern used when creating the MachineDeployment. - // +optional - NamingStrategy *MachineDeploymentClassNamingStrategy `json:"namingStrategy,omitempty"` - - // nodeDrainTimeout is the total amount of time that the controller will spend on draining a node. - // The default value is 0, meaning that the node can be drained without any time limitations. - // NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` - // NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass. - // +optional - NodeDrainTimeout *metav1.Duration `json:"nodeDrainTimeout,omitempty"` - - // nodeVolumeDetachTimeout 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 - NodeVolumeDetachTimeout *metav1.Duration `json:"nodeVolumeDetachTimeout,omitempty"` - - // nodeDeletionTimeout 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 - NodeDeletionTimeout *metav1.Duration `json:"nodeDeletionTimeout,omitempty"` - - // minReadySeconds is the minimum number of seconds for which a newly created machine should - // be ready. - // Defaults to 0 (machine will be considered available as soon as it - // is ready) - // NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass. - // +optional - 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: This field is considered only for computing v1beta2 conditions. - // 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:MaxItems=32 - ReadinessGates []MachineReadinessGate `json:"readinessGates,omitempty"` - - // 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. - // +optional - Strategy *MachineDeploymentStrategy `json:"strategy,omitempty"` -} - -// MachineDeploymentClassTemplate defines how a MachineDeployment generated from a MachineDeploymentClass -// should look like. -type MachineDeploymentClassTemplate 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"` - - // bootstrap contains the bootstrap template reference to be used - // for the creation of worker Machines. - // +required - Bootstrap LocalObjectTemplate `json:"bootstrap"` - - // infrastructure contains the infrastructure template reference to be used - // for the creation of worker Machines. - // +required - Infrastructure LocalObjectTemplate `json:"infrastructure"` -} - -// MachineDeploymentClassNamingStrategy defines the naming strategy for machine deployment objects. -type MachineDeploymentClassNamingStrategy 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"` -} - -// MachineHealthCheckClass defines a MachineHealthCheck for a group of Machines. -type MachineHealthCheckClass struct { - // unhealthyConditions contains a list of the conditions that determine - // whether a node is considered unhealthy. The conditions are combined in a - // logical OR, i.e. if any of the conditions is met, the node is unhealthy. - // - // +optional - // +kubebuilder:validation:MaxItems=100 - UnhealthyConditions []UnhealthyCondition `json:"unhealthyConditions,omitempty"` - - // maxUnhealthy specifies the maximum number of unhealthy machines allowed. - // Any further remediation is only allowed if at most "maxUnhealthy" machines selected by - // "selector" are not healthy. - // +optional - MaxUnhealthy *intstr.IntOrString `json:"maxUnhealthy,omitempty"` - - // unhealthyRange specifies the range of unhealthy machines allowed. - // Any further remediation is only allowed if the number of machines selected by "selector" as not healthy - // is within the range of "unhealthyRange". Takes precedence over maxUnhealthy. - // Eg. "[3-5]" - This means that remediation will be allowed only when: - // (a) there are at least 3 unhealthy machines (and) - // (b) there are at most 5 unhealthy machines - // +optional - // +kubebuilder:validation:Pattern=^\[[0-9]+-[0-9]+\]$ - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=32 - UnhealthyRange *string `json:"unhealthyRange,omitempty"` - - // nodeStartupTimeout 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 - NodeStartupTimeout *metav1.Duration `json:"nodeStartupTimeout,omitempty"` - - // remediationTemplate is a reference to a remediation template - // provided by an infrastructure provider. - // - // This field is completely optional, when filled, the MachineHealthCheck controller - // creates a new object from the template referenced and hands off remediation of the machine to - // a controller that lives outside of Cluster API. - // +optional - RemediationTemplate *corev1.ObjectReference `json:"remediationTemplate,omitempty"` -} - -// MachinePoolClass serves as a template to define a pool of worker nodes of the cluster -// provisioned using `ClusterClass`. -type MachinePoolClass struct { - // 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"` - - // template is a local struct containing a collection of templates for creation of - // MachinePools objects representing a pool of worker nodes. - // +required - Template MachinePoolClassTemplate `json:"template"` - - // 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 - // +kubebuilder:validation:MaxItems=100 - // +kubebuilder:validation:items:MinLength=1 - // +kubebuilder:validation:items:MaxLength=256 - FailureDomains []string `json:"failureDomains,omitempty"` - - // namingStrategy allows changing the naming pattern used when creating the MachinePool. - // +optional - NamingStrategy *MachinePoolClassNamingStrategy `json:"namingStrategy,omitempty"` - - // nodeDrainTimeout is the total amount of time that the controller will spend on draining a node. - // The default value is 0, meaning that the node can be drained without any time limitations. - // NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` - // NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass. - // +optional - NodeDrainTimeout *metav1.Duration `json:"nodeDrainTimeout,omitempty"` - - // nodeVolumeDetachTimeout 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 - NodeVolumeDetachTimeout *metav1.Duration `json:"nodeVolumeDetachTimeout,omitempty"` - - // nodeDeletionTimeout 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 - NodeDeletionTimeout *metav1.Duration `json:"nodeDeletionTimeout,omitempty"` - - // 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 - MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` -} - -// MachinePoolClassTemplate defines how a MachinePool generated from a MachinePoolClass -// should look like. -type MachinePoolClassTemplate 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"` - - // bootstrap contains the bootstrap template reference to be used - // for the creation of the Machines in the MachinePool. - // +required - Bootstrap LocalObjectTemplate `json:"bootstrap"` - - // infrastructure contains the infrastructure template reference to be used - // for the creation of the MachinePool. - // +required - Infrastructure LocalObjectTemplate `json:"infrastructure"` -} - -// MachinePoolClassNamingStrategy defines the naming strategy for machine pool objects. -type MachinePoolClassNamingStrategy 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"` -} - -// IsZero returns true if none of the values of MachineHealthCheckClass are defined. -func (m MachineHealthCheckClass) IsZero() bool { - return reflect.ValueOf(m).IsZero() -} - -// 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"` - - // 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"` - - // metadata 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 is going to be removed in the next apiVersion. Please use XMetadata in JSONSchemaProps instead. - // - // +optional - Metadata ClusterClassVariableMetadata `json:"metadata,omitempty"` - - // schema defines the schema of the variable. - // +required - Schema VariableSchema `json:"schema"` -} - -// 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. -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"` -} - -// 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. -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 - // +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 - // +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: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"` - - // 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. -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"` - // 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/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. - // 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"` - - // 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 - // +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"` - - // 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:MaxItems=100 - // +required - JSONPatches []JSONPatch `json:"jsonPatches"` -} - -// 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. - // +required - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=512 - APIVersion string `json:"apiVersion"` - - // kind filters templates by kind. - // +required - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=256 - Kind string `json:"kind"` - - // matchResources selects templates based on where they are referenced. - // +required - MatchResources PatchSelectorMatch `json:"matchResources"` -} - -// 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 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 - // +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 - // +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"` - - // 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"` - - // 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 GenerateExtension or ValidateExtension must be set. -type ExternalPatchDefinition struct { - // generateExtension references an extension which is called to generate patches. - // +optional - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=512 - GenerateExtension *string `json:"generateExtension,omitempty"` - - // validateExtension references an extension which is called to validate the topology. - // +optional - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=512 - ValidateExtension *string `json:"validateExtension,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"` -} - -// LocalObjectTemplate defines a template for a topology Class. -type LocalObjectTemplate struct { - // ref is a required reference to a custom resource - // offered by a provider. - // +required - Ref *corev1.ObjectReference `json:"ref"` -} - -// ClusterClassStatus defines the observed state of the ClusterClass. -type ClusterClassStatus struct { - // variables is a list of ClusterClassStatusVariable that are defined for the ClusterClass. - // +optional - // +kubebuilder:validation:MaxItems=1000 - Variables []ClusterClassStatusVariable `json:"variables,omitempty"` - - // conditions defines current observed state of the ClusterClass. - // +optional - Conditions Conditions `json:"conditions,omitempty"` - - // observedGeneration is the latest generation observed by the controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // v1beta2 groups all the fields that will be added or modified in ClusterClass's status with the V1Beta2 version. - // +optional - V1Beta2 *ClusterClassV1Beta2Status `json:"v1beta2,omitempty"` -} - -// ClusterClassV1Beta2Status groups all the fields that will be added or modified in ClusterClass 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 ClusterClassV1Beta2Status 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"` -} - -// 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"` - - // definitionsConflict specifies whether or not there are conflicting definitions for a single variable name. - // +optional - DefinitionsConflict bool `json:"definitionsConflict"` - - // definitions is a list of definitions for a variable. - // +kubebuilder:validation:MaxItems=100 - // +required - Definitions []ClusterClassStatusVariableDefinition `json:"definitions"` -} - -// 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"` - - // 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"` - - // metadata 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 is going to be removed in the next apiVersion. - // - // +optional - Metadata ClusterClassVariableMetadata `json:"metadata,omitempty"` - - // schema defines the schema of the variable. - // +required - Schema VariableSchema `json:"schema"` -} - -// GetConditions returns the set of conditions for this object. -func (c *ClusterClass) GetConditions() Conditions { - return c.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (c *ClusterClass) SetConditions(conditions Conditions) { - c.Status.Conditions = conditions -} - -// GetV1Beta2Conditions returns the set of conditions for this object. -func (c *ClusterClass) GetV1Beta2Conditions() []metav1.Condition { - if c.Status.V1Beta2 == nil { - return nil - } - return c.Status.V1Beta2.Conditions -} - -// SetV1Beta2Conditions sets conditions for an API object. -func (c *ClusterClass) SetV1Beta2Conditions(conditions []metav1.Condition) { - if c.Status.V1Beta2 == nil { - c.Status.V1Beta2 = &ClusterClassV1Beta2Status{} - } - c.Status.V1Beta2.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/v1beta1/common_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/common_types.go deleted file mode 100644 index 2006bb88ce..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/common_types.go +++ /dev/null @@ -1,360 +0,0 @@ -/* -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" - apivalidation "k8s.io/apimachinery/pkg/api/validation" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" - "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 MachineDeploymentStrategy 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" -) - -var ( - // ZeroDuration is a zero value of the metav1.Duration type. - ZeroDuration = metav1.Duration{} -) - -// 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"` - - // address is the machine address. - // +required - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=256 - Address string `json:"address"` -} - -// MachineAddresses is a slice of MachineAddress items to be used by infrastructure providers. -type MachineAddresses []MachineAddress - -// ObjectMeta is metadata that all persisted resources must have, which includes all objects -// users must create. This is a copy of customizable fields from metav1.ObjectMeta. -// -// ObjectMeta is embedded in `Machine.Spec`, `MachineDeployment.Template` and `MachineSet.Template`, -// which are not top-level Kubernetes objects. Given that metav1.ObjectMeta has lots of special cases -// and read-only fields which end up in the generated CRD validation, having it as a subset simplifies -// the API and some issues that can impact user experience. -// -// During the [upgrade to controller-tools@v2](https://github.com/kubernetes-sigs/cluster-api/pull/1054) -// for v1alpha2, we noticed a failure would occur running Cluster API test suite against the new CRDs, -// specifically `spec.metadata.creationTimestamp in body must be of type string: "null"`. -// The investigation showed that `controller-tools@v2` behaves differently than its previous version -// when handling types from [metav1](k8s.io/apimachinery/pkg/apis/meta/v1) package. -// -// In more details, we found that embedded (non-top level) types that embedded `metav1.ObjectMeta` -// had validation properties, including for `creationTimestamp` (metav1.Time). -// The `metav1.Time` type specifies a custom json marshaller that, when IsZero() is true, returns `null` -// which breaks validation because the field isn't marked as nullable. -// -// In future versions, controller-tools@v2 might allow overriding the type and validation for embedded -// types. When that happens, this hack should be revisited. -type ObjectMeta struct { - // 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 -} diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/condition_consts.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/condition_consts.go deleted file mode 100644 index 8e36313c79..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/condition_consts.go +++ /dev/null @@ -1,367 +0,0 @@ -/* -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 - -// Common ConditionTypes used by Cluster API objects. -const ( - // ReadyCondition defines the Ready condition type that summarizes the operational state of a Cluster API object. - ReadyCondition ConditionType = "Ready" -) - -// Common ConditionReason used by Cluster API objects. -const ( - // DeletingReason (Severity=Info) documents a condition not in Status=True because the underlying object it is currently being deleted. - DeletingReason = "Deleting" - - // DeletionFailedReason (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. - DeletionFailedReason = "DeletionFailed" - - // DeletedReason (Severity=Info) documents a condition not in Status=True because the underlying object was deleted. - DeletedReason = "Deleted" - - // IncorrectExternalRefReason (Severity=Error) documents a CAPI object with an incorrect external object reference. - IncorrectExternalRefReason = "IncorrectExternalRef" -) - -const ( - // InfrastructureReadyCondition reports a summary of current status of the infrastructure object defined for this cluster/machine/machinepool. - // This condition is mirrored from the Ready condition in the infrastructure ref object, and - // the absence of this condition might signal problems in the reconcile external loops or the fact that - // the infrastructure provider does not implement the Ready condition yet. - InfrastructureReadyCondition ConditionType = "InfrastructureReady" - - // WaitingForInfrastructureFallbackReason (Severity=Info) documents a cluster/machine/machinepool waiting for the underlying infrastructure - // to be available. - // NOTE: This reason is used only as a fallback when the infrastructure object is not reporting its own ready condition. - WaitingForInfrastructureFallbackReason = "WaitingForInfrastructure" -) - -// Conditions and condition Reasons for the ClusterClass object. -const ( - // ClusterClassVariablesReconciledCondition 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. - ClusterClassVariablesReconciledCondition ConditionType = "VariablesReconciled" - - // VariableDiscoveryFailedReason (Severity=Error) documents a ClusterClass with VariableDiscovery extensions that - // failed. - VariableDiscoveryFailedReason = "VariableDiscoveryFailed" -) - -// Conditions and condition Reasons for the Cluster object. - -const ( - // ControlPlaneInitializedCondition reports if the cluster's control plane has been initialized such that the - // cluster's apiserver is reachable. 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. - ControlPlaneInitializedCondition ConditionType = "ControlPlaneInitialized" - - // MissingNodeRefReason (Severity=Info) documents a cluster waiting for at least one control plane Machine to have - // its node reference populated. - MissingNodeRefReason = "MissingNodeRef" - - // WaitingForControlPlaneProviderInitializedReason (Severity=Info) documents a cluster waiting for the control plane - // provider to report successful control plane initialization. - WaitingForControlPlaneProviderInitializedReason = "WaitingForControlPlaneProviderInitialized" - - // ControlPlaneReadyCondition reports the ready condition from the control plane object defined for this cluster. - // This condition is mirrored from the Ready condition in the control plane ref object, and - // the absence of this condition might signal problems in the reconcile external loops or the fact that - // the control plane provider does not implement the Ready condition yet. - ControlPlaneReadyCondition ConditionType = "ControlPlaneReady" - - // WaitingForControlPlaneFallbackReason (Severity=Info) documents a cluster waiting for the control plane - // to be available. - // NOTE: This reason is used only as a fallback when the control plane object is not reporting its own ready condition. - WaitingForControlPlaneFallbackReason = "WaitingForControlPlane" - - // WaitingForControlPlaneAvailableReason (Severity=Info) documents a Cluster API object - // waiting for the control plane machine to be available. - // - // NOTE: Having the control plane machine available is a pre-condition for joining additional control planes - // or workers nodes. - WaitingForControlPlaneAvailableReason = "WaitingForControlPlaneAvailable" -) - -// Conditions and condition Reasons for the Machine object. - -const ( - // BootstrapReadyCondition reports a summary of current status of the bootstrap object defined for this machine. - // This condition is mirrored from the Ready condition in the bootstrap ref object, and - // the absence of this condition might signal problems in the reconcile external loops or the fact that - // the bootstrap provider does not implement the Ready condition yet. - BootstrapReadyCondition ConditionType = "BootstrapReady" - - // WaitingForDataSecretFallbackReason (Severity=Info) documents a machine waiting for the bootstrap data secret - // to be available. - // NOTE: This reason is used only as a fallback when the bootstrap object is not reporting its own ready condition. - WaitingForDataSecretFallbackReason = "WaitingForDataSecret" - - // DrainingSucceededCondition provide evidence of the status of the node drain operation which happens during the machine - // deletion process. - DrainingSucceededCondition ConditionType = "DrainingSucceeded" - - // DrainingReason (Severity=Info) documents a machine node being drained. - DrainingReason = "Draining" - - // DrainingFailedReason (Severity=Warning) documents a machine node drain operation failed. - DrainingFailedReason = "DrainingFailed" - - // PreDrainDeleteHookSucceededCondition reports a machine waiting for a PreDrainDeleteHook before being delete. - PreDrainDeleteHookSucceededCondition ConditionType = "PreDrainDeleteHookSucceeded" - - // PreTerminateDeleteHookSucceededCondition reports a machine waiting for a PreDrainDeleteHook before being delete. - PreTerminateDeleteHookSucceededCondition ConditionType = "PreTerminateDeleteHookSucceeded" - - // WaitingExternalHookReason (Severity=Info) provide evidence that we are waiting for an external hook to complete. - WaitingExternalHookReason = "WaitingExternalHook" - - // VolumeDetachSucceededCondition reports a machine waiting for volumes to be detached. - VolumeDetachSucceededCondition ConditionType = "VolumeDetachSucceeded" - - // WaitingForVolumeDetachReason (Severity=Info) provide evidence that a machine node waiting for volumes to be attached. - WaitingForVolumeDetachReason = "WaitingForVolumeDetach" -) - -const ( - // MachineHealthCheckSucceededCondition 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. - MachineHealthCheckSucceededCondition ConditionType = "HealthCheckSucceeded" - - // MachineHasFailureReason is the reason used when a machine has either a FailureReason or a FailureMessage set on its status. - MachineHasFailureReason = "MachineHasFailure" - - // HasRemediateMachineAnnotationReason is the reason that get's set at the MachineHealthCheckSucceededCondition when a machine - // has the RemediateMachineAnnotation set. - HasRemediateMachineAnnotationReason = "HasRemediateMachineAnnotation" - - // NodeStartupTimeoutReason is the reason used when a machine's node does not appear within the specified timeout. - NodeStartupTimeoutReason = "NodeStartupTimeout" - - // UnhealthyNodeConditionReason is the reason used when a machine's node has one of the MachineHealthCheck's unhealthy conditions. - UnhealthyNodeConditionReason = "UnhealthyNode" -) - -const ( - // MachineOwnerRemediatedCondition is set on machines that have failed a healthcheck by the MachineHealthCheck controller. - // MachineOwnerRemediatedCondition is set to False after a health check fails, but should be changed to True by the owning controller after remediation succeeds. - MachineOwnerRemediatedCondition ConditionType = "OwnerRemediated" - - // WaitingForRemediationReason is the reason used when a machine fails a health check and remediation is needed. - WaitingForRemediationReason = "WaitingForRemediation" - - // RemediationFailedReason is the reason used when a remediation owner fails to remediate an unhealthy machine. - RemediationFailedReason = "RemediationFailed" - - // RemediationInProgressReason is the reason used when an unhealthy machine is being remediated by the remediation owner. - RemediationInProgressReason = "RemediationInProgress" - - // ExternalRemediationTemplateAvailableCondition is set on machinehealthchecks when MachineHealthCheck controller uses external remediation. - // ExternalRemediationTemplateAvailableCondition is set to false if external remediation template is not found. - ExternalRemediationTemplateAvailableCondition ConditionType = "ExternalRemediationTemplateAvailable" - - // ExternalRemediationTemplateNotFoundReason is the reason used when a machine health check fails to find external remediation template. - ExternalRemediationTemplateNotFoundReason = "ExternalRemediationTemplateNotFound" - - // ExternalRemediationRequestAvailableCondition is set on machinehealthchecks when MachineHealthCheck controller uses external remediation. - // ExternalRemediationRequestAvailableCondition is set to false if creating external remediation request fails. - ExternalRemediationRequestAvailableCondition ConditionType = "ExternalRemediationRequestAvailable" - - // ExternalRemediationRequestCreationFailedReason is the reason used when a machine health check fails to create external remediation request. - ExternalRemediationRequestCreationFailedReason = "ExternalRemediationRequestCreationFailed" -) - -// Conditions and condition Reasons for the Machine's Node object. -const ( - // MachineNodeHealthyCondition provides info about the operational state of the Kubernetes node hosted on the machine by summarizing node conditions. - // If the conditions defined in a Kubernetes node (i.e., NodeReady, NodeMemoryPressure, NodeDiskPressure and NodePIDPressure) are in a healthy state, it will be set to True. - MachineNodeHealthyCondition ConditionType = "NodeHealthy" - - // WaitingForNodeRefReason (Severity=Info) documents a machine.spec.providerId is not assigned yet. - WaitingForNodeRefReason = "WaitingForNodeRef" - - // NodeProvisioningReason (Severity=Info) documents machine in the process of provisioning a node. - // NB. provisioning --> NodeRef == "". - NodeProvisioningReason = "NodeProvisioning" - - // NodeNotFoundReason (Severity=Error) documents a machine's node has previously been observed but is now gone. - // NB. provisioned --> NodeRef != "". - NodeNotFoundReason = "NodeNotFound" - - // NodeConditionsFailedReason (Severity=Warning) documents a node is not in a healthy state due to the failed state of at least 1 Kubelet condition. - NodeConditionsFailedReason = "NodeConditionsFailed" - - // NodeInspectionFailedReason 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. - NodeInspectionFailedReason = "NodeInspectionFailed" -) - -// Conditions and condition Reasons for the MachineHealthCheck object. - -const ( - // RemediationAllowedCondition is set on MachineHealthChecks to show the status of whether the MachineHealthCheck is - // allowed to remediate any Machines or whether it is blocked from remediating any further. - RemediationAllowedCondition ConditionType = "RemediationAllowed" - - // TooManyUnhealthyReason is the reason used when too many Machines are unhealthy and the MachineHealthCheck is blocked - // from making any further remediations. - TooManyUnhealthyReason = "TooManyUnhealthy" -) - -// Conditions and condition Reasons for MachineDeployments. - -const ( - // MachineDeploymentAvailableCondition means the MachineDeployment is available, that is, at least the minimum available - // machines required (i.e. Spec.Replicas-MaxUnavailable when MachineDeploymentStrategyType = RollingUpdate) are up and running for at least minReadySeconds. - MachineDeploymentAvailableCondition ConditionType = "Available" - - // MachineSetReadyCondition reports a summary of current status of the MachineSet owned by the MachineDeployment. - MachineSetReadyCondition ConditionType = "MachineSetReady" - - // WaitingForMachineSetFallbackReason (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. - WaitingForMachineSetFallbackReason = "WaitingForMachineSet" - - // WaitingForAvailableMachinesReason (Severity=Warning) reflects the fact that the required minimum number of machines for a machinedeployment are not available. - WaitingForAvailableMachinesReason = "WaitingForAvailableMachines" -) - -// Conditions and condition Reasons for MachineSets. - -const ( - // MachinesCreatedCondition 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. - MachinesCreatedCondition ConditionType = "MachinesCreated" - - // MachinesReadyCondition reports an aggregate of current status of the machines controlled by the MachineSet. - MachinesReadyCondition ConditionType = "MachinesReady" - - // PreflightCheckFailedReason (Severity=Error) documents a MachineSet failing preflight checks - // to create machine(s). - PreflightCheckFailedReason = "PreflightCheckFailed" - - // BootstrapTemplateCloningFailedReason (Severity=Error) documents a MachineSet failing to - // clone the bootstrap template. - BootstrapTemplateCloningFailedReason = "BootstrapTemplateCloningFailed" - - // InfrastructureTemplateCloningFailedReason (Severity=Error) documents a MachineSet failing to - // clone the infrastructure template. - InfrastructureTemplateCloningFailedReason = "InfrastructureTemplateCloningFailed" - - // MachineCreationFailedReason (Severity=Error) documents a MachineSet failing to - // generate a machine object. - MachineCreationFailedReason = "MachineCreationFailed" - - // ResizedCondition documents a MachineSet is resizing the set of controlled machines. - ResizedCondition ConditionType = "Resized" - - // ScalingUpReason (Severity=Info) documents a MachineSet is increasing the number of replicas. - ScalingUpReason = "ScalingUp" - - // ScalingDownReason (Severity=Info) documents a MachineSet is decreasing the number of replicas. - ScalingDownReason = "ScalingDown" -) - -// Conditions and condition reasons for Clusters with a managed Topology. -const ( - // TopologyReconciledCondition 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). - TopologyReconciledCondition ConditionType = "TopologyReconciled" - - // TopologyReconcileFailedReason (Severity=Error) documents the reconciliation of a Cluster topology - // failing due to an error. - TopologyReconcileFailedReason = "TopologyReconcileFailed" - - // TopologyReconciledControlPlaneUpgradePendingReason (Severity=Info) documents reconciliation of a Cluster topology - // not yet completed because Control Plane is not yet updated to match the desired topology spec. - TopologyReconciledControlPlaneUpgradePendingReason = "ControlPlaneUpgradePending" - - // TopologyReconciledMachineDeploymentsCreatePendingReason (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. - TopologyReconciledMachineDeploymentsCreatePendingReason = "MachineDeploymentsCreatePending" - - // TopologyReconciledMachineDeploymentsUpgradePendingReason (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. - TopologyReconciledMachineDeploymentsUpgradePendingReason = "MachineDeploymentsUpgradePending" - - // TopologyReconciledMachineDeploymentsUpgradeDeferredReason (Severity=Info) documents reconciliation of a Cluster topology - // not yet completed because the upgrade for at least one of the MachineDeployments has been deferred. - TopologyReconciledMachineDeploymentsUpgradeDeferredReason = "MachineDeploymentsUpgradeDeferred" - - // TopologyReconciledMachinePoolsUpgradePendingReason (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. - TopologyReconciledMachinePoolsUpgradePendingReason = "MachinePoolsUpgradePending" - - // TopologyReconciledMachinePoolsCreatePendingReason (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. - TopologyReconciledMachinePoolsCreatePendingReason = "MachinePoolsCreatePending" - - // TopologyReconciledMachinePoolsUpgradeDeferredReason (Severity=Info) documents reconciliation of a Cluster topology - // not yet completed because the upgrade for at least one of the MachinePools has been deferred. - TopologyReconciledMachinePoolsUpgradeDeferredReason = "MachinePoolsUpgradeDeferred" - - // TopologyReconciledHookBlockingReason (Severity=Info) documents reconciliation of a Cluster topology - // not yet completed because at least one of the lifecycle hooks is blocking. - TopologyReconciledHookBlockingReason = "LifecycleHookBlocking" - - // TopologyReconciledClusterClassNotReconciledReason (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. - TopologyReconciledClusterClassNotReconciledReason = "ClusterClassNotReconciled" - - // TopologyReconciledPausedReason (Severity=Info) surfaces when the Cluster is paused. - TopologyReconciledPausedReason = "Paused" -) - -// Conditions and condition reasons for ClusterClass. -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 ConditionType = "RefVersionsUpToDate" - - // ClusterClassOutdatedRefVersionsReason (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). - ClusterClassOutdatedRefVersionsReason = "OutdatedRefVersions" - - // ClusterClassRefVersionsUpToDateInternalErrorReason (Severity=Warning) surfaces that an unexpected error occurred when validating - // 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/core/v1beta1/condition_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/condition_types.go deleted file mode 100644 index 687a487fe7..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/condition_types.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -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" -) - -// 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"` - - // 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/v1beta1/conversion.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/conversion.go deleted file mode 100644 index 03d7a7a9ad..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/conversion.go +++ /dev/null @@ -1,2403 +0,0 @@ -/* -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/core/v1beta1/doc.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/doc.go deleted file mode 100644 index 1df77151b5..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/doc.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1beta1 contains API Schema definitions for the cluster v1beta1 API group -// +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 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 deleted file mode 100644 index 63ef4c408b..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/groupversion_info.go +++ /dev/null @@ -1,54 +0,0 @@ -/* -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/core/v1beta1/machine_phase_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machine_phase_types.go deleted file mode 100644 index 10e10e246d..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machine_phase_types.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -// MachinePhase is a string representation of a Machine Phase. -// -// This type is a high-level indicator of the status of the Machine as it is provisioned, -// from the API user’s perspective. -// -// The value should not be interpreted by any software components as a reliable indication -// of the actual state of the Machine, and controllers should not use the Machine Phase field -// value when making decisions about what action to take. -// -// Controllers should always look at the actual state of the Machine’s fields to make those decisions. -type MachinePhase string - -const ( - // MachinePhasePending is the first state a Machine is assigned by - // Cluster API Machine controller after being created. - MachinePhasePending = MachinePhase("Pending") - - // MachinePhaseProvisioning is the state when the - // Machine infrastructure is being created. - MachinePhaseProvisioning = MachinePhase("Provisioning") - - // MachinePhaseProvisioned is the state when its - // infrastructure has been created and configured. - MachinePhaseProvisioned = MachinePhase("Provisioned") - - // MachinePhaseRunning is the Machine state when it has - // become a Kubernetes Node in a Ready state. - MachinePhaseRunning = MachinePhase("Running") - - // MachinePhaseDeleting is the Machine state when a delete - // request has been sent to the API Server, - // but its infrastructure has not yet been fully deleted. - MachinePhaseDeleting = MachinePhase("Deleting") - - // MachinePhaseDeleted is the Machine state when the object - // and the related infrastructure is deleted and - // ready to be garbage collected by the API Server. - MachinePhaseDeleted = MachinePhase("Deleted") - - // MachinePhaseFailed is the Machine state when the system - // might require user intervention. - MachinePhaseFailed = MachinePhase("Failed") - - // MachinePhaseUnknown is returned if the Machine state cannot be determined. - MachinePhaseUnknown = MachinePhase("Unknown") -) diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machine_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machine_types.go deleted file mode 100644 index 9665953dd4..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machine_types.go +++ /dev/null @@ -1,727 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - capierrors "sigs.k8s.io/cluster-api/errors" -) - -const ( - // MachineFinalizer is set on PrepareForCreate callback. - MachineFinalizer = "machine.cluster.x-k8s.io" - - // 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 that will be used in v1Beta2 API version. -const ( - // MachineAvailableV1Beta2Condition 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. - MachineAvailableV1Beta2Condition = AvailableV1Beta2Condition - - // MachineWaitingForMinReadySecondsV1Beta2Reason surfaces when a machine is ready for less than MinReadySeconds (and thus not yet available). - MachineWaitingForMinReadySecondsV1Beta2Reason = "WaitingForMinReadySeconds" - - // MachineAvailableV1Beta2Reason surfaces when a machine is ready for at least MinReadySeconds. - // Note: MinReadySeconds is assumed 0 until it will be implemented in v1beta2 API. - MachineAvailableV1Beta2Reason = AvailableV1Beta2Reason - - // MachineAvailableInternalErrorV1Beta2Reason surfaces unexpected error when computing the Available condition. - MachineAvailableInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// Machine's Ready condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // MachineReadyV1Beta2Condition 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. - MachineReadyV1Beta2Condition = ReadyV1Beta2Condition - - // MachineReadyV1Beta2Reason surfaces when the machine readiness criteria is met. - MachineReadyV1Beta2Reason = ReadyV1Beta2Reason - - // MachineNotReadyV1Beta2Reason surfaces when the machine readiness criteria is not met. - // Note: when a machine is not ready, it is also not available. - MachineNotReadyV1Beta2Reason = NotReadyV1Beta2Reason - - // MachineReadyUnknownV1Beta2Reason surfaces when at least one machine readiness criteria is unknown - // and no machine readiness criteria is not met. - MachineReadyUnknownV1Beta2Reason = ReadyUnknownV1Beta2Reason - - // MachineReadyInternalErrorV1Beta2Reason surfaces unexpected error when computing the Ready condition. - MachineReadyInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// Machine's UpToDate condition and corresponding reasons that will be used in v1Beta2 API version. -// Note: UpToDate condition is set by the controller owning the machine. -const ( - // MachineUpToDateV1Beta2Condition 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. - MachineUpToDateV1Beta2Condition = "UpToDate" - - // MachineUpToDateV1Beta2Reason surface when a Machine spec matches the spec of the Machine's owner resource, e.g. KubeadmControlPlane or MachineDeployment. - MachineUpToDateV1Beta2Reason = "UpToDate" - - // MachineNotUpToDateV1Beta2Reason surface when a Machine spec does not match the spec of the Machine's owner resource, e.g. KubeadmControlPlane or MachineDeployment. - MachineNotUpToDateV1Beta2Reason = "NotUpToDate" -) - -// Machine's BootstrapConfigReady condition and corresponding reasons that will be used in v1Beta2 API version. -// Note: when possible, BootstrapConfigReady condition will use reasons surfaced from the underlying bootstrap config object. -const ( - // MachineBootstrapConfigReadyV1Beta2Condition condition mirrors the corresponding Ready condition from the Machine's BootstrapConfig resource. - MachineBootstrapConfigReadyV1Beta2Condition = BootstrapConfigReadyV1Beta2Condition - - // MachineBootstrapDataSecretProvidedV1Beta2Reason surfaces when a bootstrap data secret is provided (not originated - // from a BoostrapConfig object referenced from the machine). - MachineBootstrapDataSecretProvidedV1Beta2Reason = "DataSecretProvided" - - // MachineBootstrapConfigReadyV1Beta2Reason surfaces when the machine bootstrap config is ready. - MachineBootstrapConfigReadyV1Beta2Reason = ReadyV1Beta2Reason - - // MachineBootstrapConfigNotReadyV1Beta2Reason surfaces when the machine bootstrap config is not ready. - MachineBootstrapConfigNotReadyV1Beta2Reason = NotReadyV1Beta2Reason - - // MachineBootstrapConfigInvalidConditionReportedV1Beta2Reason surfaces a BootstrapConfig Ready condition (read from a bootstrap config object) which is invalid. - // (e.g. its status is missing). - MachineBootstrapConfigInvalidConditionReportedV1Beta2Reason = InvalidConditionReportedV1Beta2Reason - - // MachineBootstrapConfigInternalErrorV1Beta2Reason surfaces unexpected failures when reading a BootstrapConfig object. - MachineBootstrapConfigInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason - - // MachineBootstrapConfigDoesNotExistV1Beta2Reason 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. - MachineBootstrapConfigDoesNotExistV1Beta2Reason = ObjectDoesNotExistV1Beta2Reason - - // MachineBootstrapConfigDeletedV1Beta2Reason 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. - MachineBootstrapConfigDeletedV1Beta2Reason = ObjectDeletedV1Beta2Reason -) - -// Machine's InfrastructureReady condition and corresponding reasons that will be used in v1Beta2 API version. -// Note: when possible, InfrastructureReady condition will use reasons surfaced from the underlying infra machine object. -const ( - // MachineInfrastructureReadyV1Beta2Condition mirrors the corresponding Ready condition from the Machine's infrastructure resource. - MachineInfrastructureReadyV1Beta2Condition = InfrastructureReadyV1Beta2Condition - - // MachineInfrastructureReadyV1Beta2Reason surfaces when the machine infrastructure is ready. - MachineInfrastructureReadyV1Beta2Reason = ReadyV1Beta2Reason - - // MachineInfrastructureNotReadyV1Beta2Reason surfaces when the machine infrastructure is not ready. - MachineInfrastructureNotReadyV1Beta2Reason = NotReadyV1Beta2Reason - - // MachineInfrastructureInvalidConditionReportedV1Beta2Reason surfaces a infrastructure Ready condition (read from an infra machine object) which is invalid. - // (e.g. its status is missing). - MachineInfrastructureInvalidConditionReportedV1Beta2Reason = InvalidConditionReportedV1Beta2Reason - - // MachineInfrastructureInternalErrorV1Beta2Reason surfaces unexpected failures when reading an infra machine object. - MachineInfrastructureInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason - - // MachineInfrastructureDoesNotExistV1Beta2Reason 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. - MachineInfrastructureDoesNotExistV1Beta2Reason = ObjectDoesNotExistV1Beta2Reason - - // MachineInfrastructureDeletedV1Beta2Reason 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. - MachineInfrastructureDeletedV1Beta2Reason = ObjectDeletedV1Beta2Reason -) - -// Machine's NodeHealthy and NodeReady conditions and corresponding reasons that will be used in v1Beta2 API version. -// Note: when possible, NodeHealthy and NodeReady conditions will use reasons surfaced from the underlying node. -const ( - // MachineNodeHealthyV1Beta2Condition is true if the Machine's Node is ready and it does not report MemoryPressure, DiskPressure and PIDPressure. - MachineNodeHealthyV1Beta2Condition = "NodeHealthy" - - // MachineNodeReadyV1Beta2Condition is true if the Machine's Node is ready. - MachineNodeReadyV1Beta2Condition = "NodeReady" - - // MachineNodeReadyV1Beta2Reason surfaces when Machine's Node Ready condition is true. - MachineNodeReadyV1Beta2Reason = "NodeReady" - - // MachineNodeNotReadyV1Beta2Reason surfaces when Machine's Node Ready condition is false. - MachineNodeNotReadyV1Beta2Reason = "NodeNotReady" - - // MachineNodeReadyUnknownV1Beta2Reason surfaces when Machine's Node Ready condition is unknown. - MachineNodeReadyUnknownV1Beta2Reason = "NodeReadyUnknown" - - // MachineNodeHealthyV1Beta2Reason surfaces when all the node conditions report healthy state. - MachineNodeHealthyV1Beta2Reason = "NodeHealthy" - - // MachineNodeNotHealthyV1Beta2Reason surfaces when at least one node conditions report not healthy state. - MachineNodeNotHealthyV1Beta2Reason = "NodeNotHealthy" - - // MachineNodeHealthUnknownV1Beta2Reason surfaces when at least one node conditions report healthy state unknown - // and no node conditions report not healthy state. - MachineNodeHealthUnknownV1Beta2Reason = "NodeHealthyUnknown" - - // MachineNodeInternalErrorV1Beta2Reason surfaces unexpected failures when reading a Node object. - MachineNodeInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason - - // MachineNodeDoesNotExistV1Beta2Reason 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. - MachineNodeDoesNotExistV1Beta2Reason = "NodeDoesNotExist" - - // MachineNodeDeletedV1Beta2Reason 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. - MachineNodeDeletedV1Beta2Reason = "NodeDeleted" - - // MachineNodeInspectionFailedV1Beta2Reason documents a failure when inspecting the status of a Node. - MachineNodeInspectionFailedV1Beta2Reason = InspectionFailedV1Beta2Reason - - // MachineNodeConnectionDownV1Beta2Reason surfaces that the connection to the workload cluster is down. - MachineNodeConnectionDownV1Beta2Reason = ConnectionDownV1Beta2Reason -) - -// Machine's HealthCheckSucceeded condition and corresponding reasons that will be used in v1Beta2 API version. -// Note: HealthCheckSucceeded condition is set by the MachineHealthCheck controller. -const ( - // MachineHealthCheckSucceededV1Beta2Condition 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. - MachineHealthCheckSucceededV1Beta2Condition = "HealthCheckSucceeded" - - // MachineHealthCheckSucceededV1Beta2Reason surfaces when a machine passes all the health checks defined by a MachineHealthCheck object. - MachineHealthCheckSucceededV1Beta2Reason = "HealthCheckSucceeded" - - // MachineHealthCheckUnhealthyNodeV1Beta2Reason surfaces when the node hosted on the machine does not pass the health checks - // defined by a MachineHealthCheck object. - MachineHealthCheckUnhealthyNodeV1Beta2Reason = "UnhealthyNode" - - // MachineHealthCheckNodeStartupTimeoutV1Beta2Reason surfaces when the node hosted on the machine does not appear within - // the timeout defined by a MachineHealthCheck object. - MachineHealthCheckNodeStartupTimeoutV1Beta2Reason = "NodeStartupTimeout" - - // MachineHealthCheckNodeDeletedV1Beta2Reason surfaces when a MachineHealthCheck detects that the node hosted on the - // machine has been deleted while the Machine is still running. - MachineHealthCheckNodeDeletedV1Beta2Reason = "NodeDeleted" - - // MachineHealthCheckHasRemediateAnnotationV1Beta2Reason surfaces when a MachineHealthCheck detects that a Machine was - // marked for remediation via the `cluster.x-k8s.io/remediate-machine` annotation. - MachineHealthCheckHasRemediateAnnotationV1Beta2Reason = "HasRemediateAnnotation" -) - -// Machine's OwnerRemediated conditions and corresponding reasons that will be used in v1Beta2 API version. -// 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 ( - // MachineOwnerRemediatedV1Beta2Condition is only present if MHC instances targeting this machine - // determine that the controller owning this machine should perform remediation. - MachineOwnerRemediatedV1Beta2Condition = "OwnerRemediated" - - // MachineOwnerRemediatedWaitingForRemediationV1Beta2Reason surfaces the machine is waiting for the owner controller - // to start remediation. - MachineOwnerRemediatedWaitingForRemediationV1Beta2Reason = "WaitingForRemediation" -) - -// Machine's ExternallyRemediated conditions and corresponding reasons that will be used in v1Beta2 API version. -// 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 ( - // MachineExternallyRemediatedV1Beta2Condition is only present if MHC instances targeting this machine - // determine that an external controller should perform remediation. - MachineExternallyRemediatedV1Beta2Condition = "ExternallyRemediated" - - // MachineExternallyRemediatedWaitingForRemediationV1Beta2Reason surfaces the machine is waiting for the - // external remediation controller to start remediation. - MachineExternallyRemediatedWaitingForRemediationV1Beta2Reason = "WaitingForRemediation" - - // MachineExternallyRemediatedRemediationTemplateNotFoundV1Beta2Reason surfaces that the MachineHealthCheck cannot - // find the template for an external remediation request. - MachineExternallyRemediatedRemediationTemplateNotFoundV1Beta2Reason = "RemediationTemplateNotFound" - - // MachineExternallyRemediatedRemediationRequestCreationFailedV1Beta2Reason surfaces that the MachineHealthCheck cannot - // create a request for the external remediation controller. - MachineExternallyRemediatedRemediationRequestCreationFailedV1Beta2Reason = "RemediationRequestCreationFailed" -) - -// Machine's Deleting condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // MachineDeletingV1Beta2Condition surfaces details about progress in the machine deletion workflow. - MachineDeletingV1Beta2Condition = DeletingV1Beta2Condition - - // MachineNotDeletingV1Beta2Reason surfaces when the Machine is not deleting because the - // DeletionTimestamp is not set. - MachineNotDeletingV1Beta2Reason = NotDeletingV1Beta2Reason - - // MachineDeletingV1Beta2Reason surfaces when the Machine is deleting because the - // DeletionTimestamp is set. This reason is used if none of the more specific reasons apply. - MachineDeletingV1Beta2Reason = DeletingV1Beta2Reason - - // MachineDeletingInternalErrorV1Beta2Reason surfaces unexpected failures when deleting a Machine. - MachineDeletingInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason - - // MachineDeletingWaitingForPreDrainHookV1Beta2Reason 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. - MachineDeletingWaitingForPreDrainHookV1Beta2Reason = "WaitingForPreDrainHook" - - // MachineDeletingDrainingNodeV1Beta2Reason surfaces when the Machine deletion is draining the Node. - MachineDeletingDrainingNodeV1Beta2Reason = "DrainingNode" - - // MachineDeletingWaitingForVolumeDetachV1Beta2Reason surfaces when the Machine deletion is - // waiting for volumes to detach from the Node. - MachineDeletingWaitingForVolumeDetachV1Beta2Reason = "WaitingForVolumeDetach" - - // MachineDeletingWaitingForPreTerminateHookV1Beta2Reason 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. - MachineDeletingWaitingForPreTerminateHookV1Beta2Reason = "WaitingForPreTerminateHook" - - // MachineDeletingWaitingForInfrastructureDeletionV1Beta2Reason surfaces when the Machine deletion - // waits for InfraMachine deletion to complete. - MachineDeletingWaitingForInfrastructureDeletionV1Beta2Reason = "WaitingForInfrastructureDeletion" - - // MachineDeletingWaitingForBootstrapDeletionV1Beta2Reason surfaces when the Machine deletion - // waits for BootstrapConfig deletion to complete. - MachineDeletingWaitingForBootstrapDeletionV1Beta2Reason = "WaitingForBootstrapDeletion" - - // MachineDeletingDeletingNodeV1Beta2Reason surfaces when the Machine deletion is - // deleting the Node. - MachineDeletingDeletingNodeV1Beta2Reason = "DeletingNode" - - // MachineDeletingDeletionCompletedV1Beta2Reason 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. - MachineDeletingDeletionCompletedV1Beta2Reason = DeletionCompletedV1Beta2Reason -) - -// 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"` - - // bootstrap is a reference to a local struct which encapsulates - // fields to configure the Machine’s bootstrapping mechanism. - // +required - Bootstrap Bootstrap `json:"bootstrap"` - - // infrastructureRef is a required reference to a custom resource - // offered by an infrastructure provider. - // +required - InfrastructureRef corev1.ObjectReference `json:"infrastructureRef"` - - // 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 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"` - - // 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: This field is considered only for computing v1beta2 conditions. - // 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:MaxItems=32 - ReadinessGates []MachineReadinessGate `json:"readinessGates,omitempty"` - - // nodeDrainTimeout is the total amount of time that the controller will spend on draining a node. - // The default value is 0, meaning that the node can be drained without any time limitations. - // NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` - // +optional - NodeDrainTimeout *metav1.Duration `json:"nodeDrainTimeout,omitempty"` - - // nodeVolumeDetachTimeout 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 - NodeVolumeDetachTimeout *metav1.Duration `json:"nodeVolumeDetachTimeout,omitempty"` - - // nodeDeletionTimeout 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 - NodeDeletionTimeout *metav1.Duration `json:"nodeDeletionTimeout,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"` - - // 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. - // +kubebuilder:validation:Enum=Positive;Negative - // +optional - Polarity ConditionPolarity `json:"polarity,omitempty"` -} - -// MachineStatus defines the observed state of Machine. -type MachineStatus struct { - // nodeRef will point to the corresponding Node if it exists. - // +optional - NodeRef *corev1.ObjectReference `json:"nodeRef,omitempty"` - - // nodeInfo is a set of ids/uuids to uniquely identify the node. - // More info: https://kubernetes.io/docs/concepts/nodes/node/#info - // +optional - NodeInfo *corev1.NodeSystemInfo `json:"nodeInfo,omitempty"` - - // lastUpdated identifies when the phase of the Machine last transitioned. - // +optional - LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` - - // 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"` - - // 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"` - - // bootstrapReady is the state of the bootstrap provider. - // +optional - BootstrapReady bool `json:"bootstrapReady"` - - // infrastructureReady is the state of the infrastructure provider. - // +optional - InfrastructureReady bool `json:"infrastructureReady"` - - // observedGeneration is the latest generation observed by the controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // conditions defines current service state of the Machine. - // +optional - Conditions Conditions `json:"conditions,omitempty"` - - // 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"` - - // v1beta2 groups all the fields that will be added or modified in Machine's status with the V1Beta2 version. - // +optional - V1Beta2 *MachineV1Beta2Status `json:"v1beta2,omitempty"` -} - -// MachineV1Beta2Status groups all the fields that will be added or modified in MachineStatus 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 MachineV1Beta2Status 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"` -} - -// 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 NodeDrainTimeout is exceeded. - // Only present when the Machine has a deletionTimestamp and draining the node had been started. - // +optional - NodeDrainStartTime *metav1.Time `json:"nodeDrainStartTime,omitempty"` - - // waitForNodeVolumeDetachStartTime is the time when waiting for volume detachment started - // and is used to determine if the NodeVolumeDetachTimeout 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"` -} - -// 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 *corev1.ObjectReference `json:"configRef,omitempty"` - - // dataSecretName is the name of the secret that stores the bootstrap data script. - // If nil, the Machine should remain in the Pending state. - // +optional - // +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: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" -// +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. - // +optional - Spec MachineSpec `json:"spec,omitempty"` - // status is the observed state of Machine. - // +optional - Status MachineStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (m *Machine) GetConditions() Conditions { - return m.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (m *Machine) SetConditions(conditions Conditions) { - m.Status.Conditions = conditions -} - -// GetV1Beta2Conditions returns the set of conditions for this object. -func (m *Machine) GetV1Beta2Conditions() []metav1.Condition { - if m.Status.V1Beta2 == nil { - return nil - } - return m.Status.V1Beta2.Conditions -} - -// SetV1Beta2Conditions sets conditions for an API object. -func (m *Machine) SetV1Beta2Conditions(conditions []metav1.Condition) { - if m.Status.V1Beta2 == nil { - m.Status.V1Beta2 = &MachineV1Beta2Status{} - } - m.Status.V1Beta2.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/v1beta1/machinedeployment_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinedeployment_types.go deleted file mode 100644 index 4abb03a9aa..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinedeployment_types.go +++ /dev/null @@ -1,628 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" -) - -const ( - // MachineDeploymentTopologyFinalizer is the finalizer used by the topology MachineDeployment controller to - // clean up referenced template resources if necessary when a MachineDeployment is being deleted. - MachineDeploymentTopologyFinalizer = "machinedeployment.topology.cluster.x-k8s.io" - - // 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" -) - -// MachineDeploymentStrategyType defines the type of MachineDeployment rollout strategies. -type MachineDeploymentStrategyType string - -const ( - // RollingUpdateMachineDeploymentStrategyType replaces the old MachineSet by new one using rolling update - // i.e. gradually scale down the old MachineSet and scale up the new one. - RollingUpdateMachineDeploymentStrategyType MachineDeploymentStrategyType = "RollingUpdate" - - // OnDeleteMachineDeploymentStrategyType replaces old MachineSets when the deletion of the associated machines are completed. - OnDeleteMachineDeploymentStrategyType MachineDeploymentStrategyType = "OnDelete" - - // RevisionAnnotation is the revision annotation of a machine deployment's machine sets which records its rollout sequence. - RevisionAnnotation = "machinedeployment.clusters.x-k8s.io/revision" - - // RevisionHistoryAnnotation maintains the history of all old revisions that a machine set has served for a machine deployment. - // - // Deprecated: This annotation is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/issues/10479 for more details. - RevisionHistoryAnnotation = "machinedeployment.clusters.x-k8s.io/revision-history" - - // DesiredReplicasAnnotation is the desired replicas for a machine deployment recorded as an annotation - // in its machine sets. Helps in separating scaling events from the rollout process and for - // determining if the new machine set for a deployment is really saturated. - DesiredReplicasAnnotation = "machinedeployment.clusters.x-k8s.io/desired-replicas" - - // MaxReplicasAnnotation is the maximum replicas a deployment can have at a given point, which - // is machinedeployment.spec.replicas + maxSurge. Used by the underlying machine sets to estimate their - // proportions in case the deployment has surge replicas. - MaxReplicasAnnotation = "machinedeployment.clusters.x-k8s.io/max-replicas" - - // 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 that will be used in v1Beta2 API version. -const ( - // MachineDeploymentAvailableV1Beta2Condition 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. - MachineDeploymentAvailableV1Beta2Condition = AvailableV1Beta2Condition - - // MachineDeploymentAvailableWaitingForReplicasSetV1Beta2Reason surfaces when the .spec.replicas - // field of the MachineDeployment is not set. - MachineDeploymentAvailableWaitingForReplicasSetV1Beta2Reason = WaitingForReplicasSetV1Beta2Reason - - // MachineDeploymentAvailableWaitingForAvailableReplicasSetV1Beta2Reason surfaces when the .status.v1beta2.availableReplicas - // field of the MachineDeployment is not set. - MachineDeploymentAvailableWaitingForAvailableReplicasSetV1Beta2Reason = "WaitingForAvailableReplicasSet" - - // MachineDeploymentAvailableV1Beta2Reason surfaces when a Deployment is available. - MachineDeploymentAvailableV1Beta2Reason = AvailableV1Beta2Reason - - // MachineDeploymentNotAvailableV1Beta2Reason surfaces when a Deployment is not available. - MachineDeploymentNotAvailableV1Beta2Reason = NotAvailableV1Beta2Reason - - // MachineDeploymentAvailableInternalErrorV1Beta2Reason surfaces unexpected failures when computing the Available condition. - MachineDeploymentAvailableInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// MachineDeployment's MachinesReady condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // MachineDeploymentMachinesReadyV1Beta2Condition surfaces detail of issues on the controlled machines, if any. - MachineDeploymentMachinesReadyV1Beta2Condition = MachinesReadyV1Beta2Condition - - // MachineDeploymentMachinesReadyV1Beta2Reason surfaces when all the controlled machine's Ready conditions are true. - MachineDeploymentMachinesReadyV1Beta2Reason = ReadyV1Beta2Reason - - // MachineDeploymentMachinesNotReadyV1Beta2Reason surfaces when at least one of the controlled machine's Ready conditions is false. - MachineDeploymentMachinesNotReadyV1Beta2Reason = NotReadyV1Beta2Reason - - // MachineDeploymentMachinesReadyUnknownV1Beta2Reason 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. - MachineDeploymentMachinesReadyUnknownV1Beta2Reason = ReadyUnknownV1Beta2Reason - - // MachineDeploymentMachinesReadyNoReplicasV1Beta2Reason surfaces when no machines exist for the MachineDeployment. - MachineDeploymentMachinesReadyNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason - - // MachineDeploymentMachinesReadyInternalErrorV1Beta2Reason surfaces unexpected failures when listing machines - // or aggregating machine's conditions. - MachineDeploymentMachinesReadyInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// MachineDeployment's MachinesUpToDate condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // MachineDeploymentMachinesUpToDateV1Beta2Condition 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. - MachineDeploymentMachinesUpToDateV1Beta2Condition = MachinesUpToDateV1Beta2Condition - - // MachineDeploymentMachinesUpToDateV1Beta2Reason surfaces when all the controlled machine's UpToDate conditions are true. - MachineDeploymentMachinesUpToDateV1Beta2Reason = UpToDateV1Beta2Reason - - // MachineDeploymentMachinesNotUpToDateV1Beta2Reason surfaces when at least one of the controlled machine's UpToDate conditions is false. - MachineDeploymentMachinesNotUpToDateV1Beta2Reason = NotUpToDateV1Beta2Reason - - // MachineDeploymentMachinesUpToDateUnknownV1Beta2Reason 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. - MachineDeploymentMachinesUpToDateUnknownV1Beta2Reason = UpToDateUnknownV1Beta2Reason - - // MachineDeploymentMachinesUpToDateNoReplicasV1Beta2Reason surfaces when no machines exist for the MachineDeployment. - MachineDeploymentMachinesUpToDateNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason - - // MachineDeploymentMachinesUpToDateInternalErrorV1Beta2Reason surfaces unexpected failures when listing machines - // or aggregating status. - MachineDeploymentMachinesUpToDateInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// MachineDeployment's RollingOut condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // MachineDeploymentRollingOutV1Beta2Condition is true if there is at least one machine not up-to-date. - MachineDeploymentRollingOutV1Beta2Condition = RollingOutV1Beta2Condition - - // MachineDeploymentRollingOutV1Beta2Reason surfaces when there is at least one machine not up-to-date. - MachineDeploymentRollingOutV1Beta2Reason = RollingOutV1Beta2Reason - - // MachineDeploymentNotRollingOutV1Beta2Reason surfaces when all the machines are up-to-date. - MachineDeploymentNotRollingOutV1Beta2Reason = NotRollingOutV1Beta2Reason - - // MachineDeploymentRollingOutInternalErrorV1Beta2Reason surfaces unexpected failures when listing machines. - MachineDeploymentRollingOutInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// MachineDeployment's ScalingUp condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // MachineDeploymentScalingUpV1Beta2Condition is true if actual replicas < desired replicas. - MachineDeploymentScalingUpV1Beta2Condition = ScalingUpV1Beta2Condition - - // MachineDeploymentScalingUpV1Beta2Reason surfaces when actual replicas < desired replicas. - MachineDeploymentScalingUpV1Beta2Reason = ScalingUpV1Beta2Reason - - // MachineDeploymentNotScalingUpV1Beta2Reason surfaces when actual replicas >= desired replicas. - MachineDeploymentNotScalingUpV1Beta2Reason = NotScalingUpV1Beta2Reason - - // MachineDeploymentScalingUpInternalErrorV1Beta2Reason surfaces unexpected failures when listing machines. - MachineDeploymentScalingUpInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason - - // MachineDeploymentScalingUpWaitingForReplicasSetV1Beta2Reason surfaces when the .spec.replicas - // field of the MachineDeployment is not set. - MachineDeploymentScalingUpWaitingForReplicasSetV1Beta2Reason = WaitingForReplicasSetV1Beta2Reason -) - -// MachineDeployment's ScalingDown condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // MachineDeploymentScalingDownV1Beta2Condition is true if actual replicas > desired replicas. - MachineDeploymentScalingDownV1Beta2Condition = ScalingDownV1Beta2Condition - - // MachineDeploymentScalingDownV1Beta2Reason surfaces when actual replicas > desired replicas. - MachineDeploymentScalingDownV1Beta2Reason = ScalingDownV1Beta2Reason - - // MachineDeploymentNotScalingDownV1Beta2Reason surfaces when actual replicas <= desired replicas. - MachineDeploymentNotScalingDownV1Beta2Reason = NotScalingDownV1Beta2Reason - - // MachineDeploymentScalingDownInternalErrorV1Beta2Reason surfaces unexpected failures when listing machines. - MachineDeploymentScalingDownInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason - - // MachineDeploymentScalingDownWaitingForReplicasSetV1Beta2Reason surfaces when the .spec.replicas - // field of the MachineDeployment is not set. - MachineDeploymentScalingDownWaitingForReplicasSetV1Beta2Reason = WaitingForReplicasSetV1Beta2Reason -) - -// MachineDeployment's Remediating condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // MachineDeploymentRemediatingV1Beta2Condition surfaces details about ongoing remediation of the controlled machines, if any. - MachineDeploymentRemediatingV1Beta2Condition = RemediatingV1Beta2Condition - - // MachineDeploymentRemediatingV1Beta2Reason surfaces when the MachineDeployment has at least one machine with HealthCheckSucceeded set to false - // and with the OwnerRemediated condition set to false. - MachineDeploymentRemediatingV1Beta2Reason = RemediatingV1Beta2Reason - - // MachineDeploymentNotRemediatingV1Beta2Reason surfaces when the MachineDeployment does not have any machine with HealthCheckSucceeded set to false - // and with the OwnerRemediated condition set to false. - MachineDeploymentNotRemediatingV1Beta2Reason = NotRemediatingV1Beta2Reason - - // MachineDeploymentRemediatingInternalErrorV1Beta2Reason surfaces unexpected failures when computing the Remediating condition. - MachineDeploymentRemediatingInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// MachineDeployment's Deleting condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // MachineDeploymentDeletingV1Beta2Condition surfaces details about ongoing deletion of the controlled machines. - MachineDeploymentDeletingV1Beta2Condition = DeletingV1Beta2Condition - - // MachineDeploymentNotDeletingV1Beta2Reason surfaces when the MachineDeployment is not deleting because the - // DeletionTimestamp is not set. - MachineDeploymentNotDeletingV1Beta2Reason = NotDeletingV1Beta2Reason - - // MachineDeploymentDeletingV1Beta2Reason surfaces when the MachineDeployment is deleting because the - // DeletionTimestamp is set. - MachineDeploymentDeletingV1Beta2Reason = DeletingV1Beta2Reason - - // MachineDeploymentDeletingInternalErrorV1Beta2Reason surfaces unexpected failures when deleting a MachineDeployment. - MachineDeploymentDeletingInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// 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"` - - // 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"` - - // rolloutAfter 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 - RolloutAfter *metav1.Time `json:"rolloutAfter,omitempty"` - - // 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"` - - // template describes the machines that will be created. - // +required - Template MachineTemplateSpec `json:"template"` - - // strategy is the deployment strategy to use to replace existing machines with - // new ones. - // +optional - Strategy *MachineDeploymentStrategy `json:"strategy,omitempty"` - - // machineNamingStrategy allows changing the naming pattern used when creating Machines. - // Note: InfraMachines & BootstrapConfigs will use the same name as the corresponding Machines. - // +optional - MachineNamingStrategy *MachineNamingStrategy `json:"machineNamingStrategy,omitempty"` - - // minReadySeconds is the minimum number of seconds for which a Node for a newly created machine should be ready before considering the replica available. - // Defaults to 0 (machine will be considered available as soon as the Node is ready) - // +optional - MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` - - // revisionHistoryLimit is the number of old MachineSets to retain to allow rollback. - // This is a pointer to distinguish between explicit zero and not specified. - // Defaults to 1. - // - // Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/issues/10479 for more details. - // - // +optional - RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` - - // paused indicates that the deployment is paused. - // +optional - Paused bool `json:"paused,omitempty"` - - // progressDeadlineSeconds is the maximum time in seconds for a deployment to make progress before it - // is considered to be failed. The deployment controller will continue to - // process failed deployments and a condition with a ProgressDeadlineExceeded - // reason will be surfaced in the deployment status. Note that progress will - // not be estimated during the time a deployment is paused. Defaults to 600s. - // - // Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/issues/11470 for more details. - // - // +optional - ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` -} - -// MachineDeploymentStrategy describes how to replace existing machines -// with new ones. -type MachineDeploymentStrategy struct { - // type of deployment. Allowed values are RollingUpdate and OnDelete. - // The default is RollingUpdate. - // +kubebuilder:validation:Enum=RollingUpdate;OnDelete - // +optional - Type MachineDeploymentStrategyType `json:"type,omitempty"` - - // rollingUpdate is the rolling update config params. Present only if - // MachineDeploymentStrategyType = RollingUpdate. - // +optional - RollingUpdate *MachineRollingUpdateDeployment `json:"rollingUpdate,omitempty"` - - // remediation controls the strategy of remediating unhealthy machines - // and how remediating operations should occur during the lifecycle of the dependant MachineSets. - // +optional - Remediation *RemediationStrategy `json:"remediation,omitempty"` -} - -// 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. - // 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"` - - // deletePolicy defines the policy used by the MachineDeployment to identify nodes to delete when downscaling. - // Valid values are "Random, "Newest", "Oldest" - // When no value is supplied, the default DeletePolicy of MachineSet is used - // +kubebuilder:validation:Enum=Random;Newest;Oldest - // +optional - DeletePolicy *string `json:"deletePolicy,omitempty"` -} - -// 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. - // - // 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"` -} - -// MachineNamingStrategy allows changing the naming pattern used when creating -// Machines. -// Note: InfraMachines & BootstrapConfigs will use the same name as the corresponding Machines. -type MachineNamingStrategy 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"` -} - -// MachineDeploymentStatus defines the observed state of MachineDeployment. -type MachineDeploymentStatus struct { - // observedGeneration is the generation observed by the deployment controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // selector is the same as the label selector but in the string format to avoid introspection - // by clients. The string will be in the same format as the query-param syntax. - // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors - // +optional - // +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"` - - // updatedReplicas is the total number of non-terminated machines targeted by this deployment - // that have the desired template spec. - // +optional - UpdatedReplicas int32 `json:"updatedReplicas"` - - // readyReplicas is the total number of ready machines targeted by this deployment. - // +optional - ReadyReplicas int32 `json:"readyReplicas"` - - // availableReplicas is the total number of available machines (ready for at least minReadySeconds) - // targeted by this deployment. - // +optional - AvailableReplicas int32 `json:"availableReplicas"` - - // 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"` - - // 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"` - - // conditions defines current service state of the MachineDeployment. - // +optional - Conditions Conditions `json:"conditions,omitempty"` - - // v1beta2 groups all the fields that will be added or modified in MachineDeployment's status with the V1Beta2 version. - // +optional - V1Beta2 *MachineDeploymentV1Beta2Status `json:"v1beta2,omitempty"` -} - -// MachineDeploymentV1Beta2Status groups all the fields that will be added or modified in MachineDeployment 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 MachineDeploymentV1Beta2Status 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"` - - // 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"` -} - -// MachineDeploymentPhase indicates the progress of the machine deployment. -type MachineDeploymentPhase string - -const ( - // MachineDeploymentPhaseScalingUp indicates the MachineDeployment is scaling up. - MachineDeploymentPhaseScalingUp = MachineDeploymentPhase("ScalingUp") - - // MachineDeploymentPhaseScalingDown indicates the MachineDeployment is scaling down. - MachineDeploymentPhaseScalingDown = MachineDeploymentPhase("ScalingDown") - - // MachineDeploymentPhaseRunning indicates scaling has completed and all Machines are running. - MachineDeploymentPhaseRunning = MachineDeploymentPhase("Running") - - // MachineDeploymentPhaseFailed indicates there was a problem scaling and user intervention might be required. - MachineDeploymentPhaseFailed = MachineDeploymentPhase("Failed") - - // MachineDeploymentPhaseUnknown indicates the state of the MachineDeployment cannot be determined. - MachineDeploymentPhaseUnknown = MachineDeploymentPhase("Unknown") -) - -// SetTypedPhase sets the Phase field to the string representation of MachineDeploymentPhase. -func (md *MachineDeploymentStatus) SetTypedPhase(p MachineDeploymentPhase) { - md.Phase = string(p) -} - -// GetTypedPhase attempts to parse the Phase field and return -// the typed MachineDeploymentPhase representation. -func (md *MachineDeploymentStatus) GetTypedPhase() MachineDeploymentPhase { - switch phase := MachineDeploymentPhase(md.Phase); phase { - case - MachineDeploymentPhaseScalingDown, - MachineDeploymentPhaseScalingUp, - MachineDeploymentPhaseRunning, - MachineDeploymentPhaseFailed: - return phase - default: - return MachineDeploymentPhaseUnknown - } -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=machinedeployments,shortName=md,scope=Namespaced,categories=cluster-api -// +kubebuilder: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" -// +kubebuilder:printcolumn:name="Desired",type=integer,JSONPath=".spec.replicas",description="Total number of machines desired by this MachineDeployment",priority=10 -// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Total number of non-terminated machines targeted by this MachineDeployment" -// +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="Total number of ready machines targeted by this MachineDeployment" -// +kubebuilder:printcolumn:name="Updated",type=integer,JSONPath=".status.updatedReplicas",description="Total number of non-terminated machines targeted by this deployment that have the desired template spec" -// +kubebuilder:printcolumn:name="Unavailable",type=integer,JSONPath=".status.unavailableReplicas",description="Total number of unavailable machines targeted by this MachineDeployment" -// +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. - // +optional - Spec MachineDeploymentSpec `json:"spec,omitempty"` - // status is the observed state of MachineDeployment. - // +optional - Status MachineDeploymentStatus `json:"status,omitempty"` -} - -// +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{}) -} - -// GetConditions returns the set of conditions for the machinedeployment. -func (m *MachineDeployment) GetConditions() Conditions { - return m.Status.Conditions -} - -// SetConditions updates the set of conditions on the machinedeployment. -func (m *MachineDeployment) SetConditions(conditions Conditions) { - m.Status.Conditions = conditions -} - -// GetV1Beta2Conditions returns the set of conditions for this object. -func (m *MachineDeployment) GetV1Beta2Conditions() []metav1.Condition { - if m.Status.V1Beta2 == nil { - return nil - } - return m.Status.V1Beta2.Conditions -} - -// SetV1Beta2Conditions sets conditions for an API object. -func (m *MachineDeployment) SetV1Beta2Conditions(conditions []metav1.Condition) { - if m.Status.V1Beta2 == nil { - m.Status.V1Beta2 = &MachineDeploymentV1Beta2Status{} - } - m.Status.V1Beta2.Conditions = conditions -} diff --git a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinedrainrules_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinedrainrules_types.go deleted file mode 100644 index ff653dca05..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinedrainrules_types.go +++ /dev/null @@ -1,235 +0,0 @@ -/* -Copyright 2024 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" -) - -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"` - - // 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"` - - // 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: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" - -// 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"` -} - -// +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/v1beta1/machinehealthcheck_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinehealthcheck_types.go deleted file mode 100644 index c8e4d27046..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinehealthcheck_types.go +++ /dev/null @@ -1,261 +0,0 @@ -/* -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 ( - "time" - - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" -) - -// MachineHealthCheck's RemediationAllowed condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // MachineHealthCheckRemediationAllowedV1Beta2Condition surfaces whether the MachineHealthCheck is - // allowed to remediate any Machines or whether it is blocked from remediating any further. - MachineHealthCheckRemediationAllowedV1Beta2Condition = "RemediationAllowed" - - // MachineHealthCheckTooManyUnhealthyV1Beta2Reason is the reason used when too many Machines are unhealthy and - // the MachineHealthCheck is blocked from making any further remediation. - MachineHealthCheckTooManyUnhealthyV1Beta2Reason = "TooManyUnhealthy" - - // MachineHealthCheckRemediationAllowedV1Beta2Reason is the reason used when the number of unhealthy machine - // is within the limits defined by the MachineHealthCheck, and thus remediation is allowed. - MachineHealthCheckRemediationAllowedV1Beta2Reason = "RemediationAllowed" -) - -var ( - // DefaultNodeStartupTimeout 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. - DefaultNodeStartupTimeout = metav1.Duration{Duration: 10 * time.Minute} -) - -// 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"` - - // selector is a label selector to match machines whose health will be exercised - // +required - Selector metav1.LabelSelector `json:"selector"` - - // unhealthyConditions contains a list of the conditions that determine - // whether a node is considered unhealthy. The conditions are combined in a - // logical OR, i.e. if any of the conditions is met, the node is unhealthy. - // - // +optional - // +kubebuilder:validation:MaxItems=100 - UnhealthyConditions []UnhealthyCondition `json:"unhealthyConditions,omitempty"` - - // maxUnhealthy specifies the maximum number of unhealthy machines allowed. - // Any further remediation is only allowed if at most "maxUnhealthy" machines selected by - // "selector" are not healthy. - // - // Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/issues/10722 for more details. - // - // +optional - MaxUnhealthy *intstr.IntOrString `json:"maxUnhealthy,omitempty"` - - // unhealthyRange specifies the range of unhealthy machines allowed. - // Any further remediation is only allowed if the number of machines selected by "selector" as not healthy - // is within the range of "unhealthyRange". Takes precedence over maxUnhealthy. - // Eg. "[3-5]" - This means that remediation will be allowed only when: - // (a) there are at least 3 unhealthy machines (and) - // (b) there are at most 5 unhealthy machines - // - // Deprecated: This field is deprecated and is going to be removed in the next apiVersion. Please see https://github.com/kubernetes-sigs/cluster-api/issues/10722 for more details. - // - // +optional - // +kubebuilder:validation:Pattern=^\[[0-9]+-[0-9]+\]$ - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=32 - UnhealthyRange *string `json:"unhealthyRange,omitempty"` - - // nodeStartupTimeout 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 - NodeStartupTimeout *metav1.Duration `json:"nodeStartupTimeout,omitempty"` - - // remediationTemplate is a reference to a remediation template - // provided by an infrastructure provider. - // - // This field is completely optional, when filled, the MachineHealthCheck controller - // creates a new object from the template referenced and hands off remediation of the machine to - // a controller that lives outside of Cluster API. - // +optional - RemediationTemplate *corev1.ObjectReference `json:"remediationTemplate,omitempty"` -} - -// UnhealthyCondition represents a Node condition type and value with a timeout -// specified as a duration. When the named condition has been in the given -// status for at least the timeout value, a node is considered unhealthy. -type UnhealthyCondition struct { - // type of Node condition - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:MinLength=1 - // +required - Type corev1.NodeConditionType `json:"type"` - - // status of the condition, one of True, False, Unknown. - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:MinLength=1 - // +required - Status corev1.ConditionStatus `json:"status"` - - // timeout 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 - Timeout metav1.Duration `json:"timeout"` -} - -// MachineHealthCheckStatus defines the observed state of MachineHealthCheck. -type MachineHealthCheckStatus struct { - // expectedMachines is the total number of machines counted by this machine health check - // +kubebuilder:validation:Minimum=0 - // +optional - ExpectedMachines int32 `json:"expectedMachines"` - - // currentHealthy is the total number of healthy machines counted by this machine health check - // +kubebuilder:validation:Minimum=0 - // +optional - CurrentHealthy int32 `json:"currentHealthy"` - - // 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"` - - // observedGeneration is the latest generation observed by the controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // targets shows the current list of machines the machine health check is watching - // +optional - // +kubebuilder:validation:MaxItems=10000 - // +kubebuilder:validation:items:MinLength=1 - // +kubebuilder:validation:items:MaxLength=253 - Targets []string `json:"targets,omitempty"` - - // conditions defines current service state of the MachineHealthCheck. - // +optional - Conditions Conditions `json:"conditions,omitempty"` - - // v1beta2 groups all the fields that will be added or modified in MachineHealthCheck's status with the V1Beta2 version. - // +optional - V1Beta2 *MachineHealthCheckV1Beta2Status `json:"v1beta2,omitempty"` -} - -// MachineHealthCheckV1Beta2Status groups all the fields that will be added or modified in MachineHealthCheck 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 MachineHealthCheckV1Beta2Status 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"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=machinehealthchecks,shortName=mhc;mhcs,scope=Namespaced,categories=cluster-api -// +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" -// +kubebuilder:printcolumn:name="MaxUnhealthy",type="string",JSONPath=".spec.maxUnhealthy",description="Maximum number of unhealthy machines allowed" -// +kubebuilder:printcolumn:name="CurrentHealthy",type="integer",JSONPath=".status.currentHealthy",description="Current observed healthy machines" -// +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 - // +optional - Spec MachineHealthCheckSpec `json:"spec,omitempty"` - - // status is the most recently observed status of MachineHealthCheck resource - // +optional - Status MachineHealthCheckStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (m *MachineHealthCheck) GetConditions() Conditions { - return m.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (m *MachineHealthCheck) SetConditions(conditions Conditions) { - m.Status.Conditions = conditions -} - -// GetV1Beta2Conditions returns the set of conditions for this object. -func (m *MachineHealthCheck) GetV1Beta2Conditions() []metav1.Condition { - if m.Status.V1Beta2 == nil { - return nil - } - return m.Status.V1Beta2.Conditions -} - -// SetV1Beta2Conditions sets conditions for an API object. -func (m *MachineHealthCheck) SetV1Beta2Conditions(conditions []metav1.Condition) { - if m.Status.V1Beta2 == nil { - m.Status.V1Beta2 = &MachineHealthCheckV1Beta2Status{} - } - m.Status.V1Beta2.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/v1beta1/machinepool_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinepool_types.go deleted file mode 100644 index 5ecd8fa227..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machinepool_types.go +++ /dev/null @@ -1,356 +0,0 @@ -/* -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/core/v1beta1/machineset_types.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machineset_types.go deleted file mode 100644 index e302d020d3..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/machineset_types.go +++ /dev/null @@ -1,472 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1beta1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/util/validation/field" - - capierrors "sigs.k8s.io/cluster-api/errors" -) - -const ( - // MachineSetTopologyFinalizer is the finalizer used by the topology MachineDeployment controller to - // clean up referenced template resources if necessary when a MachineSet is being deleted. - MachineSetTopologyFinalizer = "machineset.topology.cluster.x-k8s.io" - - // 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"` - - // 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"` - - // minReadySeconds is the minimum number of seconds for which a Node for a newly created machine should be ready before considering the replica available. - // Defaults to 0 (machine will be considered available as soon as the Node is ready) - // +optional - MinReadySeconds int32 `json:"minReadySeconds,omitempty"` - - // deletePolicy defines the policy used to identify nodes to delete when downscaling. - // Defaults to "Random". Valid values are "Random, "Newest", "Oldest" - // +kubebuilder:validation:Enum=Random;Newest;Oldest - // +optional - DeletePolicy string `json:"deletePolicy,omitempty"` - - // selector is a label query over machines that should match the replica count. - // Label keys and values that must match in order to be controlled by this MachineSet. - // It must match the machine template's labels. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - // +required - Selector metav1.LabelSelector `json:"selector"` - - // template is the object that describes the machine that will be created if - // insufficient replicas are detected. - // Object references to custom resources are treated as templates. - // +optional - Template MachineTemplateSpec `json:"template,omitempty"` - - // machineNamingStrategy allows changing the naming pattern used when creating Machines. - // Note: InfraMachines & BootstrapConfigs will use the same name as the corresponding Machines. - // +optional - MachineNamingStrategy *MachineNamingStrategy `json:"machineNamingStrategy,omitempty"` -} - -// MachineSet's ScalingUp condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // MachineSetScalingUpV1Beta2Condition 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. - MachineSetScalingUpV1Beta2Condition = ScalingUpV1Beta2Condition - - // MachineSetScalingUpV1Beta2Reason surfaces when actual replicas < desired replicas. - MachineSetScalingUpV1Beta2Reason = ScalingUpV1Beta2Reason - - // MachineSetNotScalingUpV1Beta2Reason surfaces when actual replicas >= desired replicas. - MachineSetNotScalingUpV1Beta2Reason = NotScalingUpV1Beta2Reason - - // MachineSetScalingUpInternalErrorV1Beta2Reason surfaces unexpected failures when listing machines. - MachineSetScalingUpInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason - - // MachineSetScalingUpWaitingForReplicasSetV1Beta2Reason surfaces when the .spec.replicas - // field of the MachineSet is not set. - MachineSetScalingUpWaitingForReplicasSetV1Beta2Reason = WaitingForReplicasSetV1Beta2Reason -) - -// MachineSet's ScalingDown condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // MachineSetScalingDownV1Beta2Condition is true if actual replicas > desired replicas. - MachineSetScalingDownV1Beta2Condition = ScalingDownV1Beta2Condition - - // MachineSetScalingDownV1Beta2Reason surfaces when actual replicas > desired replicas. - MachineSetScalingDownV1Beta2Reason = ScalingDownV1Beta2Reason - - // MachineSetNotScalingDownV1Beta2Reason surfaces when actual replicas <= desired replicas. - MachineSetNotScalingDownV1Beta2Reason = NotScalingDownV1Beta2Reason - - // MachineSetScalingDownInternalErrorV1Beta2Reason surfaces unexpected failures when listing machines. - MachineSetScalingDownInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason - - // MachineSetScalingDownWaitingForReplicasSetV1Beta2Reason surfaces when the .spec.replicas - // field of the MachineSet is not set. - MachineSetScalingDownWaitingForReplicasSetV1Beta2Reason = WaitingForReplicasSetV1Beta2Reason -) - -// MachineSet's MachinesReady condition and corresponding reasons that will be used in v1Beta2 API version. -// Note: Reason's could also be derived from the aggregation of machine's Ready conditions. -const ( - // MachineSetMachinesReadyV1Beta2Condition surfaces detail of issues on the controlled machines, if any. - MachineSetMachinesReadyV1Beta2Condition = MachinesReadyV1Beta2Condition - - // MachineSetMachinesReadyV1Beta2Reason surfaces when all the controlled machine's Ready conditions are true. - MachineSetMachinesReadyV1Beta2Reason = ReadyV1Beta2Reason - - // MachineSetMachinesNotReadyV1Beta2Reason surfaces when at least one of the controlled machine's Ready conditions is false. - MachineSetMachinesNotReadyV1Beta2Reason = NotReadyV1Beta2Reason - - // MachineSetMachinesReadyUnknownV1Beta2Reason 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. - MachineSetMachinesReadyUnknownV1Beta2Reason = ReadyUnknownV1Beta2Reason - - // MachineSetMachinesReadyNoReplicasV1Beta2Reason surfaces when no machines exist for the MachineSet. - MachineSetMachinesReadyNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason - - // MachineSetMachinesReadyInternalErrorV1Beta2Reason surfaces unexpected failures when listing machines - // or aggregating machine's conditions. - MachineSetMachinesReadyInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// MachineSet's MachinesUpToDate condition and corresponding reasons that will be used in v1Beta2 API version. -// Note: Reason's could also be derived from the aggregation of machine's MachinesUpToDate conditions. -const ( - // MachineSetMachinesUpToDateV1Beta2Condition 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. - MachineSetMachinesUpToDateV1Beta2Condition = MachinesUpToDateV1Beta2Condition - - // MachineSetMachinesUpToDateV1Beta2Reason surfaces when all the controlled machine's UpToDate conditions are true. - MachineSetMachinesUpToDateV1Beta2Reason = UpToDateV1Beta2Reason - - // MachineSetMachinesNotUpToDateV1Beta2Reason surfaces when at least one of the controlled machine's UpToDate conditions is false. - MachineSetMachinesNotUpToDateV1Beta2Reason = NotUpToDateV1Beta2Reason - - // MachineSetMachinesUpToDateUnknownV1Beta2Reason 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. - MachineSetMachinesUpToDateUnknownV1Beta2Reason = UpToDateUnknownV1Beta2Reason - - // MachineSetMachinesUpToDateNoReplicasV1Beta2Reason surfaces when no machines exist for the MachineSet. - MachineSetMachinesUpToDateNoReplicasV1Beta2Reason = NoReplicasV1Beta2Reason - - // MachineSetMachinesUpToDateInternalErrorV1Beta2Reason surfaces unexpected failures when listing machines - // or aggregating status. - MachineSetMachinesUpToDateInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// MachineSet's Remediating condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // MachineSetRemediatingV1Beta2Condition surfaces details about ongoing remediation of the controlled machines, if any. - MachineSetRemediatingV1Beta2Condition = RemediatingV1Beta2Condition - - // MachineSetRemediatingV1Beta2Reason surfaces when the MachineSet has at least one machine with HealthCheckSucceeded set to false - // and with the OwnerRemediated condition set to false. - MachineSetRemediatingV1Beta2Reason = RemediatingV1Beta2Reason - - // MachineSetNotRemediatingV1Beta2Reason surfaces when the MachineSet does not have any machine with HealthCheckSucceeded set to false - // and with the OwnerRemediated condition set to false. - MachineSetNotRemediatingV1Beta2Reason = NotRemediatingV1Beta2Reason - - // MachineSetRemediatingInternalErrorV1Beta2Reason surfaces unexpected failures when computing the Remediating condition. - MachineSetRemediatingInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// Reasons that will be used for the OwnerRemediated condition set by MachineHealthCheck on MachineSet controlled machines -// being remediated in v1Beta2 API version. -const ( - // MachineSetMachineCannotBeRemediatedV1Beta2Reason surfaces when remediation of a MachineSet machine can't be started. - MachineSetMachineCannotBeRemediatedV1Beta2Reason = "CannotBeRemediated" - - // MachineSetMachineRemediationDeferredV1Beta2Reason surfaces when remediation of a MachineSet machine must be deferred. - MachineSetMachineRemediationDeferredV1Beta2Reason = "RemediationDeferred" - - // MachineSetMachineRemediationMachineDeletingV1Beta2Reason 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. - MachineSetMachineRemediationMachineDeletingV1Beta2Reason = "MachineDeleting" -) - -// MachineSet's Deleting condition and corresponding reasons that will be used in v1Beta2 API version. -const ( - // MachineSetDeletingV1Beta2Condition surfaces details about ongoing deletion of the controlled machines. - MachineSetDeletingV1Beta2Condition = DeletingV1Beta2Condition - - // MachineSetNotDeletingV1Beta2Reason surfaces when the MachineSet is not deleting because the - // DeletionTimestamp is not set. - MachineSetNotDeletingV1Beta2Reason = NotDeletingV1Beta2Reason - - // MachineSetDeletingV1Beta2Reason surfaces when the MachineSet is deleting because the - // DeletionTimestamp is set. - MachineSetDeletingV1Beta2Reason = DeletingV1Beta2Reason - - // MachineSetDeletingInternalErrorV1Beta2Reason surfaces unexpected failures when deleting a MachineSet. - MachineSetDeletingInternalErrorV1Beta2Reason = InternalErrorV1Beta2Reason -) - -// 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"` - - // 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 - // +optional - Spec MachineSpec `json:"spec,omitempty"` -} - -// MachineSetDeletePolicy defines how priority is assigned to nodes to delete when -// downscaling a MachineSet. Defaults to "Random". -type MachineSetDeletePolicy string - -const ( - // RandomMachineSetDeletePolicy prioritizes both Machines that have the annotation - // "cluster.x-k8s.io/delete-machine=yes" and Machines that are unhealthy - // (Status.FailureReason or Status.FailureMessage are set to a non-empty value - // or NodeHealthy type of Status.Conditions is not true). - // Finally, it picks Machines at random to delete. - RandomMachineSetDeletePolicy MachineSetDeletePolicy = "Random" - - // NewestMachineSetDeletePolicy prioritizes both Machines that have the annotation - // "cluster.x-k8s.io/delete-machine=yes" and Machines that are unhealthy - // (Status.FailureReason or Status.FailureMessage are set to a non-empty value - // or NodeHealthy type of Status.Conditions is not true). - // It then prioritizes the newest Machines for deletion based on the Machine's CreationTimestamp. - NewestMachineSetDeletePolicy MachineSetDeletePolicy = "Newest" - - // OldestMachineSetDeletePolicy prioritizes both Machines that have the annotation - // "cluster.x-k8s.io/delete-machine=yes" and Machines that are unhealthy - // (Status.FailureReason or Status.FailureMessage are set to a non-empty value - // or NodeHealthy type of Status.Conditions is not true). - // It then prioritizes the oldest Machines for deletion based on the Machine's CreationTimestamp. - OldestMachineSetDeletePolicy MachineSetDeletePolicy = "Oldest" -) - -// MachineSetStatus defines the observed state of MachineSet. -type MachineSetStatus struct { - // selector is the same as the label selector but in the string format to avoid introspection - // by clients. The string will be in the same format as the query-param syntax. - // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors - // +optional - // +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"` - - // 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"` - - // readyReplicas is the number of ready replicas for this MachineSet. A machine is considered ready when the node has been created and is "Ready". - // +optional - ReadyReplicas int32 `json:"readyReplicas"` - - // availableReplicas is the number of available replicas (ready for at least minReadySeconds) for this MachineSet. - // +optional - AvailableReplicas int32 `json:"availableReplicas"` - - // observedGeneration reflects the generation of the most recently observed MachineSet. - // +optional - ObservedGeneration int64 `json:"observedGeneration,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"` - - // conditions defines current service state of the MachineSet. - // +optional - Conditions Conditions `json:"conditions,omitempty"` - - // v1beta2 groups all the fields that will be added or modified in MachineSet's status with the V1Beta2 version. - // +optional - V1Beta2 *MachineSetV1Beta2Status `json:"v1beta2,omitempty"` -} - -// MachineSetV1Beta2Status groups all the fields that will be added or modified in MachineSetStatus 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 MachineSetV1Beta2Status 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"` - - // 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"` -} - -// 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: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" -// +kubebuilder:printcolumn:name="Desired",type=integer,JSONPath=".spec.replicas",description="Total number of machines desired by this machineset",priority=10 -// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Total number of non-terminated machines targeted by this machineset" -// +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="Total number of ready machines targeted by this machineset." -// +kubebuilder:printcolumn:name="Available",type="integer",JSONPath=".status.availableReplicas",description="Total number of available machines (ready for at least minReadySeconds)" -// +kubebuilder:printcolumn:name="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. - // +optional - Spec MachineSetSpec `json:"spec,omitempty"` - // status is the observed state of MachineSet. - // +optional - Status MachineSetStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for the MachineSet. -func (m *MachineSet) GetConditions() Conditions { - return m.Status.Conditions -} - -// SetConditions updates the set of conditions on the MachineSet. -func (m *MachineSet) SetConditions(conditions Conditions) { - m.Status.Conditions = conditions -} - -// GetV1Beta2Conditions returns the set of conditions for this object. -func (m *MachineSet) GetV1Beta2Conditions() []metav1.Condition { - if m.Status.V1Beta2 == nil { - return nil - } - return m.Status.V1Beta2.Conditions -} - -// SetV1Beta2Conditions sets conditions for an API object. -func (m *MachineSet) SetV1Beta2Conditions(conditions []metav1.Condition) { - if m.Status.V1Beta2 == nil { - m.Status.V1Beta2 = &MachineSetV1Beta2Status{} - } - m.Status.V1Beta2.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/v1beta1/v1beta2_condition_consts.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/v1beta2_condition_consts.go deleted file mode 100644 index c00c0fc4cd..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/v1beta2_condition_consts.go +++ /dev/null @@ -1,215 +0,0 @@ -/* -Copyright 2024 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 - -// Conditions types that are used across different objects. -const ( - // AvailableV1Beta2Condition 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. - AvailableV1Beta2Condition = "Available" - - // ReadyV1Beta2Condition 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. - ReadyV1Beta2Condition = "Ready" - - // BootstrapConfigReadyV1Beta2Condition 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. - BootstrapConfigReadyV1Beta2Condition = "BootstrapConfigReady" - - // InfrastructureReadyV1Beta2Condition 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. - InfrastructureReadyV1Beta2Condition = "InfrastructureReady" - - // MachinesReadyV1Beta2Condition 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. - MachinesReadyV1Beta2Condition = "MachinesReady" - - // MachinesUpToDateV1Beta2Condition 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. - MachinesUpToDateV1Beta2Condition = "MachinesUpToDate" - - // RollingOutV1Beta2Condition 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. - RollingOutV1Beta2Condition = "RollingOut" - - // ScalingUpV1Beta2Condition 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. - ScalingUpV1Beta2Condition = "ScalingUp" - - // ScalingDownV1Beta2Condition 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. - ScalingDownV1Beta2Condition = "ScalingDown" - - // RemediatingV1Beta2Condition 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. - RemediatingV1Beta2Condition = "Remediating" - - // DeletingV1Beta2Condition 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. - DeletingV1Beta2Condition = "Deleting" - - // PausedV1Beta2Condition 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. - PausedV1Beta2Condition = "Paused" -) - -// Reasons that are used across different objects. -const ( - // AvailableV1Beta2Reason applies to a condition surfacing object availability. - AvailableV1Beta2Reason = "Available" - - // NotAvailableV1Beta2Reason applies to a condition surfacing object not satisfying availability criteria. - NotAvailableV1Beta2Reason = "NotAvailable" - - // AvailableUnknownV1Beta2Reason applies to a condition surfacing object availability unknown. - AvailableUnknownV1Beta2Reason = "AvailableUnknown" - - // ReadyV1Beta2Reason applies to a condition surfacing object readiness. - ReadyV1Beta2Reason = "Ready" - - // NotReadyV1Beta2Reason applies to a condition surfacing object not satisfying readiness criteria. - NotReadyV1Beta2Reason = "NotReady" - - // ReadyUnknownV1Beta2Reason applies to a condition surfacing object readiness unknown. - ReadyUnknownV1Beta2Reason = "ReadyUnknown" - - // UpToDateV1Beta2Reason applies to a condition surfacing object up-tp-date. - UpToDateV1Beta2Reason = "UpToDate" - - // NotUpToDateV1Beta2Reason applies to a condition surfacing object not up-tp-date. - NotUpToDateV1Beta2Reason = "NotUpToDate" - - // UpToDateUnknownV1Beta2Reason applies to a condition surfacing object up-tp-date unknown. - UpToDateUnknownV1Beta2Reason = "UpToDateUnknown" - - // RollingOutV1Beta2Reason surfaces when an object is rolling out. - RollingOutV1Beta2Reason = "RollingOut" - - // NotRollingOutV1Beta2Reason surfaces when an object is not rolling out. - NotRollingOutV1Beta2Reason = "NotRollingOut" - - // ScalingUpV1Beta2Reason surfaces when an object is scaling up. - ScalingUpV1Beta2Reason = "ScalingUp" - - // NotScalingUpV1Beta2Reason surfaces when an object is not scaling up. - NotScalingUpV1Beta2Reason = "NotScalingUp" - - // ScalingDownV1Beta2Reason surfaces when an object is scaling down. - ScalingDownV1Beta2Reason = "ScalingDown" - - // NotScalingDownV1Beta2Reason surfaces when an object is not scaling down. - NotScalingDownV1Beta2Reason = "NotScalingDown" - - // RemediatingV1Beta2Reason 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. - RemediatingV1Beta2Reason = "Remediating" - - // NotRemediatingV1Beta2Reason 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. - NotRemediatingV1Beta2Reason = "NotRemediating" - - // NoReplicasV1Beta2Reason surfaces when an object that manage replicas does not have any. - NoReplicasV1Beta2Reason = "NoReplicas" - - // WaitingForReplicasSetV1Beta2Reason surfaces when the replica field of an object is not set. - WaitingForReplicasSetV1Beta2Reason = "WaitingForReplicasSet" - - // InvalidConditionReportedV1Beta2Reason applies to a condition, usually read from an external object, that is invalid - // (e.g. its status is missing). - InvalidConditionReportedV1Beta2Reason = "InvalidConditionReported" - - // InternalErrorV1Beta2Reason surfaces unexpected errors reporting by controllers. - // In most cases, it will be required to look at controllers logs to properly triage those issues. - InternalErrorV1Beta2Reason = "InternalError" - - // ObjectDoesNotExistV1Beta2Reason surfaces when a referenced object does not exist. - ObjectDoesNotExistV1Beta2Reason = "ObjectDoesNotExist" - - // ObjectDeletedV1Beta2Reason 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. - ObjectDeletedV1Beta2Reason = "ObjectDeleted" - - // NotPausedV1Beta2Reason surfaces when an object is not paused. - NotPausedV1Beta2Reason = "NotPaused" - - // PausedV1Beta2Reason surfaces when an object is paused. - PausedV1Beta2Reason = "Paused" - - // ConnectionDownV1Beta2Reason surfaces that the connection to the workload cluster is down. - ConnectionDownV1Beta2Reason = "ConnectionDown" - - // NotDeletingV1Beta2Reason surfaces when an object is not deleting because the - // DeletionTimestamp is not set. - NotDeletingV1Beta2Reason = "NotDeleting" - - // DeletingV1Beta2Reason surfaces when an object is deleting because the - // DeletionTimestamp is set. This reason is used if none of the more specific reasons apply. - DeletingV1Beta2Reason = "Deleting" - - // DeletionCompletedV1Beta2Reason 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. - DeletionCompletedV1Beta2Reason = "DeletionCompleted" - - // InspectionFailedV1Beta2Reason applies to a condition when inspection of the underlying object failed. - InspectionFailedV1Beta2Reason = "InspectionFailed" - - // WaitingForClusterInfrastructureReadyV1Beta2Reason documents an infra Machine waiting for the cluster - // infrastructure to be ready. - WaitingForClusterInfrastructureReadyV1Beta2Reason = "WaitingForClusterInfrastructureReady" - - // WaitingForControlPlaneInitializedV1Beta2Reason documents an infra Machine waiting - // for the control plane to be initialized. - WaitingForControlPlaneInitializedV1Beta2Reason = "WaitingForControlPlaneInitialized" - - // WaitingForBootstrapDataV1Beta2Reason documents an infra Machine waiting for the bootstrap - // data to be ready before starting to create the Machine's infrastructure. - WaitingForBootstrapDataV1Beta2Reason = "WaitingForBootstrapData" - - // ProvisionedV1Beta2Reason documents an object or a piece of infrastructure being provisioned. - ProvisionedV1Beta2Reason = "Provisioned" - - // NotProvisionedV1Beta2Reason documents an object or a piece of infrastructure is not provisioned. - NotProvisionedV1Beta2Reason = "NotProvisioned" -) 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 deleted file mode 100644 index eb54f254dd..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.conversion.go +++ /dev/null @@ -1,3728 +0,0 @@ -//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/core/v1beta1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.deepcopy.go deleted file mode 100644 index a1b090669c..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,3064 +0,0 @@ -//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 v1beta1 - -import ( - "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" - "k8s.io/apimachinery/pkg/util/intstr" - "sigs.k8s.io/cluster-api/errors" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIEndpoint) DeepCopyInto(out *APIEndpoint) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIEndpoint. -func (in *APIEndpoint) DeepCopy() *APIEndpoint { - if in == nil { - return nil - } - out := new(APIEndpoint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Bootstrap) DeepCopyInto(out *Bootstrap) { - *out = *in - if in.ConfigRef != nil { - in, out := &in.ConfigRef, &out.ConfigRef - *out = new(v1.ObjectReference) - **out = **in - } - if in.DataSecretName != nil { - in, out := &in.DataSecretName, &out.DataSecretName - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Bootstrap. -func (in *Bootstrap) DeepCopy() *Bootstrap { - if in == nil { - return nil - } - out := new(Bootstrap) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Cluster) DeepCopyInto(out *Cluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. -func (in *Cluster) DeepCopy() *Cluster { - if in == nil { - return nil - } - out := new(Cluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Cluster) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *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 *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.EnabledIf != nil { - in, out := &in.EnabledIf, &out.EnabledIf - *out = new(string) - **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 *ClusterClassSpec) DeepCopyInto(out *ClusterClassSpec) { - *out = *in - if in.AvailabilityGates != nil { - in, out := &in.AvailabilityGates, &out.AvailabilityGates - *out = make([]ClusterAvailabilityGate, len(*in)) - copy(*out, *in) - } - in.Infrastructure.DeepCopyInto(&out.Infrastructure) - if in.InfrastructureNamingStrategy != nil { - in, out := &in.InfrastructureNamingStrategy, &out.InfrastructureNamingStrategy - *out = new(InfrastructureNamingStrategy) - (*in).DeepCopyInto(*out) - } - 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.Variables != nil { - in, out := &in.Variables, &out.Variables - *out = make([]ClusterClassStatusVariable, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - 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(ClusterClassV1Beta2Status) - (*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.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 - in.Metadata.DeepCopyInto(&out.Metadata) - 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 *ClusterClassV1Beta2Status) DeepCopyInto(out *ClusterClassV1Beta2Status) { - *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]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClassV1Beta2Status. -func (in *ClusterClassV1Beta2Status) DeepCopy() *ClusterClassV1Beta2Status { - if in == nil { - return nil - } - out := new(ClusterClassV1Beta2Status) - 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 - in.Metadata.DeepCopyInto(&out.Metadata) - 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 *ClusterList) DeepCopyInto(out *ClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Cluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. -func (in *ClusterList) DeepCopy() *ClusterList { - if in == nil { - return nil - } - out := new(ClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterNetwork) DeepCopyInto(out *ClusterNetwork) { - *out = *in - if in.APIServerPort != nil { - in, out := &in.APIServerPort, &out.APIServerPort - *out = new(int32) - **out = **in - } - if in.Services != nil { - in, out := &in.Services, &out.Services - *out = new(NetworkRanges) - (*in).DeepCopyInto(*out) - } - if in.Pods != nil { - in, out := &in.Pods, &out.Pods - *out = new(NetworkRanges) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterNetwork. -func (in *ClusterNetwork) DeepCopy() *ClusterNetwork { - if in == nil { - return nil - } - out := new(ClusterNetwork) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { - *out = *in - if in.ClusterNetwork != nil { - in, out := &in.ClusterNetwork, &out.ClusterNetwork - *out = new(ClusterNetwork) - (*in).DeepCopyInto(*out) - } - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if in.ControlPlaneRef != nil { - in, out := &in.ControlPlaneRef, &out.ControlPlaneRef - *out = new(v1.ObjectReference) - **out = **in - } - if in.InfrastructureRef != nil { - in, out := &in.InfrastructureRef, &out.InfrastructureRef - *out = new(v1.ObjectReference) - **out = **in - } - if in.Topology != nil { - in, out := &in.Topology, &out.Topology - *out = new(Topology) - (*in).DeepCopyInto(*out) - } - 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.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make(FailureDomains, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.ClusterStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.V1Beta2 != nil { - in, out := &in.V1Beta2, &out.V1Beta2 - *out = new(ClusterV1Beta2Status) - (*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 *ClusterV1Beta2Status) DeepCopyInto(out *ClusterV1Beta2Status) { - *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.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) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterV1Beta2Status. -func (in *ClusterV1Beta2Status) DeepCopy() *ClusterV1Beta2Status { - if in == nil { - return nil - } - out := new(ClusterV1Beta2Status) - 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 *ControlPlaneClass) DeepCopyInto(out *ControlPlaneClass) { - *out = *in - in.Metadata.DeepCopyInto(&out.Metadata) - in.LocalObjectTemplate.DeepCopyInto(&out.LocalObjectTemplate) - if in.MachineInfrastructure != nil { - in, out := &in.MachineInfrastructure, &out.MachineInfrastructure - *out = new(LocalObjectTemplate) - (*in).DeepCopyInto(*out) - } - if in.MachineHealthCheck != nil { - in, out := &in.MachineHealthCheck, &out.MachineHealthCheck - *out = new(MachineHealthCheckClass) - (*in).DeepCopyInto(*out) - } - if in.NamingStrategy != nil { - in, out := &in.NamingStrategy, &out.NamingStrategy - *out = new(ControlPlaneClassNamingStrategy) - (*in).DeepCopyInto(*out) - } - if in.NodeDrainTimeout != nil { - in, out := &in.NodeDrainTimeout, &out.NodeDrainTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.NodeVolumeDetachTimeout != nil { - in, out := &in.NodeVolumeDetachTimeout, &out.NodeVolumeDetachTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.NodeDeletionTimeout != nil { - in, out := &in.NodeDeletionTimeout, &out.NodeDeletionTimeout - *out = new(metav1.Duration) - **out = **in - } - 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 *ControlPlaneClassNamingStrategy) DeepCopyInto(out *ControlPlaneClassNamingStrategy) { - *out = *in - if in.Template != nil { - in, out := &in.Template, &out.Template - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneClassNamingStrategy. -func (in *ControlPlaneClassNamingStrategy) DeepCopy() *ControlPlaneClassNamingStrategy { - if in == nil { - return nil - } - out := new(ControlPlaneClassNamingStrategy) - 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 - } - if in.MachineHealthCheck != nil { - in, out := &in.MachineHealthCheck, &out.MachineHealthCheck - *out = new(MachineHealthCheckTopology) - (*in).DeepCopyInto(*out) - } - if in.NodeDrainTimeout != nil { - in, out := &in.NodeDrainTimeout, &out.NodeDrainTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.NodeVolumeDetachTimeout != nil { - in, out := &in.NodeVolumeDetachTimeout, &out.NodeVolumeDetachTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.NodeDeletionTimeout != nil { - in, out := &in.NodeDeletionTimeout, &out.NodeDeletionTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.ReadinessGates != nil { - in, out := &in.ReadinessGates, &out.ReadinessGates - *out = make([]MachineReadinessGate, len(*in)) - copy(*out, *in) - } - if in.Variables != nil { - in, out := &in.Variables, &out.Variables - *out = new(ControlPlaneVariables) - (*in).DeepCopyInto(*out) - } -} - -// 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 *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.GenerateExtension != nil { - in, out := &in.GenerateExtension, &out.GenerateExtension - *out = new(string) - **out = **in - } - if in.ValidateExtension != nil { - in, out := &in.ValidateExtension, &out.ValidateExtension - *out = new(string) - **out = **in - } - if in.DiscoverVariablesExtension != nil { - in, out := &in.DiscoverVariablesExtension, &out.DiscoverVariablesExtension - *out = new(string) - **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 *FailureDomainSpec) DeepCopyInto(out *FailureDomainSpec) { - *out = *in - if in.Attributes != nil { - in, out := &in.Attributes, &out.Attributes - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailureDomainSpec. -func (in *FailureDomainSpec) DeepCopy() *FailureDomainSpec { - if in == nil { - return nil - } - out := new(FailureDomainSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in FailureDomains) DeepCopyInto(out *FailureDomains) { - { - in := &in - *out = make(FailureDomains, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailureDomains. -func (in FailureDomains) DeepCopy() FailureDomains { - if in == nil { - return nil - } - out := new(FailureDomains) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InfrastructureNamingStrategy) DeepCopyInto(out *InfrastructureNamingStrategy) { - *out = *in - if in.Template != nil { - in, out := &in.Template, &out.Template - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InfrastructureNamingStrategy. -func (in *InfrastructureNamingStrategy) DeepCopy() *InfrastructureNamingStrategy { - if in == nil { - return nil - } - out := new(InfrastructureNamingStrategy) - 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) - (*in).DeepCopyInto(*out) - } -} - -// 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 - if in.Variable != nil { - in, out := &in.Variable, &out.Variable - *out = new(string) - **out = **in - } - if in.Template != nil { - in, out := &in.Template, &out.Template - *out = new(string) - **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.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.Minimum != nil { - in, out := &in.Minimum, &out.Minimum - *out = new(int64) - **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) - } - if in.XMetadata != nil { - in, out := &in.XMetadata, &out.XMetadata - *out = new(VariableSchemaMetadata) - (*in).DeepCopyInto(*out) - } - 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 *LocalObjectTemplate) DeepCopyInto(out *LocalObjectTemplate) { - *out = *in - if in.Ref != nil { - in, out := &in.Ref, &out.Ref - *out = new(v1.ObjectReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalObjectTemplate. -func (in *LocalObjectTemplate) DeepCopy() *LocalObjectTemplate { - if in == nil { - return nil - } - out := new(LocalObjectTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Machine) DeepCopyInto(out *Machine) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Machine. -func (in *Machine) DeepCopy() *Machine { - if in == nil { - return nil - } - out := new(Machine) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Machine) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineAddress) DeepCopyInto(out *MachineAddress) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineAddress. -func (in *MachineAddress) DeepCopy() *MachineAddress { - if in == nil { - return nil - } - out := new(MachineAddress) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in MachineAddresses) DeepCopyInto(out *MachineAddresses) { - { - in := &in - *out = make(MachineAddresses, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineAddresses. -func (in MachineAddresses) DeepCopy() MachineAddresses { - if in == nil { - return nil - } - out := new(MachineAddresses) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeletionStatus) DeepCopyInto(out *MachineDeletionStatus) { - *out = *in - if in.NodeDrainStartTime != nil { - in, out := &in.NodeDrainStartTime, &out.NodeDrainStartTime - *out = (*in).DeepCopy() - } - if in.WaitForNodeVolumeDetachStartTime != nil { - in, out := &in.WaitForNodeVolumeDetachStartTime, &out.WaitForNodeVolumeDetachStartTime - *out = (*in).DeepCopy() - } -} - -// 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.Template.DeepCopyInto(&out.Template) - if in.MachineHealthCheck != nil { - in, out := &in.MachineHealthCheck, &out.MachineHealthCheck - *out = new(MachineHealthCheckClass) - (*in).DeepCopyInto(*out) - } - if in.FailureDomain != nil { - in, out := &in.FailureDomain, &out.FailureDomain - *out = new(string) - **out = **in - } - if in.NamingStrategy != nil { - in, out := &in.NamingStrategy, &out.NamingStrategy - *out = new(MachineDeploymentClassNamingStrategy) - (*in).DeepCopyInto(*out) - } - if in.NodeDrainTimeout != nil { - in, out := &in.NodeDrainTimeout, &out.NodeDrainTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.NodeVolumeDetachTimeout != nil { - in, out := &in.NodeVolumeDetachTimeout, &out.NodeVolumeDetachTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.NodeDeletionTimeout != nil { - in, out := &in.NodeDeletionTimeout, &out.NodeDeletionTimeout - *out = new(metav1.Duration) - **out = **in - } - 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) - } - if in.Strategy != nil { - in, out := &in.Strategy, &out.Strategy - *out = new(MachineDeploymentStrategy) - (*in).DeepCopyInto(*out) - } -} - -// 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 *MachineDeploymentClassNamingStrategy) DeepCopyInto(out *MachineDeploymentClassNamingStrategy) { - *out = *in - if in.Template != nil { - in, out := &in.Template, &out.Template - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClassNamingStrategy. -func (in *MachineDeploymentClassNamingStrategy) DeepCopy() *MachineDeploymentClassNamingStrategy { - if in == nil { - return nil - } - out := new(MachineDeploymentClassNamingStrategy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentClassTemplate) DeepCopyInto(out *MachineDeploymentClassTemplate) { - *out = *in - in.Metadata.DeepCopyInto(&out.Metadata) - in.Bootstrap.DeepCopyInto(&out.Bootstrap) - in.Infrastructure.DeepCopyInto(&out.Infrastructure) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClassTemplate. -func (in *MachineDeploymentClassTemplate) DeepCopy() *MachineDeploymentClassTemplate { - if in == nil { - return nil - } - out := new(MachineDeploymentClassTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentList) DeepCopyInto(out *MachineDeploymentList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachineDeployment, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentList. -func (in *MachineDeploymentList) DeepCopy() *MachineDeploymentList { - if in == nil { - return nil - } - out := new(MachineDeploymentList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineDeploymentList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentSpec) DeepCopyInto(out *MachineDeploymentSpec) { - *out = *in - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } - if in.RolloutAfter != nil { - in, out := &in.RolloutAfter, &out.RolloutAfter - *out = (*in).DeepCopy() - } - in.Selector.DeepCopyInto(&out.Selector) - in.Template.DeepCopyInto(&out.Template) - if in.Strategy != nil { - in, out := &in.Strategy, &out.Strategy - *out = new(MachineDeploymentStrategy) - (*in).DeepCopyInto(*out) - } - if in.MachineNamingStrategy != nil { - in, out := &in.MachineNamingStrategy, &out.MachineNamingStrategy - *out = new(MachineNamingStrategy) - **out = **in - } - if in.MinReadySeconds != nil { - in, out := &in.MinReadySeconds, &out.MinReadySeconds - *out = new(int32) - **out = **in - } - if in.RevisionHistoryLimit != nil { - in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit - *out = new(int32) - **out = **in - } - if in.ProgressDeadlineSeconds != nil { - in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds - *out = new(int32) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentSpec. -func (in *MachineDeploymentSpec) DeepCopy() *MachineDeploymentSpec { - if in == nil { - return nil - } - out := new(MachineDeploymentSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentStatus) DeepCopyInto(out *MachineDeploymentStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.V1Beta2 != nil { - in, out := &in.V1Beta2, &out.V1Beta2 - *out = new(MachineDeploymentV1Beta2Status) - (*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 *MachineDeploymentStrategy) DeepCopyInto(out *MachineDeploymentStrategy) { - *out = *in - if in.RollingUpdate != nil { - in, out := &in.RollingUpdate, &out.RollingUpdate - *out = new(MachineRollingUpdateDeployment) - (*in).DeepCopyInto(*out) - } - if in.Remediation != nil { - in, out := &in.Remediation, &out.Remediation - *out = new(RemediationStrategy) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentStrategy. -func (in *MachineDeploymentStrategy) DeepCopy() *MachineDeploymentStrategy { - if in == nil { - return nil - } - out := new(MachineDeploymentStrategy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentTopology) DeepCopyInto(out *MachineDeploymentTopology) { - *out = *in - in.Metadata.DeepCopyInto(&out.Metadata) - if in.FailureDomain != nil { - in, out := &in.FailureDomain, &out.FailureDomain - *out = new(string) - **out = **in - } - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } - if in.MachineHealthCheck != nil { - in, out := &in.MachineHealthCheck, &out.MachineHealthCheck - *out = new(MachineHealthCheckTopology) - (*in).DeepCopyInto(*out) - } - if in.NodeDrainTimeout != nil { - in, out := &in.NodeDrainTimeout, &out.NodeDrainTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.NodeVolumeDetachTimeout != nil { - in, out := &in.NodeVolumeDetachTimeout, &out.NodeVolumeDetachTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.NodeDeletionTimeout != nil { - in, out := &in.NodeDeletionTimeout, &out.NodeDeletionTimeout - *out = new(metav1.Duration) - **out = **in - } - 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) - } - if in.Strategy != nil { - in, out := &in.Strategy, &out.Strategy - *out = new(MachineDeploymentStrategy) - (*in).DeepCopyInto(*out) - } - if in.Variables != nil { - in, out := &in.Variables, &out.Variables - *out = new(MachineDeploymentVariables) - (*in).DeepCopyInto(*out) - } -} - -// 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 *MachineDeploymentV1Beta2Status) DeepCopyInto(out *MachineDeploymentV1Beta2Status) { - *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 MachineDeploymentV1Beta2Status. -func (in *MachineDeploymentV1Beta2Status) DeepCopy() *MachineDeploymentV1Beta2Status { - if in == nil { - return nil - } - out := new(MachineDeploymentV1Beta2Status) - 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 *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(metav1.LabelSelector) - (*in).DeepCopyInto(*out) - } - if in.ClusterSelector != nil { - in, out := &in.ClusterSelector, &out.ClusterSelector - *out = new(metav1.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(metav1.LabelSelector) - (*in).DeepCopyInto(*out) - } - if in.NamespaceSelector != nil { - in, out := &in.NamespaceSelector, &out.NamespaceSelector - *out = new(metav1.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 *MachineHealthCheckClass) DeepCopyInto(out *MachineHealthCheckClass) { - *out = *in - if in.UnhealthyConditions != nil { - in, out := &in.UnhealthyConditions, &out.UnhealthyConditions - *out = make([]UnhealthyCondition, len(*in)) - copy(*out, *in) - } - if in.MaxUnhealthy != nil { - in, out := &in.MaxUnhealthy, &out.MaxUnhealthy - *out = new(intstr.IntOrString) - **out = **in - } - if in.UnhealthyRange != nil { - in, out := &in.UnhealthyRange, &out.UnhealthyRange - *out = new(string) - **out = **in - } - if in.NodeStartupTimeout != nil { - in, out := &in.NodeStartupTimeout, &out.NodeStartupTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.RemediationTemplate != nil { - in, out := &in.RemediationTemplate, &out.RemediationTemplate - *out = new(v1.ObjectReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckClass. -func (in *MachineHealthCheckClass) DeepCopy() *MachineHealthCheckClass { - if in == nil { - return nil - } - out := new(MachineHealthCheckClass) - 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 *MachineHealthCheckSpec) DeepCopyInto(out *MachineHealthCheckSpec) { - *out = *in - in.Selector.DeepCopyInto(&out.Selector) - if in.UnhealthyConditions != nil { - in, out := &in.UnhealthyConditions, &out.UnhealthyConditions - *out = make([]UnhealthyCondition, len(*in)) - copy(*out, *in) - } - if in.MaxUnhealthy != nil { - in, out := &in.MaxUnhealthy, &out.MaxUnhealthy - *out = new(intstr.IntOrString) - **out = **in - } - if in.UnhealthyRange != nil { - in, out := &in.UnhealthyRange, &out.UnhealthyRange - *out = new(string) - **out = **in - } - if in.NodeStartupTimeout != nil { - in, out := &in.NodeStartupTimeout, &out.NodeStartupTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.RemediationTemplate != nil { - in, out := &in.RemediationTemplate, &out.RemediationTemplate - *out = new(v1.ObjectReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckSpec. -func (in *MachineHealthCheckSpec) DeepCopy() *MachineHealthCheckSpec { - if in == nil { - return nil - } - out := new(MachineHealthCheckSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineHealthCheckStatus) DeepCopyInto(out *MachineHealthCheckStatus) { - *out = *in - if in.Targets != nil { - in, out := &in.Targets, &out.Targets - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.V1Beta2 != nil { - in, out := &in.V1Beta2, &out.V1Beta2 - *out = new(MachineHealthCheckV1Beta2Status) - (*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 *MachineHealthCheckTopology) DeepCopyInto(out *MachineHealthCheckTopology) { - *out = *in - if in.Enable != nil { - in, out := &in.Enable, &out.Enable - *out = new(bool) - **out = **in - } - in.MachineHealthCheckClass.DeepCopyInto(&out.MachineHealthCheckClass) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckTopology. -func (in *MachineHealthCheckTopology) DeepCopy() *MachineHealthCheckTopology { - if in == nil { - return nil - } - out := new(MachineHealthCheckTopology) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineHealthCheckV1Beta2Status) DeepCopyInto(out *MachineHealthCheckV1Beta2Status) { - *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]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckV1Beta2Status. -func (in *MachineHealthCheckV1Beta2Status) DeepCopy() *MachineHealthCheckV1Beta2Status { - if in == nil { - return nil - } - out := new(MachineHealthCheckV1Beta2Status) - 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 *MachineNamingStrategy) DeepCopyInto(out *MachineNamingStrategy) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineNamingStrategy. -func (in *MachineNamingStrategy) DeepCopy() *MachineNamingStrategy { - if in == nil { - return nil - } - out := new(MachineNamingStrategy) - 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.Template.DeepCopyInto(&out.Template) - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.NamingStrategy != nil { - in, out := &in.NamingStrategy, &out.NamingStrategy - *out = new(MachinePoolClassNamingStrategy) - (*in).DeepCopyInto(*out) - } - if in.NodeDrainTimeout != nil { - in, out := &in.NodeDrainTimeout, &out.NodeDrainTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.NodeVolumeDetachTimeout != nil { - in, out := &in.NodeVolumeDetachTimeout, &out.NodeVolumeDetachTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.NodeDeletionTimeout != nil { - in, out := &in.NodeDeletionTimeout, &out.NodeDeletionTimeout - *out = new(metav1.Duration) - **out = **in - } - 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 *MachinePoolClassNamingStrategy) DeepCopyInto(out *MachinePoolClassNamingStrategy) { - *out = *in - if in.Template != nil { - in, out := &in.Template, &out.Template - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolClassNamingStrategy. -func (in *MachinePoolClassNamingStrategy) DeepCopy() *MachinePoolClassNamingStrategy { - if in == nil { - return nil - } - out := new(MachinePoolClassNamingStrategy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachinePoolClassTemplate) DeepCopyInto(out *MachinePoolClassTemplate) { - *out = *in - in.Metadata.DeepCopyInto(&out.Metadata) - in.Bootstrap.DeepCopyInto(&out.Bootstrap) - in.Infrastructure.DeepCopyInto(&out.Infrastructure) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolClassTemplate. -func (in *MachinePoolClassTemplate) DeepCopy() *MachinePoolClassTemplate { - if in == nil { - return nil - } - out := new(MachinePoolClassTemplate) - 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.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 - in.Metadata.DeepCopyInto(&out.Metadata) - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.NodeDrainTimeout != nil { - in, out := &in.NodeDrainTimeout, &out.NodeDrainTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.NodeVolumeDetachTimeout != nil { - in, out := &in.NodeVolumeDetachTimeout, &out.NodeVolumeDetachTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.NodeDeletionTimeout != nil { - in, out := &in.NodeDeletionTimeout, &out.NodeDeletionTimeout - *out = new(metav1.Duration) - **out = **in - } - 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 - } - if in.Variables != nil { - in, out := &in.Variables, &out.Variables - *out = new(MachinePoolVariables) - (*in).DeepCopyInto(*out) - } -} - -// 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 *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 - 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 *MachineRollingUpdateDeployment) DeepCopyInto(out *MachineRollingUpdateDeployment) { - *out = *in - if in.MaxUnavailable != nil { - in, out := &in.MaxUnavailable, &out.MaxUnavailable - *out = new(intstr.IntOrString) - **out = **in - } - if in.MaxSurge != nil { - in, out := &in.MaxSurge, &out.MaxSurge - *out = new(intstr.IntOrString) - **out = **in - } - if in.DeletePolicy != nil { - in, out := &in.DeletePolicy, &out.DeletePolicy - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineRollingUpdateDeployment. -func (in *MachineRollingUpdateDeployment) DeepCopy() *MachineRollingUpdateDeployment { - if in == nil { - return nil - } - out := new(MachineRollingUpdateDeployment) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSet) DeepCopyInto(out *MachineSet) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSet. -func (in *MachineSet) DeepCopy() *MachineSet { - if in == nil { - return nil - } - out := new(MachineSet) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineSet) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSetList) DeepCopyInto(out *MachineSetList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachineSet, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetList. -func (in *MachineSetList) DeepCopy() *MachineSetList { - if in == nil { - return nil - } - out := new(MachineSetList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineSetList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSetSpec) DeepCopyInto(out *MachineSetSpec) { - *out = *in - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } - in.Selector.DeepCopyInto(&out.Selector) - in.Template.DeepCopyInto(&out.Template) - if in.MachineNamingStrategy != nil { - in, out := &in.MachineNamingStrategy, &out.MachineNamingStrategy - *out = new(MachineNamingStrategy) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetSpec. -func (in *MachineSetSpec) DeepCopy() *MachineSetSpec { - if in == nil { - return nil - } - out := new(MachineSetSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSetStatus) DeepCopyInto(out *MachineSetStatus) { - *out = *in - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.MachineSetStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - 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(MachineSetV1Beta2Status) - (*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 *MachineSetV1Beta2Status) DeepCopyInto(out *MachineSetV1Beta2Status) { - *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 MachineSetV1Beta2Status. -func (in *MachineSetV1Beta2Status) DeepCopy() *MachineSetV1Beta2Status { - if in == nil { - return nil - } - out := new(MachineSetV1Beta2Status) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSpec) DeepCopyInto(out *MachineSpec) { - *out = *in - in.Bootstrap.DeepCopyInto(&out.Bootstrap) - out.InfrastructureRef = in.InfrastructureRef - if in.Version != nil { - in, out := &in.Version, &out.Version - *out = new(string) - **out = **in - } - if in.ProviderID != nil { - in, out := &in.ProviderID, &out.ProviderID - *out = new(string) - **out = **in - } - if in.FailureDomain != nil { - in, out := &in.FailureDomain, &out.FailureDomain - *out = new(string) - **out = **in - } - if in.ReadinessGates != nil { - in, out := &in.ReadinessGates, &out.ReadinessGates - *out = make([]MachineReadinessGate, len(*in)) - copy(*out, *in) - } - if in.NodeDrainTimeout != nil { - in, out := &in.NodeDrainTimeout, &out.NodeDrainTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.NodeVolumeDetachTimeout != nil { - in, out := &in.NodeVolumeDetachTimeout, &out.NodeVolumeDetachTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.NodeDeletionTimeout != nil { - in, out := &in.NodeDeletionTimeout, &out.NodeDeletionTimeout - *out = new(metav1.Duration) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSpec. -func (in *MachineSpec) DeepCopy() *MachineSpec { - if in == nil { - return nil - } - out := new(MachineSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineStatus) DeepCopyInto(out *MachineStatus) { - *out = *in - if in.NodeRef != nil { - in, out := &in.NodeRef, &out.NodeRef - *out = new(v1.ObjectReference) - **out = **in - } - if in.NodeInfo != nil { - in, out := &in.NodeInfo, &out.NodeInfo - *out = new(v1.NodeSystemInfo) - (*in).DeepCopyInto(*out) - } - if in.LastUpdated != nil { - in, out := &in.LastUpdated, &out.LastUpdated - *out = (*in).DeepCopy() - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.MachineStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make(MachineAddresses, len(*in)) - copy(*out, *in) - } - if in.CertificatesExpiryDate != nil { - in, out := &in.CertificatesExpiryDate, &out.CertificatesExpiryDate - *out = (*in).DeepCopy() - } - 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.Deletion != nil { - in, out := &in.Deletion, &out.Deletion - *out = new(MachineDeletionStatus) - (*in).DeepCopyInto(*out) - } - if in.V1Beta2 != nil { - in, out := &in.V1Beta2, &out.V1Beta2 - *out = new(MachineV1Beta2Status) - (*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 *MachineV1Beta2Status) DeepCopyInto(out *MachineV1Beta2Status) { - *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]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineV1Beta2Status. -func (in *MachineV1Beta2Status) DeepCopy() *MachineV1Beta2Status { - if in == nil { - return nil - } - out := new(MachineV1Beta2Status) - 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.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 *RemediationStrategy) DeepCopyInto(out *RemediationStrategy) { - *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 RemediationStrategy. -func (in *RemediationStrategy) DeepCopy() *RemediationStrategy { - if in == nil { - return nil - } - out := new(RemediationStrategy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Topology) DeepCopyInto(out *Topology) { - *out = *in - if in.RolloutAfter != nil { - in, out := &in.RolloutAfter, &out.RolloutAfter - *out = (*in).DeepCopy() - } - in.ControlPlane.DeepCopyInto(&out.ControlPlane) - if in.Workers != nil { - in, out := &in.Workers, &out.Workers - *out = new(WorkersTopology) - (*in).DeepCopyInto(*out) - } - 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 *UnhealthyCondition) DeepCopyInto(out *UnhealthyCondition) { - *out = *in - out.Timeout = in.Timeout -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UnhealthyCondition. -func (in *UnhealthyCondition) DeepCopy() *UnhealthyCondition { - if in == nil { - return nil - } - out := new(UnhealthyCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *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/v1beta1/zz_generated.openapi.go b/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.openapi.go deleted file mode 100644 index 13a78b2371..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/core/v1beta1/zz_generated.openapi.go +++ /dev/null @@ -1,5426 +0,0 @@ -//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 v1beta1 - -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/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_cluster_api_api_core_v1beta1_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.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "port": { - SchemaProps: spec.SchemaProps{ - Description: "port is the port on which the API server is serving.", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"host", "port"}, - }, - }, - } -} - -func schema_cluster_api_api_core_v1beta1_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.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - "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{ - "k8s.io/api/core/v1.ObjectReference"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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/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/core/v1beta1.ClusterStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_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.", - Default: "", - 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_v1beta1_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.", - 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/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/core/v1beta1.ClusterClassStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_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/v1beta1.ClusterClass"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClass"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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.", - Default: "", - 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": { - 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/v1beta1.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/v1beta1.ExternalPatchDefinition"), - }, - }, - }, - Required: []string{"name"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.ExternalPatchDefinition", "sigs.k8s.io/cluster-api/api/core/v1beta1.PatchDefinition"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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: this field is considered only for computing v1beta2 conditions. 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.", - 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.ClusterAvailabilityGate"), - }, - }, - }, - }, - }, - "infrastructure": { - 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/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/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/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/core/v1beta1.WorkersClass"), - }, - }, - "variables": { - 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/v1beta1.ClusterClassVariable"), - }, - }, - }, - }, - }, - "patches": { - 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/v1beta1.ClusterClassPatch"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_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{ - "variables": { - 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/v1beta1.ClusterClassStatusVariable"), - }, - }, - }, - }, - }, - "conditions": { - SchemaProps: spec.SchemaProps{ - Description: "conditions defines current observed state of 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/v1beta1.Condition"), - }, - }, - }, - }, - }, - "observedGeneration": { - SchemaProps: spec.SchemaProps{ - Description: "observedGeneration is the latest generation observed by the controller.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "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/core/v1beta1.ClusterClassV1Beta2Status"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_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.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "definitionsConflict": { - SchemaProps: spec.SchemaProps{ - Description: "definitionsConflict specifies whether or not there are conflicting definitions for a single variable name.", - Default: false, - Type: []string{"boolean"}, - Format: "", - }, - }, - "definitions": { - 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/v1beta1.ClusterClassStatusVariableDefinition"), - }, - }, - }, - }, - }, - }, - Required: []string{"name", "definitions"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassStatusVariableDefinition"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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.", - Default: "", - 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.", - Default: false, - Type: []string{"boolean"}, - Format: "", - }, - }, - "metadata": { - 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/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/core/v1beta1.VariableSchema"), - }, - }, - }, - Required: []string{"from", "required", "schema"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassVariableMetadata", "sigs.k8s.io/cluster-api/api/core/v1beta1.VariableSchema"}, - } -} - -func schema_cluster_api_api_core_v1beta1_ClusterClassV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ClusterClassV1Beta2Status groups all the fields that will be added or modified in ClusterClass 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 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"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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.", - Default: "", - 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.", - Default: false, - Type: []string{"boolean"}, - Format: "", - }, - }, - "metadata": { - 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/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/core/v1beta1.VariableSchema"), - }, - }, - }, - Required: []string{"name", "required", "schema"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterClassVariableMetadata", "sigs.k8s.io/cluster-api/api/core/v1beta1.VariableSchema"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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_v1beta1_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_v1beta1_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/v1beta1.Cluster"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.Cluster"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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.", - 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/core/v1beta1.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/v1beta1.NetworkRanges"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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.", - 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/core/v1beta1.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.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - "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.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - "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/core/v1beta1.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.\n\nNOTE: this field is considered only for computing v1beta2 conditions.", - 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.ClusterAvailabilityGate"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_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{ - "failureDomains": { - SchemaProps: spec.SchemaProps{ - Description: "failureDomains is a slice of failure domain objects synced from the infrastructure provider.", - 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/v1beta1.FailureDomainSpec"), - }, - }, - }, - }, - }, - "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: "", - }, - }, - "phase": { - SchemaProps: spec.SchemaProps{ - Description: "phase represents the current phase of cluster actuation.", - Type: []string{"string"}, - Format: "", - }, - }, - "infrastructureReady": { - SchemaProps: spec.SchemaProps{ - Description: "infrastructureReady is the state of the infrastructure provider.", - Default: false, - Type: []string{"boolean"}, - Format: "", - }, - }, - "controlPlaneReady": { - SchemaProps: spec.SchemaProps{ - Description: "controlPlaneReady denotes if the control plane became ready during initial provisioning to receive requests. 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. Please use conditions to check the operational state of the control plane.", - Default: false, - Type: []string{"boolean"}, - Format: "", - }, - }, - "conditions": { - SchemaProps: spec.SchemaProps{ - Description: "conditions defines current service state of 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/v1beta1.Condition"), - }, - }, - }, - }, - }, - "observedGeneration": { - SchemaProps: spec.SchemaProps{ - Description: "observedGeneration is the latest generation observed by the controller.", - Type: []string{"integer"}, - Format: "int64", - }, - }, - "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/core/v1beta1.ClusterV1Beta2Status"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_ClusterV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ClusterV1Beta2Status groups all the fields that will be added or modified in Cluster 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 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"), - }, - }, - }, - }, - }, - "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/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/core/v1beta1.WorkersStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_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.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "definitionFrom": { - SchemaProps: spec.SchemaProps{ - Description: "definitionFrom specifies where the definition of this Variable is from.\n\nDeprecated: This field is deprecated, must not be set anymore and is going to be removed in the next apiVersion.", - 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_v1beta1_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_v1beta1_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/v1beta1.ObjectMeta"), - }, - }, - "ref": { - SchemaProps: spec.SchemaProps{ - Description: "ref is a required reference to a custom resource offered by a provider.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - "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/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/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/core/v1beta1.ControlPlaneClassNamingStrategy"), - }, - }, - "nodeDrainTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeDrainTimeout is the total amount of time that the controller will spend on draining a node. The default value is 0, meaning that the node can be drained without any time limitations. NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` NOTE: This value can be overridden while defining a Cluster.Topology.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "nodeVolumeDetachTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeVolumeDetachTimeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "nodeDeletionTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeDeletionTimeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "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: This field is considered only for computing v1beta2 conditions. 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.", - 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.MachineReadinessGate"), - }, - }, - }, - }, - }, - }, - Required: []string{"ref"}, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_ControlPlaneClassNamingStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "ControlPlaneClassNamingStrategy 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_v1beta1_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/v1beta1.ObjectMeta"), - }, - }, - "replicas": { - SchemaProps: spec.SchemaProps{ - Description: "replicas is the number of control plane nodes. If the value is nil, the ControlPlane object is created without the number of Replicas and it's assumed that the control plane controller does not implement support for this field. When specified against a control plane provider that lacks support for this field, this value will be ignored.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "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/core/v1beta1.MachineHealthCheckTopology"), - }, - }, - "nodeDrainTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeDrainTimeout is the total amount of time that the controller will spend on draining a node. The default value is 0, meaning that the node can be drained without any time limitations. NOTE: NodeDrainTimeout is different from `kubectl drain --timeout`", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "nodeVolumeDetachTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeVolumeDetachTimeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "nodeDeletionTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeDeletionTimeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "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: This field is considered only for computing v1beta2 conditions. 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/v1beta1.MachineReadinessGate"), - }, - }, - }, - }, - }, - "variables": { - SchemaProps: spec.SchemaProps{ - Description: "variables can be used to customize the ControlPlane through patches.", - 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/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_cluster_api_api_core_v1beta1_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/v1beta1.ClusterVariable"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterVariable"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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 GenerateExtension or ValidateExtension must be set.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "generateExtension": { - SchemaProps: spec.SchemaProps{ - Description: "generateExtension references an extension which is called to generate patches.", - Type: []string{"string"}, - Format: "", - }, - }, - "validateExtension": { - SchemaProps: spec.SchemaProps{ - Description: "validateExtension 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_v1beta1_FailureDomainSpec(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "FailureDomainSpec is the Schema for Cluster API failure domains. It allows controllers to understand how many failure domains a cluster can optionally span across.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "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: "", - }, - }, - }, - }, - }, - }, - }, - }, - } -} - -func schema_cluster_api_api_core_v1beta1_InfrastructureNamingStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "InfrastructureNamingStrategy 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_v1beta1_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.", - Default: "", - 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", - Default: "", - 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/v1beta1.JSONPatchValue"), - }, - }, - }, - Required: []string{"op", "path"}, - }, - }, - Dependencies: []string{ - "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1.JSON", "sigs.k8s.io/cluster-api/api/core/v1beta1.JSONPatchValue"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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_v1beta1_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/v1beta1.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/v1beta1.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": { - 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/v1beta1.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": { - 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/v1beta1.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.", - Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.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/v1beta1.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/v1beta1.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/v1beta1.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/v1beta1.JSONSchemaProps"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_LocalObjectTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "LocalObjectTemplate defines a template for a topology Class.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "ref": { - SchemaProps: spec.SchemaProps{ - Description: "ref is a required reference to a custom resource offered by a provider.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - }, - Required: []string{"ref"}, - }, - }, - Dependencies: []string{ - "k8s.io/api/core/v1.ObjectReference"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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/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/core/v1beta1.MachineStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_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.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "address": { - SchemaProps: spec.SchemaProps{ - Description: "address is the machine address.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, - Required: []string{"type", "address"}, - }, - }, - } -} - -func schema_cluster_api_api_core_v1beta1_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 NodeDrainTimeout 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 NodeVolumeDetachTimeout 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_v1beta1_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/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/core/v1beta1.MachineDeploymentStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_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{ - "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.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "template": { - 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/core/v1beta1.MachineDeploymentClassTemplate"), - }, - }, - "machineHealthCheck": { - SchemaProps: spec.SchemaProps{ - Description: "machineHealthCheck defines a MachineHealthCheck for this MachineDeploymentClass.", - Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckClass"), - }, - }, - "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. NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.", - Type: []string{"string"}, - Format: "", - }, - }, - "namingStrategy": { - SchemaProps: spec.SchemaProps{ - Description: "namingStrategy allows changing the naming pattern used when creating the MachineDeployment.", - Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentClassNamingStrategy"), - }, - }, - "nodeDrainTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeDrainTimeout is the total amount of time that the controller will spend on draining a node. The default value is 0, meaning that the node can be drained without any time limitations. NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` NOTE: This value can be overridden while defining a Cluster.Topology using this MachineDeploymentClass.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "nodeVolumeDetachTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeVolumeDetachTimeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "nodeDeletionTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeDeletionTimeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "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: This field is considered only for computing v1beta2 conditions. NOTE: 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/v1beta1.MachineReadinessGate"), - }, - }, - }, - }, - }, - "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/core/v1beta1.MachineDeploymentStrategy"), - }, - }, - }, - Required: []string{"class", "template"}, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_MachineDeploymentClassNamingStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MachineDeploymentClassNamingStrategy 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_v1beta1_MachineDeploymentClassTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MachineDeploymentClassTemplate defines how a MachineDeployment generated from a MachineDeploymentClass should look like.", - 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/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/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/core/v1beta1.LocalObjectTemplate"), - }, - }, - }, - Required: []string{"bootstrap", "infrastructure"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.LocalObjectTemplate", "sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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/v1beta1.MachineDeployment"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeployment"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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.", - Default: "", - 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", - }, - }, - "rolloutAfter": { - SchemaProps: spec.SchemaProps{ - Description: "rolloutAfter 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"), - }, - }, - "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/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/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/core/v1beta1.MachineNamingStrategy"), - }, - }, - "minReadySeconds": { - SchemaProps: spec.SchemaProps{ - Description: "minReadySeconds is the minimum number of seconds for which a Node for a newly created machine should be ready before considering the replica available. Defaults to 0 (machine will be considered available as soon as the Node is ready)", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "revisionHistoryLimit": { - SchemaProps: spec.SchemaProps{ - Description: "revisionHistoryLimit is the number of old MachineSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.\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/issues/10479 for more details.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "paused": { - SchemaProps: spec.SchemaProps{ - Description: "paused indicates that the deployment is paused.", - Type: []string{"boolean"}, - Format: "", - }, - }, - "progressDeadlineSeconds": { - SchemaProps: spec.SchemaProps{ - Description: "progressDeadlineSeconds is the maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s.\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/issues/11470 for more details.", - Type: []string{"integer"}, - Format: "int32", - }, - }, - }, - Required: []string{"clusterName", "selector", "template"}, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_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{ - "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).", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - "updatedReplicas": { - SchemaProps: spec.SchemaProps{ - Description: "updatedReplicas is the total number of non-terminated machines targeted by this deployment that have the desired template spec.", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - "readyReplicas": { - SchemaProps: spec.SchemaProps{ - Description: "readyReplicas is the total number of ready machines targeted by this deployment.", - 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.", - 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", - }, - }, - "phase": { - SchemaProps: spec.SchemaProps{ - Description: "phase represents the current phase of a MachineDeployment (ScalingUp, ScalingDown, Running, Failed, or Unknown).", - Type: []string{"string"}, - Format: "", - }, - }, - "conditions": { - SchemaProps: spec.SchemaProps{ - Description: "conditions defines current service state of the MachineDeployment.", - 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 MachineDeployment's status with the V1Beta2 version.", - Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentV1Beta2Status"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.Condition", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentV1Beta2Status"}, - } -} - -func schema_cluster_api_api_core_v1beta1_MachineDeploymentStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MachineDeploymentStrategy describes how to replace existing machines with new ones.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "type of deployment. Allowed values are RollingUpdate and OnDelete. The default is RollingUpdate.", - Type: []string{"string"}, - Format: "", - }, - }, - "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/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/core/v1beta1.RemediationStrategy"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineRollingUpdateDeployment", "sigs.k8s.io/cluster-api/api/core/v1beta1.RemediationStrategy"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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/v1beta1.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.", - Default: "", - 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.", - Default: "", - 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", - }, - }, - "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/core/v1beta1.MachineHealthCheckTopology"), - }, - }, - "nodeDrainTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeDrainTimeout is the total amount of time that the controller will spend on draining a node. The default value is 0, meaning that the node can be drained without any time limitations. NOTE: NodeDrainTimeout is different from `kubectl drain --timeout`", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "nodeVolumeDetachTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeVolumeDetachTimeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "nodeDeletionTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeDeletionTimeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "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.\n\nNOTE: This field is considered only for computing v1beta2 conditions.", - 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.MachineReadinessGate"), - }, - }, - }, - }, - }, - "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/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/core/v1beta1.MachineDeploymentVariables"), - }, - }, - }, - Required: []string{"class", "name"}, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_MachineDeploymentV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MachineDeploymentV1Beta2Status groups all the fields that will be added or modified in MachineDeployment 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 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"), - }, - }, - }, - }, - }, - "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", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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/v1beta1.ClusterVariable"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterVariable"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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/v1beta1.MachineDrainRuleSpec"), - }, - }, - }, - Required: []string{"metadata", "spec"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ObjectMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRuleSpec"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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.", - Default: "", - 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_v1beta1_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/v1beta1.MachineDrainRule"), - }, - }, - }, - }, - }, - }, - Required: []string{"metadata", "items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDrainRule"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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_v1beta1_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_v1beta1_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/v1beta1.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/v1beta1.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/v1beta1.MachineDrainRulePodSelector"), - }, - }, - }, - }, - }, - }, - Required: []string{"drain"}, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_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/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/core/v1beta1.MachineHealthCheckStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_MachineHealthCheckClass(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MachineHealthCheckClass defines a MachineHealthCheck for a group of Machines.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "unhealthyConditions": { - SchemaProps: spec.SchemaProps{ - Description: "unhealthyConditions contains a list of the conditions that determine whether a node is considered unhealthy. The conditions are combined in a logical OR, i.e. if any of the conditions is met, the node is unhealthy.", - 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.UnhealthyCondition"), - }, - }, - }, - }, - }, - "maxUnhealthy": { - SchemaProps: spec.SchemaProps{ - Description: "maxUnhealthy specifies the maximum number of unhealthy machines allowed. Any further remediation is only allowed if at most \"maxUnhealthy\" machines selected by \"selector\" are not healthy.", - Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), - }, - }, - "unhealthyRange": { - SchemaProps: spec.SchemaProps{ - Description: "unhealthyRange specifies the range of unhealthy machines allowed. Any further remediation is only allowed if the number of machines selected by \"selector\" as not healthy is within the range of \"unhealthyRange\". Takes precedence over maxUnhealthy. Eg. \"[3-5]\" - This means that remediation will be allowed only when: (a) there are at least 3 unhealthy machines (and) (b) there are at most 5 unhealthy machines", - Type: []string{"string"}, - Format: "", - }, - }, - "nodeStartupTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeStartupTimeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "remediationTemplate": { - SchemaProps: spec.SchemaProps{ - Description: "remediationTemplate 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.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - }, - }, - }, - 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/core/v1beta1.UnhealthyCondition"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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/v1beta1.MachineHealthCheck"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheck"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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.", - Default: "", - 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"), - }, - }, - "unhealthyConditions": { - SchemaProps: spec.SchemaProps{ - Description: "unhealthyConditions contains a list of the conditions that determine whether a node is considered unhealthy. The conditions are combined in a logical OR, i.e. if any of the conditions is met, the node is unhealthy.", - 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.UnhealthyCondition"), - }, - }, - }, - }, - }, - "maxUnhealthy": { - SchemaProps: spec.SchemaProps{ - Description: "maxUnhealthy specifies the maximum number of unhealthy machines allowed. Any further remediation is only allowed if at most \"maxUnhealthy\" machines selected by \"selector\" are not healthy.\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/issues/10722 for more details.", - Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), - }, - }, - "unhealthyRange": { - SchemaProps: spec.SchemaProps{ - Description: "unhealthyRange specifies the range of unhealthy machines allowed. Any further remediation is only allowed if the number of machines selected by \"selector\" as not healthy is within the range of \"unhealthyRange\". Takes precedence over maxUnhealthy. Eg. \"[3-5]\" - This means that remediation will be allowed only when: (a) there are at least 3 unhealthy machines (and) (b) there are at most 5 unhealthy machines\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/issues/10722 for more details.", - Type: []string{"string"}, - Format: "", - }, - }, - "nodeStartupTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeStartupTimeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "remediationTemplate": { - SchemaProps: spec.SchemaProps{ - Description: "remediationTemplate 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.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - }, - Required: []string{"clusterName", "selector"}, - }, - }, - 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/core/v1beta1.UnhealthyCondition"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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{ - "expectedMachines": { - SchemaProps: spec.SchemaProps{ - Description: "expectedMachines is the total number of machines counted by this machine health check", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - "currentHealthy": { - SchemaProps: spec.SchemaProps{ - Description: "currentHealthy is the total number of healthy machines counted by this machine health check", - Default: 0, - 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", - Default: 0, - 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": { - 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: "", - }, - }, - }, - }, - }, - "conditions": { - SchemaProps: spec.SchemaProps{ - Description: "conditions defines current service state of the MachineHealthCheck.", - 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 MachineHealthCheck's status with the V1Beta2 version.", - Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckV1Beta2Status"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.Condition", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineHealthCheckV1Beta2Status"}, - } -} - -func schema_cluster_api_api_core_v1beta1_MachineHealthCheckTopology(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MachineHealthCheckTopology defines a MachineHealthCheck for a group of machines.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "enable": { - SchemaProps: spec.SchemaProps{ - Description: "enable 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: "", - }, - }, - "unhealthyConditions": { - SchemaProps: spec.SchemaProps{ - Description: "unhealthyConditions contains a list of the conditions that determine whether a node is considered unhealthy. The conditions are combined in a logical OR, i.e. if any of the conditions is met, the node is unhealthy.", - 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.UnhealthyCondition"), - }, - }, - }, - }, - }, - "maxUnhealthy": { - SchemaProps: spec.SchemaProps{ - Description: "maxUnhealthy specifies the maximum number of unhealthy machines allowed. Any further remediation is only allowed if at most \"maxUnhealthy\" machines selected by \"selector\" are not healthy.", - Ref: ref("k8s.io/apimachinery/pkg/util/intstr.IntOrString"), - }, - }, - "unhealthyRange": { - SchemaProps: spec.SchemaProps{ - Description: "unhealthyRange specifies the range of unhealthy machines allowed. Any further remediation is only allowed if the number of machines selected by \"selector\" as not healthy is within the range of \"unhealthyRange\". Takes precedence over maxUnhealthy. Eg. \"[3-5]\" - This means that remediation will be allowed only when: (a) there are at least 3 unhealthy machines (and) (b) there are at most 5 unhealthy machines", - Type: []string{"string"}, - Format: "", - }, - }, - "nodeStartupTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeStartupTimeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "remediationTemplate": { - SchemaProps: spec.SchemaProps{ - Description: "remediationTemplate 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.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - }, - }, - }, - 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/core/v1beta1.UnhealthyCondition"}, - } -} - -func schema_cluster_api_api_core_v1beta1_MachineHealthCheckV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MachineHealthCheckV1Beta2Status groups all the fields that will be added or modified in MachineHealthCheck 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 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"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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/v1beta1.Machine"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.Machine"}, - } -} - -func schema_cluster_api_api_core_v1beta1_MachineNamingStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - 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.", - 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_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{ - 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{ - "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.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "template": { - 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/core/v1beta1.MachinePoolClassTemplate"), - }, - }, - "failureDomains": { - 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: "", - }, - }, - }, - }, - }, - "namingStrategy": { - SchemaProps: spec.SchemaProps{ - Description: "namingStrategy allows changing the naming pattern used when creating the MachinePool.", - Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolClassNamingStrategy"), - }, - }, - "nodeDrainTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeDrainTimeout is the total amount of time that the controller will spend on draining a node. The default value is 0, meaning that the node can be drained without any time limitations. NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` NOTE: This value can be overridden while defining a Cluster.Topology using this MachinePoolClass.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "nodeVolumeDetachTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeVolumeDetachTimeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "nodeDeletionTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeDeletionTimeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "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", "template"}, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_MachinePoolClassNamingStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MachinePoolClassNamingStrategy defines the naming strategy for machine pool 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_v1beta1_MachinePoolClassTemplate(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MachinePoolClassTemplate defines how a MachinePool generated from a MachinePoolClass should look like.", - 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/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/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/core/v1beta1.LocalObjectTemplate"), - }, - }, - }, - Required: []string{"bootstrap", "infrastructure"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.LocalObjectTemplate", "sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta"}, - } -} - -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{ - 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/v1beta1.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.", - Default: "", - 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.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "failureDomains": { - 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: "", - }, - }, - }, - }, - }, - "nodeDrainTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeDrainTimeout is the total amount of time that the controller will spend on draining a node. The default value is 0, meaning that the node can be drained without any time limitations. NOTE: NodeDrainTimeout is different from `kubectl drain --timeout`", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "nodeVolumeDetachTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeVolumeDetachTimeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "nodeDeletionTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeDeletionTimeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "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.", - Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolVariables"), - }, - }, - }, - Required: []string{"class", "name"}, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_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/v1beta1.ClusterVariable"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.ClusterVariable"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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.", - Default: "", - 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_v1beta1_MachineRollingUpdateDeployment(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MachineRollingUpdateDeployment 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"), - }, - }, - "deletePolicy": { - SchemaProps: spec.SchemaProps{ - Description: "deletePolicy defines the policy used by the MachineDeployment to identify nodes to delete when downscaling. Valid values are \"Random, \"Newest\", \"Oldest\" When no value is supplied, the default DeletePolicy of MachineSet is used", - Type: []string{"string"}, - Format: "", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/util/intstr.IntOrString"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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/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/core/v1beta1.MachineSetStatus"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_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/v1beta1.MachineSet"), - }, - }, - }, - }, - }, - }, - Required: []string{"items"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.ListMeta", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSet"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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.", - Default: "", - 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", - }, - }, - "minReadySeconds": { - SchemaProps: spec.SchemaProps{ - Description: "minReadySeconds is the minimum number of seconds for which a Node for a newly created machine should be ready before considering the replica available. Defaults to 0 (machine will be considered available as soon as the Node is ready)", - Type: []string{"integer"}, - Format: "int32", - }, - }, - "deletePolicy": { - SchemaProps: spec.SchemaProps{ - Description: "deletePolicy defines the policy used to identify nodes to delete when downscaling. Defaults to \"Random\". Valid values are \"Random, \"Newest\", \"Oldest\"", - Type: []string{"string"}, - Format: "", - }, - }, - "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/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/core/v1beta1.MachineNamingStrategy"), - }, - }, - }, - Required: []string{"clusterName", "selector"}, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_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{ - "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.", - Default: 0, - Type: []string{"integer"}, - Format: "int32", - }, - }, - "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\".", - 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.", - Default: 0, - 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", - }, - }, - "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: "", - }, - }, - "conditions": { - SchemaProps: spec.SchemaProps{ - Description: "conditions defines current service state of the MachineSet.", - 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 MachineSet's status with the V1Beta2 version.", - Ref: ref("sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSetV1Beta2Status"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.Condition", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSetV1Beta2Status"}, - } -} - -func schema_cluster_api_api_core_v1beta1_MachineSetV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MachineSetV1Beta2Status groups all the fields that will be added or modified in MachineSetStatus 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 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"), - }, - }, - }, - }, - }, - "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", - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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.", - Default: "", - 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/v1beta1.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("k8s.io/api/core/v1.ObjectReference"), - }, - }, - "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 a key in the FailureDomains map stored on the cluster object.", - Type: []string{"string"}, - Format: "", - }, - }, - "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: This field is considered only for computing v1beta2 conditions. 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).", - 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.MachineReadinessGate"), - }, - }, - }, - }, - }, - "nodeDrainTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeDrainTimeout is the total amount of time that the controller will spend on draining a node. The default value is 0, meaning that the node can be drained without any time limitations. NOTE: NodeDrainTimeout is different from `kubectl drain --timeout`", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "nodeVolumeDetachTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeVolumeDetachTimeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - "nodeDeletionTimeout": { - SchemaProps: spec.SchemaProps{ - Description: "nodeDeletionTimeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - }, - Required: []string{"clusterName", "bootstrap", "infrastructureRef"}, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_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{ - "nodeRef": { - SchemaProps: spec.SchemaProps{ - Description: "nodeRef will point to the corresponding Node if it exists.", - Ref: ref("k8s.io/api/core/v1.ObjectReference"), - }, - }, - "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"), - }, - }, - "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: "", - }, - }, - "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/v1beta1.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"), - }, - }, - "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 defines current service state of the Machine.", - 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"), - }, - }, - }, - }, - }, - "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/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/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/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_cluster_api_api_core_v1beta1_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/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/core/v1beta1.MachineSpec"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineSpec", "sigs.k8s.io/cluster-api/api/core/v1beta1.ObjectMeta"}, - } -} - -func schema_cluster_api_api_core_v1beta1_MachineV1Beta2Status(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "MachineV1Beta2Status groups all the fields that will be added or modified in MachineStatus 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 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"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Condition"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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": { - 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_v1beta1_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_v1beta1_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/v1beta1.PatchSelector"), - }, - }, - "jsonPatches": { - 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/v1beta1.JSONPatch"), - }, - }, - }, - }, - }, - }, - Required: []string{"selector", "jsonPatches"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.JSONPatch", "sigs.k8s.io/cluster-api/api/core/v1beta1.PatchSelector"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "kind": { - SchemaProps: spec.SchemaProps{ - Description: "kind filters templates by kind.", - Default: "", - 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/v1beta1.PatchSelectorMatch"), - }, - }, - }, - Required: []string{"apiVersion", "kind", "matchResources"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.PatchSelectorMatch"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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/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/core/v1beta1.PatchSelectorMatchMachinePoolClass"), - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.PatchSelectorMatchMachineDeploymentClass", "sigs.k8s.io/cluster-api/api/core/v1beta1.PatchSelectorMatchMachinePoolClass"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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": { - 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_v1beta1_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": { - 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_v1beta1_RemediationStrategy(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "RemediationStrategy allows to define how the MachineSet can control scaling operations.", - 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_v1beta1_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{ - "class": { - SchemaProps: spec.SchemaProps{ - Description: "class is the name of the ClusterClass object to create the topology.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "classNamespace": { - SchemaProps: spec.SchemaProps{ - Description: "classNamespace is the namespace of the ClusterClass that should be used for the topology. If classNamespace is empty or not set, it is defaulted to the namespace of the Cluster object. classNamespace 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: "", - }, - }, - "version": { - SchemaProps: spec.SchemaProps{ - Description: "version is the Kubernetes version of the cluster.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "rolloutAfter": { - SchemaProps: spec.SchemaProps{ - Description: "rolloutAfter performs a rollout of the entire cluster one component at a time, control plane first and then machine deployments.\n\nDeprecated: This field has no function and is going to be removed in the next apiVersion.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Time"), - }, - }, - "controlPlane": { - SchemaProps: spec.SchemaProps{ - Description: "controlPlane describes the cluster control plane.", - Default: map[string]interface{}{}, - 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/core/v1beta1.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/v1beta1.ClusterVariable"), - }, - }, - }, - }, - }, - }, - Required: []string{"class", "version"}, - }, - }, - Dependencies: []string{ - "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_cluster_api_api_core_v1beta1_UnhealthyCondition(ref common.ReferenceCallback) common.OpenAPIDefinition { - return common.OpenAPIDefinition{ - Schema: spec.Schema{ - SchemaProps: spec.SchemaProps{ - Description: "UnhealthyCondition represents a Node condition type and value with a timeout specified as a duration. When the named condition has been in the given status for at least the timeout value, a node is considered unhealthy.", - Type: []string{"object"}, - Properties: map[string]spec.Schema{ - "type": { - SchemaProps: spec.SchemaProps{ - Description: "type of Node condition", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "status": { - SchemaProps: spec.SchemaProps{ - Description: "status of the condition, one of True, False, Unknown.", - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - "timeout": { - SchemaProps: spec.SchemaProps{ - Description: "timeout 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.", - Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), - }, - }, - }, - Required: []string{"type", "status", "timeout"}, - }, - }, - Dependencies: []string{ - "k8s.io/apimachinery/pkg/apis/meta/v1.Duration"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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.", - Default: "", - 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_v1beta1_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/v1beta1.JSONSchemaProps"), - }, - }, - }, - Required: []string{"openAPIV3Schema"}, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.JSONSchemaProps"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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_v1beta1_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/v1beta1.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/v1beta1.MachinePoolClass"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "sigs.k8s.io/cluster-api/api/core/v1beta1.MachineDeploymentClass", "sigs.k8s.io/cluster-api/api/core/v1beta1.MachinePoolClass"}, - } -} - -func schema_cluster_api_api_core_v1beta1_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_v1beta1_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/v1beta1.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/v1beta1.MachinePoolTopology"), - }, - }, - }, - }, - }, - }, - }, - }, - Dependencies: []string{ - "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/ipam/v1beta1/.import-restrictions b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/.import-restrictions deleted file mode 100644 index f6f10b3ff5..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/.import-restrictions +++ /dev/null @@ -1,5 +0,0 @@ -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/ipam/v1beta1/condition_consts.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/condition_consts.go deleted file mode 100644 index db0c507aea..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/condition_consts.go +++ /dev/null @@ -1,32 +0,0 @@ -/* -Copyright 2024 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 - -// These reasons are intended to be used with failed Ready conditions on an [IPAddressClaim]. -const ( - // AllocationFailedReason 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. - AllocationFailedReason = "AllocationFailed" - - // PoolNotReadyReason is the reason used when the referenced IP pool is not ready. - PoolNotReadyReason = "PoolNotReady" - - // PoolExhaustedReason is the reason used when an IP pool referenced by an [IPAddressClaim] is full and no address - // can be allocated for the claim. - PoolExhaustedReason = "PoolExhausted" -) 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 deleted file mode 100644 index 3ea24dff09..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/conversion.go +++ /dev/null @@ -1,169 +0,0 @@ -/* -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 deleted file mode 100644 index acfb16f1e9..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/doc.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -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/api/ipam/v1beta1/groupversion_info.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/groupversion_info.go deleted file mode 100644 index 6c4c4451dd..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/groupversion_info.go +++ /dev/null @@ -1,45 +0,0 @@ -/* -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 - -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: "ipam.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{} -) - -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/ipam/v1beta1/ipaddress_types.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/ipaddress_types.go deleted file mode 100644 index 7cf6a49c86..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/ipaddress_types.go +++ /dev/null @@ -1,87 +0,0 @@ -/* -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 - -import ( - corev1 "k8s.io/api/core/v1" - 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 corev1.LocalObjectReference `json:"claimRef"` - - // poolRef is a reference to the pool that this IPAddress was created from. - // +required - PoolRef corev1.TypedLocalObjectReference `json:"poolRef"` - - // address is the IP address. - // +required - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=39 - Address string `json:"address"` - - // prefix is the prefix of the address. - // +required - Prefix int `json:"prefix"` - - // 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"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=ipaddresses,scope=Namespaced,categories=cluster-api -// +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" -// +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. - // +optional - Spec IPAddressSpec `json:"spec,omitempty"` -} - -// +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/v1beta1/ipaddressclaim_types.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/ipaddressclaim_types.go deleted file mode 100644 index 8a6a44a2e6..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/ipaddressclaim_types.go +++ /dev/null @@ -1,130 +0,0 @@ -/* -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 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" -) - -// 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 corev1.TypedLocalObjectReference `json:"poolRef"` -} - -// IPAddressClaimStatus is the observed status of a IPAddressClaim. -type IPAddressClaimStatus struct { - // addressRef is a reference to the address that was created for this claim. - // +optional - AddressRef corev1.LocalObjectReference `json:"addressRef,omitempty"` - - // conditions summarises the current state of the IPAddressClaim - // +optional - 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 - V1Beta2 *IPAddressClaimV1Beta2Status `json:"v1beta2,omitempty"` -} - -// IPAddressClaimV1Beta2Status groups all the fields that will be added or modified in IPAddressClaimStatus 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 IPAddressClaimV1Beta2Status struct { - // conditions represents the observations of a IPAddressClaim's current state. - // +optional - // +listType=map - // +listMapKey=type - // +kubebuilder:validation:MaxItems=32 - Conditions []metav1.Condition `json:"conditions,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=ipaddressclaims,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +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" - -// 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. - // +optional - Spec IPAddressClaimSpec `json:"spec,omitempty"` - // status is the observed state of IPAddressClaim. - // +optional - Status IPAddressClaimStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (m *IPAddressClaim) GetConditions() clusterv1beta1.Conditions { - return m.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (m *IPAddressClaim) SetConditions(conditions clusterv1beta1.Conditions) { - m.Status.Conditions = conditions -} - -// GetV1Beta2Conditions returns the set of conditions for this object. -func (m *IPAddressClaim) GetV1Beta2Conditions() []metav1.Condition { - if m.Status.V1Beta2 == nil { - return nil - } - return m.Status.V1Beta2.Conditions -} - -// SetV1Beta2Conditions sets conditions for an API object. -func (m *IPAddressClaim) SetV1Beta2Conditions(conditions []metav1.Condition) { - if m.Status.V1Beta2 == nil { - m.Status.V1Beta2 = &IPAddressClaimV1Beta2Status{} - } - m.Status.V1Beta2.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/v1beta1/zz_generated.conversion.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/zz_generated.conversion.go deleted file mode 100644 index c777ace2be..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/zz_generated.conversion.go +++ /dev/null @@ -1,383 +0,0 @@ -//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/api/ipam/v1beta1/zz_generated.deepcopy.go b/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/zz_generated.deepcopy.go deleted file mode 100644 index a4f0ecf51a..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/api/ipam/v1beta1/zz_generated.deepcopy.go +++ /dev/null @@ -1,227 +0,0 @@ -//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 v1beta1 - -import ( - "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - 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. -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) - in.Spec.DeepCopyInto(&out.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 *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 *IPAddressClaimSpec) DeepCopyInto(out *IPAddressClaimSpec) { - *out = *in - in.PoolRef.DeepCopyInto(&out.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 - out.AddressRef = in.AddressRef - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(corev1beta1.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.V1Beta2 != nil { - in, out := &in.V1Beta2, &out.V1Beta2 - *out = new(IPAddressClaimV1Beta2Status) - (*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 *IPAddressClaimV1Beta2Status) DeepCopyInto(out *IPAddressClaimV1Beta2Status) { - *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]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IPAddressClaimV1Beta2Status. -func (in *IPAddressClaimV1Beta2Status) DeepCopy() *IPAddressClaimV1Beta2Status { - if in == nil { - return nil - } - out := new(IPAddressClaimV1Beta2Status) - 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 *IPAddressSpec) DeepCopyInto(out *IPAddressSpec) { - *out = *in - out.ClaimRef = in.ClaimRef - in.PoolRef.DeepCopyInto(&out.PoolRef) -} - -// 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 -} diff --git a/vendor/sigs.k8s.io/cluster-api/util/conversion/conversion.go b/vendor/sigs.k8s.io/cluster-api/util/conversion/conversion.go deleted file mode 100644 index 916d77c1f5..0000000000 --- a/vendor/sigs.k8s.io/cluster-api/util/conversion/conversion.go +++ /dev/null @@ -1,218 +0,0 @@ -/* -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) - } - } - }) - } -}