diff --git a/charts/gardener/gardenlet/templates/clusterrole-gardenlet.yaml b/charts/gardener/gardenlet/templates/clusterrole-gardenlet.yaml index 65dd0103dd9..26fc41915de 100644 --- a/charts/gardener/gardenlet/templates/clusterrole-gardenlet.yaml +++ b/charts/gardener/gardenlet/templates/clusterrole-gardenlet.yaml @@ -177,6 +177,13 @@ rules: - filters.fluentbit.fluent.io - outputs.fluentbit.fluent.io - parsers.fluentbit.fluent.io + # TODO(rfranzke): Remove this code after Gardener v1.83 has been released. + - alicloudmachineclasses.machine.sapcloud.io + - awsmachineclasses.machine.sapcloud.io + - azuremachineclasses.machine.sapcloud.io + - gcpmachineclasses.machine.sapcloud.io + - openstackmachineclasses.machine.sapcloud.io + - packetmachineclasses.machine.sapcloud.io verbs: - delete - apiGroups: @@ -437,10 +444,10 @@ rules: - apiGroups: - machine.sapcloud.io resources: + - machineclasses - machinedeployments - machinesets - machines - - machineclasses verbs: - list - watch diff --git a/cmd/gardener-extension-provider-local/app/app.go b/cmd/gardener-extension-provider-local/app/app.go index fbad13bd0bf..0907e9d665b 100644 --- a/cmd/gardener-extension-provider-local/app/app.go +++ b/cmd/gardener-extension-provider-local/app/app.go @@ -254,6 +254,7 @@ func NewControllerManagerCommand(ctx context.Context) *cobra.Command { ingressCtrlOpts.Completed().Apply(&localingress.DefaultAddOptions) serviceCtrlOpts.Completed().Apply(&localservice.DefaultAddOptions) workerCtrlOpts.Completed().Apply(&localworker.DefaultAddOptions.Controller) + localworker.DefaultAddOptions.GardenCluster = gardenCluster localBackupBucketOptions.Completed().Apply(&localbackupbucket.DefaultAddOptions) localBackupBucketOptions.Completed().Apply(&localbackupentry.DefaultAddOptions) heartbeatCtrlOptions.Completed().Apply(&heartbeat.DefaultAddOptions) diff --git a/docs/deployment/version_skew_policy.md b/docs/deployment/version_skew_policy.md index 1e8ab56fe4f..962c3507d0d 100644 --- a/docs/deployment/version_skew_policy.md +++ b/docs/deployment/version_skew_policy.md @@ -28,7 +28,7 @@ In multi-instance setups of Gardener, the newest and oldest `gardener-apiserver` Example: - newest `gardener-apiserver` is at **1.37** -- other `gardener-apiserver` instances are supported at **1.37** and **v1.36** +- other `gardener-apiserver` instances are supported at **1.37** and **1.36** #### gardener-controller-manager, gardener-scheduler, gardener-admission-controller, gardenlet @@ -37,8 +37,8 @@ They are expected to match the `gardener-apiserver` minor version, but may be up Example: -- `gardener-apiserver` is at **v1.37** -- `gardener-controller-manager`, `gardener-scheduler`, `gardener-admission-controller`, and `gardenlet` are supported at **1.37** and **v1.36** +- `gardener-apiserver` is at **1.37** +- `gardener-controller-manager`, `gardener-scheduler`, `gardener-admission-controller`, and `gardenlet` are supported at **1.37** and **1.36** #### gardener-operator @@ -87,6 +87,26 @@ Actions: - Upgrade `gardener-operator` to **1.38**. +## Supported Gardener Extension Versions + +Extensions are maintained and released separately and independently of the `gardener/gardener` repository. +Consequently, providing version constraints is not possible in this document. +Sometimes, the documentation of extensions contains compatibility information (e.g., "this extension version is only compatible with Gardener versions higher than **1.80**", see [this example](https://github.com/gardener/gardener-extension-provider-aws#compatibility)). + +However, since all extensions typically make use of the [extensions library](../../extensions) ([example](https://github.com/gardener/gardener-extension-provider-aws/blob/cb96b60c970c2e20615dffb3018dc0571cab764d/go.mod#L12)), a general constraint is that _no extension must depend on a version of the extensions library higher than the version of `gardenlet`_. + +Example 1: + +- `gardener-apiserver` and other Gardener control plane components are at **1.37**. +- All `gardenlet`s are at **1.37**. +- Only extensions are supported which depend on **1.37** or lower of the extensions library. + +Example 2: + +- `gardener-apiserver` and other Gardener control plane components are at **1.37**. +- Some `gardenlet`s are at **1.37**, others are at **1.36**. +- Only extensions are supported which depend on **1.36** or lower of the extensions library. + ## Supported Kubernetes Versions Please refer to [Supported Kubernetes Versions](../usage/supported_k8s_versions.md). diff --git a/docs/extensions/migration.md b/docs/extensions/migration.md index c5d0dd3f79c..eacdc285c6b 100644 --- a/docs/extensions/migration.md +++ b/docs/extensions/migration.md @@ -73,18 +73,32 @@ In addition, extension controllers that use [referenced resources](referenced-re ### Migrate and Restore Actuator Methods -Most extension controller implementations follow a common pattern where a generic `Reconciler` implementation delegates to an `Actuator` interface that contains the methods `Reconcile` and `Delete`, provided by the extension. The two new methods `Migrate` and `Restore` have been added to all such `Actuator` interfaces, see [the infrastructure `Actuator` interface](https://github.com/gardener/gardener/blob/master/extensions/pkg/controller/infrastructure/actuator.go) as an example. These methods are called by the generic reconcilers for the [migrate and restore operations](#migrate-and-restore-operations) respectively, and should be implemented by the extension according to the above guidelines. +Most extension controller implementations follow a common pattern where a generic `Reconciler` implementation delegates to an `Actuator` interface that contains the methods `Reconcile` and `Delete`, provided by the extension. +Two methods `Migrate` and `Restore` are available in all such `Actuator` interfaces, see [the infrastructure `Actuator` interface](https://github.com/gardener/gardener/blob/master/extensions/pkg/controller/infrastructure/actuator.go) as an example. +These methods are called by the generic reconcilers for the [migrate and restore operations](#migrate-and-restore-operations) respectively, and should be implemented by the extension according to the above guidelines. -### Owner Checks +### Extension Controllers Based on Generic Actuators -The so called "bad case" scenario for control plane migration proposed in [GEP-17](../proposals/17-shoot-control-plane-migration-bad-case.md) introduced the requirement for extension controllers to check whether they are currently operating in the source or destination seed during reconciliations to avoid the case in which controllers from different seeds can operate on the same IaaS resources (split brain scenario). To that end, a special "owner checking" mechanism has been added to the `Reconciler` implementations of all extension controllers. For an example usage of this mechanism see [the infrastructure Reconciler implementation](https://github.com/gardener/gardener/blob/7ac4b04feec409f3e5a5208cd06af9a10c755337/extensions/pkg/controller/infrastructure/reconciler.go#L109-L121). The purpose of the owner check is to interrupt reconciliations of extension controllers that do not operate in the seed that is currently configured to host the shoot's control plane. Note that `Migrate` operations must not be interrupted, as they are required to clean up Kubernetes resources left in the shoot's control plane namespace and do not act on IaaS resources. +In practice, the implementation of many extension controllers (for example, the `ControlPlane` and `Worker` controllers in most provider extensions) are based on a *generic `Actuator` implementation* that only delegates to extension methods for behavior that is truly provider specific. +In all such cases, the `Migrate` and `Restore` methods have already been implemented properly in the generic actuators and there is nothing more to do in the extension itself. -### Extension Controllers Based on Generic Actuators +In some rare cases, extension controllers based on a generic actuator might still introduce a custom `Actuator` implementation to override some of the generic actuator methods in order to enhance or change their behavior in a certain way. +In such cases, the `Migrate` and `Restore` methods might need to be overridden as well, see the [Azure controlplane controller](https://github.com/gardener/gardener-extension-provider-azure/tree/master/pkg/controller/controlplane) as an example. -In practice, the implementation of many extension controllers (for example, the controlplane and worker controllers in most provider extensions) are based on a *generic `Actuator` implementation* that only delegates to extension methods for behavior that is truly provider specific. In all such cases, the `Migrate` and `Restore` methods have already been implemented properly in the generic actuators and there is nothing more to do in the extension itself. +#### `Worker` State -In some rare cases, extension controllers based on a generic actuator might still introduce a custom `Actuator` implementation to override some of the generic actuator methods in order to enhance or change their behavior in a certain way. In such cases, the `Migrate` and `Restore` methods might need to be overridden as well, see the [Azure controlplane controller](https://github.com/gardener/gardener-extension-provider-azure/tree/master/pkg/controller/controlplane) as an example. +Note that the machine state is handled specially by `gardenlet` (i.e., all relevant objects in the `machine.sapcloud.io/v1alpha1` API are directly persisted by `gardenlet` and **NOT** by the generic actuators). +In the past, they were persisted to the `Worker`'s `.status.state` field by the so-called "worker state reconciler", however, this reconciler was dropped and changed as part of [GEP-22](../proposals/22-improved-usage-of-shootstate-api.md#eliminating-the-worker-state-reconciler). +Nowadays, `gardenlet` directly writes the state to the `ShootState` resource during the `Migrate` phase of a `Shoot` (without the detour of the `Worker`'s `.status.state` field). +On restoration, unlike for other extension kinds, `gardenlet` no longer populates the machine state into the `Worker`'s `.status.state` field. +Instead, the extension controller should read the machine state directly from the `ShootState` in the garden cluster (see [this document](garden-api-access.md) for information how to access the garden cluster) and use it to subsequently restore the relevant `machine.sapcloud.io/v1alpha1` resources. +This flow is implemented in the [generic `Worker` actuator](../../extensions/pkg/controller/worker/genericactuator/actuator_restore.go). +As a result, Extension controllers using this generic actuator do not need to implement any custom logic. ### Extension Controllers Not Based on Generic Actuators -The implementation of some extension controllers (for example, the infrastructure controllers in all provider extensions) are not based on a generic `Actuator` implementation. Such extension controllers must always provide a proper implementation of the `Migrate` and `Restore` methods according to the above guidelines, see the [AWS infrastructure controller](https://github.com/gardener/gardener-extension-provider-aws/tree/master/pkg/controller/infrastructure) as an example. In practice, this might result in code duplication between the different extensions, since the `Migrate` and `Restore` code is usually not provider or OS-specific. +The implementation of some extension controllers (for example, the infrastructure controllers in all provider extensions) are not based on a generic `Actuator` implementation. +Such extension controllers must always provide a proper implementation of the `Migrate` and `Restore` methods according to the above guidelines, see the [AWS infrastructure controller](https://github.com/gardener/gardener-extension-provider-aws/tree/master/pkg/controller/infrastructure) as an example. +In practice, this might result in code duplication between the different extensions, since the `Migrate` and `Restore` code is usually not provider or OS-specific. + +> If you do not use the generic `Worker` actuator, see [this section](#worker-state) for information how to handle the machine state related to the `Worker` resource. diff --git a/example/seed-crds/10-crd-machine.sapcloud.io_machineclasses.yaml b/example/seed-crds/10-crd-machine.sapcloud.io_machineclasses.yaml new file mode 100644 index 00000000000..9312f19226c --- /dev/null +++ b/example/seed-crds/10-crd-machine.sapcloud.io_machineclasses.yaml @@ -0,0 +1,109 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 + name: machineclasses.machine.sapcloud.io +spec: + group: machine.sapcloud.io + names: + kind: MachineClass + listKind: MachineClassList + plural: machineclasses + shortNames: + - mcc + singular: machineclass + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: MachineClass can be used to templatize and re-use provider configuration + across multiple Machines / MachineSets / MachineDeployments. + 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 + credentialsSecretRef: + description: CredentialsSecretRef can optionally store the credentials + (in this case the SecretRef does not need to store them). This might + be useful if multiple machine classes with the same credentials but + different user-datas are used. + properties: + name: + description: name is unique within a namespace to reference a secret + resource. + type: string + namespace: + description: namespace defines the space within which the secret name + must be unique. + type: string + type: object + x-kubernetes-map-type: atomic + 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 + nodeTemplate: + description: NodeTemplate contains subfields to track all node resources + and other node info required to scale nodegroup from zero + properties: + capacity: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: Capacity contains subfields to track all node resources + required to scale nodegroup from zero + type: object + instanceType: + description: Instance type of the node belonging to nodeGroup + type: string + region: + description: Region of the expected node belonging to nodeGroup + type: string + zone: + description: Zone of the expected node belonging to nodeGroup + type: string + required: + - capacity + - instanceType + - region + - zone + type: object + x-kubernetes-preserve-unknown-fields: true + provider: + description: Provider is the combination of name and location of cloud-specific + drivers. + type: string + providerSpec: + description: Provider-specific configuration to use during node creation. + type: object + x-kubernetes-preserve-unknown-fields: true + secretRef: + description: SecretRef stores the necessary secrets such as credentials + or userdata. + properties: + name: + description: name is unique within a namespace to reference a secret + resource. + type: string + namespace: + description: namespace defines the space within which the secret name + must be unique. + type: string + type: object + x-kubernetes-map-type: atomic + required: + - providerSpec + type: object + served: true + storage: true diff --git a/example/seed-crds/10-crd-machine.sapcloud.io_machinedeployments.yaml b/example/seed-crds/10-crd-machine.sapcloud.io_machinedeployments.yaml new file mode 100644 index 00000000000..30009a5be84 --- /dev/null +++ b/example/seed-crds/10-crd-machine.sapcloud.io_machinedeployments.yaml @@ -0,0 +1,493 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 + name: machinedeployments.machine.sapcloud.io +spec: + group: machine.sapcloud.io + names: + kind: MachineDeployment + listKind: MachineDeploymentList + plural: machinedeployments + shortNames: + - mcd + singular: machinedeployment + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: Total number of ready machines targeted by this machine deployment. + jsonPath: .status.readyReplicas + name: Ready + type: integer + - description: Number of desired machines. + jsonPath: .spec.replicas + name: Desired + type: integer + - description: Total number of non-terminated machines targeted by this machine + deployment that have the desired template spec. + jsonPath: .status.updatedReplicas + name: Up-to-date + type: integer + - description: Total number of available machines (ready for at least minReadySeconds) + targeted by this machine deployment. + jsonPath: .status.availableReplicas + name: Available + type: integer + - description: |- + CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: MachineDeployment enables declarative updates for machines and + MachineSets. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Specification of the desired behavior of the MachineDeployment. + properties: + minReadySeconds: + description: Minimum number of seconds for which a newly created machine + should be ready without any of its container crashing, for it to + be considered available. Defaults to 0 (machine will be considered + available as soon as it is ready) + format: int32 + type: integer + paused: + description: Indicates that the MachineDeployment is paused and will + not be processed by the MachineDeployment controller. + type: boolean + progressDeadlineSeconds: + description: The maximum time in seconds for a MachineDeployment to + make progress before it is considered to be failed. The MachineDeployment + controller will continue to process failed MachineDeployments and + a condition with a ProgressDeadlineExceeded reason will be surfaced + in the MachineDeployment status. Note that progress will not be + estimated during the time a MachineDeployment is paused. This is + not set by default, which is treated as infinite deadline. + format: int32 + type: integer + replicas: + description: Number of desired machines. This is a pointer to distinguish + between explicit zero and not specified. Defaults to 0. + format: int32 + type: integer + revisionHistoryLimit: + description: The number of old MachineSets to retain to allow rollback. + This is a pointer to distinguish between explicit zero and not specified. + format: int32 + type: integer + rollbackTo: + description: DEPRECATED. The config this MachineDeployment is rolling + back to. Will be cleared after rollback is done. + properties: + revision: + description: The revision to rollback to. If set to 0, rollback + to the last revision. + format: int64 + type: integer + type: object + selector: + description: Label selector for machines. Existing MachineSets whose + machines are selected by this will be the ones affected by this + MachineDeployment. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. + properties: + key: + description: key is the label key that the selector applies + to. + type: string + operator: + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + strategy: + description: The MachineDeployment strategy to use to replace existing + machines with new ones. + properties: + rollingUpdate: + description: 'Rolling update config params. Present only if MachineDeploymentStrategyType + = RollingUpdate. --- TODO: Update this to follow our convention + for oneOf, whatever we decide it to be.' + properties: + maxSurge: + anyOf: + - type: integer + - type: string + description: 'The maximum number of machines that can be scheduled + above the desired number of machines. Value can be an absolute + number (ex: 5) or a percentage of desired machines (ex: + 10%). This can not be 0 if MaxUnavailable is 0. Absolute + number is calculated from percentage by rounding up. By + default, a value of 1 is used. Example: when this is set + to 30%, the new MC 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 MC can be scaled + up further, ensuring that total number of machines running + at any time during the update is atmost 130% of desired + machines.' + x-kubernetes-int-or-string: true + maxUnavailable: + anyOf: + - type: integer + - type: string + description: 'The maximum number of machines that can be unavailable + during the update. Value can be an absolute number (ex: + 5) or a percentage of desired machines (ex: 10%). Absolute + number is calculated from percentage by rounding down. This + can not be 0 if MaxSurge is 0. By default, a fixed value + of 1 is used. Example: when this is set to 30%, the old + MC can be scaled down to 70% of desired machines immediately + when the rolling update starts. Once new machines are ready, + old MC can be scaled down further, followed by scaling up + the new MC, ensuring that the total number of machines available + at all times during the update is at least 70% of desired + machines.' + x-kubernetes-int-or-string: true + type: object + type: + description: Type of MachineDeployment. Can be "Recreate" or "RollingUpdate". + Default is RollingUpdate. + type: string + type: object + template: + description: Template describes the machines that will be created. + properties: + metadata: + description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' + type: object + x-kubernetes-preserve-unknown-fields: true + spec: + description: 'Specification of the desired behavior of the machine. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status' + properties: + class: + description: Class contains the machineclass attributes of + a machine + properties: + apiGroup: + description: API group to which it belongs + type: string + kind: + description: Kind for machine class + type: string + name: + description: Name of machine class + type: string + type: object + creationTimeout: + description: MachineCreationTimeout is the timeout after which + machinie creation is declared failed. + type: string + drainTimeout: + description: MachineDraintimeout is the timeout after which + machine is forcefully deleted. + type: string + healthTimeout: + description: MachineHealthTimeout is the timeout after which + machine is declared unhealhty/failed. + type: string + maxEvictRetries: + description: MaxEvictRetries is the number of retries that + will be attempted while draining the node. + format: int32 + type: integer + nodeConditions: + description: NodeConditions are the set of conditions if set + to true for MachineHealthTimeOut, machine will be declared + failed. + type: string + nodeTemplate: + description: NodeTemplateSpec describes the data a node should + have when created from a template + properties: + metadata: + type: object + x-kubernetes-preserve-unknown-fields: true + spec: + description: NodeSpec describes the attributes that a + node is created with. + properties: + configSource: + description: 'Deprecated: Previously used to specify + the source of the node''s configuration for the + DynamicKubeletConfig feature. This feature is removed.' + properties: + configMap: + description: ConfigMap is a reference to a Node's + ConfigMap + properties: + kubeletConfigKey: + description: KubeletConfigKey declares which + key of the referenced ConfigMap corresponds + to the KubeletConfiguration structure This + field is required in all cases. + type: string + name: + description: Name is the metadata.name of + the referenced ConfigMap. This field is + required in all cases. + type: string + namespace: + description: Namespace is the metadata.namespace + of the referenced ConfigMap. This field + is required in all cases. + type: string + resourceVersion: + description: ResourceVersion is the metadata.ResourceVersion + of the referenced ConfigMap. This field + is forbidden in Node.Spec, and required + in Node.Status. + type: string + uid: + description: UID is the metadata.UID of the + referenced ConfigMap. This field is forbidden + in Node.Spec, and required in Node.Status. + type: string + required: + - kubeletConfigKey + - name + - namespace + type: object + type: object + externalID: + description: 'Deprecated. Not all kubelets will set + this field. Remove field after 1.13. see: https://issues.k8s.io/61966' + type: string + podCIDR: + description: PodCIDR represents the pod IP range assigned + to the node. + type: string + podCIDRs: + description: podCIDRs represents the IP ranges assigned + to the node for usage by Pods on that node. If this + field is specified, the 0th entry must match the + podCIDR field. It may contain at most 1 value for + each of IPv4 and IPv6. + items: + type: string + type: array + providerID: + description: 'ID of the node assigned by the cloud + provider in the format: ://' + type: string + taints: + description: If specified, the node's taints. + items: + description: The node this Taint is attached to + has the "effect" on any pod that does not tolerate + the Taint. + properties: + effect: + description: Required. The effect of the taint + on pods that do not tolerate the taint. Valid + effects are NoSchedule, PreferNoSchedule and + NoExecute. + type: string + key: + description: Required. The taint key to be applied + to a node. + type: string + timeAdded: + description: TimeAdded represents the time at + which the taint was added. It is only written + for NoExecute taints. + format: date-time + type: string + value: + description: The taint value corresponding to + the taint key. + type: string + required: + - effect + - key + type: object + type: array + unschedulable: + description: 'Unschedulable controls node schedulability + of new pods. By default, node is schedulable. More + info: https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration' + type: boolean + type: object + type: object + providerID: + description: ProviderID represents the provider's unique ID + given to a machine + type: string + type: object + type: object + required: + - template + type: object + status: + description: Most recently observed status of the MachineDeployment. + properties: + availableReplicas: + description: Total number of available machines (ready for at least + minReadySeconds) targeted by this MachineDeployment. + format: int32 + type: integer + collisionCount: + description: Count of hash collisions for the MachineDeployment. The + MachineDeployment controller uses this field as a collision avoidance + mechanism when it needs to create the name for the newest MachineSet. + format: int32 + type: integer + conditions: + description: Represents the latest available observations of a MachineDeployment's + current state. + items: + description: MachineDeploymentCondition describes the state of a + MachineDeployment at a certain point. + properties: + lastTransitionTime: + description: Last time the condition transitioned from one status + to another. + format: date-time + type: string + lastUpdateTime: + description: The last time this condition was updated. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. + type: string + reason: + description: The reason for the condition's last transition. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of MachineDeployment condition. + type: string + required: + - status + - type + type: object + type: array + failedMachines: + description: FailedMachines has summary of machines on which lastOperation + Failed + items: + description: MachineSummary store the summary of machine. + properties: + lastOperation: + description: Last operation refers to the status of the last + operation performed + properties: + description: + description: Description of the current operation + type: string + errorCode: + description: ErrorCode of the current operation if any + type: string + lastUpdateTime: + description: Last update time of current operation + format: date-time + type: string + state: + description: State of operation + type: string + type: + description: Type of operation + type: string + type: object + name: + description: Name of the machine object + type: string + ownerRef: + description: OwnerRef + type: string + providerID: + description: ProviderID represents the provider's unique ID + given to a machine + type: string + type: object + type: array + observedGeneration: + description: The generation observed by the MachineDeployment controller. + format: int64 + type: integer + readyReplicas: + description: Total number of ready machines targeted by this MachineDeployment. + format: int32 + type: integer + replicas: + description: Total number of non-terminated machines targeted by this + MachineDeployment (their labels match the selector). + format: int32 + type: integer + unavailableReplicas: + description: Total number of unavailable machines targeted by this + MachineDeployment. This is the total number of machines that are + still required for the MachineDeployment to have 100% available + capacity. They may either be machines that are running but not yet + available or machines that still have not been created. + format: int32 + type: integer + updatedReplicas: + description: Total number of non-terminated machines targeted by this + MachineDeployment that have the desired template spec. + format: int32 + type: integer + type: object + type: object + served: true + storage: true + subresources: + scale: + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas + status: {} diff --git a/example/seed-crds/10-crd-machine.sapcloud.io_machines.yaml b/example/seed-crds/10-crd-machine.sapcloud.io_machines.yaml new file mode 100644 index 00000000000..a398f754507 --- /dev/null +++ b/example/seed-crds/10-crd-machine.sapcloud.io_machines.yaml @@ -0,0 +1,284 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 + name: machines.machine.sapcloud.io +spec: + group: machine.sapcloud.io + names: + kind: Machine + listKind: MachineList + plural: machines + shortNames: + - mc + singular: machine + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: Current status of the machine. + jsonPath: .status.currentStatus.phase + name: Status + type: string + - description: |- + CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + jsonPath: .metadata.creationTimestamp + name: Age + type: date + - description: Node backing the machine object + jsonPath: .metadata.labels.node + name: Node + type: string + - description: ProviderID of the infra instance backing the machine object + jsonPath: .spec.providerID + name: ProviderID + priority: 1 + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: Machine is the representation of a physical or virtual machine. + 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 contains the specification of the machine + properties: + class: + description: Class contains the machineclass attributes of a machine + properties: + apiGroup: + description: API group to which it belongs + type: string + kind: + description: Kind for machine class + type: string + name: + description: Name of machine class + type: string + type: object + creationTimeout: + description: MachineCreationTimeout is the timeout after which machinie + creation is declared failed. + type: string + drainTimeout: + description: MachineDraintimeout is the timeout after which machine + is forcefully deleted. + type: string + healthTimeout: + description: MachineHealthTimeout is the timeout after which machine + is declared unhealhty/failed. + type: string + maxEvictRetries: + description: MaxEvictRetries is the number of retries that will be + attempted while draining the node. + format: int32 + type: integer + nodeConditions: + description: NodeConditions are the set of conditions if set to true + for MachineHealthTimeOut, machine will be declared failed. + type: string + nodeTemplate: + description: NodeTemplateSpec describes the data a node should have + when created from a template + properties: + metadata: + type: object + x-kubernetes-preserve-unknown-fields: true + spec: + description: NodeSpec describes the attributes that a node is + created with. + properties: + configSource: + description: 'Deprecated: Previously used to specify the source + of the node''s configuration for the DynamicKubeletConfig + feature. This feature is removed.' + properties: + configMap: + description: ConfigMap is a reference to a Node's ConfigMap + properties: + kubeletConfigKey: + description: KubeletConfigKey declares which key of + the referenced ConfigMap corresponds to the KubeletConfiguration + structure This field is required in all cases. + type: string + name: + description: Name is the metadata.name of the referenced + ConfigMap. This field is required in all cases. + type: string + namespace: + description: Namespace is the metadata.namespace of + the referenced ConfigMap. This field is required + in all cases. + type: string + resourceVersion: + description: ResourceVersion is the metadata.ResourceVersion + of the referenced ConfigMap. This field is forbidden + in Node.Spec, and required in Node.Status. + type: string + uid: + description: UID is the metadata.UID of the referenced + ConfigMap. This field is forbidden in Node.Spec, + and required in Node.Status. + type: string + required: + - kubeletConfigKey + - name + - namespace + type: object + type: object + externalID: + description: 'Deprecated. Not all kubelets will set this field. + Remove field after 1.13. see: https://issues.k8s.io/61966' + type: string + podCIDR: + description: PodCIDR represents the pod IP range assigned + to the node. + type: string + podCIDRs: + description: podCIDRs represents the IP ranges assigned to + the node for usage by Pods on that node. If this field is + specified, the 0th entry must match the podCIDR field. It + may contain at most 1 value for each of IPv4 and IPv6. + items: + type: string + type: array + providerID: + description: 'ID of the node assigned by the cloud provider + in the format: ://' + type: string + taints: + description: If specified, the node's taints. + items: + description: The node this Taint is attached to has the + "effect" on any pod that does not tolerate the Taint. + properties: + effect: + description: Required. The effect of the taint on pods + that do not tolerate the taint. Valid effects are + NoSchedule, PreferNoSchedule and NoExecute. + type: string + key: + description: Required. The taint key to be applied to + a node. + type: string + timeAdded: + description: TimeAdded represents the time at which + the taint was added. It is only written for NoExecute + taints. + format: date-time + type: string + value: + description: The taint value corresponding to the taint + key. + type: string + required: + - effect + - key + type: object + type: array + unschedulable: + description: 'Unschedulable controls node schedulability of + new pods. By default, node is schedulable. More info: https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration' + type: boolean + type: object + type: object + providerID: + description: ProviderID represents the provider's unique ID given + to a machine + type: string + type: object + status: + description: Status contains fields depicting the status + properties: + conditions: + description: Conditions of this machine, same as node + items: + description: NodeCondition contains condition information for a + node. + properties: + lastHeartbeatTime: + description: Last time we got an update on a given condition. + format: date-time + type: string + lastTransitionTime: + description: Last time the condition transit from one status + to another. + format: date-time + type: string + message: + description: Human readable message indicating details about + last transition. + type: string + reason: + description: (brief) reason for the condition's last transition. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of node condition. + type: string + required: + - status + - type + type: object + type: array + currentStatus: + description: Current status of the machine object + properties: + lastUpdateTime: + description: Last update time of current status + format: date-time + type: string + phase: + description: MachinePhase is a label for the condition of a machines + at the current time. + type: string + timeoutActive: + type: boolean + type: object + lastKnownState: + description: LastKnownState can store details of the last known state + of the VM by the plugins. It can be used by future operation calls + to determine current infrastucture state + type: string + lastOperation: + description: Last operation refers to the status of the last operation + performed + properties: + description: + description: Description of the current operation + type: string + errorCode: + description: ErrorCode of the current operation if any + type: string + lastUpdateTime: + description: Last update time of current operation + format: date-time + type: string + state: + description: State of operation + type: string + type: + description: Type of operation + type: string + type: object + type: object + type: object + served: true + storage: true + subresources: + status: {} diff --git a/example/seed-crds/10-crd-machine.sapcloud.io_machinesets.yaml b/example/seed-crds/10-crd-machine.sapcloud.io_machinesets.yaml new file mode 100644 index 00000000000..a712c0179f7 --- /dev/null +++ b/example/seed-crds/10-crd-machine.sapcloud.io_machinesets.yaml @@ -0,0 +1,417 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 + name: machinesets.machine.sapcloud.io +spec: + group: machine.sapcloud.io + names: + kind: MachineSet + listKind: MachineSetList + plural: machinesets + shortNames: + - mcs + singular: machineset + scope: Namespaced + versions: + - additionalPrinterColumns: + - description: Number of desired replicas. + jsonPath: .spec.replicas + name: Desired + type: integer + - description: Number of actual replicas. + jsonPath: .status.replicas + name: Current + type: integer + - description: Number of ready replicas for this machine set. + jsonPath: .status.readyReplicas + name: Ready + type: integer + - description: |- + CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. + Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 + schema: + openAPIV3Schema: + description: MachineSet TODO + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: MachineSetSpec is the specification of a MachineSet. + properties: + machineClass: + description: ClassSpec is the class specification of machine + properties: + apiGroup: + description: API group to which it belongs + type: string + kind: + description: Kind for machine class + type: string + name: + description: Name of machine class + type: string + type: object + minReadySeconds: + format: int32 + type: integer + replicas: + format: int32 + type: integer + selector: + description: A label selector is a label query over a set of resources. + The result of matchLabels and matchExpressions are ANDed. An empty + label selector matches all objects. A null label selector matches + no objects. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. + The requirements are ANDed. + items: + description: A label selector requirement is a selector that + contains values, a key, and an operator that relates the key + and values. + properties: + key: + description: key is the label key that the selector applies + to. + type: string + operator: + description: operator represents a key's relationship to + a set of values. Valid operators are In, NotIn, Exists + and DoesNotExist. + type: string + values: + description: values is an array of string values. If the + operator is In or NotIn, the values array must be non-empty. + If the operator is Exists or DoesNotExist, the values + array must be empty. This array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single + {key,value} in the matchLabels map is equivalent to an element + of matchExpressions, whose key field is "key", the operator + is "In", and the values array contains only "value". The requirements + are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + template: + description: MachineTemplateSpec describes the data a machine should + have when created from a template + properties: + metadata: + description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' + type: object + x-kubernetes-preserve-unknown-fields: true + spec: + description: 'Specification of the desired behavior of the machine. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status' + properties: + class: + description: Class contains the machineclass attributes of + a machine + properties: + apiGroup: + description: API group to which it belongs + type: string + kind: + description: Kind for machine class + type: string + name: + description: Name of machine class + type: string + type: object + creationTimeout: + description: MachineCreationTimeout is the timeout after which + machinie creation is declared failed. + type: string + drainTimeout: + description: MachineDraintimeout is the timeout after which + machine is forcefully deleted. + type: string + healthTimeout: + description: MachineHealthTimeout is the timeout after which + machine is declared unhealhty/failed. + type: string + maxEvictRetries: + description: MaxEvictRetries is the number of retries that + will be attempted while draining the node. + format: int32 + type: integer + nodeConditions: + description: NodeConditions are the set of conditions if set + to true for MachineHealthTimeOut, machine will be declared + failed. + type: string + nodeTemplate: + description: NodeTemplateSpec describes the data a node should + have when created from a template + properties: + metadata: + type: object + x-kubernetes-preserve-unknown-fields: true + spec: + description: NodeSpec describes the attributes that a + node is created with. + properties: + configSource: + description: 'Deprecated: Previously used to specify + the source of the node''s configuration for the + DynamicKubeletConfig feature. This feature is removed.' + properties: + configMap: + description: ConfigMap is a reference to a Node's + ConfigMap + properties: + kubeletConfigKey: + description: KubeletConfigKey declares which + key of the referenced ConfigMap corresponds + to the KubeletConfiguration structure This + field is required in all cases. + type: string + name: + description: Name is the metadata.name of + the referenced ConfigMap. This field is + required in all cases. + type: string + namespace: + description: Namespace is the metadata.namespace + of the referenced ConfigMap. This field + is required in all cases. + type: string + resourceVersion: + description: ResourceVersion is the metadata.ResourceVersion + of the referenced ConfigMap. This field + is forbidden in Node.Spec, and required + in Node.Status. + type: string + uid: + description: UID is the metadata.UID of the + referenced ConfigMap. This field is forbidden + in Node.Spec, and required in Node.Status. + type: string + required: + - kubeletConfigKey + - name + - namespace + type: object + type: object + externalID: + description: 'Deprecated. Not all kubelets will set + this field. Remove field after 1.13. see: https://issues.k8s.io/61966' + type: string + podCIDR: + description: PodCIDR represents the pod IP range assigned + to the node. + type: string + podCIDRs: + description: podCIDRs represents the IP ranges assigned + to the node for usage by Pods on that node. If this + field is specified, the 0th entry must match the + podCIDR field. It may contain at most 1 value for + each of IPv4 and IPv6. + items: + type: string + type: array + providerID: + description: 'ID of the node assigned by the cloud + provider in the format: ://' + type: string + taints: + description: If specified, the node's taints. + items: + description: The node this Taint is attached to + has the "effect" on any pod that does not tolerate + the Taint. + properties: + effect: + description: Required. The effect of the taint + on pods that do not tolerate the taint. Valid + effects are NoSchedule, PreferNoSchedule and + NoExecute. + type: string + key: + description: Required. The taint key to be applied + to a node. + type: string + timeAdded: + description: TimeAdded represents the time at + which the taint was added. It is only written + for NoExecute taints. + format: date-time + type: string + value: + description: The taint value corresponding to + the taint key. + type: string + required: + - effect + - key + type: object + type: array + unschedulable: + description: 'Unschedulable controls node schedulability + of new pods. By default, node is schedulable. More + info: https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration' + type: boolean + type: object + type: object + providerID: + description: ProviderID represents the provider's unique ID + given to a machine + type: string + type: object + type: object + type: object + status: + description: MachineSetStatus holds the most recently observed status + of MachineSet. + properties: + availableReplicas: + description: The number of available replicas (ready for at least + minReadySeconds) for this replica set. + format: int32 + type: integer + failedMachines: + description: FailedMachines has summary of machines on which lastOperation + Failed + items: + description: MachineSummary store the summary of machine. + properties: + lastOperation: + description: Last operation refers to the status of the last + operation performed + properties: + description: + description: Description of the current operation + type: string + errorCode: + description: ErrorCode of the current operation if any + type: string + lastUpdateTime: + description: Last update time of current operation + format: date-time + type: string + state: + description: State of operation + type: string + type: + description: Type of operation + type: string + type: object + name: + description: Name of the machine object + type: string + ownerRef: + description: OwnerRef + type: string + providerID: + description: ProviderID represents the provider's unique ID + given to a machine + type: string + type: object + type: array + fullyLabeledReplicas: + description: The number of pods that have labels matching the labels + of the pod template of the replicaset. + format: int32 + type: integer + lastOperation: + description: LastOperation performed + properties: + description: + description: Description of the current operation + type: string + errorCode: + description: ErrorCode of the current operation if any + type: string + lastUpdateTime: + description: Last update time of current operation + format: date-time + type: string + state: + description: State of operation + type: string + type: + description: Type of operation + type: string + type: object + machineSetCondition: + description: Represents the latest available observations of a replica + set's current state. + items: + description: MachineSetCondition describes the state of a machine + set at a certain point. + properties: + lastTransitionTime: + description: The last time the condition transitioned from one + status to another. + format: date-time + type: string + message: + description: A human readable message indicating details about + the transition. + type: string + reason: + description: The reason for the condition's last transition. + type: string + status: + description: Status of the condition, one of True, False, Unknown. + type: string + type: + description: Type of machine set condition. + type: string + required: + - status + - type + type: object + type: array + observedGeneration: + description: ObservedGeneration is the most recent generation observed + by the controller. + format: int64 + type: integer + readyReplicas: + description: The number of ready replicas for this replica set. + format: int32 + type: integer + replicas: + description: Replicas is the number of actual replicas. + format: int32 + type: integer + type: object + type: object + served: true + storage: true + subresources: + scale: + specReplicasPath: .spec.replicas + statusReplicasPath: .status.replicas + status: {} diff --git a/example/seed-crds/doc.go b/example/seed-crds/doc.go index 97634477034..37df4f8e823 100644 --- a/example/seed-crds/doc.go +++ b/example/seed-crds/doc.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:generate ../../hack/generate-crds.sh 10-crd- extensions.gardener.cloud resources.gardener.cloud druid.gardener.cloud autoscaling.k8s.io fluentbit.fluent.io +//go:generate ../../hack/generate-crds.sh 10-crd- extensions.gardener.cloud resources.gardener.cloud druid.gardener.cloud autoscaling.k8s.io fluentbit.fluent.io machine.sapcloud.io // Package seed_crds contains generated manifests for all CRDs that are present on a Seed cluster. // Useful for development purposes. diff --git a/extensions/pkg/controller/worker/controller.go b/extensions/pkg/controller/worker/controller.go index a9139695866..82b7064661e 100644 --- a/extensions/pkg/controller/worker/controller.go +++ b/extensions/pkg/controller/worker/controller.go @@ -17,7 +17,6 @@ package worker import ( "context" - machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/manager" @@ -34,8 +33,6 @@ const ( FinalizerName = "extensions.gardener.cloud/worker" // ControllerName is the name of the controller. ControllerName = "worker" - // ControllerNameState is the name of the controller responsible for updating the worker's state. - ControllerNameState = "worker-state" ) // AddArgs are arguments for adding an worker controller to a manager. @@ -68,15 +65,7 @@ func Add(ctx context.Context, mgr manager.Manager, args AddArgs) error { args.ControllerOptions.Reconciler = NewReconciler(mgr, args.Actuator) predicates := extensionspredicate.AddTypePredicate(args.Predicates, args.Type) - if err := add(ctx, mgr, args, predicates); err != nil { - return err - } - - return addStateUpdatingController(ctx, mgr, args.ControllerOptions, args.Type) -} -// add adds a new Controller to mgr with r as the reconcile.Reconciler -func add(ctx context.Context, mgr manager.Manager, args AddArgs, predicates []predicate.Predicate) error { ctrl, err := controller.New(ControllerName, mgr, args.ControllerOptions) if err != nil { return err @@ -93,40 +82,3 @@ func add(ctx context.Context, mgr manager.Manager, args AddArgs, predicates []pr return ctrl.Watch(source.Kind(mgr.GetCache(), &extensionsv1alpha1.Worker{}), &handler.EnqueueRequestForObject{}, predicates...) } - -func addStateUpdatingController(ctx context.Context, mgr manager.Manager, options controller.Options, extensionType string) error { - var ( - machinePredicates = []predicate.Predicate{ - predicate.Or( - MachineNodeInfoHasChanged(), - predicate.GenerationChangedPredicate{}, - ), - } - workerPredicates = []predicate.Predicate{ - extensionspredicate.HasType(extensionType), - WorkerStateUpdateIsNotSkipped(), - } - ) - - ctrl, err := controller.New(ControllerNameState, mgr, controller.Options{ - MaxConcurrentReconciles: options.MaxConcurrentReconciles, - Reconciler: NewStateReconciler(mgr), - }) - if err != nil { - return err - } - - if err := ctrl.Watch( - source.Kind(mgr.GetCache(), &machinev1alpha1.MachineSet{}), - mapper.EnqueueRequestsFrom(ctx, mgr.GetCache(), MachineSetToWorkerMapper(workerPredicates), mapper.UpdateWithNew, ctrl.GetLogger()), - machinePredicates..., - ); err != nil { - return err - } - - return ctrl.Watch( - source.Kind(mgr.GetCache(), &machinev1alpha1.Machine{}), - mapper.EnqueueRequestsFrom(ctx, mgr.GetCache(), MachineToWorkerMapper(workerPredicates), mapper.UpdateWithNew, ctrl.GetLogger()), - machinePredicates..., - ) -} diff --git a/extensions/pkg/controller/worker/genericactuator/actuator.go b/extensions/pkg/controller/worker/genericactuator/actuator.go index c17ca402a21..550e32e3a63 100644 --- a/extensions/pkg/controller/worker/genericactuator/actuator.go +++ b/extensions/pkg/controller/worker/genericactuator/actuator.go @@ -17,18 +17,16 @@ package genericactuator import ( "context" "fmt" - "strings" "time" machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" "github.com/go-logr/logr" corev1 "k8s.io/api/core/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/sets" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/client/apiutil" + "sigs.k8s.io/controller-runtime/pkg/cluster" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/manager" @@ -39,15 +37,11 @@ import ( v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" kubernetesclient "github.com/gardener/gardener/pkg/client/kubernetes" - "github.com/gardener/gardener/pkg/controllerutils" "github.com/gardener/gardener/pkg/utils/chart" + gardenerutils "github.com/gardener/gardener/pkg/utils/gardener" "github.com/gardener/gardener/pkg/utils/imagevector" - kubernetesutils "github.com/gardener/gardener/pkg/utils/kubernetes" ) -// GardenPurposeMachineClass is a constant for the 'machineclass' value in a label. -const GardenPurposeMachineClass = "machineclass" - type genericActuator struct { delegateFactory DelegateFactory mcmManaged bool @@ -56,8 +50,9 @@ type genericActuator struct { mcmShootChart chart.Interface imageVector imagevector.ImageVector - client client.Client - reader client.Reader + gardenReader client.Reader + seedClient client.Client + seedReader client.Reader scheme *runtime.Scheme gardenerClientset kubernetesclient.Interface chartApplier kubernetesclient.ChartApplier @@ -71,6 +66,7 @@ type genericActuator struct { // If machine-controller-manager should not be managed then only the delegateFactory must be provided. func NewActuator( mgr manager.Manager, + gardenCluster cluster.Cluster, delegateFactory DelegateFactory, mcmName string, mcmSeedChart, @@ -78,7 +74,10 @@ func NewActuator( imageVector imagevector.ImageVector, chartRendererFactory extensionscontroller.ChartRendererFactory, errorCodeCheckFunc healthcheck.ErrorCodeCheckFunc, -) (worker.Actuator, error) { +) ( + worker.Actuator, + error, +) { gardenerClientset, err := kubernetesclient.NewWithConfig(kubernetesclient.WithRESTConfig(mgr.GetConfig())) if err != nil { return nil, err @@ -91,8 +90,9 @@ func NewActuator( mcmSeedChart: mcmSeedChart, mcmShootChart: mcmShootChart, imageVector: imageVector, - client: mgr.GetClient(), - reader: mgr.GetAPIReader(), + gardenReader: gardenCluster.GetAPIReader(), + seedClient: mgr.GetClient(), + seedReader: mgr.GetAPIReader(), scheme: mgr.GetScheme(), gardenerClientset: gardenerClientset, chartApplier: gardenerClientset.ChartApplier(), @@ -105,7 +105,7 @@ func (a *genericActuator) cleanupMachineDeployments(ctx context.Context, logger logger.Info("Cleaning up machine deployments") for _, existingMachineDeployment := range existingMachineDeployments.Items { if !wantedMachineDeployments.HasDeployment(existingMachineDeployment.Name) { - if err := a.client.Delete(ctx, &existingMachineDeployment); err != nil { + if err := a.seedClient.Delete(ctx, &existingMachineDeployment); err != nil { return err } } @@ -113,8 +113,9 @@ func (a *genericActuator) cleanupMachineDeployments(ctx context.Context, logger return nil } -func (a *genericActuator) listMachineClassNames(ctx context.Context, namespace string, machineClassList client.ObjectList) (sets.Set[string], error) { - if err := a.client.List(ctx, machineClassList, client.InNamespace(namespace)); err != nil { +func (a *genericActuator) listMachineClassNames(ctx context.Context, namespace string) (sets.Set[string], error) { + machineClassList := &machinev1alpha1.MachineClassList{} + if err := a.seedClient.List(ctx, machineClassList, client.InNamespace(namespace)); err != nil { return nil, err } @@ -135,9 +136,10 @@ func (a *genericActuator) listMachineClassNames(ctx context.Context, namespace s return classNames, nil } -func (a *genericActuator) cleanupMachineClasses(ctx context.Context, logger logr.Logger, namespace string, machineClassList client.ObjectList, wantedMachineDeployments worker.MachineDeployments) error { +func (a *genericActuator) cleanupMachineClasses(ctx context.Context, logger logr.Logger, namespace string, wantedMachineDeployments worker.MachineDeployments) error { logger.Info("Cleaning up machine classes") - if err := a.client.List(ctx, machineClassList, client.InNamespace(namespace)); err != nil { + machineClassList := &machinev1alpha1.MachineClassList{} + if err := a.seedClient.List(ctx, machineClassList, client.InNamespace(namespace)); err != nil { return err } @@ -145,7 +147,7 @@ func (a *genericActuator) cleanupMachineClasses(ctx context.Context, logger logr machineClass := obj.(client.Object) if !wantedMachineDeployments.HasClass(machineClass.GetName()) { logger.Info("Deleting machine class", "machineClass", machineClass) - if err := a.client.Delete(ctx, machineClass); err != nil { + if err := a.seedClient.Delete(ctx, machineClass); err != nil { return err } } @@ -155,12 +157,12 @@ func (a *genericActuator) cleanupMachineClasses(ctx context.Context, logger logr } func getMachineClassSecretLabels() map[string]string { - return map[string]string{v1beta1constants.GardenerPurpose: GardenPurposeMachineClass} + return map[string]string{v1beta1constants.GardenerPurpose: v1beta1constants.GardenPurposeMachineClass} } func (a *genericActuator) listMachineClassSecrets(ctx context.Context, namespace string) (*corev1.SecretList, error) { secretList := &corev1.SecretList{} - if err := a.client.List(ctx, secretList, client.InNamespace(namespace), client.MatchingLabels(getMachineClassSecretLabels())); err != nil { + if err := a.seedClient.List(ctx, secretList, client.InNamespace(namespace), client.MatchingLabels(getMachineClassSecretLabels())); err != nil { return nil, err } @@ -179,31 +181,7 @@ func (a *genericActuator) cleanupMachineClassSecrets(ctx context.Context, logger // Cleanup all secrets which were used for machine classes that do not exist anymore. for _, secret := range secretList.Items { if !wantedMachineDeployments.HasSecret(secret.Name) { - if err := a.client.Delete(ctx, &secret); err != nil { - return err - } - } - } - - return nil -} - -// shallowDeleteMachineClassSecrets deletes all unused machine class secrets (i.e., those which are not part -// of the provided list ) without waiting for MCM to do this. -func (a *genericActuator) shallowDeleteMachineClassSecrets(ctx context.Context, log logr.Logger, namespace string, wantedMachineDeployments worker.MachineDeployments) error { - log.Info("Shallow deleting machine class secrets") - secretList, err := a.listMachineClassSecrets(ctx, namespace) - if err != nil { - return err - } - // Delete the finalizers to all secrets which were used for machine classes that do not exist anymore. - for _, secret := range secretList.Items { - if !wantedMachineDeployments.HasSecret(secret.Name) { - log.Info("Removing all finalizers from machine class secret", "secret", client.ObjectKeyFromObject(&secret)) - if err := controllerutils.RemoveAllFinalizers(ctx, a.client, &secret); err != nil { - return fmt.Errorf("error removing all finalizers from machine class secret: %s/%s: %w", secret.Namespace, secret.Name, err) - } - if err := a.client.Delete(ctx, &secret); err != nil { + if err := a.seedClient.Delete(ctx, &secret); err != nil { return err } } @@ -212,49 +190,18 @@ func (a *genericActuator) shallowDeleteMachineClassSecrets(ctx context.Context, return nil } -// removeFinalizerFromWorkerSecretRef removes the MCM finalizers from the secret that is referenced by the worker -func (a *genericActuator) removeFinalizerFromWorkerSecretRef(ctx context.Context, log logr.Logger, worker *extensionsv1alpha1.Worker) error { - secret, err := kubernetesutils.GetSecretByReference(ctx, a.client, &worker.Spec.SecretRef) - if err != nil { - if apierrors.IsNotFound(err) { - return nil - } - return err - } - - finalizersToRemove := []string{} - if controllerutil.ContainsFinalizer(secret, mcmFinalizer) { - finalizersToRemove = append(finalizersToRemove, mcmFinalizer) - } - if controllerutil.ContainsFinalizer(secret, mcmProviderFinalizer) { - finalizersToRemove = append(finalizersToRemove, mcmProviderFinalizer) - } - if len(finalizersToRemove) == 0 { - return nil - } - - if len(finalizersToRemove) > 0 { - log.Info("Removing finalizers from secret", "secret", client.ObjectKeyFromObject(secret)) - if err := controllerutils.RemoveFinalizers(ctx, a.client, secret, finalizersToRemove...); err != nil { - return fmt.Errorf("failed to remove finalizer from secret: %w", err) - } - } - - return nil -} - // cleanupMachineSets deletes MachineSets having number of desired and actual replicas equaling 0 func (a *genericActuator) cleanupMachineSets(ctx context.Context, logger logr.Logger, namespace string) error { logger.Info("Cleaning up machine sets") machineSetList := &machinev1alpha1.MachineSetList{} - if err := a.client.List(ctx, machineSetList, client.InNamespace(namespace)); err != nil { + if err := a.seedClient.List(ctx, machineSetList, client.InNamespace(namespace)); err != nil { return err } for _, machineSet := range machineSetList.Items { if machineSet.Spec.Replicas == 0 && machineSet.Status.Replicas == 0 { logger.Info("Deleting MachineSet as the number of desired and actual replicas is 0", "machineSet", &machineSet) - if err := a.client.Delete(ctx, machineSet.DeepCopy()); client.IgnoreNotFound(err) != nil { + if err := a.seedClient.Delete(ctx, machineSet.DeepCopy()); client.IgnoreNotFound(err) != nil { return err } } @@ -262,44 +209,15 @@ func (a *genericActuator) cleanupMachineSets(ctx context.Context, logger logr.Lo return nil } -func (a *genericActuator) shallowDeleteAllObjects(ctx context.Context, log logr.Logger, namespace string, objectList client.ObjectList) error { - var objectKind interface{} = strings.TrimSuffix(fmt.Sprintf("%T", objectList), "List") - if gvk, err := apiutil.GVKForObject(objectList, a.scheme); err == nil { - objectKind = gvk - } - - log = log.WithValues("kind", objectKind) - log.Info("Shallow deleting all objects of kind") - - if err := a.client.List(ctx, objectList, client.InNamespace(namespace)); err != nil { - return err - } - - return meta.EachListItem(objectList, func(obj runtime.Object) error { - object := obj.(client.Object) - if err := controllerutils.RemoveAllFinalizers(ctx, a.client, object); err != nil { - return err - } - log.Info("Removing all finalizers from object", "object", client.ObjectKeyFromObject(object)) - if err := controllerutils.RemoveAllFinalizers(ctx, a.client, object); err != nil { - return fmt.Errorf("error removing all finalizers from object: %s/%s: %w", object.GetNamespace(), object.GetName(), err) - } - if err := a.client.Delete(ctx, object); client.IgnoreNotFound(err) != nil { - return err - } - return nil - }) -} - // IsMachineControllerStuck determines if the machine controller pod is stuck. func (a *genericActuator) IsMachineControllerStuck(ctx context.Context, worker *extensionsv1alpha1.Worker) (bool, *string, error) { machineDeployments := &machinev1alpha1.MachineDeploymentList{} - if err := a.client.List(ctx, machineDeployments, client.InNamespace(worker.Namespace)); err != nil { + if err := a.seedClient.List(ctx, machineDeployments, client.InNamespace(worker.Namespace)); err != nil { return false, nil, err } machineSets := &machinev1alpha1.MachineSetList{} - if err := a.client.List(ctx, machineSets, client.InNamespace(worker.Namespace)); err != nil { + if err := a.seedClient.List(ctx, machineSets, client.InNamespace(worker.Namespace)); err != nil { return false, nil, err } @@ -325,7 +243,7 @@ const ( // - the machine set does not have a status that indicates (attempted) machine creation func isMachineControllerStuck(machineSets []machinev1alpha1.MachineSet, machineDeployments []machinev1alpha1.MachineDeployment) (bool, *string) { // map the owner reference to the existing machine sets - ownerReferenceToMachineSet := extensionsworkerhelper.BuildOwnerToMachineSetsMap(machineSets) + ownerReferenceToMachineSet := gardenerutils.BuildOwnerToMachineSetsMap(machineSets) for _, machineDeployment := range machineDeployments { if !controllerutil.ContainsFinalizer(&machineDeployment, mcmFinalizer) { diff --git a/extensions/pkg/controller/worker/genericactuator/actuator_delete.go b/extensions/pkg/controller/worker/genericactuator/actuator_delete.go index aab6aec1b21..b8cb8eb1727 100644 --- a/extensions/pkg/controller/worker/genericactuator/actuator_delete.go +++ b/extensions/pkg/controller/worker/genericactuator/actuator_delete.go @@ -18,13 +18,11 @@ import ( "context" "errors" "fmt" - "strings" "time" machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" "github.com/go-logr/logr" corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/meta" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" @@ -32,6 +30,7 @@ import ( v1beta1helper "github.com/gardener/gardener/pkg/apis/core/v1beta1/helper" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "github.com/gardener/gardener/pkg/utils/flow" + gardenerutils "github.com/gardener/gardener/pkg/utils/gardener" kubernetesutils "github.com/gardener/gardener/pkg/utils/kubernetes" retryutils "github.com/gardener/gardener/pkg/utils/retry" ) @@ -78,30 +77,30 @@ func (a *genericActuator) Delete(ctx context.Context, log logr.Logger, worker *e // Mark all existing machines to become forcefully deleted. log.Info("Marking all machines to become forcefully deleted") - if err := markAllMachinesForcefulDeletion(ctx, log, a.client, worker.Namespace); err != nil { + if err := markAllMachinesForcefulDeletion(ctx, log, a.seedClient, worker.Namespace); err != nil { return fmt.Errorf("marking all machines for forceful deletion failed: %w", err) } // Delete all machine deployments. log.Info("Deleting all machine deployments") - if err := a.client.DeleteAllOf(ctx, &machinev1alpha1.MachineDeployment{}, client.InNamespace(worker.Namespace)); err != nil { + if err := a.seedClient.DeleteAllOf(ctx, &machinev1alpha1.MachineDeployment{}, client.InNamespace(worker.Namespace)); err != nil { return fmt.Errorf("cleaning up all machine deployments failed: %w", err) } // Delete all machine classes. log.Info("Deleting all machine classes") - if err := a.client.DeleteAllOf(ctx, workerDelegate.MachineClass(), client.InNamespace(worker.Namespace)); err != nil { + if err := a.seedClient.DeleteAllOf(ctx, &machinev1alpha1.MachineClass{}, client.InNamespace(worker.Namespace)); err != nil { return fmt.Errorf("cleaning up all machine classes failed: %w", err) } // Delete all machine class secrets. log.Info("Deleting all machine class secrets") - if err := a.client.DeleteAllOf(ctx, &corev1.Secret{}, client.InNamespace(worker.Namespace), client.MatchingLabels(getMachineClassSecretLabels())); err != nil { + if err := a.seedClient.DeleteAllOf(ctx, &corev1.Secret{}, client.InNamespace(worker.Namespace), client.MatchingLabels(getMachineClassSecretLabels())); err != nil { return fmt.Errorf("cleaning up all machine class secrets failed: %w", err) } // Wait until all machine resources have been properly deleted. - if err := a.waitUntilMachineResourcesDeleted(ctx, log, worker, workerDelegate); err != nil { + if err := gardenerutils.WaitUntilMachineResourcesDeleted(ctx, log, a.seedClient, worker.Namespace); err != nil { newError := fmt.Errorf("failed while waiting for all machine resources to be deleted: %w", err) if a.errorCodeCheckFunc != nil { return v1beta1helper.NewErrorWithCodes(newError, a.errorCodeCheckFunc(err)...) @@ -172,106 +171,12 @@ func markMachineForcefulDeletion(ctx context.Context, cl client.Client, machine return cl.Update(ctx, machine) } -// waitUntilMachineResourcesDeleted waits for a maximum of 30 minutes until all machine resources have been properly -// deleted by the machine-controller-manager. It polls the status every 5 seconds. -// TODO: Parallelise this? -func (a *genericActuator) waitUntilMachineResourcesDeleted(ctx context.Context, log logr.Logger, worker *extensionsv1alpha1.Worker, workerDelegate WorkerDelegate) error { - var ( - countMachines = -1 - countMachineSets = -1 - countMachineDeployments = -1 - countMachineClasses = -1 - countMachineClassSecrets = -1 - ) - log.Info("Waiting until all machine resources have been deleted") - - return retryutils.UntilTimeout(ctx, 5*time.Second, 5*time.Minute, func(ctx context.Context) (bool, error) { - msg := "" - - // Check whether all machines have been deleted. - if countMachines != 0 { - existingMachines := &machinev1alpha1.MachineList{} - if err := a.reader.List(ctx, existingMachines, client.InNamespace(worker.Namespace)); err != nil { - return retryutils.SevereError(err) - } - countMachines = len(existingMachines.Items) - msg += fmt.Sprintf("%d machines, ", countMachines) - } - - // Check whether all machine sets have been deleted. - if countMachineSets != 0 { - existingMachineSets := &machinev1alpha1.MachineSetList{} - if err := a.reader.List(ctx, existingMachineSets, client.InNamespace(worker.Namespace)); err != nil { - return retryutils.SevereError(err) - } - countMachineSets = len(existingMachineSets.Items) - msg += fmt.Sprintf("%d machine sets, ", countMachineSets) - } - - // Check whether all machine deployments have been deleted. - if countMachineDeployments != 0 { - existingMachineDeployments := &machinev1alpha1.MachineDeploymentList{} - if err := a.reader.List(ctx, existingMachineDeployments, client.InNamespace(worker.Namespace)); err != nil { - return retryutils.SevereError(err) - } - countMachineDeployments = len(existingMachineDeployments.Items) - msg += fmt.Sprintf("%d machine deployments, ", countMachineDeployments) - - // Check whether an operation failed during the deletion process. - for _, existingMachineDeployment := range existingMachineDeployments.Items { - for _, failedMachine := range existingMachineDeployment.Status.FailedMachines { - return retryutils.SevereError(fmt.Errorf("machine %s failed: %s", failedMachine.Name, failedMachine.LastOperation.Description)) - } - } - } - - // Check whether all machine classes have been deleted. - if countMachineClasses != 0 { - machineClassList := workerDelegate.MachineClassList() - if err := a.reader.List(ctx, machineClassList, client.InNamespace(worker.Namespace)); err != nil { - return retryutils.SevereError(err) - } - machineClasses, err := meta.ExtractList(machineClassList) - if err != nil { - return retryutils.SevereError(err) - } - countMachineClasses = len(machineClasses) - msg += fmt.Sprintf("%d machine classes, ", countMachineClasses) - } - - // Check whether all machine class secrets have been deleted. - if countMachineClassSecrets != 0 { - count := 0 - existingMachineClassSecrets, err := a.listMachineClassSecrets(ctx, worker.Namespace) - if err != nil { - return retryutils.SevereError(err) - } - for _, machineClassSecret := range existingMachineClassSecrets.Items { - if len(machineClassSecret.Finalizers) != 0 { - count++ - } - } - countMachineClassSecrets = count - msg += fmt.Sprintf("%d machine class secrets, ", countMachineClassSecrets) - } - - if countMachines != 0 || countMachineSets != 0 || countMachineDeployments != 0 || countMachineClasses != 0 || countMachineClassSecrets != 0 { - log.Info("Waiting until machine resources have been deleted", - "machines", countMachines, "machineSets", countMachineSets, "machineDeployments", countMachineDeployments, - "machineClasses", countMachineClasses, "machineClassSecrets", countMachineClassSecrets) - return retryutils.MinorError(fmt.Errorf("waiting until the following machine resources have been deleted: %s", strings.TrimSuffix(msg, ", "))) - } - - return retryutils.Ok() - }) -} - func (a *genericActuator) waitUntilCredentialsSecretAcquiredOrReleased(ctx context.Context, acquired bool, worker *extensionsv1alpha1.Worker) error { acquiredOrReleased := false return retryutils.UntilTimeout(ctx, 5*time.Second, 5*time.Minute, func(ctx context.Context) (bool, error) { // Check whether the finalizer of the machine class credentials secret has been added or removed. if !acquiredOrReleased { - secret, err := kubernetesutils.GetSecretByReference(ctx, a.client, &worker.Spec.SecretRef) + secret, err := kubernetesutils.GetSecretByReference(ctx, a.seedClient, &worker.Spec.SecretRef) if err != nil { return retryutils.SevereError(fmt.Errorf("could not get the secret referenced by worker: %+v", err)) } diff --git a/extensions/pkg/controller/worker/genericactuator/actuator_migrate.go b/extensions/pkg/controller/worker/genericactuator/actuator_migrate.go index c1b1fd1487e..40e021abcc9 100644 --- a/extensions/pkg/controller/worker/genericactuator/actuator_migrate.go +++ b/extensions/pkg/controller/worker/genericactuator/actuator_migrate.go @@ -18,29 +18,20 @@ import ( "context" "fmt" - machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" "github.com/go-logr/logr" - "sigs.k8s.io/controller-runtime/pkg/client" "github.com/gardener/gardener/extensions/pkg/controller" - extensionsworkercontroller "github.com/gardener/gardener/extensions/pkg/controller/worker" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" kubernetesutils "github.com/gardener/gardener/pkg/utils/kubernetes" "github.com/gardener/gardener/pkg/utils/managedresources" ) -// Migrate removes all machine related resources (e.g. MachineDeployments, MachineClasses, MachineClassSecrets, MachineSets and Machines) -// without waiting for machine-controller-manager to do that. Before removal it ensures that the MCM is deleted. -func (a *genericActuator) Migrate(ctx context.Context, log logr.Logger, worker *extensionsv1alpha1.Worker, cluster *controller.Cluster) error { +// Migrate ensures that the MCM is deleted in case it is managed. +func (a *genericActuator) Migrate(ctx context.Context, log logr.Logger, worker *extensionsv1alpha1.Worker, _ *controller.Cluster) error { log = log.WithValues("operation", "migrate") - workerDelegate, err := a.delegateFactory.WorkerDelegate(ctx, worker, cluster) - if err != nil { - return fmt.Errorf("could not instantiate actuator context: %w", err) - } - // Keep objects for shoot managed resources so that they are not deleted from the shoot during the migration - if err := managedresources.SetKeepObjects(ctx, a.client, worker.Namespace, McmShootResourceName, true); err != nil { + if err := managedresources.SetKeepObjects(ctx, a.seedClient, worker.Namespace, McmShootResourceName, true); err != nil { return fmt.Errorf("could not keep objects of managed resource containing mcm chart for worker '%s': %w", kubernetesutils.ObjectName(worker), err) } @@ -55,48 +46,5 @@ func (a *genericActuator) Migrate(ctx context.Context, log logr.Logger, worker * } } - // TODO(rfranzke): Instead of checking for machine objects, we could also only persist the state when it is nil. - // This is only to prevent that subsequent executions of Migrate don't overwrite/delete previously persisted state. - // We cannot do it this way yet since gardenlet does not persist the ShootState after all extension resources have - // been migrated. It is planned to do so after v1.79 has been released, hence we have to wait a bit longer. - machineObjectsExist, err := kubernetesutils.ResourcesExist(ctx, a.client, &machinev1alpha1.MachineList{}, a.client.Scheme(), client.InNamespace(worker.Namespace)) - if err != nil { - return fmt.Errorf("failed checking whether machine objects exist: %w", err) - } - if machineObjectsExist { - if err := extensionsworkercontroller.PersistState(ctx, log, a.client, worker); err != nil { - return fmt.Errorf("failed persisting worker state: %w", err) - } - } - - if err := a.shallowDeleteAllObjects(ctx, log, worker.Namespace, &machinev1alpha1.MachineList{}); err != nil { - return fmt.Errorf("shallow deletion of all machine failed: %w", err) - } - - if err := a.shallowDeleteAllObjects(ctx, log, worker.Namespace, &machinev1alpha1.MachineSetList{}); err != nil { - return fmt.Errorf("shallow deletion of all machineSets failed: %w", err) - } - - if err := a.shallowDeleteAllObjects(ctx, log, worker.Namespace, &machinev1alpha1.MachineDeploymentList{}); err != nil { - return fmt.Errorf("shallow deletion of all machineDeployments failed: %w", err) - } - - if err := a.shallowDeleteAllObjects(ctx, log, worker.Namespace, workerDelegate.MachineClassList()); err != nil { - return fmt.Errorf("cleaning up machine classes failed: %w", err) - } - - if err := a.shallowDeleteMachineClassSecrets(ctx, log, worker.Namespace, nil); err != nil { - return fmt.Errorf("cleaning up machine class secrets failed: %w", err) - } - - if err := a.removeFinalizerFromWorkerSecretRef(ctx, log, worker); err != nil { - return fmt.Errorf("unable to remove the finalizers from worker`s secret: %w", err) - } - - // Wait until all machine resources have been properly deleted. - if err := a.waitUntilMachineResourcesDeleted(ctx, log, worker, workerDelegate); err != nil { - return fmt.Errorf("failed while waiting for all machine resources to be deleted: %w", err) - } - return nil } diff --git a/extensions/pkg/controller/worker/genericactuator/actuator_reconcile.go b/extensions/pkg/controller/worker/genericactuator/actuator_reconcile.go index 414ecf65b2b..59aae6c85d2 100644 --- a/extensions/pkg/controller/worker/genericactuator/actuator_reconcile.go +++ b/extensions/pkg/controller/worker/genericactuator/actuator_reconcile.go @@ -35,6 +35,7 @@ import ( extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" extensionsv1alpha1helper "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1/helper" "github.com/gardener/gardener/pkg/controllerutils" + gardenerutils "github.com/gardener/gardener/pkg/utils/gardener" "github.com/gardener/gardener/pkg/utils/kubernetes/health" retryutils "github.com/gardener/gardener/pkg/utils/retry" ) @@ -54,7 +55,7 @@ func (a *genericActuator) Reconcile(ctx context.Context, log logr.Logger, worker // Get the list of all existing machine deployments. existingMachineDeployments := &machinev1alpha1.MachineDeploymentList{} - if err := a.client.List(ctx, existingMachineDeployments, client.InNamespace(worker.Namespace)); err != nil { + if err := a.seedClient.List(ctx, existingMachineDeployments, client.InNamespace(worker.Namespace)); err != nil { return err } @@ -97,7 +98,7 @@ func (a *genericActuator) Reconcile(ctx context.Context, log logr.Logger, worker ) // Get list of existing machine class names - existingMachineClassNames, err := a.listMachineClassNames(ctx, worker.Namespace, workerDelegate.MachineClassList()) + existingMachineClassNames, err := a.listMachineClassNames(ctx, worker.Namespace) if err != nil { return err } @@ -119,7 +120,7 @@ func (a *genericActuator) Reconcile(ctx context.Context, log logr.Logger, worker } // Generate machine deployment configuration based on previously computed list of deployments and deploy them. - if err := deployMachineDeployments(ctx, log, a.client, cluster, worker, existingMachineDeployments, wantedMachineDeployments, workerDelegate.MachineClassKind(), clusterAutoscalerUsed); err != nil { + if err := deployMachineDeployments(ctx, log, a.seedClient, cluster, worker, existingMachineDeployments, wantedMachineDeployments, clusterAutoscalerUsed); err != nil { return fmt.Errorf("failed to generate the machine deployment config: %w", err) } @@ -139,12 +140,12 @@ func (a *genericActuator) Reconcile(ctx context.Context, log logr.Logger, worker if isStuck { podList := corev1.PodList{} - if err2 := a.client.List(ctx, &podList, client.InNamespace(worker.Namespace), client.MatchingLabels{"role": "machine-controller-manager"}); err2 != nil { + if err2 := a.seedClient.List(ctx, &podList, client.InNamespace(worker.Namespace), client.MatchingLabels{"role": "machine-controller-manager"}); err2 != nil { return fmt.Errorf("failed to list machine-controller-manager pods for worker (%s/%s): %w", worker.Namespace, worker.Name, err2) } for _, pod := range podList.Items { - if err2 := a.client.Delete(ctx, &pod); err2 != nil { + if err2 := a.seedClient.Delete(ctx, &pod); err2 != nil { return fmt.Errorf("failed to delete stuck machine-controller-manager pod for worker (%s/%s): %w", worker.Namespace, worker.Name, err2) } } @@ -164,7 +165,7 @@ func (a *genericActuator) Reconcile(ctx context.Context, log logr.Logger, worker } // Delete all old machine classes (i.e. those which were not previously computed but exist in the cluster). - if err := a.cleanupMachineClasses(ctx, log, worker.Namespace, workerDelegate.MachineClassList(), wantedMachineDeployments); err != nil { + if err := a.cleanupMachineClasses(ctx, log, worker.Namespace, wantedMachineDeployments); err != nil { return fmt.Errorf("failed to cleanup the machine classes: %w", err) } @@ -188,7 +189,7 @@ func (a *genericActuator) Reconcile(ctx context.Context, log logr.Logger, worker // Scale down machine-controller-manager if shoot is hibernated. if isHibernationEnabled { - if err := scaleMachineControllerManager(ctx, log, a.client, worker, 0); err != nil { + if err := scaleMachineControllerManager(ctx, log, a.seedClient, worker, 0); err != nil { return err } } @@ -209,7 +210,6 @@ func deployMachineDeployments( worker *extensionsv1alpha1.Worker, existingMachineDeployments *machinev1alpha1.MachineDeploymentList, wantedMachineDeployments extensionsworkercontroller.MachineDeployments, - classKind string, clusterAutoscalerUsed bool, ) error { log.Info("Deploying machine deployments") @@ -291,7 +291,7 @@ func deployMachineDeployments( }, Spec: machinev1alpha1.MachineSpec{ Class: machinev1alpha1.ClassSpec{ - Kind: classKind, + Kind: "MachineClass", Name: deployment.ClassName, }, NodeTemplateSpec: machinev1alpha1.NodeTemplateSpec{ @@ -327,18 +327,18 @@ func (a *genericActuator) waitUntilWantedMachineDeploymentsAvailable(ctx context // Get the list of all machine deployments machineDeployments := &machinev1alpha1.MachineDeploymentList{} - if err := a.client.List(ctx, machineDeployments, client.InNamespace(worker.Namespace)); err != nil { + if err := a.seedClient.List(ctx, machineDeployments, client.InNamespace(worker.Namespace)); err != nil { return retryutils.SevereError(err) } // Get the list of all machine sets machineSets := &machinev1alpha1.MachineSetList{} - if err := a.client.List(ctx, machineSets, client.InNamespace(worker.Namespace)); err != nil { + if err := a.seedClient.List(ctx, machineSets, client.InNamespace(worker.Namespace)); err != nil { return retryutils.SevereError(err) } // map the owner reference to the machine sets - ownerReferenceToMachineSet := extensionsworkerhelper.BuildOwnerToMachineSetsMap(machineSets.Items) + ownerReferenceToMachineSet := gardenerutils.BuildOwnerToMachineSetsMap(machineSets.Items) // Collect the numbers of available and desired replicas. for _, deployment := range machineDeployments.Items { @@ -432,7 +432,7 @@ func (a *genericActuator) waitUntilUnwantedMachineDeploymentsDeleted(ctx context log.Info("Waiting until unwanted machine deployments are deleted") return retryutils.UntilTimeout(ctx, 5*time.Second, 5*time.Minute, func(ctx context.Context) (bool, error) { existingMachineDeployments := &machinev1alpha1.MachineDeploymentList{} - if err := a.client.List(ctx, existingMachineDeployments, client.InNamespace(worker.Namespace)); err != nil { + if err := a.seedClient.List(ctx, existingMachineDeployments, client.InNamespace(worker.Namespace)); err != nil { return retryutils.SevereError(err) } @@ -469,7 +469,7 @@ func (a *genericActuator) updateWorkerStatusMachineDeployments(ctx context.Conte patch := client.MergeFrom(worker.DeepCopy()) worker.Status.MachineDeployments = statusMachineDeployments worker.Status.MachineDeploymentsLastUpdateTime = &updateTime - return a.client.Status().Patch(ctx, worker, patch) + return a.seedClient.Status().Patch(ctx, worker, patch) } // Helper functions diff --git a/extensions/pkg/controller/worker/genericactuator/actuator_restore.go b/extensions/pkg/controller/worker/genericactuator/actuator_restore.go index d4a1d925926..d59662070cd 100644 --- a/extensions/pkg/controller/worker/genericactuator/actuator_restore.go +++ b/extensions/pkg/controller/worker/genericactuator/actuator_restore.go @@ -22,12 +22,17 @@ import ( machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" "github.com/go-logr/logr" apierrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" extensionscontroller "github.com/gardener/gardener/extensions/pkg/controller" extensionsworkercontroller "github.com/gardener/gardener/extensions/pkg/controller/worker" + gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" + v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" + v1beta1helper "github.com/gardener/gardener/pkg/apis/core/v1beta1/helper" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "github.com/gardener/gardener/pkg/client/kubernetes" + "github.com/gardener/gardener/pkg/utils/gardener/shootstate" kubernetesutils "github.com/gardener/gardener/pkg/utils/kubernetes" ) @@ -35,7 +40,8 @@ import ( func RestoreWithoutReconcile( ctx context.Context, log logr.Logger, - cl client.Client, + gardenReader client.Reader, + seedClient client.Client, delegateFactory DelegateFactory, worker *extensionsv1alpha1.Worker, cluster *extensionscontroller.Cluster, @@ -56,21 +62,21 @@ func RestoreWithoutReconcile( // Get the list of all existing machine deployments. existingMachineDeployments := &machinev1alpha1.MachineDeploymentList{} - if err := cl.List(ctx, existingMachineDeployments, client.InNamespace(worker.Namespace)); err != nil { + if err := seedClient.List(ctx, existingMachineDeployments, client.InNamespace(worker.Namespace)); err != nil { return err } // Parse the worker state to a separate machineDeployment states and attach them to // the corresponding machineDeployments which are to be deployed later - log.Info("Extracting state from worker status") - if err := addStateToMachineDeployment(worker, wantedMachineDeployments); err != nil { + log.Info("Extracting machine state") + if err := addStateToMachineDeployment(ctx, log, gardenReader, cluster.Shoot, worker, wantedMachineDeployments); err != nil { return err } wantedMachineDeployments = removeWantedDeploymentWithoutState(wantedMachineDeployments) // Scale the machine-controller-manager to 0. During restoration MCM must not be working - if err := scaleMachineControllerManager(ctx, log, cl, worker, 0); err != nil { + if err := scaleMachineControllerManager(ctx, log, seedClient, worker, 0); err != nil { return fmt.Errorf("failed to scale down machine-controller-manager: %w", err) } @@ -79,23 +85,23 @@ func RestoreWithoutReconcile( return fmt.Errorf("failed to deploy the machine classes: %w", err) } - if err := kubernetes.WaitUntilDeploymentScaledToDesiredReplicas(ctx, cl, kubernetesutils.Key(worker.Namespace, McmDeploymentName), 0); err != nil && !apierrors.IsNotFound(err) { + if err := kubernetes.WaitUntilDeploymentScaledToDesiredReplicas(ctx, seedClient, kubernetesutils.Key(worker.Namespace, McmDeploymentName), 0); err != nil && !apierrors.IsNotFound(err) { return fmt.Errorf("deadline exceeded while scaling down machine-controller-manager: %w", err) } // Do the actual restoration - if err := restoreMachineSetsAndMachines(ctx, log, cl, wantedMachineDeployments); err != nil { + if err := restoreMachineSetsAndMachines(ctx, log, seedClient, wantedMachineDeployments); err != nil { return fmt.Errorf("failed restoration of the machineSet and the machines: %w", err) } // Generate machine deployment configuration based on previously computed list of deployments and deploy them. - if err := deployMachineDeployments(ctx, log, cl, cluster, worker, existingMachineDeployments, wantedMachineDeployments, workerDelegate.MachineClassKind(), true); err != nil { + if err := deployMachineDeployments(ctx, log, seedClient, cluster, worker, existingMachineDeployments, wantedMachineDeployments, true); err != nil { return fmt.Errorf("failed to restore the machine deployment config: %w", err) } // Scale the machine-controller-manager to 1 now that all resources have been restored. if !extensionscontroller.IsHibernated(cluster) { - if err := scaleMachineControllerManager(ctx, log, cl, worker, 1); err != nil { + if err := scaleMachineControllerManager(ctx, log, seedClient, worker, 1); err != nil { return fmt.Errorf("failed to scale up machine-controller-manager: %w", err) } } @@ -107,34 +113,52 @@ func RestoreWithoutReconcile( // If there is a record in the state corresponding to a wanted deployment then the Restore function // deploys that MachineDeployment with all related MachineSet and Machines. It finally calls the 'Reconcile' function. func (a *genericActuator) Restore(ctx context.Context, log logr.Logger, worker *extensionsv1alpha1.Worker, cluster *extensionscontroller.Cluster) error { - if err := RestoreWithoutReconcile(ctx, log, a.client, a.delegateFactory, worker, cluster); err != nil { + if err := RestoreWithoutReconcile(ctx, log, a.gardenReader, a.seedClient, a.delegateFactory, worker, cluster); err != nil { return err } return a.Reconcile(ctx, log, worker, cluster) - // TODO(rfranzke): Uncomment these lines after the stateReconciler has been dropped (probably after v1.79 has been - // released). - // patch := client.MergeFromWithOptions(worker.DeepCopy(), client.MergeFromWithOptimisticLock{}) - // worker.Status.State = nil - // return a.client.Status().Patch(ctx, worker, patch) } -func addStateToMachineDeployment(worker *extensionsv1alpha1.Worker, wantedMachineDeployments extensionsworkercontroller.MachineDeployments) error { - if worker.Status.State == nil || len(worker.Status.State.Raw) <= 0 { - return nil +func addStateToMachineDeployment( + ctx context.Context, + log logr.Logger, + gardenReader client.Reader, + shoot *gardencorev1beta1.Shoot, + worker *extensionsv1alpha1.Worker, + wantedMachineDeployments extensionsworkercontroller.MachineDeployments, +) error { + var state []byte + + // We use the `gardenReader` here to prevent controller-runtime from trying to cache/list the ShootStates. + shootState := &gardencorev1beta1.ShootState{ObjectMeta: metav1.ObjectMeta{Name: shoot.Name, Namespace: shoot.Namespace}} + if err := gardenReader.Get(ctx, client.ObjectKeyFromObject(shootState), shootState); err != nil { + return err } - // Parse the worker state to MachineDeploymentStates - workerState := &extensionsworkercontroller.State{ - MachineDeployments: make(map[string]*extensionsworkercontroller.MachineDeploymentState), + gardenerData := v1beta1helper.GardenerResourceDataList(shootState.Spec.Gardener) + if machineState := gardenerData.Get(v1beta1constants.DataTypeMachineState); machineState != nil && machineState.Type == v1beta1constants.DataTypeMachineState { + log.Info("Fetching machine state from ShootState succeeded", "shootState", client.ObjectKeyFromObject(shootState)) + state = machineState.Data.Raw + } else { + // TODO(rfranzke): Drop this code after Gardener v1.86 has been released. + log.Info("Fetching machine state from ShootState not possible since the machine state was not found, falling back to Worker's .status.state field", "shootState", client.ObjectKeyFromObject(shootState)) + if worker.Status.State == nil || len(worker.Status.State.Raw) <= 0 { + log.Info("Worker's .status.state field is empty, no state to add") + return nil + } + log.Info("Fetching machine state from Worker's .status.state field succeeded") + state = worker.Status.State.Raw } - if err := json.Unmarshal(worker.Status.State.Raw, &workerState); err != nil { + // Parse the worker state to MachineDeploymentStates + machineState := &shootstate.MachineState{MachineDeployments: make(map[string]*shootstate.MachineDeploymentState)} + if err := json.Unmarshal(state, &machineState); err != nil { return err } // Attach the parsed MachineDeploymentStates to the wanted MachineDeployments for index, wantedMachineDeployment := range wantedMachineDeployments { - wantedMachineDeployments[index].State = workerState.MachineDeployments[wantedMachineDeployment.Name] + wantedMachineDeployments[index].State = machineState.MachineDeployments[wantedMachineDeployment.Name] } return nil diff --git a/extensions/pkg/controller/worker/genericactuator/actuator_restore_test.go b/extensions/pkg/controller/worker/genericactuator/actuator_restore_test.go new file mode 100644 index 00000000000..4bd54083864 --- /dev/null +++ b/extensions/pkg/controller/worker/genericactuator/actuator_restore_test.go @@ -0,0 +1,121 @@ +// Copyright 2023 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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://wwr.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 genericactuator + +import ( + "context" + "encoding/json" + + machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" + "github.com/go-logr/logr" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + fakeclient "sigs.k8s.io/controller-runtime/pkg/client/fake" + + extensionsworkercontroller "github.com/gardener/gardener/extensions/pkg/controller/worker" + gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" + extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" + "github.com/gardener/gardener/pkg/client/kubernetes" + "github.com/gardener/gardener/pkg/utils/gardener/shootstate" +) + +var _ = Describe("ActuatorRestore", func() { + Describe("#addStateToMachineDeployment", func() { + var ( + ctx = context.Background() + log = logr.Discard() + fakeGardenClient client.Client + + shoot *gardencorev1beta1.Shoot + shootState *gardencorev1beta1.ShootState + worker *extensionsv1alpha1.Worker + wantedMachineDeployments extensionsworkercontroller.MachineDeployments + + stateDeployment1 = &shootstate.MachineDeploymentState{ + Replicas: 1, + MachineSets: []machinev1alpha1.MachineSet{{ObjectMeta: metav1.ObjectMeta{Name: "deploy1-set1"}}}, + Machines: []machinev1alpha1.Machine{{ObjectMeta: metav1.ObjectMeta{Name: "deploy1-machine1"}}}, + } + stateDeployment2 = &shootstate.MachineDeploymentState{ + Replicas: 2, + MachineSets: []machinev1alpha1.MachineSet{{ObjectMeta: metav1.ObjectMeta{Name: "deploy2-set1"}}}, + Machines: []machinev1alpha1.Machine{{ObjectMeta: metav1.ObjectMeta{Name: "deploy2-machine1"}}}, + } + machineState = &shootstate.MachineState{MachineDeployments: map[string]*shootstate.MachineDeploymentState{ + "deploy1": stateDeployment1, + "deploy2": stateDeployment2, + }} + machineStateRaw []byte + ) + + BeforeEach(func() { + fakeGardenClient = fakeclient.NewClientBuilder().WithScheme(kubernetes.GardenScheme).Build() + + shoot = &gardencorev1beta1.Shoot{ObjectMeta: metav1.ObjectMeta{Name: "bar", Namespace: "foo"}} + shootState = &gardencorev1beta1.ShootState{ObjectMeta: metav1.ObjectMeta{Name: shoot.Name, Namespace: shoot.Namespace}} + worker = &extensionsv1alpha1.Worker{ObjectMeta: metav1.ObjectMeta{Namespace: "shoot--foo--bar"}} + wantedMachineDeployments = []extensionsworkercontroller.MachineDeployment{ + {Name: "deploy1"}, + {Name: "deploy2"}, + {Name: "deploy3"}, + } + + var err error + machineStateRaw, err = json.Marshal(machineState) + Expect(err).NotTo(HaveOccurred()) + + Expect(fakeGardenClient.Create(ctx, shootState)).To(Succeed()) + }) + + It("should do nothing because neither machine state exists in ShootState nor .status.state field is set", func() { + Expect(addStateToMachineDeployment(ctx, log, fakeGardenClient, shoot, worker, wantedMachineDeployments)).To(Succeed()) + + Expect(wantedMachineDeployments[0].State).To(BeNil()) + Expect(wantedMachineDeployments[1].State).To(BeNil()) + Expect(wantedMachineDeployments[2].State).To(BeNil()) + }) + + It("should fetch the machine state from the ShootState", func() { + patch := client.MergeFrom(shootState.DeepCopy()) + shootState.Spec = gardencorev1beta1.ShootStateSpec{ + Gardener: []gardencorev1beta1.GardenerResourceData{{ + Name: "machine-state", + Type: "machine-state", + Data: runtime.RawExtension{Raw: machineStateRaw}, + }}, + } + Expect(fakeGardenClient.Patch(ctx, shootState, patch)).To(Succeed()) + + Expect(addStateToMachineDeployment(ctx, log, fakeGardenClient, shoot, worker, wantedMachineDeployments)).To(Succeed()) + + Expect(wantedMachineDeployments[0].State).To(Equal(stateDeployment1)) + Expect(wantedMachineDeployments[1].State).To(Equal(stateDeployment2)) + Expect(wantedMachineDeployments[2].State).To(BeNil()) + }) + + It("should fetch the state from the Worker's .status.state field when machine state does not exist in ShootState", func() { + worker.Status.State = &runtime.RawExtension{Raw: machineStateRaw} + + Expect(addStateToMachineDeployment(ctx, log, fakeGardenClient, shoot, worker, wantedMachineDeployments)).To(Succeed()) + + Expect(wantedMachineDeployments[0].State).To(Equal(stateDeployment1)) + Expect(wantedMachineDeployments[1].State).To(Equal(stateDeployment2)) + Expect(wantedMachineDeployments[2].State).To(BeNil()) + }) + }) +}) diff --git a/extensions/pkg/controller/worker/genericactuator/actuator_test.go b/extensions/pkg/controller/worker/genericactuator/actuator_test.go index f61c501779f..dc2bf618662 100644 --- a/extensions/pkg/controller/worker/genericactuator/actuator_test.go +++ b/extensions/pkg/controller/worker/genericactuator/actuator_test.go @@ -30,8 +30,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log" "github.com/gardener/gardener/extensions/pkg/controller/worker" - extensionsworkerhelper "github.com/gardener/gardener/extensions/pkg/controller/worker/helper" mockclient "github.com/gardener/gardener/pkg/mock/controller-runtime/client" + "github.com/gardener/gardener/pkg/utils/gardener/shootstate" ) var _ = Describe("Actuator", func() { @@ -72,7 +72,7 @@ var _ = Describe("Actuator", func() { }) It("should return secrets matching the label selector", func() { - a := &genericActuator{client: fake.NewClientBuilder().WithRuntimeObjects(all...).Build()} + a := &genericActuator{seedClient: fake.NewClientBuilder().WithRuntimeObjects(all...).Build()} actual, err := a.listMachineClassSecrets(context.TODO(), ns) Expect(err).ToNot(HaveOccurred()) @@ -84,14 +84,14 @@ var _ = Describe("Actuator", func() { Describe("#removeWantedDeploymentWithoutState", func() { var ( mdWithoutState = worker.MachineDeployment{ClassName: "gcp", Name: "md-without-state"} - mdWithStateAndMachineSets = worker.MachineDeployment{ClassName: "gcp", Name: "md-with-state-machinesets", State: &worker.MachineDeploymentState{Replicas: 1, MachineSets: []machinev1alpha1.MachineSet{ + mdWithStateAndMachineSets = worker.MachineDeployment{ClassName: "gcp", Name: "md-with-state-machinesets", State: &shootstate.MachineDeploymentState{Replicas: 1, MachineSets: []machinev1alpha1.MachineSet{ { ObjectMeta: metav1.ObjectMeta{ Name: "machineSet", }, }, }}} - mdWithEmptyState = worker.MachineDeployment{ClassName: "gcp", Name: "md-with-state", State: &worker.MachineDeploymentState{Replicas: 1, MachineSets: []machinev1alpha1.MachineSet{}}} + mdWithEmptyState = worker.MachineDeployment{ClassName: "gcp", Name: "md-with-state", State: &shootstate.MachineDeploymentState{Replicas: 1, MachineSets: []machinev1alpha1.MachineSet{}}} ) It("should not panic for MachineDeployments without state", func() { @@ -128,7 +128,7 @@ var _ = Describe("Actuator", func() { Describe("#isMachineControllerStuck", func() { var ( machineDeploymentName = "machine-deployment-1" - machineDeploymentOwnerReference = []metav1.OwnerReference{{Name: machineDeploymentName, Kind: extensionsworkerhelper.MachineDeploymentKind}} + machineDeploymentOwnerReference = []metav1.OwnerReference{{Name: machineDeploymentName, Kind: "MachineDeployment"}} machineClassName = "machine-class-new" machineDeploymentSpec = machinev1alpha1.MachineDeploymentSpec{ @@ -245,7 +245,7 @@ var _ = Describe("Actuator", func() { mockCtrl = gomock.NewController(GinkgoT()) mockClient = mockclient.NewMockClient(mockCtrl) - a = &genericActuator{client: mockClient} + a = &genericActuator{seedClient: mockClient} expectedMachineSet = machinev1alpha1.MachineSet{ ObjectMeta: metav1.ObjectMeta{ @@ -276,7 +276,7 @@ var _ = Describe("Actuator", func() { machineDeployments = worker.MachineDeployments{ { - State: &worker.MachineDeploymentState{ + State: &shootstate.MachineDeploymentState{ Replicas: 2, MachineSets: []machinev1alpha1.MachineSet{ expectedMachineSet, @@ -299,7 +299,7 @@ var _ = Describe("Actuator", func() { mockClient.EXPECT().Create(ctx, &expectedMachine1) mockClient.EXPECT().Create(ctx, &expectedMachine2) - Expect(restoreMachineSetsAndMachines(ctx, logger, a.client, machineDeployments)).To(Succeed()) + Expect(restoreMachineSetsAndMachines(ctx, logger, a.seedClient, machineDeployments)).To(Succeed()) }) It("should not return error if machineset and machines already exist", func() { @@ -307,7 +307,7 @@ var _ = Describe("Actuator", func() { mockClient.EXPECT().Create(ctx, &expectedMachine1).Return(alreadyExistsError) mockClient.EXPECT().Create(ctx, &expectedMachine2).Return(alreadyExistsError) - Expect(restoreMachineSetsAndMachines(ctx, logger, a.client, machineDeployments)).To(Succeed()) + Expect(restoreMachineSetsAndMachines(ctx, logger, a.seedClient, machineDeployments)).To(Succeed()) }) }) }) diff --git a/extensions/pkg/controller/worker/genericactuator/interface.go b/extensions/pkg/controller/worker/genericactuator/interface.go index c4924c68d6b..335989fe01f 100644 --- a/extensions/pkg/controller/worker/genericactuator/interface.go +++ b/extensions/pkg/controller/worker/genericactuator/interface.go @@ -17,8 +17,6 @@ package genericactuator import ( "context" - "sigs.k8s.io/controller-runtime/pkg/client" - extensionscontroller "github.com/gardener/gardener/extensions/pkg/controller" "github.com/gardener/gardener/extensions/pkg/controller/worker" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" @@ -33,12 +31,6 @@ type WorkerDelegate interface { // that are required by the machine-controller-manager inside the shoot cluster itself. GetMachineControllerManagerShootChartValues(context.Context) (map[string]interface{}, error) - // MachineClassKind yields the name of the provider specific machine class. - MachineClassKind() string - // MachineClass yields a newly initialized machine class object. - MachineClass() client.Object - // MachineClassList yields a newly initialized machine class list object. - MachineClassList() client.ObjectList // DeployMachineClasses generates and creates the provider specific machine classes. DeployMachineClasses(context.Context) error diff --git a/extensions/pkg/controller/worker/genericactuator/machine_controller_manager.go b/extensions/pkg/controller/worker/genericactuator/machine_controller_manager.go index b3839a3de36..5f9ae70e4aa 100644 --- a/extensions/pkg/controller/worker/genericactuator/machine_controller_manager.go +++ b/extensions/pkg/controller/worker/genericactuator/machine_controller_manager.go @@ -49,10 +49,10 @@ type ReplicaCount func() int32 func (a *genericActuator) deployMachineControllerManager(ctx context.Context, logger logr.Logger, workerObj *extensionsv1alpha1.Worker, cluster *extensionscontroller.Cluster, workerDelegate WorkerDelegate, replicas ReplicaCount) error { if !a.mcmManaged { logger.Info("Skip machine-controller-manager deployment since gardenlet manages it - deleting monitoring ConfigMap and extension-worker-mcm-shoot ManagedResource") - if err := a.client.Delete(ctx, &corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: "machine-controller-manager-monitoring-config", Namespace: workerObj.Namespace}}); client.IgnoreNotFound(err) != nil { + if err := a.seedClient.Delete(ctx, &corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: "machine-controller-manager-monitoring-config", Namespace: workerObj.Namespace}}); client.IgnoreNotFound(err) != nil { return err } - return managedresources.Delete(ctx, a.client, workerObj.Namespace, McmShootResourceName, false) + return managedresources.Delete(ctx, a.seedClient, workerObj.Namespace, McmShootResourceName, false) } logger.Info("Deploying the machine-controller-manager") @@ -65,7 +65,7 @@ func (a *genericActuator) deployMachineControllerManager(ctx context.Context, lo mcmValues["useTokenRequestor"] = true mcmValues["useProjectedTokenMount"] = true - if err := gardenerutils.NewShootAccessSecret(a.mcmName, workerObj.Namespace).Reconcile(ctx, a.client); err != nil { + if err := gardenerutils.NewShootAccessSecret(a.mcmName, workerObj.Namespace).Reconcile(ctx, a.seedClient); err != nil { return err } mcmValues["genericTokenKubeconfigSecretName"] = extensionscontroller.GenericTokenKubeconfigSecretNameFromCluster(cluster) @@ -83,7 +83,7 @@ func (a *genericActuator) deployMachineControllerManager(ctx context.Context, lo } logger.Info("Waiting until rollout of machine-controller-manager Deployment is completed") - if err := kubernetes.WaitUntilDeploymentRolloutIsComplete(ctx, a.client, workerObj.Namespace, McmDeploymentName, 5*time.Second, 300*time.Second); err != nil { + if err := kubernetes.WaitUntilDeploymentRolloutIsComplete(ctx, a.seedClient, workerObj.Namespace, McmDeploymentName, 5*time.Second, 300*time.Second); err != nil { return fmt.Errorf("waiting until deployment/%s is updated: %w", McmDeploymentName, err) } @@ -93,36 +93,36 @@ func (a *genericActuator) deployMachineControllerManager(ctx context.Context, lo func (a *genericActuator) deleteMachineControllerManager(ctx context.Context, logger logr.Logger, workerObj *extensionsv1alpha1.Worker) error { if !a.mcmManaged { logger.Info("Skip machine-controller-manager deletion since gardenlet manages it - deleting monitoring ConfigMap and extension-worker-mcm-shoot ManagedResource") - if err := a.client.Delete(ctx, &corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: "machine-controller-manager-monitoring-config", Namespace: workerObj.Namespace}}); client.IgnoreNotFound(err) != nil { + if err := a.seedClient.Delete(ctx, &corev1.ConfigMap{ObjectMeta: metav1.ObjectMeta{Name: "machine-controller-manager-monitoring-config", Namespace: workerObj.Namespace}}); client.IgnoreNotFound(err) != nil { return err } - return managedresources.Delete(ctx, a.client, workerObj.Namespace, McmShootResourceName, false) + return managedresources.Delete(ctx, a.seedClient, workerObj.Namespace, McmShootResourceName, false) } logger.Info("Deleting the machine-controller-manager") - if err := managedresources.Delete(ctx, a.client, workerObj.Namespace, McmShootResourceName, false); err != nil { + if err := managedresources.Delete(ctx, a.seedClient, workerObj.Namespace, McmShootResourceName, false); err != nil { return fmt.Errorf("could not delete managed resource containing mcm chart for worker '%s': %w", kubernetesutils.ObjectName(workerObj), err) } logger.Info("Waiting for machine-controller-manager ManagedResource to be deleted") timeoutCtx, cancel := context.WithTimeout(ctx, 2*time.Minute) defer cancel() - if err := managedresources.WaitUntilDeleted(timeoutCtx, a.client, workerObj.Namespace, McmShootResourceName); err != nil { + if err := managedresources.WaitUntilDeleted(timeoutCtx, a.seedClient, workerObj.Namespace, McmShootResourceName); err != nil { return fmt.Errorf("error while waiting for managed resource containing mcm for '%s' to be deleted: %w", kubernetesutils.ObjectName(workerObj), err) } - if err := a.mcmSeedChart.Delete(ctx, a.client, workerObj.Namespace); err != nil { + if err := a.mcmSeedChart.Delete(ctx, a.seedClient, workerObj.Namespace); err != nil { return fmt.Errorf("cleaning up machine-controller-manager resources in seed failed: %w", err) } - return kubernetesutils.DeleteObject(ctx, a.client, &corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: "shoot-access-" + a.mcmName, Namespace: workerObj.Namespace}}) + return kubernetesutils.DeleteObject(ctx, a.seedClient, &corev1.Secret{ObjectMeta: metav1.ObjectMeta{Name: "shoot-access-" + a.mcmName, Namespace: workerObj.Namespace}}) } func (a *genericActuator) waitUntilMachineControllerManagerIsDeleted(ctx context.Context, logger logr.Logger, namespace string) error { logger.Info("Waiting until machine-controller-manager is deleted") return wait.PollUntil(5*time.Second, func() (bool, error) { machineControllerManagerDeployment := &appsv1.Deployment{} - if err := a.client.Get(ctx, client.ObjectKey{Namespace: namespace, Name: McmDeploymentName}, machineControllerManagerDeployment); err != nil { + if err := a.seedClient.Get(ctx, client.ObjectKey{Namespace: namespace, Name: McmDeploymentName}, machineControllerManagerDeployment); err != nil { if apierrors.IsNotFound(err) { return true, nil } @@ -158,7 +158,7 @@ func (a *genericActuator) applyMachineControllerManagerShootChart(ctx context.Co values["useTokenRequestor"] = true - if err := managedresources.RenderChartAndCreate(ctx, workerObj.Namespace, McmShootResourceName, false, a.client, chartRenderer, a.mcmShootChart, values, a.imageVector, metav1.NamespaceSystem, cluster.Shoot.Spec.Kubernetes.Version, true, false); err != nil { + if err := managedresources.RenderChartAndCreate(ctx, workerObj.Namespace, McmShootResourceName, false, a.seedClient, chartRenderer, a.mcmShootChart, values, a.imageVector, metav1.NamespaceSystem, cluster.Shoot.Spec.Kubernetes.Version, true, false); err != nil { return fmt.Errorf("could not apply control plane shoot chart for worker '%s': %w", kubernetesutils.ObjectName(workerObj), err) } diff --git a/extensions/pkg/controller/worker/helper/helper.go b/extensions/pkg/controller/worker/helper/helper.go index 355ade13fcd..777abbcf555 100644 --- a/extensions/pkg/controller/worker/helper/helper.go +++ b/extensions/pkg/controller/worker/helper/helper.go @@ -24,54 +24,6 @@ import ( errorsutils "github.com/gardener/gardener/pkg/utils/errors" ) -const ( - nameLabel = "name" - // MachineSetKind is the kind of the owner reference of a machine set - MachineSetKind = "MachineSet" - // MachineDeploymentKind is the kind of the owner reference of a machine deployment - MachineDeploymentKind = "MachineDeployment" -) - -// BuildOwnerToMachinesMap builds a map from a slice of machinev1alpha1.Machine, that maps the owner reference -// to a slice of machines with the same owner reference -func BuildOwnerToMachinesMap(machines []machinev1alpha1.Machine) map[string][]machinev1alpha1.Machine { - ownerToMachines := make(map[string][]machinev1alpha1.Machine) - for index, machine := range machines { - if len(machine.OwnerReferences) > 0 { - for _, reference := range machine.OwnerReferences { - if reference.Kind == MachineSetKind { - ownerToMachines[reference.Name] = append(ownerToMachines[reference.Name], machines[index]) - } - } - } else if len(machine.Labels) > 0 { - if machineDeploymentName, ok := machine.Labels[nameLabel]; ok { - ownerToMachines[machineDeploymentName] = append(ownerToMachines[machineDeploymentName], machines[index]) - } - } - } - return ownerToMachines -} - -// BuildOwnerToMachineSetsMap builds a map from a slice of machinev1alpha1.MachineSet, that maps the owner reference -// to a slice of MachineSets with the same owner reference -func BuildOwnerToMachineSetsMap(machineSets []machinev1alpha1.MachineSet) map[string][]machinev1alpha1.MachineSet { - ownerToMachineSets := make(map[string][]machinev1alpha1.MachineSet) - for index, machineSet := range machineSets { - if len(machineSet.OwnerReferences) > 0 { - for _, reference := range machineSet.OwnerReferences { - if reference.Kind == MachineDeploymentKind { - ownerToMachineSets[reference.Name] = append(ownerToMachineSets[reference.Name], machineSets[index]) - } - } - } else if len(machineSet.Labels) > 0 { - if machineDeploymentName, ok := machineSet.Labels[nameLabel]; ok { - ownerToMachineSets[machineDeploymentName] = append(ownerToMachineSets[machineDeploymentName], machineSets[index]) - } - } - } - return ownerToMachineSets -} - // GetMachineSetWithMachineClass checks if for the given , there exists a machine set in the with the machine class // returns the machine set or nil func GetMachineSetWithMachineClass(machineDeploymentName, machineClassName string, ownerReferenceToMachineSet map[string][]machinev1alpha1.MachineSet) *machinev1alpha1.MachineSet { diff --git a/extensions/pkg/controller/worker/helper/helper_test.go b/extensions/pkg/controller/worker/helper/helper_test.go index d4658c613e7..73102188c44 100644 --- a/extensions/pkg/controller/worker/helper/helper_test.go +++ b/extensions/pkg/controller/worker/helper/helper_test.go @@ -20,113 +20,13 @@ import ( . "github.com/onsi/gomega" . "github.com/onsi/gomega/gstruct" gomegatypes "github.com/onsi/gomega/types" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) var _ = Describe("Helper Tests", func() { - machineSetName := "machine-set-1" - machineDeploymentName := "machine-deployment-1" var ( - machineSetReference = machinev1alpha1.Machine{ - ObjectMeta: metav1.ObjectMeta{ - OwnerReferences: []metav1.OwnerReference{ - { - Kind: MachineSetKind, - Name: machineSetName, - }, - }, - }, - } - - machineDeploymentReference = machinev1alpha1.Machine{ - ObjectMeta: metav1.ObjectMeta{ - OwnerReferences: []metav1.OwnerReference{ - { - Kind: MachineDeploymentKind, - Name: machineDeploymentName, - }, - }, - }, - } - - machineLabelReference = machinev1alpha1.Machine{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{ - nameLabel: machineDeploymentName, - }, - }, - } - ) - - DescribeTable("#BuildOwnerToMachinesMap", func(machines []machinev1alpha1.Machine, expected map[string][]machinev1alpha1.Machine) { - result := BuildOwnerToMachinesMap(machines) - Expect(result).To(Equal(expected)) - }, - Entry("should map using reference kind = `MachineSet`", []machinev1alpha1.Machine{machineSetReference, machineLabelReference}, map[string][]machinev1alpha1.Machine{ - machineSetName: {machineSetReference}, machineDeploymentName: {machineLabelReference}, - }), - - Entry("should map using label with key `name`", []machinev1alpha1.Machine{machineLabelReference}, map[string][]machinev1alpha1.Machine{ - machineDeploymentName: {machineLabelReference}, - }), - - Entry("should not consider machines with machine deployment reference", []machinev1alpha1.Machine{machineSetReference, machineDeploymentReference, machineLabelReference}, map[string][]machinev1alpha1.Machine{ - machineSetName: {machineSetReference}, machineDeploymentName: {machineLabelReference}, - }), - ) - - var ( - machineSetWithOwnerReference = machinev1alpha1.MachineSet{ - ObjectMeta: metav1.ObjectMeta{ - OwnerReferences: []metav1.OwnerReference{ - { - Kind: MachineDeploymentKind, - Name: machineDeploymentName, - }, - }, - }, - } - - machineSetWithWrongOwnerReference = machinev1alpha1.MachineSet{ - ObjectMeta: metav1.ObjectMeta{ - OwnerReferences: []metav1.OwnerReference{ - { - Kind: MachineSetKind, - Name: machineDeploymentName, - }, - }, - }, - } - - machineSetWithLabelReference = machinev1alpha1.MachineSet{ - ObjectMeta: metav1.ObjectMeta{ - Labels: map[string]string{ - nameLabel: machineDeploymentName, - }, - }, - } - ) - - DescribeTable("#BuildOwnerToMachineSetsMap", func(machines []machinev1alpha1.MachineSet, expected map[string][]machinev1alpha1.MachineSet) { - result := BuildOwnerToMachineSetsMap(machines) - Expect(result).To(Equal(expected)) - }, - Entry("should map using reference kind = `MachineDeployment", []machinev1alpha1.MachineSet{machineSetWithOwnerReference}, map[string][]machinev1alpha1.MachineSet{ - machineDeploymentName: {machineSetWithOwnerReference}, - }), - - Entry("should map using label with key `name`", []machinev1alpha1.MachineSet{machineSetWithLabelReference}, map[string][]machinev1alpha1.MachineSet{ - machineDeploymentName: {machineSetWithLabelReference}, - }), - - Entry("should not consider machines with machine set reference", []machinev1alpha1.MachineSet{machineSetWithOwnerReference, machineSetWithLabelReference, machineSetWithWrongOwnerReference}, map[string][]machinev1alpha1.MachineSet{ - machineDeploymentName: {machineSetWithOwnerReference, machineSetWithLabelReference}, - }), - ) - - var ( - machineClassName = "test-machine-class" - expectedMachineSet = machinev1alpha1.MachineSet{Spec: machinev1alpha1.MachineSetSpec{ + machineDeploymentName = "machine-deployment-1" + machineClassName = "test-machine-class" + expectedMachineSet = machinev1alpha1.MachineSet{Spec: machinev1alpha1.MachineSetSpec{ Template: machinev1alpha1.MachineTemplateSpec{ Spec: machinev1alpha1.MachineSpec{ Class: machinev1alpha1.ClassSpec{ diff --git a/extensions/pkg/controller/worker/machines.go b/extensions/pkg/controller/worker/machines.go index 4de306e5b06..63c15f4572c 100644 --- a/extensions/pkg/controller/worker/machines.go +++ b/extensions/pkg/controller/worker/machines.go @@ -30,6 +30,7 @@ import ( "github.com/gardener/gardener/pkg/apis/core/v1beta1/helper" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "github.com/gardener/gardener/pkg/utils" + "github.com/gardener/gardener/pkg/utils/gardener/shootstate" ) var diskSizeRegex = regexp.MustCompile(`^(\d+)`) @@ -47,26 +48,13 @@ type MachineDeployment struct { Labels map[string]string Annotations map[string]string Taints []corev1.Taint - State *MachineDeploymentState + State *shootstate.MachineDeploymentState MachineConfiguration *machinev1alpha1.MachineConfiguration } // MachineDeployments is a list of machine deployments. type MachineDeployments []MachineDeployment -// MachineDeploymentState stores the last versions of the machine sets and machine which -// the machine deployment corresponds -type MachineDeploymentState struct { - Replicas int32 `json:"replicas,omitempty"` - MachineSets []machinev1alpha1.MachineSet `json:"machineSets,omitempty"` - Machines []machinev1alpha1.Machine `json:"machines,omitempty"` -} - -// State represent the last known state of a Worker -type State struct { - MachineDeployments map[string]*MachineDeploymentState `json:"machineDeployments,omitempty"` -} - // HasDeployment checks whether the is part of the // list, i.e. whether there is an entry whose 'Name' attribute matches . It returns true or false. func (m MachineDeployments) HasDeployment(name string) bool { diff --git a/extensions/pkg/controller/worker/mapper.go b/extensions/pkg/controller/worker/mapper.go index fba76d6ed13..e21da3e59bf 100644 --- a/extensions/pkg/controller/worker/mapper.go +++ b/extensions/pkg/controller/worker/mapper.go @@ -15,19 +15,12 @@ package worker import ( - "context" - "time" - - machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" - "github.com/go-logr/logr" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/manager" "sigs.k8s.io/controller-runtime/pkg/predicate" - "sigs.k8s.io/controller-runtime/pkg/reconcile" extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "github.com/gardener/gardener/pkg/controllerutils/mapper" - predicateutils "github.com/gardener/gardener/pkg/controllerutils/predicate" ) // ClusterToWorkerMapper returns a mapper that returns requests for Worker whose @@ -35,72 +28,3 @@ import ( func ClusterToWorkerMapper(mgr manager.Manager, predicates []predicate.Predicate) mapper.Mapper { return mapper.ClusterToObjectMapper(mgr, func() client.ObjectList { return &extensionsv1alpha1.WorkerList{} }, predicates) } - -// MachineSetToWorkerMapper returns a mapper that returns requests for Worker whose -// referenced MachineSets have been modified. -func MachineSetToWorkerMapper(predicates []predicate.Predicate) mapper.Mapper { - return newMachineSetToObjectMapper(func() client.ObjectList { return &extensionsv1alpha1.WorkerList{} }, predicates) -} - -// MachineToWorkerMapper returns a mapper that returns requests for Worker whose -// referenced Machines have been modified. -func MachineToWorkerMapper(predicates []predicate.Predicate) mapper.Mapper { - return newMachineToObjectMapper(func() client.ObjectList { return &extensionsv1alpha1.WorkerList{} }, predicates) -} - -type machineSetToObjectMapper struct { - newObjListFunc func() client.ObjectList - predicates []predicate.Predicate -} - -func (m *machineSetToObjectMapper) Map(ctx context.Context, _ logr.Logger, reader client.Reader, obj client.Object) []reconcile.Request { - machineSet, ok := obj.(*machinev1alpha1.MachineSet) - if !ok { - return nil - } - - objList := m.newObjListFunc() - if err := reader.List(ctx, objList, client.InNamespace(machineSet.Namespace)); err != nil { - return nil - } - - return mapper.ObjectListToRequests(objList, func(o client.Object) bool { - return predicateutils.EvalGeneric(o, m.predicates...) - }) -} - -// newMachineSetToObjectMapper returns a mapper that returns requests for objects whose -// referenced MachineSets have been modified. -func newMachineSetToObjectMapper(newObjListFunc func() client.ObjectList, predicates []predicate.Predicate) mapper.Mapper { - return &machineSetToObjectMapper{newObjListFunc: newObjListFunc, predicates: predicates} -} - -type machineToObjectMapper struct { - newObjListFunc func() client.ObjectList - predicates []predicate.Predicate -} - -func (m *machineToObjectMapper) Map(ctx context.Context, _ logr.Logger, reader client.Reader, obj client.Object) []reconcile.Request { - ctx, cancel := context.WithTimeout(ctx, 5*time.Second) - defer cancel() - - machine, ok := obj.(*machinev1alpha1.Machine) - if !ok { - return nil - } - - objList := m.newObjListFunc() - if err := reader.List(ctx, objList, client.InNamespace(machine.Namespace)); err != nil { - return nil - } - - return mapper.ObjectListToRequests(objList, func(o client.Object) bool { - return predicateutils.EvalGeneric(o, m.predicates...) - }) -} - -// newMachineToObjectMapper returns a mapper that returns requests for objects whose -// referenced Machines have been modified. -func newMachineToObjectMapper(newObjListFunc func() client.ObjectList, predicates []predicate.Predicate) mapper.Mapper { - return &machineToObjectMapper{newObjListFunc: newObjListFunc, predicates: predicates} -} diff --git a/extensions/pkg/controller/worker/mapper_test.go b/extensions/pkg/controller/worker/mapper_test.go deleted file mode 100644 index 5579f40e29b..00000000000 --- a/extensions/pkg/controller/worker/mapper_test.go +++ /dev/null @@ -1,281 +0,0 @@ -// Copyright 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// 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 worker_test - -import ( - "context" - - machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" - "github.com/go-logr/logr" - . "github.com/onsi/ginkgo/v2" - . "github.com/onsi/gomega" - "go.uber.org/mock/gomock" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/event" - "sigs.k8s.io/controller-runtime/pkg/predicate" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - "github.com/gardener/gardener/extensions/pkg/controller/worker" - extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" - mockclient "github.com/gardener/gardener/pkg/mock/controller-runtime/client" -) - -var _ = Describe("Worker Mapper", func() { - var ( - ctx = context.TODO() - ctrl *gomock.Controller - c *mockclient.MockClient - ) - - BeforeEach(func() { - ctrl = gomock.NewController(GinkgoT()) - c = mockclient.NewMockClient(ctrl) - }) - - AfterEach(func() { - ctrl.Finish() - }) - - Describe("#MachineSetToWorkerMapper", func() { - var ( - resourceName = "machineSet" - namespace = "shoot" - ) - - It("should find all objects for the passed worker", func() { - mapper := worker.MachineSetToWorkerMapper(nil) - - c.EXPECT(). - List( - gomock.Any(), - gomock.AssignableToTypeOf(&extensionsv1alpha1.WorkerList{}), - gomock.AssignableToTypeOf(client.InNamespace(namespace)), - ). - DoAndReturn(func(_ context.Context, actual *extensionsv1alpha1.WorkerList, _ ...client.ListOption) error { - *actual = extensionsv1alpha1.WorkerList{ - Items: []extensionsv1alpha1.Worker{ - { - ObjectMeta: metav1.ObjectMeta{ - Name: resourceName, - Namespace: namespace, - }, - }, - }, - } - return nil - }) - - result := mapper.Map(ctx, logr.Discard(), c, &machinev1alpha1.MachineSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: namespace, - }, - }) - - Expect(result).To(ConsistOf(reconcile.Request{ - NamespacedName: types.NamespacedName{ - Name: resourceName, - Namespace: namespace, - }, - })) - }) - - It("should find no objects for the passed cluster because predicates do not match", func() { - var ( - predicates = []predicate.Predicate{ - predicate.Funcs{ - GenericFunc: func(event event.GenericEvent) bool { - return false - }, - }, - } - mapper = worker.MachineSetToWorkerMapper(predicates) - ) - - c.EXPECT(). - List( - gomock.Any(), - gomock.AssignableToTypeOf(&extensionsv1alpha1.WorkerList{}), - gomock.AssignableToTypeOf(client.InNamespace(namespace)), - ). - DoAndReturn(func(_ context.Context, actual *extensionsv1alpha1.WorkerList, _ ...client.ListOption) error { - *actual = extensionsv1alpha1.WorkerList{ - Items: []extensionsv1alpha1.Worker{ - { - ObjectMeta: metav1.ObjectMeta{ - Name: resourceName, - Namespace: namespace, - }, - }, - }, - } - return nil - }) - - result := mapper.Map(ctx, logr.Discard(), c, &machinev1alpha1.MachineSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: namespace, - }, - }) - - Expect(result).To(BeEmpty()) - }) - - It("should find no objects because list is empty", func() { - mapper := worker.MachineSetToWorkerMapper(nil) - - c.EXPECT(). - List( - gomock.Any(), - gomock.AssignableToTypeOf(&extensionsv1alpha1.WorkerList{}), - gomock.AssignableToTypeOf(client.InNamespace(namespace)), - ). - DoAndReturn(func(_ context.Context, actual *extensionsv1alpha1.WorkerList, _ ...client.ListOption) error { - *actual = extensionsv1alpha1.WorkerList{} - return nil - }) - - result := mapper.Map(ctx, logr.Discard(), c, &machinev1alpha1.MachineSet{ - ObjectMeta: metav1.ObjectMeta{ - Name: namespace, - }, - }) - - Expect(result).To(BeEmpty()) - }) - - It("should find no objects because the passed object is no worker", func() { - mapper := worker.MachineSetToWorkerMapper(nil) - result := mapper.Map(ctx, logr.Discard(), c, &extensionsv1alpha1.Cluster{}) - Expect(result).To(BeNil()) - }) - }) - - Describe("#MachineToWorkerMapper", func() { - var ( - resourceName = "machineSet" - namespace = "shoot" - ) - - It("should find all objects for the passed worker", func() { - mapper := worker.MachineToWorkerMapper(nil) - - c.EXPECT(). - List( - gomock.Any(), - gomock.AssignableToTypeOf(&extensionsv1alpha1.WorkerList{}), - gomock.AssignableToTypeOf(client.InNamespace(namespace)), - ). - DoAndReturn(func(_ context.Context, actual *extensionsv1alpha1.WorkerList, _ ...client.ListOption) error { - *actual = extensionsv1alpha1.WorkerList{ - Items: []extensionsv1alpha1.Worker{ - { - ObjectMeta: metav1.ObjectMeta{ - Name: resourceName, - Namespace: namespace, - }, - }, - }, - } - return nil - }) - - result := mapper.Map(ctx, logr.Discard(), c, &machinev1alpha1.Machine{ - ObjectMeta: metav1.ObjectMeta{ - Name: namespace, - }, - }) - - Expect(result).To(ConsistOf(reconcile.Request{ - NamespacedName: types.NamespacedName{ - Name: resourceName, - Namespace: namespace, - }, - })) - }) - - It("should find no objects for the passed cluster because predicates do not match", func() { - var ( - predicates = []predicate.Predicate{ - predicate.Funcs{ - GenericFunc: func(event event.GenericEvent) bool { - return false - }, - }, - } - mapper = worker.MachineToWorkerMapper(predicates) - ) - - c.EXPECT(). - List( - gomock.Any(), - gomock.AssignableToTypeOf(&extensionsv1alpha1.WorkerList{}), - gomock.AssignableToTypeOf(client.InNamespace(namespace)), - ). - DoAndReturn(func(_ context.Context, actual *extensionsv1alpha1.WorkerList, _ ...client.ListOption) error { - *actual = extensionsv1alpha1.WorkerList{ - Items: []extensionsv1alpha1.Worker{ - { - ObjectMeta: metav1.ObjectMeta{ - Name: resourceName, - Namespace: namespace, - }, - }, - }, - } - return nil - }) - - result := mapper.Map(ctx, logr.Discard(), c, &machinev1alpha1.Machine{ - ObjectMeta: metav1.ObjectMeta{ - Name: namespace, - }, - }) - - Expect(result).To(BeEmpty()) - }) - - It("should find no objects because list is empty", func() { - mapper := worker.MachineToWorkerMapper(nil) - - c.EXPECT(). - List( - gomock.Any(), - gomock.AssignableToTypeOf(&extensionsv1alpha1.WorkerList{}), - gomock.AssignableToTypeOf(client.InNamespace(namespace)), - ). - DoAndReturn(func(_ context.Context, actual *extensionsv1alpha1.WorkerList, _ ...client.ListOption) error { - *actual = extensionsv1alpha1.WorkerList{} - return nil - }) - - result := mapper.Map(ctx, logr.Discard(), c, &machinev1alpha1.Machine{ - ObjectMeta: metav1.ObjectMeta{ - Name: namespace, - }, - }) - - Expect(result).To(BeEmpty()) - }) - - It("should find no objects because the passed object is no worker", func() { - mapper := worker.MachineToWorkerMapper(nil) - - result := mapper.Map(ctx, logr.Discard(), c, &extensionsv1alpha1.Cluster{}) - Expect(result).To(BeNil()) - }) - }) -}) diff --git a/extensions/pkg/controller/worker/predicate.go b/extensions/pkg/controller/worker/predicate.go index c560894cd33..b7b10a6bf55 100644 --- a/extensions/pkg/controller/worker/predicate.go +++ b/extensions/pkg/controller/worker/predicate.go @@ -19,8 +19,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/event" "sigs.k8s.io/controller-runtime/pkg/predicate" - - "github.com/gardener/gardener/pkg/api/extensions" ) // MachineNodeInfoHasChanged is a predicate deciding whether the information about the backing node of a Machine has @@ -56,20 +54,3 @@ func MachineNodeInfoHasChanged() predicate.Predicate { }, } } - -// WorkerSkipStateUpdateAnnotation is a Worker annotation that instructs the worker-state controller to do not reconcile the corresponding Worker. -const WorkerSkipStateUpdateAnnotation = "worker.gardener.cloud/skip-state-update" - -// WorkerStateUpdateIsNotSkipped is a predicate deciding whether the Worker is not annotated to skip state updates. -func WorkerStateUpdateIsNotSkipped() predicate.Predicate { - return predicate.NewPredicateFuncs(func(obj client.Object) bool { - acc, err := extensions.Accessor(obj) - if err != nil { - // We assume by default that the Worker is not annotated to skip state updates. - return true - } - - _, found := acc.GetAnnotations()[WorkerSkipStateUpdateAnnotation] - return !found - }) -} diff --git a/extensions/pkg/controller/worker/predicate_test.go b/extensions/pkg/controller/worker/predicate_test.go index 09f1ac66dd9..e97023ed26d 100644 --- a/extensions/pkg/controller/worker/predicate_test.go +++ b/extensions/pkg/controller/worker/predicate_test.go @@ -19,11 +19,9 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/event" "github.com/gardener/gardener/extensions/pkg/controller/worker" - extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" ) var _ = Describe("Worker Predicates", func() { @@ -91,53 +89,4 @@ var _ = Describe("Worker Predicates", func() { Expect(predicate.Generic(genericEvent)).To(BeFalse()) }) }) - - Describe("#WorkerStateUpdateIsNotSkipped", func() { - var ( - object client.Object - createEvent event.CreateEvent - updateEvent event.UpdateEvent - deleteEvent event.DeleteEvent - genericEvent event.GenericEvent - ) - - BeforeEach(func() { - object = &extensionsv1alpha1.Worker{} - createEvent = event.CreateEvent{ - Object: object, - } - updateEvent = event.UpdateEvent{ - ObjectOld: object, - ObjectNew: object, - } - deleteEvent = event.DeleteEvent{ - Object: object, - } - genericEvent = event.GenericEvent{ - Object: object, - } - }) - - It("should be true for a worker without the worker.gardener.cloud/skip-state-update annotation", func() { - predicate := worker.WorkerStateUpdateIsNotSkipped() - - Expect(predicate.Create(createEvent)).To(BeTrue()) - Expect(predicate.Update(updateEvent)).To(BeTrue()) - Expect(predicate.Delete(deleteEvent)).To(BeTrue()) - Expect(predicate.Generic(genericEvent)).To(BeTrue()) - }) - - It("should be false for a worker with the worker.gardener.cloud/skip-state-update annotation", func() { - object.SetAnnotations(map[string]string{ - "worker.gardener.cloud/skip-state-update": "true", - }) - - predicate := worker.WorkerStateUpdateIsNotSkipped() - - Expect(predicate.Create(createEvent)).To(BeFalse()) - Expect(predicate.Update(updateEvent)).To(BeFalse()) - Expect(predicate.Delete(deleteEvent)).To(BeFalse()) - Expect(predicate.Generic(genericEvent)).To(BeFalse()) - }) - }) }) diff --git a/extensions/pkg/controller/worker/state_reconciler.go b/extensions/pkg/controller/worker/state_reconciler.go deleted file mode 100644 index 0d6f86ee226..00000000000 --- a/extensions/pkg/controller/worker/state_reconciler.go +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// 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 worker - -import ( - "bytes" - "cmp" - "context" - "encoding/json" - "fmt" - "slices" - - machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" - "github.com/go-logr/logr" - apierrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/manager" - "sigs.k8s.io/controller-runtime/pkg/reconcile" - - extensionsworkerhelper "github.com/gardener/gardener/extensions/pkg/controller/worker/helper" - gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" - v1beta1helper "github.com/gardener/gardener/pkg/apis/core/v1beta1/helper" - extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" -) - -// TODO(rfranzke): Drop this stateReconciler after a few releases as soon as the shoot migrate flow persists the Shoot -// state only after all extension resources have been migrated. - -type stateReconciler struct { - client client.Client -} - -// NewStateReconciler creates a new reconcile.Reconciler that reconciles -// Worker's State resources of Gardener's `extensions.gardener.cloud` API group. -func NewStateReconciler(mgr manager.Manager) reconcile.Reconciler { - return &stateReconciler{client: mgr.GetClient()} -} - -func (r *stateReconciler) Reconcile(ctx context.Context, request reconcile.Request) (reconcile.Result, error) { - log := logf.FromContext(ctx) - - worker := &extensionsv1alpha1.Worker{} - if err := r.client.Get(ctx, request.NamespacedName, worker); err != nil { - if apierrors.IsNotFound(err) { - log.V(1).Info("Object is gone, stop reconciling") - return reconcile.Result{}, nil - } - return reconcile.Result{}, fmt.Errorf("error retrieving object from store: %w", err) - } - - if worker.DeletionTimestamp != nil { - return reconcile.Result{}, nil - } - - if v1beta1helper.ComputeOperationType(worker.ObjectMeta, worker.Status.LastOperation) != gardencorev1beta1.LastOperationTypeReconcile { - return reconcile.Result{Requeue: true}, nil - } - - if isWorkerMigrated(worker) { - return reconcile.Result{}, nil - } - - return reconcile.Result{}, PersistState(ctx, log, r.client, worker) -} - -// PersistState persists the worker state into the .status.state field. -func PersistState(ctx context.Context, log logr.Logger, c client.Client, worker *extensionsv1alpha1.Worker) error { - state, err := computeState(ctx, c, worker.Namespace) - if err != nil { - return err - } - - rawState, err := json.Marshal(state) - if err != nil { - return err - } - - // If the state did not change, do not even try to send an empty PATCH request. - if worker.Status.State != nil && bytes.Equal(rawState, worker.Status.State.Raw) { - return nil - } - - patch := client.MergeFromWithOptions(worker.DeepCopy(), client.MergeFromWithOptimisticLock{}) - worker.Status.State = &runtime.RawExtension{Raw: rawState} - if err := c.Status().Patch(ctx, worker, patch); err != nil { - return fmt.Errorf("error updating Worker state: %w", err) - } - - log.Info("Successfully updated Worker state") - return nil -} - -func computeState(ctx context.Context, c client.Client, namespace string) (*State, error) { - existingMachineDeployments := &machinev1alpha1.MachineDeploymentList{} - if err := c.List(ctx, existingMachineDeployments, client.InNamespace(namespace)); err != nil { - return nil, err - } - - machineSets, err := getExistingMachineSetsMap(ctx, c, namespace) - if err != nil { - return nil, err - } - - machines, err := getExistingMachinesMap(ctx, c, namespace) - if err != nil { - return nil, err - } - - workerState := &State{MachineDeployments: make(map[string]*MachineDeploymentState)} - - for _, deployment := range existingMachineDeployments.Items { - machineDeploymentState := &MachineDeploymentState{} - machineDeploymentState.Replicas = deployment.Spec.Replicas - - machineDeploymentMachineSets, ok := machineSets[deployment.Name] - if !ok { - continue - } - - addMachineSetToMachineDeploymentState(machineDeploymentMachineSets, machineDeploymentState) - - for _, machineSet := range machineDeploymentMachineSets { - currentMachines := append(machines[machineSet.Name], machines[deployment.Name]...) - if len(currentMachines) <= 0 { - continue - } - - for index := range currentMachines { - addMachineToMachineDeploymentState(¤tMachines[index], machineDeploymentState) - } - } - - workerState.MachineDeployments[deployment.Name] = machineDeploymentState - } - - return workerState, nil -} - -// getExistingMachineSetsMap returns a map of existing MachineSets as values and their owners as keys -func getExistingMachineSetsMap(ctx context.Context, c client.Client, namespace string) (map[string][]machinev1alpha1.MachineSet, error) { - existingMachineSets := &machinev1alpha1.MachineSetList{} - if err := c.List(ctx, existingMachineSets, client.InNamespace(namespace)); err != nil { - return nil, err - } - - // When we read from the cache we get unsorted results, hence, we sort to prevent unnecessary state updates from happening. - slices.SortFunc(existingMachineSets.Items, func(a, b machinev1alpha1.MachineSet) int { - return cmp.Compare(a.Name, b.Name) - }) - - return extensionsworkerhelper.BuildOwnerToMachineSetsMap(existingMachineSets.Items), nil -} - -// getExistingMachinesMap returns a map of the existing Machines as values and the name of their owner -// no matter of being machineSet or MachineDeployment. If a Machine has a ownerReference the key(owner) -// will be the MachineSet if not the key will be the name of the MachineDeployment which is stored as -// a label. We assume that there is no MachineDeployment and MachineSet with the same names. -func getExistingMachinesMap(ctx context.Context, c client.Client, namespace string) (map[string][]machinev1alpha1.Machine, error) { - existingMachines := &machinev1alpha1.MachineList{} - if err := c.List(ctx, existingMachines, client.InNamespace(namespace)); err != nil { - return nil, err - } - - // We temporarily filter out machines without provider ID or node label (VMs which got created but not yet joined the cluster) - // to prevent unnecessarily persisting them in the Worker state. - // TODO: Remove this again once machine-controller-manager supports backing off creation/deletion of failed machines, see - // https://github.com/gardener/machine-controller-manager/issues/483. - var filteredMachines []machinev1alpha1.Machine - for _, machine := range existingMachines.Items { - if _, ok := machine.Labels["node"]; ok || machine.Spec.ProviderID != "" { - filteredMachines = append(filteredMachines, machine) - } - } - - // When we read from the cache we get unsorted results, hence, we sort to prevent unnecessary state updates from happening. - slices.SortFunc(filteredMachines, func(a, b machinev1alpha1.Machine) int { - return cmp.Compare(a.Name, b.Name) - }) - - return extensionsworkerhelper.BuildOwnerToMachinesMap(filteredMachines), nil -} - -func addMachineSetToMachineDeploymentState(machineSets []machinev1alpha1.MachineSet, machineDeploymentState *MachineDeploymentState) { - if len(machineSets) < 1 || machineDeploymentState == nil { - return - } - - // remove redundant data from the machine set - for index := range machineSets { - machineSet := &machineSets[index] - machineSet.ObjectMeta = metav1.ObjectMeta{ - Name: machineSet.Name, - Namespace: machineSet.Namespace, - Annotations: machineSet.Annotations, - Labels: machineSet.Labels, - } - machineSet.OwnerReferences = nil - machineSet.Status = machinev1alpha1.MachineSetStatus{} - } - - machineDeploymentState.MachineSets = machineSets -} - -func addMachineToMachineDeploymentState(machine *machinev1alpha1.Machine, machineDeploymentState *MachineDeploymentState) { - if machine == nil || machineDeploymentState == nil { - return - } - - // remove redundant data from the machine - machine.ObjectMeta = metav1.ObjectMeta{ - Name: machine.Name, - Namespace: machine.Namespace, - Annotations: machine.Annotations, - Labels: machine.Labels, - } - machine.OwnerReferences = nil - machine.Status = machinev1alpha1.MachineStatus{} - - machineDeploymentState.Machines = append(machineDeploymentState.Machines, *machine) -} - -func isWorkerMigrated(worker *extensionsv1alpha1.Worker) bool { - return worker.Status.LastOperation != nil && - worker.Status.LastOperation.Type == gardencorev1beta1.LastOperationTypeMigrate && - worker.Status.LastOperation.State == gardencorev1beta1.LastOperationStateSucceeded -} diff --git a/go.mod b/go.mod index b3d82e63a1c..a39f489590a 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( github.com/gardener/dependency-watchdog v1.1.2 github.com/gardener/etcd-druid v0.19.2 github.com/gardener/hvpa-controller/api v0.5.0 - github.com/gardener/machine-controller-manager v0.48.1 + github.com/gardener/machine-controller-manager v0.50.0 github.com/go-logr/logr v1.2.4 github.com/go-test/deep v1.1.0 github.com/gogo/protobuf v1.3.2 diff --git a/go.sum b/go.sum index b36fc6060c1..57cfb9f03a8 100644 --- a/go.sum +++ b/go.sum @@ -180,8 +180,8 @@ github.com/gardener/etcd-druid v0.19.2 h1:Z8TTbmVUxZ7UWU5iJAwUHUI6A9E5Mfd5JcvokV github.com/gardener/etcd-druid v0.19.2/go.mod h1:0Q9nKPiONDac/Gr0SZYFkVXHGt/Yt//rcRfDIUfftZo= github.com/gardener/hvpa-controller/api v0.5.0 h1:f4F3O7YUrenwh4S3TgPREPiB287JjjUiUL18OqPLyAA= github.com/gardener/hvpa-controller/api v0.5.0/go.mod h1:QQl3ELkCaki+8RhXl0FZMfvnm0WCGwGJlGmrxJj6lvM= -github.com/gardener/machine-controller-manager v0.48.1 h1:Oxr5e6gRm7P40Ds4nGlga/0nmfF7cH4rOfjthR6Mm38= -github.com/gardener/machine-controller-manager v0.48.1/go.mod h1:Axeu1Oh3agySk0oR4T+FUNax41Ni2K8tuksu8KRHuh0= +github.com/gardener/machine-controller-manager v0.50.0 h1:3dcQjzueFU1TGgprV00adjb3OCR99myTBx8DQGxywks= +github.com/gardener/machine-controller-manager v0.50.0/go.mod h1:RySZ40AgbNV/wMq60G/w49kb+okbj5Xs1A6usz5Pm/I= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= diff --git a/hack/generate-crds.sh b/hack/generate-crds.sh index b119d9a4c29..3d78b653ad2 100755 --- a/hack/generate-crds.sh +++ b/hack/generate-crds.sh @@ -57,6 +57,9 @@ get_group_package () { "fluentbit.fluent.io") echo "github.com/fluent/fluent-operator/v2/apis/fluentbit/v1alpha2" ;; + "machine.sapcloud.io") + echo "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" + ;; *) >&2 echo "unknown group $1" return 1 @@ -70,6 +73,7 @@ generate_all_groups () { generate_group druid.gardener.cloud generate_group autoscaling.k8s.io generate_group fluentbit.fluent.io + generate_group machine.sapcloud.io } generate_group () { diff --git a/pkg/apis/core/v1beta1/constants/types_constants.go b/pkg/apis/core/v1beta1/constants/types_constants.go index a9f0780c37a..52884c2cccb 100644 --- a/pkg/apis/core/v1beta1/constants/types_constants.go +++ b/pkg/apis/core/v1beta1/constants/types_constants.go @@ -553,6 +553,13 @@ const ( // DefaultIngressGatewayAppLabelValue is the ingress gateway value for the app label. DefaultIngressGatewayAppLabelValue = "istio-ingressgateway" + // DataTypeSecret is a constant for a value of the 'Type' field in 'GardenerResourceData' structs describing that + // the data is a secret. + DataTypeSecret = "secret" + // DataTypeMachineState is a constant for a value of the 'Type' field in 'GardenerResourceData' structs describing + // that the data is machine state. + DataTypeMachineState = "machine-state" + // DefaultSchedulerName is the name of the default scheduler. DefaultSchedulerName = "default-scheduler" // SchedulingPurpose is a constant for the key in a label describing the purpose of the scheduler related object. @@ -835,7 +842,10 @@ const ( TaintNodeCriticalComponentsNotReady = "node.gardener.cloud/critical-components-not-ready" // LabelNodeCriticalComponent is the label key for marking node-critical component pods. LabelNodeCriticalComponent = "node.gardener.cloud/critical-component" - // AnnotationWaitForCSINode is the annotation key for csi-driver-node pods, - // indicating they use the driver specified in the value. + // AnnotationPrefixWaitForCSINode is the annotation key for csi-driver-node pods, indicating they use the driver + // specified in the value. AnnotationPrefixWaitForCSINode = "node.gardener.cloud/wait-for-csi-node-" + + // GardenPurposeMachineClass is a constant for the 'machineclass' value in a label. + GardenPurposeMachineClass = "machineclass" ) diff --git a/pkg/component/extensions/worker/worker.go b/pkg/component/extensions/worker/worker.go index c1b0d138740..a5574e20165 100644 --- a/pkg/component/extensions/worker/worker.go +++ b/pkg/component/extensions/worker/worker.go @@ -262,10 +262,32 @@ func (w *worker) deploy(ctx context.Context, operation string) (extensionsv1alph // Restore uses the seed client and the ShootState to create the Worker resources and restore their state. func (w *worker) Restore(ctx context.Context, shootState *gardencorev1beta1.ShootState) error { + // gardenlet persists the machine state in the ShootState's `.spec.gardener[]` list with `type=machine-state`. + // In the future, the provider extension's Worker controller is expected to read the machine state directly from the + // ShootState resource in the garden cluster, and use it to recreate the actual machine.saploud.io/v1alpha1 objects. + // However: For backwards-compatibility, we have to make the machine state also available in the Worker object's + // `.status.state` field since older versions (< v1.81) of the generic `Worker` actuator's `Restore` function expect + // to find the state here, see https://github.com/gardener/gardener/blob/422e2bbedd23351383154bb733838a416f39f2b6/extensions/pkg/controller/worker/genericactuator/actuator_restore.go#L121C1-L141. + // TODO(rfranzke): Drop this code after Gardener v1.86 has been released. + var ( + shootStateCopy = shootState.DeepCopy() + gardenerData = v1beta1helper.GardenerResourceDataList(shootStateCopy.Spec.Gardener) + ) + + if machineState := gardenerData.Get(v1beta1constants.DataTypeMachineState); machineState != nil && machineState.Type == v1beta1constants.DataTypeMachineState { + extensionsData := v1beta1helper.ExtensionResourceStateList(shootStateCopy.Spec.Extensions) + extensionsData.Upsert(&gardencorev1beta1.ExtensionResourceState{ + Kind: extensionsv1alpha1.WorkerResource, + Name: &w.worker.Name, + State: &machineState.Data, + }) + shootStateCopy.Spec.Extensions = extensionsData + } + return extensions.RestoreExtensionWithDeployFunction( ctx, w.client, - shootState, + shootStateCopy, extensionsv1alpha1.WorkerResource, w.deploy, ) diff --git a/pkg/component/extensions/worker/worker_test.go b/pkg/component/extensions/worker/worker_test.go index fe68c57d544..b389ebb1471 100644 --- a/pkg/component/extensions/worker/worker_test.go +++ b/pkg/component/extensions/worker/worker_test.go @@ -668,14 +668,14 @@ var _ = Describe("Worker", func() { Describe("#Restore", func() { var ( - state = &runtime.RawExtension{Raw: []byte(`{"dummy":"state"}`)} + state = runtime.RawExtension{Raw: []byte(`{"dummy":"state"}`)} shootState = &gardencorev1beta1.ShootState{ Spec: gardencorev1beta1.ShootStateSpec{ - Extensions: []gardencorev1beta1.ExtensionResourceState{ + Gardener: []gardencorev1beta1.GardenerResourceData{ { - Name: &name, - Kind: extensionsv1alpha1.WorkerResource, - State: state, + Name: "machine-state", + Type: "machine-state", + Data: state, }, }, }, @@ -711,7 +711,7 @@ var _ = Describe("Worker", func() { // restore state expectedWithState := obj.DeepCopy() - expectedWithState.Status.State = state + expectedWithState.Status.State = &state test.EXPECTStatusPatch(ctx, mockStatusWriter, expectedWithState, obj, types.MergePatchType) // annotate with restore annotation diff --git a/pkg/component/machinecontrollermanager/crd.go b/pkg/component/machinecontrollermanager/crd.go index e07fb90ac84..b04da536ccd 100644 --- a/pkg/component/machinecontrollermanager/crd.go +++ b/pkg/component/machinecontrollermanager/crd.go @@ -19,33 +19,24 @@ import ( _ "embed" "fmt" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" "github.com/gardener/gardener/pkg/client/kubernetes" "github.com/gardener/gardener/pkg/component" gardenerutils "github.com/gardener/gardener/pkg/utils/gardener" + kubernetesutils "github.com/gardener/gardener/pkg/utils/kubernetes" ) var ( - //go:embed templates/crd-alicloudmachineclasses.tpl.yaml - machineClassAlicloudCRD string - //go:embed templates/crd-awsmachineclasses.tpl.yaml - machineClassAWSCRD string - //go:embed templates/crd-azuremachineclasses.tpl.yaml - machineClassAzureCRD string - //go:embed templates/crd-gcpmachineclasses.tpl.yaml - machineClassGCPCRD string - //go:embed templates/crd-openstackmachineclasses.tpl.yaml - machineClassOpenStackCRD string - //go:embed templates/crd-packetmachineclasses.tpl.yaml - machineClassPacketCRD string - //go:embed templates/crd-machineclasses.tpl.yaml + //go:embed templates/crd-machine.sapcloud.io_machineclasses.yaml machineClassCRD string - //go:embed templates/crd-machinedeployments.tpl.yaml + //go:embed templates/crd-machine.sapcloud.io_machinedeployments.yaml machineDeploymentCRD string - //go:embed templates/crd-machinesets.tpl.yaml + //go:embed templates/crd-machine.sapcloud.io_machinesets.yaml machineSetCRD string - //go:embed templates/crd-machines.tpl.yaml + //go:embed templates/crd-machine.sapcloud.io_machines.yaml machineCRD string crdResources []string @@ -53,12 +44,6 @@ var ( func init() { crdResources = []string{ - machineClassAlicloudCRD, - machineClassAWSCRD, - machineClassAzureCRD, - machineClassGCPCRD, - machineClassOpenStackCRD, - machineClassPacketCRD, machineClassCRD, machineDeploymentCRD, machineSetCRD, @@ -87,7 +72,7 @@ func (c *crd) Deploy(ctx context.Context) error { } } - return nil + return c.deleteLegacyCRDs(ctx) } func (c *crd) Destroy(ctx context.Context) error { @@ -108,5 +93,27 @@ func (c *crd) Destroy(ctx context.Context) error { } } + return c.deleteLegacyCRDs(ctx) +} + +// TODO(rfranzke): Remove this code after Gardener v1.83 has been released. +func (c *crd) deleteLegacyCRDs(ctx context.Context) error { + for _, name := range []string{ + "alicloudmachineclasses.machine.sapcloud.io", + "awsmachineclasses.machine.sapcloud.io", + "azuremachineclasses.machine.sapcloud.io", + "gcpmachineclasses.machine.sapcloud.io", + "openstackmachineclasses.machine.sapcloud.io", + "packetmachineclasses.machine.sapcloud.io", + } { + obj := &apiextensionsv1.CustomResourceDefinition{ObjectMeta: metav1.ObjectMeta{Name: name}} + if err := gardenerutils.ConfirmDeletion(ctx, c.client, obj); client.IgnoreNotFound(err) != nil { + return err + } + if err := kubernetesutils.DeleteObject(ctx, c.client, obj); err != nil { + return err + } + } + return nil } diff --git a/pkg/component/machinecontrollermanager/crd_test.go b/pkg/component/machinecontrollermanager/crd_test.go index a257a5d921e..2cc92c6e274 100644 --- a/pkg/component/machinecontrollermanager/crd_test.go +++ b/pkg/component/machinecontrollermanager/crd_test.go @@ -51,32 +51,20 @@ var _ = Describe("CRD", func() { Describe("#Deploy", func() { It("should deploy the CRDs", func() { Expect(crdDeployer.Deploy(ctx)).To(Succeed()) - Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "alicloudmachineclasses.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(Succeed()) - Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "awsmachineclasses.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(Succeed()) - Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "azuremachineclasses.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(Succeed()) - Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "gcpmachineclasses.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(Succeed()) Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "machineclasses.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(Succeed()) Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "machinedeployments.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(Succeed()) Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "machines.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(Succeed()) Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "machinesets.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(Succeed()) - Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "openstackmachineclasses.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(Succeed()) - Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "packetmachineclasses.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(Succeed()) }) }) Describe("#Destroy", func() { It("should delete the CRDs", func() { Expect(crdDeployer.Destroy(ctx)).To(Succeed()) - Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "alicloudmachineclasses.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(BeNotFoundError()) - Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "awsmachineclasses.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(BeNotFoundError()) - Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "azuremachineclasses.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(BeNotFoundError()) - Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "gcpmachineclasses.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(BeNotFoundError()) Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "machineclasses.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(BeNotFoundError()) Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "machinedeployments.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(BeNotFoundError()) Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "machines.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(BeNotFoundError()) Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "machinesets.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(BeNotFoundError()) - Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "openstackmachineclasses.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(BeNotFoundError()) - Expect(fakeClient.Get(ctx, client.ObjectKey{Name: "packetmachineclasses.machine.sapcloud.io"}, &apiextensionsv1.CustomResourceDefinition{})).To(BeNotFoundError()) }) }) }) diff --git a/pkg/component/machinecontrollermanager/templates/crd-alicloudmachineclasses.tpl.yaml b/pkg/component/machinecontrollermanager/templates/crd-alicloudmachineclasses.tpl.yaml deleted file mode 100644 index 77a90dd1d33..00000000000 --- a/pkg/component/machinecontrollermanager/templates/crd-alicloudmachineclasses.tpl.yaml +++ /dev/null @@ -1,155 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - labels: - gardener.cloud/deletion-protected: "true" - name: alicloudmachineclasses.machine.sapcloud.io -spec: - group: machine.sapcloud.io - names: - kind: AlicloudMachineClass - listKind: AlicloudMachineClassList - plural: alicloudmachineclasses - singular: alicloudmachineclass - scope: Namespaced - versions: - - additionalPrinterColumns: - - jsonPath: .spec.instanceType - name: Instance Type - type: string - - jsonPath: .spec.region - name: Region - priority: 1 - type: string - - description: |- - CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. - Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: AlicloudMachineClass TODO - 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: AlicloudMachineClassSpec is the specification of a AlicloudMachineClass. - properties: - IoOptimized: - type: string - credentialsSecretRef: - description: SecretReference represents a Secret Reference. It has - enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a - secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret - name must be unique. - type: string - type: object - dataDisks: - items: - properties: - category: - type: string - deleteWithInstance: - type: boolean - description: - type: string - encrypted: - type: boolean - name: - type: string - size: - type: integer - required: - - category - - deleteWithInstance - - encrypted - - name - - size - type: object - type: array - imageID: - type: string - instanceChargeType: - type: string - instanceType: - type: string - internetChargeType: - type: string - internetMaxBandwidthIn: - type: integer - internetMaxBandwidthOut: - type: integer - keyPairName: - type: string - privateIPAddress: - type: string - region: - type: string - secretRef: - description: SecretReference represents a Secret Reference. It has - enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a - secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret - name must be unique. - type: string - type: object - securityGroupID: - type: string - spotStrategy: - type: string - systemDisk: - description: AlicloudSystemDisk describes SystemDisk for Alicloud. - properties: - category: - type: string - size: - type: integer - required: - - category - - size - type: object - tags: - additionalProperties: - type: string - type: object - vSwitchID: - type: string - zoneID: - type: string - required: - - imageID - - instanceType - - keyPairName - - region - - vSwitchID - type: object - type: object - served: true - storage: true - subresources: {} diff --git a/pkg/component/machinecontrollermanager/templates/crd-awsmachineclasses.tpl.yaml b/pkg/component/machinecontrollermanager/templates/crd-awsmachineclasses.tpl.yaml deleted file mode 100644 index b7e37a51ea1..00000000000 --- a/pkg/component/machinecontrollermanager/templates/crd-awsmachineclasses.tpl.yaml +++ /dev/null @@ -1,233 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - labels: - gardener.cloud/deletion-protected: "true" - name: awsmachineclasses.machine.sapcloud.io -spec: - group: machine.sapcloud.io - names: - kind: AWSMachineClass - listKind: AWSMachineClassList - plural: awsmachineclasses - singular: awsmachineclass - scope: Namespaced - versions: - - additionalPrinterColumns: - - jsonPath: .spec.machineType - name: Machine Type - type: string - - jsonPath: .spec.ami - name: AMI - type: string - - jsonPath: .spec.region - name: Region - priority: 1 - type: string - - description: |- - CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. - Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: AWSMachineClass TODO - 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: AWSMachineClassSpec is the specification of a AWSMachineClass. - properties: - ami: - type: string - blockDevices: - items: - properties: - deviceName: - description: The device name exposed to the machine (for example, - /dev/sdh or xvdh). - type: string - ebs: - description: Parameters used to automatically set up EBS volumes - when the machine is launched. - properties: - deleteOnTermination: - description: Indicates whether the EBS volume is deleted - on machine termination. - type: boolean - encrypted: - description: Indicates whether the EBS volume is encrypted. - Encrypted Amazon EBS volumes may only be attached to machines - that support Amazon EBS encryption. - type: boolean - iops: - description: "The number of I/O operations per second (IOPS) - that the volume supports. For io1, this represents the - number of IOPS that are provisioned for the volume. For - gp2, this represents the baseline performance of the volume - and the rate at which the volume accumulates I/O credits - for bursting. For more information about General Purpose - SSD baseline performance, I/O credits, and bursting, see - Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - in the Amazon Elastic Compute Cloud User Guide. \n Constraint: - Range is 100-20000 IOPS for io1 volumes and 100-10000 - IOPS for gp2 volumes. \n Condition: This parameter is - required for requests to create io1 volumes; it is not - used in requests to create gp2, st1, sc1, or standard - volumes." - format: int64 - type: integer - kmsKeyID: - description: "Identifier (key ID, key alias, ID ARN, or - alias ARN) for a customer managed CMK under which the - EBS volume is encrypted. \n This parameter is only supported - on BlockDeviceMapping objects called by RunInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html), - RequestSpotFleet (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotFleet.html), - and RequestSpotInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html)." - type: string - snapshotID: - description: The ID of the snapshot. - type: string - volumeSize: - description: "The size of the volume, in GiB. \n Constraints: - 1-16384 for General Purpose SSD (gp2), 4-16384 for Provisioned - IOPS SSD (io1), 500-16384 for Throughput Optimized HDD - (st1), 500-16384 for Cold HDD (sc1), and 1-1024 for Magnetic - (standard) volumes. If you specify a snapshot, the volume - size must be equal to or larger than the snapshot size. - \n Default: If you're creating the volume from a snapshot - and don't specify a volume size, the default is the snapshot - size." - format: int64 - type: integer - volumeType: - description: "The volume type: gp2, io1, st1, sc1, or standard. - \n Default: standard" - type: string - type: object - noDevice: - description: Suppresses the specified device included in the - block device mapping of the AMI. - type: string - virtualName: - description: "The virtual device name (ephemeralN). Machine - store volumes are numbered starting from 0. An machine type - with 2 available machine store volumes can specify mappings - for ephemeral0 and ephemeral1.The number of available machine - store volumes depends on the machine type. After you connect - to the machine, you must mount the volume. \n Constraints: - For M3 machines, you must specify machine store volumes in - the block device mapping for the machine. When you launch - an M3 machine, we ignore any machine store volumes specified - in the block device mapping for the AMI." - type: string - type: object - type: array - credentialsSecretRef: - description: SecretReference represents a Secret Reference. It has - enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a - secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret - name must be unique. - type: string - type: object - ebsOptimized: - type: boolean - iam: - description: Describes an IAM machine profile. - properties: - arn: - description: The Amazon Resource Name (ARN) of the machine profile. - type: string - name: - description: The name of the machine profile. - type: string - type: object - keyName: - type: string - machineType: - type: string - monitoring: - type: boolean - networkInterfaces: - items: - description: Describes a network interface. Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MachineAWSNetworkInterfaceSpecification - properties: - associatePublicIPAddress: - description: Indicates whether to assign a public IPv4 address - to an machine you launch in a VPC. The public IP address can - only be assigned to a network interface for eth0, and can - only be assigned to a new network interface, not an existing - one. You cannot specify more than one network interface in - the request. If launching into a default subnet, the default - value is true. - type: boolean - deleteOnTermination: - description: If set to true, the interface is deleted when the - machine is terminated. You can specify true only if creating - a new network interface when launching an machine. - type: boolean - description: - description: The description of the network interface. Applies - only if creating a network interface when launching an machine. - type: string - securityGroupIDs: - description: The IDs of the security groups for the network - interface. Applies only if creating a network interface when - launching an machine. - items: - type: string - type: array - subnetID: - description: The ID of the subnet associated with the network - string. Applies only if creating a network interface when - launching an machine. - type: string - type: object - type: array - region: - type: string - secretRef: - description: SecretReference represents a Secret Reference. It has - enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a - secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret - name must be unique. - type: string - type: object - spotPrice: - type: string - tags: - additionalProperties: - type: string - type: object - type: object - type: object - served: true - storage: true - subresources: {} diff --git a/pkg/component/machinecontrollermanager/templates/crd-azuremachineclasses.tpl.yaml b/pkg/component/machinecontrollermanager/templates/crd-azuremachineclasses.tpl.yaml deleted file mode 100644 index a8a234255ad..00000000000 --- a/pkg/component/machinecontrollermanager/templates/crd-azuremachineclasses.tpl.yaml +++ /dev/null @@ -1,259 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - labels: - gardener.cloud/deletion-protected: "true" - name: azuremachineclasses.machine.sapcloud.io -spec: - group: machine.sapcloud.io - names: - kind: AzureMachineClass - listKind: AzureMachineClassList - plural: azuremachineclasses - singular: azuremachineclass - scope: Namespaced - versions: - - additionalPrinterColumns: - - jsonPath: .spec.properties.hardwareProfile.vmSize - name: VM Size - type: string - - jsonPath: .spec.location - name: Location - priority: 1 - type: string - - description: |- - CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. - Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: AzureMachineClass TODO - 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: AzureMachineClassSpec is the specification of a AzureMachineClass. - properties: - credentialsSecretRef: - description: SecretReference represents a Secret Reference. It has - enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a - secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret - name must be unique. - type: string - type: object - location: - type: string - properties: - description: AzureVirtualMachineProperties is describes the properties - of a Virtual Machine. - properties: - availabilitySet: - description: AzureSubResource is the Sub Resource definition. - properties: - id: - type: string - type: object - hardwareProfile: - description: AzureHardwareProfile is specifies the hardware settings - for the virtual machine. Refer github.com/Azure/azure-sdk-for-go/arm/compute/models.go - for VMSizes - properties: - vmSize: - type: string - type: object - identityID: - type: string - machineSet: - description: AzureMachineSetConfig contains the information about - the machine set - properties: - id: - type: string - kind: - type: string - required: - - id - - kind - type: object - networkProfile: - description: AzureNetworkProfile is specifies the network interfaces - of the virtual machine. - properties: - acceleratedNetworking: - type: boolean - networkInterfaces: - description: AzureNetworkInterfaceReference is describes a - network interface reference. - properties: - id: - type: string - properties: - description: AzureNetworkInterfaceReferenceProperties - is describes a network interface reference properties. - properties: - primary: - type: boolean - type: object - type: object - type: object - osProfile: - description: AzureOSProfile is specifies the operating system - settings for the virtual machine. - properties: - adminPassword: - type: string - adminUsername: - type: string - computerName: - type: string - customData: - type: string - linuxConfiguration: - description: AzureLinuxConfiguration is specifies the Linux - operating system settings on the virtual machine.

For - a list of supported Linux distributions, see [Linux on Azure-Endorsed - Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) -

For running non-endorsed distributions, see [Information - for Non-Endorsed Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). - properties: - disablePasswordAuthentication: - type: boolean - ssh: - description: AzureSSHConfiguration is SSH configuration - for Linux based VMs running on Azure - properties: - publicKeys: - description: AzureSSHPublicKey is contains information - about SSH certificate public key and the path on - the Linux VM where the public key is placed. - properties: - keyData: - type: string - path: - type: string - type: object - type: object - type: object - type: object - storageProfile: - description: AzureStorageProfile is specifies the storage settings - for the virtual machine disks. - properties: - dataDisks: - items: - properties: - caching: - type: string - diskSizeGB: - format: int32 - type: integer - lun: - format: int32 - type: integer - name: - type: string - storageAccountType: - type: string - type: object - type: array - imageReference: - description: AzureImageReference is specifies information - about the image to use. You can specify information about - platform images, marketplace images, or virtual machine - images. This element is required when you want to use a - platform image, marketplace image, or virtual machine image, - but is not used in other creation operations. - properties: - id: - type: string - urn: - description: Uniform Resource Name of the OS image to - be used , it has the format 'publisher:offer:sku:version' - type: string - type: object - osDisk: - description: AzureOSDisk is specifies information about the - operating system disk used by the virtual machine.

- For more information about disks, see [About disks and VHDs - for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). - properties: - caching: - type: string - createOption: - type: string - diskSizeGB: - format: int32 - type: integer - managedDisk: - description: AzureManagedDiskParameters is the parameters - of a managed disk. - properties: - id: - type: string - storageAccountType: - type: string - type: object - name: - type: string - type: object - type: object - zone: - type: integer - type: object - resourceGroup: - type: string - secretRef: - description: SecretReference represents a Secret Reference. It has - enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a - secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret - name must be unique. - type: string - type: object - subnetInfo: - description: AzureSubnetInfo is the information containing the subnet - details - properties: - subnetName: - type: string - vnetName: - type: string - vnetResourceGroup: - type: string - type: object - tags: - additionalProperties: - type: string - type: object - type: object - type: object - served: true - storage: true - subresources: {} diff --git a/pkg/component/machinecontrollermanager/templates/crd-gcpmachineclasses.tpl.yaml b/pkg/component/machinecontrollermanager/templates/crd-gcpmachineclasses.tpl.yaml deleted file mode 100644 index 0dcc54c6ed7..00000000000 --- a/pkg/component/machinecontrollermanager/templates/crd-gcpmachineclasses.tpl.yaml +++ /dev/null @@ -1,198 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - labels: - gardener.cloud/deletion-protected: "true" - name: gcpmachineclasses.machine.sapcloud.io -spec: - group: machine.sapcloud.io - names: - kind: GCPMachineClass - listKind: GCPMachineClassList - plural: gcpmachineclasses - singular: gcpmachineclass - scope: Namespaced - versions: - - additionalPrinterColumns: - - jsonPath: .spec.machineType - name: Machine Type - type: string - - jsonPath: .spec.region - name: Region - priority: 1 - type: string - - description: |- - CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. - Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: GCPMachineClass TODO - 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: GCPMachineClassSpec is the specification of a GCPMachineClass. - properties: - canIpForward: - type: boolean - credentialsSecretRef: - description: SecretReference represents a Secret Reference. It has - enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a - secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret - name must be unique. - type: string - type: object - deletionProtection: - type: boolean - description: - type: string - disks: - items: - description: GCPDisk describes disks for GCP. - properties: - autoDelete: - type: boolean - boot: - type: boolean - image: - type: string - interface: - type: string - labels: - additionalProperties: - type: string - type: object - sizeGb: - format: int64 - type: integer - type: - type: string - required: - - autoDelete - - boot - - image - - interface - - labels - - sizeGb - - type - type: object - type: array - labels: - additionalProperties: - type: string - type: object - machineType: - type: string - metadata: - items: - description: GCPMetadata describes metadata for GCP. - properties: - key: - type: string - value: - type: string - required: - - key - - value - type: object - type: array - networkInterfaces: - items: - description: GCPNetworkInterface describes network interfaces for - GCP - properties: - disableExternalIP: - type: boolean - network: - type: string - subnetwork: - type: string - type: object - type: array - region: - type: string - scheduling: - description: GCPScheduling describes scheduling configuration for - GCP. - properties: - automaticRestart: - type: boolean - onHostMaintenance: - type: string - preemptible: - type: boolean - required: - - automaticRestart - - onHostMaintenance - - preemptible - type: object - secretRef: - description: SecretReference represents a Secret Reference. It has - enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a - secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret - name must be unique. - type: string - type: object - serviceAccounts: - items: - description: GCPServiceAccount describes service accounts for GCP. - properties: - email: - type: string - scopes: - items: - type: string - type: array - required: - - email - - scopes - type: object - type: array - tags: - items: - type: string - type: array - zone: - type: string - required: - - canIpForward - - deletionProtection - - machineType - - region - - scheduling - - serviceAccounts - - zone - type: object - type: object - served: true - storage: true - subresources: {} diff --git a/pkg/component/machinecontrollermanager/templates/crd-machineclasses.tpl.yaml b/pkg/component/machinecontrollermanager/templates/crd-machine.sapcloud.io_machineclasses.yaml similarity index 70% rename from pkg/component/machinecontrollermanager/templates/crd-machineclasses.tpl.yaml rename to pkg/component/machinecontrollermanager/templates/crd-machine.sapcloud.io_machineclasses.yaml index a7afeeb4832..bdca148da38 100644 --- a/pkg/component/machinecontrollermanager/templates/crd-machineclasses.tpl.yaml +++ b/pkg/component/machinecontrollermanager/templates/crd-machine.sapcloud.io_machineclasses.yaml @@ -2,10 +2,10 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.9.2 labels: gardener.cloud/deletion-protected: "true" + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 name: machineclasses.machine.sapcloud.io spec: group: machine.sapcloud.io @@ -18,19 +18,7 @@ spec: singular: machineclass scope: Namespaced versions: - - additionalPrinterColumns: - - description: Name of the provider which acts on the machine class object - jsonPath: .provider - name: Provider - type: string - - description: |- - CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. - - Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 + - name: v1alpha1 schema: openAPIV3Schema: description: MachineClass can be used to templatize and re-use provider configuration @@ -38,8 +26,8 @@ spec: 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' + 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 credentialsSecretRef: description: CredentialsSecretRef can optionally store the credentials @@ -48,18 +36,19 @@ spec: different user-datas are used. properties: name: - description: Name is unique within a namespace to reference a secret + description: name is unique within a namespace to reference a secret resource. type: string namespace: - description: Namespace defines the space within which the secret name + description: namespace defines the space within which the secret name must be unique. type: string type: object + x-kubernetes-map-type: atomic 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' + 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 @@ -106,14 +95,15 @@ spec: or userdata. properties: name: - description: Name is unique within a namespace to reference a secret + description: name is unique within a namespace to reference a secret resource. type: string namespace: - description: Namespace defines the space within which the secret name + description: namespace defines the space within which the secret name must be unique. type: string type: object + x-kubernetes-map-type: atomic required: - providerSpec type: object diff --git a/pkg/component/machinecontrollermanager/templates/crd-machinedeployments.tpl.yaml b/pkg/component/machinecontrollermanager/templates/crd-machine.sapcloud.io_machinedeployments.yaml similarity index 99% rename from pkg/component/machinecontrollermanager/templates/crd-machinedeployments.tpl.yaml rename to pkg/component/machinecontrollermanager/templates/crd-machine.sapcloud.io_machinedeployments.yaml index 6b70b2a417a..e098b6cd276 100644 --- a/pkg/component/machinecontrollermanager/templates/crd-machinedeployments.tpl.yaml +++ b/pkg/component/machinecontrollermanager/templates/crd-machine.sapcloud.io_machinedeployments.yaml @@ -1,12 +1,11 @@ -# Source: https://github.com/gardener/machine-controller-manager/blob/5b9a383788ef0723ca12eb86c688cdf3b157277d/kubernetes/crds/machine.sapcloud.io_machinedeployments.yaml --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.9.2 labels: gardener.cloud/deletion-protected: "true" + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 name: machinedeployments.machine.sapcloud.io spec: group: machine.sapcloud.io diff --git a/pkg/component/machinecontrollermanager/templates/crd-machines.tpl.yaml b/pkg/component/machinecontrollermanager/templates/crd-machine.sapcloud.io_machines.yaml similarity index 98% rename from pkg/component/machinecontrollermanager/templates/crd-machines.tpl.yaml rename to pkg/component/machinecontrollermanager/templates/crd-machine.sapcloud.io_machines.yaml index 146cce6b14f..90bb305456b 100644 --- a/pkg/component/machinecontrollermanager/templates/crd-machines.tpl.yaml +++ b/pkg/component/machinecontrollermanager/templates/crd-machine.sapcloud.io_machines.yaml @@ -1,12 +1,11 @@ -# Source: https://github.com/gardener/machine-controller-manager/blob/5b9a383788ef0723ca12eb86c688cdf3b157277d/kubernetes/crds/machine.sapcloud.io_machines.yaml --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.9.2 labels: gardener.cloud/deletion-protected: "true" + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 name: machines.machine.sapcloud.io spec: group: machine.sapcloud.io diff --git a/pkg/component/machinecontrollermanager/templates/crd-machinesets.tpl.yaml b/pkg/component/machinecontrollermanager/templates/crd-machine.sapcloud.io_machinesets.yaml similarity index 98% rename from pkg/component/machinecontrollermanager/templates/crd-machinesets.tpl.yaml rename to pkg/component/machinecontrollermanager/templates/crd-machine.sapcloud.io_machinesets.yaml index e09d1af8a61..f448b3ae41a 100644 --- a/pkg/component/machinecontrollermanager/templates/crd-machinesets.tpl.yaml +++ b/pkg/component/machinecontrollermanager/templates/crd-machine.sapcloud.io_machinesets.yaml @@ -1,12 +1,11 @@ -# Source: https://github.com/gardener/machine-controller-manager/blob/5b9a383788ef0723ca12eb86c688cdf3b157277d/kubernetes/crds/machine.sapcloud.io_machinesets.yaml --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.9.2 labels: gardener.cloud/deletion-protected: "true" + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 name: machinesets.machine.sapcloud.io spec: group: machine.sapcloud.io diff --git a/pkg/component/machinecontrollermanager/templates/crd-openstackmachineclasses.tpl.yaml b/pkg/component/machinecontrollermanager/templates/crd-openstackmachineclasses.tpl.yaml deleted file mode 100644 index 29d50a5feb7..00000000000 --- a/pkg/component/machinecontrollermanager/templates/crd-openstackmachineclasses.tpl.yaml +++ /dev/null @@ -1,139 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - labels: - gardener.cloud/deletion-protected: "true" - name: openstackmachineclasses.machine.sapcloud.io -spec: - group: machine.sapcloud.io - names: - kind: OpenStackMachineClass - listKind: OpenStackMachineClassList - plural: openstackmachineclasses - singular: openstackmachineclass - scope: Namespaced - versions: - - additionalPrinterColumns: - - jsonPath: .spec.flavorName - name: Flavor - type: string - - jsonPath: .spec.imageName - name: Image - type: string - - jsonPath: .spec.region - name: Region - priority: 1 - type: string - - description: |- - CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. - Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: OpenStackMachineClass TODO - 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: OpenStackMachineClassSpec is the specification of a OpenStackMachineClass. - properties: - availabilityZone: - type: string - credentialsSecretRef: - description: SecretReference represents a Secret Reference. It has - enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a - secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret - name must be unique. - type: string - type: object - flavorName: - type: string - imageID: - type: string - imageName: - type: string - keyName: - type: string - networkID: - type: string - networks: - items: - properties: - id: - type: string - name: - type: string - podNetwork: - type: boolean - type: object - type: array - podNetworkCidr: - type: string - region: - type: string - rootDiskSize: - type: integer - secretRef: - description: SecretReference represents a Secret Reference. It has - enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a - secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret - name must be unique. - type: string - type: object - securityGroups: - items: - type: string - type: array - serverGroupID: - type: string - subnetID: - type: string - tags: - additionalProperties: - type: string - type: object - useConfigDrive: - type: boolean - required: - - availabilityZone - - flavorName - - imageID - - imageName - - keyName - - networkID - - podNetworkCidr - - region - - securityGroups - type: object - type: object - served: true - storage: true - subresources: {} diff --git a/pkg/component/machinecontrollermanager/templates/crd-packetmachineclasses.tpl.yaml b/pkg/component/machinecontrollermanager/templates/crd-packetmachineclasses.tpl.yaml deleted file mode 100644 index f3b4b13566a..00000000000 --- a/pkg/component/machinecontrollermanager/templates/crd-packetmachineclasses.tpl.yaml +++ /dev/null @@ -1,104 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.9.2 - labels: - gardener.cloud/deletion-protected: "true" - name: packetmachineclasses.machine.sapcloud.io -spec: - group: machine.sapcloud.io - names: - kind: PacketMachineClass - listKind: PacketMachineClassList - plural: packetmachineclasses - singular: packetmachineclass - scope: Namespaced - versions: - - additionalPrinterColumns: - - description: |- - CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. - Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - jsonPath: .metadata.creationTimestamp - name: Age - type: date - name: v1alpha1 - schema: - openAPIV3Schema: - description: PacketMachineClass TODO - 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: PacketMachineClassSpec is the specification of a PacketMachineClass. - properties: - OS: - type: string - billingCycle: - type: string - credentialsSecretRef: - description: SecretReference represents a Secret Reference. It has - enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a - secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret - name must be unique. - type: string - type: object - facility: - items: - type: string - type: array - machineType: - type: string - projectID: - type: string - secretRef: - description: SecretReference represents a Secret Reference. It has - enough information to retrieve secret in any namespace - properties: - name: - description: Name is unique within a namespace to reference a - secret resource. - type: string - namespace: - description: Namespace defines the space within which the secret - name must be unique. - type: string - type: object - sshKeys: - items: - type: string - type: array - tags: - items: - type: string - type: array - userdata: - type: string - required: - - OS - - billingCycle - - facility - - machineType - - projectID - type: object - type: object - served: true - storage: true - subresources: {} diff --git a/pkg/component/machinecontrollermanager/templates/doc.go b/pkg/component/machinecontrollermanager/templates/doc.go new file mode 100644 index 00000000000..d1ff9a26d1b --- /dev/null +++ b/pkg/component/machinecontrollermanager/templates/doc.go @@ -0,0 +1,17 @@ +// Copyright 2023 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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. + +//go:generate ../../../../hack/generate-crds.sh crd- -l machine.sapcloud.io + +package templates diff --git a/pkg/gardenlet/controller/managedseed/charttest/charttest.go b/pkg/gardenlet/controller/managedseed/charttest/charttest.go index fd3e8b8d15f..965d90181bb 100644 --- a/pkg/gardenlet/controller/managedseed/charttest/charttest.go +++ b/pkg/gardenlet/controller/managedseed/charttest/charttest.go @@ -279,6 +279,13 @@ func getGardenletClusterRole(labels map[string]string) *rbacv1.ClusterRole { "filters.fluentbit.fluent.io", "outputs.fluentbit.fluent.io", "parsers.fluentbit.fluent.io", + // TODO(rfranzke): Remove this code after Gardener v1.83 has been released. + "alicloudmachineclasses.machine.sapcloud.io", + "awsmachineclasses.machine.sapcloud.io", + "azuremachineclasses.machine.sapcloud.io", + "gcpmachineclasses.machine.sapcloud.io", + "openstackmachineclasses.machine.sapcloud.io", + "packetmachineclasses.machine.sapcloud.io", }, Verbs: []string{"delete"}, }, @@ -392,7 +399,7 @@ func getGardenletClusterRole(labels map[string]string) *rbacv1.ClusterRole { }, { APIGroups: []string{"machine.sapcloud.io"}, - Resources: []string{"machinedeployments", "machinesets", "machines", "machineclasses"}, + Resources: []string{"machineclasses", "machinedeployments", "machinesets", "machines"}, Verbs: []string{"list", "watch", "get", "patch", "update", "delete"}, }, }, diff --git a/pkg/gardenlet/controller/shoot/shoot/reconciler_migrate.go b/pkg/gardenlet/controller/shoot/shoot/reconciler_migrate.go index f4d9574364f..68520e53d49 100644 --- a/pkg/gardenlet/controller/shoot/shoot/reconciler_migrate.go +++ b/pkg/gardenlet/controller/shoot/shoot/reconciler_migrate.go @@ -31,6 +31,7 @@ import ( botanistpkg "github.com/gardener/gardener/pkg/operation/botanist" errorsutils "github.com/gardener/gardener/pkg/utils/errors" "github.com/gardener/gardener/pkg/utils/flow" + gardenerutils "github.com/gardener/gardener/pkg/utils/gardener" "github.com/gardener/gardener/pkg/utils/gardener/shootstate" kubernetesutils "github.com/gardener/gardener/pkg/utils/kubernetes" retryutils "github.com/gardener/gardener/pkg/utils/retry" @@ -181,19 +182,10 @@ func (r *Reconciler) runMigrateShootFlow(ctx context.Context, o *operation.Opera }).SkipIf(o.Shoot.IsWorkerless).DoIf(features.DefaultFeatureGate.Enabled(features.MachineControllerManagerDeployment)), Dependencies: flow.NewTaskIDs(deleteMachineControllerManager), }) - // TODO(rfranzke): Make the 'persistShootState' task dependent on 'waitUntilExtensionResourcesMigrated' after - // v1.79 has been released. - persistShootState = g.Add(flow.Task{ - Name: "Persisting ShootState in garden cluster", - Fn: func(ctx context.Context) error { - return shootstate.Deploy(ctx, r.Clock, botanist.GardenClient, botanist.SeedClientSet.Client(), botanist.Shoot.GetInfo(), false) - }, - Dependencies: flow.NewTaskIDs(waitUntilMachineControllerManagerDeleted), - }) migrateExtensionResources = g.Add(flow.Task{ Name: "Migrating extension resources", Fn: botanist.MigrateExtensionResourcesInParallel, - Dependencies: flow.NewTaskIDs(persistShootState), + Dependencies: flow.NewTaskIDs(waitUntilMachineControllerManagerDeleted), }) waitUntilExtensionResourcesMigrated = g.Add(flow.Task{ Name: "Waiting until extension resources have been migrated", @@ -210,16 +202,35 @@ func (r *Reconciler) runMigrateShootFlow(ctx context.Context, o *operation.Opera Fn: botanist.Shoot.Components.Extensions.Extension.WaitMigrateBeforeKubeAPIServer, Dependencies: flow.NewTaskIDs(migrateExtensionsBeforeKubeAPIServer), }) + persistShootState = g.Add(flow.Task{ + Name: "Persisting ShootState in garden cluster", + Fn: func(ctx context.Context) error { + return shootstate.Deploy(ctx, r.Clock, botanist.GardenClient, botanist.SeedClientSet.Client(), botanist.Shoot.GetInfo(), false) + }, + Dependencies: flow.NewTaskIDs(waitUntilExtensionResourcesMigrated), + }) deleteExtensionResources = g.Add(flow.Task{ Name: "Deleting extension resources from the Shoot namespace", Fn: botanist.DestroyExtensionResourcesInParallel, - Dependencies: flow.NewTaskIDs(waitUntilExtensionResourcesMigrated), + Dependencies: flow.NewTaskIDs(persistShootState), }) waitUntilExtensionResourcesDeleted = g.Add(flow.Task{ Name: "Waiting until extension resources have been deleted", Fn: botanist.WaitUntilExtensionResourcesDeleted, Dependencies: flow.NewTaskIDs(deleteExtensionResources), }) + deleteMachineResources = g.Add(flow.Task{ + Name: "Shallow-deleting machine resources from the Shoot namespace", + Fn: botanist.ShallowDeleteMachineResources, + Dependencies: flow.NewTaskIDs(persistShootState), + }) + waitUntilMachineResourcesDeleted = g.Add(flow.Task{ + Name: "Waiting until machine resources have been deleted", + Fn: func(ctx context.Context) error { + return gardenerutils.WaitUntilMachineResourcesDeleted(ctx, botanist.Logger, botanist.SeedClientSet.Client(), botanist.Shoot.SeedNamespace) + }, + Dependencies: flow.NewTaskIDs(deleteMachineResources), + }) deleteExtensionsBeforeKubeAPIServer = g.Add(flow.Task{ Name: "Deleting extensions before kube-apiserver", Fn: botanist.Shoot.Components.Extensions.Extension.DestroyBeforeKubeAPIServer, @@ -347,6 +358,7 @@ func (r *Reconciler) runMigrateShootFlow(ctx context.Context, o *operation.Opera }) syncPoint = flow.NewTaskIDs( waitUntilExtensionsAfterKubeAPIServerDeleted, + waitUntilMachineResourcesDeleted, waitUntilExtensionsDeleted, waitUntilInfrastructureDeleted, ) diff --git a/pkg/gardenlet/controller/shoot/shoot/reconciler_reconcile.go b/pkg/gardenlet/controller/shoot/shoot/reconciler_reconcile.go index 6f71ad7e66a..3b79463b251 100644 --- a/pkg/gardenlet/controller/shoot/shoot/reconciler_reconcile.go +++ b/pkg/gardenlet/controller/shoot/shoot/reconciler_reconcile.go @@ -20,12 +20,14 @@ import ( "time" corev1 "k8s.io/api/core/v1" + apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" v1beta1helper "github.com/gardener/gardener/pkg/apis/core/v1beta1/helper" + extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "github.com/gardener/gardener/pkg/client/kubernetes/clientmap/keys" "github.com/gardener/gardener/pkg/component/kubeapiserver" "github.com/gardener/gardener/pkg/controllerutils" @@ -825,6 +827,26 @@ func (r *Reconciler) runReconcileShootFlow(ctx context.Context, o *operation.Ope } } + // TODO(rfranzke): Drop this code after Gardener v1.89 has been released. + { + o.Logger.Info("Removing state from Worker status now that shoot was successfully reconciled or restored") + worker := &extensionsv1alpha1.Worker{ObjectMeta: metav1.ObjectMeta{Namespace: botanist.Shoot.SeedNamespace, Name: botanist.Shoot.GetInfo().Name}} + if err := botanist.SeedClientSet.Client().Get(ctx, client.ObjectKeyFromObject(worker), worker); err != nil { + if !apierrors.IsNotFound(err) { + err = fmt.Errorf("failed to read Worker object: %w", err) + return v1beta1helper.NewWrappedLastErrors(v1beta1helper.FormatLastErrDescription(err), err) + } + // Not all Shoots have `Worker` objects, e.g., workerless clusters. + } else if worker.Status.State != nil { + patch := client.MergeFromWithOptions(worker.DeepCopy(), client.MergeFromWithOptimisticLock{}) + worker.Status.State = nil + if err := botanist.SeedClientSet.Client().Status().Patch(ctx, worker, patch); err != nil { + err = fmt.Errorf("failed to patch .status.state field of Worker object to nil: %w", err) + return v1beta1helper.NewWrappedLastErrors(v1beta1helper.FormatLastErrDescription(err), err) + } + } + } + // ensure that shoot client is invalidated after it has been hibernated if o.Shoot.HibernationEnabled { if err := o.ShootClientMap.InvalidateClient(keys.ForShoot(o.Shoot.GetInfo())); err != nil { diff --git a/pkg/operation/botanist/migration.go b/pkg/operation/botanist/migration.go index 9dc0aa781f8..0b83d254e5a 100644 --- a/pkg/operation/botanist/migration.go +++ b/pkg/operation/botanist/migration.go @@ -18,11 +18,17 @@ import ( "context" "fmt" + machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/meta" + "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/controller-runtime/pkg/client" gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" + v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" v1beta1helper "github.com/gardener/gardener/pkg/apis/core/v1beta1/helper" "github.com/gardener/gardener/pkg/component" + "github.com/gardener/gardener/pkg/controllerutils" "github.com/gardener/gardener/pkg/utils/flow" ) @@ -116,3 +122,72 @@ func (b *Botanist) IsCopyOfBackupsRequired(ctx context.Context) (bool, error) { func (b *Botanist) IsRestorePhase() bool { return v1beta1helper.ShootHasOperationType(b.Shoot.GetInfo().Status.LastOperation, gardencorev1beta1.LastOperationTypeRestore) } + +// ShallowDeleteMachineResources deletes all machine-related resources by forcefully removing their finalizers. +func (b *Botanist) ShallowDeleteMachineResources(ctx context.Context) error { + var taskFns []flow.TaskFn + + for _, v := range []struct { + objectKind string + objectList client.ObjectList + listOptions []client.ListOption + keepResources bool + }{ + { + objectKind: "Machine", + objectList: &machinev1alpha1.MachineList{}, + }, + { + objectKind: "MachineSet", + objectList: &machinev1alpha1.MachineSetList{}, + }, + { + objectKind: "MachineDeployment", + objectList: &machinev1alpha1.MachineDeploymentList{}, + }, + { + objectKind: "MachineClass", + objectList: &machinev1alpha1.MachineClassList{}, + }, + { + objectKind: "Secret", + objectList: &corev1.SecretList{}, + listOptions: []client.ListOption{client.MatchingLabels(map[string]string{v1beta1constants.GardenerPurpose: v1beta1constants.GardenPurposeMachineClass})}, + }, + { + objectKind: "Secret", + objectList: &corev1.SecretList{}, + listOptions: []client.ListOption{client.MatchingLabels(map[string]string{v1beta1constants.GardenerPurpose: v1beta1constants.SecretNameCloudProvider})}, + keepResources: true, + }, + } { + log := b.Logger.WithValues("kind", v.objectKind) + log.Info("Shallow deleting all objects of kind") + + if err := b.SeedClientSet.Client().List(ctx, v.objectList, append(v.listOptions, client.InNamespace(b.Shoot.SeedNamespace))...); err != nil { + return err + } + + if err := meta.EachListItem(v.objectList, func(obj runtime.Object) error { + object := obj.(client.Object) + keep := v.keepResources + + taskFns = append(taskFns, func(ctx context.Context) error { + log.Info("Removing machine-controller-manager finalizers from object", "object", client.ObjectKeyFromObject(object)) + if err := controllerutils.RemoveFinalizers(ctx, b.SeedClientSet.Client(), object, "machine.sapcloud.io/machine-controller-manager", "machine.sapcloud.io/machine-controller"); err != nil { + return fmt.Errorf("failed to remove machine-controller-manager finalizers from secret %s: %w", client.ObjectKeyFromObject(object), err) + } + if keep { + return nil + } + return client.IgnoreNotFound(b.SeedClientSet.Client().Delete(ctx, object)) + }) + + return nil + }); err != nil { + return fmt.Errorf("failed computing task functions for shallow deletion of all %ss: %w", v.objectKind, err) + } + } + + return flow.Parallel(taskFns...)(ctx) +} diff --git a/pkg/operation/botanist/migration_test.go b/pkg/operation/botanist/migration_test.go index 9baaaebc54c..68320575b6d 100644 --- a/pkg/operation/botanist/migration_test.go +++ b/pkg/operation/botanist/migration_test.go @@ -19,15 +19,21 @@ import ( "errors" "fmt" + machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" "github.com/hashicorp/go-multierror" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "go.uber.org/mock/gomock" + 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/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/client" + fakeclient "sigs.k8s.io/controller-runtime/pkg/client/fake" gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" + "github.com/gardener/gardener/pkg/client/kubernetes" + kubernetesfake "github.com/gardener/gardener/pkg/client/kubernetes/fake" mockbackupentry "github.com/gardener/gardener/pkg/component/backupentry/mock" mocketcd "github.com/gardener/gardener/pkg/component/etcd/mock" mockcontainerruntime "github.com/gardener/gardener/pkg/component/extensions/containerruntime/mock" @@ -40,6 +46,7 @@ import ( . "github.com/gardener/gardener/pkg/operation/botanist" "github.com/gardener/gardener/pkg/operation/seed" shootpkg "github.com/gardener/gardener/pkg/operation/shoot" + . "github.com/gardener/gardener/pkg/utils/test/matchers" ) var _ = Describe("migration", func() { @@ -56,8 +63,10 @@ var _ = Describe("migration", func() { botanist *Botanist - ctx = context.TODO() - fakeErr = fmt.Errorf("fake") + ctx = context.TODO() + fakeErr = fmt.Errorf("fake") + fakeClient client.Client + fakeKubernetesInterface kubernetes.Interface ) BeforeEach(func() { @@ -71,7 +80,11 @@ var _ = Describe("migration", func() { operatingSystemConfig = mockoperatingsystemconfig.NewMockInterface(ctrl) worker = mockworker.NewMockInterface(ctrl) + fakeClient = fakeclient.NewClientBuilder().WithScheme(kubernetes.SeedScheme).Build() + fakeKubernetesInterface = kubernetesfake.NewClientSetBuilder().WithClient(fakeClient).Build() + botanist = &Botanist{Operation: &operation.Operation{ + SeedClientSet: fakeKubernetesInterface, Shoot: &shootpkg.Shoot{ Components: &shootpkg.Components{ Extensions: &shootpkg.Extensions{ @@ -350,4 +363,38 @@ var _ = Describe("migration", func() { Expect(botanist.IsRestorePhase()).To(BeFalse()) }) }) + + Describe("#ShallowDeleteMachineResources", func() { + It("should delete most of the resources and remove MCM finalizers", func() { + var ( + machine = &machinev1alpha1.Machine{ObjectMeta: metav1.ObjectMeta{GenerateName: "obj-", Namespace: shootNamespace, Finalizers: []string{"machine.sapcloud.io/machine-controller-manager", "machine.sapcloud.io/machine-controller"}}} + machineSet = &machinev1alpha1.MachineSet{ObjectMeta: metav1.ObjectMeta{GenerateName: "obj-", Namespace: shootNamespace, Finalizers: []string{"machine.sapcloud.io/machine-controller-manager", "machine.sapcloud.io/machine-controller"}}} + machineDeployment = &machinev1alpha1.MachineDeployment{ObjectMeta: metav1.ObjectMeta{GenerateName: "obj-", Namespace: shootNamespace, Finalizers: []string{"machine.sapcloud.io/machine-controller-manager", "machine.sapcloud.io/machine-controller"}}} + machineClass = &machinev1alpha1.MachineClass{ObjectMeta: metav1.ObjectMeta{GenerateName: "obj-", Namespace: shootNamespace, Finalizers: []string{"machine.sapcloud.io/machine-controller-manager", "machine.sapcloud.io/machine-controller"}}} + machineClassSecret = &corev1.Secret{ObjectMeta: metav1.ObjectMeta{GenerateName: "obj-", Namespace: shootNamespace, Finalizers: []string{"machine.sapcloud.io/machine-controller-manager", "machine.sapcloud.io/machine-controller"}, Labels: map[string]string{"gardener.cloud/purpose": "machineclass"}}} + cloudProviderSecret = &corev1.Secret{ObjectMeta: metav1.ObjectMeta{GenerateName: "obj-", Namespace: shootNamespace, Finalizers: []string{"machine.sapcloud.io/machine-controller-manager", "machine.sapcloud.io/machine-controller", "do-not-remove-me"}, Labels: map[string]string{"gardener.cloud/purpose": "cloudprovider"}}} + unrelatedSecret = &corev1.Secret{ObjectMeta: metav1.ObjectMeta{GenerateName: "obj-", Namespace: shootNamespace}} + ) + + Expect(fakeClient.Create(ctx, machine)).To(Succeed()) + Expect(fakeClient.Create(ctx, machineSet)).To(Succeed()) + Expect(fakeClient.Create(ctx, machineDeployment)).To(Succeed()) + Expect(fakeClient.Create(ctx, machineClass)).To(Succeed()) + Expect(fakeClient.Create(ctx, machineClassSecret)).To(Succeed()) + Expect(fakeClient.Create(ctx, cloudProviderSecret)).To(Succeed()) + Expect(fakeClient.Create(ctx, unrelatedSecret)).To(Succeed()) + + Expect(botanist.ShallowDeleteMachineResources(ctx)).To(Succeed()) + + Expect(fakeClient.Get(ctx, client.ObjectKeyFromObject(machine), machine)).To(BeNotFoundError()) + Expect(fakeClient.Get(ctx, client.ObjectKeyFromObject(machineSet), machineSet)).To(BeNotFoundError()) + Expect(fakeClient.Get(ctx, client.ObjectKeyFromObject(machineDeployment), machineDeployment)).To(BeNotFoundError()) + Expect(fakeClient.Get(ctx, client.ObjectKeyFromObject(machineClass), machineClass)).To(BeNotFoundError()) + Expect(fakeClient.Get(ctx, client.ObjectKeyFromObject(machineClassSecret), machineClassSecret)).To(BeNotFoundError()) + Expect(fakeClient.Get(ctx, client.ObjectKeyFromObject(cloudProviderSecret), cloudProviderSecret)).To(Succeed()) + Expect(cloudProviderSecret.DeletionTimestamp).To(BeNil()) + Expect(cloudProviderSecret.Finalizers).To(ConsistOf("do-not-remove-me")) + Expect(fakeClient.Get(ctx, client.ObjectKeyFromObject(unrelatedSecret), unrelatedSecret)).To(Succeed()) + }) + }) }) diff --git a/pkg/operation/botanist/secrets.go b/pkg/operation/botanist/secrets.go index 18d33f6f3a0..d1b50eafcf6 100644 --- a/pkg/operation/botanist/secrets.go +++ b/pkg/operation/botanist/secrets.go @@ -115,7 +115,7 @@ func (b *Botanist) restoreSecretsFromShootStateForSecretsManagerAdoption(ctx con entry := v if entry.Labels[secretsmanager.LabelKeyManagedBy] != secretsmanager.LabelValueSecretsManager || - entry.Type != "secret" { + entry.Type != v1beta1constants.DataTypeSecret { continue } diff --git a/pkg/provider-local/controller/worker/actuator.go b/pkg/provider-local/controller/worker/actuator.go index 62dbe0056d3..3bfe61a1e21 100644 --- a/pkg/provider-local/controller/worker/actuator.go +++ b/pkg/provider-local/controller/worker/actuator.go @@ -28,6 +28,7 @@ import ( "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/cluster" "sigs.k8s.io/controller-runtime/pkg/manager" extensionsconfig "github.com/gardener/gardener/extensions/pkg/apis/config" @@ -46,10 +47,11 @@ import ( ) type delegateFactory struct { - client client.Client - decoder runtime.Decoder - restConfig *rest.Config - scheme *runtime.Scheme + gardenReader client.Reader + seedClient client.Client + decoder runtime.Decoder + restConfig *rest.Config + scheme *runtime.Scheme } type actuator struct { @@ -58,7 +60,7 @@ type actuator struct { } // NewActuator creates a new Actuator that updates the status of the handled WorkerPoolConfigs. -func NewActuator(mgr manager.Manager, gardenletManagesMCM bool) (worker.Actuator, error) { +func NewActuator(mgr manager.Manager, gardenCluster cluster.Cluster, gardenletManagesMCM bool) (worker.Actuator, error) { var ( mcmName string mcmChartSeed *chart.Chart @@ -66,10 +68,11 @@ func NewActuator(mgr manager.Manager, gardenletManagesMCM bool) (worker.Actuator imageVector imagevector.ImageVector chartRendererFactory extensionscontroller.ChartRendererFactory workerDelegate = &delegateFactory{ - client: mgr.GetClient(), - decoder: serializer.NewCodecFactory(mgr.GetScheme(), serializer.EnableStrict).UniversalDecoder(), - restConfig: mgr.GetConfig(), - scheme: mgr.GetScheme(), + gardenReader: gardenCluster.GetAPIReader(), + seedClient: mgr.GetClient(), + decoder: serializer.NewCodecFactory(mgr.GetScheme(), serializer.EnableStrict).UniversalDecoder(), + restConfig: mgr.GetConfig(), + scheme: mgr.GetScheme(), } ) @@ -83,6 +86,7 @@ func NewActuator(mgr manager.Manager, gardenletManagesMCM bool) (worker.Actuator genericactuator, err := genericactuator.NewActuator( mgr, + gardenCluster, workerDelegate, mcmName, mcmChartSeed, @@ -102,7 +106,7 @@ func NewActuator(mgr manager.Manager, gardenletManagesMCM bool) (worker.Actuator } func (a *actuator) Restore(ctx context.Context, log logr.Logger, worker *extensionsv1alpha1.Worker, cluster *extensionscontroller.Cluster) error { - if err := genericactuator.RestoreWithoutReconcile(ctx, log, a.workerDelegate.client, a.workerDelegate, worker, cluster); err != nil { + if err := genericactuator.RestoreWithoutReconcile(ctx, log, a.workerDelegate.gardenReader, a.workerDelegate.seedClient, a.workerDelegate, worker, cluster); err != nil { return fmt.Errorf("failed restoring the worker state: %w", err) } @@ -124,18 +128,18 @@ func (a *actuator) Restore(ctx context.Context, log logr.Logger, worker *extensi } func (a *actuator) deleteNoLongerNeededMachines(ctx context.Context, log logr.Logger, namespace string) error { - _, shootClient, err := util.NewClientForShoot(ctx, a.workerDelegate.client, namespace, client.Options{}, extensionsconfig.RESTOptions{}) + _, shootClient, err := util.NewClientForShoot(ctx, a.workerDelegate.seedClient, namespace, client.Options{}, extensionsconfig.RESTOptions{}) if err != nil { return fmt.Errorf("failed creating client for shoot cluster: %w", err) } machineList := &machinev1alpha1.MachineList{} - if err := a.workerDelegate.client.List(ctx, machineList, client.InNamespace(namespace)); err != nil { + if err := a.workerDelegate.seedClient.List(ctx, machineList, client.InNamespace(namespace)); err != nil { return fmt.Errorf("failed listing machines: %w", err) } podList := &corev1.PodList{} - if err := a.workerDelegate.client.List(ctx, podList, client.InNamespace(namespace), client.MatchingLabels{"app": "machine"}); err != nil { + if err := a.workerDelegate.seedClient.List(ctx, podList, client.InNamespace(namespace), client.MatchingLabels{"app": "machine"}); err != nil { return fmt.Errorf("failed listing pods: %w", err) } @@ -156,7 +160,7 @@ func (a *actuator) deleteNoLongerNeededMachines(ctx context.Context, log logr.Lo return fmt.Errorf("failed deleting node %q for machine %q: %w", nodeName, machine.Name, err) } - if err := a.workerDelegate.client.Delete(ctx, machine.DeepCopy()); err != nil { + if err := a.workerDelegate.seedClient.Delete(ctx, machine.DeepCopy()); err != nil { return fmt.Errorf("failed deleting machine %q: %w", machine.Name, err) } } @@ -181,7 +185,7 @@ func (d *delegateFactory) WorkerDelegate(_ context.Context, worker *extensionsv1 } return NewWorkerDelegate( - d.client, + d.seedClient, d.decoder, d.scheme, seedChartApplier, diff --git a/pkg/provider-local/controller/worker/add.go b/pkg/provider-local/controller/worker/add.go index 97f2f03830a..6c88462fdb0 100644 --- a/pkg/provider-local/controller/worker/add.go +++ b/pkg/provider-local/controller/worker/add.go @@ -19,6 +19,7 @@ import ( machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" apiextensionsscheme "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme" + "sigs.k8s.io/controller-runtime/pkg/cluster" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/manager" @@ -33,6 +34,8 @@ var ( // AddOptions are options to apply when adding the local worker controller to the manager. type AddOptions struct { + // GardenCluster is the garden cluster object. + GardenCluster cluster.Cluster // Controller are the controller.Options. Controller controller.Options // IgnoreOperationAnnotation specifies whether to ignore the operation annotation or not. @@ -52,7 +55,7 @@ func AddToManagerWithOptions(ctx context.Context, mgr manager.Manager, opts AddO return err } - actuator, err := NewActuator(mgr, opts.GardenletManagesMCM) + actuator, err := NewActuator(mgr, opts.GardenCluster, opts.GardenletManagesMCM) if err != nil { return err } diff --git a/pkg/provider-local/controller/worker/machines.go b/pkg/provider-local/controller/worker/machines.go index 07712bf76c9..22eee18646a 100644 --- a/pkg/provider-local/controller/worker/machines.go +++ b/pkg/provider-local/controller/worker/machines.go @@ -31,21 +31,6 @@ import ( "github.com/gardener/gardener/pkg/provider-local/local" ) -// MachineClassKind yields the name of the machine class kind used by local provider. -func (w *workerDelegate) MachineClassKind() string { - return "MachineClass" -} - -// MachineClassList yields a newly initialized MachineClassList object. -func (w *workerDelegate) MachineClassList() client.ObjectList { - return &machinev1alpha1.MachineClassList{} -} - -// MachineClass yields a newly initialized MachineClass object. -func (w *workerDelegate) MachineClass() client.Object { - return &machinev1alpha1.MachineClass{} -} - // DeployMachineClasses generates and creates the local provider specific machine classes. func (w *workerDelegate) DeployMachineClasses(ctx context.Context) error { if w.machineClasses == nil { @@ -116,7 +101,7 @@ func (w *workerDelegate) generateMachineConfig() error { ObjectMeta: metav1.ObjectMeta{ Name: className, Namespace: w.worker.Namespace, - Labels: map[string]string{v1beta1constants.GardenerPurpose: genericworkeractuator.GardenPurposeMachineClass}, + Labels: map[string]string{v1beta1constants.GardenerPurpose: v1beta1constants.GardenPurposeMachineClass}, }, Type: corev1.SecretTypeOpaque, Data: map[string][]byte{"userData": pool.UserData}, diff --git a/pkg/utils/gardener/machines.go b/pkg/utils/gardener/machines.go new file mode 100644 index 00000000000..ca2b557c366 --- /dev/null +++ b/pkg/utils/gardener/machines.go @@ -0,0 +1,170 @@ +// Copyright 2023 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 gardener + +import ( + "context" + "fmt" + "strings" + "time" + + machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" + "github.com/go-logr/logr" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + + v1beta1constants "github.com/gardener/gardener/pkg/apis/core/v1beta1/constants" + retryutils "github.com/gardener/gardener/pkg/utils/retry" +) + +const ( + nameLabel = "name" + // MachineSetKind is the kind of the owner reference of a machine set + MachineSetKind = "MachineSet" + // MachineDeploymentKind is the kind of the owner reference of a machine deployment + MachineDeploymentKind = "MachineDeployment" +) + +// BuildOwnerToMachinesMap returns a map that associates `MachineSet` names to the given `machines`. +func BuildOwnerToMachinesMap(machines []machinev1alpha1.Machine) map[string][]machinev1alpha1.Machine { + ownerToMachines := make(map[string][]machinev1alpha1.Machine) + for index, machine := range machines { + if len(machine.OwnerReferences) > 0 { + for _, reference := range machine.OwnerReferences { + if reference.Kind == MachineSetKind { + ownerToMachines[reference.Name] = append(ownerToMachines[reference.Name], machines[index]) + } + } + } else if len(machine.Labels) > 0 { + if machineDeploymentName, ok := machine.Labels[nameLabel]; ok { + ownerToMachines[machineDeploymentName] = append(ownerToMachines[machineDeploymentName], machines[index]) + } + } + } + return ownerToMachines +} + +// BuildOwnerToMachineSetsMap returns a map that associates `MachineDeployment` names to the given `machineSets`. +func BuildOwnerToMachineSetsMap(machineSets []machinev1alpha1.MachineSet) map[string][]machinev1alpha1.MachineSet { + ownerToMachineSets := make(map[string][]machinev1alpha1.MachineSet) + for index, machineSet := range machineSets { + if len(machineSet.OwnerReferences) > 0 { + for _, reference := range machineSet.OwnerReferences { + if reference.Kind == MachineDeploymentKind { + ownerToMachineSets[reference.Name] = append(ownerToMachineSets[reference.Name], machineSets[index]) + } + } + } else if len(machineSet.Labels) > 0 { + if machineDeploymentName, ok := machineSet.Labels[nameLabel]; ok { + ownerToMachineSets[machineDeploymentName] = append(ownerToMachineSets[machineDeploymentName], machineSets[index]) + } + } + } + return ownerToMachineSets +} + +// WaitUntilMachineResourcesDeleted waits for a maximum of 30 minutes until all machine resources have been properly +// deleted by the machine-controller-manager. It polls the status every 5 seconds. +func WaitUntilMachineResourcesDeleted(ctx context.Context, log logr.Logger, reader client.Reader, namespace string) error { + var ( + countMachines = -1 + countMachineSets = -1 + countMachineDeployments = -1 + countMachineClasses = -1 + countMachineClassSecrets = -1 + ) + log.Info("Waiting until all machine resources have been deleted") + + return retryutils.UntilTimeout(ctx, 5*time.Second, 5*time.Minute, func(ctx context.Context) (bool, error) { + var msg string + + // Check whether all machines have been deleted. + if countMachines != 0 { + machineList := &metav1.PartialObjectMetadataList{} + machineList.SetGroupVersionKind(machinev1alpha1.SchemeGroupVersion.WithKind("MachineList")) + if err := reader.List(ctx, machineList, client.InNamespace(namespace)); err != nil { + return retryutils.SevereError(err) + } + countMachines = len(machineList.Items) + msg += fmt.Sprintf("%d machines, ", countMachines) + } + + // Check whether all machine sets have been deleted. + if countMachineSets != 0 { + machineSetList := &metav1.PartialObjectMetadataList{} + machineSetList.SetGroupVersionKind(machinev1alpha1.SchemeGroupVersion.WithKind("MachineSetList")) + if err := reader.List(ctx, machineSetList, client.InNamespace(namespace)); err != nil { + return retryutils.SevereError(err) + } + countMachineSets = len(machineSetList.Items) + msg += fmt.Sprintf("%d machine sets, ", countMachineSets) + } + + // Check whether all machine deployments have been deleted. + if countMachineDeployments != 0 { + machineDeploymentList := &machinev1alpha1.MachineDeploymentList{} + if err := reader.List(ctx, machineDeploymentList, client.InNamespace(namespace)); err != nil { + return retryutils.SevereError(err) + } + countMachineDeployments = len(machineDeploymentList.Items) + msg += fmt.Sprintf("%d machine deployments, ", countMachineDeployments) + + // Check whether an operation failed during the deletion process. + for _, existingMachineDeployment := range machineDeploymentList.Items { + for _, failedMachine := range existingMachineDeployment.Status.FailedMachines { + return retryutils.SevereError(fmt.Errorf("machine %s failed: %s", failedMachine.Name, failedMachine.LastOperation.Description)) + } + } + } + + // Check whether all machine classes have been deleted. + if countMachineClasses != 0 { + machineClassList := &metav1.PartialObjectMetadataList{} + machineClassList.SetGroupVersionKind(machinev1alpha1.SchemeGroupVersion.WithKind("MachineClassList")) + if err := reader.List(ctx, machineClassList, client.InNamespace(namespace)); err != nil { + return retryutils.SevereError(err) + } + countMachineClasses = len(machineClassList.Items) + msg += fmt.Sprintf("%d machine classes, ", countMachineClasses) + } + + // Check whether all machine class secrets have been deleted. + if countMachineClassSecrets != 0 { + count := 0 + machineClassSecretsList := &metav1.PartialObjectMetadataList{} + machineClassSecretsList.SetGroupVersionKind(corev1.SchemeGroupVersion.WithKind("SecretList")) + if err := reader.List(ctx, machineClassSecretsList, client.InNamespace(namespace), client.MatchingLabels(map[string]string{v1beta1constants.GardenerPurpose: v1beta1constants.GardenPurposeMachineClass})); err != nil { + return retryutils.SevereError(err) + } + for _, machineClassSecret := range machineClassSecretsList.Items { + if len(machineClassSecret.Finalizers) != 0 { + count++ + } + } + countMachineClassSecrets = count + msg += fmt.Sprintf("%d machine class secrets, ", countMachineClassSecrets) + } + + if countMachines != 0 || countMachineSets != 0 || countMachineDeployments != 0 || countMachineClasses != 0 || countMachineClassSecrets != 0 { + log.Info("Waiting until machine resources have been deleted", + "machines", countMachines, "machineSets", countMachineSets, "machineDeployments", countMachineDeployments, + "machineClasses", countMachineClasses, "machineClassSecrets", countMachineClassSecrets) + return retryutils.MinorError(fmt.Errorf("waiting until the following machine resources have been deleted: %s", strings.TrimSuffix(msg, ", "))) + } + + return retryutils.Ok() + }) +} diff --git a/pkg/utils/gardener/machines_test.go b/pkg/utils/gardener/machines_test.go new file mode 100644 index 00000000000..6558ed996a5 --- /dev/null +++ b/pkg/utils/gardener/machines_test.go @@ -0,0 +1,186 @@ +// Copyright 2023 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 gardener_test + +import ( + "context" + + machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" + "github.com/go-logr/logr" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + fakeclient "sigs.k8s.io/controller-runtime/pkg/client/fake" + + "github.com/gardener/gardener/pkg/client/kubernetes" + . "github.com/gardener/gardener/pkg/utils/gardener" + "github.com/gardener/gardener/pkg/utils/retry" + retryfake "github.com/gardener/gardener/pkg/utils/retry/fake" + "github.com/gardener/gardener/pkg/utils/test" +) + +var _ = Describe("Machines", func() { + machineSetName := "machine-set-1" + machineDeploymentName := "machine-deployment-1" + var ( + machineSetReference = machinev1alpha1.Machine{ + ObjectMeta: metav1.ObjectMeta{ + OwnerReferences: []metav1.OwnerReference{ + { + Kind: MachineSetKind, + Name: machineSetName, + }, + }, + }, + } + + machineDeploymentReference = machinev1alpha1.Machine{ + ObjectMeta: metav1.ObjectMeta{ + OwnerReferences: []metav1.OwnerReference{ + { + Kind: MachineDeploymentKind, + Name: machineDeploymentName, + }, + }, + }, + } + + machineLabelReference = machinev1alpha1.Machine{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + "name": machineDeploymentName, + }, + }, + } + ) + + DescribeTable("#BuildOwnerToMachinesMap", func(machines []machinev1alpha1.Machine, expected map[string][]machinev1alpha1.Machine) { + result := BuildOwnerToMachinesMap(machines) + Expect(result).To(Equal(expected)) + }, + Entry("should map using reference kind = `MachineSet`", []machinev1alpha1.Machine{machineSetReference, machineLabelReference}, map[string][]machinev1alpha1.Machine{ + machineSetName: {machineSetReference}, machineDeploymentName: {machineLabelReference}, + }), + + Entry("should map using label with key `name`", []machinev1alpha1.Machine{machineLabelReference}, map[string][]machinev1alpha1.Machine{ + machineDeploymentName: {machineLabelReference}, + }), + + Entry("should not consider machines with machine deployment reference", []machinev1alpha1.Machine{machineSetReference, machineDeploymentReference, machineLabelReference}, map[string][]machinev1alpha1.Machine{ + machineSetName: {machineSetReference}, machineDeploymentName: {machineLabelReference}, + }), + ) + + var ( + machineSetWithOwnerReference = machinev1alpha1.MachineSet{ + ObjectMeta: metav1.ObjectMeta{ + OwnerReferences: []metav1.OwnerReference{ + { + Kind: MachineDeploymentKind, + Name: machineDeploymentName, + }, + }, + }, + } + + machineSetWithWrongOwnerReference = machinev1alpha1.MachineSet{ + ObjectMeta: metav1.ObjectMeta{ + OwnerReferences: []metav1.OwnerReference{ + { + Kind: MachineSetKind, + Name: machineDeploymentName, + }, + }, + }, + } + + machineSetWithLabelReference = machinev1alpha1.MachineSet{ + ObjectMeta: metav1.ObjectMeta{ + Labels: map[string]string{ + "name": machineDeploymentName, + }, + }, + } + ) + + DescribeTable("#BuildOwnerToMachineSetsMap", func(machines []machinev1alpha1.MachineSet, expected map[string][]machinev1alpha1.MachineSet) { + result := BuildOwnerToMachineSetsMap(machines) + Expect(result).To(Equal(expected)) + }, + Entry("should map using reference kind = `MachineDeployment", []machinev1alpha1.MachineSet{machineSetWithOwnerReference}, map[string][]machinev1alpha1.MachineSet{ + machineDeploymentName: {machineSetWithOwnerReference}, + }), + + Entry("should map using label with key `name`", []machinev1alpha1.MachineSet{machineSetWithLabelReference}, map[string][]machinev1alpha1.MachineSet{ + machineDeploymentName: {machineSetWithLabelReference}, + }), + + Entry("should not consider machines with machine set reference", []machinev1alpha1.MachineSet{machineSetWithOwnerReference, machineSetWithLabelReference, machineSetWithWrongOwnerReference}, map[string][]machinev1alpha1.MachineSet{ + machineDeploymentName: {machineSetWithOwnerReference, machineSetWithLabelReference}, + }), + ) + + Describe("#WaitUntilMachineResourcesDeleted", func() { + var ( + ctx = context.TODO() + log = logr.Discard() + fakeClient client.Client + fakeOps *retryfake.Ops + + namespace = "namespace" + ) + + BeforeEach(func() { + fakeOps = &retryfake.Ops{MaxAttempts: 1} + fakeClient = fakeclient.NewClientBuilder().WithScheme(kubernetes.SeedScheme).Build() + + DeferCleanup(test.WithVars( + &retry.Until, fakeOps.Until, + &retry.UntilTimeout, fakeOps.UntilTimeout, + )) + }) + + It("should succeed because no machine objects exist", func() { + Expect(WaitUntilMachineResourcesDeleted(ctx, log, fakeClient, namespace)).To(Succeed()) + }) + + It("should fail because MachineDeployments are left", func() { + Expect(fakeClient.Create(ctx, &machinev1alpha1.MachineDeployment{ObjectMeta: metav1.ObjectMeta{GenerateName: "obj-", Namespace: namespace}})).To(Succeed()) + Expect(WaitUntilMachineResourcesDeleted(ctx, log, fakeClient, namespace)).To(MatchError(ContainSubstring("waiting until the following machine resources have been deleted: 0 machines, 0 machine sets, 1 machine deployments, 0 machine classes, 0 machine class secrets"))) + }) + + It("should fail because MachineSets are left", func() { + Expect(fakeClient.Create(ctx, &machinev1alpha1.MachineSet{ObjectMeta: metav1.ObjectMeta{GenerateName: "obj-", Namespace: namespace}})).To(Succeed()) + Expect(WaitUntilMachineResourcesDeleted(ctx, log, fakeClient, namespace)).To(MatchError(ContainSubstring("waiting until the following machine resources have been deleted: 0 machines, 1 machine sets, 0 machine deployments, 0 machine classes, 0 machine class secrets"))) + }) + + It("should fail because Machine are left", func() { + Expect(fakeClient.Create(ctx, &machinev1alpha1.Machine{ObjectMeta: metav1.ObjectMeta{GenerateName: "obj-", Namespace: namespace}})).To(Succeed()) + Expect(WaitUntilMachineResourcesDeleted(ctx, log, fakeClient, namespace)).To(MatchError(ContainSubstring("waiting until the following machine resources have been deleted: 1 machines, 0 machine sets, 0 machine deployments, 0 machine classes, 0 machine class secrets"))) + }) + + It("should fail because MachineClasses are left", func() { + Expect(fakeClient.Create(ctx, &machinev1alpha1.MachineClass{ObjectMeta: metav1.ObjectMeta{GenerateName: "obj-", Namespace: namespace}})).To(Succeed()) + Expect(WaitUntilMachineResourcesDeleted(ctx, log, fakeClient, namespace)).To(MatchError(ContainSubstring("waiting until the following machine resources have been deleted: 0 machines, 0 machine sets, 0 machine deployments, 1 machine classes, 0 machine class secrets"))) + }) + + It("should fail because MachineClass secrets are left", func() { + Expect(fakeClient.Create(ctx, &corev1.Secret{ObjectMeta: metav1.ObjectMeta{GenerateName: "obj-", Namespace: namespace, Labels: map[string]string{"gardener.cloud/purpose": "machineclass"}, Finalizers: []string{"foo"}}})).To(Succeed()) + Expect(WaitUntilMachineResourcesDeleted(ctx, log, fakeClient, namespace)).To(MatchError(ContainSubstring("waiting until the following machine resources have been deleted: 0 machines, 0 machine sets, 0 machine deployments, 0 machine classes, 1 machine class secrets"))) + }) + }) +}) diff --git a/pkg/utils/gardener/shootstate/machines.go b/pkg/utils/gardener/shootstate/machines.go new file mode 100644 index 00000000000..350b70e1c7a --- /dev/null +++ b/pkg/utils/gardener/shootstate/machines.go @@ -0,0 +1,146 @@ +// Copyright 2023 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file +// +// 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 shootstate + +import ( + "cmp" + "context" + "slices" + + machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + + gardenerutils "github.com/gardener/gardener/pkg/utils/gardener" +) + +// MachineDeploymentState stores the last versions of the machine sets and machines to which the machine deployment +// corresponds. +type MachineDeploymentState struct { + Replicas int32 `json:"replicas,omitempty"` + MachineSets []machinev1alpha1.MachineSet `json:"machineSets,omitempty"` + Machines []machinev1alpha1.Machine `json:"machines,omitempty"` +} + +// MachineState represent the last known state of the machines. +type MachineState struct { + MachineDeployments map[string]*MachineDeploymentState `json:"machineDeployments,omitempty"` +} + +func computeMachineState(ctx context.Context, seedClient client.Client, namespace string) (*MachineState, error) { + state := &MachineState{MachineDeployments: make(map[string]*MachineDeploymentState)} + + machineDeployments := &machinev1alpha1.MachineDeploymentList{} + if err := seedClient.List(ctx, machineDeployments, client.InNamespace(namespace)); err != nil { + return nil, err + } + + machineDeploymentToMachineSets, err := getMachineDeploymentToMachineSetsMap(ctx, seedClient, namespace) + if err != nil { + return nil, err + } + + machineSetToMachines, err := getMachineSetToMachinesMap(ctx, seedClient, namespace) + if err != nil { + return nil, err + } + + var allMachines []machinev1alpha1.Machine + for _, machineDeployment := range machineDeployments.Items { + machineSets, ok := machineDeploymentToMachineSets[machineDeployment.Name] + if !ok { + continue + } + + for i, machineSet := range machineSets { + // remove irrelevant data from the machine set + machineSets[i].ObjectMeta = metav1.ObjectMeta{ + Name: machineSet.Name, + Namespace: machineSet.Namespace, + Annotations: machineSet.Annotations, + Labels: machineSet.Labels, + } + machineSets[i].Status = machinev1alpha1.MachineSetStatus{} + + // fetch machines related to the machine set/deployment + machines := append(machineSetToMachines[machineSet.Name], machineSetToMachines[machineDeployment.Name]...) + if len(machines) == 0 { + continue + } + + for j, machine := range machines { + // remove irrelevant data from the machine + machines[j].ObjectMeta = metav1.ObjectMeta{ + Name: machine.Name, + Namespace: machine.Namespace, + Annotations: machine.Annotations, + Labels: machine.Labels, + } + machines[j].Status = machinev1alpha1.MachineStatus{} + } + + allMachines = append(allMachines, machines...) + } + + state.MachineDeployments[machineDeployment.Name] = &MachineDeploymentState{ + Replicas: machineDeployment.Spec.Replicas, + MachineSets: machineSets, + Machines: allMachines, + } + } + + return state, nil +} + +func getMachineDeploymentToMachineSetsMap(ctx context.Context, c client.Client, namespace string) (map[string][]machinev1alpha1.MachineSet, error) { + existingMachineSets := &machinev1alpha1.MachineSetList{} + if err := c.List(ctx, existingMachineSets, client.InNamespace(namespace)); err != nil { + return nil, err + } + + // When we read from the cache we get unsorted results, hence, we sort to prevent unnecessary state updates from + // happening. + slices.SortFunc(existingMachineSets.Items, func(a, b machinev1alpha1.MachineSet) int { + return cmp.Compare(a.Name, b.Name) + }) + + return gardenerutils.BuildOwnerToMachineSetsMap(existingMachineSets.Items), nil +} + +func getMachineSetToMachinesMap(ctx context.Context, seedClient client.Client, namespace string) (map[string][]machinev1alpha1.Machine, error) { + existingMachines := &machinev1alpha1.MachineList{} + if err := seedClient.List(ctx, existingMachines, client.InNamespace(namespace)); err != nil { + return nil, err + } + + // We temporarily filter out machines without provider ID or node label (VMs which got created but not yet joined + // the cluster) to prevent unnecessarily persisting them in the Worker state. + // TODO: Remove this again once machine-controller-manager supports backing off creation/deletion of failed + // machines, see https://github.com/gardener/machine-controller-manager/issues/483. + var filteredMachines []machinev1alpha1.Machine + for _, machine := range existingMachines.Items { + if _, ok := machine.Labels["node"]; ok || machine.Spec.ProviderID != "" { + filteredMachines = append(filteredMachines, machine) + } + } + + // When we read from the cache we get unsorted results, hence, we sort to prevent unnecessary state updates from + // happening. + slices.SortFunc(filteredMachines, func(a, b machinev1alpha1.Machine) int { + return cmp.Compare(a.Name, b.Name) + }) + + return gardenerutils.BuildOwnerToMachinesMap(filteredMachines), nil +} diff --git a/pkg/utils/gardener/shootstate/shootstate.go b/pkg/utils/gardener/shootstate/shootstate.go index 2e4ddd24bfb..830c7d7dab1 100644 --- a/pkg/utils/gardener/shootstate/shootstate.go +++ b/pkg/utils/gardener/shootstate/shootstate.go @@ -73,6 +73,9 @@ func Deploy(ctx context.Context, clock clock.Clock, gardenClient, seedClient cli for _, data := range spec.Extensions { extensionsData.Upsert(data.DeepCopy()) } + // Temporarily not persist the Worker state since this data is already explicitly persisted by gardenlet in `.spec.gardener[]`. + // TODO(rfranzke): Delete the next line after Gardener v1.86 has been released. + extensionsData.Delete(extensionsv1alpha1.WorkerResource, &shoot.Name, nil) shootState.Spec.Extensions = extensionsData resourcesData := v1beta1helper.ResourceDataList(shootState.Spec.Resources) @@ -130,6 +133,36 @@ func computeGardenerData( ) ( []gardencorev1beta1.GardenerResourceData, error, +) { + secretsToPersist, err := computeSecretsToPersist(ctx, seedClient, seedNamespace) + if err != nil { + return nil, err + } + + machineState, err := computeMachineState(ctx, seedClient, seedNamespace) + if err != nil { + return nil, err + } + + machineStateJSON, err := json.Marshal(machineState) + if err != nil { + return nil, fmt.Errorf("failed marshalling machine state to JSON: %w", err) + } + + return append(secretsToPersist, gardencorev1beta1.GardenerResourceData{ + Name: v1beta1constants.DataTypeMachineState, + Type: v1beta1constants.DataTypeMachineState, + Data: runtime.RawExtension{Raw: machineStateJSON}, + }), nil +} + +func computeSecretsToPersist( + ctx context.Context, + seedClient client.Client, + seedNamespace string, +) ( + []gardencorev1beta1.GardenerResourceData, + error, ) { secretList := &corev1.SecretList{} if err := seedClient.List(ctx, secretList, client.InNamespace(seedNamespace), client.MatchingLabels{ @@ -150,7 +183,7 @@ func computeGardenerData( dataList = append(dataList, gardencorev1beta1.GardenerResourceData{ Name: secret.Name, Labels: secret.Labels, - Type: "secret", + Type: v1beta1constants.DataTypeSecret, Data: runtime.RawExtension{Raw: dataJSON}, }) } @@ -184,7 +217,9 @@ func computeExtensionsDataAndResources( {extensionsv1alpha1.InfrastructureResource, func() client.ObjectList { return &extensionsv1alpha1.InfrastructureList{} }}, {extensionsv1alpha1.NetworkResource, func() client.ObjectList { return &extensionsv1alpha1.NetworkList{} }}, {extensionsv1alpha1.OperatingSystemConfigResource, func() client.ObjectList { return &extensionsv1alpha1.OperatingSystemConfigList{} }}, - {extensionsv1alpha1.WorkerResource, func() client.ObjectList { return &extensionsv1alpha1.WorkerList{} }}, + // Temporarily not persist the Worker state since this data is already explicitly persisted by gardenlet in `.spec.gardener[]`. + // TODO(rfranzke): Uncomment next line after Gardener v1.86 has been released. + // {extensionsv1alpha1.WorkerResource, func() client.ObjectList { return &extensionsv1alpha1.WorkerList{} }}, } { objList := extension.newObjectListFunc() if err := seedClient.List(ctx, objList, client.InNamespace(seedNamespace)); err != nil { diff --git a/pkg/utils/gardener/shootstate/shootstate_test.go b/pkg/utils/gardener/shootstate/shootstate_test.go index 0c74d83a8c1..aa8d50d0bac 100644 --- a/pkg/utils/gardener/shootstate/shootstate_test.go +++ b/pkg/utils/gardener/shootstate/shootstate_test.go @@ -18,6 +18,7 @@ import ( "context" "time" + machinev1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" autoscalingv1 "k8s.io/api/autoscaling/v1" @@ -74,10 +75,12 @@ var _ = Describe("ShootState", func() { }) Describe("#Deploy", func() { - It("should deploy a ShootState with an empty spec when there is nothing to persist", func() { + It("should deploy an empty ShootState when there is nothing to persist", func() { Expect(Deploy(ctx, fakeClock, fakeGardenClient, fakeSeedClient, shoot, true)).To(Succeed()) Expect(fakeGardenClient.Get(ctx, client.ObjectKeyFromObject(shootState), shootState)).To(Succeed()) - Expect(shootState.Spec).To(Equal(gardencorev1beta1.ShootStateSpec{})) + Expect(shootState.Spec).To(Equal(gardencorev1beta1.ShootStateSpec{ + Gardener: []gardencorev1beta1.GardenerResourceData{{Name: "machine-state", Type: "machine-state", Data: runtime.RawExtension{Raw: []byte("{}")}}}, + })) Expect(shootState.Annotations).To(HaveKeyWithValue("gardener.cloud/timestamp", fakeClock.Now().UTC().Format(time.RFC3339))) }) @@ -85,14 +88,16 @@ var _ = Describe("ShootState", func() { var ( existingGardenerData = []gardencorev1beta1.GardenerResourceData{{Name: "some-data"}} existingExtensionsData = []gardencorev1beta1.ExtensionResourceState{{Name: pointer.String("some-data")}} - existingResourcesData = []gardencorev1beta1.ResourceData{{Data: runtime.RawExtension{Raw: []byte("{}")}}} - expectedSpec gardencorev1beta1.ShootStateSpec + // TODO(rfranzke): Remove this `existingWorkerState` after Gardener v1.86 has been released. + existingWorkerState = []gardencorev1beta1.ExtensionResourceState{{Kind: "Worker", Name: pointer.String("my-shoot")}} + existingResourcesData = []gardencorev1beta1.ResourceData{{Data: runtime.RawExtension{Raw: []byte("{}")}}} + expectedSpec gardencorev1beta1.ShootStateSpec ) BeforeEach(func() { By("Create ShootState with some data") shootState.Spec.Gardener = append(shootState.Spec.Gardener, existingGardenerData...) - shootState.Spec.Extensions = append(shootState.Spec.Extensions, existingExtensionsData...) + shootState.Spec.Extensions = append(shootState.Spec.Extensions, append(existingExtensionsData, existingWorkerState...)...) shootState.Spec.Resources = append(shootState.Spec.Resources, existingResourcesData...) Expect(fakeGardenClient.Create(ctx, shootState)).To(Succeed()) @@ -118,6 +123,9 @@ var _ = Describe("ShootState", func() { // this extension object has no state, hence it should not be persisted in the ShootState createExtensionObject(ctx, fakeSeedClient, "osc2", seedNamespace, &extensionsv1alpha1.OperatingSystemConfig{}, nil) + By("Creating machine data") + createMachineObjects(ctx, fakeSeedClient, seedNamespace) + expectedSpec = gardencorev1beta1.ShootStateSpec{ Gardener: []gardencorev1beta1.GardenerResourceData{ { @@ -132,6 +140,11 @@ var _ = Describe("ShootState", func() { Data: runtime.RawExtension{Raw: []byte(`{"secret3":"c29tZS1kYXRh"}`)}, Labels: map[string]string{"managed-by": "secrets-manager", "persist": "true"}, }, + { + Name: "machine-state", + Type: "machine-state", + Data: runtime.RawExtension{Raw: []byte(`{"machineDeployments":{"deploy1":{"machineSets":[{"metadata":{"annotations":{"some":"annotation"},"creationTimestamp":null,"name":"deploy1-set1","namespace":"shoot--my-project--my-shoot"},"spec":{"machineClass":{},"template":{"metadata":{"creationTimestamp":null},"spec":{"class":{},"nodeTemplate":{"metadata":{"creationTimestamp":null},"spec":{}}}}},"status":{"lastOperation":{"lastUpdateTime":null}}},{"metadata":{"annotations":{"some":"annotation"},"creationTimestamp":null,"labels":{"name":"deploy1"},"name":"deploy1-set2","namespace":"shoot--my-project--my-shoot"},"spec":{"machineClass":{},"template":{"metadata":{"creationTimestamp":null},"spec":{"class":{},"nodeTemplate":{"metadata":{"creationTimestamp":null},"spec":{}}}}},"status":{"lastOperation":{"lastUpdateTime":null}}}],"machines":[{"metadata":{"annotations":{"some":"annotation"},"creationTimestamp":null,"labels":{"node":"nodename"},"name":"deploy1-set1-machine1","namespace":"shoot--my-project--my-shoot"},"spec":{"class":{},"nodeTemplate":{"metadata":{"creationTimestamp":null},"spec":{}}},"status":{"currentStatus":{"lastUpdateTime":null},"lastOperation":{"lastUpdateTime":null}}},{"metadata":{"annotations":{"some":"annotation"},"creationTimestamp":null,"labels":{"name":"deploy1"},"name":"deploy1-set2-machine2","namespace":"shoot--my-project--my-shoot"},"spec":{"class":{},"nodeTemplate":{"metadata":{"creationTimestamp":null},"spec":{}},"providerID":"provider-id"},"status":{"currentStatus":{"lastUpdateTime":null},"lastOperation":{"lastUpdateTime":null}}},{"metadata":{"annotations":{"some":"annotation"},"creationTimestamp":null,"labels":{"name":"deploy1"},"name":"deploy1-set2-machine2","namespace":"shoot--my-project--my-shoot"},"spec":{"class":{},"nodeTemplate":{"metadata":{"creationTimestamp":null},"spec":{}},"providerID":"provider-id"},"status":{"currentStatus":{"lastUpdateTime":null},"lastOperation":{"lastUpdateTime":null}}}],"replicas":3}}}`)}, + }, }, Extensions: []gardencorev1beta1.ExtensionResourceState{ { @@ -190,11 +203,12 @@ var _ = Describe("ShootState", func() { Purpose: pointer.String(""), State: &runtime.RawExtension{Raw: []byte(`{"name":"osc"}`)}, }, - { - Kind: "Worker", - Name: pointer.String("worker"), - State: &runtime.RawExtension{Raw: []byte(`{"name":"worker"}`)}, - }, + // TODO(rfranzke): Uncomment next lines after Gardener v1.86 has been released. + // { + // Kind: "Worker", + // Name: pointer.String("worker"), + // State: &runtime.RawExtension{Raw: []byte(`{"name":"worker"}`)}, + // }, }, Resources: []gardencorev1beta1.ResourceData{{ CrossVersionObjectReference: autoscalingv1.CrossVersionObjectReference{ @@ -276,3 +290,92 @@ func createExtensionObject( acc.GetExtensionStatus().SetResources(namedResourceReferences) ExpectWithOffset(1, fakeSeedClient.Patch(ctx, obj, patch)).To(Succeed()) } + +func createMachineObjects( + ctx context.Context, + fakeSeedClient client.Client, + namespace string, +) { + machineDeployment1 := &machinev1alpha1.MachineDeployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "deploy1", + Namespace: namespace, + }, + Spec: machinev1alpha1.MachineDeploymentSpec{Replicas: 3}, + } + ExpectWithOffset(1, fakeSeedClient.Create(ctx, machineDeployment1)).To(Succeed()) + + machineSet1 := &machinev1alpha1.MachineSet{ + ObjectMeta: metav1.ObjectMeta{ + Name: "deploy1-set1", + Namespace: namespace, + OwnerReferences: []metav1.OwnerReference{{Kind: "MachineDeployment", Name: machineDeployment1.Name}}, + Annotations: map[string]string{"some": "annotation"}, + }, + Status: machinev1alpha1.MachineSetStatus{ + Replicas: 1234, + ReadyReplicas: 5678, + }, + } + ExpectWithOffset(1, fakeSeedClient.Create(ctx, machineSet1)).To(Succeed()) + + machineSet2 := &machinev1alpha1.MachineSet{ + ObjectMeta: metav1.ObjectMeta{ + Name: "deploy1-set2", + Namespace: namespace, + Labels: map[string]string{"name": machineDeployment1.Name}, + Annotations: map[string]string{"some": "annotation"}, + }, + Status: machinev1alpha1.MachineSetStatus{ + Replicas: 1234, + ReadyReplicas: 5678, + }, + } + ExpectWithOffset(1, fakeSeedClient.Create(ctx, machineSet2)).To(Succeed()) + + machine1 := &machinev1alpha1.Machine{ + ObjectMeta: metav1.ObjectMeta{ + Name: "deploy1-set1-machine1", + Namespace: namespace, + OwnerReferences: []metav1.OwnerReference{{Kind: "MachineSet", Name: machineSet1.Name}}, + Labels: map[string]string{"node": "nodename"}, + Annotations: map[string]string{"some": "annotation"}, + }, + Status: machinev1alpha1.MachineStatus{ + CurrentStatus: machinev1alpha1.CurrentStatus{TimeoutActive: true}, + }, + } + ExpectWithOffset(1, fakeSeedClient.Create(ctx, machine1)).To(Succeed()) + + machine2 := &machinev1alpha1.Machine{ + ObjectMeta: metav1.ObjectMeta{ + Name: "deploy1-set2-machine2", + Namespace: namespace, + Labels: map[string]string{"name": machineDeployment1.Name}, + Annotations: map[string]string{"some": "annotation"}, + }, + Spec: machinev1alpha1.MachineSpec{ProviderID: "provider-id"}, + Status: machinev1alpha1.MachineStatus{ + CurrentStatus: machinev1alpha1.CurrentStatus{TimeoutActive: true}, + }, + } + ExpectWithOffset(1, fakeSeedClient.Create(ctx, machine2)).To(Succeed()) + + machine3 := &machinev1alpha1.Machine{ + ObjectMeta: metav1.ObjectMeta{ + Name: "deploy1-set2-machine3", + Namespace: namespace, + OwnerReferences: []metav1.OwnerReference{{Kind: "MachineSet", Name: machineSet2.Name}}, + }, + } + ExpectWithOffset(1, fakeSeedClient.Create(ctx, machine3)).To(Succeed()) + + machineDeployment2 := &machinev1alpha1.MachineDeployment{ + ObjectMeta: metav1.ObjectMeta{ + Name: "deploy2", + Namespace: namespace, + }, + Spec: machinev1alpha1.MachineDeploymentSpec{Replicas: 3}, + } + ExpectWithOffset(1, fakeSeedClient.Create(ctx, machineDeployment2)).To(Succeed()) +} diff --git a/skaffold.yaml b/skaffold.yaml index e14d76172c9..efeb1331a8f 100644 --- a/skaffold.yaml +++ b/skaffold.yaml @@ -663,6 +663,7 @@ build: - pkg/utils/errors - pkg/utils/flow - pkg/utils/gardener + - pkg/utils/gardener/shootstate - pkg/utils/imagevector - pkg/utils/kubernetes - pkg/utils/kubernetes/client diff --git a/test/integration/gardenlet/seed/seed/seed_test.go b/test/integration/gardenlet/seed/seed/seed_test.go index 03b2a244540..089c9197b61 100644 --- a/test/integration/gardenlet/seed/seed/seed_test.go +++ b/test/integration/gardenlet/seed/seed/seed_test.go @@ -498,16 +498,10 @@ var _ = Describe("Seed controller tests", func() { var ( crdsOnlyForSeedClusters = []gomegatypes.GomegaMatcher{ // machine-controller-manager - MatchFields(IgnoreExtras, Fields{"ObjectMeta": MatchFields(IgnoreExtras, Fields{"Name": Equal("alicloudmachineclasses.machine.sapcloud.io")})}), - MatchFields(IgnoreExtras, Fields{"ObjectMeta": MatchFields(IgnoreExtras, Fields{"Name": Equal("awsmachineclasses.machine.sapcloud.io")})}), - MatchFields(IgnoreExtras, Fields{"ObjectMeta": MatchFields(IgnoreExtras, Fields{"Name": Equal("azuremachineclasses.machine.sapcloud.io")})}), - MatchFields(IgnoreExtras, Fields{"ObjectMeta": MatchFields(IgnoreExtras, Fields{"Name": Equal("gcpmachineclasses.machine.sapcloud.io")})}), MatchFields(IgnoreExtras, Fields{"ObjectMeta": MatchFields(IgnoreExtras, Fields{"Name": Equal("machineclasses.machine.sapcloud.io")})}), MatchFields(IgnoreExtras, Fields{"ObjectMeta": MatchFields(IgnoreExtras, Fields{"Name": Equal("machinedeployments.machine.sapcloud.io")})}), MatchFields(IgnoreExtras, Fields{"ObjectMeta": MatchFields(IgnoreExtras, Fields{"Name": Equal("machines.machine.sapcloud.io")})}), MatchFields(IgnoreExtras, Fields{"ObjectMeta": MatchFields(IgnoreExtras, Fields{"Name": Equal("machinesets.machine.sapcloud.io")})}), - MatchFields(IgnoreExtras, Fields{"ObjectMeta": MatchFields(IgnoreExtras, Fields{"Name": Equal("openstackmachineclasses.machine.sapcloud.io")})}), - MatchFields(IgnoreExtras, Fields{"ObjectMeta": MatchFields(IgnoreExtras, Fields{"Name": Equal("packetmachineclasses.machine.sapcloud.io")})}), // extensions MatchFields(IgnoreExtras, Fields{"ObjectMeta": MatchFields(IgnoreExtras, Fields{"Name": Equal("backupbuckets.extensions.gardener.cloud")})}), MatchFields(IgnoreExtras, Fields{"ObjectMeta": MatchFields(IgnoreExtras, Fields{"Name": Equal("backupentries.extensions.gardener.cloud")})}), diff --git a/test/integration/gardenlet/shoot/state/state_suite_test.go b/test/integration/gardenlet/shoot/state/state_suite_test.go index 07393060899..e4b4b79f83d 100644 --- a/test/integration/gardenlet/shoot/state/state_suite_test.go +++ b/test/integration/gardenlet/shoot/state/state_suite_test.go @@ -37,7 +37,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/manager" metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server" - extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1" "github.com/gardener/gardener/pkg/client/kubernetes" gardenerenvtest "github.com/gardener/gardener/pkg/envtest" "github.com/gardener/gardener/pkg/gardenlet/apis/config" @@ -91,6 +90,10 @@ var _ = BeforeSuite(func() { filepath.Join("..", "..", "..", "..", "..", "example", "seed-crds", "10-crd-extensions.gardener.cloud_networks.yaml"), filepath.Join("..", "..", "..", "..", "..", "example", "seed-crds", "10-crd-extensions.gardener.cloud_operatingsystemconfigs.yaml"), filepath.Join("..", "..", "..", "..", "..", "example", "seed-crds", "10-crd-extensions.gardener.cloud_workers.yaml"), + filepath.Join("..", "..", "..", "..", "..", "example", "seed-crds", "10-crd-machine.sapcloud.io_machines.yaml"), + filepath.Join("..", "..", "..", "..", "..", "example", "seed-crds", "10-crd-machine.sapcloud.io_machinesets.yaml"), + filepath.Join("..", "..", "..", "..", "..", "example", "seed-crds", "10-crd-machine.sapcloud.io_machinedeployments.yaml"), + filepath.Join("..", "..", "..", "..", "..", "example", "seed-crds", "10-crd-machine.sapcloud.io_machineclasses.yaml"), }, }, ErrorIfCRDPathMissing: true, @@ -114,7 +117,7 @@ var _ = BeforeSuite(func() { testSchemeBuilder := runtime.NewSchemeBuilder( kubernetes.AddGardenSchemeToScheme, - extensionsv1alpha1.AddToScheme, + kubernetes.AddSeedSchemeToScheme, ) testScheme := runtime.NewScheme() Expect(testSchemeBuilder.AddToScheme(testScheme)).To(Succeed()) diff --git a/test/integration/gardenlet/shoot/state/state_test.go b/test/integration/gardenlet/shoot/state/state_test.go index 8f489509bb3..447d9065586 100644 --- a/test/integration/gardenlet/shoot/state/state_test.go +++ b/test/integration/gardenlet/shoot/state/state_test.go @@ -21,6 +21,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" @@ -39,6 +40,8 @@ var _ = Describe("Shoot State controller tests", func() { secret *corev1.Secret lastOperation *gardencorev1beta1.LastOperation + + emptyMachineState = gardencorev1beta1.GardenerResourceData{Name: "machine-state", Type: "machine-state", Data: runtime.RawExtension{Raw: []byte("{}")}} ) BeforeEach(func() { @@ -150,7 +153,7 @@ var _ = Describe("Shoot State controller tests", func() { By("Ensure ShootState is newly created") Eventually(func(g Gomega) { g.Expect(testClient.Get(ctx, client.ObjectKeyFromObject(shootState), shootState)).To(Succeed()) - g.Expect(shootState.Spec.Gardener).To(BeEmpty()) + g.Expect(shootState.Spec.Gardener).To(ConsistOf(emptyMachineState)) }).Should(Succeed()) By("Create secret for next backup") @@ -171,7 +174,7 @@ var _ = Describe("Shoot State controller tests", func() { By("Ensure ShootState is not updated") Consistently(func(g Gomega) { g.Expect(testClient.Get(ctx, client.ObjectKeyFromObject(shootState), shootState)).To(Succeed()) - g.Expect(shootState.Spec.Gardener).To(BeEmpty()) + g.Expect(shootState.Spec.Gardener).To(ConsistOf(emptyMachineState)) }).Should(Succeed()) }) }) @@ -244,7 +247,7 @@ var _ = Describe("Shoot State controller tests", func() { Eventually(func(g Gomega) { g.Expect(testClient.Get(ctx, client.ObjectKeyFromObject(shootState), shootState)).To(Succeed()) lastBackup = shootState.Annotations["gardener.cloud/timestamp"] - g.Expect(shootState.Spec.Gardener).To(BeEmpty()) + g.Expect(shootState.Spec.Gardener).To(ConsistOf(emptyMachineState)) }).Should(Succeed()) By("Create secret for next backup") @@ -254,7 +257,7 @@ var _ = Describe("Shoot State controller tests", func() { Consistently(func(g Gomega) { g.Expect(testClient.Get(ctx, client.ObjectKeyFromObject(shootState), shootState)).To(Succeed()) g.Expect(shootState.Annotations).To(HaveKeyWithValue("gardener.cloud/timestamp", lastBackup)) - g.Expect(shootState.Spec.Gardener).To(BeEmpty()) + g.Expect(shootState.Spec.Gardener).To(ConsistOf(emptyMachineState)) }).Should(Succeed()) By("Step clock") @@ -264,7 +267,7 @@ var _ = Describe("Shoot State controller tests", func() { Eventually(func(g Gomega) { g.Expect(testClient.Get(ctx, client.ObjectKeyFromObject(shootState), shootState)).To(Succeed()) g.Expect(shootState.Annotations).To(HaveKeyWithValue("gardener.cloud/timestamp", Not(Equal(lastBackup)))) - g.Expect(shootState.Spec.Gardener).To(HaveLen(1)) + g.Expect(shootState.Spec.Gardener).To(HaveLen(2)) }).Should(Succeed()) }) }) diff --git a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/register.go b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/register.go index 136a0ec435f..f5fa1c5526a 100644 --- a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/register.go +++ b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/register.go @@ -43,29 +43,11 @@ var ( // the code-generation can find it. SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme is exposed for API installation - AddToScheme = SchemeBuilder.AddToScheme - localSchemeBuilder = &SchemeBuilder + AddToScheme = SchemeBuilder.AddToScheme ) func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, - &OpenStackMachineClass{}, - &OpenStackMachineClassList{}, - - &AWSMachineClass{}, - &AWSMachineClassList{}, - - &AzureMachineClass{}, - &AzureMachineClassList{}, - - &GCPMachineClass{}, - &GCPMachineClassList{}, - - &AlicloudMachineClass{}, - &AlicloudMachineClassList{}, - - &PacketMachineClass{}, - &PacketMachineClassList{}, &MachineClass{}, &MachineClassList{}, diff --git a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/types.go b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/types.go index 46e1d241b42..ab83b4226d6 100644 --- a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/types.go +++ b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/types.go @@ -87,11 +87,11 @@ type NodeTemplateSpec struct { // MachineTemplateSpec describes the data a machine should have when created from a template type MachineTemplateSpec struct { // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata metav1.ObjectMeta // Specification of the desired behavior of the machine. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status Spec MachineSpec } @@ -121,11 +121,11 @@ type MachineTemplate struct { metav1.TypeMeta // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata metav1.ObjectMeta // Template defines the machines that will be created from this machine template. - // https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status + // https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status Template MachineTemplateSpec } @@ -136,7 +136,7 @@ type MachineTemplateList struct { metav1.TypeMeta // Standard list metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds metav1.ListMeta // List of machine templates @@ -187,6 +187,10 @@ type LastOperation struct { // Description of the current operation Description string + // ErrorCode of the current operation if any + // +optional + ErrorCode string + // Last update time of current operation LastUpdateTime metav1.Time @@ -211,7 +215,7 @@ const ( // MachineRunning means node is ready and running successfully MachineRunning MachinePhase = "Running" - // MachineRunning means node is terminating + // MachineTerminating means node is terminating MachineTerminating MachinePhase = "Terminating" // MachineUnknown indicates that the node is not ready at the movement @@ -220,7 +224,7 @@ const ( // MachineFailed means operation failed leading to machine status failure MachineFailed MachinePhase = "Failed" - // MachineCrashLoopBackOff means creation or deletion of the machine is failing. + // MachineCrashLoopBackOff means creation or deletion of the machine is failing. It means that machine object is present but there is no corresponding VM. MachineCrashLoopBackOff MachinePhase = "CrashLoopBackOff" ) @@ -619,576 +623,6 @@ type MachineDeploymentList struct { Items []MachineDeployment } -/********************** OpenStackMachineClass APIs ***************/ - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// OpenStackMachineClass TODO -type OpenStackMachineClass struct { - metav1.ObjectMeta - - metav1.TypeMeta - - Spec OpenStackMachineClassSpec -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// OpenStackMachineClassList is a collection of OpenStackMachineClasses. -type OpenStackMachineClassList struct { - metav1.TypeMeta - - metav1.ListMeta - - Items []OpenStackMachineClass -} - -// OpenStackMachineClassSpec is the specification of a OpenStackMachineClass. -type OpenStackMachineClassSpec struct { - ImageID string - ImageName string - Region string - AvailabilityZone string - FlavorName string - KeyName string - SecurityGroups []string - Tags map[string]string - NetworkID string - Networks []OpenStackNetwork - SubnetID *string - SecretRef *corev1.SecretReference - CredentialsSecretRef *corev1.SecretReference - PodNetworkCidr string - RootDiskSize int // in GB - UseConfigDrive *bool - ServerGroupID *string -} - -type OpenStackNetwork struct { - Id string - Name string - PodNetwork bool -} - -/********************** AWSMachineClass APIs ***************/ - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// AWSMachineClass TODO -type AWSMachineClass struct { - metav1.ObjectMeta - - metav1.TypeMeta - - Spec AWSMachineClassSpec -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// AWSMachineClassList is a collection of AWSMachineClasses. -type AWSMachineClassList struct { - metav1.TypeMeta - - metav1.ListMeta - - Items []AWSMachineClass -} - -// AWSMachineClassSpec is the specification of a AWSMachineClass. -type AWSMachineClassSpec struct { - AMI string - Region string - BlockDevices []AWSBlockDeviceMappingSpec - EbsOptimized bool - IAM AWSIAMProfileSpec - MachineType string - KeyName string - Monitoring bool - NetworkInterfaces []AWSNetworkInterfaceSpec - Tags map[string]string - SpotPrice *string - SecretRef *corev1.SecretReference - CredentialsSecretRef *corev1.SecretReference - - // TODO add more here -} - -type AWSBlockDeviceMappingSpec struct { - - // The device name exposed to the machine (for example, /dev/sdh or xvdh). - DeviceName string - - // Parameters used to automatically set up EBS volumes when the machine is - // launched. - Ebs AWSEbsBlockDeviceSpec - - // Suppresses the specified device included in the block device mapping of the - // AMI. - NoDevice string - - // The virtual device name (ephemeralN). Machine store volumes are numbered - // starting from 0. An machine type with 2 available machine store volumes - // can specify mappings for ephemeral0 and ephemeral1.The number of available - // machine store volumes depends on the machine type. After you connect to - // the machine, you must mount the volume. - // - // Constraints: For M3 machines, you must specify machine store volumes in - // the block device mapping for the machine. When you launch an M3 machine, - // we ignore any machine store volumes specified in the block device mapping - // for the AMI. - VirtualName string -} - -// Describes a block device for an EBS volume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EbsBlockDevice -type AWSEbsBlockDeviceSpec struct { - - // Indicates whether the EBS volume is deleted on machine termination. - DeleteOnTermination *bool - - // Indicates whether the EBS volume is encrypted. Encrypted Amazon EBS volumes - // may only be attached to machines that support Amazon EBS encryption. - Encrypted bool - - // The number of I/O operations per second (IOPS) that the volume supports. - // For io1, this represents the number of IOPS that are provisioned for the - // volume. For gp2, this represents the baseline performance of the volume and - // the rate at which the volume accumulates I/O credits for bursting. For more - // information about General Purpose SSD baseline performance, I/O credits, - // and bursting, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. - // - // Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS for - // gp2 volumes. - // - // Condition: This parameter is required for requests to create io1 volumes; - // it is not used in requests to create gp2, st1, sc1, or standard volumes. - Iops int64 - - // Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed - // CMK under which the EBS volume is encrypted. - // - // This parameter is only supported on BlockDeviceMapping objects called by - // RunInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html), - // RequestSpotFleet (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotFleet.html), - // and RequestSpotInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html). - KmsKeyID *string - - // The ID of the snapshot. - SnapshotID *string - - // The size of the volume, in GiB. - // - // Constraints: 1-16384 for General Purpose SSD (gp2), 4-16384 for Provisioned - // IOPS SSD (io1), 500-16384 for Throughput Optimized HDD (st1), 500-16384 for - // Cold HDD (sc1), and 1-1024 for Magnetic (standard) volumes. If you specify - // a snapshot, the volume size must be equal to or larger than the snapshot - // size. - // - // Default: If you're creating the volume from a snapshot and don't specify - // a volume size, the default is the snapshot size. - VolumeSize int64 - - // The volume type: gp2, io1, st1, sc1, or standard. - // - // Default: standard - VolumeType string -} - -// Describes an IAM machine profile. -type AWSIAMProfileSpec struct { - // The Amazon Resource Name (ARN) of the machine profile. - ARN string - - // The name of the machine profile. - Name string -} - -// Describes a network interface. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MachineAWSNetworkInterfaceSpecification -type AWSNetworkInterfaceSpec struct { - - // Indicates whether to assign a public IPv4 address to an machine you launch - // in a VPC. The public IP address can only be assigned to a network interface - // for eth0, and can only be assigned to a new network interface, not an existing - // one. You cannot specify more than one network interface in the request. If - // launching into a default subnet, the default value is true. - AssociatePublicIPAddress *bool - - // If set to true, the interface is deleted when the machine is terminated. - // You can specify true only if creating a new network interface when launching - // an machine. - DeleteOnTermination *bool - - // The description of the network interface. Applies only if creating a network - // interface when launching an machine. - Description *string - - // The IDs of the security groups for the network interface. Applies only if - // creating a network interface when launching an machine. - SecurityGroupIDs []string - - // The ID of the subnet associated with the network string. Applies only if - // creating a network interface when launching an machine. - SubnetID string -} - -/********************** AzureMachineClass APIs ***************/ - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// AzureMachineClass TODO -type AzureMachineClass struct { - metav1.ObjectMeta - - metav1.TypeMeta - - Spec AzureMachineClassSpec -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// AzureMachineClassList is a collection of AzureMachineClasses. -type AzureMachineClassList struct { - metav1.TypeMeta - - metav1.ListMeta - - Items []AzureMachineClass -} - -// AzureMachineClassSpec is the specification of a AzureMachineClass. -type AzureMachineClassSpec struct { - Location string - Tags map[string]string - Properties AzureVirtualMachineProperties - ResourceGroup string - SubnetInfo AzureSubnetInfo - SecretRef *corev1.SecretReference - CredentialsSecretRef *corev1.SecretReference -} - -// AzureVirtualMachineProperties is describes the properties of a Virtual Machine. -type AzureVirtualMachineProperties struct { - HardwareProfile AzureHardwareProfile - StorageProfile AzureStorageProfile - OsProfile AzureOSProfile - NetworkProfile AzureNetworkProfile - AvailabilitySet *AzureSubResource - IdentityID *string - Zone *int - MachineSet *AzureMachineSetConfig -} - -// AzureHardwareProfile is specifies the hardware settings for the virtual machine. -// Refer github.com/Azure/azure-sdk-for-go/arm/compute/models.go for VMSizes -type AzureHardwareProfile struct { - VMSize string -} - -// AzureStorageProfile is specifies the storage settings for the virtual machine disks. -type AzureStorageProfile struct { - ImageReference AzureImageReference - OsDisk AzureOSDisk - DataDisks []AzureDataDisk -} - -// AzureImageReference is specifies information about the image to use. You can specify information about platform images, -// marketplace images, or virtual machine images. This element is required when you want to use a platform image, -// marketplace image, or virtual machine image, but is not used in other creation operations. -type AzureImageReference struct { - ID string - URN *string -} - -// AzureOSDisk is specifies information about the operating system disk used by the virtual machine.

For more -// information about disks, see [About disks and VHDs for Azure virtual -// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). -type AzureOSDisk struct { - Name string - Caching string - ManagedDisk AzureManagedDiskParameters - DiskSizeGB int32 - CreateOption string -} - -type AzureDataDisk struct { - Name string - Lun *int32 - Caching string - StorageAccountType string - DiskSizeGB int32 -} - -// AzureManagedDiskParameters is the parameters of a managed disk. -type AzureManagedDiskParameters struct { - ID string - StorageAccountType string -} - -// AzureOSProfile is specifies the operating system settings for the virtual machine. -type AzureOSProfile struct { - ComputerName string - AdminUsername string - AdminPassword string - CustomData string - LinuxConfiguration AzureLinuxConfiguration -} - -// AzureLinuxConfiguration is specifies the Linux operating system settings on the virtual machine.

For a list of -// supported Linux distributions, see [Linux on Azure-Endorsed -// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) -//

For running non-endorsed distributions, see [Information for Non-Endorsed -// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). -type AzureLinuxConfiguration struct { - DisablePasswordAuthentication bool - SSH AzureSSHConfiguration -} - -// AzureSSHConfiguration is SSH configuration for Linux based VMs running on Azure -type AzureSSHConfiguration struct { - PublicKeys AzureSSHPublicKey -} - -// AzureSSHPublicKey is contains information about SSH certificate public key and the path on the Linux VM where the public -// key is placed. -type AzureSSHPublicKey struct { - Path string - KeyData string -} - -// AzureNetworkProfile is specifies the network interfaces of the virtual machine. -type AzureNetworkProfile struct { - NetworkInterfaces AzureNetworkInterfaceReference - AcceleratedNetworking *bool -} - -// AzureNetworkInterfaceReference is describes a network interface reference. -type AzureNetworkInterfaceReference struct { - ID string - *AzureNetworkInterfaceReferenceProperties -} - -// AzureNetworkInterfaceReferenceProperties is describes a network interface reference properties. -type AzureNetworkInterfaceReferenceProperties struct { - Primary bool -} - -// AzureSubResource is the Sub Resource definition. -type AzureSubResource struct { - ID string -} - -// AzureSubnetInfo is the information containing the subnet details -type AzureSubnetInfo struct { - VnetName string - VnetResourceGroup *string - SubnetName string -} - -// AzureMachineSetConfig contains the information about the machine set -type AzureMachineSetConfig struct { - ID string - Kind string -} - -const ( - // MachineSetKindAvailabilitySet is the machine set kind for AvailabilitySet - MachineSetKindAvailabilitySet string = "availabilityset" - // MachineSetKindVMO is the machine set kind for VirtualMachineScaleSet Orchestration Mode VM (VMO) - MachineSetKindVMO string = "vmo" -) - -/********************** GCPMachineClass APIs ***************/ - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// GCPMachineClass TODO -type GCPMachineClass struct { - metav1.ObjectMeta - - metav1.TypeMeta - - Spec GCPMachineClassSpec -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// GCPMachineClassList is a collection of GCPMachineClasses. -type GCPMachineClassList struct { - metav1.TypeMeta - - metav1.ListMeta - - Items []GCPMachineClass -} - -// GCPMachineClassSpec is the specification of a GCPMachineClass. -type GCPMachineClassSpec struct { - CanIpForward bool - DeletionProtection bool - Description *string - Disks []*GCPDisk - Labels map[string]string - MachineType string - Metadata []*GCPMetadata - NetworkInterfaces []*GCPNetworkInterface - Scheduling GCPScheduling - SecretRef *corev1.SecretReference - CredentialsSecretRef *corev1.SecretReference - ServiceAccounts []GCPServiceAccount - Tags []string - Region string - Zone string -} - -// GCPDisk describes disks for GCP. -type GCPDisk struct { - AutoDelete *bool - Boot bool - SizeGb int64 - Type string - Interface string - Image string - Labels map[string]string -} - -// GCPMetadata describes metadata for GCP. -type GCPMetadata struct { - Key string - Value *string -} - -// GCPNetworkInterface describes network interfaces for GCP -type GCPNetworkInterface struct { - DisableExternalIP bool - Network string - Subnetwork string -} - -// GCPScheduling describes scheduling configuration for GCP. -type GCPScheduling struct { - AutomaticRestart bool - OnHostMaintenance string - Preemptible bool -} - -// GCPServiceAccount describes service accounts for GCP. -type GCPServiceAccount struct { - Email string - Scopes []string -} - -/********************** AlicloudMachineClass APIs ***************/ - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// AlicloudMachineClass -type AlicloudMachineClass struct { - metav1.ObjectMeta - - metav1.TypeMeta - - Spec AlicloudMachineClassSpec -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// AlicloudMachineClassList is a collection of AlicloudMachineClasses. -type AlicloudMachineClassList struct { - metav1.TypeMeta - - metav1.ListMeta - - Items []AlicloudMachineClass -} - -// AlicloudMachineClassSpec is the specification of a AlicloudMachineClass. -type AlicloudMachineClassSpec struct { - ImageID string - InstanceType string - Region string - ZoneID string - SecurityGroupID string - VSwitchID string - PrivateIPAddress string - SystemDisk *AlicloudSystemDisk - DataDisks []AlicloudDataDisk - InstanceChargeType string - InternetChargeType string - InternetMaxBandwidthIn *int - InternetMaxBandwidthOut *int - SpotStrategy string - IoOptimized string - Tags map[string]string - KeyPairName string - SecretRef *corev1.SecretReference - CredentialsSecretRef *corev1.SecretReference -} - -// AlicloudSystemDisk describes SystemDisk for Alicloud. -type AlicloudSystemDisk struct { - Category string - Size int -} - -// AlicloudDataDisk describes DataDisk for Alicloud. -type AlicloudDataDisk struct { - Name string - Category string - Description string - Encrypted bool - Size int - DeleteWithInstance *bool -} - -/********************** PacketMachineClass APIs ***************/ - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// PacketMachineClass TODO -type PacketMachineClass struct { - metav1.ObjectMeta - - metav1.TypeMeta - - Spec PacketMachineClassSpec -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// PacketMachineClassList is a collection of PacketMachineClasses. -type PacketMachineClassList struct { - metav1.TypeMeta - - metav1.ListMeta - - Items []PacketMachineClass -} - -// PacketMachineClassSpec is the specification of a PacketMachineClass. -type PacketMachineClassSpec struct { - Facility []string // required - MachineType string // required - OS string // required - ProjectID string // required - BillingCycle string - Tags []string - SSHKeys []string - UserData string - - SecretRef *corev1.SecretReference - CredentialsSecretRef *corev1.SecretReference - - // TODO add more here -} - // +genclient // +genclient:noStatus // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/alicoud_machineclass_types.go b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/alicoud_machineclass_types.go deleted file mode 100644 index 3c53eff7b5e..00000000000 --- a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/alicoud_machineclass_types.go +++ /dev/null @@ -1,111 +0,0 @@ -// Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// 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. - -// WARNING! -// IF YOU MODIFY ANY OF THE TYPES HERE COPY THEM TO ../types.go -// AND RUN `make generate` - -package v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - // AlicloudAccessKeyID is a constant for a key name that is part of the Alibaba cloud credentials. - AlicloudAccessKeyID string = "alicloudAccessKeyID" - // AlicloudAccessKeySecret is a constant for a key name that is part of the Alibaba cloud credentials. - AlicloudAccessKeySecret string = "alicloudAccessKeySecret" - - // AlicloudAlternativeAccessKeyID is a constant for a key name of a secret containing the Alibaba cloud - // credentials (access key id). - AlicloudAlternativeAccessKeyID = "accessKeyID" - // AlicloudAlternativeAccessKeySecret is a constant for a key name of a secret containing the Alibaba cloud - // credentials (access key secret). - AlicloudAlternativeAccessKeySecret = "accessKeySecret" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:object:root=true -// +kubebuilder:printcolumn:name="Instance Type",type=string,JSONPath=`.spec.instanceType` -// +kubebuilder:printcolumn:name="Region",type=string,JSONPath=`.spec.region`,priority=1 -// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" - -// AlicloudMachineClass TODO -type AlicloudMachineClass struct { - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - - // +optional - metav1.TypeMeta `json:",inline"` - - // +optional - Spec AlicloudMachineClassSpec `json:"spec,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:object:root=true - -// AlicloudMachineClassList is a collection of AlicloudMachineClasses. -type AlicloudMachineClassList struct { - // +optional - metav1.TypeMeta `json:",inline"` - - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - // +optional - Items []AlicloudMachineClass `json:"items"` -} - -// AlicloudMachineClassSpec is the specification of a AlicloudMachineClass. -type AlicloudMachineClassSpec struct { - ImageID string `json:"imageID"` - InstanceType string `json:"instanceType"` - Region string `json:"region"` - ZoneID string `json:"zoneID,omitempty"` - SecurityGroupID string `json:"securityGroupID,omitempty"` - VSwitchID string `json:"vSwitchID"` - PrivateIPAddress string `json:"privateIPAddress,omitempty"` - SystemDisk *AlicloudSystemDisk `json:"systemDisk,omitempty"` - DataDisks []AlicloudDataDisk `json:"dataDisks,omitempty"` - InstanceChargeType string `json:"instanceChargeType,omitempty"` - InternetChargeType string `json:"internetChargeType,omitempty"` - InternetMaxBandwidthIn *int `json:"internetMaxBandwidthIn,omitempty"` - InternetMaxBandwidthOut *int `json:"internetMaxBandwidthOut,omitempty"` - SpotStrategy string `json:"spotStrategy,omitempty"` - IoOptimized string `json:"IoOptimized,omitempty"` - Tags map[string]string `json:"tags,omitempty"` - KeyPairName string `json:"keyPairName"` - SecretRef *corev1.SecretReference `json:"secretRef,omitempty"` - CredentialsSecretRef *corev1.SecretReference `json:"credentialsSecretRef,omitempty"` -} - -type AlicloudDataDisk struct { - Name string `json:"name,omitempty"` - Category string `json:"category,omitempty"` - // +optional - Description string `json:"description,omitempty"` - Encrypted bool `json:"encrypted,omitempty"` - DeleteWithInstance *bool `json:"deleteWithInstance,omitempty"` - Size int `json:"size,omitempty"` -} - -// AlicloudSystemDisk describes SystemDisk for Alicloud. -type AlicloudSystemDisk struct { - Category string `json:"category"` - Size int `json:"size"` -} diff --git a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/aws_machineclass_types.go b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/aws_machineclass_types.go deleted file mode 100644 index 9e4e54b6a50..00000000000 --- a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/aws_machineclass_types.go +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// 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. - -// WARNING! -// IF YOU MODIFY ANY OF THE TYPES HERE COPY THEM TO ../types.go -// AND RUN `make generate` - -package v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - // AWSAccessKeyID is a constant for a key name that is part of the AWS cloud credentials. - AWSAccessKeyID string = "providerAccessKeyId" - // AWSSecretAccessKey is a constant for a key name that is part of the AWS cloud credentials. - AWSSecretAccessKey string = "providerSecretAccessKey" - - // AWSAlternativeAccessKeyID is a constant for a key name of a secret containing the AWS credentials (access key - // id). - AWSAlternativeAccessKeyID = "accessKeyID" - // AWSAlternativeAccessKeySecret is a constant for a key name of a secret containing the AWS credentials (access key - // secret). - AWSAlternativeSecretAccessKey = "secretAccessKey" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:object:root=true -// +kubebuilder:printcolumn:name="Machine Type",type=string,JSONPath=`.spec.machineType` -// +kubebuilder:printcolumn:name="AMI",type=string,JSONPath=`.spec.ami` -// +kubebuilder:printcolumn:name="Region",type=string,JSONPath=`.spec.region`,priority=1 -// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" - -// AWSMachineClass TODO -type AWSMachineClass struct { - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - - // +optional - metav1.TypeMeta `json:",inline"` - - // +optional - Spec AWSMachineClassSpec `json:"spec,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:object:root=true - -// AWSMachineClassList is a collection of AWSMachineClasses. -type AWSMachineClassList struct { - // +optional - metav1.TypeMeta `json:",inline"` - - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - // +optional - Items []AWSMachineClass `json:"items"` -} - -// AWSMachineClassSpec is the specification of a AWSMachineClass. -type AWSMachineClassSpec struct { - AMI string `json:"ami,omitempty"` - Region string `json:"region,omitempty"` - BlockDevices []AWSBlockDeviceMappingSpec `json:"blockDevices,omitempty"` - EbsOptimized bool `json:"ebsOptimized,omitempty"` - IAM AWSIAMProfileSpec `json:"iam,omitempty"` - MachineType string `json:"machineType,omitempty"` - KeyName string `json:"keyName,omitempty"` - Monitoring bool `json:"monitoring,omitempty"` - NetworkInterfaces []AWSNetworkInterfaceSpec `json:"networkInterfaces,omitempty"` - Tags map[string]string `json:"tags,omitempty"` - SpotPrice *string `json:"spotPrice,omitempty"` - SecretRef *corev1.SecretReference `json:"secretRef,omitempty"` - CredentialsSecretRef *corev1.SecretReference `json:"credentialsSecretRef,omitempty"` - - // TODO add more here -} - -type AWSBlockDeviceMappingSpec struct { - - // The device name exposed to the machine (for example, /dev/sdh or xvdh). - DeviceName string `json:"deviceName,omitempty"` - - // Parameters used to automatically set up EBS volumes when the machine is - // launched. - Ebs AWSEbsBlockDeviceSpec `json:"ebs,omitempty"` - - // Suppresses the specified device included in the block device mapping of the - // AMI. - NoDevice string `json:"noDevice,omitempty"` - - // The virtual device name (ephemeralN). Machine store volumes are numbered - // starting from 0. An machine type with 2 available machine store volumes - // can specify mappings for ephemeral0 and ephemeral1.The number of available - // machine store volumes depends on the machine type. After you connect to - // the machine, you must mount the volume. - // - // Constraints: For M3 machines, you must specify machine store volumes in - // the block device mapping for the machine. When you launch an M3 machine, - // we ignore any machine store volumes specified in the block device mapping - // for the AMI. - VirtualName string `json:"virtualName,omitempty"` -} - -// Describes a block device for an EBS volume. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EbsBlockDevice -type AWSEbsBlockDeviceSpec struct { - - // Indicates whether the EBS volume is deleted on machine termination. - DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` - - // Indicates whether the EBS volume is encrypted. Encrypted Amazon EBS volumes - // may only be attached to machines that support Amazon EBS encryption. - Encrypted bool `json:"encrypted,omitempty"` - - // The number of I/O operations per second (IOPS) that the volume supports. - // For io1, this represents the number of IOPS that are provisioned for the - // volume. For gp2, this represents the baseline performance of the volume and - // the rate at which the volume accumulates I/O credits for bursting. For more - // information about General Purpose SSD baseline performance, I/O credits, - // and bursting, see Amazon EBS Volume Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. - // - // Constraint: Range is 100-20000 IOPS for io1 volumes and 100-10000 IOPS for - // gp2 volumes. - // - // Condition: This parameter is required for requests to create io1 volumes; - // it is not used in requests to create gp2, st1, sc1, or standard volumes. - Iops int64 `json:"iops,omitempty"` - - // Identifier (key ID, key alias, ID ARN, or alias ARN) for a customer managed - // CMK under which the EBS volume is encrypted. - // - // This parameter is only supported on BlockDeviceMapping objects called by - // RunInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html), - // RequestSpotFleet (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotFleet.html), - // and RequestSpotInstances (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html). - KmsKeyID *string `json:"kmsKeyID,omitempty"` - - // The ID of the snapshot. - SnapshotID *string `json:"snapshotID,omitempty"` - - // The size of the volume, in GiB. - // - // Constraints: 1-16384 for General Purpose SSD (gp2), 4-16384 for Provisioned - // IOPS SSD (io1), 500-16384 for Throughput Optimized HDD (st1), 500-16384 for - // Cold HDD (sc1), and 1-1024 for Magnetic (standard) volumes. If you specify - // a snapshot, the volume size must be equal to or larger than the snapshot - // size. - // - // Default: If you're creating the volume from a snapshot and don't specify - // a volume size, the default is the snapshot size. - VolumeSize int64 `json:"volumeSize,omitempty"` - - // The volume type: gp2, io1, st1, sc1, or standard. - // - // Default: standard - VolumeType string `json:"volumeType,omitempty"` -} - -// Describes an IAM machine profile. -type AWSIAMProfileSpec struct { - // The Amazon Resource Name (ARN) of the machine profile. - ARN string `json:"arn,omitempty"` - - // The name of the machine profile. - Name string `json:"name,omitempty"` -} - -// Describes a network interface. -// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MachineAWSNetworkInterfaceSpecification -type AWSNetworkInterfaceSpec struct { - - // Indicates whether to assign a public IPv4 address to an machine you launch - // in a VPC. The public IP address can only be assigned to a network interface - // for eth0, and can only be assigned to a new network interface, not an existing - // one. You cannot specify more than one network interface in the request. If - // launching into a default subnet, the default value is true. - AssociatePublicIPAddress *bool `json:"associatePublicIPAddress,omitempty"` - - // If set to true, the interface is deleted when the machine is terminated. - // You can specify true only if creating a new network interface when launching - // an machine. - DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` - - // The description of the network interface. Applies only if creating a network - // interface when launching an machine. - Description *string `json:"description,omitempty"` - - // The IDs of the security groups for the network interface. Applies only if - // creating a network interface when launching an machine. - SecurityGroupIDs []string `json:"securityGroupIDs,omitempty"` - - // The ID of the subnet associated with the network string. Applies only if - // creating a network interface when launching an machine. - SubnetID string `json:"subnetID,omitempty"` -} diff --git a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/azure_machineclass_types.go b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/azure_machineclass_types.go deleted file mode 100644 index 690b89dbd09..00000000000 --- a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/azure_machineclass_types.go +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// 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. - -// WARNING! -// IF YOU MODIFY ANY OF THE TYPES HERE COPY THEM TO ../types.go -// AND RUN `make generate` - -package v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - // AzureClientID is a constant for a key name that is part of the Azure cloud credentials. - AzureClientID string = "azureClientId" - // AzureClientSecret is a constant for a key name that is part of the Azure cloud credentials. - AzureClientSecret string = "azureClientSecret" - // AzureSubscriptionID is a constant for a key name that is part of the Azure cloud credentials. - AzureSubscriptionID string = "azureSubscriptionId" - // AzureTenantID is a constant for a key name that is part of the Azure cloud credentials. - AzureTenantID string = "azureTenantId" - - // AzureAlternativeClientID is a constant for a key name of a secret containing the Azure credentials (client id). - AzureAlternativeClientID = "clientID" - // AzureAlternativeClientSecret is a constant for a key name of a secret containing the Azure credentials (client - // secret). - AzureAlternativeClientSecret = "clientSecret" - // AzureAlternativeSubscriptionID is a constant for a key name of a secret containing the Azure credentials - // (subscription id). - AzureAlternativeSubscriptionID = "subscriptionID" - // AzureAlternativeTenantID is a constant for a key name of a secret containing the Azure credentials (tenant id). - AzureAlternativeTenantID = "tenantID" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:object:root=true -// +kubebuilder:printcolumn:name="VM Size",type=string,JSONPath=`.spec.properties.hardwareProfile.vmSize` -// +kubebuilder:printcolumn:name="Location",type=string,JSONPath=`.spec.location`,priority=1 -// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" - -// AzureMachineClass TODO -type AzureMachineClass struct { - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - - // +optional - metav1.TypeMeta `json:",inline"` - - // +optional - Spec AzureMachineClassSpec `json:"spec,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:object:root=true - -// AzureMachineClassList is a collection of AzureMachineClasses. -type AzureMachineClassList struct { - // +optional - metav1.TypeMeta `json:",inline"` - - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - // +optional - Items []AzureMachineClass `json:"items"` -} - -// AzureMachineClassSpec is the specification of a AzureMachineClass. -type AzureMachineClassSpec struct { - Location string `json:"location,omitempty"` - Tags map[string]string `json:"tags,omitempty"` - Properties AzureVirtualMachineProperties `json:"properties,omitempty"` - ResourceGroup string `json:"resourceGroup,omitempty"` - SubnetInfo AzureSubnetInfo `json:"subnetInfo,omitempty"` - SecretRef *corev1.SecretReference `json:"secretRef,omitempty"` - CredentialsSecretRef *corev1.SecretReference `json:"credentialsSecretRef,omitempty"` -} - -// AzureVirtualMachineProperties is describes the properties of a Virtual Machine. -type AzureVirtualMachineProperties struct { - HardwareProfile AzureHardwareProfile `json:"hardwareProfile,omitempty"` - StorageProfile AzureStorageProfile `json:"storageProfile,omitempty"` - OsProfile AzureOSProfile `json:"osProfile,omitempty"` - NetworkProfile AzureNetworkProfile `json:"networkProfile,omitempty"` - AvailabilitySet *AzureSubResource `json:"availabilitySet,omitempty"` - IdentityID *string `json:"identityID,omitempty"` - Zone *int `json:"zone,omitempty"` - MachineSet *AzureMachineSetConfig `json:"machineSet,omitempty"` -} - -// AzureHardwareProfile is specifies the hardware settings for the virtual machine. -// Refer github.com/Azure/azure-sdk-for-go/arm/compute/models.go for VMSizes -type AzureHardwareProfile struct { - VMSize string `json:"vmSize,omitempty"` -} - -// AzureStorageProfile is specifies the storage settings for the virtual machine disks. -type AzureStorageProfile struct { - ImageReference AzureImageReference `json:"imageReference,omitempty"` - OsDisk AzureOSDisk `json:"osDisk,omitempty"` - DataDisks []AzureDataDisk `json:"dataDisks,omitempty"` -} - -// AzureImageReference is specifies information about the image to use. You can specify information about platform images, -// marketplace images, or virtual machine images. This element is required when you want to use a platform image, -// marketplace image, or virtual machine image, but is not used in other creation operations. -type AzureImageReference struct { - ID string `json:"id,omitempty"` - // Uniform Resource Name of the OS image to be used , it has the format 'publisher:offer:sku:version' - URN *string `json:"urn,omitempty"` -} - -// AzureOSDisk is specifies information about the operating system disk used by the virtual machine.

For more -// information about disks, see [About disks and VHDs for Azure virtual -// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). -type AzureOSDisk struct { - Name string `json:"name,omitempty"` - Caching string `json:"caching,omitempty"` - ManagedDisk AzureManagedDiskParameters `json:"managedDisk,omitempty"` - DiskSizeGB int32 `json:"diskSizeGB,omitempty"` - CreateOption string `json:"createOption,omitempty"` -} - -type AzureDataDisk struct { - Name string `json:"name,omitempty"` - Lun *int32 `json:"lun,omitempty"` - Caching string `json:"caching,omitempty"` - StorageAccountType string `json:"storageAccountType,omitempty"` - DiskSizeGB int32 `json:"diskSizeGB,omitempty"` -} - -// AzureManagedDiskParameters is the parameters of a managed disk. -type AzureManagedDiskParameters struct { - ID string `json:"id,omitempty"` - StorageAccountType string `json:"storageAccountType,omitempty"` -} - -// AzureOSProfile is specifies the operating system settings for the virtual machine. -type AzureOSProfile struct { - ComputerName string `json:"computerName,omitempty"` - AdminUsername string `json:"adminUsername,omitempty"` - AdminPassword string `json:"adminPassword,omitempty"` - CustomData string `json:"customData,omitempty"` - LinuxConfiguration AzureLinuxConfiguration `json:"linuxConfiguration,omitempty"` -} - -// AzureLinuxConfiguration is specifies the Linux operating system settings on the virtual machine.

For a list of -// supported Linux distributions, see [Linux on Azure-Endorsed -// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) -//

For running non-endorsed distributions, see [Information for Non-Endorsed -// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). -type AzureLinuxConfiguration struct { - DisablePasswordAuthentication bool `json:"disablePasswordAuthentication,omitempty"` - SSH AzureSSHConfiguration `json:"ssh,omitempty"` -} - -// AzureSSHConfiguration is SSH configuration for Linux based VMs running on Azure -type AzureSSHConfiguration struct { - PublicKeys AzureSSHPublicKey `json:"publicKeys,omitempty"` -} - -// AzureSSHPublicKey is contains information about SSH certificate public key and the path on the Linux VM where the public -// key is placed. -type AzureSSHPublicKey struct { - Path string `json:"path,omitempty"` - KeyData string `json:"keyData,omitempty"` -} - -// AzureNetworkProfile is specifies the network interfaces of the virtual machine. -type AzureNetworkProfile struct { - NetworkInterfaces AzureNetworkInterfaceReference `json:"networkInterfaces,omitempty"` - AcceleratedNetworking *bool `json:"acceleratedNetworking,omitempty"` -} - -// AzureNetworkInterfaceReference is describes a network interface reference. -type AzureNetworkInterfaceReference struct { - ID string `json:"id,omitempty"` - *AzureNetworkInterfaceReferenceProperties `json:"properties,omitempty"` -} - -// AzureNetworkInterfaceReferenceProperties is describes a network interface reference properties. -type AzureNetworkInterfaceReferenceProperties struct { - Primary bool `json:"primary,omitempty"` -} - -// AzureSubResource is the Sub Resource definition. -type AzureSubResource struct { - ID string `json:"id,omitempty"` -} - -// AzureSubnetInfo is the information containing the subnet details -type AzureSubnetInfo struct { - VnetName string `json:"vnetName,omitempty"` - VnetResourceGroup *string `json:"vnetResourceGroup,omitempty"` - SubnetName string `json:"subnetName,omitempty"` -} - -// AzureMachineSetConfig contains the information about the machine set -type AzureMachineSetConfig struct { - ID string `json:"id"` - Kind string `json:"kind"` -} - -const ( - // MachineSetKindAvailabilitySet is the machine set kind for AvailabilitySet - MachineSetKindAvailabilitySet string = "availabilityset" - // MachineSetKindVMO is the machine set kind for VirtualMachineScaleSet Orchestration Mode VM (VMO) - MachineSetKindVMO string = "vmo" -) diff --git a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/defaults.go b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/defaults.go deleted file mode 100644 index 7f5d7eca18f..00000000000 --- a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/defaults.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright (c) 2017 SAP SE or an SAP affiliate company. All rights reserved. - -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 v1alpha1 - -import ( - "k8s.io/apimachinery/pkg/runtime" -) - -func addDefaultingFuncs(scheme *runtime.Scheme) error { - return RegisterDefaults(scheme) -} diff --git a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/gcp_machineclass_types.go b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/gcp_machineclass_types.go deleted file mode 100644 index 780f615606a..00000000000 --- a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/gcp_machineclass_types.go +++ /dev/null @@ -1,123 +0,0 @@ -// Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// 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. - -// WARNING! -// IF YOU MODIFY ANY OF THE TYPES HERE COPY THEM TO ../types.go -// AND RUN `make generate` - -package v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - // GCPServiceAccountJSON is a constant for a key name that is part of the GCP cloud credentials. - GCPServiceAccountJSON string = "serviceAccountJSON" - - // GCPAlternativeServiceAccountJSON is a constant for a key name of a secret containing the GCP credentials (service - // account json). - GCPAlternativeServiceAccountJSON = "serviceaccount.json" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:object:root=true -// +kubebuilder:printcolumn:name="Machine Type",type=string,JSONPath=`.spec.machineType` -// +kubebuilder:printcolumn:name="Region",type=string,JSONPath=`.spec.region`,priority=1 -// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" - -// GCPMachineClass TODO -type GCPMachineClass struct { - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - - // +optional - metav1.TypeMeta `json:",inline"` - - // +optional - Spec GCPMachineClassSpec `json:"spec,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:object:root=true - -// GCPMachineClassList is a collection of GCPMachineClasses. -type GCPMachineClassList struct { - // +optional - metav1.TypeMeta `json:",inline"` - - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - // +optional - Items []GCPMachineClass `json:"items"` -} - -// GCPMachineClassSpec is the specification of a GCPMachineClass. -type GCPMachineClassSpec struct { - CanIpForward bool `json:"canIpForward"` - DeletionProtection bool `json:"deletionProtection"` - Description *string `json:"description,omitempty"` - Disks []*GCPDisk `json:"disks,omitempty"` - Labels map[string]string `json:"labels,omitempty"` - MachineType string `json:"machineType"` - Metadata []*GCPMetadata `json:"metadata,omitempty"` - NetworkInterfaces []*GCPNetworkInterface `json:"networkInterfaces,omitempty"` - Scheduling GCPScheduling `json:"scheduling"` - SecretRef *corev1.SecretReference `json:"secretRef,omitempty"` - CredentialsSecretRef *corev1.SecretReference `json:"credentialsSecretRef,omitempty"` - ServiceAccounts []GCPServiceAccount `json:"serviceAccounts"` - Tags []string `json:"tags,omitempty"` - Region string `json:"region"` - Zone string `json:"zone"` -} - -// GCPDisk describes disks for GCP. -type GCPDisk struct { - AutoDelete *bool `json:"autoDelete"` - Boot bool `json:"boot"` - SizeGb int64 `json:"sizeGb"` - Type string `json:"type"` - Interface string `json:"interface"` - Image string `json:"image"` - Labels map[string]string `json:"labels"` -} - -// GCPMetadata describes metadata for GCP. -type GCPMetadata struct { - Key string `json:"key"` - Value *string `json:"value"` -} - -// GCPNetworkInterface describes network interfaces for GCP -type GCPNetworkInterface struct { - DisableExternalIP bool `json:"disableExternalIP,omitempty"` - Network string `json:"network,omitempty"` - Subnetwork string `json:"subnetwork,omitempty"` -} - -// GCPScheduling describes scheduling configuration for GCP. -type GCPScheduling struct { - AutomaticRestart bool `json:"automaticRestart"` - OnHostMaintenance string `json:"onHostMaintenance"` - Preemptible bool `json:"preemptible"` -} - -// GCPServiceAccount describes service accounts for GCP. -type GCPServiceAccount struct { - Email string `json:"email"` - Scopes []string `json:"scopes"` -} diff --git a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/machine_types.go b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/machine_types.go index e0eb04f0a48..b5920e570a6 100644 --- a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/machine_types.go +++ b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/machine_types.go @@ -122,6 +122,10 @@ type LastOperation struct { // Description of the current operation Description string `json:"description,omitempty"` + // ErrorCode of the current operation if any + // +optional + ErrorCode string `json:"errorCode,omitempty"` + // Last update time of current operation LastUpdateTime metav1.Time `json:"lastUpdateTime,omitempty"` @@ -146,7 +150,7 @@ const ( // MachineRunning means node is ready and running successfully MachineRunning MachinePhase = "Running" - // MachineRunning means node is terminating + // MachineTerminating means node is terminating MachineTerminating MachinePhase = "Terminating" // MachineUnknown indicates that the node is not ready at the movement @@ -155,7 +159,7 @@ const ( // MachineFailed means operation failed leading to machine status failure MachineFailed MachinePhase = "Failed" - // MachineCrashLoopBackOff means creation or deletion of the machine is failing. + // MachineCrashLoopBackOff means creation or deletion of the machine is failing. It means that machine object is present but there is no corresponding VM. MachineCrashLoopBackOff MachinePhase = "CrashLoopBackOff" ) @@ -188,7 +192,7 @@ const ( // MachineOperationHealthCheck indicates that the operation was a create MachineOperationHealthCheck MachineOperationType = "HealthCheck" - // MachineOperationDelete indicates that the operation was a create + // MachineOperationDelete indicates that the operation was a delete MachineOperationDelete MachineOperationType = "Delete" ) diff --git a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/openstack_machineclass_types.go b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/openstack_machineclass_types.go deleted file mode 100644 index 97e729e5c2e..00000000000 --- a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/openstack_machineclass_types.go +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// 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. - -// WARNING! -// IF YOU MODIFY ANY OF THE TYPES HERE COPY THEM TO ../types.go -// AND RUN `make generate` - -package v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - // OpenStackAuthURL is a constant for a key name that is part of the OpenStack cloud credentials. - OpenStackAuthURL string = "authURL" - // OpenStackCACert is a constant for a key name that is part of the OpenStack cloud credentials. - OpenStackCACert string = "caCert" - // OpenStackInsecure is a constant for a key name that is part of the OpenStack cloud credentials. - OpenStackInsecure string = "insecure" - // OpenStackDomainName is a constant for a key name that is part of the OpenStack cloud credentials. - OpenStackDomainName string = "domainName" - // OpenStackDomainID is a constant for a key name that is part of the OpenStack cloud credentials. - OpenStackDomainID string = "domainID" - // OpenStackTenantName is a constant for a key name that is part of the OpenStack cloud credentials. - OpenStackTenantName string = "tenantName" - // OpenStackTenantID is a constant for a key name that is part of the OpenStack cloud credentials. - OpenStackTenantID string = "tenantID" - // OpenStackUserDomainName is a constant for a key name that is part of the OpenStack cloud credentials. - OpenStackUserDomainName string = "userDomainName" - // OpenStackUserDomainID is a constant for a key name that is part of the OpenStack cloud credentials. - OpenStackUserDomainID string = "userDomainID" - // OpenStackUsername is a constant for a key name that is part of the OpenStack cloud credentials. - OpenStackUsername string = "username" - // OpenStackPassword is a constant for a key name that is part of the OpenStack cloud credentials. - OpenStackPassword string = "password" - // OpenStackClientCert is a constant for a key name that is part of the OpenStack cloud credentials. - OpenStackClientCert string = "clientCert" - // OpenStackClientKey is a constant for a key name that is part of the OpenStack cloud credentials. - OpenStackClientKey string = "clientKey" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:object:root=true -// +kubebuilder:printcolumn:name="Flavor",type=string,JSONPath=`.spec.flavorName` -// +kubebuilder:printcolumn:name="Image",type=string,JSONPath=`.spec.imageName` -// +kubebuilder:printcolumn:name="Region",type=string,JSONPath=`.spec.region`,priority=1 -// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" -// OpenStackMachineClass TODO -type OpenStackMachineClass struct { - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - - // +optional - metav1.TypeMeta `json:",inline"` - - // +optional - Spec OpenStackMachineClassSpec `json:"spec,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:object:root=true - -// OpenStackMachineClassList is a collection of OpenStackMachineClasses. -type OpenStackMachineClassList struct { - // +optional - metav1.TypeMeta `json:",inline"` - - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - // +optional - Items []OpenStackMachineClass `json:"items"` -} - -// OpenStackMachineClassSpec is the specification of a OpenStackMachineClass. -type OpenStackMachineClassSpec struct { - ImageID string `json:"imageID"` - ImageName string `json:"imageName"` - Region string `json:"region"` - AvailabilityZone string `json:"availabilityZone"` - FlavorName string `json:"flavorName"` - KeyName string `json:"keyName"` - SecurityGroups []string `json:"securityGroups"` - Tags map[string]string `json:"tags,omitempty"` - NetworkID string `json:"networkID"` - Networks []OpenStackNetwork `json:"networks,omitempty"` - SubnetID *string `json:"subnetID,omitempty"` - SecretRef *corev1.SecretReference `json:"secretRef,omitempty"` - CredentialsSecretRef *corev1.SecretReference `json:"credentialsSecretRef,omitempty"` - PodNetworkCidr string `json:"podNetworkCidr"` - RootDiskSize int `json:"rootDiskSize,omitempty"` // in GB - UseConfigDrive *bool `json:"useConfigDrive,omitempty"` - ServerGroupID *string `json:"serverGroupID,omitempty"` -} - -type OpenStackNetwork struct { - Id string `json:"id,omitempty"` // takes priority before name - Name string `json:"name,omitempty"` - PodNetwork bool `json:"podNetwork,omitempty"` -} diff --git a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/packet_machineclass_types.go b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/packet_machineclass_types.go deleted file mode 100644 index 82d1aad2f29..00000000000 --- a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/packet_machineclass_types.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file -// -// 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. - -// WARNING! -// IF YOU MODIFY ANY OF THE TYPES HERE COPY THEM TO ../types.go -// AND RUN `make generate` - -package v1alpha1 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - // PacketAPIKey is a constant for a key name that is part of the Packet cloud credentials - PacketAPIKey string = "apiToken" -) - -// +genclient -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:object:root=true -// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\nPopulated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata" - -// PacketMachineClass TODO -type PacketMachineClass struct { - // +optional - metav1.ObjectMeta `json:"metadata,omitempty"` - - // +optional - metav1.TypeMeta `json:",inline"` - - // +optional - Spec PacketMachineClassSpec `json:"spec,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object -// +kubebuilder:object:root=true - -// PacketMachineClassList is a collection of PacketMachineClasses. -type PacketMachineClassList struct { - // +optional - metav1.TypeMeta `json:",inline"` - - // +optional - metav1.ListMeta `json:"metadata,omitempty"` - - // +optional - Items []PacketMachineClass `json:"items"` -} - -// PacketMachineClassSpec is the specification of a PacketMachineClass. -type PacketMachineClassSpec struct { - Facility []string `json:"facility"` - MachineType string `json:"machineType"` - BillingCycle string `json:"billingCycle"` - OS string `json:"OS"` - ProjectID string `json:"projectID"` - Tags []string `json:"tags,omitempty"` - SSHKeys []string `json:"sshKeys,omitempty"` - UserData string `json:"userdata,omitempty"` - - SecretRef *corev1.SecretReference `json:"secretRef,omitempty"` - CredentialsSecretRef *corev1.SecretReference `json:"credentialsSecretRef,omitempty"` -} diff --git a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/register.go b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/register.go index d6c85928deb..46e47df2e58 100644 --- a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/register.go +++ b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/register.go @@ -5,7 +5,7 @@ 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 + 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, @@ -52,24 +52,6 @@ func Resource(resource string) schema.GroupResource { // Adds the list of known types to api.Scheme. func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, - &OpenStackMachineClass{}, - &OpenStackMachineClassList{}, - - &AWSMachineClass{}, - &AWSMachineClassList{}, - - &AzureMachineClass{}, - &AzureMachineClassList{}, - - &GCPMachineClass{}, - &GCPMachineClassList{}, - - &AlicloudMachineClass{}, - &AlicloudMachineClassList{}, - - &PacketMachineClass{}, - &PacketMachineClassList{}, - &MachineClass{}, &MachineClassList{}, diff --git a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/shared_types.go b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/shared_types.go index c5737c45ba3..b5473561d49 100644 --- a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/shared_types.go +++ b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/shared_types.go @@ -26,12 +26,12 @@ import ( type MachineTemplateSpec struct { // +kubebuilder:validation:XPreserveUnknownFields // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata // +optional metav1.ObjectMeta `json:"metadata,omitempty"` // Specification of the desired behavior of the machine. - // More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#spec-and-status + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status // +optional Spec MachineSpec `json:"spec,omitempty"` } diff --git a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/zz_generated.conversion.go b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/zz_generated.conversion.go index c1d4a9a8aaa..d912fa928f9 100644 --- a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/zz_generated.conversion.go +++ b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/zz_generated.conversion.go @@ -39,326 +39,6 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*AWSBlockDeviceMappingSpec)(nil), (*machine.AWSBlockDeviceMappingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AWSBlockDeviceMappingSpec_To_machine_AWSBlockDeviceMappingSpec(a.(*AWSBlockDeviceMappingSpec), b.(*machine.AWSBlockDeviceMappingSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AWSBlockDeviceMappingSpec)(nil), (*AWSBlockDeviceMappingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AWSBlockDeviceMappingSpec_To_v1alpha1_AWSBlockDeviceMappingSpec(a.(*machine.AWSBlockDeviceMappingSpec), b.(*AWSBlockDeviceMappingSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSEbsBlockDeviceSpec)(nil), (*machine.AWSEbsBlockDeviceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AWSEbsBlockDeviceSpec_To_machine_AWSEbsBlockDeviceSpec(a.(*AWSEbsBlockDeviceSpec), b.(*machine.AWSEbsBlockDeviceSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AWSEbsBlockDeviceSpec)(nil), (*AWSEbsBlockDeviceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AWSEbsBlockDeviceSpec_To_v1alpha1_AWSEbsBlockDeviceSpec(a.(*machine.AWSEbsBlockDeviceSpec), b.(*AWSEbsBlockDeviceSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSIAMProfileSpec)(nil), (*machine.AWSIAMProfileSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AWSIAMProfileSpec_To_machine_AWSIAMProfileSpec(a.(*AWSIAMProfileSpec), b.(*machine.AWSIAMProfileSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AWSIAMProfileSpec)(nil), (*AWSIAMProfileSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AWSIAMProfileSpec_To_v1alpha1_AWSIAMProfileSpec(a.(*machine.AWSIAMProfileSpec), b.(*AWSIAMProfileSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSMachineClass)(nil), (*machine.AWSMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AWSMachineClass_To_machine_AWSMachineClass(a.(*AWSMachineClass), b.(*machine.AWSMachineClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AWSMachineClass)(nil), (*AWSMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AWSMachineClass_To_v1alpha1_AWSMachineClass(a.(*machine.AWSMachineClass), b.(*AWSMachineClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSMachineClassList)(nil), (*machine.AWSMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AWSMachineClassList_To_machine_AWSMachineClassList(a.(*AWSMachineClassList), b.(*machine.AWSMachineClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AWSMachineClassList)(nil), (*AWSMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AWSMachineClassList_To_v1alpha1_AWSMachineClassList(a.(*machine.AWSMachineClassList), b.(*AWSMachineClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSMachineClassSpec)(nil), (*machine.AWSMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AWSMachineClassSpec_To_machine_AWSMachineClassSpec(a.(*AWSMachineClassSpec), b.(*machine.AWSMachineClassSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AWSMachineClassSpec)(nil), (*AWSMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AWSMachineClassSpec_To_v1alpha1_AWSMachineClassSpec(a.(*machine.AWSMachineClassSpec), b.(*AWSMachineClassSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AWSNetworkInterfaceSpec)(nil), (*machine.AWSNetworkInterfaceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AWSNetworkInterfaceSpec_To_machine_AWSNetworkInterfaceSpec(a.(*AWSNetworkInterfaceSpec), b.(*machine.AWSNetworkInterfaceSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AWSNetworkInterfaceSpec)(nil), (*AWSNetworkInterfaceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AWSNetworkInterfaceSpec_To_v1alpha1_AWSNetworkInterfaceSpec(a.(*machine.AWSNetworkInterfaceSpec), b.(*AWSNetworkInterfaceSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AlicloudDataDisk)(nil), (*machine.AlicloudDataDisk)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AlicloudDataDisk_To_machine_AlicloudDataDisk(a.(*AlicloudDataDisk), b.(*machine.AlicloudDataDisk), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AlicloudDataDisk)(nil), (*AlicloudDataDisk)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AlicloudDataDisk_To_v1alpha1_AlicloudDataDisk(a.(*machine.AlicloudDataDisk), b.(*AlicloudDataDisk), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AlicloudMachineClass)(nil), (*machine.AlicloudMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AlicloudMachineClass_To_machine_AlicloudMachineClass(a.(*AlicloudMachineClass), b.(*machine.AlicloudMachineClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AlicloudMachineClass)(nil), (*AlicloudMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AlicloudMachineClass_To_v1alpha1_AlicloudMachineClass(a.(*machine.AlicloudMachineClass), b.(*AlicloudMachineClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AlicloudMachineClassList)(nil), (*machine.AlicloudMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AlicloudMachineClassList_To_machine_AlicloudMachineClassList(a.(*AlicloudMachineClassList), b.(*machine.AlicloudMachineClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AlicloudMachineClassList)(nil), (*AlicloudMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AlicloudMachineClassList_To_v1alpha1_AlicloudMachineClassList(a.(*machine.AlicloudMachineClassList), b.(*AlicloudMachineClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AlicloudMachineClassSpec)(nil), (*machine.AlicloudMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AlicloudMachineClassSpec_To_machine_AlicloudMachineClassSpec(a.(*AlicloudMachineClassSpec), b.(*machine.AlicloudMachineClassSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AlicloudMachineClassSpec)(nil), (*AlicloudMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AlicloudMachineClassSpec_To_v1alpha1_AlicloudMachineClassSpec(a.(*machine.AlicloudMachineClassSpec), b.(*AlicloudMachineClassSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AlicloudSystemDisk)(nil), (*machine.AlicloudSystemDisk)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AlicloudSystemDisk_To_machine_AlicloudSystemDisk(a.(*AlicloudSystemDisk), b.(*machine.AlicloudSystemDisk), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AlicloudSystemDisk)(nil), (*AlicloudSystemDisk)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AlicloudSystemDisk_To_v1alpha1_AlicloudSystemDisk(a.(*machine.AlicloudSystemDisk), b.(*AlicloudSystemDisk), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureDataDisk)(nil), (*machine.AzureDataDisk)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureDataDisk_To_machine_AzureDataDisk(a.(*AzureDataDisk), b.(*machine.AzureDataDisk), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureDataDisk)(nil), (*AzureDataDisk)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureDataDisk_To_v1alpha1_AzureDataDisk(a.(*machine.AzureDataDisk), b.(*AzureDataDisk), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureHardwareProfile)(nil), (*machine.AzureHardwareProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureHardwareProfile_To_machine_AzureHardwareProfile(a.(*AzureHardwareProfile), b.(*machine.AzureHardwareProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureHardwareProfile)(nil), (*AzureHardwareProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureHardwareProfile_To_v1alpha1_AzureHardwareProfile(a.(*machine.AzureHardwareProfile), b.(*AzureHardwareProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureImageReference)(nil), (*machine.AzureImageReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureImageReference_To_machine_AzureImageReference(a.(*AzureImageReference), b.(*machine.AzureImageReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureImageReference)(nil), (*AzureImageReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureImageReference_To_v1alpha1_AzureImageReference(a.(*machine.AzureImageReference), b.(*AzureImageReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureLinuxConfiguration)(nil), (*machine.AzureLinuxConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureLinuxConfiguration_To_machine_AzureLinuxConfiguration(a.(*AzureLinuxConfiguration), b.(*machine.AzureLinuxConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureLinuxConfiguration)(nil), (*AzureLinuxConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureLinuxConfiguration_To_v1alpha1_AzureLinuxConfiguration(a.(*machine.AzureLinuxConfiguration), b.(*AzureLinuxConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureMachineClass)(nil), (*machine.AzureMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureMachineClass_To_machine_AzureMachineClass(a.(*AzureMachineClass), b.(*machine.AzureMachineClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureMachineClass)(nil), (*AzureMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureMachineClass_To_v1alpha1_AzureMachineClass(a.(*machine.AzureMachineClass), b.(*AzureMachineClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureMachineClassList)(nil), (*machine.AzureMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureMachineClassList_To_machine_AzureMachineClassList(a.(*AzureMachineClassList), b.(*machine.AzureMachineClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureMachineClassList)(nil), (*AzureMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureMachineClassList_To_v1alpha1_AzureMachineClassList(a.(*machine.AzureMachineClassList), b.(*AzureMachineClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureMachineClassSpec)(nil), (*machine.AzureMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureMachineClassSpec_To_machine_AzureMachineClassSpec(a.(*AzureMachineClassSpec), b.(*machine.AzureMachineClassSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureMachineClassSpec)(nil), (*AzureMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureMachineClassSpec_To_v1alpha1_AzureMachineClassSpec(a.(*machine.AzureMachineClassSpec), b.(*AzureMachineClassSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureMachineSetConfig)(nil), (*machine.AzureMachineSetConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureMachineSetConfig_To_machine_AzureMachineSetConfig(a.(*AzureMachineSetConfig), b.(*machine.AzureMachineSetConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureMachineSetConfig)(nil), (*AzureMachineSetConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureMachineSetConfig_To_v1alpha1_AzureMachineSetConfig(a.(*machine.AzureMachineSetConfig), b.(*AzureMachineSetConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureManagedDiskParameters)(nil), (*machine.AzureManagedDiskParameters)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureManagedDiskParameters_To_machine_AzureManagedDiskParameters(a.(*AzureManagedDiskParameters), b.(*machine.AzureManagedDiskParameters), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureManagedDiskParameters)(nil), (*AzureManagedDiskParameters)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureManagedDiskParameters_To_v1alpha1_AzureManagedDiskParameters(a.(*machine.AzureManagedDiskParameters), b.(*AzureManagedDiskParameters), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureNetworkInterfaceReference)(nil), (*machine.AzureNetworkInterfaceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureNetworkInterfaceReference_To_machine_AzureNetworkInterfaceReference(a.(*AzureNetworkInterfaceReference), b.(*machine.AzureNetworkInterfaceReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureNetworkInterfaceReference)(nil), (*AzureNetworkInterfaceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureNetworkInterfaceReference_To_v1alpha1_AzureNetworkInterfaceReference(a.(*machine.AzureNetworkInterfaceReference), b.(*AzureNetworkInterfaceReference), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureNetworkInterfaceReferenceProperties)(nil), (*machine.AzureNetworkInterfaceReferenceProperties)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureNetworkInterfaceReferenceProperties_To_machine_AzureNetworkInterfaceReferenceProperties(a.(*AzureNetworkInterfaceReferenceProperties), b.(*machine.AzureNetworkInterfaceReferenceProperties), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureNetworkInterfaceReferenceProperties)(nil), (*AzureNetworkInterfaceReferenceProperties)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureNetworkInterfaceReferenceProperties_To_v1alpha1_AzureNetworkInterfaceReferenceProperties(a.(*machine.AzureNetworkInterfaceReferenceProperties), b.(*AzureNetworkInterfaceReferenceProperties), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureNetworkProfile)(nil), (*machine.AzureNetworkProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureNetworkProfile_To_machine_AzureNetworkProfile(a.(*AzureNetworkProfile), b.(*machine.AzureNetworkProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureNetworkProfile)(nil), (*AzureNetworkProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureNetworkProfile_To_v1alpha1_AzureNetworkProfile(a.(*machine.AzureNetworkProfile), b.(*AzureNetworkProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureOSDisk)(nil), (*machine.AzureOSDisk)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureOSDisk_To_machine_AzureOSDisk(a.(*AzureOSDisk), b.(*machine.AzureOSDisk), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureOSDisk)(nil), (*AzureOSDisk)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureOSDisk_To_v1alpha1_AzureOSDisk(a.(*machine.AzureOSDisk), b.(*AzureOSDisk), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureOSProfile)(nil), (*machine.AzureOSProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureOSProfile_To_machine_AzureOSProfile(a.(*AzureOSProfile), b.(*machine.AzureOSProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureOSProfile)(nil), (*AzureOSProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureOSProfile_To_v1alpha1_AzureOSProfile(a.(*machine.AzureOSProfile), b.(*AzureOSProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureSSHConfiguration)(nil), (*machine.AzureSSHConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureSSHConfiguration_To_machine_AzureSSHConfiguration(a.(*AzureSSHConfiguration), b.(*machine.AzureSSHConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureSSHConfiguration)(nil), (*AzureSSHConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureSSHConfiguration_To_v1alpha1_AzureSSHConfiguration(a.(*machine.AzureSSHConfiguration), b.(*AzureSSHConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureSSHPublicKey)(nil), (*machine.AzureSSHPublicKey)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureSSHPublicKey_To_machine_AzureSSHPublicKey(a.(*AzureSSHPublicKey), b.(*machine.AzureSSHPublicKey), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureSSHPublicKey)(nil), (*AzureSSHPublicKey)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureSSHPublicKey_To_v1alpha1_AzureSSHPublicKey(a.(*machine.AzureSSHPublicKey), b.(*AzureSSHPublicKey), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureStorageProfile)(nil), (*machine.AzureStorageProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureStorageProfile_To_machine_AzureStorageProfile(a.(*AzureStorageProfile), b.(*machine.AzureStorageProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureStorageProfile)(nil), (*AzureStorageProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureStorageProfile_To_v1alpha1_AzureStorageProfile(a.(*machine.AzureStorageProfile), b.(*AzureStorageProfile), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureSubResource)(nil), (*machine.AzureSubResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureSubResource_To_machine_AzureSubResource(a.(*AzureSubResource), b.(*machine.AzureSubResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureSubResource)(nil), (*AzureSubResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureSubResource_To_v1alpha1_AzureSubResource(a.(*machine.AzureSubResource), b.(*AzureSubResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureSubnetInfo)(nil), (*machine.AzureSubnetInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureSubnetInfo_To_machine_AzureSubnetInfo(a.(*AzureSubnetInfo), b.(*machine.AzureSubnetInfo), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureSubnetInfo)(nil), (*AzureSubnetInfo)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureSubnetInfo_To_v1alpha1_AzureSubnetInfo(a.(*machine.AzureSubnetInfo), b.(*AzureSubnetInfo), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*AzureVirtualMachineProperties)(nil), (*machine.AzureVirtualMachineProperties)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_AzureVirtualMachineProperties_To_machine_AzureVirtualMachineProperties(a.(*AzureVirtualMachineProperties), b.(*machine.AzureVirtualMachineProperties), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.AzureVirtualMachineProperties)(nil), (*AzureVirtualMachineProperties)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_AzureVirtualMachineProperties_To_v1alpha1_AzureVirtualMachineProperties(a.(*machine.AzureVirtualMachineProperties), b.(*AzureVirtualMachineProperties), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*ClassSpec)(nil), (*machine.ClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha1_ClassSpec_To_machine_ClassSpec(a.(*ClassSpec), b.(*machine.ClassSpec), scope) }); err != nil { @@ -379,86 +59,6 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*GCPDisk)(nil), (*machine.GCPDisk)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_GCPDisk_To_machine_GCPDisk(a.(*GCPDisk), b.(*machine.GCPDisk), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.GCPDisk)(nil), (*GCPDisk)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_GCPDisk_To_v1alpha1_GCPDisk(a.(*machine.GCPDisk), b.(*GCPDisk), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*GCPMachineClass)(nil), (*machine.GCPMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_GCPMachineClass_To_machine_GCPMachineClass(a.(*GCPMachineClass), b.(*machine.GCPMachineClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.GCPMachineClass)(nil), (*GCPMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_GCPMachineClass_To_v1alpha1_GCPMachineClass(a.(*machine.GCPMachineClass), b.(*GCPMachineClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*GCPMachineClassList)(nil), (*machine.GCPMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_GCPMachineClassList_To_machine_GCPMachineClassList(a.(*GCPMachineClassList), b.(*machine.GCPMachineClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.GCPMachineClassList)(nil), (*GCPMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_GCPMachineClassList_To_v1alpha1_GCPMachineClassList(a.(*machine.GCPMachineClassList), b.(*GCPMachineClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*GCPMachineClassSpec)(nil), (*machine.GCPMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_GCPMachineClassSpec_To_machine_GCPMachineClassSpec(a.(*GCPMachineClassSpec), b.(*machine.GCPMachineClassSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.GCPMachineClassSpec)(nil), (*GCPMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_GCPMachineClassSpec_To_v1alpha1_GCPMachineClassSpec(a.(*machine.GCPMachineClassSpec), b.(*GCPMachineClassSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*GCPMetadata)(nil), (*machine.GCPMetadata)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_GCPMetadata_To_machine_GCPMetadata(a.(*GCPMetadata), b.(*machine.GCPMetadata), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.GCPMetadata)(nil), (*GCPMetadata)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_GCPMetadata_To_v1alpha1_GCPMetadata(a.(*machine.GCPMetadata), b.(*GCPMetadata), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*GCPNetworkInterface)(nil), (*machine.GCPNetworkInterface)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_GCPNetworkInterface_To_machine_GCPNetworkInterface(a.(*GCPNetworkInterface), b.(*machine.GCPNetworkInterface), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.GCPNetworkInterface)(nil), (*GCPNetworkInterface)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_GCPNetworkInterface_To_v1alpha1_GCPNetworkInterface(a.(*machine.GCPNetworkInterface), b.(*GCPNetworkInterface), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*GCPScheduling)(nil), (*machine.GCPScheduling)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_GCPScheduling_To_machine_GCPScheduling(a.(*GCPScheduling), b.(*machine.GCPScheduling), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.GCPScheduling)(nil), (*GCPScheduling)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_GCPScheduling_To_v1alpha1_GCPScheduling(a.(*machine.GCPScheduling), b.(*GCPScheduling), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*GCPServiceAccount)(nil), (*machine.GCPServiceAccount)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_GCPServiceAccount_To_machine_GCPServiceAccount(a.(*GCPServiceAccount), b.(*machine.GCPServiceAccount), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.GCPServiceAccount)(nil), (*GCPServiceAccount)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_GCPServiceAccount_To_v1alpha1_GCPServiceAccount(a.(*machine.GCPServiceAccount), b.(*GCPServiceAccount), scope) - }); err != nil { - return err - } if err := s.AddGeneratedConversionFunc((*LastOperation)(nil), (*machine.LastOperation)(nil), func(a, b interface{}, scope conversion.Scope) error { return Convert_v1alpha1_LastOperation_To_machine_LastOperation(a.(*LastOperation), b.(*machine.LastOperation), scope) }); err != nil { @@ -665,1059 +265,53 @@ func RegisterConversions(s *runtime.Scheme) error { return err } if err := s.AddGeneratedConversionFunc((*machine.MachineTemplateSpec)(nil), (*MachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_MachineTemplateSpec_To_v1alpha1_MachineTemplateSpec(a.(*machine.MachineTemplateSpec), b.(*MachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NodeTemplate)(nil), (*machine.NodeTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_NodeTemplate_To_machine_NodeTemplate(a.(*NodeTemplate), b.(*machine.NodeTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.NodeTemplate)(nil), (*NodeTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_NodeTemplate_To_v1alpha1_NodeTemplate(a.(*machine.NodeTemplate), b.(*NodeTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NodeTemplateSpec)(nil), (*machine.NodeTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_NodeTemplateSpec_To_machine_NodeTemplateSpec(a.(*NodeTemplateSpec), b.(*machine.NodeTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.NodeTemplateSpec)(nil), (*NodeTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_NodeTemplateSpec_To_v1alpha1_NodeTemplateSpec(a.(*machine.NodeTemplateSpec), b.(*NodeTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackMachineClass)(nil), (*machine.OpenStackMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_OpenStackMachineClass_To_machine_OpenStackMachineClass(a.(*OpenStackMachineClass), b.(*machine.OpenStackMachineClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.OpenStackMachineClass)(nil), (*OpenStackMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_OpenStackMachineClass_To_v1alpha1_OpenStackMachineClass(a.(*machine.OpenStackMachineClass), b.(*OpenStackMachineClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackMachineClassList)(nil), (*machine.OpenStackMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_OpenStackMachineClassList_To_machine_OpenStackMachineClassList(a.(*OpenStackMachineClassList), b.(*machine.OpenStackMachineClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.OpenStackMachineClassList)(nil), (*OpenStackMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_OpenStackMachineClassList_To_v1alpha1_OpenStackMachineClassList(a.(*machine.OpenStackMachineClassList), b.(*OpenStackMachineClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackMachineClassSpec)(nil), (*machine.OpenStackMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_OpenStackMachineClassSpec_To_machine_OpenStackMachineClassSpec(a.(*OpenStackMachineClassSpec), b.(*machine.OpenStackMachineClassSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.OpenStackMachineClassSpec)(nil), (*OpenStackMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_OpenStackMachineClassSpec_To_v1alpha1_OpenStackMachineClassSpec(a.(*machine.OpenStackMachineClassSpec), b.(*OpenStackMachineClassSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*OpenStackNetwork)(nil), (*machine.OpenStackNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_OpenStackNetwork_To_machine_OpenStackNetwork(a.(*OpenStackNetwork), b.(*machine.OpenStackNetwork), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.OpenStackNetwork)(nil), (*OpenStackNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_OpenStackNetwork_To_v1alpha1_OpenStackNetwork(a.(*machine.OpenStackNetwork), b.(*OpenStackNetwork), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*PacketMachineClass)(nil), (*machine.PacketMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_PacketMachineClass_To_machine_PacketMachineClass(a.(*PacketMachineClass), b.(*machine.PacketMachineClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.PacketMachineClass)(nil), (*PacketMachineClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_PacketMachineClass_To_v1alpha1_PacketMachineClass(a.(*machine.PacketMachineClass), b.(*PacketMachineClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*PacketMachineClassList)(nil), (*machine.PacketMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_PacketMachineClassList_To_machine_PacketMachineClassList(a.(*PacketMachineClassList), b.(*machine.PacketMachineClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.PacketMachineClassList)(nil), (*PacketMachineClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_PacketMachineClassList_To_v1alpha1_PacketMachineClassList(a.(*machine.PacketMachineClassList), b.(*PacketMachineClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*PacketMachineClassSpec)(nil), (*machine.PacketMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_PacketMachineClassSpec_To_machine_PacketMachineClassSpec(a.(*PacketMachineClassSpec), b.(*machine.PacketMachineClassSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.PacketMachineClassSpec)(nil), (*PacketMachineClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_PacketMachineClassSpec_To_v1alpha1_PacketMachineClassSpec(a.(*machine.PacketMachineClassSpec), b.(*PacketMachineClassSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*RollbackConfig)(nil), (*machine.RollbackConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_RollbackConfig_To_machine_RollbackConfig(a.(*RollbackConfig), b.(*machine.RollbackConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.RollbackConfig)(nil), (*RollbackConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_RollbackConfig_To_v1alpha1_RollbackConfig(a.(*machine.RollbackConfig), b.(*RollbackConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*RollingUpdateMachineDeployment)(nil), (*machine.RollingUpdateMachineDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha1_RollingUpdateMachineDeployment_To_machine_RollingUpdateMachineDeployment(a.(*RollingUpdateMachineDeployment), b.(*machine.RollingUpdateMachineDeployment), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*machine.RollingUpdateMachineDeployment)(nil), (*RollingUpdateMachineDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_machine_RollingUpdateMachineDeployment_To_v1alpha1_RollingUpdateMachineDeployment(a.(*machine.RollingUpdateMachineDeployment), b.(*RollingUpdateMachineDeployment), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha1_AWSBlockDeviceMappingSpec_To_machine_AWSBlockDeviceMappingSpec(in *AWSBlockDeviceMappingSpec, out *machine.AWSBlockDeviceMappingSpec, s conversion.Scope) error { - out.DeviceName = in.DeviceName - if err := Convert_v1alpha1_AWSEbsBlockDeviceSpec_To_machine_AWSEbsBlockDeviceSpec(&in.Ebs, &out.Ebs, s); err != nil { - return err - } - out.NoDevice = in.NoDevice - out.VirtualName = in.VirtualName - return nil -} - -// Convert_v1alpha1_AWSBlockDeviceMappingSpec_To_machine_AWSBlockDeviceMappingSpec is an autogenerated conversion function. -func Convert_v1alpha1_AWSBlockDeviceMappingSpec_To_machine_AWSBlockDeviceMappingSpec(in *AWSBlockDeviceMappingSpec, out *machine.AWSBlockDeviceMappingSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_AWSBlockDeviceMappingSpec_To_machine_AWSBlockDeviceMappingSpec(in, out, s) -} - -func autoConvert_machine_AWSBlockDeviceMappingSpec_To_v1alpha1_AWSBlockDeviceMappingSpec(in *machine.AWSBlockDeviceMappingSpec, out *AWSBlockDeviceMappingSpec, s conversion.Scope) error { - out.DeviceName = in.DeviceName - if err := Convert_machine_AWSEbsBlockDeviceSpec_To_v1alpha1_AWSEbsBlockDeviceSpec(&in.Ebs, &out.Ebs, s); err != nil { - return err - } - out.NoDevice = in.NoDevice - out.VirtualName = in.VirtualName - return nil -} - -// Convert_machine_AWSBlockDeviceMappingSpec_To_v1alpha1_AWSBlockDeviceMappingSpec is an autogenerated conversion function. -func Convert_machine_AWSBlockDeviceMappingSpec_To_v1alpha1_AWSBlockDeviceMappingSpec(in *machine.AWSBlockDeviceMappingSpec, out *AWSBlockDeviceMappingSpec, s conversion.Scope) error { - return autoConvert_machine_AWSBlockDeviceMappingSpec_To_v1alpha1_AWSBlockDeviceMappingSpec(in, out, s) -} - -func autoConvert_v1alpha1_AWSEbsBlockDeviceSpec_To_machine_AWSEbsBlockDeviceSpec(in *AWSEbsBlockDeviceSpec, out *machine.AWSEbsBlockDeviceSpec, s conversion.Scope) error { - out.DeleteOnTermination = (*bool)(unsafe.Pointer(in.DeleteOnTermination)) - out.Encrypted = in.Encrypted - out.Iops = in.Iops - out.KmsKeyID = (*string)(unsafe.Pointer(in.KmsKeyID)) - out.SnapshotID = (*string)(unsafe.Pointer(in.SnapshotID)) - out.VolumeSize = in.VolumeSize - out.VolumeType = in.VolumeType - return nil -} - -// Convert_v1alpha1_AWSEbsBlockDeviceSpec_To_machine_AWSEbsBlockDeviceSpec is an autogenerated conversion function. -func Convert_v1alpha1_AWSEbsBlockDeviceSpec_To_machine_AWSEbsBlockDeviceSpec(in *AWSEbsBlockDeviceSpec, out *machine.AWSEbsBlockDeviceSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_AWSEbsBlockDeviceSpec_To_machine_AWSEbsBlockDeviceSpec(in, out, s) -} - -func autoConvert_machine_AWSEbsBlockDeviceSpec_To_v1alpha1_AWSEbsBlockDeviceSpec(in *machine.AWSEbsBlockDeviceSpec, out *AWSEbsBlockDeviceSpec, s conversion.Scope) error { - out.DeleteOnTermination = (*bool)(unsafe.Pointer(in.DeleteOnTermination)) - out.Encrypted = in.Encrypted - out.Iops = in.Iops - out.KmsKeyID = (*string)(unsafe.Pointer(in.KmsKeyID)) - out.SnapshotID = (*string)(unsafe.Pointer(in.SnapshotID)) - out.VolumeSize = in.VolumeSize - out.VolumeType = in.VolumeType - return nil -} - -// Convert_machine_AWSEbsBlockDeviceSpec_To_v1alpha1_AWSEbsBlockDeviceSpec is an autogenerated conversion function. -func Convert_machine_AWSEbsBlockDeviceSpec_To_v1alpha1_AWSEbsBlockDeviceSpec(in *machine.AWSEbsBlockDeviceSpec, out *AWSEbsBlockDeviceSpec, s conversion.Scope) error { - return autoConvert_machine_AWSEbsBlockDeviceSpec_To_v1alpha1_AWSEbsBlockDeviceSpec(in, out, s) -} - -func autoConvert_v1alpha1_AWSIAMProfileSpec_To_machine_AWSIAMProfileSpec(in *AWSIAMProfileSpec, out *machine.AWSIAMProfileSpec, s conversion.Scope) error { - out.ARN = in.ARN - out.Name = in.Name - return nil -} - -// Convert_v1alpha1_AWSIAMProfileSpec_To_machine_AWSIAMProfileSpec is an autogenerated conversion function. -func Convert_v1alpha1_AWSIAMProfileSpec_To_machine_AWSIAMProfileSpec(in *AWSIAMProfileSpec, out *machine.AWSIAMProfileSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_AWSIAMProfileSpec_To_machine_AWSIAMProfileSpec(in, out, s) -} - -func autoConvert_machine_AWSIAMProfileSpec_To_v1alpha1_AWSIAMProfileSpec(in *machine.AWSIAMProfileSpec, out *AWSIAMProfileSpec, s conversion.Scope) error { - out.ARN = in.ARN - out.Name = in.Name - return nil -} - -// Convert_machine_AWSIAMProfileSpec_To_v1alpha1_AWSIAMProfileSpec is an autogenerated conversion function. -func Convert_machine_AWSIAMProfileSpec_To_v1alpha1_AWSIAMProfileSpec(in *machine.AWSIAMProfileSpec, out *AWSIAMProfileSpec, s conversion.Scope) error { - return autoConvert_machine_AWSIAMProfileSpec_To_v1alpha1_AWSIAMProfileSpec(in, out, s) -} - -func autoConvert_v1alpha1_AWSMachineClass_To_machine_AWSMachineClass(in *AWSMachineClass, out *machine.AWSMachineClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_AWSMachineClassSpec_To_machine_AWSMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_AWSMachineClass_To_machine_AWSMachineClass is an autogenerated conversion function. -func Convert_v1alpha1_AWSMachineClass_To_machine_AWSMachineClass(in *AWSMachineClass, out *machine.AWSMachineClass, s conversion.Scope) error { - return autoConvert_v1alpha1_AWSMachineClass_To_machine_AWSMachineClass(in, out, s) -} - -func autoConvert_machine_AWSMachineClass_To_v1alpha1_AWSMachineClass(in *machine.AWSMachineClass, out *AWSMachineClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_machine_AWSMachineClassSpec_To_v1alpha1_AWSMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_machine_AWSMachineClass_To_v1alpha1_AWSMachineClass is an autogenerated conversion function. -func Convert_machine_AWSMachineClass_To_v1alpha1_AWSMachineClass(in *machine.AWSMachineClass, out *AWSMachineClass, s conversion.Scope) error { - return autoConvert_machine_AWSMachineClass_To_v1alpha1_AWSMachineClass(in, out, s) -} - -func autoConvert_v1alpha1_AWSMachineClassList_To_machine_AWSMachineClassList(in *AWSMachineClassList, out *machine.AWSMachineClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]machine.AWSMachineClass)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha1_AWSMachineClassList_To_machine_AWSMachineClassList is an autogenerated conversion function. -func Convert_v1alpha1_AWSMachineClassList_To_machine_AWSMachineClassList(in *AWSMachineClassList, out *machine.AWSMachineClassList, s conversion.Scope) error { - return autoConvert_v1alpha1_AWSMachineClassList_To_machine_AWSMachineClassList(in, out, s) -} - -func autoConvert_machine_AWSMachineClassList_To_v1alpha1_AWSMachineClassList(in *machine.AWSMachineClassList, out *AWSMachineClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]AWSMachineClass)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_machine_AWSMachineClassList_To_v1alpha1_AWSMachineClassList is an autogenerated conversion function. -func Convert_machine_AWSMachineClassList_To_v1alpha1_AWSMachineClassList(in *machine.AWSMachineClassList, out *AWSMachineClassList, s conversion.Scope) error { - return autoConvert_machine_AWSMachineClassList_To_v1alpha1_AWSMachineClassList(in, out, s) -} - -func autoConvert_v1alpha1_AWSMachineClassSpec_To_machine_AWSMachineClassSpec(in *AWSMachineClassSpec, out *machine.AWSMachineClassSpec, s conversion.Scope) error { - out.AMI = in.AMI - out.Region = in.Region - out.BlockDevices = *(*[]machine.AWSBlockDeviceMappingSpec)(unsafe.Pointer(&in.BlockDevices)) - out.EbsOptimized = in.EbsOptimized - if err := Convert_v1alpha1_AWSIAMProfileSpec_To_machine_AWSIAMProfileSpec(&in.IAM, &out.IAM, s); err != nil { - return err - } - out.MachineType = in.MachineType - out.KeyName = in.KeyName - out.Monitoring = in.Monitoring - out.NetworkInterfaces = *(*[]machine.AWSNetworkInterfaceSpec)(unsafe.Pointer(&in.NetworkInterfaces)) - out.Tags = *(*map[string]string)(unsafe.Pointer(&in.Tags)) - out.SpotPrice = (*string)(unsafe.Pointer(in.SpotPrice)) - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.CredentialsSecretRef = (*v1.SecretReference)(unsafe.Pointer(in.CredentialsSecretRef)) - return nil -} - -// Convert_v1alpha1_AWSMachineClassSpec_To_machine_AWSMachineClassSpec is an autogenerated conversion function. -func Convert_v1alpha1_AWSMachineClassSpec_To_machine_AWSMachineClassSpec(in *AWSMachineClassSpec, out *machine.AWSMachineClassSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_AWSMachineClassSpec_To_machine_AWSMachineClassSpec(in, out, s) -} - -func autoConvert_machine_AWSMachineClassSpec_To_v1alpha1_AWSMachineClassSpec(in *machine.AWSMachineClassSpec, out *AWSMachineClassSpec, s conversion.Scope) error { - out.AMI = in.AMI - out.Region = in.Region - out.BlockDevices = *(*[]AWSBlockDeviceMappingSpec)(unsafe.Pointer(&in.BlockDevices)) - out.EbsOptimized = in.EbsOptimized - if err := Convert_machine_AWSIAMProfileSpec_To_v1alpha1_AWSIAMProfileSpec(&in.IAM, &out.IAM, s); err != nil { - return err - } - out.MachineType = in.MachineType - out.KeyName = in.KeyName - out.Monitoring = in.Monitoring - out.NetworkInterfaces = *(*[]AWSNetworkInterfaceSpec)(unsafe.Pointer(&in.NetworkInterfaces)) - out.Tags = *(*map[string]string)(unsafe.Pointer(&in.Tags)) - out.SpotPrice = (*string)(unsafe.Pointer(in.SpotPrice)) - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.CredentialsSecretRef = (*v1.SecretReference)(unsafe.Pointer(in.CredentialsSecretRef)) - return nil -} - -// Convert_machine_AWSMachineClassSpec_To_v1alpha1_AWSMachineClassSpec is an autogenerated conversion function. -func Convert_machine_AWSMachineClassSpec_To_v1alpha1_AWSMachineClassSpec(in *machine.AWSMachineClassSpec, out *AWSMachineClassSpec, s conversion.Scope) error { - return autoConvert_machine_AWSMachineClassSpec_To_v1alpha1_AWSMachineClassSpec(in, out, s) -} - -func autoConvert_v1alpha1_AWSNetworkInterfaceSpec_To_machine_AWSNetworkInterfaceSpec(in *AWSNetworkInterfaceSpec, out *machine.AWSNetworkInterfaceSpec, s conversion.Scope) error { - out.AssociatePublicIPAddress = (*bool)(unsafe.Pointer(in.AssociatePublicIPAddress)) - out.DeleteOnTermination = (*bool)(unsafe.Pointer(in.DeleteOnTermination)) - out.Description = (*string)(unsafe.Pointer(in.Description)) - out.SecurityGroupIDs = *(*[]string)(unsafe.Pointer(&in.SecurityGroupIDs)) - out.SubnetID = in.SubnetID - return nil -} - -// Convert_v1alpha1_AWSNetworkInterfaceSpec_To_machine_AWSNetworkInterfaceSpec is an autogenerated conversion function. -func Convert_v1alpha1_AWSNetworkInterfaceSpec_To_machine_AWSNetworkInterfaceSpec(in *AWSNetworkInterfaceSpec, out *machine.AWSNetworkInterfaceSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_AWSNetworkInterfaceSpec_To_machine_AWSNetworkInterfaceSpec(in, out, s) -} - -func autoConvert_machine_AWSNetworkInterfaceSpec_To_v1alpha1_AWSNetworkInterfaceSpec(in *machine.AWSNetworkInterfaceSpec, out *AWSNetworkInterfaceSpec, s conversion.Scope) error { - out.AssociatePublicIPAddress = (*bool)(unsafe.Pointer(in.AssociatePublicIPAddress)) - out.DeleteOnTermination = (*bool)(unsafe.Pointer(in.DeleteOnTermination)) - out.Description = (*string)(unsafe.Pointer(in.Description)) - out.SecurityGroupIDs = *(*[]string)(unsafe.Pointer(&in.SecurityGroupIDs)) - out.SubnetID = in.SubnetID - return nil -} - -// Convert_machine_AWSNetworkInterfaceSpec_To_v1alpha1_AWSNetworkInterfaceSpec is an autogenerated conversion function. -func Convert_machine_AWSNetworkInterfaceSpec_To_v1alpha1_AWSNetworkInterfaceSpec(in *machine.AWSNetworkInterfaceSpec, out *AWSNetworkInterfaceSpec, s conversion.Scope) error { - return autoConvert_machine_AWSNetworkInterfaceSpec_To_v1alpha1_AWSNetworkInterfaceSpec(in, out, s) -} - -func autoConvert_v1alpha1_AlicloudDataDisk_To_machine_AlicloudDataDisk(in *AlicloudDataDisk, out *machine.AlicloudDataDisk, s conversion.Scope) error { - out.Name = in.Name - out.Category = in.Category - out.Description = in.Description - out.Encrypted = in.Encrypted - out.DeleteWithInstance = (*bool)(unsafe.Pointer(in.DeleteWithInstance)) - out.Size = in.Size - return nil -} - -// Convert_v1alpha1_AlicloudDataDisk_To_machine_AlicloudDataDisk is an autogenerated conversion function. -func Convert_v1alpha1_AlicloudDataDisk_To_machine_AlicloudDataDisk(in *AlicloudDataDisk, out *machine.AlicloudDataDisk, s conversion.Scope) error { - return autoConvert_v1alpha1_AlicloudDataDisk_To_machine_AlicloudDataDisk(in, out, s) -} - -func autoConvert_machine_AlicloudDataDisk_To_v1alpha1_AlicloudDataDisk(in *machine.AlicloudDataDisk, out *AlicloudDataDisk, s conversion.Scope) error { - out.Name = in.Name - out.Category = in.Category - out.Description = in.Description - out.Encrypted = in.Encrypted - out.Size = in.Size - out.DeleteWithInstance = (*bool)(unsafe.Pointer(in.DeleteWithInstance)) - return nil -} - -// Convert_machine_AlicloudDataDisk_To_v1alpha1_AlicloudDataDisk is an autogenerated conversion function. -func Convert_machine_AlicloudDataDisk_To_v1alpha1_AlicloudDataDisk(in *machine.AlicloudDataDisk, out *AlicloudDataDisk, s conversion.Scope) error { - return autoConvert_machine_AlicloudDataDisk_To_v1alpha1_AlicloudDataDisk(in, out, s) -} - -func autoConvert_v1alpha1_AlicloudMachineClass_To_machine_AlicloudMachineClass(in *AlicloudMachineClass, out *machine.AlicloudMachineClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_AlicloudMachineClassSpec_To_machine_AlicloudMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_AlicloudMachineClass_To_machine_AlicloudMachineClass is an autogenerated conversion function. -func Convert_v1alpha1_AlicloudMachineClass_To_machine_AlicloudMachineClass(in *AlicloudMachineClass, out *machine.AlicloudMachineClass, s conversion.Scope) error { - return autoConvert_v1alpha1_AlicloudMachineClass_To_machine_AlicloudMachineClass(in, out, s) -} - -func autoConvert_machine_AlicloudMachineClass_To_v1alpha1_AlicloudMachineClass(in *machine.AlicloudMachineClass, out *AlicloudMachineClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_machine_AlicloudMachineClassSpec_To_v1alpha1_AlicloudMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_machine_AlicloudMachineClass_To_v1alpha1_AlicloudMachineClass is an autogenerated conversion function. -func Convert_machine_AlicloudMachineClass_To_v1alpha1_AlicloudMachineClass(in *machine.AlicloudMachineClass, out *AlicloudMachineClass, s conversion.Scope) error { - return autoConvert_machine_AlicloudMachineClass_To_v1alpha1_AlicloudMachineClass(in, out, s) -} - -func autoConvert_v1alpha1_AlicloudMachineClassList_To_machine_AlicloudMachineClassList(in *AlicloudMachineClassList, out *machine.AlicloudMachineClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]machine.AlicloudMachineClass, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_AlicloudMachineClass_To_machine_AlicloudMachineClass(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha1_AlicloudMachineClassList_To_machine_AlicloudMachineClassList is an autogenerated conversion function. -func Convert_v1alpha1_AlicloudMachineClassList_To_machine_AlicloudMachineClassList(in *AlicloudMachineClassList, out *machine.AlicloudMachineClassList, s conversion.Scope) error { - return autoConvert_v1alpha1_AlicloudMachineClassList_To_machine_AlicloudMachineClassList(in, out, s) -} - -func autoConvert_machine_AlicloudMachineClassList_To_v1alpha1_AlicloudMachineClassList(in *machine.AlicloudMachineClassList, out *AlicloudMachineClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AlicloudMachineClass, len(*in)) - for i := range *in { - if err := Convert_machine_AlicloudMachineClass_To_v1alpha1_AlicloudMachineClass(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_machine_AlicloudMachineClassList_To_v1alpha1_AlicloudMachineClassList is an autogenerated conversion function. -func Convert_machine_AlicloudMachineClassList_To_v1alpha1_AlicloudMachineClassList(in *machine.AlicloudMachineClassList, out *AlicloudMachineClassList, s conversion.Scope) error { - return autoConvert_machine_AlicloudMachineClassList_To_v1alpha1_AlicloudMachineClassList(in, out, s) -} - -func autoConvert_v1alpha1_AlicloudMachineClassSpec_To_machine_AlicloudMachineClassSpec(in *AlicloudMachineClassSpec, out *machine.AlicloudMachineClassSpec, s conversion.Scope) error { - out.ImageID = in.ImageID - out.InstanceType = in.InstanceType - out.Region = in.Region - out.ZoneID = in.ZoneID - out.SecurityGroupID = in.SecurityGroupID - out.VSwitchID = in.VSwitchID - out.PrivateIPAddress = in.PrivateIPAddress - out.SystemDisk = (*machine.AlicloudSystemDisk)(unsafe.Pointer(in.SystemDisk)) - if in.DataDisks != nil { - in, out := &in.DataDisks, &out.DataDisks - *out = make([]machine.AlicloudDataDisk, len(*in)) - for i := range *in { - if err := Convert_v1alpha1_AlicloudDataDisk_To_machine_AlicloudDataDisk(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.DataDisks = nil - } - out.InstanceChargeType = in.InstanceChargeType - out.InternetChargeType = in.InternetChargeType - out.InternetMaxBandwidthIn = (*int)(unsafe.Pointer(in.InternetMaxBandwidthIn)) - out.InternetMaxBandwidthOut = (*int)(unsafe.Pointer(in.InternetMaxBandwidthOut)) - out.SpotStrategy = in.SpotStrategy - out.IoOptimized = in.IoOptimized - out.Tags = *(*map[string]string)(unsafe.Pointer(&in.Tags)) - out.KeyPairName = in.KeyPairName - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.CredentialsSecretRef = (*v1.SecretReference)(unsafe.Pointer(in.CredentialsSecretRef)) - return nil -} - -// Convert_v1alpha1_AlicloudMachineClassSpec_To_machine_AlicloudMachineClassSpec is an autogenerated conversion function. -func Convert_v1alpha1_AlicloudMachineClassSpec_To_machine_AlicloudMachineClassSpec(in *AlicloudMachineClassSpec, out *machine.AlicloudMachineClassSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_AlicloudMachineClassSpec_To_machine_AlicloudMachineClassSpec(in, out, s) -} - -func autoConvert_machine_AlicloudMachineClassSpec_To_v1alpha1_AlicloudMachineClassSpec(in *machine.AlicloudMachineClassSpec, out *AlicloudMachineClassSpec, s conversion.Scope) error { - out.ImageID = in.ImageID - out.InstanceType = in.InstanceType - out.Region = in.Region - out.ZoneID = in.ZoneID - out.SecurityGroupID = in.SecurityGroupID - out.VSwitchID = in.VSwitchID - out.PrivateIPAddress = in.PrivateIPAddress - out.SystemDisk = (*AlicloudSystemDisk)(unsafe.Pointer(in.SystemDisk)) - if in.DataDisks != nil { - in, out := &in.DataDisks, &out.DataDisks - *out = make([]AlicloudDataDisk, len(*in)) - for i := range *in { - if err := Convert_machine_AlicloudDataDisk_To_v1alpha1_AlicloudDataDisk(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.DataDisks = nil - } - out.InstanceChargeType = in.InstanceChargeType - out.InternetChargeType = in.InternetChargeType - out.InternetMaxBandwidthIn = (*int)(unsafe.Pointer(in.InternetMaxBandwidthIn)) - out.InternetMaxBandwidthOut = (*int)(unsafe.Pointer(in.InternetMaxBandwidthOut)) - out.SpotStrategy = in.SpotStrategy - out.IoOptimized = in.IoOptimized - out.Tags = *(*map[string]string)(unsafe.Pointer(&in.Tags)) - out.KeyPairName = in.KeyPairName - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.CredentialsSecretRef = (*v1.SecretReference)(unsafe.Pointer(in.CredentialsSecretRef)) - return nil -} - -// Convert_machine_AlicloudMachineClassSpec_To_v1alpha1_AlicloudMachineClassSpec is an autogenerated conversion function. -func Convert_machine_AlicloudMachineClassSpec_To_v1alpha1_AlicloudMachineClassSpec(in *machine.AlicloudMachineClassSpec, out *AlicloudMachineClassSpec, s conversion.Scope) error { - return autoConvert_machine_AlicloudMachineClassSpec_To_v1alpha1_AlicloudMachineClassSpec(in, out, s) -} - -func autoConvert_v1alpha1_AlicloudSystemDisk_To_machine_AlicloudSystemDisk(in *AlicloudSystemDisk, out *machine.AlicloudSystemDisk, s conversion.Scope) error { - out.Category = in.Category - out.Size = in.Size - return nil -} - -// Convert_v1alpha1_AlicloudSystemDisk_To_machine_AlicloudSystemDisk is an autogenerated conversion function. -func Convert_v1alpha1_AlicloudSystemDisk_To_machine_AlicloudSystemDisk(in *AlicloudSystemDisk, out *machine.AlicloudSystemDisk, s conversion.Scope) error { - return autoConvert_v1alpha1_AlicloudSystemDisk_To_machine_AlicloudSystemDisk(in, out, s) -} - -func autoConvert_machine_AlicloudSystemDisk_To_v1alpha1_AlicloudSystemDisk(in *machine.AlicloudSystemDisk, out *AlicloudSystemDisk, s conversion.Scope) error { - out.Category = in.Category - out.Size = in.Size - return nil -} - -// Convert_machine_AlicloudSystemDisk_To_v1alpha1_AlicloudSystemDisk is an autogenerated conversion function. -func Convert_machine_AlicloudSystemDisk_To_v1alpha1_AlicloudSystemDisk(in *machine.AlicloudSystemDisk, out *AlicloudSystemDisk, s conversion.Scope) error { - return autoConvert_machine_AlicloudSystemDisk_To_v1alpha1_AlicloudSystemDisk(in, out, s) -} - -func autoConvert_v1alpha1_AzureDataDisk_To_machine_AzureDataDisk(in *AzureDataDisk, out *machine.AzureDataDisk, s conversion.Scope) error { - out.Name = in.Name - out.Lun = (*int32)(unsafe.Pointer(in.Lun)) - out.Caching = in.Caching - out.StorageAccountType = in.StorageAccountType - out.DiskSizeGB = in.DiskSizeGB - return nil -} - -// Convert_v1alpha1_AzureDataDisk_To_machine_AzureDataDisk is an autogenerated conversion function. -func Convert_v1alpha1_AzureDataDisk_To_machine_AzureDataDisk(in *AzureDataDisk, out *machine.AzureDataDisk, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureDataDisk_To_machine_AzureDataDisk(in, out, s) -} - -func autoConvert_machine_AzureDataDisk_To_v1alpha1_AzureDataDisk(in *machine.AzureDataDisk, out *AzureDataDisk, s conversion.Scope) error { - out.Name = in.Name - out.Lun = (*int32)(unsafe.Pointer(in.Lun)) - out.Caching = in.Caching - out.StorageAccountType = in.StorageAccountType - out.DiskSizeGB = in.DiskSizeGB - return nil -} - -// Convert_machine_AzureDataDisk_To_v1alpha1_AzureDataDisk is an autogenerated conversion function. -func Convert_machine_AzureDataDisk_To_v1alpha1_AzureDataDisk(in *machine.AzureDataDisk, out *AzureDataDisk, s conversion.Scope) error { - return autoConvert_machine_AzureDataDisk_To_v1alpha1_AzureDataDisk(in, out, s) -} - -func autoConvert_v1alpha1_AzureHardwareProfile_To_machine_AzureHardwareProfile(in *AzureHardwareProfile, out *machine.AzureHardwareProfile, s conversion.Scope) error { - out.VMSize = in.VMSize - return nil -} - -// Convert_v1alpha1_AzureHardwareProfile_To_machine_AzureHardwareProfile is an autogenerated conversion function. -func Convert_v1alpha1_AzureHardwareProfile_To_machine_AzureHardwareProfile(in *AzureHardwareProfile, out *machine.AzureHardwareProfile, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureHardwareProfile_To_machine_AzureHardwareProfile(in, out, s) -} - -func autoConvert_machine_AzureHardwareProfile_To_v1alpha1_AzureHardwareProfile(in *machine.AzureHardwareProfile, out *AzureHardwareProfile, s conversion.Scope) error { - out.VMSize = in.VMSize - return nil -} - -// Convert_machine_AzureHardwareProfile_To_v1alpha1_AzureHardwareProfile is an autogenerated conversion function. -func Convert_machine_AzureHardwareProfile_To_v1alpha1_AzureHardwareProfile(in *machine.AzureHardwareProfile, out *AzureHardwareProfile, s conversion.Scope) error { - return autoConvert_machine_AzureHardwareProfile_To_v1alpha1_AzureHardwareProfile(in, out, s) -} - -func autoConvert_v1alpha1_AzureImageReference_To_machine_AzureImageReference(in *AzureImageReference, out *machine.AzureImageReference, s conversion.Scope) error { - out.ID = in.ID - out.URN = (*string)(unsafe.Pointer(in.URN)) - return nil -} - -// Convert_v1alpha1_AzureImageReference_To_machine_AzureImageReference is an autogenerated conversion function. -func Convert_v1alpha1_AzureImageReference_To_machine_AzureImageReference(in *AzureImageReference, out *machine.AzureImageReference, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureImageReference_To_machine_AzureImageReference(in, out, s) -} - -func autoConvert_machine_AzureImageReference_To_v1alpha1_AzureImageReference(in *machine.AzureImageReference, out *AzureImageReference, s conversion.Scope) error { - out.ID = in.ID - out.URN = (*string)(unsafe.Pointer(in.URN)) - return nil -} - -// Convert_machine_AzureImageReference_To_v1alpha1_AzureImageReference is an autogenerated conversion function. -func Convert_machine_AzureImageReference_To_v1alpha1_AzureImageReference(in *machine.AzureImageReference, out *AzureImageReference, s conversion.Scope) error { - return autoConvert_machine_AzureImageReference_To_v1alpha1_AzureImageReference(in, out, s) -} - -func autoConvert_v1alpha1_AzureLinuxConfiguration_To_machine_AzureLinuxConfiguration(in *AzureLinuxConfiguration, out *machine.AzureLinuxConfiguration, s conversion.Scope) error { - out.DisablePasswordAuthentication = in.DisablePasswordAuthentication - if err := Convert_v1alpha1_AzureSSHConfiguration_To_machine_AzureSSHConfiguration(&in.SSH, &out.SSH, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_AzureLinuxConfiguration_To_machine_AzureLinuxConfiguration is an autogenerated conversion function. -func Convert_v1alpha1_AzureLinuxConfiguration_To_machine_AzureLinuxConfiguration(in *AzureLinuxConfiguration, out *machine.AzureLinuxConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureLinuxConfiguration_To_machine_AzureLinuxConfiguration(in, out, s) -} - -func autoConvert_machine_AzureLinuxConfiguration_To_v1alpha1_AzureLinuxConfiguration(in *machine.AzureLinuxConfiguration, out *AzureLinuxConfiguration, s conversion.Scope) error { - out.DisablePasswordAuthentication = in.DisablePasswordAuthentication - if err := Convert_machine_AzureSSHConfiguration_To_v1alpha1_AzureSSHConfiguration(&in.SSH, &out.SSH, s); err != nil { - return err - } - return nil -} - -// Convert_machine_AzureLinuxConfiguration_To_v1alpha1_AzureLinuxConfiguration is an autogenerated conversion function. -func Convert_machine_AzureLinuxConfiguration_To_v1alpha1_AzureLinuxConfiguration(in *machine.AzureLinuxConfiguration, out *AzureLinuxConfiguration, s conversion.Scope) error { - return autoConvert_machine_AzureLinuxConfiguration_To_v1alpha1_AzureLinuxConfiguration(in, out, s) -} - -func autoConvert_v1alpha1_AzureMachineClass_To_machine_AzureMachineClass(in *AzureMachineClass, out *machine.AzureMachineClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_AzureMachineClassSpec_To_machine_AzureMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_AzureMachineClass_To_machine_AzureMachineClass is an autogenerated conversion function. -func Convert_v1alpha1_AzureMachineClass_To_machine_AzureMachineClass(in *AzureMachineClass, out *machine.AzureMachineClass, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureMachineClass_To_machine_AzureMachineClass(in, out, s) -} - -func autoConvert_machine_AzureMachineClass_To_v1alpha1_AzureMachineClass(in *machine.AzureMachineClass, out *AzureMachineClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_machine_AzureMachineClassSpec_To_v1alpha1_AzureMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_machine_AzureMachineClass_To_v1alpha1_AzureMachineClass is an autogenerated conversion function. -func Convert_machine_AzureMachineClass_To_v1alpha1_AzureMachineClass(in *machine.AzureMachineClass, out *AzureMachineClass, s conversion.Scope) error { - return autoConvert_machine_AzureMachineClass_To_v1alpha1_AzureMachineClass(in, out, s) -} - -func autoConvert_v1alpha1_AzureMachineClassList_To_machine_AzureMachineClassList(in *AzureMachineClassList, out *machine.AzureMachineClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]machine.AzureMachineClass)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha1_AzureMachineClassList_To_machine_AzureMachineClassList is an autogenerated conversion function. -func Convert_v1alpha1_AzureMachineClassList_To_machine_AzureMachineClassList(in *AzureMachineClassList, out *machine.AzureMachineClassList, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureMachineClassList_To_machine_AzureMachineClassList(in, out, s) -} - -func autoConvert_machine_AzureMachineClassList_To_v1alpha1_AzureMachineClassList(in *machine.AzureMachineClassList, out *AzureMachineClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]AzureMachineClass)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_machine_AzureMachineClassList_To_v1alpha1_AzureMachineClassList is an autogenerated conversion function. -func Convert_machine_AzureMachineClassList_To_v1alpha1_AzureMachineClassList(in *machine.AzureMachineClassList, out *AzureMachineClassList, s conversion.Scope) error { - return autoConvert_machine_AzureMachineClassList_To_v1alpha1_AzureMachineClassList(in, out, s) -} - -func autoConvert_v1alpha1_AzureMachineClassSpec_To_machine_AzureMachineClassSpec(in *AzureMachineClassSpec, out *machine.AzureMachineClassSpec, s conversion.Scope) error { - out.Location = in.Location - out.Tags = *(*map[string]string)(unsafe.Pointer(&in.Tags)) - if err := Convert_v1alpha1_AzureVirtualMachineProperties_To_machine_AzureVirtualMachineProperties(&in.Properties, &out.Properties, s); err != nil { - return err - } - out.ResourceGroup = in.ResourceGroup - if err := Convert_v1alpha1_AzureSubnetInfo_To_machine_AzureSubnetInfo(&in.SubnetInfo, &out.SubnetInfo, s); err != nil { - return err - } - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.CredentialsSecretRef = (*v1.SecretReference)(unsafe.Pointer(in.CredentialsSecretRef)) - return nil -} - -// Convert_v1alpha1_AzureMachineClassSpec_To_machine_AzureMachineClassSpec is an autogenerated conversion function. -func Convert_v1alpha1_AzureMachineClassSpec_To_machine_AzureMachineClassSpec(in *AzureMachineClassSpec, out *machine.AzureMachineClassSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureMachineClassSpec_To_machine_AzureMachineClassSpec(in, out, s) -} - -func autoConvert_machine_AzureMachineClassSpec_To_v1alpha1_AzureMachineClassSpec(in *machine.AzureMachineClassSpec, out *AzureMachineClassSpec, s conversion.Scope) error { - out.Location = in.Location - out.Tags = *(*map[string]string)(unsafe.Pointer(&in.Tags)) - if err := Convert_machine_AzureVirtualMachineProperties_To_v1alpha1_AzureVirtualMachineProperties(&in.Properties, &out.Properties, s); err != nil { - return err - } - out.ResourceGroup = in.ResourceGroup - if err := Convert_machine_AzureSubnetInfo_To_v1alpha1_AzureSubnetInfo(&in.SubnetInfo, &out.SubnetInfo, s); err != nil { - return err - } - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.CredentialsSecretRef = (*v1.SecretReference)(unsafe.Pointer(in.CredentialsSecretRef)) - return nil -} - -// Convert_machine_AzureMachineClassSpec_To_v1alpha1_AzureMachineClassSpec is an autogenerated conversion function. -func Convert_machine_AzureMachineClassSpec_To_v1alpha1_AzureMachineClassSpec(in *machine.AzureMachineClassSpec, out *AzureMachineClassSpec, s conversion.Scope) error { - return autoConvert_machine_AzureMachineClassSpec_To_v1alpha1_AzureMachineClassSpec(in, out, s) -} - -func autoConvert_v1alpha1_AzureMachineSetConfig_To_machine_AzureMachineSetConfig(in *AzureMachineSetConfig, out *machine.AzureMachineSetConfig, s conversion.Scope) error { - out.ID = in.ID - out.Kind = in.Kind - return nil -} - -// Convert_v1alpha1_AzureMachineSetConfig_To_machine_AzureMachineSetConfig is an autogenerated conversion function. -func Convert_v1alpha1_AzureMachineSetConfig_To_machine_AzureMachineSetConfig(in *AzureMachineSetConfig, out *machine.AzureMachineSetConfig, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureMachineSetConfig_To_machine_AzureMachineSetConfig(in, out, s) -} - -func autoConvert_machine_AzureMachineSetConfig_To_v1alpha1_AzureMachineSetConfig(in *machine.AzureMachineSetConfig, out *AzureMachineSetConfig, s conversion.Scope) error { - out.ID = in.ID - out.Kind = in.Kind - return nil -} - -// Convert_machine_AzureMachineSetConfig_To_v1alpha1_AzureMachineSetConfig is an autogenerated conversion function. -func Convert_machine_AzureMachineSetConfig_To_v1alpha1_AzureMachineSetConfig(in *machine.AzureMachineSetConfig, out *AzureMachineSetConfig, s conversion.Scope) error { - return autoConvert_machine_AzureMachineSetConfig_To_v1alpha1_AzureMachineSetConfig(in, out, s) -} - -func autoConvert_v1alpha1_AzureManagedDiskParameters_To_machine_AzureManagedDiskParameters(in *AzureManagedDiskParameters, out *machine.AzureManagedDiskParameters, s conversion.Scope) error { - out.ID = in.ID - out.StorageAccountType = in.StorageAccountType - return nil -} - -// Convert_v1alpha1_AzureManagedDiskParameters_To_machine_AzureManagedDiskParameters is an autogenerated conversion function. -func Convert_v1alpha1_AzureManagedDiskParameters_To_machine_AzureManagedDiskParameters(in *AzureManagedDiskParameters, out *machine.AzureManagedDiskParameters, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureManagedDiskParameters_To_machine_AzureManagedDiskParameters(in, out, s) -} - -func autoConvert_machine_AzureManagedDiskParameters_To_v1alpha1_AzureManagedDiskParameters(in *machine.AzureManagedDiskParameters, out *AzureManagedDiskParameters, s conversion.Scope) error { - out.ID = in.ID - out.StorageAccountType = in.StorageAccountType - return nil -} - -// Convert_machine_AzureManagedDiskParameters_To_v1alpha1_AzureManagedDiskParameters is an autogenerated conversion function. -func Convert_machine_AzureManagedDiskParameters_To_v1alpha1_AzureManagedDiskParameters(in *machine.AzureManagedDiskParameters, out *AzureManagedDiskParameters, s conversion.Scope) error { - return autoConvert_machine_AzureManagedDiskParameters_To_v1alpha1_AzureManagedDiskParameters(in, out, s) -} - -func autoConvert_v1alpha1_AzureNetworkInterfaceReference_To_machine_AzureNetworkInterfaceReference(in *AzureNetworkInterfaceReference, out *machine.AzureNetworkInterfaceReference, s conversion.Scope) error { - out.ID = in.ID - out.AzureNetworkInterfaceReferenceProperties = (*machine.AzureNetworkInterfaceReferenceProperties)(unsafe.Pointer(in.AzureNetworkInterfaceReferenceProperties)) - return nil -} - -// Convert_v1alpha1_AzureNetworkInterfaceReference_To_machine_AzureNetworkInterfaceReference is an autogenerated conversion function. -func Convert_v1alpha1_AzureNetworkInterfaceReference_To_machine_AzureNetworkInterfaceReference(in *AzureNetworkInterfaceReference, out *machine.AzureNetworkInterfaceReference, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureNetworkInterfaceReference_To_machine_AzureNetworkInterfaceReference(in, out, s) -} - -func autoConvert_machine_AzureNetworkInterfaceReference_To_v1alpha1_AzureNetworkInterfaceReference(in *machine.AzureNetworkInterfaceReference, out *AzureNetworkInterfaceReference, s conversion.Scope) error { - out.ID = in.ID - out.AzureNetworkInterfaceReferenceProperties = (*AzureNetworkInterfaceReferenceProperties)(unsafe.Pointer(in.AzureNetworkInterfaceReferenceProperties)) - return nil -} - -// Convert_machine_AzureNetworkInterfaceReference_To_v1alpha1_AzureNetworkInterfaceReference is an autogenerated conversion function. -func Convert_machine_AzureNetworkInterfaceReference_To_v1alpha1_AzureNetworkInterfaceReference(in *machine.AzureNetworkInterfaceReference, out *AzureNetworkInterfaceReference, s conversion.Scope) error { - return autoConvert_machine_AzureNetworkInterfaceReference_To_v1alpha1_AzureNetworkInterfaceReference(in, out, s) -} - -func autoConvert_v1alpha1_AzureNetworkInterfaceReferenceProperties_To_machine_AzureNetworkInterfaceReferenceProperties(in *AzureNetworkInterfaceReferenceProperties, out *machine.AzureNetworkInterfaceReferenceProperties, s conversion.Scope) error { - out.Primary = in.Primary - return nil -} - -// Convert_v1alpha1_AzureNetworkInterfaceReferenceProperties_To_machine_AzureNetworkInterfaceReferenceProperties is an autogenerated conversion function. -func Convert_v1alpha1_AzureNetworkInterfaceReferenceProperties_To_machine_AzureNetworkInterfaceReferenceProperties(in *AzureNetworkInterfaceReferenceProperties, out *machine.AzureNetworkInterfaceReferenceProperties, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureNetworkInterfaceReferenceProperties_To_machine_AzureNetworkInterfaceReferenceProperties(in, out, s) -} - -func autoConvert_machine_AzureNetworkInterfaceReferenceProperties_To_v1alpha1_AzureNetworkInterfaceReferenceProperties(in *machine.AzureNetworkInterfaceReferenceProperties, out *AzureNetworkInterfaceReferenceProperties, s conversion.Scope) error { - out.Primary = in.Primary - return nil -} - -// Convert_machine_AzureNetworkInterfaceReferenceProperties_To_v1alpha1_AzureNetworkInterfaceReferenceProperties is an autogenerated conversion function. -func Convert_machine_AzureNetworkInterfaceReferenceProperties_To_v1alpha1_AzureNetworkInterfaceReferenceProperties(in *machine.AzureNetworkInterfaceReferenceProperties, out *AzureNetworkInterfaceReferenceProperties, s conversion.Scope) error { - return autoConvert_machine_AzureNetworkInterfaceReferenceProperties_To_v1alpha1_AzureNetworkInterfaceReferenceProperties(in, out, s) -} - -func autoConvert_v1alpha1_AzureNetworkProfile_To_machine_AzureNetworkProfile(in *AzureNetworkProfile, out *machine.AzureNetworkProfile, s conversion.Scope) error { - if err := Convert_v1alpha1_AzureNetworkInterfaceReference_To_machine_AzureNetworkInterfaceReference(&in.NetworkInterfaces, &out.NetworkInterfaces, s); err != nil { - return err - } - out.AcceleratedNetworking = (*bool)(unsafe.Pointer(in.AcceleratedNetworking)) - return nil -} - -// Convert_v1alpha1_AzureNetworkProfile_To_machine_AzureNetworkProfile is an autogenerated conversion function. -func Convert_v1alpha1_AzureNetworkProfile_To_machine_AzureNetworkProfile(in *AzureNetworkProfile, out *machine.AzureNetworkProfile, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureNetworkProfile_To_machine_AzureNetworkProfile(in, out, s) -} - -func autoConvert_machine_AzureNetworkProfile_To_v1alpha1_AzureNetworkProfile(in *machine.AzureNetworkProfile, out *AzureNetworkProfile, s conversion.Scope) error { - if err := Convert_machine_AzureNetworkInterfaceReference_To_v1alpha1_AzureNetworkInterfaceReference(&in.NetworkInterfaces, &out.NetworkInterfaces, s); err != nil { - return err - } - out.AcceleratedNetworking = (*bool)(unsafe.Pointer(in.AcceleratedNetworking)) - return nil -} - -// Convert_machine_AzureNetworkProfile_To_v1alpha1_AzureNetworkProfile is an autogenerated conversion function. -func Convert_machine_AzureNetworkProfile_To_v1alpha1_AzureNetworkProfile(in *machine.AzureNetworkProfile, out *AzureNetworkProfile, s conversion.Scope) error { - return autoConvert_machine_AzureNetworkProfile_To_v1alpha1_AzureNetworkProfile(in, out, s) -} - -func autoConvert_v1alpha1_AzureOSDisk_To_machine_AzureOSDisk(in *AzureOSDisk, out *machine.AzureOSDisk, s conversion.Scope) error { - out.Name = in.Name - out.Caching = in.Caching - if err := Convert_v1alpha1_AzureManagedDiskParameters_To_machine_AzureManagedDiskParameters(&in.ManagedDisk, &out.ManagedDisk, s); err != nil { - return err - } - out.DiskSizeGB = in.DiskSizeGB - out.CreateOption = in.CreateOption - return nil -} - -// Convert_v1alpha1_AzureOSDisk_To_machine_AzureOSDisk is an autogenerated conversion function. -func Convert_v1alpha1_AzureOSDisk_To_machine_AzureOSDisk(in *AzureOSDisk, out *machine.AzureOSDisk, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureOSDisk_To_machine_AzureOSDisk(in, out, s) -} - -func autoConvert_machine_AzureOSDisk_To_v1alpha1_AzureOSDisk(in *machine.AzureOSDisk, out *AzureOSDisk, s conversion.Scope) error { - out.Name = in.Name - out.Caching = in.Caching - if err := Convert_machine_AzureManagedDiskParameters_To_v1alpha1_AzureManagedDiskParameters(&in.ManagedDisk, &out.ManagedDisk, s); err != nil { - return err - } - out.DiskSizeGB = in.DiskSizeGB - out.CreateOption = in.CreateOption - return nil -} - -// Convert_machine_AzureOSDisk_To_v1alpha1_AzureOSDisk is an autogenerated conversion function. -func Convert_machine_AzureOSDisk_To_v1alpha1_AzureOSDisk(in *machine.AzureOSDisk, out *AzureOSDisk, s conversion.Scope) error { - return autoConvert_machine_AzureOSDisk_To_v1alpha1_AzureOSDisk(in, out, s) -} - -func autoConvert_v1alpha1_AzureOSProfile_To_machine_AzureOSProfile(in *AzureOSProfile, out *machine.AzureOSProfile, s conversion.Scope) error { - out.ComputerName = in.ComputerName - out.AdminUsername = in.AdminUsername - out.AdminPassword = in.AdminPassword - out.CustomData = in.CustomData - if err := Convert_v1alpha1_AzureLinuxConfiguration_To_machine_AzureLinuxConfiguration(&in.LinuxConfiguration, &out.LinuxConfiguration, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_AzureOSProfile_To_machine_AzureOSProfile is an autogenerated conversion function. -func Convert_v1alpha1_AzureOSProfile_To_machine_AzureOSProfile(in *AzureOSProfile, out *machine.AzureOSProfile, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureOSProfile_To_machine_AzureOSProfile(in, out, s) -} - -func autoConvert_machine_AzureOSProfile_To_v1alpha1_AzureOSProfile(in *machine.AzureOSProfile, out *AzureOSProfile, s conversion.Scope) error { - out.ComputerName = in.ComputerName - out.AdminUsername = in.AdminUsername - out.AdminPassword = in.AdminPassword - out.CustomData = in.CustomData - if err := Convert_machine_AzureLinuxConfiguration_To_v1alpha1_AzureLinuxConfiguration(&in.LinuxConfiguration, &out.LinuxConfiguration, s); err != nil { - return err - } - return nil -} - -// Convert_machine_AzureOSProfile_To_v1alpha1_AzureOSProfile is an autogenerated conversion function. -func Convert_machine_AzureOSProfile_To_v1alpha1_AzureOSProfile(in *machine.AzureOSProfile, out *AzureOSProfile, s conversion.Scope) error { - return autoConvert_machine_AzureOSProfile_To_v1alpha1_AzureOSProfile(in, out, s) -} - -func autoConvert_v1alpha1_AzureSSHConfiguration_To_machine_AzureSSHConfiguration(in *AzureSSHConfiguration, out *machine.AzureSSHConfiguration, s conversion.Scope) error { - if err := Convert_v1alpha1_AzureSSHPublicKey_To_machine_AzureSSHPublicKey(&in.PublicKeys, &out.PublicKeys, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_AzureSSHConfiguration_To_machine_AzureSSHConfiguration is an autogenerated conversion function. -func Convert_v1alpha1_AzureSSHConfiguration_To_machine_AzureSSHConfiguration(in *AzureSSHConfiguration, out *machine.AzureSSHConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureSSHConfiguration_To_machine_AzureSSHConfiguration(in, out, s) -} - -func autoConvert_machine_AzureSSHConfiguration_To_v1alpha1_AzureSSHConfiguration(in *machine.AzureSSHConfiguration, out *AzureSSHConfiguration, s conversion.Scope) error { - if err := Convert_machine_AzureSSHPublicKey_To_v1alpha1_AzureSSHPublicKey(&in.PublicKeys, &out.PublicKeys, s); err != nil { - return err - } - return nil -} - -// Convert_machine_AzureSSHConfiguration_To_v1alpha1_AzureSSHConfiguration is an autogenerated conversion function. -func Convert_machine_AzureSSHConfiguration_To_v1alpha1_AzureSSHConfiguration(in *machine.AzureSSHConfiguration, out *AzureSSHConfiguration, s conversion.Scope) error { - return autoConvert_machine_AzureSSHConfiguration_To_v1alpha1_AzureSSHConfiguration(in, out, s) -} - -func autoConvert_v1alpha1_AzureSSHPublicKey_To_machine_AzureSSHPublicKey(in *AzureSSHPublicKey, out *machine.AzureSSHPublicKey, s conversion.Scope) error { - out.Path = in.Path - out.KeyData = in.KeyData - return nil -} - -// Convert_v1alpha1_AzureSSHPublicKey_To_machine_AzureSSHPublicKey is an autogenerated conversion function. -func Convert_v1alpha1_AzureSSHPublicKey_To_machine_AzureSSHPublicKey(in *AzureSSHPublicKey, out *machine.AzureSSHPublicKey, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureSSHPublicKey_To_machine_AzureSSHPublicKey(in, out, s) -} - -func autoConvert_machine_AzureSSHPublicKey_To_v1alpha1_AzureSSHPublicKey(in *machine.AzureSSHPublicKey, out *AzureSSHPublicKey, s conversion.Scope) error { - out.Path = in.Path - out.KeyData = in.KeyData - return nil -} - -// Convert_machine_AzureSSHPublicKey_To_v1alpha1_AzureSSHPublicKey is an autogenerated conversion function. -func Convert_machine_AzureSSHPublicKey_To_v1alpha1_AzureSSHPublicKey(in *machine.AzureSSHPublicKey, out *AzureSSHPublicKey, s conversion.Scope) error { - return autoConvert_machine_AzureSSHPublicKey_To_v1alpha1_AzureSSHPublicKey(in, out, s) -} - -func autoConvert_v1alpha1_AzureStorageProfile_To_machine_AzureStorageProfile(in *AzureStorageProfile, out *machine.AzureStorageProfile, s conversion.Scope) error { - if err := Convert_v1alpha1_AzureImageReference_To_machine_AzureImageReference(&in.ImageReference, &out.ImageReference, s); err != nil { - return err - } - if err := Convert_v1alpha1_AzureOSDisk_To_machine_AzureOSDisk(&in.OsDisk, &out.OsDisk, s); err != nil { - return err - } - out.DataDisks = *(*[]machine.AzureDataDisk)(unsafe.Pointer(&in.DataDisks)) - return nil -} - -// Convert_v1alpha1_AzureStorageProfile_To_machine_AzureStorageProfile is an autogenerated conversion function. -func Convert_v1alpha1_AzureStorageProfile_To_machine_AzureStorageProfile(in *AzureStorageProfile, out *machine.AzureStorageProfile, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureStorageProfile_To_machine_AzureStorageProfile(in, out, s) -} - -func autoConvert_machine_AzureStorageProfile_To_v1alpha1_AzureStorageProfile(in *machine.AzureStorageProfile, out *AzureStorageProfile, s conversion.Scope) error { - if err := Convert_machine_AzureImageReference_To_v1alpha1_AzureImageReference(&in.ImageReference, &out.ImageReference, s); err != nil { - return err - } - if err := Convert_machine_AzureOSDisk_To_v1alpha1_AzureOSDisk(&in.OsDisk, &out.OsDisk, s); err != nil { + return Convert_machine_MachineTemplateSpec_To_v1alpha1_MachineTemplateSpec(a.(*machine.MachineTemplateSpec), b.(*MachineTemplateSpec), scope) + }); err != nil { return err } - out.DataDisks = *(*[]AzureDataDisk)(unsafe.Pointer(&in.DataDisks)) - return nil -} - -// Convert_machine_AzureStorageProfile_To_v1alpha1_AzureStorageProfile is an autogenerated conversion function. -func Convert_machine_AzureStorageProfile_To_v1alpha1_AzureStorageProfile(in *machine.AzureStorageProfile, out *AzureStorageProfile, s conversion.Scope) error { - return autoConvert_machine_AzureStorageProfile_To_v1alpha1_AzureStorageProfile(in, out, s) -} - -func autoConvert_v1alpha1_AzureSubResource_To_machine_AzureSubResource(in *AzureSubResource, out *machine.AzureSubResource, s conversion.Scope) error { - out.ID = in.ID - return nil -} - -// Convert_v1alpha1_AzureSubResource_To_machine_AzureSubResource is an autogenerated conversion function. -func Convert_v1alpha1_AzureSubResource_To_machine_AzureSubResource(in *AzureSubResource, out *machine.AzureSubResource, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureSubResource_To_machine_AzureSubResource(in, out, s) -} - -func autoConvert_machine_AzureSubResource_To_v1alpha1_AzureSubResource(in *machine.AzureSubResource, out *AzureSubResource, s conversion.Scope) error { - out.ID = in.ID - return nil -} - -// Convert_machine_AzureSubResource_To_v1alpha1_AzureSubResource is an autogenerated conversion function. -func Convert_machine_AzureSubResource_To_v1alpha1_AzureSubResource(in *machine.AzureSubResource, out *AzureSubResource, s conversion.Scope) error { - return autoConvert_machine_AzureSubResource_To_v1alpha1_AzureSubResource(in, out, s) -} - -func autoConvert_v1alpha1_AzureSubnetInfo_To_machine_AzureSubnetInfo(in *AzureSubnetInfo, out *machine.AzureSubnetInfo, s conversion.Scope) error { - out.VnetName = in.VnetName - out.VnetResourceGroup = (*string)(unsafe.Pointer(in.VnetResourceGroup)) - out.SubnetName = in.SubnetName - return nil -} - -// Convert_v1alpha1_AzureSubnetInfo_To_machine_AzureSubnetInfo is an autogenerated conversion function. -func Convert_v1alpha1_AzureSubnetInfo_To_machine_AzureSubnetInfo(in *AzureSubnetInfo, out *machine.AzureSubnetInfo, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureSubnetInfo_To_machine_AzureSubnetInfo(in, out, s) -} - -func autoConvert_machine_AzureSubnetInfo_To_v1alpha1_AzureSubnetInfo(in *machine.AzureSubnetInfo, out *AzureSubnetInfo, s conversion.Scope) error { - out.VnetName = in.VnetName - out.VnetResourceGroup = (*string)(unsafe.Pointer(in.VnetResourceGroup)) - out.SubnetName = in.SubnetName - return nil -} - -// Convert_machine_AzureSubnetInfo_To_v1alpha1_AzureSubnetInfo is an autogenerated conversion function. -func Convert_machine_AzureSubnetInfo_To_v1alpha1_AzureSubnetInfo(in *machine.AzureSubnetInfo, out *AzureSubnetInfo, s conversion.Scope) error { - return autoConvert_machine_AzureSubnetInfo_To_v1alpha1_AzureSubnetInfo(in, out, s) -} - -func autoConvert_v1alpha1_AzureVirtualMachineProperties_To_machine_AzureVirtualMachineProperties(in *AzureVirtualMachineProperties, out *machine.AzureVirtualMachineProperties, s conversion.Scope) error { - if err := Convert_v1alpha1_AzureHardwareProfile_To_machine_AzureHardwareProfile(&in.HardwareProfile, &out.HardwareProfile, s); err != nil { + if err := s.AddGeneratedConversionFunc((*NodeTemplate)(nil), (*machine.NodeTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_NodeTemplate_To_machine_NodeTemplate(a.(*NodeTemplate), b.(*machine.NodeTemplate), scope) + }); err != nil { return err } - if err := Convert_v1alpha1_AzureStorageProfile_To_machine_AzureStorageProfile(&in.StorageProfile, &out.StorageProfile, s); err != nil { + if err := s.AddGeneratedConversionFunc((*machine.NodeTemplate)(nil), (*NodeTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_machine_NodeTemplate_To_v1alpha1_NodeTemplate(a.(*machine.NodeTemplate), b.(*NodeTemplate), scope) + }); err != nil { return err } - if err := Convert_v1alpha1_AzureOSProfile_To_machine_AzureOSProfile(&in.OsProfile, &out.OsProfile, s); err != nil { + if err := s.AddGeneratedConversionFunc((*NodeTemplateSpec)(nil), (*machine.NodeTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_NodeTemplateSpec_To_machine_NodeTemplateSpec(a.(*NodeTemplateSpec), b.(*machine.NodeTemplateSpec), scope) + }); err != nil { return err } - if err := Convert_v1alpha1_AzureNetworkProfile_To_machine_AzureNetworkProfile(&in.NetworkProfile, &out.NetworkProfile, s); err != nil { + if err := s.AddGeneratedConversionFunc((*machine.NodeTemplateSpec)(nil), (*NodeTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_machine_NodeTemplateSpec_To_v1alpha1_NodeTemplateSpec(a.(*machine.NodeTemplateSpec), b.(*NodeTemplateSpec), scope) + }); err != nil { return err } - out.AvailabilitySet = (*machine.AzureSubResource)(unsafe.Pointer(in.AvailabilitySet)) - out.IdentityID = (*string)(unsafe.Pointer(in.IdentityID)) - out.Zone = (*int)(unsafe.Pointer(in.Zone)) - out.MachineSet = (*machine.AzureMachineSetConfig)(unsafe.Pointer(in.MachineSet)) - return nil -} - -// Convert_v1alpha1_AzureVirtualMachineProperties_To_machine_AzureVirtualMachineProperties is an autogenerated conversion function. -func Convert_v1alpha1_AzureVirtualMachineProperties_To_machine_AzureVirtualMachineProperties(in *AzureVirtualMachineProperties, out *machine.AzureVirtualMachineProperties, s conversion.Scope) error { - return autoConvert_v1alpha1_AzureVirtualMachineProperties_To_machine_AzureVirtualMachineProperties(in, out, s) -} - -func autoConvert_machine_AzureVirtualMachineProperties_To_v1alpha1_AzureVirtualMachineProperties(in *machine.AzureVirtualMachineProperties, out *AzureVirtualMachineProperties, s conversion.Scope) error { - if err := Convert_machine_AzureHardwareProfile_To_v1alpha1_AzureHardwareProfile(&in.HardwareProfile, &out.HardwareProfile, s); err != nil { + if err := s.AddGeneratedConversionFunc((*RollbackConfig)(nil), (*machine.RollbackConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_RollbackConfig_To_machine_RollbackConfig(a.(*RollbackConfig), b.(*machine.RollbackConfig), scope) + }); err != nil { return err } - if err := Convert_machine_AzureStorageProfile_To_v1alpha1_AzureStorageProfile(&in.StorageProfile, &out.StorageProfile, s); err != nil { + if err := s.AddGeneratedConversionFunc((*machine.RollbackConfig)(nil), (*RollbackConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_machine_RollbackConfig_To_v1alpha1_RollbackConfig(a.(*machine.RollbackConfig), b.(*RollbackConfig), scope) + }); err != nil { return err } - if err := Convert_machine_AzureOSProfile_To_v1alpha1_AzureOSProfile(&in.OsProfile, &out.OsProfile, s); err != nil { + if err := s.AddGeneratedConversionFunc((*RollingUpdateMachineDeployment)(nil), (*machine.RollingUpdateMachineDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_RollingUpdateMachineDeployment_To_machine_RollingUpdateMachineDeployment(a.(*RollingUpdateMachineDeployment), b.(*machine.RollingUpdateMachineDeployment), scope) + }); err != nil { return err } - if err := Convert_machine_AzureNetworkProfile_To_v1alpha1_AzureNetworkProfile(&in.NetworkProfile, &out.NetworkProfile, s); err != nil { + if err := s.AddGeneratedConversionFunc((*machine.RollingUpdateMachineDeployment)(nil), (*RollingUpdateMachineDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_machine_RollingUpdateMachineDeployment_To_v1alpha1_RollingUpdateMachineDeployment(a.(*machine.RollingUpdateMachineDeployment), b.(*RollingUpdateMachineDeployment), scope) + }); err != nil { return err } - out.AvailabilitySet = (*AzureSubResource)(unsafe.Pointer(in.AvailabilitySet)) - out.IdentityID = (*string)(unsafe.Pointer(in.IdentityID)) - out.Zone = (*int)(unsafe.Pointer(in.Zone)) - out.MachineSet = (*AzureMachineSetConfig)(unsafe.Pointer(in.MachineSet)) return nil } -// Convert_machine_AzureVirtualMachineProperties_To_v1alpha1_AzureVirtualMachineProperties is an autogenerated conversion function. -func Convert_machine_AzureVirtualMachineProperties_To_v1alpha1_AzureVirtualMachineProperties(in *machine.AzureVirtualMachineProperties, out *AzureVirtualMachineProperties, s conversion.Scope) error { - return autoConvert_machine_AzureVirtualMachineProperties_To_v1alpha1_AzureVirtualMachineProperties(in, out, s) -} - func autoConvert_v1alpha1_ClassSpec_To_machine_ClassSpec(in *ClassSpec, out *machine.ClassSpec, s conversion.Scope) error { out.APIGroup = in.APIGroup out.Kind = in.Kind @@ -1766,232 +360,9 @@ func Convert_machine_CurrentStatus_To_v1alpha1_CurrentStatus(in *machine.Current return autoConvert_machine_CurrentStatus_To_v1alpha1_CurrentStatus(in, out, s) } -func autoConvert_v1alpha1_GCPDisk_To_machine_GCPDisk(in *GCPDisk, out *machine.GCPDisk, s conversion.Scope) error { - out.AutoDelete = (*bool)(unsafe.Pointer(in.AutoDelete)) - out.Boot = in.Boot - out.SizeGb = in.SizeGb - out.Type = in.Type - out.Interface = in.Interface - out.Image = in.Image - out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) - return nil -} - -// Convert_v1alpha1_GCPDisk_To_machine_GCPDisk is an autogenerated conversion function. -func Convert_v1alpha1_GCPDisk_To_machine_GCPDisk(in *GCPDisk, out *machine.GCPDisk, s conversion.Scope) error { - return autoConvert_v1alpha1_GCPDisk_To_machine_GCPDisk(in, out, s) -} - -func autoConvert_machine_GCPDisk_To_v1alpha1_GCPDisk(in *machine.GCPDisk, out *GCPDisk, s conversion.Scope) error { - out.AutoDelete = (*bool)(unsafe.Pointer(in.AutoDelete)) - out.Boot = in.Boot - out.SizeGb = in.SizeGb - out.Type = in.Type - out.Interface = in.Interface - out.Image = in.Image - out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) - return nil -} - -// Convert_machine_GCPDisk_To_v1alpha1_GCPDisk is an autogenerated conversion function. -func Convert_machine_GCPDisk_To_v1alpha1_GCPDisk(in *machine.GCPDisk, out *GCPDisk, s conversion.Scope) error { - return autoConvert_machine_GCPDisk_To_v1alpha1_GCPDisk(in, out, s) -} - -func autoConvert_v1alpha1_GCPMachineClass_To_machine_GCPMachineClass(in *GCPMachineClass, out *machine.GCPMachineClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_GCPMachineClassSpec_To_machine_GCPMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_GCPMachineClass_To_machine_GCPMachineClass is an autogenerated conversion function. -func Convert_v1alpha1_GCPMachineClass_To_machine_GCPMachineClass(in *GCPMachineClass, out *machine.GCPMachineClass, s conversion.Scope) error { - return autoConvert_v1alpha1_GCPMachineClass_To_machine_GCPMachineClass(in, out, s) -} - -func autoConvert_machine_GCPMachineClass_To_v1alpha1_GCPMachineClass(in *machine.GCPMachineClass, out *GCPMachineClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_machine_GCPMachineClassSpec_To_v1alpha1_GCPMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_machine_GCPMachineClass_To_v1alpha1_GCPMachineClass is an autogenerated conversion function. -func Convert_machine_GCPMachineClass_To_v1alpha1_GCPMachineClass(in *machine.GCPMachineClass, out *GCPMachineClass, s conversion.Scope) error { - return autoConvert_machine_GCPMachineClass_To_v1alpha1_GCPMachineClass(in, out, s) -} - -func autoConvert_v1alpha1_GCPMachineClassList_To_machine_GCPMachineClassList(in *GCPMachineClassList, out *machine.GCPMachineClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]machine.GCPMachineClass)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha1_GCPMachineClassList_To_machine_GCPMachineClassList is an autogenerated conversion function. -func Convert_v1alpha1_GCPMachineClassList_To_machine_GCPMachineClassList(in *GCPMachineClassList, out *machine.GCPMachineClassList, s conversion.Scope) error { - return autoConvert_v1alpha1_GCPMachineClassList_To_machine_GCPMachineClassList(in, out, s) -} - -func autoConvert_machine_GCPMachineClassList_To_v1alpha1_GCPMachineClassList(in *machine.GCPMachineClassList, out *GCPMachineClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]GCPMachineClass)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_machine_GCPMachineClassList_To_v1alpha1_GCPMachineClassList is an autogenerated conversion function. -func Convert_machine_GCPMachineClassList_To_v1alpha1_GCPMachineClassList(in *machine.GCPMachineClassList, out *GCPMachineClassList, s conversion.Scope) error { - return autoConvert_machine_GCPMachineClassList_To_v1alpha1_GCPMachineClassList(in, out, s) -} - -func autoConvert_v1alpha1_GCPMachineClassSpec_To_machine_GCPMachineClassSpec(in *GCPMachineClassSpec, out *machine.GCPMachineClassSpec, s conversion.Scope) error { - out.CanIpForward = in.CanIpForward - out.DeletionProtection = in.DeletionProtection - out.Description = (*string)(unsafe.Pointer(in.Description)) - out.Disks = *(*[]*machine.GCPDisk)(unsafe.Pointer(&in.Disks)) - out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) - out.MachineType = in.MachineType - out.Metadata = *(*[]*machine.GCPMetadata)(unsafe.Pointer(&in.Metadata)) - out.NetworkInterfaces = *(*[]*machine.GCPNetworkInterface)(unsafe.Pointer(&in.NetworkInterfaces)) - if err := Convert_v1alpha1_GCPScheduling_To_machine_GCPScheduling(&in.Scheduling, &out.Scheduling, s); err != nil { - return err - } - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.CredentialsSecretRef = (*v1.SecretReference)(unsafe.Pointer(in.CredentialsSecretRef)) - out.ServiceAccounts = *(*[]machine.GCPServiceAccount)(unsafe.Pointer(&in.ServiceAccounts)) - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - out.Region = in.Region - out.Zone = in.Zone - return nil -} - -// Convert_v1alpha1_GCPMachineClassSpec_To_machine_GCPMachineClassSpec is an autogenerated conversion function. -func Convert_v1alpha1_GCPMachineClassSpec_To_machine_GCPMachineClassSpec(in *GCPMachineClassSpec, out *machine.GCPMachineClassSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_GCPMachineClassSpec_To_machine_GCPMachineClassSpec(in, out, s) -} - -func autoConvert_machine_GCPMachineClassSpec_To_v1alpha1_GCPMachineClassSpec(in *machine.GCPMachineClassSpec, out *GCPMachineClassSpec, s conversion.Scope) error { - out.CanIpForward = in.CanIpForward - out.DeletionProtection = in.DeletionProtection - out.Description = (*string)(unsafe.Pointer(in.Description)) - out.Disks = *(*[]*GCPDisk)(unsafe.Pointer(&in.Disks)) - out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) - out.MachineType = in.MachineType - out.Metadata = *(*[]*GCPMetadata)(unsafe.Pointer(&in.Metadata)) - out.NetworkInterfaces = *(*[]*GCPNetworkInterface)(unsafe.Pointer(&in.NetworkInterfaces)) - if err := Convert_machine_GCPScheduling_To_v1alpha1_GCPScheduling(&in.Scheduling, &out.Scheduling, s); err != nil { - return err - } - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.CredentialsSecretRef = (*v1.SecretReference)(unsafe.Pointer(in.CredentialsSecretRef)) - out.ServiceAccounts = *(*[]GCPServiceAccount)(unsafe.Pointer(&in.ServiceAccounts)) - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - out.Region = in.Region - out.Zone = in.Zone - return nil -} - -// Convert_machine_GCPMachineClassSpec_To_v1alpha1_GCPMachineClassSpec is an autogenerated conversion function. -func Convert_machine_GCPMachineClassSpec_To_v1alpha1_GCPMachineClassSpec(in *machine.GCPMachineClassSpec, out *GCPMachineClassSpec, s conversion.Scope) error { - return autoConvert_machine_GCPMachineClassSpec_To_v1alpha1_GCPMachineClassSpec(in, out, s) -} - -func autoConvert_v1alpha1_GCPMetadata_To_machine_GCPMetadata(in *GCPMetadata, out *machine.GCPMetadata, s conversion.Scope) error { - out.Key = in.Key - out.Value = (*string)(unsafe.Pointer(in.Value)) - return nil -} - -// Convert_v1alpha1_GCPMetadata_To_machine_GCPMetadata is an autogenerated conversion function. -func Convert_v1alpha1_GCPMetadata_To_machine_GCPMetadata(in *GCPMetadata, out *machine.GCPMetadata, s conversion.Scope) error { - return autoConvert_v1alpha1_GCPMetadata_To_machine_GCPMetadata(in, out, s) -} - -func autoConvert_machine_GCPMetadata_To_v1alpha1_GCPMetadata(in *machine.GCPMetadata, out *GCPMetadata, s conversion.Scope) error { - out.Key = in.Key - out.Value = (*string)(unsafe.Pointer(in.Value)) - return nil -} - -// Convert_machine_GCPMetadata_To_v1alpha1_GCPMetadata is an autogenerated conversion function. -func Convert_machine_GCPMetadata_To_v1alpha1_GCPMetadata(in *machine.GCPMetadata, out *GCPMetadata, s conversion.Scope) error { - return autoConvert_machine_GCPMetadata_To_v1alpha1_GCPMetadata(in, out, s) -} - -func autoConvert_v1alpha1_GCPNetworkInterface_To_machine_GCPNetworkInterface(in *GCPNetworkInterface, out *machine.GCPNetworkInterface, s conversion.Scope) error { - out.DisableExternalIP = in.DisableExternalIP - out.Network = in.Network - out.Subnetwork = in.Subnetwork - return nil -} - -// Convert_v1alpha1_GCPNetworkInterface_To_machine_GCPNetworkInterface is an autogenerated conversion function. -func Convert_v1alpha1_GCPNetworkInterface_To_machine_GCPNetworkInterface(in *GCPNetworkInterface, out *machine.GCPNetworkInterface, s conversion.Scope) error { - return autoConvert_v1alpha1_GCPNetworkInterface_To_machine_GCPNetworkInterface(in, out, s) -} - -func autoConvert_machine_GCPNetworkInterface_To_v1alpha1_GCPNetworkInterface(in *machine.GCPNetworkInterface, out *GCPNetworkInterface, s conversion.Scope) error { - out.DisableExternalIP = in.DisableExternalIP - out.Network = in.Network - out.Subnetwork = in.Subnetwork - return nil -} - -// Convert_machine_GCPNetworkInterface_To_v1alpha1_GCPNetworkInterface is an autogenerated conversion function. -func Convert_machine_GCPNetworkInterface_To_v1alpha1_GCPNetworkInterface(in *machine.GCPNetworkInterface, out *GCPNetworkInterface, s conversion.Scope) error { - return autoConvert_machine_GCPNetworkInterface_To_v1alpha1_GCPNetworkInterface(in, out, s) -} - -func autoConvert_v1alpha1_GCPScheduling_To_machine_GCPScheduling(in *GCPScheduling, out *machine.GCPScheduling, s conversion.Scope) error { - out.AutomaticRestart = in.AutomaticRestart - out.OnHostMaintenance = in.OnHostMaintenance - out.Preemptible = in.Preemptible - return nil -} - -// Convert_v1alpha1_GCPScheduling_To_machine_GCPScheduling is an autogenerated conversion function. -func Convert_v1alpha1_GCPScheduling_To_machine_GCPScheduling(in *GCPScheduling, out *machine.GCPScheduling, s conversion.Scope) error { - return autoConvert_v1alpha1_GCPScheduling_To_machine_GCPScheduling(in, out, s) -} - -func autoConvert_machine_GCPScheduling_To_v1alpha1_GCPScheduling(in *machine.GCPScheduling, out *GCPScheduling, s conversion.Scope) error { - out.AutomaticRestart = in.AutomaticRestart - out.OnHostMaintenance = in.OnHostMaintenance - out.Preemptible = in.Preemptible - return nil -} - -// Convert_machine_GCPScheduling_To_v1alpha1_GCPScheduling is an autogenerated conversion function. -func Convert_machine_GCPScheduling_To_v1alpha1_GCPScheduling(in *machine.GCPScheduling, out *GCPScheduling, s conversion.Scope) error { - return autoConvert_machine_GCPScheduling_To_v1alpha1_GCPScheduling(in, out, s) -} - -func autoConvert_v1alpha1_GCPServiceAccount_To_machine_GCPServiceAccount(in *GCPServiceAccount, out *machine.GCPServiceAccount, s conversion.Scope) error { - out.Email = in.Email - out.Scopes = *(*[]string)(unsafe.Pointer(&in.Scopes)) - return nil -} - -// Convert_v1alpha1_GCPServiceAccount_To_machine_GCPServiceAccount is an autogenerated conversion function. -func Convert_v1alpha1_GCPServiceAccount_To_machine_GCPServiceAccount(in *GCPServiceAccount, out *machine.GCPServiceAccount, s conversion.Scope) error { - return autoConvert_v1alpha1_GCPServiceAccount_To_machine_GCPServiceAccount(in, out, s) -} - -func autoConvert_machine_GCPServiceAccount_To_v1alpha1_GCPServiceAccount(in *machine.GCPServiceAccount, out *GCPServiceAccount, s conversion.Scope) error { - out.Email = in.Email - out.Scopes = *(*[]string)(unsafe.Pointer(&in.Scopes)) - return nil -} - -// Convert_machine_GCPServiceAccount_To_v1alpha1_GCPServiceAccount is an autogenerated conversion function. -func Convert_machine_GCPServiceAccount_To_v1alpha1_GCPServiceAccount(in *machine.GCPServiceAccount, out *GCPServiceAccount, s conversion.Scope) error { - return autoConvert_machine_GCPServiceAccount_To_v1alpha1_GCPServiceAccount(in, out, s) -} - func autoConvert_v1alpha1_LastOperation_To_machine_LastOperation(in *LastOperation, out *machine.LastOperation, s conversion.Scope) error { out.Description = in.Description + out.ErrorCode = in.ErrorCode out.LastUpdateTime = in.LastUpdateTime out.State = machine.MachineState(in.State) out.Type = machine.MachineOperationType(in.Type) @@ -2005,6 +376,7 @@ func Convert_v1alpha1_LastOperation_To_machine_LastOperation(in *LastOperation, func autoConvert_machine_LastOperation_To_v1alpha1_LastOperation(in *machine.LastOperation, out *LastOperation, s conversion.Scope) error { out.Description = in.Description + out.ErrorCode = in.ErrorCode out.LastUpdateTime = in.LastUpdateTime out.State = MachineState(in.State) out.Type = MachineOperationType(in.Type) @@ -2684,216 +1056,6 @@ func Convert_machine_NodeTemplateSpec_To_v1alpha1_NodeTemplateSpec(in *machine.N return autoConvert_machine_NodeTemplateSpec_To_v1alpha1_NodeTemplateSpec(in, out, s) } -func autoConvert_v1alpha1_OpenStackMachineClass_To_machine_OpenStackMachineClass(in *OpenStackMachineClass, out *machine.OpenStackMachineClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_OpenStackMachineClassSpec_To_machine_OpenStackMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_OpenStackMachineClass_To_machine_OpenStackMachineClass is an autogenerated conversion function. -func Convert_v1alpha1_OpenStackMachineClass_To_machine_OpenStackMachineClass(in *OpenStackMachineClass, out *machine.OpenStackMachineClass, s conversion.Scope) error { - return autoConvert_v1alpha1_OpenStackMachineClass_To_machine_OpenStackMachineClass(in, out, s) -} - -func autoConvert_machine_OpenStackMachineClass_To_v1alpha1_OpenStackMachineClass(in *machine.OpenStackMachineClass, out *OpenStackMachineClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_machine_OpenStackMachineClassSpec_To_v1alpha1_OpenStackMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_machine_OpenStackMachineClass_To_v1alpha1_OpenStackMachineClass is an autogenerated conversion function. -func Convert_machine_OpenStackMachineClass_To_v1alpha1_OpenStackMachineClass(in *machine.OpenStackMachineClass, out *OpenStackMachineClass, s conversion.Scope) error { - return autoConvert_machine_OpenStackMachineClass_To_v1alpha1_OpenStackMachineClass(in, out, s) -} - -func autoConvert_v1alpha1_OpenStackMachineClassList_To_machine_OpenStackMachineClassList(in *OpenStackMachineClassList, out *machine.OpenStackMachineClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]machine.OpenStackMachineClass)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha1_OpenStackMachineClassList_To_machine_OpenStackMachineClassList is an autogenerated conversion function. -func Convert_v1alpha1_OpenStackMachineClassList_To_machine_OpenStackMachineClassList(in *OpenStackMachineClassList, out *machine.OpenStackMachineClassList, s conversion.Scope) error { - return autoConvert_v1alpha1_OpenStackMachineClassList_To_machine_OpenStackMachineClassList(in, out, s) -} - -func autoConvert_machine_OpenStackMachineClassList_To_v1alpha1_OpenStackMachineClassList(in *machine.OpenStackMachineClassList, out *OpenStackMachineClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]OpenStackMachineClass)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_machine_OpenStackMachineClassList_To_v1alpha1_OpenStackMachineClassList is an autogenerated conversion function. -func Convert_machine_OpenStackMachineClassList_To_v1alpha1_OpenStackMachineClassList(in *machine.OpenStackMachineClassList, out *OpenStackMachineClassList, s conversion.Scope) error { - return autoConvert_machine_OpenStackMachineClassList_To_v1alpha1_OpenStackMachineClassList(in, out, s) -} - -func autoConvert_v1alpha1_OpenStackMachineClassSpec_To_machine_OpenStackMachineClassSpec(in *OpenStackMachineClassSpec, out *machine.OpenStackMachineClassSpec, s conversion.Scope) error { - out.ImageID = in.ImageID - out.ImageName = in.ImageName - out.Region = in.Region - out.AvailabilityZone = in.AvailabilityZone - out.FlavorName = in.FlavorName - out.KeyName = in.KeyName - out.SecurityGroups = *(*[]string)(unsafe.Pointer(&in.SecurityGroups)) - out.Tags = *(*map[string]string)(unsafe.Pointer(&in.Tags)) - out.NetworkID = in.NetworkID - out.Networks = *(*[]machine.OpenStackNetwork)(unsafe.Pointer(&in.Networks)) - out.SubnetID = (*string)(unsafe.Pointer(in.SubnetID)) - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.CredentialsSecretRef = (*v1.SecretReference)(unsafe.Pointer(in.CredentialsSecretRef)) - out.PodNetworkCidr = in.PodNetworkCidr - out.RootDiskSize = in.RootDiskSize - out.UseConfigDrive = (*bool)(unsafe.Pointer(in.UseConfigDrive)) - out.ServerGroupID = (*string)(unsafe.Pointer(in.ServerGroupID)) - return nil -} - -// Convert_v1alpha1_OpenStackMachineClassSpec_To_machine_OpenStackMachineClassSpec is an autogenerated conversion function. -func Convert_v1alpha1_OpenStackMachineClassSpec_To_machine_OpenStackMachineClassSpec(in *OpenStackMachineClassSpec, out *machine.OpenStackMachineClassSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_OpenStackMachineClassSpec_To_machine_OpenStackMachineClassSpec(in, out, s) -} - -func autoConvert_machine_OpenStackMachineClassSpec_To_v1alpha1_OpenStackMachineClassSpec(in *machine.OpenStackMachineClassSpec, out *OpenStackMachineClassSpec, s conversion.Scope) error { - out.ImageID = in.ImageID - out.ImageName = in.ImageName - out.Region = in.Region - out.AvailabilityZone = in.AvailabilityZone - out.FlavorName = in.FlavorName - out.KeyName = in.KeyName - out.SecurityGroups = *(*[]string)(unsafe.Pointer(&in.SecurityGroups)) - out.Tags = *(*map[string]string)(unsafe.Pointer(&in.Tags)) - out.NetworkID = in.NetworkID - out.Networks = *(*[]OpenStackNetwork)(unsafe.Pointer(&in.Networks)) - out.SubnetID = (*string)(unsafe.Pointer(in.SubnetID)) - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.CredentialsSecretRef = (*v1.SecretReference)(unsafe.Pointer(in.CredentialsSecretRef)) - out.PodNetworkCidr = in.PodNetworkCidr - out.RootDiskSize = in.RootDiskSize - out.UseConfigDrive = (*bool)(unsafe.Pointer(in.UseConfigDrive)) - out.ServerGroupID = (*string)(unsafe.Pointer(in.ServerGroupID)) - return nil -} - -// Convert_machine_OpenStackMachineClassSpec_To_v1alpha1_OpenStackMachineClassSpec is an autogenerated conversion function. -func Convert_machine_OpenStackMachineClassSpec_To_v1alpha1_OpenStackMachineClassSpec(in *machine.OpenStackMachineClassSpec, out *OpenStackMachineClassSpec, s conversion.Scope) error { - return autoConvert_machine_OpenStackMachineClassSpec_To_v1alpha1_OpenStackMachineClassSpec(in, out, s) -} - -func autoConvert_v1alpha1_OpenStackNetwork_To_machine_OpenStackNetwork(in *OpenStackNetwork, out *machine.OpenStackNetwork, s conversion.Scope) error { - out.Id = in.Id - out.Name = in.Name - out.PodNetwork = in.PodNetwork - return nil -} - -// Convert_v1alpha1_OpenStackNetwork_To_machine_OpenStackNetwork is an autogenerated conversion function. -func Convert_v1alpha1_OpenStackNetwork_To_machine_OpenStackNetwork(in *OpenStackNetwork, out *machine.OpenStackNetwork, s conversion.Scope) error { - return autoConvert_v1alpha1_OpenStackNetwork_To_machine_OpenStackNetwork(in, out, s) -} - -func autoConvert_machine_OpenStackNetwork_To_v1alpha1_OpenStackNetwork(in *machine.OpenStackNetwork, out *OpenStackNetwork, s conversion.Scope) error { - out.Id = in.Id - out.Name = in.Name - out.PodNetwork = in.PodNetwork - return nil -} - -// Convert_machine_OpenStackNetwork_To_v1alpha1_OpenStackNetwork is an autogenerated conversion function. -func Convert_machine_OpenStackNetwork_To_v1alpha1_OpenStackNetwork(in *machine.OpenStackNetwork, out *OpenStackNetwork, s conversion.Scope) error { - return autoConvert_machine_OpenStackNetwork_To_v1alpha1_OpenStackNetwork(in, out, s) -} - -func autoConvert_v1alpha1_PacketMachineClass_To_machine_PacketMachineClass(in *PacketMachineClass, out *machine.PacketMachineClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha1_PacketMachineClassSpec_To_machine_PacketMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha1_PacketMachineClass_To_machine_PacketMachineClass is an autogenerated conversion function. -func Convert_v1alpha1_PacketMachineClass_To_machine_PacketMachineClass(in *PacketMachineClass, out *machine.PacketMachineClass, s conversion.Scope) error { - return autoConvert_v1alpha1_PacketMachineClass_To_machine_PacketMachineClass(in, out, s) -} - -func autoConvert_machine_PacketMachineClass_To_v1alpha1_PacketMachineClass(in *machine.PacketMachineClass, out *PacketMachineClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_machine_PacketMachineClassSpec_To_v1alpha1_PacketMachineClassSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_machine_PacketMachineClass_To_v1alpha1_PacketMachineClass is an autogenerated conversion function. -func Convert_machine_PacketMachineClass_To_v1alpha1_PacketMachineClass(in *machine.PacketMachineClass, out *PacketMachineClass, s conversion.Scope) error { - return autoConvert_machine_PacketMachineClass_To_v1alpha1_PacketMachineClass(in, out, s) -} - -func autoConvert_v1alpha1_PacketMachineClassList_To_machine_PacketMachineClassList(in *PacketMachineClassList, out *machine.PacketMachineClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]machine.PacketMachineClass)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha1_PacketMachineClassList_To_machine_PacketMachineClassList is an autogenerated conversion function. -func Convert_v1alpha1_PacketMachineClassList_To_machine_PacketMachineClassList(in *PacketMachineClassList, out *machine.PacketMachineClassList, s conversion.Scope) error { - return autoConvert_v1alpha1_PacketMachineClassList_To_machine_PacketMachineClassList(in, out, s) -} - -func autoConvert_machine_PacketMachineClassList_To_v1alpha1_PacketMachineClassList(in *machine.PacketMachineClassList, out *PacketMachineClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]PacketMachineClass)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_machine_PacketMachineClassList_To_v1alpha1_PacketMachineClassList is an autogenerated conversion function. -func Convert_machine_PacketMachineClassList_To_v1alpha1_PacketMachineClassList(in *machine.PacketMachineClassList, out *PacketMachineClassList, s conversion.Scope) error { - return autoConvert_machine_PacketMachineClassList_To_v1alpha1_PacketMachineClassList(in, out, s) -} - -func autoConvert_v1alpha1_PacketMachineClassSpec_To_machine_PacketMachineClassSpec(in *PacketMachineClassSpec, out *machine.PacketMachineClassSpec, s conversion.Scope) error { - out.Facility = *(*[]string)(unsafe.Pointer(&in.Facility)) - out.MachineType = in.MachineType - out.BillingCycle = in.BillingCycle - out.OS = in.OS - out.ProjectID = in.ProjectID - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - out.SSHKeys = *(*[]string)(unsafe.Pointer(&in.SSHKeys)) - out.UserData = in.UserData - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.CredentialsSecretRef = (*v1.SecretReference)(unsafe.Pointer(in.CredentialsSecretRef)) - return nil -} - -// Convert_v1alpha1_PacketMachineClassSpec_To_machine_PacketMachineClassSpec is an autogenerated conversion function. -func Convert_v1alpha1_PacketMachineClassSpec_To_machine_PacketMachineClassSpec(in *PacketMachineClassSpec, out *machine.PacketMachineClassSpec, s conversion.Scope) error { - return autoConvert_v1alpha1_PacketMachineClassSpec_To_machine_PacketMachineClassSpec(in, out, s) -} - -func autoConvert_machine_PacketMachineClassSpec_To_v1alpha1_PacketMachineClassSpec(in *machine.PacketMachineClassSpec, out *PacketMachineClassSpec, s conversion.Scope) error { - out.Facility = *(*[]string)(unsafe.Pointer(&in.Facility)) - out.MachineType = in.MachineType - out.OS = in.OS - out.ProjectID = in.ProjectID - out.BillingCycle = in.BillingCycle - out.Tags = *(*[]string)(unsafe.Pointer(&in.Tags)) - out.SSHKeys = *(*[]string)(unsafe.Pointer(&in.SSHKeys)) - out.UserData = in.UserData - out.SecretRef = (*v1.SecretReference)(unsafe.Pointer(in.SecretRef)) - out.CredentialsSecretRef = (*v1.SecretReference)(unsafe.Pointer(in.CredentialsSecretRef)) - return nil -} - -// Convert_machine_PacketMachineClassSpec_To_v1alpha1_PacketMachineClassSpec is an autogenerated conversion function. -func Convert_machine_PacketMachineClassSpec_To_v1alpha1_PacketMachineClassSpec(in *machine.PacketMachineClassSpec, out *PacketMachineClassSpec, s conversion.Scope) error { - return autoConvert_machine_PacketMachineClassSpec_To_v1alpha1_PacketMachineClassSpec(in, out, s) -} - func autoConvert_v1alpha1_RollbackConfig_To_machine_RollbackConfig(in *RollbackConfig, out *machine.RollbackConfig, s conversion.Scope) error { out.Revision = in.Revision return nil diff --git a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/zz_generated.deepcopy.go index b55e3928a0b..35b368e1a46 100644 --- a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1/zz_generated.deepcopy.go @@ -29,1075 +29,34 @@ import ( ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSBlockDeviceMappingSpec) DeepCopyInto(out *AWSBlockDeviceMappingSpec) { - *out = *in - in.Ebs.DeepCopyInto(&out.Ebs) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSBlockDeviceMappingSpec. -func (in *AWSBlockDeviceMappingSpec) DeepCopy() *AWSBlockDeviceMappingSpec { - if in == nil { - return nil - } - out := new(AWSBlockDeviceMappingSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSEbsBlockDeviceSpec) DeepCopyInto(out *AWSEbsBlockDeviceSpec) { - *out = *in - if in.DeleteOnTermination != nil { - in, out := &in.DeleteOnTermination, &out.DeleteOnTermination - *out = new(bool) - **out = **in - } - if in.KmsKeyID != nil { - in, out := &in.KmsKeyID, &out.KmsKeyID - *out = new(string) - **out = **in - } - if in.SnapshotID != nil { - in, out := &in.SnapshotID, &out.SnapshotID - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSEbsBlockDeviceSpec. -func (in *AWSEbsBlockDeviceSpec) DeepCopy() *AWSEbsBlockDeviceSpec { - if in == nil { - return nil - } - out := new(AWSEbsBlockDeviceSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSIAMProfileSpec) DeepCopyInto(out *AWSIAMProfileSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSIAMProfileSpec. -func (in *AWSIAMProfileSpec) DeepCopy() *AWSIAMProfileSpec { - if in == nil { - return nil - } - out := new(AWSIAMProfileSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSMachineClass) DeepCopyInto(out *AWSMachineClass) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.TypeMeta = in.TypeMeta - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineClass. -func (in *AWSMachineClass) DeepCopy() *AWSMachineClass { - if in == nil { - return nil - } - out := new(AWSMachineClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSMachineClass) 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 *AWSMachineClassList) DeepCopyInto(out *AWSMachineClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AWSMachineClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineClassList. -func (in *AWSMachineClassList) DeepCopy() *AWSMachineClassList { - if in == nil { - return nil - } - out := new(AWSMachineClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSMachineClassList) 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 *AWSMachineClassSpec) DeepCopyInto(out *AWSMachineClassSpec) { - *out = *in - if in.BlockDevices != nil { - in, out := &in.BlockDevices, &out.BlockDevices - *out = make([]AWSBlockDeviceMappingSpec, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - out.IAM = in.IAM - if in.NetworkInterfaces != nil { - in, out := &in.NetworkInterfaces, &out.NetworkInterfaces - *out = make([]AWSNetworkInterfaceSpec, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.SpotPrice != nil { - in, out := &in.SpotPrice, &out.SpotPrice - *out = new(string) - **out = **in - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.SecretReference) - **out = **in - } - if in.CredentialsSecretRef != nil { - in, out := &in.CredentialsSecretRef, &out.CredentialsSecretRef - *out = new(v1.SecretReference) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineClassSpec. -func (in *AWSMachineClassSpec) DeepCopy() *AWSMachineClassSpec { - if in == nil { - return nil - } - out := new(AWSMachineClassSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSNetworkInterfaceSpec) DeepCopyInto(out *AWSNetworkInterfaceSpec) { - *out = *in - if in.AssociatePublicIPAddress != nil { - in, out := &in.AssociatePublicIPAddress, &out.AssociatePublicIPAddress - *out = new(bool) - **out = **in - } - if in.DeleteOnTermination != nil { - in, out := &in.DeleteOnTermination, &out.DeleteOnTermination - *out = new(bool) - **out = **in - } - if in.Description != nil { - in, out := &in.Description, &out.Description - *out = new(string) - **out = **in - } - if in.SecurityGroupIDs != nil { - in, out := &in.SecurityGroupIDs, &out.SecurityGroupIDs - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSNetworkInterfaceSpec. -func (in *AWSNetworkInterfaceSpec) DeepCopy() *AWSNetworkInterfaceSpec { - if in == nil { - return nil - } - out := new(AWSNetworkInterfaceSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AlicloudDataDisk) DeepCopyInto(out *AlicloudDataDisk) { - *out = *in - if in.DeleteWithInstance != nil { - in, out := &in.DeleteWithInstance, &out.DeleteWithInstance - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlicloudDataDisk. -func (in *AlicloudDataDisk) DeepCopy() *AlicloudDataDisk { - if in == nil { - return nil - } - out := new(AlicloudDataDisk) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AlicloudMachineClass) DeepCopyInto(out *AlicloudMachineClass) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.TypeMeta = in.TypeMeta - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlicloudMachineClass. -func (in *AlicloudMachineClass) DeepCopy() *AlicloudMachineClass { - if in == nil { - return nil - } - out := new(AlicloudMachineClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AlicloudMachineClass) 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 *AlicloudMachineClassList) DeepCopyInto(out *AlicloudMachineClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AlicloudMachineClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlicloudMachineClassList. -func (in *AlicloudMachineClassList) DeepCopy() *AlicloudMachineClassList { - if in == nil { - return nil - } - out := new(AlicloudMachineClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AlicloudMachineClassList) 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 *AlicloudMachineClassSpec) DeepCopyInto(out *AlicloudMachineClassSpec) { - *out = *in - if in.SystemDisk != nil { - in, out := &in.SystemDisk, &out.SystemDisk - *out = new(AlicloudSystemDisk) - **out = **in - } - if in.DataDisks != nil { - in, out := &in.DataDisks, &out.DataDisks - *out = make([]AlicloudDataDisk, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.InternetMaxBandwidthIn != nil { - in, out := &in.InternetMaxBandwidthIn, &out.InternetMaxBandwidthIn - *out = new(int) - **out = **in - } - if in.InternetMaxBandwidthOut != nil { - in, out := &in.InternetMaxBandwidthOut, &out.InternetMaxBandwidthOut - *out = new(int) - **out = **in - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.SecretReference) - **out = **in - } - if in.CredentialsSecretRef != nil { - in, out := &in.CredentialsSecretRef, &out.CredentialsSecretRef - *out = new(v1.SecretReference) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlicloudMachineClassSpec. -func (in *AlicloudMachineClassSpec) DeepCopy() *AlicloudMachineClassSpec { - if in == nil { - return nil - } - out := new(AlicloudMachineClassSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AlicloudSystemDisk) DeepCopyInto(out *AlicloudSystemDisk) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlicloudSystemDisk. -func (in *AlicloudSystemDisk) DeepCopy() *AlicloudSystemDisk { - if in == nil { - return nil - } - out := new(AlicloudSystemDisk) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureDataDisk) DeepCopyInto(out *AzureDataDisk) { - *out = *in - if in.Lun != nil { - in, out := &in.Lun, &out.Lun - *out = new(int32) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureDataDisk. -func (in *AzureDataDisk) DeepCopy() *AzureDataDisk { - if in == nil { - return nil - } - out := new(AzureDataDisk) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureHardwareProfile) DeepCopyInto(out *AzureHardwareProfile) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureHardwareProfile. -func (in *AzureHardwareProfile) DeepCopy() *AzureHardwareProfile { - if in == nil { - return nil - } - out := new(AzureHardwareProfile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureImageReference) DeepCopyInto(out *AzureImageReference) { - *out = *in - if in.URN != nil { - in, out := &in.URN, &out.URN - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureImageReference. -func (in *AzureImageReference) DeepCopy() *AzureImageReference { - if in == nil { - return nil - } - out := new(AzureImageReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureLinuxConfiguration) DeepCopyInto(out *AzureLinuxConfiguration) { - *out = *in - out.SSH = in.SSH - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureLinuxConfiguration. -func (in *AzureLinuxConfiguration) DeepCopy() *AzureLinuxConfiguration { - if in == nil { - return nil - } - out := new(AzureLinuxConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureMachineClass) DeepCopyInto(out *AzureMachineClass) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.TypeMeta = in.TypeMeta - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineClass. -func (in *AzureMachineClass) DeepCopy() *AzureMachineClass { - if in == nil { - return nil - } - out := new(AzureMachineClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureMachineClass) 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 *AzureMachineClassList) DeepCopyInto(out *AzureMachineClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AzureMachineClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineClassList. -func (in *AzureMachineClassList) DeepCopy() *AzureMachineClassList { - if in == nil { - return nil - } - out := new(AzureMachineClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureMachineClassList) 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 *AzureMachineClassSpec) DeepCopyInto(out *AzureMachineClassSpec) { - *out = *in - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - in.Properties.DeepCopyInto(&out.Properties) - in.SubnetInfo.DeepCopyInto(&out.SubnetInfo) - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.SecretReference) - **out = **in - } - if in.CredentialsSecretRef != nil { - in, out := &in.CredentialsSecretRef, &out.CredentialsSecretRef - *out = new(v1.SecretReference) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineClassSpec. -func (in *AzureMachineClassSpec) DeepCopy() *AzureMachineClassSpec { - if in == nil { - return nil - } - out := new(AzureMachineClassSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureMachineSetConfig) DeepCopyInto(out *AzureMachineSetConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineSetConfig. -func (in *AzureMachineSetConfig) DeepCopy() *AzureMachineSetConfig { - if in == nil { - return nil - } - out := new(AzureMachineSetConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedDiskParameters) DeepCopyInto(out *AzureManagedDiskParameters) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedDiskParameters. -func (in *AzureManagedDiskParameters) DeepCopy() *AzureManagedDiskParameters { - if in == nil { - return nil - } - out := new(AzureManagedDiskParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureNetworkInterfaceReference) DeepCopyInto(out *AzureNetworkInterfaceReference) { - *out = *in - if in.AzureNetworkInterfaceReferenceProperties != nil { - in, out := &in.AzureNetworkInterfaceReferenceProperties, &out.AzureNetworkInterfaceReferenceProperties - *out = new(AzureNetworkInterfaceReferenceProperties) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureNetworkInterfaceReference. -func (in *AzureNetworkInterfaceReference) DeepCopy() *AzureNetworkInterfaceReference { - if in == nil { - return nil - } - out := new(AzureNetworkInterfaceReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureNetworkInterfaceReferenceProperties) DeepCopyInto(out *AzureNetworkInterfaceReferenceProperties) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureNetworkInterfaceReferenceProperties. -func (in *AzureNetworkInterfaceReferenceProperties) DeepCopy() *AzureNetworkInterfaceReferenceProperties { - if in == nil { - return nil - } - out := new(AzureNetworkInterfaceReferenceProperties) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureNetworkProfile) DeepCopyInto(out *AzureNetworkProfile) { - *out = *in - in.NetworkInterfaces.DeepCopyInto(&out.NetworkInterfaces) - if in.AcceleratedNetworking != nil { - in, out := &in.AcceleratedNetworking, &out.AcceleratedNetworking - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureNetworkProfile. -func (in *AzureNetworkProfile) DeepCopy() *AzureNetworkProfile { - if in == nil { - return nil - } - out := new(AzureNetworkProfile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureOSDisk) DeepCopyInto(out *AzureOSDisk) { - *out = *in - out.ManagedDisk = in.ManagedDisk - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureOSDisk. -func (in *AzureOSDisk) DeepCopy() *AzureOSDisk { - if in == nil { - return nil - } - out := new(AzureOSDisk) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureOSProfile) DeepCopyInto(out *AzureOSProfile) { - *out = *in - out.LinuxConfiguration = in.LinuxConfiguration - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureOSProfile. -func (in *AzureOSProfile) DeepCopy() *AzureOSProfile { - if in == nil { - return nil - } - out := new(AzureOSProfile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureSSHConfiguration) DeepCopyInto(out *AzureSSHConfiguration) { - *out = *in - out.PublicKeys = in.PublicKeys - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureSSHConfiguration. -func (in *AzureSSHConfiguration) DeepCopy() *AzureSSHConfiguration { - if in == nil { - return nil - } - out := new(AzureSSHConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureSSHPublicKey) DeepCopyInto(out *AzureSSHPublicKey) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureSSHPublicKey. -func (in *AzureSSHPublicKey) DeepCopy() *AzureSSHPublicKey { - if in == nil { - return nil - } - out := new(AzureSSHPublicKey) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureStorageProfile) DeepCopyInto(out *AzureStorageProfile) { - *out = *in - in.ImageReference.DeepCopyInto(&out.ImageReference) - out.OsDisk = in.OsDisk - if in.DataDisks != nil { - in, out := &in.DataDisks, &out.DataDisks - *out = make([]AzureDataDisk, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureStorageProfile. -func (in *AzureStorageProfile) DeepCopy() *AzureStorageProfile { - if in == nil { - return nil - } - out := new(AzureStorageProfile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureSubResource) DeepCopyInto(out *AzureSubResource) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureSubResource. -func (in *AzureSubResource) DeepCopy() *AzureSubResource { - if in == nil { - return nil - } - out := new(AzureSubResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureSubnetInfo) DeepCopyInto(out *AzureSubnetInfo) { - *out = *in - if in.VnetResourceGroup != nil { - in, out := &in.VnetResourceGroup, &out.VnetResourceGroup - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureSubnetInfo. -func (in *AzureSubnetInfo) DeepCopy() *AzureSubnetInfo { - if in == nil { - return nil - } - out := new(AzureSubnetInfo) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureVirtualMachineProperties) DeepCopyInto(out *AzureVirtualMachineProperties) { - *out = *in - out.HardwareProfile = in.HardwareProfile - in.StorageProfile.DeepCopyInto(&out.StorageProfile) - out.OsProfile = in.OsProfile - in.NetworkProfile.DeepCopyInto(&out.NetworkProfile) - if in.AvailabilitySet != nil { - in, out := &in.AvailabilitySet, &out.AvailabilitySet - *out = new(AzureSubResource) - **out = **in - } - if in.IdentityID != nil { - in, out := &in.IdentityID, &out.IdentityID - *out = new(string) - **out = **in - } - if in.Zone != nil { - in, out := &in.Zone, &out.Zone - *out = new(int) - **out = **in - } - if in.MachineSet != nil { - in, out := &in.MachineSet, &out.MachineSet - *out = new(AzureMachineSetConfig) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureVirtualMachineProperties. -func (in *AzureVirtualMachineProperties) DeepCopy() *AzureVirtualMachineProperties { - if in == nil { - return nil - } - out := new(AzureVirtualMachineProperties) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClassSpec) DeepCopyInto(out *ClassSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClassSpec. -func (in *ClassSpec) DeepCopy() *ClassSpec { - if in == nil { - return nil - } - out := new(ClassSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CurrentStatus) DeepCopyInto(out *CurrentStatus) { - *out = *in - in.LastUpdateTime.DeepCopyInto(&out.LastUpdateTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CurrentStatus. -func (in *CurrentStatus) DeepCopy() *CurrentStatus { - if in == nil { - return nil - } - out := new(CurrentStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GCPDisk) DeepCopyInto(out *GCPDisk) { - *out = *in - if in.AutoDelete != nil { - in, out := &in.AutoDelete, &out.AutoDelete - *out = new(bool) - **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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPDisk. -func (in *GCPDisk) DeepCopy() *GCPDisk { - if in == nil { - return nil - } - out := new(GCPDisk) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GCPMachineClass) DeepCopyInto(out *GCPMachineClass) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.TypeMeta = in.TypeMeta - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachineClass. -func (in *GCPMachineClass) DeepCopy() *GCPMachineClass { - if in == nil { - return nil - } - out := new(GCPMachineClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GCPMachineClass) 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 *GCPMachineClassList) DeepCopyInto(out *GCPMachineClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]GCPMachineClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachineClassList. -func (in *GCPMachineClassList) DeepCopy() *GCPMachineClassList { - if in == nil { - return nil - } - out := new(GCPMachineClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GCPMachineClassList) 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 *GCPMachineClassSpec) DeepCopyInto(out *GCPMachineClassSpec) { - *out = *in - if in.Description != nil { - in, out := &in.Description, &out.Description - *out = new(string) - **out = **in - } - if in.Disks != nil { - in, out := &in.Disks, &out.Disks - *out = make([]*GCPDisk, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(GCPDisk) - (*in).DeepCopyInto(*out) - } - } - } - 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.Metadata != nil { - in, out := &in.Metadata, &out.Metadata - *out = make([]*GCPMetadata, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(GCPMetadata) - (*in).DeepCopyInto(*out) - } - } - } - if in.NetworkInterfaces != nil { - in, out := &in.NetworkInterfaces, &out.NetworkInterfaces - *out = make([]*GCPNetworkInterface, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(GCPNetworkInterface) - **out = **in - } - } - } - out.Scheduling = in.Scheduling - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.SecretReference) - **out = **in - } - if in.CredentialsSecretRef != nil { - in, out := &in.CredentialsSecretRef, &out.CredentialsSecretRef - *out = new(v1.SecretReference) - **out = **in - } - if in.ServiceAccounts != nil { - in, out := &in.ServiceAccounts, &out.ServiceAccounts - *out = make([]GCPServiceAccount, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachineClassSpec. -func (in *GCPMachineClassSpec) DeepCopy() *GCPMachineClassSpec { - if in == nil { - return nil - } - out := new(GCPMachineClassSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GCPMetadata) DeepCopyInto(out *GCPMetadata) { - *out = *in - if in.Value != nil { - in, out := &in.Value, &out.Value - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMetadata. -func (in *GCPMetadata) DeepCopy() *GCPMetadata { - if in == nil { - return nil - } - out := new(GCPMetadata) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GCPNetworkInterface) DeepCopyInto(out *GCPNetworkInterface) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPNetworkInterface. -func (in *GCPNetworkInterface) DeepCopy() *GCPNetworkInterface { - if in == nil { - return nil - } - out := new(GCPNetworkInterface) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GCPScheduling) DeepCopyInto(out *GCPScheduling) { +func (in *ClassSpec) DeepCopyInto(out *ClassSpec) { *out = *in return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPScheduling. -func (in *GCPScheduling) DeepCopy() *GCPScheduling { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClassSpec. +func (in *ClassSpec) DeepCopy() *ClassSpec { if in == nil { return nil } - out := new(GCPScheduling) + out := new(ClassSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GCPServiceAccount) DeepCopyInto(out *GCPServiceAccount) { +func (in *CurrentStatus) DeepCopyInto(out *CurrentStatus) { *out = *in - if in.Scopes != nil { - in, out := &in.Scopes, &out.Scopes - *out = make([]string, len(*in)) - copy(*out, *in) - } + in.LastUpdateTime.DeepCopyInto(&out.LastUpdateTime) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPServiceAccount. -func (in *GCPServiceAccount) DeepCopy() *GCPServiceAccount { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CurrentStatus. +func (in *CurrentStatus) DeepCopy() *CurrentStatus { if in == nil { return nil } - out := new(GCPServiceAccount) + out := new(CurrentStatus) in.DeepCopyInto(out) return out } @@ -1733,241 +692,6 @@ func (in *NodeTemplateSpec) DeepCopy() *NodeTemplateSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackMachineClass) DeepCopyInto(out *OpenStackMachineClass) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.TypeMeta = in.TypeMeta - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineClass. -func (in *OpenStackMachineClass) DeepCopy() *OpenStackMachineClass { - if in == nil { - return nil - } - out := new(OpenStackMachineClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenStackMachineClass) 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 *OpenStackMachineClassList) DeepCopyInto(out *OpenStackMachineClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]OpenStackMachineClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineClassList. -func (in *OpenStackMachineClassList) DeepCopy() *OpenStackMachineClassList { - if in == nil { - return nil - } - out := new(OpenStackMachineClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenStackMachineClassList) 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 *OpenStackMachineClassSpec) DeepCopyInto(out *OpenStackMachineClassSpec) { - *out = *in - if in.SecurityGroups != nil { - in, out := &in.SecurityGroups, &out.SecurityGroups - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Networks != nil { - in, out := &in.Networks, &out.Networks - *out = make([]OpenStackNetwork, len(*in)) - copy(*out, *in) - } - if in.SubnetID != nil { - in, out := &in.SubnetID, &out.SubnetID - *out = new(string) - **out = **in - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.SecretReference) - **out = **in - } - if in.CredentialsSecretRef != nil { - in, out := &in.CredentialsSecretRef, &out.CredentialsSecretRef - *out = new(v1.SecretReference) - **out = **in - } - if in.UseConfigDrive != nil { - in, out := &in.UseConfigDrive, &out.UseConfigDrive - *out = new(bool) - **out = **in - } - if in.ServerGroupID != nil { - in, out := &in.ServerGroupID, &out.ServerGroupID - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineClassSpec. -func (in *OpenStackMachineClassSpec) DeepCopy() *OpenStackMachineClassSpec { - if in == nil { - return nil - } - out := new(OpenStackMachineClassSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackNetwork) DeepCopyInto(out *OpenStackNetwork) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackNetwork. -func (in *OpenStackNetwork) DeepCopy() *OpenStackNetwork { - if in == nil { - return nil - } - out := new(OpenStackNetwork) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PacketMachineClass) DeepCopyInto(out *PacketMachineClass) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.TypeMeta = in.TypeMeta - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PacketMachineClass. -func (in *PacketMachineClass) DeepCopy() *PacketMachineClass { - if in == nil { - return nil - } - out := new(PacketMachineClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PacketMachineClass) 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 *PacketMachineClassList) DeepCopyInto(out *PacketMachineClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PacketMachineClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PacketMachineClassList. -func (in *PacketMachineClassList) DeepCopy() *PacketMachineClassList { - if in == nil { - return nil - } - out := new(PacketMachineClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PacketMachineClassList) 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 *PacketMachineClassSpec) DeepCopyInto(out *PacketMachineClassSpec) { - *out = *in - if in.Facility != nil { - in, out := &in.Facility, &out.Facility - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.SSHKeys != nil { - in, out := &in.SSHKeys, &out.SSHKeys - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.SecretReference) - **out = **in - } - if in.CredentialsSecretRef != nil { - in, out := &in.CredentialsSecretRef, &out.CredentialsSecretRef - *out = new(v1.SecretReference) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PacketMachineClassSpec. -func (in *PacketMachineClassSpec) DeepCopy() *PacketMachineClassSpec { - if in == nil { - return nil - } - out := new(PacketMachineClassSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RollbackConfig) DeepCopyInto(out *RollbackConfig) { *out = *in diff --git a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/zz_generated.deepcopy.go b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/zz_generated.deepcopy.go index 72a43a82201..e9bb9464371 100644 --- a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/zz_generated.deepcopy.go +++ b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/zz_generated.deepcopy.go @@ -29,1075 +29,34 @@ import ( ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSBlockDeviceMappingSpec) DeepCopyInto(out *AWSBlockDeviceMappingSpec) { - *out = *in - in.Ebs.DeepCopyInto(&out.Ebs) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSBlockDeviceMappingSpec. -func (in *AWSBlockDeviceMappingSpec) DeepCopy() *AWSBlockDeviceMappingSpec { - if in == nil { - return nil - } - out := new(AWSBlockDeviceMappingSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSEbsBlockDeviceSpec) DeepCopyInto(out *AWSEbsBlockDeviceSpec) { - *out = *in - if in.DeleteOnTermination != nil { - in, out := &in.DeleteOnTermination, &out.DeleteOnTermination - *out = new(bool) - **out = **in - } - if in.KmsKeyID != nil { - in, out := &in.KmsKeyID, &out.KmsKeyID - *out = new(string) - **out = **in - } - if in.SnapshotID != nil { - in, out := &in.SnapshotID, &out.SnapshotID - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSEbsBlockDeviceSpec. -func (in *AWSEbsBlockDeviceSpec) DeepCopy() *AWSEbsBlockDeviceSpec { - if in == nil { - return nil - } - out := new(AWSEbsBlockDeviceSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSIAMProfileSpec) DeepCopyInto(out *AWSIAMProfileSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSIAMProfileSpec. -func (in *AWSIAMProfileSpec) DeepCopy() *AWSIAMProfileSpec { - if in == nil { - return nil - } - out := new(AWSIAMProfileSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSMachineClass) DeepCopyInto(out *AWSMachineClass) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.TypeMeta = in.TypeMeta - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineClass. -func (in *AWSMachineClass) DeepCopy() *AWSMachineClass { - if in == nil { - return nil - } - out := new(AWSMachineClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSMachineClass) 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 *AWSMachineClassList) DeepCopyInto(out *AWSMachineClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AWSMachineClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineClassList. -func (in *AWSMachineClassList) DeepCopy() *AWSMachineClassList { - if in == nil { - return nil - } - out := new(AWSMachineClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AWSMachineClassList) 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 *AWSMachineClassSpec) DeepCopyInto(out *AWSMachineClassSpec) { - *out = *in - if in.BlockDevices != nil { - in, out := &in.BlockDevices, &out.BlockDevices - *out = make([]AWSBlockDeviceMappingSpec, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - out.IAM = in.IAM - if in.NetworkInterfaces != nil { - in, out := &in.NetworkInterfaces, &out.NetworkInterfaces - *out = make([]AWSNetworkInterfaceSpec, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.SpotPrice != nil { - in, out := &in.SpotPrice, &out.SpotPrice - *out = new(string) - **out = **in - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.SecretReference) - **out = **in - } - if in.CredentialsSecretRef != nil { - in, out := &in.CredentialsSecretRef, &out.CredentialsSecretRef - *out = new(v1.SecretReference) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineClassSpec. -func (in *AWSMachineClassSpec) DeepCopy() *AWSMachineClassSpec { - if in == nil { - return nil - } - out := new(AWSMachineClassSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AWSNetworkInterfaceSpec) DeepCopyInto(out *AWSNetworkInterfaceSpec) { - *out = *in - if in.AssociatePublicIPAddress != nil { - in, out := &in.AssociatePublicIPAddress, &out.AssociatePublicIPAddress - *out = new(bool) - **out = **in - } - if in.DeleteOnTermination != nil { - in, out := &in.DeleteOnTermination, &out.DeleteOnTermination - *out = new(bool) - **out = **in - } - if in.Description != nil { - in, out := &in.Description, &out.Description - *out = new(string) - **out = **in - } - if in.SecurityGroupIDs != nil { - in, out := &in.SecurityGroupIDs, &out.SecurityGroupIDs - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSNetworkInterfaceSpec. -func (in *AWSNetworkInterfaceSpec) DeepCopy() *AWSNetworkInterfaceSpec { - if in == nil { - return nil - } - out := new(AWSNetworkInterfaceSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AlicloudDataDisk) DeepCopyInto(out *AlicloudDataDisk) { - *out = *in - if in.DeleteWithInstance != nil { - in, out := &in.DeleteWithInstance, &out.DeleteWithInstance - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlicloudDataDisk. -func (in *AlicloudDataDisk) DeepCopy() *AlicloudDataDisk { - if in == nil { - return nil - } - out := new(AlicloudDataDisk) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AlicloudMachineClass) DeepCopyInto(out *AlicloudMachineClass) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.TypeMeta = in.TypeMeta - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlicloudMachineClass. -func (in *AlicloudMachineClass) DeepCopy() *AlicloudMachineClass { - if in == nil { - return nil - } - out := new(AlicloudMachineClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AlicloudMachineClass) 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 *AlicloudMachineClassList) DeepCopyInto(out *AlicloudMachineClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AlicloudMachineClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlicloudMachineClassList. -func (in *AlicloudMachineClassList) DeepCopy() *AlicloudMachineClassList { - if in == nil { - return nil - } - out := new(AlicloudMachineClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AlicloudMachineClassList) 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 *AlicloudMachineClassSpec) DeepCopyInto(out *AlicloudMachineClassSpec) { - *out = *in - if in.SystemDisk != nil { - in, out := &in.SystemDisk, &out.SystemDisk - *out = new(AlicloudSystemDisk) - **out = **in - } - if in.DataDisks != nil { - in, out := &in.DataDisks, &out.DataDisks - *out = make([]AlicloudDataDisk, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.InternetMaxBandwidthIn != nil { - in, out := &in.InternetMaxBandwidthIn, &out.InternetMaxBandwidthIn - *out = new(int) - **out = **in - } - if in.InternetMaxBandwidthOut != nil { - in, out := &in.InternetMaxBandwidthOut, &out.InternetMaxBandwidthOut - *out = new(int) - **out = **in - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.SecretReference) - **out = **in - } - if in.CredentialsSecretRef != nil { - in, out := &in.CredentialsSecretRef, &out.CredentialsSecretRef - *out = new(v1.SecretReference) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlicloudMachineClassSpec. -func (in *AlicloudMachineClassSpec) DeepCopy() *AlicloudMachineClassSpec { - if in == nil { - return nil - } - out := new(AlicloudMachineClassSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AlicloudSystemDisk) DeepCopyInto(out *AlicloudSystemDisk) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlicloudSystemDisk. -func (in *AlicloudSystemDisk) DeepCopy() *AlicloudSystemDisk { - if in == nil { - return nil - } - out := new(AlicloudSystemDisk) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureDataDisk) DeepCopyInto(out *AzureDataDisk) { - *out = *in - if in.Lun != nil { - in, out := &in.Lun, &out.Lun - *out = new(int32) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureDataDisk. -func (in *AzureDataDisk) DeepCopy() *AzureDataDisk { - if in == nil { - return nil - } - out := new(AzureDataDisk) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureHardwareProfile) DeepCopyInto(out *AzureHardwareProfile) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureHardwareProfile. -func (in *AzureHardwareProfile) DeepCopy() *AzureHardwareProfile { - if in == nil { - return nil - } - out := new(AzureHardwareProfile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureImageReference) DeepCopyInto(out *AzureImageReference) { - *out = *in - if in.URN != nil { - in, out := &in.URN, &out.URN - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureImageReference. -func (in *AzureImageReference) DeepCopy() *AzureImageReference { - if in == nil { - return nil - } - out := new(AzureImageReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureLinuxConfiguration) DeepCopyInto(out *AzureLinuxConfiguration) { - *out = *in - out.SSH = in.SSH - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureLinuxConfiguration. -func (in *AzureLinuxConfiguration) DeepCopy() *AzureLinuxConfiguration { - if in == nil { - return nil - } - out := new(AzureLinuxConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureMachineClass) DeepCopyInto(out *AzureMachineClass) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.TypeMeta = in.TypeMeta - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineClass. -func (in *AzureMachineClass) DeepCopy() *AzureMachineClass { - if in == nil { - return nil - } - out := new(AzureMachineClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureMachineClass) 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 *AzureMachineClassList) DeepCopyInto(out *AzureMachineClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]AzureMachineClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineClassList. -func (in *AzureMachineClassList) DeepCopy() *AzureMachineClassList { - if in == nil { - return nil - } - out := new(AzureMachineClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *AzureMachineClassList) 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 *AzureMachineClassSpec) DeepCopyInto(out *AzureMachineClassSpec) { - *out = *in - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - in.Properties.DeepCopyInto(&out.Properties) - in.SubnetInfo.DeepCopyInto(&out.SubnetInfo) - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.SecretReference) - **out = **in - } - if in.CredentialsSecretRef != nil { - in, out := &in.CredentialsSecretRef, &out.CredentialsSecretRef - *out = new(v1.SecretReference) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineClassSpec. -func (in *AzureMachineClassSpec) DeepCopy() *AzureMachineClassSpec { - if in == nil { - return nil - } - out := new(AzureMachineClassSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureMachineSetConfig) DeepCopyInto(out *AzureMachineSetConfig) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureMachineSetConfig. -func (in *AzureMachineSetConfig) DeepCopy() *AzureMachineSetConfig { - if in == nil { - return nil - } - out := new(AzureMachineSetConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureManagedDiskParameters) DeepCopyInto(out *AzureManagedDiskParameters) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureManagedDiskParameters. -func (in *AzureManagedDiskParameters) DeepCopy() *AzureManagedDiskParameters { - if in == nil { - return nil - } - out := new(AzureManagedDiskParameters) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureNetworkInterfaceReference) DeepCopyInto(out *AzureNetworkInterfaceReference) { - *out = *in - if in.AzureNetworkInterfaceReferenceProperties != nil { - in, out := &in.AzureNetworkInterfaceReferenceProperties, &out.AzureNetworkInterfaceReferenceProperties - *out = new(AzureNetworkInterfaceReferenceProperties) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureNetworkInterfaceReference. -func (in *AzureNetworkInterfaceReference) DeepCopy() *AzureNetworkInterfaceReference { - if in == nil { - return nil - } - out := new(AzureNetworkInterfaceReference) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureNetworkInterfaceReferenceProperties) DeepCopyInto(out *AzureNetworkInterfaceReferenceProperties) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureNetworkInterfaceReferenceProperties. -func (in *AzureNetworkInterfaceReferenceProperties) DeepCopy() *AzureNetworkInterfaceReferenceProperties { - if in == nil { - return nil - } - out := new(AzureNetworkInterfaceReferenceProperties) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureNetworkProfile) DeepCopyInto(out *AzureNetworkProfile) { - *out = *in - in.NetworkInterfaces.DeepCopyInto(&out.NetworkInterfaces) - if in.AcceleratedNetworking != nil { - in, out := &in.AcceleratedNetworking, &out.AcceleratedNetworking - *out = new(bool) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureNetworkProfile. -func (in *AzureNetworkProfile) DeepCopy() *AzureNetworkProfile { - if in == nil { - return nil - } - out := new(AzureNetworkProfile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureOSDisk) DeepCopyInto(out *AzureOSDisk) { - *out = *in - out.ManagedDisk = in.ManagedDisk - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureOSDisk. -func (in *AzureOSDisk) DeepCopy() *AzureOSDisk { - if in == nil { - return nil - } - out := new(AzureOSDisk) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureOSProfile) DeepCopyInto(out *AzureOSProfile) { - *out = *in - out.LinuxConfiguration = in.LinuxConfiguration - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureOSProfile. -func (in *AzureOSProfile) DeepCopy() *AzureOSProfile { - if in == nil { - return nil - } - out := new(AzureOSProfile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureSSHConfiguration) DeepCopyInto(out *AzureSSHConfiguration) { - *out = *in - out.PublicKeys = in.PublicKeys - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureSSHConfiguration. -func (in *AzureSSHConfiguration) DeepCopy() *AzureSSHConfiguration { - if in == nil { - return nil - } - out := new(AzureSSHConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureSSHPublicKey) DeepCopyInto(out *AzureSSHPublicKey) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureSSHPublicKey. -func (in *AzureSSHPublicKey) DeepCopy() *AzureSSHPublicKey { - if in == nil { - return nil - } - out := new(AzureSSHPublicKey) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureStorageProfile) DeepCopyInto(out *AzureStorageProfile) { - *out = *in - in.ImageReference.DeepCopyInto(&out.ImageReference) - out.OsDisk = in.OsDisk - if in.DataDisks != nil { - in, out := &in.DataDisks, &out.DataDisks - *out = make([]AzureDataDisk, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureStorageProfile. -func (in *AzureStorageProfile) DeepCopy() *AzureStorageProfile { - if in == nil { - return nil - } - out := new(AzureStorageProfile) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureSubResource) DeepCopyInto(out *AzureSubResource) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureSubResource. -func (in *AzureSubResource) DeepCopy() *AzureSubResource { - if in == nil { - return nil - } - out := new(AzureSubResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureSubnetInfo) DeepCopyInto(out *AzureSubnetInfo) { - *out = *in - if in.VnetResourceGroup != nil { - in, out := &in.VnetResourceGroup, &out.VnetResourceGroup - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureSubnetInfo. -func (in *AzureSubnetInfo) DeepCopy() *AzureSubnetInfo { - if in == nil { - return nil - } - out := new(AzureSubnetInfo) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *AzureVirtualMachineProperties) DeepCopyInto(out *AzureVirtualMachineProperties) { - *out = *in - out.HardwareProfile = in.HardwareProfile - in.StorageProfile.DeepCopyInto(&out.StorageProfile) - out.OsProfile = in.OsProfile - in.NetworkProfile.DeepCopyInto(&out.NetworkProfile) - if in.AvailabilitySet != nil { - in, out := &in.AvailabilitySet, &out.AvailabilitySet - *out = new(AzureSubResource) - **out = **in - } - if in.IdentityID != nil { - in, out := &in.IdentityID, &out.IdentityID - *out = new(string) - **out = **in - } - if in.Zone != nil { - in, out := &in.Zone, &out.Zone - *out = new(int) - **out = **in - } - if in.MachineSet != nil { - in, out := &in.MachineSet, &out.MachineSet - *out = new(AzureMachineSetConfig) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AzureVirtualMachineProperties. -func (in *AzureVirtualMachineProperties) DeepCopy() *AzureVirtualMachineProperties { - if in == nil { - return nil - } - out := new(AzureVirtualMachineProperties) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClassSpec) DeepCopyInto(out *ClassSpec) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClassSpec. -func (in *ClassSpec) DeepCopy() *ClassSpec { - if in == nil { - return nil - } - out := new(ClassSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CurrentStatus) DeepCopyInto(out *CurrentStatus) { - *out = *in - in.LastUpdateTime.DeepCopyInto(&out.LastUpdateTime) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CurrentStatus. -func (in *CurrentStatus) DeepCopy() *CurrentStatus { - if in == nil { - return nil - } - out := new(CurrentStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GCPDisk) DeepCopyInto(out *GCPDisk) { - *out = *in - if in.AutoDelete != nil { - in, out := &in.AutoDelete, &out.AutoDelete - *out = new(bool) - **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 - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPDisk. -func (in *GCPDisk) DeepCopy() *GCPDisk { - if in == nil { - return nil - } - out := new(GCPDisk) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GCPMachineClass) DeepCopyInto(out *GCPMachineClass) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.TypeMeta = in.TypeMeta - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachineClass. -func (in *GCPMachineClass) DeepCopy() *GCPMachineClass { - if in == nil { - return nil - } - out := new(GCPMachineClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GCPMachineClass) 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 *GCPMachineClassList) DeepCopyInto(out *GCPMachineClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]GCPMachineClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachineClassList. -func (in *GCPMachineClassList) DeepCopy() *GCPMachineClassList { - if in == nil { - return nil - } - out := new(GCPMachineClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *GCPMachineClassList) 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 *GCPMachineClassSpec) DeepCopyInto(out *GCPMachineClassSpec) { - *out = *in - if in.Description != nil { - in, out := &in.Description, &out.Description - *out = new(string) - **out = **in - } - if in.Disks != nil { - in, out := &in.Disks, &out.Disks - *out = make([]*GCPDisk, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(GCPDisk) - (*in).DeepCopyInto(*out) - } - } - } - 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.Metadata != nil { - in, out := &in.Metadata, &out.Metadata - *out = make([]*GCPMetadata, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(GCPMetadata) - (*in).DeepCopyInto(*out) - } - } - } - if in.NetworkInterfaces != nil { - in, out := &in.NetworkInterfaces, &out.NetworkInterfaces - *out = make([]*GCPNetworkInterface, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(GCPNetworkInterface) - **out = **in - } - } - } - out.Scheduling = in.Scheduling - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.SecretReference) - **out = **in - } - if in.CredentialsSecretRef != nil { - in, out := &in.CredentialsSecretRef, &out.CredentialsSecretRef - *out = new(v1.SecretReference) - **out = **in - } - if in.ServiceAccounts != nil { - in, out := &in.ServiceAccounts, &out.ServiceAccounts - *out = make([]GCPServiceAccount, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMachineClassSpec. -func (in *GCPMachineClassSpec) DeepCopy() *GCPMachineClassSpec { - if in == nil { - return nil - } - out := new(GCPMachineClassSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GCPMetadata) DeepCopyInto(out *GCPMetadata) { - *out = *in - if in.Value != nil { - in, out := &in.Value, &out.Value - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPMetadata. -func (in *GCPMetadata) DeepCopy() *GCPMetadata { - if in == nil { - return nil - } - out := new(GCPMetadata) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GCPNetworkInterface) DeepCopyInto(out *GCPNetworkInterface) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPNetworkInterface. -func (in *GCPNetworkInterface) DeepCopy() *GCPNetworkInterface { - if in == nil { - return nil - } - out := new(GCPNetworkInterface) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GCPScheduling) DeepCopyInto(out *GCPScheduling) { +func (in *ClassSpec) DeepCopyInto(out *ClassSpec) { *out = *in return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPScheduling. -func (in *GCPScheduling) DeepCopy() *GCPScheduling { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClassSpec. +func (in *ClassSpec) DeepCopy() *ClassSpec { if in == nil { return nil } - out := new(GCPScheduling) + out := new(ClassSpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *GCPServiceAccount) DeepCopyInto(out *GCPServiceAccount) { +func (in *CurrentStatus) DeepCopyInto(out *CurrentStatus) { *out = *in - if in.Scopes != nil { - in, out := &in.Scopes, &out.Scopes - *out = make([]string, len(*in)) - copy(*out, *in) - } + in.LastUpdateTime.DeepCopyInto(&out.LastUpdateTime) return } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GCPServiceAccount. -func (in *GCPServiceAccount) DeepCopy() *GCPServiceAccount { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CurrentStatus. +func (in *CurrentStatus) DeepCopy() *CurrentStatus { if in == nil { return nil } - out := new(GCPServiceAccount) + out := new(CurrentStatus) in.DeepCopyInto(out) return out } @@ -1826,241 +785,6 @@ func (in *NodeTemplateSpec) DeepCopy() *NodeTemplateSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackMachineClass) DeepCopyInto(out *OpenStackMachineClass) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.TypeMeta = in.TypeMeta - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineClass. -func (in *OpenStackMachineClass) DeepCopy() *OpenStackMachineClass { - if in == nil { - return nil - } - out := new(OpenStackMachineClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenStackMachineClass) 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 *OpenStackMachineClassList) DeepCopyInto(out *OpenStackMachineClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]OpenStackMachineClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineClassList. -func (in *OpenStackMachineClassList) DeepCopy() *OpenStackMachineClassList { - if in == nil { - return nil - } - out := new(OpenStackMachineClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *OpenStackMachineClassList) 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 *OpenStackMachineClassSpec) DeepCopyInto(out *OpenStackMachineClassSpec) { - *out = *in - if in.SecurityGroups != nil { - in, out := &in.SecurityGroups, &out.SecurityGroups - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Networks != nil { - in, out := &in.Networks, &out.Networks - *out = make([]OpenStackNetwork, len(*in)) - copy(*out, *in) - } - if in.SubnetID != nil { - in, out := &in.SubnetID, &out.SubnetID - *out = new(string) - **out = **in - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.SecretReference) - **out = **in - } - if in.CredentialsSecretRef != nil { - in, out := &in.CredentialsSecretRef, &out.CredentialsSecretRef - *out = new(v1.SecretReference) - **out = **in - } - if in.UseConfigDrive != nil { - in, out := &in.UseConfigDrive, &out.UseConfigDrive - *out = new(bool) - **out = **in - } - if in.ServerGroupID != nil { - in, out := &in.ServerGroupID, &out.ServerGroupID - *out = new(string) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackMachineClassSpec. -func (in *OpenStackMachineClassSpec) DeepCopy() *OpenStackMachineClassSpec { - if in == nil { - return nil - } - out := new(OpenStackMachineClassSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *OpenStackNetwork) DeepCopyInto(out *OpenStackNetwork) { - *out = *in - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenStackNetwork. -func (in *OpenStackNetwork) DeepCopy() *OpenStackNetwork { - if in == nil { - return nil - } - out := new(OpenStackNetwork) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *PacketMachineClass) DeepCopyInto(out *PacketMachineClass) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.TypeMeta = in.TypeMeta - in.Spec.DeepCopyInto(&out.Spec) - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PacketMachineClass. -func (in *PacketMachineClass) DeepCopy() *PacketMachineClass { - if in == nil { - return nil - } - out := new(PacketMachineClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PacketMachineClass) 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 *PacketMachineClassList) DeepCopyInto(out *PacketMachineClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]PacketMachineClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PacketMachineClassList. -func (in *PacketMachineClassList) DeepCopy() *PacketMachineClassList { - if in == nil { - return nil - } - out := new(PacketMachineClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *PacketMachineClassList) 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 *PacketMachineClassSpec) DeepCopyInto(out *PacketMachineClassSpec) { - *out = *in - if in.Facility != nil { - in, out := &in.Facility, &out.Facility - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Tags != nil { - in, out := &in.Tags, &out.Tags - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.SSHKeys != nil { - in, out := &in.SSHKeys, &out.SSHKeys - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.SecretRef != nil { - in, out := &in.SecretRef, &out.SecretRef - *out = new(v1.SecretReference) - **out = **in - } - if in.CredentialsSecretRef != nil { - in, out := &in.CredentialsSecretRef, &out.CredentialsSecretRef - *out = new(v1.SecretReference) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PacketMachineClassSpec. -func (in *PacketMachineClassSpec) DeepCopy() *PacketMachineClassSpec { - if in == nil { - return nil - } - out := new(PacketMachineClassSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *RollbackConfig) DeepCopyInto(out *RollbackConfig) { *out = *in diff --git a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/zz_generated.defaults.go b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/zz_generated.defaults.go index 3fa68441f14..d5513ac6d09 100644 --- a/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/zz_generated.defaults.go +++ b/vendor/github.com/gardener/machine-controller-manager/pkg/apis/machine/zz_generated.defaults.go @@ -1,3 +1,17 @@ +// Copyright 2023 SAP SE or an SAP affiliate company +// +// 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. + // +build !ignore_autogenerated // This file was autogenerated by defaulter-gen. Do not edit it manually! diff --git a/vendor/modules.txt b/vendor/modules.txt index d27e85776fb..63bb0c33eda 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -123,8 +123,8 @@ github.com/gardener/etcd-druid/pkg/utils # github.com/gardener/hvpa-controller/api v0.5.0 ## explicit; go 1.15 github.com/gardener/hvpa-controller/api/v1alpha1 -# github.com/gardener/machine-controller-manager v0.48.1 -## explicit; go 1.19 +# github.com/gardener/machine-controller-manager v0.50.0 +## explicit; go 1.20 github.com/gardener/machine-controller-manager/pkg/apis/machine github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1 # github.com/ghodss/yaml v1.0.0