diff --git a/Makefile b/Makefile index 589fdfe87c..9015d7107e 100644 --- a/Makefile +++ b/Makefile @@ -136,7 +136,6 @@ release-manifests: manifests cluster-templates generate: ## Generate code containing DeepCopy, DeepCopyInto, DeepCopyObject method implementations and API conversion implementations. controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..." conversion-gen \ - --input-dirs=./api/v1alpha4 \ --input-dirs=./api/v1beta1 \ --build-tag=ignore_autogenerated_core \ --output-file-base=zz_generated.conversion \ @@ -213,14 +212,11 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi ##@ Templates .PHONY: cluster-e2e-templates -cluster-e2e-templates: cluster-e2e-templates-v1beta1 cluster-e2e-templates-v1alpha4 cluster-e2e-templates-v135 ## Generate cluster templates for all versions +cluster-e2e-templates: cluster-e2e-templates-v1beta1 cluster-e2e-templates-v135 ## Generate cluster templates for all versions cluster-e2e-templates-v135: ## Generate cluster templates for CAPX v1.3.0 kustomize build $(NUTANIX_E2E_TEMPLATES)/v1.3.5/cluster-template --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1.3.5/cluster-template.yaml -cluster-e2e-templates-v1alpha4: ## Generate cluster templates for v1alpha4 - kustomize build $(NUTANIX_E2E_TEMPLATES)/v1alpha4/cluster-template --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1alpha4/cluster-template.yaml - cluster-e2e-templates-v1beta1: ## Generate cluster templates for v1beta1 kustomize build $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template.yaml kustomize build $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-no-secret --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-no-secret.yaml @@ -239,9 +235,6 @@ cluster-e2e-templates-v1beta1: ## Generate cluster templates for v1beta1 kustomize build $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-topology --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-topology.yaml cluster-e2e-templates-no-kubeproxy: ##Generate cluster templates without kubeproxy - # v1alpha4 - kustomize build $(NUTANIX_E2E_TEMPLATES)/v1alpha4/no-kubeproxy/cluster-template --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1alpha4/cluster-template.yaml - # v1beta1 kustomize build $(NUTANIX_E2E_TEMPLATES)/v1beta1/no-kubeproxy/cluster-template --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template.yaml kustomize build $(NUTANIX_E2E_TEMPLATES)/v1beta1/no-kubeproxy/cluster-template-no-secret --load-restrictor LoadRestrictionsNone > $(NUTANIX_E2E_TEMPLATES)/v1beta1/cluster-template-no-secret.yaml @@ -293,7 +286,7 @@ mocks: ## Generate mocks for the project mockgen -destination=mocks/k8sclient/lister.go -package=mockk8sclient k8s.io/client-go/listers/core/v1 SecretLister,SecretNamespaceLister mockgen -destination=mocks/k8sapimachinery/interfaces.go -package=mockmeta k8s.io/apimachinery/pkg/api/meta RESTMapper,RESTScope -GOTESTPKGS = $(shell go list ./... | grep -v /mocks | grep -v /templates | grep -v /v1alpha4) +GOTESTPKGS = $(shell go list ./... | grep -v /mocks | grep -v /templates) .PHONY: unit-test unit-test: mocks ## Run unit tests. diff --git a/PROJECT b/PROJECT index 91100f6f58..2117a20d1d 100644 --- a/PROJECT +++ b/PROJECT @@ -15,8 +15,8 @@ resources: domain: cluster.x-k8s.io group: infrastructure kind: NutanixCluster - path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1alpha4 - version: v1alpha4 + path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1 + version: v1beta1 - api: crdVersion: v1 namespaced: true @@ -24,16 +24,16 @@ resources: domain: cluster.x-k8s.io group: infrastructure kind: NutanixMachine - path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1alpha4 - version: v1alpha4 + path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1 + version: v1beta1 - api: crdVersion: v1 namespaced: true domain: cluster.x-k8s.io group: infrastructure kind: NutanixMachineTemplate - path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1alpha4 - version: v1alpha4 + path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1 + version: v1beta1 - api: crdVersion: v1 namespaced: true diff --git a/api/v1alpha4/conditions.go b/api/v1alpha4/conditions.go deleted file mode 100644 index 9d006b0698..0000000000 --- a/api/v1alpha4/conditions.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2022 Nutanix - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import capiv1 "sigs.k8s.io/cluster-api/api/v1beta1" - -const ( - DeletionFailed = "DeletionFailed" -) - -const ( - // ClusterCategoryCreatedCondition indicates the status of the category linked to the NutanixCluster - ClusterCategoryCreatedCondition capiv1.ConditionType = "ClusterCategoryCreated" - - ClusterCategoryCreationFailed = "ClusterCategoryCreationFailed" -) - -const ( - // PrismCentralClientCondition indicates the status of the client used to connect to Prism Central - PrismCentralClientCondition capiv1.ConditionType = "PrismClientInit" - - PrismCentralClientInitializationFailed = "PrismClientInitFailed" -) - -const ( - // VMProvisionedCondition shows the status of the VM provisioning process - VMProvisionedCondition capiv1.ConditionType = "VMProvisioned" - - VMProvisionedTaskFailed = "FailedVMTask" - - // VMAddressesAssignedCondition shows the status of the process of assigning the VM addresses - VMAddressesAssignedCondition capiv1.ConditionType = "VMAddressesAssigned" - - VMAddressesFailed = "VMAddressesFailed" - VMBootTypeInvalid = "VMBootTypeInvalid" -) - -const ( - // VMAddressesAssignedCondition shows the status of the process of assigning the VMs to a project - ProjectAssignedCondition capiv1.ConditionType = "ProjectAssigned" - - ProjectAssignationFailed = "ProjectAssignationFailed" -) - -const ( - // CredentialRefSecretOwnerSetCondition shows the status of setting the Owner - CredentialRefSecretOwnerSetCondition capiv1.ConditionType = "CredentialRefSecretOwnerSet" - - CredentialRefSecretOwnerSetFailed = "CredentialRefSecretOwnerSetFailed" -) diff --git a/api/v1alpha4/doc.go b/api/v1alpha4/doc.go deleted file mode 100644 index 530d6a6de8..0000000000 --- a/api/v1alpha4/doc.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2022 Nutanix - -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. -*/ - -// NOTE: https://pkg.go.dev/k8s.io/code-generator/cmd/conversion-gen -// Package v1alpha4 contains API Schema definitions for the infrastructure v1alpha4 API group -// +kubebuilder:object:generate=true -// +groupName=infrastructure.cluster.x-k8s.io -// +k8s:conversion-gen=github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1 -// -// Deprecated: This package will be removed in one of the next releases. -package v1alpha4 diff --git a/api/v1alpha4/groupversion_info.go b/api/v1alpha4/groupversion_info.go deleted file mode 100644 index dac3f5da54..0000000000 --- a/api/v1alpha4/groupversion_info.go +++ /dev/null @@ -1,36 +0,0 @@ -/* -Copyright 2022 Nutanix - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains API Schema definitions for the infrastructure v1alpha4 API group -package v1alpha4 - -import ( - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/controller-runtime/pkg/scheme" -) - -var ( - // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1alpha4"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme - SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = SchemeBuilder.AddToScheme - - localSchemeBuilder = SchemeBuilder.SchemeBuilder -) diff --git a/api/v1alpha4/nutanix_types.go b/api/v1alpha4/nutanix_types.go deleted file mode 100644 index e2dfa724cf..0000000000 --- a/api/v1alpha4/nutanix_types.go +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright 2022 Nutanix - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -// NutanixIdentifierType is an enumeration of different resource identifier types. -type NutanixIdentifierType string - -// NutanixBootType is an enumeration of different boot types. -type NutanixBootType string - -const ( - // NutanixIdentifierUUID is a resource identifier identifying the object by UUID. - NutanixIdentifierUUID NutanixIdentifierType = "uuid" - - // NutanixIdentifierName is a resource identifier identifying the object by Name. - NutanixIdentifierName NutanixIdentifierType = "name" - - // NutanixBootTypeLegacy is a resource identifier identifying the legacy boot type for virtual machines. - NutanixBootTypeLegacy NutanixBootType = "legacy" - - // NutanixBootTypeUEFI is a resource identifier identifying the UEFI boot type for virtual machines. - NutanixBootTypeUEFI NutanixBootType = "uefi" - - // ObsoleteDefaultCAPICategoryPrefix is the obsolete default category prefix used for CAPI clusters. - ObsoleteDefaultCAPICategoryPrefix = "kubernetes-io-cluster-" - - // DefaultCAPICategoryKeyForName is the default category key used for CAPI clusters for cluster names. - DefaultCAPICategoryKeyForName = "KubernetesClusterName" - - // DefaultCAPICategoryDescription is the default category description used for CAPI clusters. - DefaultCAPICategoryDescription = "Managed by CAPX" - - // ObsoleteDefaultCAPICategoryOwnedValue is the obsolete default category value used for CAPI clusters. - ObsoleteDefaultCAPICategoryOwnedValue = "owned" -) - -// NutanixResourceIdentifier holds the identity of a Nutanix PC resource (cluster, image, subnet, etc.) -// +union -type NutanixResourceIdentifier struct { - // Type is the identifier type to use for this resource. - // +kubebuilder:validation:Required - // +kubebuilder:validation:Enum:=uuid;name - Type NutanixIdentifierType `json:"type"` - - // uuid is the UUID of the resource in the PC. - // +optional - UUID *string `json:"uuid,omitempty"` - - // name is the resource name in the PC - // +optional - Name *string `json:"name,omitempty"` -} - -type NutanixCategoryIdentifier struct { - // key is the Key of category in PC. - // +optional - Key string `json:"key,omitempty"` - - // value is the category value linked to the category key in PC - // +optional - Value string `json:"value,omitempty"` -} diff --git a/api/v1alpha4/nutanixcluster_conversion.go b/api/v1alpha4/nutanixcluster_conversion.go deleted file mode 100644 index ad14b13970..0000000000 --- a/api/v1alpha4/nutanixcluster_conversion.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2022 Nutanix - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - infrav1beta1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1" - apiconversion "k8s.io/apimachinery/pkg/conversion" - //nolint:staticcheck // sigs.k8s.io/cluster-api/api/v1alpha4 is deprecated and will be removed in one of the next releases. - capiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" - "sigs.k8s.io/controller-runtime/pkg/conversion" -) - -// ConvertTo converts this NutanixCluster to the Hub version (v1beta1). -func (src *NutanixCluster) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.NutanixCluster) - return Convert_v1alpha4_NutanixCluster_To_v1beta1_NutanixCluster(src, dst, nil) -} - -// ConvertFrom converts from the Hub version (v1beta1) to this NutanixCluster. -func (dst *NutanixCluster) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.NutanixCluster) - return Convert_v1beta1_NutanixCluster_To_v1alpha4_NutanixCluster(src, dst, nil) -} - -// ConvertTo converts this NutanixClusterList to the Hub version (v1beta1). -func (src *NutanixClusterList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.NutanixClusterList) - return Convert_v1alpha4_NutanixClusterList_To_v1beta1_NutanixClusterList(src, dst, nil) -} - -// ConvertFrom converts from the Hub version(v1beta1) to this NutanixClusterList. -func (dst *NutanixClusterList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.NutanixClusterList) - return Convert_v1beta1_NutanixClusterList_To_v1alpha4_NutanixClusterList(src, dst, nil) -} - -// Convert_v1alpha4_NutanixClusterSpec_To_v1beta1_NutanixClusterSpec converts NutanixClusterSpec in NutanixClusterResource from v1alpha4 to v1beta1 version. -func Convert_v1alpha4_NutanixClusterSpec_To_v1beta1_NutanixClusterSpec(in *NutanixClusterSpec, out *infrav1beta1.NutanixClusterSpec, s apiconversion.Scope) error { - // Wrapping the conversion function to avoid compilation errors due to compileErrorOnMissingConversion() - // Ref: https://github.com/kubernetes/kubernetes/issues/98380 - //nolint:staticcheck // infinite recursive call - return Convert_v1alpha4_NutanixClusterSpec_To_v1beta1_NutanixClusterSpec(in, out, s) -} - -// Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint converts APIEndpoint in NutanixClusterResource from v1alpha4 to v1beta1 version. -func Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in *capiv1alpha4.APIEndpoint, out *capiv1beta1.APIEndpoint, s apiconversion.Scope) error { - // Wrapping the conversion function to avoid compilation errors due to compileErrorOnMissingConversion() - // Ref: https://github.com/kubernetes/kubernetes/issues/98380 - //nolint:staticcheck // infinite recursive call - return Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in, out, s) -} - -// Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint converts APIEndpoint in NutanixClusterResource from v1alpha4 to v1beta1 version. -func Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in *capiv1beta1.APIEndpoint, out *capiv1alpha4.APIEndpoint, s apiconversion.Scope) error { - // Wrapping the conversion function to avoid compilation errors due to compileErrorOnMissingConversion() - // Ref: https://github.com/kubernetes/kubernetes/issues/98380 - //nolint:staticcheck // infinite recursive call - return Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in, out, s) -} - -// Convert_v1beta1_NutanixClusterSpec_To_v1alpha4_NutanixClusterSpec converts NutanixClusterSpec in NutanixClusterResource from v1beta1 to v1alpha4 version. -func Convert_v1beta1_NutanixClusterSpec_To_v1alpha4_NutanixClusterSpec(in *infrav1beta1.NutanixClusterSpec, out *NutanixClusterSpec, s apiconversion.Scope) error { - // Wrapping the conversion function to avoid compilation errors due to compileErrorOnMissingConversion() - // Ref: https://github.com/kubernetes/kubernetes/issues/98380 - //nolint:staticcheck // infinite recursive call - return Convert_v1beta1_NutanixClusterSpec_To_v1alpha4_NutanixClusterSpec(in, out, s) -} - -// Convert_v1alpha4_NutanixClusterStatus_To_v1beta1_NutanixClusterStatus converts NutanixClusterStatus in NutanixClusterResource from v1alpha4 to v1beta1 version. -func Convert_v1alpha4_NutanixClusterStatus_To_v1beta1_NutanixClusterStatus(in *NutanixClusterStatus, out *infrav1beta1.NutanixClusterStatus, s apiconversion.Scope) error { - // Wrapping the conversion function to avoid compilation errors due to compileErrorOnMissingConversion() - // Ref: https://github.com/kubernetes/kubernetes/issues/98380 - //nolint:staticcheck // infinite recursive call - return Convert_v1alpha4_NutanixClusterStatus_To_v1beta1_NutanixClusterStatus(in, out, s) -} diff --git a/api/v1alpha4/nutanixcluster_types.go b/api/v1alpha4/nutanixcluster_types.go deleted file mode 100644 index 41cd6cb18c..0000000000 --- a/api/v1alpha4/nutanixcluster_types.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Copyright 2022 Nutanix - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - credentialTypes "github.com/nutanix-cloud-native/prism-go-client/environment/credentials" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - //nolint:staticcheck // sigs.k8s.io/cluster-api/api/v1alpha4 is deprecated and will be removed in one of the next releases. - capiv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - "sigs.k8s.io/cluster-api/errors" -) - -const ( - // NutanixClusterFinalizer allows NutanixClusterReconciler to clean up AHV - // resources associated with NutanixCluster before removing it from the - // API Server. - NutanixClusterFinalizer = "nutanixcluster.infrastructure.cluster.x-k8s.io" - NutanixClusterCredentialFinalizer = "nutanixcluster/infrastructure.cluster.x-k8s.io" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// NutanixClusterSpec defines the desired state of NutanixCluster -type NutanixClusterSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. - // host can be either DNS name or ip address - // +optional - ControlPlaneEndpoint capiv1.APIEndpoint `json:"controlPlaneEndpoint"` - - // prismCentral holds the endpoint address and port to access the Nutanix Prism Central. - // When a cluster-wide proxy is installed, by default, this endpoint will be accessed via the proxy. - // Should you wish for communication with this endpoint not to be proxied, please add the endpoint to the - // proxy spec.noProxy list. - // +optional - PrismCentral *credentialTypes.NutanixPrismEndpoint `json:"prismCentral"` - - // failureDomains configures failure domains information for the Nutanix platform. - // When set, the failure domains defined here may be used to spread Machines across - // prism element clusters to improve fault tolerance of the cluster. - // +listType=map - // +listMapKey=name - // +optional - FailureDomains []NutanixFailureDomain `json:"failureDomains"` -} - -// NutanixClusterStatus defines the observed state of NutanixCluster -type NutanixClusterStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // +optional - Ready bool `json:"ready,omitempty"` - - FailureDomains capiv1.FailureDomains `json:"failureDomains,omitempty"` - - // Conditions defines current service state of the NutanixCluster. - // +optional - Conditions capiv1.Conditions `json:"conditions,omitempty"` - - // Will be set in case of failure of Cluster instance - // +optional - FailureReason *errors.ClusterStatusError `json:"failureReason,omitempty"` - - // Will be set in case of failure of Cluster instance - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` -} - -//+kubebuilder:object:root=true -//+kubebuilder:resource:path=nutanixclusters,shortName=ncl,scope=Namespaced,categories=cluster-api -//+kubebuilder:subresource:status -//+kubebuilder:printcolumn:name="ControlplaneEndpoint",type="string",JSONPath=".spec.controlPlaneEndpoint.host",description="ControlplaneEndpoint" -//+kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="in ready status" - -// NutanixCluster is the Schema for the nutanixclusters API -// +kubebuilder:deprecatedversion:warning=v1alpha4 NutanixCluster is deprecated and marked as unserved. It will be removed in a future release. Use v1beta1 NutanixCluster instead. -// +kubebuilder:unservedversion -type NutanixCluster struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec NutanixClusterSpec `json:"spec,omitempty"` - Status NutanixClusterStatus `json:"status,omitempty"` -} - -// NutanixFailureDomain configures failure domain information for Nutanix. -type NutanixFailureDomain struct { - // name defines the unique name of a failure domain. - // Name is required and must be at most 64 characters in length. - // It must consist of only lower case alphanumeric characters and hyphens (-). - // It must start and end with an alphanumeric character. - // This value is arbitrary and is used to identify the failure domain within the platform. - // +kubebuilder:validation:Required - // +kubebuilder:validation:MinLength=1 - // +kubebuilder:validation:MaxLength=64 - // +kubebuilder:validation:Pattern=`[a-z0-9]([-a-z0-9]*[a-z0-9])?` - Name string `json:"name"` - - // cluster is to identify the cluster (the Prism Element under management of the Prism Central), - // in which the Machine's VM will be created. The cluster identifier (uuid or name) can be obtained - // from the Prism Central console or using the prism_central API. - // +kubebuilder:validation:Required - Cluster NutanixResourceIdentifier `json:"cluster"` - - // subnets holds a list of identifiers (one or more) of the cluster's network subnets - // for the Machine's VM to connect to. The subnet identifiers (uuid or name) can be - // obtained from the Prism Central console or using the prism_central API. - // +kubebuilder:validation:Required - // +kubebuilder:validation:MinItems=1 - // +listType=map - // +listMapKey=type - Subnets []NutanixResourceIdentifier `json:"subnets"` - - // indicates if a failure domain is suited for control plane nodes - // +kubebuilder:validation:Required - ControlPlane bool `json:"controlPlane,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (ncl *NutanixCluster) GetConditions() capiv1.Conditions { - return ncl.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (ncl *NutanixCluster) SetConditions(conditions capiv1.Conditions) { - ncl.Status.Conditions = conditions -} - -//+kubebuilder:object:root=true - -// NutanixClusterList contains a list of NutanixCluster -type NutanixClusterList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NutanixCluster `json:"items"` -} - -func init() { - SchemeBuilder.Register(&NutanixCluster{}, &NutanixClusterList{}) -} diff --git a/api/v1alpha4/nutanixmachine_conversion.go b/api/v1alpha4/nutanixmachine_conversion.go deleted file mode 100644 index 940e40d987..0000000000 --- a/api/v1alpha4/nutanixmachine_conversion.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright 2022 Nutanix - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - infrav1beta1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1" - apiconversion "k8s.io/apimachinery/pkg/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" -) - -// ConvertTo converts this NutanixMachine to the Hub version (v1beta1). -func (src *NutanixMachine) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.NutanixMachine) - return Convert_v1alpha4_NutanixMachine_To_v1beta1_NutanixMachine(src, dst, nil) -} - -// ConvertFrom converts from the Hub version (v1beta1) to this NutanixMachine. -func (dst *NutanixMachine) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.NutanixMachine) - return Convert_v1beta1_NutanixMachine_To_v1alpha4_NutanixMachine(src, dst, nil) -} - -// ConvertTo converts this NutanixMachineList to the Hub version (v1beta1). -func (src *NutanixMachineList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.NutanixMachineList) - return Convert_v1alpha4_NutanixMachineList_To_v1beta1_NutanixMachineList(src, dst, nil) -} - -// ConvertFrom converts from the Hub version(v1beta1) to this NutanixMachineList. -func (dst *NutanixMachineList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.NutanixMachineList) - return Convert_v1beta1_NutanixMachineList_To_v1alpha4_NutanixMachineList(src, dst, nil) -} - -// Convert_v1alpha4_NutanixMachineSpec_To_v1beta1_NutanixMachineSpec converts NutanixMachineSpec in NutanixMachineResource from v1alpha4 to v1beta1 version. -func Convert_v1alpha4_NutanixMachineSpec_To_v1beta1_NutanixMachineSpec(in *NutanixMachineSpec, out *infrav1beta1.NutanixMachineSpec, s apiconversion.Scope) error { - // Wrapping the conversion function to avoid compilation errors due to compileErrorOnMissingConversion() - // Ref: https://github.com/kubernetes/kubernetes/issues/98380 - //nolint:staticcheck // infinite recursive call - return Convert_v1alpha4_NutanixMachineSpec_To_v1beta1_NutanixMachineSpec(in, out, s) -} - -// Convert_v1beta1_NutanixMachineSpec_To_v1alpha4_NutanixMachineSpec converts NutanixMachineSpec in NutanixMachineResource from v1alpha4 to v1beta1 version. -func Convert_v1beta1_NutanixMachineSpec_To_v1alpha4_NutanixMachineSpec(in *infrav1beta1.NutanixMachineSpec, out *NutanixMachineSpec, s apiconversion.Scope) error { - // Wrapping the conversion function to avoid compilation errors due to compileErrorOnMissingConversion() - // Ref: https://github.com/kubernetes/kubernetes/issues/98380 - //nolint:staticcheck // infinite recursive call - return Convert_v1beta1_NutanixMachineSpec_To_v1alpha4_NutanixMachineSpec(in, out, s) -} - -// Convert_v1alpha4_NutanixMachineStatus_To_v1beta1_NutanixMachineStatus converts NutanixMachineStatus in NutanixMachineResource from v1alpha4 to v1beta1 version. -func Convert_v1alpha4_NutanixMachineStatus_To_v1beta1_NutanixMachineStatus(in *NutanixMachineStatus, out *infrav1beta1.NutanixMachineStatus, s apiconversion.Scope) error { - // Wrapping the conversion function to avoid compilation errors due to compileErrorOnMissingConversion() - // Ref: https://github.com/kubernetes/kubernetes/issues/98380 - //nolint:staticcheck // infinite recursive call - return Convert_v1alpha4_NutanixMachineStatus_To_v1beta1_NutanixMachineStatus(in, out, s) -} diff --git a/api/v1alpha4/nutanixmachine_types.go b/api/v1alpha4/nutanixmachine_types.go deleted file mode 100644 index eb6eff3815..0000000000 --- a/api/v1alpha4/nutanixmachine_types.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright 2022 Nutanix - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - //nolint:staticcheck // sigs.k8s.io/cluster-api/api/v1alpha4 is deprecated and will be removed in one of the next releases. - capiv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - "sigs.k8s.io/cluster-api/errors" -) - -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -const ( - // NutanixMachineFinalizer allows NutanixMachineReconciler to clean up AHV - // resources associated with NutanixMachine before removing it from the - // API Server. - NutanixMachineFinalizer = "nutanixmachine.infrastructure.cluster.x-k8s.io" -) - -// NutanixMachineSpec defines the desired state of NutanixMachine -type NutanixMachineSpec struct { - // SPEC FIELDS - desired state of NutanixMachine - // Important: Run "make" to regenerate code after modifying this file - - ProviderID string `json:"providerID"` - // vcpusPerSocket is the number of vCPUs per socket of the VM - // +kubebuilder:validation:Required - // +kubebuilder:validation:Minimum=1 - VCPUsPerSocket int32 `json:"vcpusPerSocket"` - // vcpuSockets is the number of vCPU sockets of the VM - // +kubebuilder:validation:Required - // +kubebuilder:validation:Minimum=1 - VCPUSockets int32 `json:"vcpuSockets"` - // memorySize is the memory size (in Quantity format) of the VM - // The minimum memorySize is 2Gi bytes - // +kubebuilder:validation:Required - MemorySize resource.Quantity `json:"memorySize"` - // image is to identify the rhcos image uploaded to the Prism Central (PC) - // The image identifier (uuid or name) can be obtained from the Prism Central console - // or using the prism_central API. - // +kubebuilder:validation:Required - Image NutanixResourceIdentifier `json:"image"` - // cluster is to identify the cluster (the Prism Element under management - // of the Prism Central), in which the Machine's VM will be created. - // The cluster identifier (uuid or name) can be obtained from the Prism Central console - // or using the prism_central API. - // +kubebuilder:validation:Optional - Cluster NutanixResourceIdentifier `json:"cluster"` - // subnet is to identify the cluster's network subnet to use for the Machine's VM - // The cluster identifier (uuid or name) can be obtained from the Prism Central console - // or using the prism_central API. - // +kubebuilder:validation:Optional - Subnets []NutanixResourceIdentifier `json:"subnet"` - // List of categories that need to be added to the machines. Categories must already exist in Prism Central - // +kubebuilder:validation:Optional - AdditionalCategories []NutanixCategoryIdentifier `json:"additionalCategories,omitempty"` - // Add the machine resources to a Prism Central project - // +optional - Project *NutanixResourceIdentifier `json:"project,omitempty"` - // Defines the boot type of the virtual machine. Only supports UEFI and Legacy - // +kubebuilder:validation:Optional - // +kubebuilder:validation:Enum:=legacy;uefi - BootType NutanixBootType `json:"bootType,omitempty"` - - // systemDiskSize is size (in Quantity format) of the system disk of the VM - // The minimum systemDiskSize is 20Gi bytes - // +kubebuilder:validation:Required - SystemDiskSize resource.Quantity `json:"systemDiskSize"` - - // BootstrapRef is a reference to a bootstrap provider-specific resource - // that holds configuration details. - // +optional - BootstrapRef *corev1.ObjectReference `json:"bootstrapRef,omitempty"` -} - -// NutanixMachineStatus defines the observed state of NutanixMachine -type NutanixMachineStatus struct { - // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster - // Important: Run "make" to regenerate code after modifying this file - - // Ready is true when the provider resource is ready. - // +optional - Ready bool `json:"ready"` - - // Addresses contains the Nutanix VM associated addresses. - // Address type is one of Hostname, ExternalIP, InternalIP, ExternalDNS, InternalDNS - Addresses []capiv1.MachineAddress `json:"addresses,omitempty"` - - // The Nutanix VM's UUID - // +optional - VmUUID string `json:"vmUUID,omitempty"` - - // NodeRef is a reference to the corresponding workload cluster Node if it exists. - // Deprecated: Do not use. Will be removed in a future release. - // +optional - NodeRef *corev1.ObjectReference `json:"nodeRef,omitempty"` - - // Conditions defines current service state of the NutanixMachine. - // +optional - Conditions capiv1.Conditions `json:"conditions,omitempty"` - - // Will be set in case of failure of Machine instance - // +optional - FailureReason *errors.MachineStatusError `json:"failureReason,omitempty"` - - // Will be set in case of failure of Machine instance - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` -} - -//+kubebuilder:object:root=true -//+kubebuilder:resource:path=nutanixmachines,shortName=nma,scope=Namespaced,categories=cluster-api -//+kubebuilder:subresource:status -//+kubebuilder:printcolumn:name="Address",type="string",JSONPath=".status.addresses[0].address",description="The VM address" -// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="NutanixMachine ready status" -// +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="NutanixMachine instance ID" - -// NutanixMachine is the Schema for the nutanixmachines API -// +kubebuilder:deprecatedversion:warning=v1alpha4 NutanixMachine is deprecated and marked as unserved. It will be removed in a future release. Use v1beta1 NutanixMachine instead. -// +kubebuilder:unservedversion -type NutanixMachine struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec NutanixMachineSpec `json:"spec,omitempty"` - Status NutanixMachineStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (nm *NutanixMachine) GetConditions() capiv1.Conditions { - return nm.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (nm *NutanixMachine) SetConditions(conditions capiv1.Conditions) { - nm.Status.Conditions = conditions -} - -//+kubebuilder:object:root=true - -// NutanixMachineList contains a list of NutanixMachine -type NutanixMachineList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NutanixMachine `json:"items"` -} - -func init() { - SchemeBuilder.Register(&NutanixMachine{}, &NutanixMachineList{}) -} diff --git a/api/v1alpha4/nutanixmachinetemplate_conversion.go b/api/v1alpha4/nutanixmachinetemplate_conversion.go deleted file mode 100644 index 723f757912..0000000000 --- a/api/v1alpha4/nutanixmachinetemplate_conversion.go +++ /dev/null @@ -1,90 +0,0 @@ -/* -Copyright 2022 Nutanix - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - infrav1beta1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1" - apiconversion "k8s.io/apimachinery/pkg/conversion" - //nolint:staticcheck // sigs.k8s.io/cluster-api/api/v1alpha4 is deprecated and will be removed in one of the next releases. - capiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" -) - -// ConvertTo converts this NutanixMachineTemplate to the Hub version (v1beta1). -func (src *NutanixMachineTemplate) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.NutanixMachineTemplate) - return Convert_v1alpha4_NutanixMachineTemplate_To_v1beta1_NutanixMachineTemplate(src, dst, nil) -} - -// ConvertFrom converts from the Hub version (v1beta1) to this NutanixMachineTemplate. -func (dst *NutanixMachineTemplate) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.NutanixMachineTemplate) - if err := Convert_v1beta1_NutanixMachineTemplate_To_v1alpha4_NutanixMachineTemplate(src, dst, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion. - if err := utilconversion.MarshalData(src, dst); err != nil { - return err - } - - return nil -} - -// ConvertTo converts this NutanixMachineTemplateList to the Hub version (v1beta1). -func (src *NutanixMachineTemplateList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.NutanixMachineTemplateList) - return Convert_v1alpha4_NutanixMachineTemplateList_To_v1beta1_NutanixMachineTemplateList(src, dst, nil) -} - -// ConvertFrom converts from the Hub version(v1beta1) to this NutanixMachineTemplateList. -func (dst *NutanixMachineTemplateList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.NutanixMachineTemplateList) - return Convert_v1beta1_NutanixMachineTemplateList_To_v1alpha4_NutanixMachineTemplateList(src, dst, nil) -} - -// Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta converts ObjectMeta in NutanixMachineTemplateResource from v1alpha4 to v1beta1 version. -func Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in *capiv1alpha4.ObjectMeta, out *capiv1beta1.ObjectMeta, s apiconversion.Scope) error { - // Wrapping the conversion function to avoid compilation errors due to compileErrorOnMissingConversion() - // Ref: https://github.com/kubernetes/kubernetes/issues/98380 - return capiv1alpha4.Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in, out, s) -} - -// Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta converts ObjectMeta in NutanixMachineTemplateResource from v1beta1 to v1alpha4 version. -func Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in *capiv1beta1.ObjectMeta, out *capiv1alpha4.ObjectMeta, s apiconversion.Scope) error { - // Wrapping the conversion function to avoid compilation errors due to compileErrorOnMissingConversion() - // Ref: https://github.com/kubernetes/kubernetes/issues/98380 - return capiv1alpha4.Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in, out, s) -} - -// Convert_v1alpha4_NutanixMachineTemplateResource_To_v1beta1_NutanixMachineTemplateResource converts NutanixMachineTemplateResource in NutanixMachineTemplateResource from v1alpha4 to v1beta1 version. -func Convert_v1alpha4_NutanixMachineTemplateResource_To_v1beta1_NutanixMachineTemplateResource(in *NutanixMachineTemplateResource, out *infrav1beta1.NutanixMachineTemplateResource, s apiconversion.Scope) error { - // Wrapping the conversion function to avoid compilation errors due to compileErrorOnMissingConversion() - // Ref: https://github.com/kubernetes/kubernetes/issues/98380 - //nolint:staticcheck // infinite recusive call - return Convert_v1alpha4_NutanixMachineTemplateResource_To_v1beta1_NutanixMachineTemplateResource(in, out, s) -} - -// Convert_v1beta1_NutanixMachineTemplateResource_To_v1alpha4_NutanixMachineTemplateResource converts NutanixMachineTemplateResource in NutanixMachineTemplateResource from v1beta1 to v1alpha4 version. -func Convert_v1beta1_NutanixMachineTemplateResource_To_v1alpha4_NutanixMachineTemplateResource(in *infrav1beta1.NutanixMachineTemplateResource, out *NutanixMachineTemplateResource, s apiconversion.Scope) error { - // Wrapping the conversion function to avoid compilation errors due to compileErrorOnMissingConversion() - // Ref: https://github.com/kubernetes/kubernetes/issues/98380 - //nolint:staticcheck // infinite recusive call - return Convert_v1beta1_NutanixMachineTemplateResource_To_v1alpha4_NutanixMachineTemplateResource(in, out, s) -} diff --git a/api/v1alpha4/nutanixmachinetemplate_types.go b/api/v1alpha4/nutanixmachinetemplate_types.go deleted file mode 100644 index a7a8f30a07..0000000000 --- a/api/v1alpha4/nutanixmachinetemplate_types.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2022 Nutanix - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - //nolint:staticcheck // sigs.k8s.io/cluster-api/api/v1alpha4 is deprecated and will be removed in one of the next releases. - capiv1 "sigs.k8s.io/cluster-api/api/v1alpha4" -) - -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - -// NutanixMachineTemplateSpec defines the desired state of NutanixMachineTemplate -type NutanixMachineTemplateSpec struct { - Template NutanixMachineTemplateResource `json:"template"` -} - -//+kubebuilder:object:root=true -//+kubebuilder:resource:path=nutanixmachinetemplates,shortName=nmtmpl,scope=Namespaced,categories=cluster-api - -// NutanixMachineTemplate is the Schema for the nutanixmachinetemplates API -type NutanixMachineTemplate struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec NutanixMachineTemplateSpec `json:"spec,omitempty"` -} - -//+kubebuilder:object:root=true - -// NutanixMachineTemplateList contains a list of NutanixMachineTemplate -type NutanixMachineTemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NutanixMachineTemplate `json:"items"` -} - -func init() { - SchemeBuilder.Register(&NutanixMachineTemplate{}, &NutanixMachineTemplateList{}) -} - -// NutanixMachineTemplateResource describes the data needed to create a NutanixMachine from a template -type NutanixMachineTemplateResource struct { - // Standard object metadata. - // Ref: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - ObjectMeta capiv1.ObjectMeta `json:"metadata,omitempty"` - // Spec is the specification of the desired behavior of the machine. - Spec NutanixMachineSpec `json:"spec"` -} diff --git a/api/v1alpha4/v1alpha4_test.go b/api/v1alpha4/v1alpha4_test.go deleted file mode 100644 index 37d407c042..0000000000 --- a/api/v1alpha4/v1alpha4_test.go +++ /dev/null @@ -1,60 +0,0 @@ -package v1alpha4 - -import ( - "testing" - - "github.com/nutanix-cloud-native/prism-go-client/environment/credentials" - "github.com/nutanix-cloud-native/prism-go-client/utils" - "github.com/stretchr/testify/assert" - //nolint:staticcheck // sigs.k8s.io/cluster-api/api/v1alpha4 is deprecated and will be removed in one of the next releases. - "sigs.k8s.io/cluster-api/api/v1alpha4" -) - -func TestNutanixCluster(t *testing.T) { - // Tests DeepCopyObject on NutanixCluster - clusterSpec := NutanixClusterSpec{ - ControlPlaneEndpoint: v1alpha4.APIEndpoint{}, - PrismCentral: &credentials.NutanixPrismEndpoint{}, - FailureDomains: []NutanixFailureDomain{}, - } - - clusterStatus := NutanixClusterStatus{ - FailureDomains: map[string]v1alpha4.FailureDomainSpec{}, - } - - cluster := NutanixCluster{ - Spec: clusterSpec, - Status: clusterStatus, - } - - obj := cluster.DeepCopyObject() - assert.NotNil(t, obj) -} - -func TestNutanixMachine(t *testing.T) { - // Tests DeepCopyObject on NutanixMachine - machineSpec := NutanixMachineSpec{ - Image: NutanixResourceIdentifier{ - Type: NutanixIdentifierName, - Name: utils.StringPtr("test-image"), - }, - AdditionalCategories: []NutanixCategoryIdentifier{ - { - Key: "key", - Value: "value", - }, - }, - } - - machineStatus := NutanixMachineStatus{ - Addresses: []v1alpha4.MachineAddress{}, - } - - machine := NutanixMachine{ - Spec: machineSpec, - Status: machineStatus, - } - - obj := machine.DeepCopyObject() - assert.NotNil(t, obj) -} diff --git a/api/v1alpha4/zz_generated.conversion.go b/api/v1alpha4/zz_generated.conversion.go deleted file mode 100644 index ce0280392e..0000000000 --- a/api/v1alpha4/zz_generated.conversion.go +++ /dev/null @@ -1,659 +0,0 @@ -//go:build !ignore_autogenerated_core -// +build !ignore_autogenerated_core - -/* -Copyright 2022 Nutanix - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - unsafe "unsafe" - - v1beta1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1" - credentials "github.com/nutanix-cloud-native/prism-go-client/environment/credentials" - v1 "k8s.io/api/core/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" - errors "sigs.k8s.io/cluster-api/errors" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*NutanixCategoryIdentifier)(nil), (*v1beta1.NutanixCategoryIdentifier)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NutanixCategoryIdentifier_To_v1beta1_NutanixCategoryIdentifier(a.(*NutanixCategoryIdentifier), b.(*v1beta1.NutanixCategoryIdentifier), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.NutanixCategoryIdentifier)(nil), (*NutanixCategoryIdentifier)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NutanixCategoryIdentifier_To_v1alpha4_NutanixCategoryIdentifier(a.(*v1beta1.NutanixCategoryIdentifier), b.(*NutanixCategoryIdentifier), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NutanixCluster)(nil), (*v1beta1.NutanixCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NutanixCluster_To_v1beta1_NutanixCluster(a.(*NutanixCluster), b.(*v1beta1.NutanixCluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.NutanixCluster)(nil), (*NutanixCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NutanixCluster_To_v1alpha4_NutanixCluster(a.(*v1beta1.NutanixCluster), b.(*NutanixCluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NutanixClusterList)(nil), (*v1beta1.NutanixClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NutanixClusterList_To_v1beta1_NutanixClusterList(a.(*NutanixClusterList), b.(*v1beta1.NutanixClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.NutanixClusterList)(nil), (*NutanixClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NutanixClusterList_To_v1alpha4_NutanixClusterList(a.(*v1beta1.NutanixClusterList), b.(*NutanixClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.NutanixClusterStatus)(nil), (*NutanixClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NutanixClusterStatus_To_v1alpha4_NutanixClusterStatus(a.(*v1beta1.NutanixClusterStatus), b.(*NutanixClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NutanixFailureDomain)(nil), (*v1beta1.NutanixFailureDomain)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NutanixFailureDomain_To_v1beta1_NutanixFailureDomain(a.(*NutanixFailureDomain), b.(*v1beta1.NutanixFailureDomain), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.NutanixFailureDomain)(nil), (*NutanixFailureDomain)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NutanixFailureDomain_To_v1alpha4_NutanixFailureDomain(a.(*v1beta1.NutanixFailureDomain), b.(*NutanixFailureDomain), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NutanixMachine)(nil), (*v1beta1.NutanixMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NutanixMachine_To_v1beta1_NutanixMachine(a.(*NutanixMachine), b.(*v1beta1.NutanixMachine), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.NutanixMachine)(nil), (*NutanixMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NutanixMachine_To_v1alpha4_NutanixMachine(a.(*v1beta1.NutanixMachine), b.(*NutanixMachine), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NutanixMachineList)(nil), (*v1beta1.NutanixMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NutanixMachineList_To_v1beta1_NutanixMachineList(a.(*NutanixMachineList), b.(*v1beta1.NutanixMachineList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.NutanixMachineList)(nil), (*NutanixMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NutanixMachineList_To_v1alpha4_NutanixMachineList(a.(*v1beta1.NutanixMachineList), b.(*NutanixMachineList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.NutanixMachineStatus)(nil), (*NutanixMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NutanixMachineStatus_To_v1alpha4_NutanixMachineStatus(a.(*v1beta1.NutanixMachineStatus), b.(*NutanixMachineStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NutanixMachineTemplate)(nil), (*v1beta1.NutanixMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NutanixMachineTemplate_To_v1beta1_NutanixMachineTemplate(a.(*NutanixMachineTemplate), b.(*v1beta1.NutanixMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.NutanixMachineTemplate)(nil), (*NutanixMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NutanixMachineTemplate_To_v1alpha4_NutanixMachineTemplate(a.(*v1beta1.NutanixMachineTemplate), b.(*NutanixMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NutanixMachineTemplateList)(nil), (*v1beta1.NutanixMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NutanixMachineTemplateList_To_v1beta1_NutanixMachineTemplateList(a.(*NutanixMachineTemplateList), b.(*v1beta1.NutanixMachineTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.NutanixMachineTemplateList)(nil), (*NutanixMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NutanixMachineTemplateList_To_v1alpha4_NutanixMachineTemplateList(a.(*v1beta1.NutanixMachineTemplateList), b.(*NutanixMachineTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NutanixMachineTemplateSpec)(nil), (*v1beta1.NutanixMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NutanixMachineTemplateSpec_To_v1beta1_NutanixMachineTemplateSpec(a.(*NutanixMachineTemplateSpec), b.(*v1beta1.NutanixMachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.NutanixMachineTemplateSpec)(nil), (*NutanixMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NutanixMachineTemplateSpec_To_v1alpha4_NutanixMachineTemplateSpec(a.(*v1beta1.NutanixMachineTemplateSpec), b.(*NutanixMachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NutanixResourceIdentifier)(nil), (*v1beta1.NutanixResourceIdentifier)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NutanixResourceIdentifier_To_v1beta1_NutanixResourceIdentifier(a.(*NutanixResourceIdentifier), b.(*v1beta1.NutanixResourceIdentifier), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.NutanixResourceIdentifier)(nil), (*NutanixResourceIdentifier)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NutanixResourceIdentifier_To_v1alpha4_NutanixResourceIdentifier(a.(*v1beta1.NutanixResourceIdentifier), b.(*NutanixResourceIdentifier), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*apiv1alpha4.APIEndpoint)(nil), (*apiv1beta1.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(a.(*apiv1alpha4.APIEndpoint), b.(*apiv1beta1.APIEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*NutanixClusterSpec)(nil), (*v1beta1.NutanixClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NutanixClusterSpec_To_v1beta1_NutanixClusterSpec(a.(*NutanixClusterSpec), b.(*v1beta1.NutanixClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*NutanixClusterStatus)(nil), (*v1beta1.NutanixClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NutanixClusterStatus_To_v1beta1_NutanixClusterStatus(a.(*NutanixClusterStatus), b.(*v1beta1.NutanixClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*NutanixMachineSpec)(nil), (*v1beta1.NutanixMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NutanixMachineSpec_To_v1beta1_NutanixMachineSpec(a.(*NutanixMachineSpec), b.(*v1beta1.NutanixMachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*NutanixMachineStatus)(nil), (*v1beta1.NutanixMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NutanixMachineStatus_To_v1beta1_NutanixMachineStatus(a.(*NutanixMachineStatus), b.(*v1beta1.NutanixMachineStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*NutanixMachineTemplateResource)(nil), (*v1beta1.NutanixMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NutanixMachineTemplateResource_To_v1beta1_NutanixMachineTemplateResource(a.(*NutanixMachineTemplateResource), b.(*v1beta1.NutanixMachineTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*apiv1alpha4.ObjectMeta)(nil), (*apiv1beta1.ObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(a.(*apiv1alpha4.ObjectMeta), b.(*apiv1beta1.ObjectMeta), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*apiv1beta1.APIEndpoint)(nil), (*apiv1alpha4.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(a.(*apiv1beta1.APIEndpoint), b.(*apiv1alpha4.APIEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.NutanixClusterSpec)(nil), (*NutanixClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NutanixClusterSpec_To_v1alpha4_NutanixClusterSpec(a.(*v1beta1.NutanixClusterSpec), b.(*NutanixClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.NutanixMachineSpec)(nil), (*NutanixMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NutanixMachineSpec_To_v1alpha4_NutanixMachineSpec(a.(*v1beta1.NutanixMachineSpec), b.(*NutanixMachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.NutanixMachineTemplateResource)(nil), (*NutanixMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NutanixMachineTemplateResource_To_v1alpha4_NutanixMachineTemplateResource(a.(*v1beta1.NutanixMachineTemplateResource), b.(*NutanixMachineTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*apiv1beta1.ObjectMeta)(nil), (*apiv1alpha4.ObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(a.(*apiv1beta1.ObjectMeta), b.(*apiv1alpha4.ObjectMeta), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha4_NutanixCategoryIdentifier_To_v1beta1_NutanixCategoryIdentifier(in *NutanixCategoryIdentifier, out *v1beta1.NutanixCategoryIdentifier, s conversion.Scope) error { - out.Key = in.Key - out.Value = in.Value - return nil -} - -// Convert_v1alpha4_NutanixCategoryIdentifier_To_v1beta1_NutanixCategoryIdentifier is an autogenerated conversion function. -func Convert_v1alpha4_NutanixCategoryIdentifier_To_v1beta1_NutanixCategoryIdentifier(in *NutanixCategoryIdentifier, out *v1beta1.NutanixCategoryIdentifier, s conversion.Scope) error { - return autoConvert_v1alpha4_NutanixCategoryIdentifier_To_v1beta1_NutanixCategoryIdentifier(in, out, s) -} - -func autoConvert_v1beta1_NutanixCategoryIdentifier_To_v1alpha4_NutanixCategoryIdentifier(in *v1beta1.NutanixCategoryIdentifier, out *NutanixCategoryIdentifier, s conversion.Scope) error { - out.Key = in.Key - out.Value = in.Value - return nil -} - -// Convert_v1beta1_NutanixCategoryIdentifier_To_v1alpha4_NutanixCategoryIdentifier is an autogenerated conversion function. -func Convert_v1beta1_NutanixCategoryIdentifier_To_v1alpha4_NutanixCategoryIdentifier(in *v1beta1.NutanixCategoryIdentifier, out *NutanixCategoryIdentifier, s conversion.Scope) error { - return autoConvert_v1beta1_NutanixCategoryIdentifier_To_v1alpha4_NutanixCategoryIdentifier(in, out, s) -} - -func autoConvert_v1alpha4_NutanixCluster_To_v1beta1_NutanixCluster(in *NutanixCluster, out *v1beta1.NutanixCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_NutanixClusterSpec_To_v1beta1_NutanixClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_NutanixClusterStatus_To_v1beta1_NutanixClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_NutanixCluster_To_v1beta1_NutanixCluster is an autogenerated conversion function. -func Convert_v1alpha4_NutanixCluster_To_v1beta1_NutanixCluster(in *NutanixCluster, out *v1beta1.NutanixCluster, s conversion.Scope) error { - return autoConvert_v1alpha4_NutanixCluster_To_v1beta1_NutanixCluster(in, out, s) -} - -func autoConvert_v1beta1_NutanixCluster_To_v1alpha4_NutanixCluster(in *v1beta1.NutanixCluster, out *NutanixCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_NutanixClusterSpec_To_v1alpha4_NutanixClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_NutanixClusterStatus_To_v1alpha4_NutanixClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_NutanixCluster_To_v1alpha4_NutanixCluster is an autogenerated conversion function. -func Convert_v1beta1_NutanixCluster_To_v1alpha4_NutanixCluster(in *v1beta1.NutanixCluster, out *NutanixCluster, s conversion.Scope) error { - return autoConvert_v1beta1_NutanixCluster_To_v1alpha4_NutanixCluster(in, out, s) -} - -func autoConvert_v1alpha4_NutanixClusterList_To_v1beta1_NutanixClusterList(in *NutanixClusterList, out *v1beta1.NutanixClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.NutanixCluster, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_NutanixCluster_To_v1beta1_NutanixCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_NutanixClusterList_To_v1beta1_NutanixClusterList is an autogenerated conversion function. -func Convert_v1alpha4_NutanixClusterList_To_v1beta1_NutanixClusterList(in *NutanixClusterList, out *v1beta1.NutanixClusterList, s conversion.Scope) error { - return autoConvert_v1alpha4_NutanixClusterList_To_v1beta1_NutanixClusterList(in, out, s) -} - -func autoConvert_v1beta1_NutanixClusterList_To_v1alpha4_NutanixClusterList(in *v1beta1.NutanixClusterList, out *NutanixClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NutanixCluster, len(*in)) - for i := range *in { - if err := Convert_v1beta1_NutanixCluster_To_v1alpha4_NutanixCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_NutanixClusterList_To_v1alpha4_NutanixClusterList is an autogenerated conversion function. -func Convert_v1beta1_NutanixClusterList_To_v1alpha4_NutanixClusterList(in *v1beta1.NutanixClusterList, out *NutanixClusterList, s conversion.Scope) error { - return autoConvert_v1beta1_NutanixClusterList_To_v1alpha4_NutanixClusterList(in, out, s) -} - -func autoConvert_v1alpha4_NutanixClusterSpec_To_v1beta1_NutanixClusterSpec(in *NutanixClusterSpec, out *v1beta1.NutanixClusterSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { - return err - } - out.PrismCentral = (*credentials.NutanixPrismEndpoint)(unsafe.Pointer(in.PrismCentral)) - out.FailureDomains = *(*[]v1beta1.NutanixFailureDomain)(unsafe.Pointer(&in.FailureDomains)) - return nil -} - -func autoConvert_v1beta1_NutanixClusterSpec_To_v1alpha4_NutanixClusterSpec(in *v1beta1.NutanixClusterSpec, out *NutanixClusterSpec, s conversion.Scope) error { - if err := Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { - return err - } - out.PrismCentral = (*credentials.NutanixPrismEndpoint)(unsafe.Pointer(in.PrismCentral)) - out.FailureDomains = *(*[]NutanixFailureDomain)(unsafe.Pointer(&in.FailureDomains)) - return nil -} - -func autoConvert_v1alpha4_NutanixClusterStatus_To_v1beta1_NutanixClusterStatus(in *NutanixClusterStatus, out *v1beta1.NutanixClusterStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.FailureDomains = *(*apiv1beta1.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) - out.Conditions = *(*apiv1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - out.FailureReason = (*errors.ClusterStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - return nil -} - -func autoConvert_v1beta1_NutanixClusterStatus_To_v1alpha4_NutanixClusterStatus(in *v1beta1.NutanixClusterStatus, out *NutanixClusterStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.FailureDomains = *(*apiv1alpha4.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) - out.Conditions = *(*apiv1alpha4.Conditions)(unsafe.Pointer(&in.Conditions)) - out.FailureReason = (*errors.ClusterStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - return nil -} - -// Convert_v1beta1_NutanixClusterStatus_To_v1alpha4_NutanixClusterStatus is an autogenerated conversion function. -func Convert_v1beta1_NutanixClusterStatus_To_v1alpha4_NutanixClusterStatus(in *v1beta1.NutanixClusterStatus, out *NutanixClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta1_NutanixClusterStatus_To_v1alpha4_NutanixClusterStatus(in, out, s) -} - -func autoConvert_v1alpha4_NutanixFailureDomain_To_v1beta1_NutanixFailureDomain(in *NutanixFailureDomain, out *v1beta1.NutanixFailureDomain, s conversion.Scope) error { - out.Name = in.Name - if err := Convert_v1alpha4_NutanixResourceIdentifier_To_v1beta1_NutanixResourceIdentifier(&in.Cluster, &out.Cluster, s); err != nil { - return err - } - out.Subnets = *(*[]v1beta1.NutanixResourceIdentifier)(unsafe.Pointer(&in.Subnets)) - out.ControlPlane = in.ControlPlane - return nil -} - -// Convert_v1alpha4_NutanixFailureDomain_To_v1beta1_NutanixFailureDomain is an autogenerated conversion function. -func Convert_v1alpha4_NutanixFailureDomain_To_v1beta1_NutanixFailureDomain(in *NutanixFailureDomain, out *v1beta1.NutanixFailureDomain, s conversion.Scope) error { - return autoConvert_v1alpha4_NutanixFailureDomain_To_v1beta1_NutanixFailureDomain(in, out, s) -} - -func autoConvert_v1beta1_NutanixFailureDomain_To_v1alpha4_NutanixFailureDomain(in *v1beta1.NutanixFailureDomain, out *NutanixFailureDomain, s conversion.Scope) error { - out.Name = in.Name - if err := Convert_v1beta1_NutanixResourceIdentifier_To_v1alpha4_NutanixResourceIdentifier(&in.Cluster, &out.Cluster, s); err != nil { - return err - } - out.Subnets = *(*[]NutanixResourceIdentifier)(unsafe.Pointer(&in.Subnets)) - out.ControlPlane = in.ControlPlane - return nil -} - -// Convert_v1beta1_NutanixFailureDomain_To_v1alpha4_NutanixFailureDomain is an autogenerated conversion function. -func Convert_v1beta1_NutanixFailureDomain_To_v1alpha4_NutanixFailureDomain(in *v1beta1.NutanixFailureDomain, out *NutanixFailureDomain, s conversion.Scope) error { - return autoConvert_v1beta1_NutanixFailureDomain_To_v1alpha4_NutanixFailureDomain(in, out, s) -} - -func autoConvert_v1alpha4_NutanixMachine_To_v1beta1_NutanixMachine(in *NutanixMachine, out *v1beta1.NutanixMachine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_NutanixMachineSpec_To_v1beta1_NutanixMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_NutanixMachineStatus_To_v1beta1_NutanixMachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_NutanixMachine_To_v1beta1_NutanixMachine is an autogenerated conversion function. -func Convert_v1alpha4_NutanixMachine_To_v1beta1_NutanixMachine(in *NutanixMachine, out *v1beta1.NutanixMachine, s conversion.Scope) error { - return autoConvert_v1alpha4_NutanixMachine_To_v1beta1_NutanixMachine(in, out, s) -} - -func autoConvert_v1beta1_NutanixMachine_To_v1alpha4_NutanixMachine(in *v1beta1.NutanixMachine, out *NutanixMachine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_NutanixMachineSpec_To_v1alpha4_NutanixMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_NutanixMachineStatus_To_v1alpha4_NutanixMachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_NutanixMachine_To_v1alpha4_NutanixMachine is an autogenerated conversion function. -func Convert_v1beta1_NutanixMachine_To_v1alpha4_NutanixMachine(in *v1beta1.NutanixMachine, out *NutanixMachine, s conversion.Scope) error { - return autoConvert_v1beta1_NutanixMachine_To_v1alpha4_NutanixMachine(in, out, s) -} - -func autoConvert_v1alpha4_NutanixMachineList_To_v1beta1_NutanixMachineList(in *NutanixMachineList, out *v1beta1.NutanixMachineList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.NutanixMachine, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_NutanixMachine_To_v1beta1_NutanixMachine(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_NutanixMachineList_To_v1beta1_NutanixMachineList is an autogenerated conversion function. -func Convert_v1alpha4_NutanixMachineList_To_v1beta1_NutanixMachineList(in *NutanixMachineList, out *v1beta1.NutanixMachineList, s conversion.Scope) error { - return autoConvert_v1alpha4_NutanixMachineList_To_v1beta1_NutanixMachineList(in, out, s) -} - -func autoConvert_v1beta1_NutanixMachineList_To_v1alpha4_NutanixMachineList(in *v1beta1.NutanixMachineList, out *NutanixMachineList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NutanixMachine, len(*in)) - for i := range *in { - if err := Convert_v1beta1_NutanixMachine_To_v1alpha4_NutanixMachine(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_NutanixMachineList_To_v1alpha4_NutanixMachineList is an autogenerated conversion function. -func Convert_v1beta1_NutanixMachineList_To_v1alpha4_NutanixMachineList(in *v1beta1.NutanixMachineList, out *NutanixMachineList, s conversion.Scope) error { - return autoConvert_v1beta1_NutanixMachineList_To_v1alpha4_NutanixMachineList(in, out, s) -} - -func autoConvert_v1alpha4_NutanixMachineSpec_To_v1beta1_NutanixMachineSpec(in *NutanixMachineSpec, out *v1beta1.NutanixMachineSpec, s conversion.Scope) error { - out.ProviderID = in.ProviderID - out.VCPUsPerSocket = in.VCPUsPerSocket - out.VCPUSockets = in.VCPUSockets - out.MemorySize = in.MemorySize - if err := Convert_v1alpha4_NutanixResourceIdentifier_To_v1beta1_NutanixResourceIdentifier(&in.Image, &out.Image, s); err != nil { - return err - } - if err := Convert_v1alpha4_NutanixResourceIdentifier_To_v1beta1_NutanixResourceIdentifier(&in.Cluster, &out.Cluster, s); err != nil { - return err - } - out.Subnets = *(*[]v1beta1.NutanixResourceIdentifier)(unsafe.Pointer(&in.Subnets)) - out.AdditionalCategories = *(*[]v1beta1.NutanixCategoryIdentifier)(unsafe.Pointer(&in.AdditionalCategories)) - out.Project = (*v1beta1.NutanixResourceIdentifier)(unsafe.Pointer(in.Project)) - out.BootType = v1beta1.NutanixBootType(in.BootType) - out.SystemDiskSize = in.SystemDiskSize - out.BootstrapRef = (*v1.ObjectReference)(unsafe.Pointer(in.BootstrapRef)) - return nil -} - -func autoConvert_v1beta1_NutanixMachineSpec_To_v1alpha4_NutanixMachineSpec(in *v1beta1.NutanixMachineSpec, out *NutanixMachineSpec, s conversion.Scope) error { - out.ProviderID = in.ProviderID - out.VCPUsPerSocket = in.VCPUsPerSocket - out.VCPUSockets = in.VCPUSockets - out.MemorySize = in.MemorySize - if err := Convert_v1beta1_NutanixResourceIdentifier_To_v1alpha4_NutanixResourceIdentifier(&in.Image, &out.Image, s); err != nil { - return err - } - if err := Convert_v1beta1_NutanixResourceIdentifier_To_v1alpha4_NutanixResourceIdentifier(&in.Cluster, &out.Cluster, s); err != nil { - return err - } - out.Subnets = *(*[]NutanixResourceIdentifier)(unsafe.Pointer(&in.Subnets)) - out.AdditionalCategories = *(*[]NutanixCategoryIdentifier)(unsafe.Pointer(&in.AdditionalCategories)) - out.Project = (*NutanixResourceIdentifier)(unsafe.Pointer(in.Project)) - out.BootType = NutanixBootType(in.BootType) - out.SystemDiskSize = in.SystemDiskSize - out.BootstrapRef = (*v1.ObjectReference)(unsafe.Pointer(in.BootstrapRef)) - // WARNING: in.GPUs requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_NutanixMachineStatus_To_v1beta1_NutanixMachineStatus(in *NutanixMachineStatus, out *v1beta1.NutanixMachineStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Addresses = *(*[]apiv1beta1.MachineAddress)(unsafe.Pointer(&in.Addresses)) - out.VmUUID = in.VmUUID - out.NodeRef = (*v1.ObjectReference)(unsafe.Pointer(in.NodeRef)) - out.Conditions = *(*apiv1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - return nil -} - -func autoConvert_v1beta1_NutanixMachineStatus_To_v1alpha4_NutanixMachineStatus(in *v1beta1.NutanixMachineStatus, out *NutanixMachineStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Addresses = *(*[]apiv1alpha4.MachineAddress)(unsafe.Pointer(&in.Addresses)) - out.VmUUID = in.VmUUID - out.NodeRef = (*v1.ObjectReference)(unsafe.Pointer(in.NodeRef)) - out.Conditions = *(*apiv1alpha4.Conditions)(unsafe.Pointer(&in.Conditions)) - out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - return nil -} - -// Convert_v1beta1_NutanixMachineStatus_To_v1alpha4_NutanixMachineStatus is an autogenerated conversion function. -func Convert_v1beta1_NutanixMachineStatus_To_v1alpha4_NutanixMachineStatus(in *v1beta1.NutanixMachineStatus, out *NutanixMachineStatus, s conversion.Scope) error { - return autoConvert_v1beta1_NutanixMachineStatus_To_v1alpha4_NutanixMachineStatus(in, out, s) -} - -func autoConvert_v1alpha4_NutanixMachineTemplate_To_v1beta1_NutanixMachineTemplate(in *NutanixMachineTemplate, out *v1beta1.NutanixMachineTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_NutanixMachineTemplateSpec_To_v1beta1_NutanixMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_NutanixMachineTemplate_To_v1beta1_NutanixMachineTemplate is an autogenerated conversion function. -func Convert_v1alpha4_NutanixMachineTemplate_To_v1beta1_NutanixMachineTemplate(in *NutanixMachineTemplate, out *v1beta1.NutanixMachineTemplate, s conversion.Scope) error { - return autoConvert_v1alpha4_NutanixMachineTemplate_To_v1beta1_NutanixMachineTemplate(in, out, s) -} - -func autoConvert_v1beta1_NutanixMachineTemplate_To_v1alpha4_NutanixMachineTemplate(in *v1beta1.NutanixMachineTemplate, out *NutanixMachineTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_NutanixMachineTemplateSpec_To_v1alpha4_NutanixMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_NutanixMachineTemplate_To_v1alpha4_NutanixMachineTemplate is an autogenerated conversion function. -func Convert_v1beta1_NutanixMachineTemplate_To_v1alpha4_NutanixMachineTemplate(in *v1beta1.NutanixMachineTemplate, out *NutanixMachineTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_NutanixMachineTemplate_To_v1alpha4_NutanixMachineTemplate(in, out, s) -} - -func autoConvert_v1alpha4_NutanixMachineTemplateList_To_v1beta1_NutanixMachineTemplateList(in *NutanixMachineTemplateList, out *v1beta1.NutanixMachineTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.NutanixMachineTemplate, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_NutanixMachineTemplate_To_v1beta1_NutanixMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_NutanixMachineTemplateList_To_v1beta1_NutanixMachineTemplateList is an autogenerated conversion function. -func Convert_v1alpha4_NutanixMachineTemplateList_To_v1beta1_NutanixMachineTemplateList(in *NutanixMachineTemplateList, out *v1beta1.NutanixMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1alpha4_NutanixMachineTemplateList_To_v1beta1_NutanixMachineTemplateList(in, out, s) -} - -func autoConvert_v1beta1_NutanixMachineTemplateList_To_v1alpha4_NutanixMachineTemplateList(in *v1beta1.NutanixMachineTemplateList, out *NutanixMachineTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NutanixMachineTemplate, len(*in)) - for i := range *in { - if err := Convert_v1beta1_NutanixMachineTemplate_To_v1alpha4_NutanixMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_NutanixMachineTemplateList_To_v1alpha4_NutanixMachineTemplateList is an autogenerated conversion function. -func Convert_v1beta1_NutanixMachineTemplateList_To_v1alpha4_NutanixMachineTemplateList(in *v1beta1.NutanixMachineTemplateList, out *NutanixMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1beta1_NutanixMachineTemplateList_To_v1alpha4_NutanixMachineTemplateList(in, out, s) -} - -func autoConvert_v1alpha4_NutanixMachineTemplateResource_To_v1beta1_NutanixMachineTemplateResource(in *NutanixMachineTemplateResource, out *v1beta1.NutanixMachineTemplateResource, s conversion.Scope) error { - if err := Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1alpha4_NutanixMachineSpec_To_v1beta1_NutanixMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func autoConvert_v1beta1_NutanixMachineTemplateResource_To_v1alpha4_NutanixMachineTemplateResource(in *v1beta1.NutanixMachineTemplateResource, out *NutanixMachineTemplateResource, s conversion.Scope) error { - if err := Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - if err := Convert_v1beta1_NutanixMachineSpec_To_v1alpha4_NutanixMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha4_NutanixMachineTemplateSpec_To_v1beta1_NutanixMachineTemplateSpec(in *NutanixMachineTemplateSpec, out *v1beta1.NutanixMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_NutanixMachineTemplateResource_To_v1beta1_NutanixMachineTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_NutanixMachineTemplateSpec_To_v1beta1_NutanixMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha4_NutanixMachineTemplateSpec_To_v1beta1_NutanixMachineTemplateSpec(in *NutanixMachineTemplateSpec, out *v1beta1.NutanixMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_NutanixMachineTemplateSpec_To_v1beta1_NutanixMachineTemplateSpec(in, out, s) -} - -func autoConvert_v1beta1_NutanixMachineTemplateSpec_To_v1alpha4_NutanixMachineTemplateSpec(in *v1beta1.NutanixMachineTemplateSpec, out *NutanixMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta1_NutanixMachineTemplateResource_To_v1alpha4_NutanixMachineTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_NutanixMachineTemplateSpec_To_v1alpha4_NutanixMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1beta1_NutanixMachineTemplateSpec_To_v1alpha4_NutanixMachineTemplateSpec(in *v1beta1.NutanixMachineTemplateSpec, out *NutanixMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta1_NutanixMachineTemplateSpec_To_v1alpha4_NutanixMachineTemplateSpec(in, out, s) -} - -func autoConvert_v1alpha4_NutanixResourceIdentifier_To_v1beta1_NutanixResourceIdentifier(in *NutanixResourceIdentifier, out *v1beta1.NutanixResourceIdentifier, s conversion.Scope) error { - out.Type = v1beta1.NutanixIdentifierType(in.Type) - out.UUID = (*string)(unsafe.Pointer(in.UUID)) - out.Name = (*string)(unsafe.Pointer(in.Name)) - return nil -} - -// Convert_v1alpha4_NutanixResourceIdentifier_To_v1beta1_NutanixResourceIdentifier is an autogenerated conversion function. -func Convert_v1alpha4_NutanixResourceIdentifier_To_v1beta1_NutanixResourceIdentifier(in *NutanixResourceIdentifier, out *v1beta1.NutanixResourceIdentifier, s conversion.Scope) error { - return autoConvert_v1alpha4_NutanixResourceIdentifier_To_v1beta1_NutanixResourceIdentifier(in, out, s) -} - -func autoConvert_v1beta1_NutanixResourceIdentifier_To_v1alpha4_NutanixResourceIdentifier(in *v1beta1.NutanixResourceIdentifier, out *NutanixResourceIdentifier, s conversion.Scope) error { - out.Type = NutanixIdentifierType(in.Type) - out.UUID = (*string)(unsafe.Pointer(in.UUID)) - out.Name = (*string)(unsafe.Pointer(in.Name)) - return nil -} - -// Convert_v1beta1_NutanixResourceIdentifier_To_v1alpha4_NutanixResourceIdentifier is an autogenerated conversion function. -func Convert_v1beta1_NutanixResourceIdentifier_To_v1alpha4_NutanixResourceIdentifier(in *v1beta1.NutanixResourceIdentifier, out *NutanixResourceIdentifier, s conversion.Scope) error { - return autoConvert_v1beta1_NutanixResourceIdentifier_To_v1alpha4_NutanixResourceIdentifier(in, out, s) -} diff --git a/api/v1alpha4/zz_generated.deepcopy.go b/api/v1alpha4/zz_generated.deepcopy.go deleted file mode 100644 index 51a759a737..0000000000 --- a/api/v1alpha4/zz_generated.deepcopy.go +++ /dev/null @@ -1,451 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright 2022 Nutanix - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - "github.com/nutanix-cloud-native/prism-go-client/environment/credentials" - "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/runtime" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - "sigs.k8s.io/cluster-api/errors" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NutanixCategoryIdentifier) DeepCopyInto(out *NutanixCategoryIdentifier) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixCategoryIdentifier. -func (in *NutanixCategoryIdentifier) DeepCopy() *NutanixCategoryIdentifier { - if in == nil { - return nil - } - out := new(NutanixCategoryIdentifier) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NutanixCluster) DeepCopyInto(out *NutanixCluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixCluster. -func (in *NutanixCluster) DeepCopy() *NutanixCluster { - if in == nil { - return nil - } - out := new(NutanixCluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NutanixCluster) 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 *NutanixClusterList) DeepCopyInto(out *NutanixClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NutanixCluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixClusterList. -func (in *NutanixClusterList) DeepCopy() *NutanixClusterList { - if in == nil { - return nil - } - out := new(NutanixClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NutanixClusterList) 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 *NutanixClusterSpec) DeepCopyInto(out *NutanixClusterSpec) { - *out = *in - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if in.PrismCentral != nil { - in, out := &in.PrismCentral, &out.PrismCentral - *out = new(credentials.NutanixPrismEndpoint) - (*in).DeepCopyInto(*out) - } - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make([]NutanixFailureDomain, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixClusterSpec. -func (in *NutanixClusterSpec) DeepCopy() *NutanixClusterSpec { - if in == nil { - return nil - } - out := new(NutanixClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NutanixClusterStatus) DeepCopyInto(out *NutanixClusterStatus) { - *out = *in - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make(apiv1alpha4.FailureDomains, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1alpha4.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.ClusterStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixClusterStatus. -func (in *NutanixClusterStatus) DeepCopy() *NutanixClusterStatus { - if in == nil { - return nil - } - out := new(NutanixClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NutanixFailureDomain) DeepCopyInto(out *NutanixFailureDomain) { - *out = *in - in.Cluster.DeepCopyInto(&out.Cluster) - if in.Subnets != nil { - in, out := &in.Subnets, &out.Subnets - *out = make([]NutanixResourceIdentifier, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixFailureDomain. -func (in *NutanixFailureDomain) DeepCopy() *NutanixFailureDomain { - if in == nil { - return nil - } - out := new(NutanixFailureDomain) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NutanixMachine) DeepCopyInto(out *NutanixMachine) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixMachine. -func (in *NutanixMachine) DeepCopy() *NutanixMachine { - if in == nil { - return nil - } - out := new(NutanixMachine) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NutanixMachine) 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 *NutanixMachineList) DeepCopyInto(out *NutanixMachineList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NutanixMachine, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixMachineList. -func (in *NutanixMachineList) DeepCopy() *NutanixMachineList { - if in == nil { - return nil - } - out := new(NutanixMachineList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NutanixMachineList) 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 *NutanixMachineSpec) DeepCopyInto(out *NutanixMachineSpec) { - *out = *in - out.MemorySize = in.MemorySize.DeepCopy() - in.Image.DeepCopyInto(&out.Image) - in.Cluster.DeepCopyInto(&out.Cluster) - if in.Subnets != nil { - in, out := &in.Subnets, &out.Subnets - *out = make([]NutanixResourceIdentifier, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.AdditionalCategories != nil { - in, out := &in.AdditionalCategories, &out.AdditionalCategories - *out = make([]NutanixCategoryIdentifier, len(*in)) - copy(*out, *in) - } - if in.Project != nil { - in, out := &in.Project, &out.Project - *out = new(NutanixResourceIdentifier) - (*in).DeepCopyInto(*out) - } - out.SystemDiskSize = in.SystemDiskSize.DeepCopy() - if in.BootstrapRef != nil { - in, out := &in.BootstrapRef, &out.BootstrapRef - *out = new(v1.ObjectReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixMachineSpec. -func (in *NutanixMachineSpec) DeepCopy() *NutanixMachineSpec { - if in == nil { - return nil - } - out := new(NutanixMachineSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NutanixMachineStatus) DeepCopyInto(out *NutanixMachineStatus) { - *out = *in - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]apiv1alpha4.MachineAddress, len(*in)) - copy(*out, *in) - } - if in.NodeRef != nil { - in, out := &in.NodeRef, &out.NodeRef - *out = new(v1.ObjectReference) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1alpha4.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.MachineStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixMachineStatus. -func (in *NutanixMachineStatus) DeepCopy() *NutanixMachineStatus { - if in == nil { - return nil - } - out := new(NutanixMachineStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NutanixMachineTemplate) DeepCopyInto(out *NutanixMachineTemplate) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixMachineTemplate. -func (in *NutanixMachineTemplate) DeepCopy() *NutanixMachineTemplate { - if in == nil { - return nil - } - out := new(NutanixMachineTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NutanixMachineTemplate) 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 *NutanixMachineTemplateList) DeepCopyInto(out *NutanixMachineTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NutanixMachineTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixMachineTemplateList. -func (in *NutanixMachineTemplateList) DeepCopy() *NutanixMachineTemplateList { - if in == nil { - return nil - } - out := new(NutanixMachineTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NutanixMachineTemplateList) 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 *NutanixMachineTemplateResource) DeepCopyInto(out *NutanixMachineTemplateResource) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixMachineTemplateResource. -func (in *NutanixMachineTemplateResource) DeepCopy() *NutanixMachineTemplateResource { - if in == nil { - return nil - } - out := new(NutanixMachineTemplateResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NutanixMachineTemplateSpec) DeepCopyInto(out *NutanixMachineTemplateSpec) { - *out = *in - in.Template.DeepCopyInto(&out.Template) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixMachineTemplateSpec. -func (in *NutanixMachineTemplateSpec) DeepCopy() *NutanixMachineTemplateSpec { - if in == nil { - return nil - } - out := new(NutanixMachineTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NutanixResourceIdentifier) DeepCopyInto(out *NutanixResourceIdentifier) { - *out = *in - if in.UUID != nil { - in, out := &in.UUID, &out.UUID - *out = new(string) - **out = **in - } - if in.Name != nil { - in, out := &in.Name, &out.Name - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NutanixResourceIdentifier. -func (in *NutanixResourceIdentifier) DeepCopy() *NutanixResourceIdentifier { - if in == nil { - return nil - } - out := new(NutanixResourceIdentifier) - in.DeepCopyInto(out) - return out -} diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixclusters.yaml index 94f8337278..799c782995 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixclusters.yaml @@ -18,295 +18,6 @@ spec: singular: nutanixcluster scope: Namespaced versions: - - additionalPrinterColumns: - - description: ControlplaneEndpoint - jsonPath: .spec.controlPlaneEndpoint.host - name: ControlplaneEndpoint - type: string - - description: in ready status - jsonPath: .status.ready - name: Ready - type: string - deprecated: true - deprecationWarning: v1alpha4 NutanixCluster is deprecated and marked as unserved. - It will be removed in a future release. Use v1beta1 NutanixCluster instead. - name: v1alpha4 - schema: - openAPIV3Schema: - description: NutanixCluster is the Schema for the nutanixclusters API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: NutanixClusterSpec defines the desired state of NutanixCluster - properties: - controlPlaneEndpoint: - description: ControlPlaneEndpoint represents the endpoint used to - communicate with the control plane. host can be either DNS name - or ip address - properties: - host: - description: The hostname on which the API server is serving. - type: string - port: - description: The port on which the API server is serving. - format: int32 - type: integer - required: - - host - - port - type: object - failureDomains: - description: failureDomains configures failure domains information - for the Nutanix platform. When set, the failure domains defined - here may be used to spread Machines across prism element clusters - to improve fault tolerance of the cluster. - items: - description: NutanixFailureDomain configures failure domain information - for Nutanix. - properties: - cluster: - description: cluster is to identify the cluster (the Prism Element - under management of the Prism Central), in which the Machine's - VM will be created. The cluster identifier (uuid or name) - can be obtained from the Prism Central console or using the - prism_central API. - properties: - name: - description: name is the resource name in the PC - type: string - type: - description: Type is the identifier type to use for this - resource. - enum: - - uuid - - name - type: string - uuid: - description: uuid is the UUID of the resource in the PC. - type: string - required: - - type - type: object - controlPlane: - description: indicates if a failure domain is suited for control - plane nodes - type: boolean - name: - description: name defines the unique name of a failure domain. - Name is required and must be at most 64 characters in length. - It must consist of only lower case alphanumeric characters - and hyphens (-). It must start and end with an alphanumeric - character. This value is arbitrary and is used to identify - the failure domain within the platform. - maxLength: 64 - minLength: 1 - pattern: '[a-z0-9]([-a-z0-9]*[a-z0-9])?' - type: string - subnets: - description: subnets holds a list of identifiers (one or more) - of the cluster's network subnets for the Machine's VM to connect - to. The subnet identifiers (uuid or name) can be obtained - from the Prism Central console or using the prism_central - API. - items: - description: NutanixResourceIdentifier holds the identity - of a Nutanix PC resource (cluster, image, subnet, etc.) - properties: - name: - description: name is the resource name in the PC - type: string - type: - description: Type is the identifier type to use for this - resource. - enum: - - uuid - - name - type: string - uuid: - description: uuid is the UUID of the resource in the PC. - type: string - required: - - type - type: object - minItems: 1 - type: array - x-kubernetes-list-map-keys: - - type - x-kubernetes-list-type: map - required: - - cluster - - name - - subnets - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - prismCentral: - description: prismCentral holds the endpoint address and port to access - the Nutanix Prism Central. When a cluster-wide proxy is installed, - by default, this endpoint will be accessed via the proxy. Should - you wish for communication with this endpoint not to be proxied, - please add the endpoint to the proxy spec.noProxy list. - properties: - additionalTrustBundle: - description: AdditionalTrustBundle is a PEM encoded x509 cert - for the RootCA that was used to create the certificate for a - Prism Central that uses certificates that were issued by a non-publicly - trusted RootCA. The trust bundle is added to the cert pool used - to authenticate the TLS connection to the Prism Central. - properties: - data: - description: Data of the trust bundle if Kind is String. - type: string - kind: - description: Kind of the Nutanix trust bundle - enum: - - String - - ConfigMap - type: string - name: - description: Name of the credential. - type: string - namespace: - description: namespace of the credential. - type: string - required: - - kind - type: object - address: - description: address is the endpoint address (DNS name or IP address) - of the Nutanix Prism Central or Element (cluster) - maxLength: 256 - type: string - credentialRef: - description: Pass credential information for the target Prism - instance - properties: - kind: - description: Kind of the Nutanix credential - enum: - - Secret - type: string - name: - description: Name of the credential. - minLength: 1 - type: string - namespace: - description: namespace of the credential. - type: string - required: - - kind - - name - type: object - insecure: - default: false - description: use insecure connection to Prism endpoint - type: boolean - port: - default: 9440 - description: port is the port number to access the Nutanix Prism - Central or Element (cluster) - format: int32 - maximum: 65535 - minimum: 1 - type: integer - required: - - address - - port - type: object - type: object - status: - description: NutanixClusterStatus defines the observed state of NutanixCluster - properties: - conditions: - description: Conditions defines current service state of the NutanixCluster. - items: - description: Condition defines an observation of a Cluster API resource - operational state. - properties: - lastTransitionTime: - description: Last time the condition transitioned from one status - to another. This should be when the underlying condition changed. - If that is not known, then using the time when the API field - changed is acceptable. - format: date-time - type: string - message: - description: A human readable message indicating details about - the transition. This field may be empty. - type: string - reason: - description: The reason for the condition's last transition - in CamelCase. The specific API may choose whether or not this - field is considered a guaranteed API. This field may not be - empty. - type: string - severity: - description: Severity provides an explicit classification of - Reason code, so the users or machines can immediately understand - the current situation and act accordingly. The Severity field - MUST be set only when Status=False. - type: string - status: - description: Status of the condition, one of True, False, Unknown. - type: string - type: - description: Type of condition in CamelCase or in foo.example.com/CamelCase. - Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. - type: string - required: - - status - - type - type: object - type: array - failureDomains: - additionalProperties: - description: FailureDomainSpec is the Schema for Cluster API failure - domains. It allows controllers to understand how many failure - domains a cluster can optionally span across. - properties: - attributes: - additionalProperties: - type: string - description: Attributes is a free form map of attributes an - infrastructure provider might use or require. - type: object - controlPlane: - description: ControlPlane determines if this failure domain - is suitable for use by control plane machines. - type: boolean - type: object - description: FailureDomains is a slice of FailureDomains. - type: object - failureMessage: - description: Will be set in case of failure of Cluster instance - type: string - failureReason: - description: Will be set in case of failure of Cluster instance - type: string - ready: - type: boolean - type: object - type: object - served: false - storage: false - subresources: - status: {} - additionalPrinterColumns: - description: ControlplaneEndpoint jsonPath: .spec.controlPlaneEndpoint.host diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixmachines.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixmachines.yaml index 140a70b4ca..7218cece13 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixmachines.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixmachines.yaml @@ -18,346 +18,6 @@ spec: singular: nutanixmachine scope: Namespaced versions: - - additionalPrinterColumns: - - description: The VM address - jsonPath: .status.addresses[0].address - name: Address - type: string - - description: NutanixMachine ready status - jsonPath: .status.ready - name: Ready - type: string - - description: NutanixMachine instance ID - jsonPath: .spec.providerID - name: ProviderID - type: string - deprecated: true - deprecationWarning: v1alpha4 NutanixMachine is deprecated and marked as unserved. - It will be removed in a future release. Use v1beta1 NutanixMachine instead. - name: v1alpha4 - schema: - openAPIV3Schema: - description: NutanixMachine is the Schema for the nutanixmachines API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: NutanixMachineSpec defines the desired state of NutanixMachine - properties: - additionalCategories: - description: List of categories that need to be added to the machines. - Categories must already exist in Prism Central - items: - properties: - key: - description: key is the Key of category in PC. - type: string - value: - description: value is the category value linked to the category - key in PC - type: string - type: object - type: array - bootType: - description: Defines the boot type of the virtual machine. Only supports - UEFI and Legacy - enum: - - legacy - - uefi - type: string - bootstrapRef: - description: BootstrapRef is a reference to a bootstrap provider-specific - resource that holds configuration details. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: 'If referring to a piece of an object instead of - an entire object, this string should contain a valid JSON/Go - field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within - a pod, this would take on a value like: "spec.containers{name}" - (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" - (container with index 2 in this pod). This syntax is chosen - only to have some well-defined way of referencing a part of - an object. TODO: this design is not final and this field is - subject to change in the future.' - type: string - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' - type: string - resourceVersion: - description: 'Specific resourceVersion to which this reference - is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' - type: string - uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' - type: string - type: object - x-kubernetes-map-type: atomic - cluster: - description: cluster is to identify the cluster (the Prism Element - under management of the Prism Central), in which the Machine's VM - will be created. The cluster identifier (uuid or name) can be obtained - from the Prism Central console or using the prism_central API. - properties: - name: - description: name is the resource name in the PC - type: string - type: - description: Type is the identifier type to use for this resource. - enum: - - uuid - - name - type: string - uuid: - description: uuid is the UUID of the resource in the PC. - type: string - required: - - type - type: object - image: - description: image is to identify the rhcos image uploaded to the - Prism Central (PC) The image identifier (uuid or name) can be obtained - from the Prism Central console or using the prism_central API. - properties: - name: - description: name is the resource name in the PC - type: string - type: - description: Type is the identifier type to use for this resource. - enum: - - uuid - - name - type: string - uuid: - description: uuid is the UUID of the resource in the PC. - type: string - required: - - type - type: object - memorySize: - anyOf: - - type: integer - - type: string - description: memorySize is the memory size (in Quantity format) of - the VM The minimum memorySize is 2Gi bytes - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - project: - description: Add the machine resources to a Prism Central project - properties: - name: - description: name is the resource name in the PC - type: string - type: - description: Type is the identifier type to use for this resource. - enum: - - uuid - - name - type: string - uuid: - description: uuid is the UUID of the resource in the PC. - type: string - required: - - type - type: object - providerID: - type: string - subnet: - description: subnet is to identify the cluster's network subnet to - use for the Machine's VM The cluster identifier (uuid or name) can - be obtained from the Prism Central console or using the prism_central - API. - items: - description: NutanixResourceIdentifier holds the identity of a Nutanix - PC resource (cluster, image, subnet, etc.) - properties: - name: - description: name is the resource name in the PC - type: string - type: - description: Type is the identifier type to use for this resource. - enum: - - uuid - - name - type: string - uuid: - description: uuid is the UUID of the resource in the PC. - type: string - required: - - type - type: object - type: array - systemDiskSize: - anyOf: - - type: integer - - type: string - description: systemDiskSize is size (in Quantity format) of the system - disk of the VM The minimum systemDiskSize is 20Gi bytes - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - vcpuSockets: - description: vcpuSockets is the number of vCPU sockets of the VM - format: int32 - minimum: 1 - type: integer - vcpusPerSocket: - description: vcpusPerSocket is the number of vCPUs per socket of the - VM - format: int32 - minimum: 1 - type: integer - required: - - image - - memorySize - - providerID - - systemDiskSize - - vcpuSockets - - vcpusPerSocket - type: object - status: - description: NutanixMachineStatus defines the observed state of NutanixMachine - properties: - addresses: - description: Addresses contains the Nutanix VM associated addresses. - Address type is one of Hostname, ExternalIP, InternalIP, ExternalDNS, - InternalDNS - items: - description: MachineAddress contains information for the node's - address. - properties: - address: - description: The machine address. - type: string - type: - description: Machine address type, one of Hostname, ExternalIP - or InternalIP. - type: string - required: - - address - - type - type: object - type: array - conditions: - description: Conditions defines current service state of the NutanixMachine. - items: - description: Condition defines an observation of a Cluster API resource - operational state. - properties: - lastTransitionTime: - description: Last time the condition transitioned from one status - to another. This should be when the underlying condition changed. - If that is not known, then using the time when the API field - changed is acceptable. - format: date-time - type: string - message: - description: A human readable message indicating details about - the transition. This field may be empty. - type: string - reason: - description: The reason for the condition's last transition - in CamelCase. The specific API may choose whether or not this - field is considered a guaranteed API. This field may not be - empty. - type: string - severity: - description: Severity provides an explicit classification of - Reason code, so the users or machines can immediately understand - the current situation and act accordingly. The Severity field - MUST be set only when Status=False. - type: string - status: - description: Status of the condition, one of True, False, Unknown. - type: string - type: - description: Type of condition in CamelCase or in foo.example.com/CamelCase. - Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. - type: string - required: - - status - - type - type: object - type: array - failureMessage: - description: Will be set in case of failure of Machine instance - type: string - failureReason: - description: Will be set in case of failure of Machine instance - type: string - nodeRef: - description: 'NodeRef is a reference to the corresponding workload - cluster Node if it exists. Deprecated: Do not use. Will be removed - in a future release.' - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: 'If referring to a piece of an object instead of - an entire object, this string should contain a valid JSON/Go - field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container within - a pod, this would take on a value like: "spec.containers{name}" - (where "name" refers to the name of the container that triggered - the event) or if no container name is specified "spec.containers[2]" - (container with index 2 in this pod). This syntax is chosen - only to have some well-defined way of referencing a part of - an object. TODO: this design is not final and this field is - subject to change in the future.' - type: string - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' - type: string - resourceVersion: - description: 'Specific resourceVersion to which this reference - is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' - type: string - uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' - type: string - type: object - x-kubernetes-map-type: atomic - ready: - description: Ready is true when the provider resource is ready. - type: boolean - vmUUID: - description: The Nutanix VM's UUID - type: string - type: object - type: object - served: false - storage: false - subresources: - status: {} - additionalPrinterColumns: - description: The VM address jsonPath: .status.addresses[0].address diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixmachinetemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixmachinetemplates.yaml index 3906913338..53e0a18c9a 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixmachinetemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_nutanixmachinetemplates.yaml @@ -18,256 +18,6 @@ spec: singular: nutanixmachinetemplate scope: Namespaced versions: - - name: v1alpha4 - schema: - openAPIV3Schema: - description: NutanixMachineTemplate is the Schema for the nutanixmachinetemplates - API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: NutanixMachineTemplateSpec defines the desired state of NutanixMachineTemplate - properties: - template: - description: NutanixMachineTemplateResource describes the data needed - to create a NutanixMachine from a template - properties: - metadata: - description: 'Standard object metadata. Ref: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' - properties: - annotations: - additionalProperties: - type: string - description: 'Annotations is an unstructured key value map - stored with a resource that may be set by external tools - to store and retrieve arbitrary metadata. They are not queryable - and should be preserved when modifying objects. More info: - http://kubernetes.io/docs/user-guide/annotations' - type: object - labels: - additionalProperties: - type: string - description: 'Map of string keys and values that can be used - to organize and categorize (scope and select) objects. May - match selectors of replication controllers and services. - More info: http://kubernetes.io/docs/user-guide/labels' - type: object - type: object - spec: - description: Spec is the specification of the desired behavior - of the machine. - properties: - additionalCategories: - description: List of categories that need to be added to the - machines. Categories must already exist in Prism Central - items: - properties: - key: - description: key is the Key of category in PC. - type: string - value: - description: value is the category value linked to the - category key in PC - type: string - type: object - type: array - bootType: - description: Defines the boot type of the virtual machine. - Only supports UEFI and Legacy - enum: - - legacy - - uefi - type: string - bootstrapRef: - description: BootstrapRef is a reference to a bootstrap provider-specific - resource that holds configuration details. - properties: - apiVersion: - description: API version of the referent. - type: string - fieldPath: - description: 'If referring to a piece of an object instead - of an entire object, this string should contain a valid - JSON/Go field access statement, such as desiredState.manifest.containers[2]. - For example, if the object reference is to a container - within a pod, this would take on a value like: "spec.containers{name}" - (where "name" refers to the name of the container that - triggered the event) or if no container name is specified - "spec.containers[2]" (container with index 2 in this - pod). This syntax is chosen only to have some well-defined - way of referencing a part of an object. TODO: this design - is not final and this field is subject to change in - the future.' - type: string - kind: - description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' - type: string - namespace: - description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/' - type: string - resourceVersion: - description: 'Specific resourceVersion to which this reference - is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency' - type: string - uid: - description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids' - type: string - type: object - x-kubernetes-map-type: atomic - cluster: - description: cluster is to identify the cluster (the Prism - Element under management of the Prism Central), in which - the Machine's VM will be created. The cluster identifier - (uuid or name) can be obtained from the Prism Central console - or using the prism_central API. - properties: - name: - description: name is the resource name in the PC - type: string - type: - description: Type is the identifier type to use for this - resource. - enum: - - uuid - - name - type: string - uuid: - description: uuid is the UUID of the resource in the PC. - type: string - required: - - type - type: object - image: - description: image is to identify the rhcos image uploaded - to the Prism Central (PC) The image identifier (uuid or - name) can be obtained from the Prism Central console or - using the prism_central API. - properties: - name: - description: name is the resource name in the PC - type: string - type: - description: Type is the identifier type to use for this - resource. - enum: - - uuid - - name - type: string - uuid: - description: uuid is the UUID of the resource in the PC. - type: string - required: - - type - type: object - memorySize: - anyOf: - - type: integer - - type: string - description: memorySize is the memory size (in Quantity format) - of the VM The minimum memorySize is 2Gi bytes - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - project: - description: Add the machine resources to a Prism Central - project - properties: - name: - description: name is the resource name in the PC - type: string - type: - description: Type is the identifier type to use for this - resource. - enum: - - uuid - - name - type: string - uuid: - description: uuid is the UUID of the resource in the PC. - type: string - required: - - type - type: object - providerID: - type: string - subnet: - description: subnet is to identify the cluster's network subnet - to use for the Machine's VM The cluster identifier (uuid - or name) can be obtained from the Prism Central console - or using the prism_central API. - items: - description: NutanixResourceIdentifier holds the identity - of a Nutanix PC resource (cluster, image, subnet, etc.) - properties: - name: - description: name is the resource name in the PC - type: string - type: - description: Type is the identifier type to use for - this resource. - enum: - - uuid - - name - type: string - uuid: - description: uuid is the UUID of the resource in the - PC. - type: string - required: - - type - type: object - type: array - systemDiskSize: - anyOf: - - type: integer - - type: string - description: systemDiskSize is size (in Quantity format) of - the system disk of the VM The minimum systemDiskSize is - 20Gi bytes - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - vcpuSockets: - description: vcpuSockets is the number of vCPU sockets of - the VM - format: int32 - minimum: 1 - type: integer - vcpusPerSocket: - description: vcpusPerSocket is the number of vCPUs per socket - of the VM - format: int32 - minimum: 1 - type: integer - required: - - image - - memorySize - - providerID - - systemDiskSize - - vcpuSockets - - vcpusPerSocket - type: object - required: - - spec - type: object - required: - - template - type: object - type: object - served: true - storage: false - name: v1beta1 schema: openAPIV3Schema: diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 2a3f943747..c0638a1027 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -48,12 +48,6 @@ patches: - format: hostname - format: ipv4 - format: ipv6 - - op: add - path: /spec/versions/1/schema/openAPIV3Schema/properties/spec/properties/prismCentral/properties/address/anyOf - value: - - format: hostname - - format: ipv4 - - format: ipv6 target: group: apiextensions.k8s.io kind: CustomResourceDefinition diff --git a/main.go b/main.go index 8d076515ed..aeba641ff7 100644 --- a/main.go +++ b/main.go @@ -46,7 +46,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" "sigs.k8s.io/controller-runtime/pkg/manager" - infrav1alpha4 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1alpha4" //nolint:staticcheck // deprecated package; will be removed in one of the next releases infrav1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1" "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/controllers" //+kubebuilder:scaffold:imports @@ -61,7 +60,6 @@ func init() { utilruntime.Must(clientgoscheme.AddToScheme(scheme)) utilruntime.Must(capiv1.AddToScheme(scheme)) utilruntime.Must(bootstrapv1.AddToScheme(scheme)) - utilruntime.Must(infrav1alpha4.AddToScheme(scheme)) utilruntime.Must(infrav1.AddToScheme(scheme)) //+kubebuilder:scaffold:scheme } diff --git a/test/e2e/config/nutanix.yaml b/test/e2e/config/nutanix.yaml index 19623822aa..be3b09c300 100644 --- a/test/e2e/config/nutanix.yaml +++ b/test/e2e/config/nutanix.yaml @@ -212,8 +212,6 @@ variables: # the management cluster to be upgraded. # NOTE: We test the latest release with a previous contract. INIT_WITH_BINARY: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.6.2/clusterctl-{OS}-{ARCH}" - #INIT_WITH_BINARY_V1ALPHA4: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.7/clusterctl-{OS}-{ARCH}" - #INIT_WITH_PROVIDERS_CONTRACT: "v1alpha4" INIT_WITH_KUBERNETES_VERSION: "v1.29.6" intervals: diff --git a/test/e2e/data/infrastructure-nutanix/v1alpha4/bases/cluster-with-kcp.yaml b/test/e2e/data/infrastructure-nutanix/v1alpha4/bases/cluster-with-kcp.yaml deleted file mode 100644 index 2128a70d15..0000000000 --- a/test/e2e/data/infrastructure-nutanix/v1alpha4/bases/cluster-with-kcp.yaml +++ /dev/null @@ -1,237 +0,0 @@ -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: NutanixCluster -metadata: - name: "${CLUSTER_NAME}" - namespace: "${NAMESPACE}" -spec: - prismCentral: - address: "${NUTANIX_ENDPOINT}" - port: ${NUTANIX_PORT=9440} - insecure: ${NUTANIX_INSECURE=false} - credentialRef: - name: "${CLUSTER_NAME}" - kind: Secret - controlPlaneEndpoint: - host: "${CONTROL_PLANE_ENDPOINT_IP}" - port: ${CONTROL_PLANE_ENDPOINT_PORT=6443} ---- -apiVersion: v1 -kind: Secret -metadata: - name: "${CLUSTER_NAME}" - namespace: "${NAMESPACE}" -stringData: - credentials: | - [ - { - "type": "basic_auth", - "data": { - "prismCentral":{ - "username": "${NUTANIX_USER}", - "password": "${NUTANIX_PASSWORD}" - } - } - } - ] - ---- -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: Cluster -metadata: - labels: - cluster.x-k8s.io/cluster-name: "${CLUSTER_NAME}" - name: "${CLUSTER_NAME}" - namespace: "${NAMESPACE}" -spec: - clusterNetwork: - services: - cidrBlocks: ["172.19.0.0/16"] - pods: - cidrBlocks: ["172.20.0.0/16"] - serviceDomain: "cluster.local" - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 - kind: KubeadmControlPlane - name: "${CLUSTER_NAME}-kcp" - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: NutanixCluster - name: "${CLUSTER_NAME}" - ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: NutanixMachineTemplate -metadata: - name: "${CLUSTER_NAME}-mt-0" - namespace: "${NAMESPACE}" -spec: - template: - spec: - providerID: "nutanix://${CLUSTER_NAME}-m1" - # Supported options for boot type: legacy and uefi - # Defaults to legacy if not set - bootType: ${NUTANIX_MACHINE_BOOT_TYPE=legacy} - vcpusPerSocket: ${NUTANIX_MACHINE_VCPU_PER_SOCKET=1} - vcpuSockets: ${NUTANIX_MACHINE_VCPU_SOCKET=2} - memorySize: "${NUTANIX_MACHINE_MEMORY_SIZE=4Gi}" - systemDiskSize: "${NUTANIX_SYSTEMDISK_SIZE=40Gi}" - image: - type: name - name: "${NUTANIX_MACHINE_TEMPLATE_IMAGE_NAME}" - cluster: - type: name - name: "${NUTANIX_PRISM_ELEMENT_CLUSTER_NAME}" - subnet: - - type: name - name: "${NUTANIX_SUBNET_NAME}" - # Adds additional categories to the virtual machines. - # Note: Categories must already be present in Prism Central - # additionalCategories: - # - key: AppType - # value: Kubernetes - # Adds the cluster virtual machines to a project defined in Prism Central. - # Replace NUTANIX_PROJECT_NAME with the correct project defined in Prism Central - # Note: Project must already be present in Prism Central. - # project: - # type: name - # name: "NUTANIX_PROJECT_NAME" - ---- -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 -kind: KubeadmControlPlane -metadata: - name: "${CLUSTER_NAME}-kcp" - namespace: "${NAMESPACE}" -spec: - replicas: ${CONTROL_PLANE_MACHINE_COUNT=1} - version: ${KUBERNETES_VERSION} - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: NutanixMachineTemplate - name: "${CLUSTER_NAME}-mt-0" - kubeadmConfigSpec: - clusterConfiguration: - apiServer: - certSANs: - - localhost - - 127.0.0.1 - - 0.0.0.0 - controllerManager: - extraArgs: - enable-hostpath-provisioner: "true" - files: - - content: | - apiVersion: v1 - kind: Pod - metadata: - name: kube-vip - namespace: kube-system - spec: - containers: - - name: kube-vip - image: ghcr.io/kube-vip/kube-vip:v0.5.0 - imagePullPolicy: IfNotPresent - args: - - manager - env: - - name: vip_arp - value: "true" - - name: address - value: "${CONTROL_PLANE_ENDPOINT_IP}" - - name: port - value: "${CONTROL_PLANE_ENDPOINT_PORT=6443}" - - name: vip_cidr - value: "32" - - name: cp_enable - value: "true" - - name: cp_namespace - value: kube-system - - name: vip_ddns - value: "false" - - name: vip_leaderelection - value: "true" - - name: vip_leaseduration - value: "15" - - name: vip_renewdeadline - value: "10" - - name: vip_retryperiod - value: "2" - - name: svc_enable - value: "${KUBEVIP_SVC_ENABLE=false}" - - name: lb_enable - value: "${KUBEVIP_LB_ENABLE=false}" - securityContext: - capabilities: - add: - - NET_ADMIN - - SYS_TIME - - NET_RAW - volumeMounts: - - mountPath: /etc/kubernetes/admin.conf - name: kubeconfig - resources: {} - hostNetwork: true - hostAliases: - - hostnames: - - kubernetes - ip: 127.0.0.1 - volumes: - - name: kubeconfig - hostPath: - type: FileOrCreate - path: /etc/kubernetes/admin.conf - status: {} - owner: root:root - path: /etc/kubernetes/manifests/kube-vip.yaml - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - # We have to pin the cgroupDriver to cgroupfs as kubeadm >=1.21 defaults to systemd - # kind will implement systemd support in: https://github.com/kubernetes-sigs/kind/issues/1726 - #cgroup-driver: cgroupfs - eviction-hard: nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<15%,memory.available<100Mi,imagefs.inodesFree<10% - users: - - name: capiuser - lockPassword: false - sudo: ALL=(ALL) NOPASSWD:ALL - sshAuthorizedKeys: - - ${NUTANIX_SSH_AUTHORIZED_KEY} - preKubeadmCommands: - - echo "before kubeadm call" > /var/log/prekubeadm.log - - hostnamectl set-hostname "{{ ds.meta_data.hostname }}" - postKubeadmCommands: - - echo export KUBECONFIG=/etc/kubernetes/admin.conf >> /root/.bashrc - - echo "after kubeadm call" > /var/log/postkubeadm.log - useExperimentalRetryJoin: true - verbosity: 10 - ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 -kind: KubeadmConfigTemplate -metadata: - name: "${CLUSTER_NAME}-kcfg-0" - namespace: "${NAMESPACE}" -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - # We have to pin the cgroupDriver to cgroupfs as kubeadm >=1.21 defaults to systemd - # kind will implement systemd support in: https://github.com/kubernetes-sigs/kind/issues/1726 - #cgroup-driver: cgroupfs - eviction-hard: nodefs.available<10%,nodefs.inodesFree<5%,imagefs.available<15%,memory.available<100Mi,imagefs.inodesFree<10% - users: - - name: capiuser - lockPassword: false - sudo: ALL=(ALL) NOPASSWD:ALL - sshAuthorizedKeys: - - ${NUTANIX_SSH_AUTHORIZED_KEY} - preKubeadmCommands: - - echo "before kubeadm call" > /var/log/prekubeadm.log - - hostnamectl set-hostname "{{ ds.meta_data.hostname }}" - postKubeadmCommands: - - echo "after kubeadm call" > /var/log/postkubeadm.log - verbosity: 10 - #useExperimentalRetryJoin: true diff --git a/test/e2e/data/infrastructure-nutanix/v1alpha4/bases/cm.yaml b/test/e2e/data/infrastructure-nutanix/v1alpha4/bases/cm.yaml deleted file mode 100644 index a7332f1690..0000000000 --- a/test/e2e/data/infrastructure-nutanix/v1alpha4/bases/cm.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: ${CLUSTER_NAME}-pc-trusted-ca-bundle - namespace: "${NAMESPACE}" -data: - ca.crt: "${NUTANIX_ADDITIONAL_TRUST_BUNDLE=''}" diff --git a/test/e2e/data/infrastructure-nutanix/v1alpha4/bases/md.yaml b/test/e2e/data/infrastructure-nutanix/v1alpha4/bases/md.yaml deleted file mode 100644 index 45ce7fbd23..0000000000 --- a/test/e2e/data/infrastructure-nutanix/v1alpha4/bases/md.yaml +++ /dev/null @@ -1,28 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachineDeployment -metadata: - labels: - cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME} - name: "${CLUSTER_NAME}-wmd" - namespace: "${NAMESPACE}" -spec: - clusterName: "${CLUSTER_NAME}" - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: {} - template: - metadata: - labels: - cluster.x-k8s.io/cluster-name: "${CLUSTER_NAME}" - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 - kind: KubeadmConfigTemplate - name: "${CLUSTER_NAME}-kcfg-0" - clusterName: "${CLUSTER_NAME}" - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: NutanixMachineTemplate - name: "${CLUSTER_NAME}-mt-0" - version: "${KUBERNETES_VERSION}" diff --git a/test/e2e/data/infrastructure-nutanix/v1alpha4/bases/mhc.yaml b/test/e2e/data/infrastructure-nutanix/v1alpha4/bases/mhc.yaml deleted file mode 100644 index d671cb3e39..0000000000 --- a/test/e2e/data/infrastructure-nutanix/v1alpha4/bases/mhc.yaml +++ /dev/null @@ -1,31 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachineHealthCheck -metadata: - name: "${CLUSTER_NAME}-mhc" - namespace: "${NAMESPACE}" -spec: - clusterName: "${CLUSTER_NAME}" - maxUnhealthy: 40% - nodeStartupTimeout: 10m - selector: - matchLabels: - cluster.x-k8s.io/cluster-name: "${CLUSTER_NAME}" - unhealthyConditions: - - type: Ready - status: "False" - timeout: 300s - - type: Ready - status: Unknown - timeout: 300s - - type: MemoryPressure - status: "True" - timeout: 300s - - type: DiskPressure - status: "True" - timeout: 300s - - type: PIDPressure - status: "True" - timeout: 300s - - type: NetworkUnavailable - status: "True" - timeout: 300s diff --git a/test/e2e/data/infrastructure-nutanix/v1alpha4/cluster-template/kustomization.yaml b/test/e2e/data/infrastructure-nutanix/v1alpha4/cluster-template/kustomization.yaml deleted file mode 100644 index 50bd8e586e..0000000000 --- a/test/e2e/data/infrastructure-nutanix/v1alpha4/cluster-template/kustomization.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: -- ../bases/cluster-with-kcp.yaml -- ../bases/md.yaml -- ../bases/mhc.yaml -- ../bases/cm.yaml diff --git a/test/e2e/data/infrastructure-nutanix/v1alpha4/no-kubeproxy/cluster-template/kustomization.yaml b/test/e2e/data/infrastructure-nutanix/v1alpha4/no-kubeproxy/cluster-template/kustomization.yaml deleted file mode 100644 index cb903e9635..0000000000 --- a/test/e2e/data/infrastructure-nutanix/v1alpha4/no-kubeproxy/cluster-template/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: -- ../../cluster-template/ -patches: -- path: ../no-kubeproxy.yaml diff --git a/test/e2e/data/infrastructure-nutanix/v1alpha4/no-kubeproxy/no-kubeproxy.yaml b/test/e2e/data/infrastructure-nutanix/v1alpha4/no-kubeproxy/no-kubeproxy.yaml deleted file mode 100644 index ba5b499816..0000000000 --- a/test/e2e/data/infrastructure-nutanix/v1alpha4/no-kubeproxy/no-kubeproxy.yaml +++ /dev/null @@ -1,23 +0,0 @@ ---- -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 -kind: KubeadmControlPlane -metadata: - name: "${CLUSTER_NAME}-kcp" - namespace: "${NAMESPACE}" -spec: - kubeadmConfigSpec: - initConfiguration: - skipPhases: - - addon/kube-proxy ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 -kind: KubeadmConfigTemplate -metadata: - name: "${CLUSTER_NAME}-kcfg-0" - namespace: "${NAMESPACE}" -spec: - template: - spec: - initConfiguration: - skipPhases: - - addon/kube-proxy