Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] ClusterClass support in CAPX #334

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
16e67be
created scaffolding for go/v4
deepakm-ntnx Nov 21, 2023
a60f330
upgrade client-go and gingko to remove cve
deepakm-ntnx Nov 22, 2023
6cafa44
updated location of new layout folder
deepakm-ntnx Nov 22, 2023
0d64077
updated go.sum
deepakm-ntnx Nov 22, 2023
ecbe3ba
[WIP] added NutanixClusterTemplate API
deepakm-ntnx Nov 22, 2023
ea672f4
WIP clusterclass changes
deepakm-ntnx Nov 21, 2023
544e2be
added generated template file
deepakm-ntnx Nov 22, 2023
133068f
fixed docker-build`
deepakm-ntnx Nov 22, 2023
0d03986
upgraded kustomize to latest
deepakm-ntnx Nov 22, 2023
6eb8304
reorg of existing controllers to new gov4 format
deepakm-ntnx Nov 27, 2023
ee8a325
fixed the kustomize yamls with latest version
deepakm-ntnx Nov 27, 2023
14cf676
added webhook for NutanixClusterTemplate
deepakm-ntnx Nov 27, 2023
9c92eaf
added webhooks to make clusterclass work
deepakm-ntnx Nov 29, 2023
513551a
enabled webhook
deepakm-ntnx Nov 29, 2023
618b868
merged latest main
deepakm-ntnx Nov 29, 2023
1604859
upgraded controller-gen to fix creationTimestamp issue
deepakm-ntnx Nov 30, 2023
133d541
added webhook for nutanixmachinetemplate
deepakm-ntnx Dec 1, 2023
e7e812f
corrected kubebuilder annotations
deepakm-ntnx Dec 1, 2023
180a1eb
fixed the stack overflow issue
deepakm-ntnx Dec 4, 2023
5691e64
merged latest master changes to this branch
deepakm-ntnx Dec 6, 2023
ea91bc2
now webhooks are working
deepakm-ntnx Dec 7, 2023
24decba
added missing failureDomain in the template
deepakm-ntnx Dec 7, 2023
9cfc372
fixed the paths in newer tests after rebasing with master
deepakm-ntnx Dec 7, 2023
7293c11
test fixes
deepakm-ntnx Dec 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 50 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ PLATFORMS_E2E ?= linux/amd64
KIND_CLUSTER_NAME ?= capi-test

# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.23
ENVTEST_K8S_VERSION = 1.28.0

#
# Directories.
Expand Down Expand Up @@ -66,9 +66,9 @@ KO := $(abspath $(TOOLS_BIN_DIR)/$(KO_BIN)-$(KO_VER))
KO_PKG := github.com/google/ko

KUSTOMIZE_BIN := kustomize
KUSTOMIZE_VER := v4.5.4
KUSTOMIZE_VER := v5.2.1
KUSTOMIZE := $(abspath $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)-$(KUSTOMIZE_VER))
KUSTOMIZE_PKG := sigs.k8s.io/kustomize/kustomize/v4
KUSTOMIZE_PKG := sigs.k8s.io/kustomize/kustomize/v5

GINGKO_VER := v2.1.4
GINKGO_BIN := ginkgo
Expand All @@ -80,7 +80,7 @@ SETUP_ENVTEST_BIN := setup-envtest
SETUP_ENVTEST := $(abspath $(TOOLS_BIN_DIR)/$(SETUP_ENVTEST_BIN)-$(SETUP_ENVTEST_VER))
SETUP_ENVTEST_PKG := sigs.k8s.io/controller-runtime/tools/setup-envtest

CONTROLLER_GEN_VER := v0.8.0
CONTROLLER_GEN_VER := v0.13.0
CONTROLLER_GEN_BIN := controller-gen
CONTROLLER_GEN := $(abspath $(TOOLS_BIN_DIR)/$(CONTROLLER_GEN_BIN)-$(CONTROLLER_GEN_VER))
CONTROLLER_GEN_PKG := sigs.k8s.io/controller-tools/cmd/controller-gen
Expand Down Expand Up @@ -210,8 +210,8 @@ generate: controller-gen conversion-gen ## Generate code containing DeepCopy, De
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."

$(CONVERSION_GEN) \
--input-dirs=./api/v1alpha4 \
--input-dirs=./api/v1beta1 \
--input-dirs=./api/infrastructure/v1alpha4 \
--input-dirs=./api/infrastructure/v1beta1 \
--build-tag=ignore_autogenerated_core \
--output-file-base=zz_generated.conversion \
--go-header-file=./hack/boilerplate.go.txt
Expand All @@ -235,25 +235,25 @@ kind-delete: ## Delete the kind cluster
.PHONY: build
build: generate fmt ## Build manager binary.
GIT_COMMIT_HASH=`git rev-parse HEAD` && \
go build -ldflags "-X main.gitCommitHash=$${GIT_COMMIT_HASH}" -o bin/manager main.go
go build -ldflags "-X main.gitCommitHash=$${GIT_COMMIT_HASH}" -o bin/manager cmd/main.go

.PHONY: run
run: manifests generate fmt vet ## Run a controller from your host.
go run ./main.go
go run cmd/main.go

.PHONY: docker-build
docker-build: $(KO) ## Build docker image with the manager.
GIT_COMMIT_HASH=`git rev-parse HEAD` && \
KO_DOCKER_REPO=ko.local GOFLAGS="-ldflags=-X=main.gitCommitHash=$${GIT_COMMIT_HASH}" $(KO) build -B --platform=${PLATFORMS} -t ${IMG_TAG} -L .
KO_DOCKER_REPO=ko.local GOFLAGS="-ldflags=-X=main.gitCommitHash=$${GIT_COMMIT_HASH}" $(KO) build -B --platform=${PLATFORMS} -t ${IMG_TAG} -L ./cmd

.PHONY: docker-push
docker-push: $(KO) ## Push docker image with the manager.
KO_DOCKER_REPO=${IMG_REPO} $(KO) build --bare --platform=${PLATFORMS} -t ${IMG_TAG} .
KO_DOCKER_REPO=${IMG_REPO} $(KO) build --bare --platform=${PLATFORMS} -t ${IMG_TAG} ./cmd

.PHONY: docker-push-kind
docker-push-kind: $(KO) ## Make docker image available to kind cluster.
GOOS=linux GOARCH=${shell go env GOARCH} KO_DOCKER_REPO=ko.local ${KO} build -B -t ${IMG_TAG} -L .
docker tag ko.local/cluster-api-provider-nutanix:${IMG_TAG} ${IMG}
GOOS=linux GOARCH=${shell go env GOARCH} KO_DOCKER_REPO=ko.local ${KO} build -B -t ${IMG_TAG} -L ./cmd
docker tag ko.local/cmd:${IMG_TAG} ${IMG}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy paste mistake.

kind load docker-image --name ${KIND_CLUSTER_NAME} ${IMG}

##@ Deployment
Expand All @@ -272,7 +272,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
$(KUSTOMIZE) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found) -f -

.PHONY: deploy
deploy: manifests kustomize docker-push-kind ## Deploy controller to the K8s cluster specified in ~/.kube/config.
deploy: manifests kustomize docker-push-kind prepare-local-clusterctl ## Deploy controller to the K8s cluster specified in ~/.kube/config.
clusterctl delete --infrastructure nutanix:${LOCAL_PROVIDER_VERSION} --include-crd || true
clusterctl init --infrastructure nutanix:${LOCAL_PROVIDER_VERSION} -v 9
# cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
Expand Down Expand Up @@ -328,14 +328,15 @@ cluster-templates: $(KUSTOMIZE) ## Generate cluster templates for all flavors
$(KUSTOMIZE) build $(TEMPLATES_DIR)/base > $(TEMPLATES_DIR)/cluster-template.yaml
$(KUSTOMIZE) build $(TEMPLATES_DIR)/csi > $(TEMPLATES_DIR)/cluster-template-csi.yaml
$(KUSTOMIZE) build $(TEMPLATES_DIR)/ccm > $(TEMPLATES_DIR)/cluster-template-ccm.yaml
$(KUSTOMIZE) build $(TEMPLATES_DIR)/clusterclass > $(TEMPLATES_DIR)/cluster-template-clusterclass.yaml

##@ Testing

.PHONY: docker-build-e2e
docker-build-e2e: $(KO) ## Build docker image with the manager with e2e tag.
GIT_COMMIT_HASH=`git rev-parse HEAD` && \
KO_DOCKER_REPO=ko.local GOFLAGS="-ldflags=-X=main.gitCommitHash=$${GIT_COMMIT_HASH}" $(KO) build -B --platform=${PLATFORMS_E2E} -t e2e -L .
docker tag ko.local/cluster-api-provider-nutanix:e2e ${IMG_REPO}:e2e
KO_DOCKER_REPO=ko.local GOFLAGS="-ldflags=-X=main.gitCommitHash=$${GIT_COMMIT_HASH}" $(KO) build -B --platform=${PLATFORMS_E2E} -t e2e -L ./cmd
docker tag ko.local/cmd:e2e ${IMG_REPO}:e2e
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy paste mistake


.PHONY: prepare-local-clusterctl
prepare-local-clusterctl: manifests kustomize cluster-templates ## Prepare overide file for local clusterctl.
Expand Down Expand Up @@ -392,6 +393,35 @@ test-kubectl-workload: ## Run kubectl queries to get all capx workload related o
kubectl -n ${TEST_NAMESPACE} get secret ${TEST_CLUSTER_NAME}-kubeconfig -o json | jq -r .data.value | base64 --decode > ${TEST_CLUSTER_NAME}.workload.kubeconfig
kubectl --kubeconfig ./${TEST_CLUSTER_NAME}.workload.kubeconfig get nodes,ns

.PHONY: test-clusterclass-create
test-clusterclass-create: cluster-templates
clusterctl generate cluster ccls-test1 --from ./templates/cluster-template-clusterclass.yaml -n $(TEST_NAMESPACE) > ccls-test1.yaml
kubectl create ns $(TEST_NAMESPACE) || true
kubectl apply -f ./ccls-test1.yaml

.PHONY: test-clusterclass-delete
test-clusterclass-delete:
kubectl -n $(TEST_NAMESPACE) delete cluster ccls-test1 || true
kubectl -n $(TEST_NAMESPACE) delete nutanixcluster ccls-test1 || true
kubectl -n $(TEST_NAMESPACE) delete clusterclass my-test-cluster-template || true
kubectl -n $(TEST_NAMESPACE) delete nutanixmachinetemplate my-test-cluster-template-cp-nmt || true
kubectl -n $(TEST_NAMESPACE) delete nutanixmachinetemplate my-test-cluster-template-md-nmt || true
kubectl -n $(TEST_NAMESPACE) delete KubeadmConfigTemplate my-test-cluster-template-md-kcfgt || true
kubectl -n $(TEST_NAMESPACE) delete kubeadmcontrolplanetemplate my-test-cluster-template-kcpt || true
kubectl -n $(TEST_NAMESPACE) delete NutanixClustertemplate my-test-cluster-template-nct || true
# kubectl -n $(TEST_NAMESPACE) delete secret ccls-test1
kubectl -n $(TEST_NAMESPACE) delete cm user-ca-bundle
rm ccls-test1.yaml || true


.PHONY: test-kubectl-clusterclass
test-kubectl-clusterclass:
kubectl -n capx-system get endpoints
kubectl -n $(TEST_NAMESPACE) get cluster,machine,MachineDeployment
kubectl -n $(TEST_NAMESPACE) get NutanixCluster,NutanixMachine -n $(TEST_NAMESPACE)
kubectl -n $(TEST_NAMESPACE) get NutanixClusterTemplate,clusterclass,KubeadmConfigTemplate,KubeadmControlPlaneTemplate,NutanixMachineTemplate,secret,configmap -n $(TEST_NAMESPACE)
kubectl -n $(TEST_NAMESPACE) get ValidatingWebhookConfiguration,MutatingWebhookConfiguration

.PHONY: ginkgo-help
ginkgo-help:
$(GINKGO) help run
Expand Down Expand Up @@ -513,7 +543,11 @@ $(KO): # Build ko from tools folder.
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(KO_PKG) $(KO_BIN) $(KO_VER)

$(KUSTOMIZE): # Build kustomize from tools folder.
GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(KUSTOMIZE_PKG) $(KUSTOMIZE_BIN) $(KUSTOMIZE_VER)
@if test -x $(KUSTOMIZE) && ! $(KUSTOMIZE) version | grep -q $(KUSTOMIZE_VERSION); then \
echo "$(KUSTOMIZE) version is not expected $(KUSTOMIZE_VERSION). Removing it before installing."; \
rm -rf $(KUSTOMIZE); \
fi
test -s $(KUSTOMIZE) || GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(KUSTOMIZE_PKG) $(KUSTOMIZE_BIN) $(KUSTOMIZE_VER)

.PHONY: $(KO_BIN)
$(KO_BIN): $(KO) ## Build a local copy of ko
Expand Down
60 changes: 56 additions & 4 deletions PROJECT
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Code generated by tool. DO NOT EDIT.
# This file is used to track the info used to scaffold your project
# and allow the plugins properly work.
# More info: https://book.kubebuilder.io/reference/project-config.html
domain: cluster.x-k8s.io
layout:
- go.kubebuilder.io/v3
- go.kubebuilder.io/v4
multigroup: true
projectName: cluster-api-provider-nutanix
repo: github.com/nutanix-cloud-native/cluster-api-provider-nutanix
resources:
Expand All @@ -11,23 +16,70 @@ resources:
domain: cluster.x-k8s.io
group: infrastructure
kind: NutanixCluster
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1alpha4
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1alpha4
version: v1alpha4
- api:
crdVersion: v1
namespaced: true
controller: true
domain: cluster.x-k8s.io
group: infrastructure
kind: NutanixCluster
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1beta1
version: v1beta1
webhooks:
defaulting: true
validation: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: cluster.x-k8s.io
group: infrastructure
kind: NutanixMachine
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1alpha4
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1alpha4
version: v1alpha4
- api:
crdVersion: v1
namespaced: true
controller: true
domain: cluster.x-k8s.io
group: infrastructure
kind: NutanixMachine
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/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
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1alpha4
version: v1alpha4
- 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/infrastructure/v1beta1
version: v1beta1
webhooks:
defaulting: true
validation: true
webhookVersion: v1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: cluster.x-k8s.io
group: infrastructure
kind: NutanixClusterTemplate
path: github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1beta1
version: v1beta1
webhooks:
defaulting: true
validation: true
webhookVersion: v1
version: "3"
File renamed without changes.
2 changes: 1 addition & 1 deletion api/v1alpha4/doc.go → api/infrastructure/v1alpha4/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ limitations under the License.
// 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
// +k8s:conversion-gen=github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1beta1
package v1alpha4
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package v1alpha4

import (
infrav1beta1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1"
infrav1beta1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1beta1"
apiconversion "k8s.io/apimachinery/pkg/conversion"
capiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4"
capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
Expand Down Expand Up @@ -54,7 +54,7 @@ func (dst *NutanixClusterList) ConvertFrom(srcRaw conversion.Hub) error { //noli
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
return Convert_v1alpha4_NutanixClusterSpec_To_v1beta1_NutanixClusterSpec(in, out, s)
return autoConvert_v1alpha4_NutanixClusterSpec_To_v1beta1_NutanixClusterSpec(in, out, s)
}

// Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint converts APIEndpoint in NutanixClusterResource from v1alpha4 to v1beta1 version.
Expand All @@ -63,7 +63,7 @@ func Convert_v1alpha4_NutanixClusterSpec_To_v1beta1_NutanixClusterSpec(in *Nutan
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
return Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in, out, s)
return capiv1alpha4.Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in, out, s)
}

// Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint converts APIEndpoint in NutanixClusterResource from v1alpha4 to v1beta1 version.
Expand All @@ -72,7 +72,7 @@ func Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in *capiv1alpha4.APIEnd
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
return Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in, out, s)
return capiv1alpha4.Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in, out, s)
}

// Convert_v1beta1_NutanixClusterSpec_To_v1alpha4_NutanixClusterSpec converts NutanixClusterSpec in NutanixClusterResource from v1beta1 to v1alpha4 version.
Expand All @@ -81,7 +81,7 @@ func Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in *capiv1beta1.APIEndp
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
return Convert_v1beta1_NutanixClusterSpec_To_v1alpha4_NutanixClusterSpec(in, out, s)
return autoConvert_v1beta1_NutanixClusterSpec_To_v1alpha4_NutanixClusterSpec(in, out, s)
}

// Convert_v1alpha4_NutanixClusterStatus_To_v1beta1_NutanixClusterStatus converts NutanixClusterStatus in NutanixClusterResource from v1alpha4 to v1beta1 version.
Expand All @@ -90,5 +90,5 @@ func Convert_v1beta1_NutanixClusterSpec_To_v1alpha4_NutanixClusterSpec(in *infra
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
return Convert_v1alpha4_NutanixClusterStatus_To_v1beta1_NutanixClusterStatus(in, out, s)
return autoConvert_v1alpha4_NutanixClusterStatus_To_v1beta1_NutanixClusterStatus(in, out, s)
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package v1alpha4

import (
infrav1beta1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1"
infrav1beta1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1beta1"
apiconversion "k8s.io/apimachinery/pkg/conversion"
"sigs.k8s.io/controller-runtime/pkg/conversion"
)
Expand Down Expand Up @@ -52,7 +52,7 @@ func (dst *NutanixMachineList) ConvertFrom(srcRaw conversion.Hub) error { // nol
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
return Convert_v1alpha4_NutanixMachineSpec_To_v1beta1_NutanixMachineSpec(in, out, s)
return autoConvert_v1alpha4_NutanixMachineSpec_To_v1beta1_NutanixMachineSpec(in, out, s)
}

// Convert_v1beta1_NutanixMachineSpec_To_v1alpha4_NutanixMachineSpec converts NutanixMachineSpec in NutanixMachineResource from v1alpha4 to v1beta1 version.
Expand All @@ -61,7 +61,7 @@ func Convert_v1alpha4_NutanixMachineSpec_To_v1beta1_NutanixMachineSpec(in *Nutan
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
return Convert_v1beta1_NutanixMachineSpec_To_v1alpha4_NutanixMachineSpec(in, out, s)
return autoConvert_v1beta1_NutanixMachineSpec_To_v1alpha4_NutanixMachineSpec(in, out, s)
}

// Convert_v1alpha4_NutanixMachineStatus_To_v1beta1_NutanixMachineStatus converts NutanixMachineStatus in NutanixMachineResource from v1alpha4 to v1beta1 version.
Expand All @@ -70,5 +70,5 @@ func Convert_v1beta1_NutanixMachineSpec_To_v1alpha4_NutanixMachineSpec(in *infra
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
return Convert_v1alpha4_NutanixMachineStatus_To_v1beta1_NutanixMachineStatus(in, out, s)
return autoConvert_v1alpha4_NutanixMachineStatus_To_v1beta1_NutanixMachineStatus(in, out, s)
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package v1alpha4

import (
infrav1beta1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/v1beta1"
infrav1beta1 "github.com/nutanix-cloud-native/cluster-api-provider-nutanix/api/infrastructure/v1beta1"
apiconversion "k8s.io/apimachinery/pkg/conversion"
capiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4"
capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
Expand Down Expand Up @@ -82,7 +82,7 @@ func Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in *capiv1beta1.ObjectMet
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
return Convert_v1alpha4_NutanixMachineTemplateResource_To_v1beta1_NutanixMachineTemplateResource(in, out, s)
return autoConvert_v1alpha4_NutanixMachineTemplateResource_To_v1beta1_NutanixMachineTemplateResource(in, out, s)
}

// Convert_v1beta1_NutanixMachineTemplateResource_To_v1alpha4_NutanixMachineTemplateResource converts NutanixMachineTemplateResource in NutanixMachineTemplateResource from v1beta1 to v1alpha4 version.
Expand All @@ -91,5 +91,5 @@ func Convert_v1alpha4_NutanixMachineTemplateResource_To_v1beta1_NutanixMachineTe
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
return Convert_v1beta1_NutanixMachineTemplateResource_To_v1alpha4_NutanixMachineTemplateResource(in, out, s)
return autoConvert_v1beta1_NutanixMachineTemplateResource_To_v1alpha4_NutanixMachineTemplateResource(in, out, s)
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading