From de4b6521117ad5a473548c3388112d8af8209566 Mon Sep 17 00:00:00 2001 From: killianmuldoon Date: Mon, 1 Jan 2024 16:11:31 +0000 Subject: [PATCH] Remove v1alpha4 apiVersions Signed-off-by: killianmuldoon --- .golangci.yml | 17 - CONTRIBUTING.md | 12 +- Makefile | 36 - api/v1alpha4/cluster_phase_types.go | 55 - api/v1alpha4/cluster_types.go | 440 ---- api/v1alpha4/cluster_types_test.go | 197 -- api/v1alpha4/clusterclass_types.go | 138 -- api/v1alpha4/common_types.go | 191 -- api/v1alpha4/condition_consts.go | 253 --- api/v1alpha4/condition_types.go | 97 - api/v1alpha4/conversion.go | 392 ---- api/v1alpha4/conversion_test.go | 148 -- api/v1alpha4/doc.go | 21 - api/v1alpha4/groupversion_info.go | 48 - api/v1alpha4/machine_phase_types.go | 64 - api/v1alpha4/machine_types.go | 282 --- api/v1alpha4/machinedeployment_types.go | 320 --- api/v1alpha4/machinehealthcheck_types.go | 175 -- api/v1alpha4/machineset_types.go | 243 --- api/v1alpha4/zz_generated.conversion.go | 1861 ----------------- api/v1alpha4/zz_generated.deepcopy.go | 1257 ----------- .../kubeadm/api/v1alpha4/condition_consts.go | 61 - bootstrap/kubeadm/api/v1alpha4/conversion.go | 222 -- .../kubeadm/api/v1alpha4/conversion_test.go | 73 - bootstrap/kubeadm/api/v1alpha4/doc.go | 21 - .../kubeadm/api/v1alpha4/groupversion_info.go | 48 - .../kubeadm/api/v1alpha4/kubeadm_types.go | 502 ----- .../api/v1alpha4/kubeadm_types_test.go | 188 -- .../api/v1alpha4/kubeadmconfig_types.go | 337 --- .../v1alpha4/kubeadmconfigtemplate_types.go | 62 - .../api/v1alpha4/zz_generated.conversion.go | 1540 -------------- .../api/v1alpha4/zz_generated.deepcopy.go | 1041 --------- ...strap.cluster.x-k8s.io_kubeadmconfigs.yaml | 1006 --------- ...uster.x-k8s.io_kubeadmconfigtemplates.yaml | 971 --------- .../kubeadm/config/crd/kustomization.yaml | 1 - bootstrap/kubeadm/main.go | 2 - .../client/cluster/inventory_test.go | 4 +- cmd/clusterctl/client/upgrade.go | 15 +- cmd/clusterctl/internal/test/contracts.go | 3 +- ...r.x-k8s.io_clusterresourcesetbindings.yaml | 96 - ....cluster.x-k8s.io_clusterresourcesets.yaml | 173 -- .../cluster.x-k8s.io_clusterclasses.yaml | 405 ---- .../crd/bases/cluster.x-k8s.io_clusters.yaml | 413 ---- .../cluster.x-k8s.io_machinedeployments.yaml | 497 ----- .../cluster.x-k8s.io_machinehealthchecks.yaml | 290 --- .../bases/cluster.x-k8s.io_machinepools.yaml | 433 ---- .../crd/bases/cluster.x-k8s.io_machines.yaml | 444 ---- .../bases/cluster.x-k8s.io_machinesets.yaml | 423 ---- .../kubeadm/api/v1alpha4/condition_consts.go | 151 -- .../kubeadm/api/v1alpha4/conversion.go | 293 --- .../kubeadm/api/v1alpha4/conversion_test.go | 89 - controlplane/kubeadm/api/v1alpha4/doc.go | 21 - .../kubeadm/api/v1alpha4/groupversion_info.go | 48 - .../v1alpha4/kubeadm_control_plane_types.go | 249 --- .../kubeadmcontrolplanetemplate_types.go | 62 - .../api/v1alpha4/zz_generated.conversion.go | 512 ----- .../api/v1alpha4/zz_generated.deepcopy.go | 302 --- ...cluster.x-k8s.io_kubeadmcontrolplanes.yaml | 1243 ----------- ...x-k8s.io_kubeadmcontrolplanetemplates.yaml | 1129 ---------- .../kubeadm/config/crd/kustomization.yaml | 1 - controlplane/kubeadm/main.go | 2 - docs/book/src/introduction.md | 13 - .../experimental-features/machine-pools.md | 11 - .../tasks/upgrading-cluster-api-versions.md | 15 - .../api/v1alpha4/clusterresourceset_types.go | 145 -- .../clusterresourcesetbinding_types.go | 142 -- .../clusterresourcesetbinding_types_test.go | 158 -- exp/addons/api/v1alpha4/condition_consts.go | 42 - exp/addons/api/v1alpha4/conversion.go | 97 - exp/addons/api/v1alpha4/conversion_test.go | 35 - exp/addons/api/v1alpha4/doc.go | 21 - exp/addons/api/v1alpha4/groupversion_info.go | 47 - .../api/v1alpha4/zz_generated.conversion.go | 441 ---- .../api/v1alpha4/zz_generated.deepcopy.go | 269 --- exp/api/v1alpha4/condition_consts.go | 30 - exp/api/v1alpha4/conversion.go | 62 - exp/api/v1alpha4/conversion_test.go | 34 - exp/api/v1alpha4/doc.go | 21 - exp/api/v1alpha4/groupversion_info.go | 48 - exp/api/v1alpha4/machinepool_types.go | 247 --- exp/api/v1alpha4/zz_generated.conversion.go | 254 --- exp/api/v1alpha4/zz_generated.deepcopy.go | 160 -- internal/runtime/test/v1alpha1/conversion.go | 10 - internal/runtime/test/v1alpha1/fake_types.go | 8 +- .../test/v1alpha1/zz_generated.conversion.go | 20 +- main.go | 6 - metadata.yaml | 3 - test/e2e/clusterctl_upgrade.go | 78 - .../clusterctl/clusterctl_helpers.go | 5 +- .../docker/api/v1alpha4/condition_consts.go | 81 - .../docker/api/v1alpha4/conversion.go | 230 -- .../docker/api/v1alpha4/conversion_test.go | 46 - .../infrastructure/docker/api/v1alpha4/doc.go | 21 - .../api/v1alpha4/dockercluster_types.go | 136 -- .../v1alpha4/dockerclustertemplate_types.go | 62 - .../api/v1alpha4/dockermachine_types.go | 135 -- .../v1alpha4/dockermachinetemplate_types.go | 63 - .../docker/api/v1alpha4/groupversion_info.go | 48 - .../api/v1alpha4/zz_generated.conversion.go | 916 -------- .../api/v1alpha4/zz_generated.deepcopy.go | 495 ----- ...cture.cluster.x-k8s.io_dockerclusters.yaml | 168 -- ...uster.x-k8s.io_dockerclustertemplates.yaml | 107 - ...e.cluster.x-k8s.io_dockermachinepools.yaml | 198 -- ...cture.cluster.x-k8s.io_dockermachines.yaml | 161 -- ...uster.x-k8s.io_dockermachinetemplates.yaml | 98 - .../docker/config/crd/kustomization.yaml | 1 - .../docker/exp/api/v1alpha4/conversion.go | 71 - .../exp/api/v1alpha4/conversion_test.go | 31 - .../docker/exp/api/v1alpha4/doc.go | 21 - .../api/v1alpha4/dockermachinepool_types.go | 155 -- .../exp/api/v1alpha4/groupversion_info.go | 48 - .../api/v1alpha4/zz_generated.conversion.go | 344 --- .../exp/api/v1alpha4/zz_generated.deepcopy.go | 191 -- test/infrastructure/docker/main.go | 4 - 114 files changed, 16 insertions(+), 25857 deletions(-) delete mode 100644 api/v1alpha4/cluster_phase_types.go delete mode 100644 api/v1alpha4/cluster_types.go delete mode 100644 api/v1alpha4/cluster_types_test.go delete mode 100644 api/v1alpha4/clusterclass_types.go delete mode 100644 api/v1alpha4/common_types.go delete mode 100644 api/v1alpha4/condition_consts.go delete mode 100644 api/v1alpha4/condition_types.go delete mode 100644 api/v1alpha4/conversion.go delete mode 100644 api/v1alpha4/conversion_test.go delete mode 100644 api/v1alpha4/doc.go delete mode 100644 api/v1alpha4/groupversion_info.go delete mode 100644 api/v1alpha4/machine_phase_types.go delete mode 100644 api/v1alpha4/machine_types.go delete mode 100644 api/v1alpha4/machinedeployment_types.go delete mode 100644 api/v1alpha4/machinehealthcheck_types.go delete mode 100644 api/v1alpha4/machineset_types.go delete mode 100644 api/v1alpha4/zz_generated.conversion.go delete mode 100644 api/v1alpha4/zz_generated.deepcopy.go delete mode 100644 bootstrap/kubeadm/api/v1alpha4/condition_consts.go delete mode 100644 bootstrap/kubeadm/api/v1alpha4/conversion.go delete mode 100644 bootstrap/kubeadm/api/v1alpha4/conversion_test.go delete mode 100644 bootstrap/kubeadm/api/v1alpha4/doc.go delete mode 100644 bootstrap/kubeadm/api/v1alpha4/groupversion_info.go delete mode 100644 bootstrap/kubeadm/api/v1alpha4/kubeadm_types.go delete mode 100644 bootstrap/kubeadm/api/v1alpha4/kubeadm_types_test.go delete mode 100644 bootstrap/kubeadm/api/v1alpha4/kubeadmconfig_types.go delete mode 100644 bootstrap/kubeadm/api/v1alpha4/kubeadmconfigtemplate_types.go delete mode 100644 bootstrap/kubeadm/api/v1alpha4/zz_generated.conversion.go delete mode 100644 bootstrap/kubeadm/api/v1alpha4/zz_generated.deepcopy.go delete mode 100644 controlplane/kubeadm/api/v1alpha4/condition_consts.go delete mode 100644 controlplane/kubeadm/api/v1alpha4/conversion.go delete mode 100644 controlplane/kubeadm/api/v1alpha4/conversion_test.go delete mode 100644 controlplane/kubeadm/api/v1alpha4/doc.go delete mode 100644 controlplane/kubeadm/api/v1alpha4/groupversion_info.go delete mode 100644 controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go delete mode 100644 controlplane/kubeadm/api/v1alpha4/kubeadmcontrolplanetemplate_types.go delete mode 100644 controlplane/kubeadm/api/v1alpha4/zz_generated.conversion.go delete mode 100644 controlplane/kubeadm/api/v1alpha4/zz_generated.deepcopy.go delete mode 100644 exp/addons/api/v1alpha4/clusterresourceset_types.go delete mode 100644 exp/addons/api/v1alpha4/clusterresourcesetbinding_types.go delete mode 100644 exp/addons/api/v1alpha4/clusterresourcesetbinding_types_test.go delete mode 100644 exp/addons/api/v1alpha4/condition_consts.go delete mode 100644 exp/addons/api/v1alpha4/conversion.go delete mode 100644 exp/addons/api/v1alpha4/conversion_test.go delete mode 100644 exp/addons/api/v1alpha4/doc.go delete mode 100644 exp/addons/api/v1alpha4/groupversion_info.go delete mode 100644 exp/addons/api/v1alpha4/zz_generated.conversion.go delete mode 100644 exp/addons/api/v1alpha4/zz_generated.deepcopy.go delete mode 100644 exp/api/v1alpha4/condition_consts.go delete mode 100644 exp/api/v1alpha4/conversion.go delete mode 100644 exp/api/v1alpha4/conversion_test.go delete mode 100644 exp/api/v1alpha4/doc.go delete mode 100644 exp/api/v1alpha4/groupversion_info.go delete mode 100644 exp/api/v1alpha4/machinepool_types.go delete mode 100644 exp/api/v1alpha4/zz_generated.conversion.go delete mode 100644 exp/api/v1alpha4/zz_generated.deepcopy.go delete mode 100644 test/infrastructure/docker/api/v1alpha4/condition_consts.go delete mode 100644 test/infrastructure/docker/api/v1alpha4/conversion.go delete mode 100644 test/infrastructure/docker/api/v1alpha4/conversion_test.go delete mode 100644 test/infrastructure/docker/api/v1alpha4/doc.go delete mode 100644 test/infrastructure/docker/api/v1alpha4/dockercluster_types.go delete mode 100644 test/infrastructure/docker/api/v1alpha4/dockerclustertemplate_types.go delete mode 100644 test/infrastructure/docker/api/v1alpha4/dockermachine_types.go delete mode 100644 test/infrastructure/docker/api/v1alpha4/dockermachinetemplate_types.go delete mode 100644 test/infrastructure/docker/api/v1alpha4/groupversion_info.go delete mode 100644 test/infrastructure/docker/api/v1alpha4/zz_generated.conversion.go delete mode 100644 test/infrastructure/docker/api/v1alpha4/zz_generated.deepcopy.go delete mode 100644 test/infrastructure/docker/exp/api/v1alpha4/conversion.go delete mode 100644 test/infrastructure/docker/exp/api/v1alpha4/conversion_test.go delete mode 100644 test/infrastructure/docker/exp/api/v1alpha4/doc.go delete mode 100644 test/infrastructure/docker/exp/api/v1alpha4/dockermachinepool_types.go delete mode 100644 test/infrastructure/docker/exp/api/v1alpha4/groupversion_info.go delete mode 100644 test/infrastructure/docker/exp/api/v1alpha4/zz_generated.conversion.go delete mode 100644 test/infrastructure/docker/exp/api/v1alpha4/zz_generated.deepcopy.go diff --git a/.golangci.yml b/.golangci.yml index 67ab574a49e2..a36f1d17d6f8 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -115,28 +115,18 @@ linters-settings: - pkg: sigs.k8s.io/controller-runtime alias: ctrl # CABPK - - pkg: sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4 - alias: bootstrapv1alpha4 - pkg: sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1 alias: bootstrapv1 # KCP - - pkg: sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4 - alias: controlplanev1alpha4 - pkg: sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1 alias: controlplanev1 # CAPI - - pkg: sigs.k8s.io/cluster-api/api/v1alpha4 - alias: clusterv1alpha4 - pkg: sigs.k8s.io/cluster-api/api/v1beta1 alias: clusterv1 # CAPI exp - - pkg: sigs.k8s.io/cluster-api/exp/api/v1alpha4 - alias: expv1alpha4 - pkg: sigs.k8s.io/cluster-api/exp/api/v1beta1 alias: expv1 # CAPI exp addons - - pkg: sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4 - alias: addonsv1alpha4 - pkg: sigs.k8s.io/cluster-api/exp/addons/api/v1beta1 alias: addonsv1 # CAPI exp IPAM @@ -158,13 +148,9 @@ linters-settings: - pkg: sigs.k8s.io/cluster-api/internal/webhooks/runtime alias: runtimewebhooks # CAPD - - pkg: sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4 - alias: infrav1alpha4 - pkg: sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1 alias: infrav1 # CAPD exp - - pkg: sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1alpha4 - alias: infraexpv1alpha4 - pkg: sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1beta1 alias: infraexpv1 nolintlint: @@ -224,9 +210,6 @@ issues: text: "SA1019: .* is deprecated: This package will be removed in one of the next releases." # Specific exclude rules for deprecated types that are still part of the codebase. These # should be removed as the referenced deprecated types are removed from the project. - - linters: - - staticcheck - text: "SA1019: (clusterv1alpha4.*) is deprecated: This type will be removed in one of the next releases." - linters: - revive text: "exported: exported method .*\\.(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4b25e5352c81..ee7dad05fef3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -156,8 +156,6 @@ Cluster API maintains the most recent release/releases for all supported API and | API Version | Supported Until | |--------------|-----------------------------------------------------------------------------------------| | **v1beta1** | TBD (current stable) | -| **v1alpha4** | EOL since 2022-04-06 ([apiVersion removal](#removal-of-v1alpha3--v1alpha4-apiversions)) | -| **v1alpha3** | EOL since 2022-02-23 ([apiVersion removal](#removal-of-v1alpha3--v1alpha4-apiversions)) | - For the current stable API version (v1beta1) we support the two most recent minor releases; older minor releases are immediately unsupported when a new major/minor release is available. - For older API versions we only support the most recent minor release until the API version reaches EOL. @@ -183,14 +181,8 @@ Cluster API maintains the most recent release/releases for all supported API and ### Removal of v1alpha3 & v1alpha4 apiVersions -We are going to remove the apiVersions in upcoming releases: -* v1.5: - * Kubernetes API server stops serving the v1alpha3 apiVersion -* v1.6: - * v1alpha3 apiVersion is removed from the CRDs - * Kubernetes API server stops serving the v1alpha4 apiVersion -* v1.7 - * v1alpha4 apiVersion is removed from the CRDs +Both v1alpha3 and v1alpha4 have been removed from Cluster API as of release 1.7. + For more details and latest information please see the following issue: [Removing v1alpha3 & v1alpha4 apiVersions](https://github.com/kubernetes-sigs/cluster-api/issues/8038). Note: Removal of a deprecated APIVersion in Kubernetes [can cause issues with garbage collection by the kube-controller-manager](https://github.com/kubernetes/kubernetes/issues/102641) diff --git a/Makefile b/Makefile index 1232e4dca4ef..001d661885fb 100644 --- a/Makefile +++ b/Makefile @@ -431,22 +431,9 @@ generate-go-conversions-core: ## Run all generate-go-conversions-core-* targets .PHONY: generate-go-conversions-core-api generate-go-conversions-core-api: $(CONVERSION_GEN) ## Generate conversions go code for core api - $(MAKE) clean-generated-conversions SRC_DIRS="./api/v1alpha4" - $(CONVERSION_GEN) \ - --input-dirs=./api/v1alpha4 \ - --build-tag=ignore_autogenerated_core \ - --output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \ - --go-header-file=./hack/boilerplate/boilerplate.generatego.txt .PHONY: generate-go-conversions-core-exp generate-go-conversions-core-exp: $(CONVERSION_GEN) ## Generate conversions go code for core exp - $(MAKE) clean-generated-conversions SRC_DIRS="./$(EXP_DIR)/api/v1alpha4,./$(EXP_DIR)/addons/api/v1alpha4" - $(CONVERSION_GEN) \ - --input-dirs=./$(EXP_DIR)/api/v1alpha4 \ - --input-dirs=./$(EXP_DIR)/addons/api/v1alpha4 \ - --extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha4 \ - --output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \ - --go-header-file=./hack/boilerplate/boilerplate.generatego.txt .PHONY: generate-go-conversions-core-exp-ipam generate-go-conversions-core-exp-ipam: $(CONVERSION_GEN) ## Generate conversions go code for core exp IPAM @@ -468,13 +455,6 @@ generate-go-conversions-core-runtime: $(CONVERSION_GEN) ## Generate conversions .PHONY: generate-go-conversions-kubeadm-bootstrap generate-go-conversions-kubeadm-bootstrap: $(CONVERSION_GEN) ## Generate conversions go code for kubeadm bootstrap - $(MAKE) clean-generated-conversions SRC_DIRS="./bootstrap/kubeadm/api" - $(CONVERSION_GEN) \ - --input-dirs=./bootstrap/kubeadm/api/v1alpha4 \ - --build-tag=ignore_autogenerated_kubeadm_bootstrap \ - --extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha4 \ - --output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \ - --go-header-file=./hack/boilerplate/boilerplate.generatego.txt $(MAKE) clean-generated-conversions SRC_DIRS="./bootstrap/kubeadm/types/upstreamv1beta2,./bootstrap/kubeadm/types/upstreamv1beta3" $(CONVERSION_GEN) \ --input-dirs=./bootstrap/kubeadm/types/upstreamv1beta2 \ @@ -485,28 +465,12 @@ generate-go-conversions-kubeadm-bootstrap: $(CONVERSION_GEN) ## Generate convers .PHONY: generate-go-conversions-kubeadm-control-plane generate-go-conversions-kubeadm-control-plane: $(CONVERSION_GEN) ## Generate conversions go code for kubeadm control plane - $(MAKE) clean-generated-conversions SRC_DIRS="./controlplane/kubeadm/api" - $(CONVERSION_GEN) \ - --input-dirs=./controlplane/kubeadm/api/v1alpha4 \ - --build-tag=ignore_autogenerated_kubeadm_controlplane \ - --extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha4 \ - --extra-peer-dirs=sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4 \ - --output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE) \ - --go-header-file=./hack/boilerplate/boilerplate.generatego.txt .PHONY: generate-go-conversions-docker-infrastructure generate-go-conversions-docker-infrastructure: $(CONVERSION_GEN) ## Generate conversions go code for docker infrastructure provider - cd $(CAPD_DIR); $(CONVERSION_GEN) \ - --input-dirs=./api/v1alpha4 \ - --input-dirs=./$(EXP_DIR)/api/v1alpha4 \ - --build-tag=ignore_autogenerated_capd \ - --extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha4 \ - --output-file-base=zz_generated.conversion $(CONVERSION_GEN_OUTPUT_BASE_CAPD) \ - --go-header-file=../../../hack/boilerplate/boilerplate.generatego.txt .PHONY: generate-go-conversions-in-memory-infrastructure generate-go-conversions-in-memory-infrastructure: $(CONVERSION_GEN) ## Generate conversions go code for in-memory infrastructure provider - cd $(CAPIM_DIR) # The tmp/sigs.k8s.io/cluster-api symlink is a workaround to make this target run outside of GOPATH .PHONY: generate-go-openapi diff --git a/api/v1alpha4/cluster_phase_types.go b/api/v1alpha4/cluster_phase_types.go deleted file mode 100644 index 49471c1f6641..000000000000 --- a/api/v1alpha4/cluster_phase_types.go +++ /dev/null @@ -1,55 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -// ClusterPhase is a string representation of a Cluster Phase. -// -// This type is a high-level indicator of the status of the Cluster as it is provisioned, -// from the API user’s perspective. -// -// The value should not be interpreted by any software components as a reliable indication -// of the actual state of the Cluster, and controllers should not use the Cluster Phase field -// value when making decisions about what action to take. -// -// Controllers should always look at the actual state of the Cluster’s fields to make those decisions. -type ClusterPhase string - -const ( - // ClusterPhasePending is the first state a Cluster is assigned by - // Cluster API Cluster controller after being created. - ClusterPhasePending = ClusterPhase("Pending") - - // ClusterPhaseProvisioning is the state when the Cluster has a provider infrastructure - // object associated and can start provisioning. - ClusterPhaseProvisioning = ClusterPhase("Provisioning") - - // ClusterPhaseProvisioned is the state when its - // infrastructure has been created and configured. - ClusterPhaseProvisioned = ClusterPhase("Provisioned") - - // ClusterPhaseDeleting is the Cluster state when a delete - // request has been sent to the API Server, - // but its infrastructure has not yet been fully deleted. - ClusterPhaseDeleting = ClusterPhase("Deleting") - - // ClusterPhaseFailed is the Cluster state when the system - // might require user intervention. - ClusterPhaseFailed = ClusterPhase("Failed") - - // ClusterPhaseUnknown is returned if the Cluster state cannot be determined. - ClusterPhaseUnknown = ClusterPhase("Unknown") -) diff --git a/api/v1alpha4/cluster_types.go b/api/v1alpha4/cluster_types.go deleted file mode 100644 index 019329d7c62e..000000000000 --- a/api/v1alpha4/cluster_types.go +++ /dev/null @@ -1,440 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "fmt" - "net" - "strings" - - "github.com/pkg/errors" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" - - capierrors "sigs.k8s.io/cluster-api/errors" -) - -const ( - // ClusterFinalizer is the finalizer used by the cluster controller to - // cleanup the cluster resources when a Cluster is being deleted. - ClusterFinalizer = "cluster.cluster.x-k8s.io" -) - -// ANCHOR: ClusterSpec - -// ClusterSpec defines the desired state of Cluster. -type ClusterSpec struct { - // Paused can be used to prevent controllers from processing the Cluster and all its associated objects. - // +optional - Paused bool `json:"paused,omitempty"` - - // Cluster network configuration. - // +optional - ClusterNetwork *ClusterNetwork `json:"clusterNetwork,omitempty"` - - // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. - // +optional - ControlPlaneEndpoint APIEndpoint `json:"controlPlaneEndpoint"` - - // ControlPlaneRef is an optional reference to a provider-specific resource that holds - // the details for provisioning the Control Plane for a Cluster. - // +optional - ControlPlaneRef *corev1.ObjectReference `json:"controlPlaneRef,omitempty"` - - // InfrastructureRef is a reference to a provider-specific resource that holds the details - // for provisioning infrastructure for a cluster in said provider. - // +optional - InfrastructureRef *corev1.ObjectReference `json:"infrastructureRef,omitempty"` - - // This encapsulates the topology for the cluster. - // NOTE: It is required to enable the ClusterTopology - // feature gate flag to activate managed topologies support; - // this feature is highly experimental, and parts of it might still be not implemented. - // +optional - Topology *Topology `json:"topology,omitempty"` -} - -// Topology encapsulates the information of the managed resources. -type Topology struct { - // The name of the ClusterClass object to create the topology. - Class string `json:"class"` - - // The Kubernetes version of the cluster. - Version string `json:"version"` - - // RolloutAfter performs a rollout of the entire cluster one component at a time, - // control plane first and then machine deployments. - // +optional - RolloutAfter *metav1.Time `json:"rolloutAfter,omitempty"` - - // ControlPlane describes the cluster control plane. - // +optional - ControlPlane ControlPlaneTopology `json:"controlPlane"` - - // Workers encapsulates the different constructs that form the worker nodes - // for the cluster. - // +optional - Workers *WorkersTopology `json:"workers,omitempty"` -} - -// ControlPlaneTopology specifies the parameters for the control plane nodes in the cluster. -type ControlPlaneTopology struct { - // Metadata is the metadata applied to the machines of the ControlPlane. - // At runtime this metadata is merged with the corresponding metadata from the ClusterClass. - // - // This field is supported if and only if the control plane provider template - // referenced in the ClusterClass is Machine based. - Metadata ObjectMeta `json:"metadata,omitempty"` - - // Replicas is the number of control plane nodes. - // If the value is nil, the ControlPlane object is created without the number of Replicas - // and it's assumed that the control plane controller does not implement support for this field. - // When specified against a control plane provider that lacks support for this field, this value will be ignored. - // +optional - Replicas *int32 `json:"replicas,omitempty"` -} - -// WorkersTopology represents the different sets of worker nodes in the cluster. -type WorkersTopology struct { - // MachineDeployments is a list of machine deployments in the cluster. - MachineDeployments []MachineDeploymentTopology `json:"machineDeployments,omitempty"` -} - -// MachineDeploymentTopology specifies the different parameters for a set of worker nodes in the topology. -// This set of nodes is managed by a MachineDeployment object whose lifecycle is managed by the Cluster controller. -type MachineDeploymentTopology struct { - // Metadata is the metadata applied to the machines of the MachineDeployment. - // At runtime this metadata is merged with the corresponding metadata from the ClusterClass. - Metadata ObjectMeta `json:"metadata,omitempty"` - - // Class is the name of the MachineDeploymentClass used to create the set of worker nodes. - // This should match one of the deployment classes defined in the ClusterClass object - // mentioned in the `Cluster.Spec.Class` field. - Class string `json:"class"` - - // Name is the unique identifier for this MachineDeploymentTopology. - // The value is used with other unique identifiers to create a MachineDeployment's Name - // (e.g. cluster's name, etc). In case the name is greater than the allowed maximum length, - // the values are hashed together. - Name string `json:"name"` - - // Replicas is the number of worker nodes belonging to this set. - // If the value is nil, the MachineDeployment is created without the number of Replicas (defaulting to zero) - // and it's assumed that an external entity (like cluster autoscaler) is responsible for the management - // of this value. - // +optional - Replicas *int32 `json:"replicas,omitempty"` -} - -// ANCHOR_END: ClusterSpec - -// ANCHOR: ClusterNetwork - -// ClusterNetwork specifies the different networking -// parameters for a cluster. -type ClusterNetwork struct { - // APIServerPort specifies the port the API Server should bind to. - // Defaults to 6443. - // +optional - APIServerPort *int32 `json:"apiServerPort,omitempty"` - - // The network ranges from which service VIPs are allocated. - // +optional - Services *NetworkRanges `json:"services,omitempty"` - - // The network ranges from which Pod networks are allocated. - // +optional - Pods *NetworkRanges `json:"pods,omitempty"` - - // Domain name for services. - // +optional - ServiceDomain string `json:"serviceDomain,omitempty"` -} - -// ANCHOR_END: ClusterNetwork - -// ANCHOR: NetworkRanges - -// NetworkRanges represents ranges of network addresses. -type NetworkRanges struct { - CIDRBlocks []string `json:"cidrBlocks"` -} - -func (n *NetworkRanges) String() string { - if n == nil { - return "" - } - return strings.Join(n.CIDRBlocks, ",") -} - -// ANCHOR_END: NetworkRanges - -// ANCHOR: ClusterStatus - -// ClusterStatus defines the observed state of Cluster. -type ClusterStatus struct { - // FailureDomains is a slice of failure domain objects synced from the infrastructure provider. - FailureDomains FailureDomains `json:"failureDomains,omitempty"` - - // FailureReason indicates that there is a fatal problem reconciling the - // state, and will be set to a token value suitable for - // programmatic interpretation. - // +optional - FailureReason *capierrors.ClusterStatusError `json:"failureReason,omitempty"` - - // FailureMessage indicates that there is a fatal problem reconciling the - // state, and will be set to a descriptive error message. - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` - - // Phase represents the current phase of cluster actuation. - // E.g. Pending, Running, Terminating, Failed etc. - // +optional - Phase string `json:"phase,omitempty"` - - // InfrastructureReady is the state of the infrastructure provider. - // +optional - InfrastructureReady bool `json:"infrastructureReady"` - - // ControlPlaneReady defines if the control plane is ready. - // +optional - ControlPlaneReady bool `json:"controlPlaneReady,omitempty"` - - // Conditions defines current service state of the cluster. - // +optional - Conditions Conditions `json:"conditions,omitempty"` - - // ObservedGeneration is the latest generation observed by the controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` -} - -// ANCHOR_END: ClusterStatus - -// SetTypedPhase sets the Phase field to the string representation of ClusterPhase. -func (c *ClusterStatus) SetTypedPhase(p ClusterPhase) { - c.Phase = string(p) -} - -// GetTypedPhase attempts to parse the Phase field and return -// the typed ClusterPhase representation as described in `machine_phase_types.go`. -func (c *ClusterStatus) GetTypedPhase() ClusterPhase { - switch phase := ClusterPhase(c.Phase); phase { - case - ClusterPhasePending, - ClusterPhaseProvisioning, - ClusterPhaseProvisioned, - ClusterPhaseDeleting, - ClusterPhaseFailed: - return phase - default: - return ClusterPhaseUnknown - } -} - -// ANCHOR: APIEndpoint - -// APIEndpoint represents a reachable Kubernetes API endpoint. -type APIEndpoint struct { - // The hostname on which the API server is serving. - Host string `json:"host"` - - // The port on which the API server is serving. - Port int32 `json:"port"` -} - -// IsZero returns true if both host and port are zero values. -func (v APIEndpoint) IsZero() bool { - return v.Host == "" && v.Port == 0 -} - -// IsValid returns true if both host and port are non-zero values. -func (v APIEndpoint) IsValid() bool { - return v.Host != "" && v.Port != 0 -} - -// String returns a formatted version HOST:PORT of this APIEndpoint. -func (v APIEndpoint) String() string { - return net.JoinHostPort(v.Host, fmt.Sprintf("%d", v.Port)) -} - -// ANCHOR_END: APIEndpoint - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:resource:path=clusters,shortName=cl,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Cluster" -// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Cluster status such as Pending/Provisioning/Provisioned/Deleting/Failed" - -// Cluster is the Schema for the clusters API. -// -// Deprecated: This type will be removed in one of the next releases. -type Cluster struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterSpec `json:"spec,omitempty"` - Status ClusterStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (c *Cluster) GetConditions() Conditions { - return c.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (c *Cluster) SetConditions(conditions Conditions) { - c.Status.Conditions = conditions -} - -// GetIPFamily returns a ClusterIPFamily from the configuration provided. -func (c *Cluster) GetIPFamily() (ClusterIPFamily, error) { - var podCIDRs, serviceCIDRs []string - if c.Spec.ClusterNetwork != nil { - if c.Spec.ClusterNetwork.Pods != nil { - podCIDRs = c.Spec.ClusterNetwork.Pods.CIDRBlocks - } - if c.Spec.ClusterNetwork.Services != nil { - serviceCIDRs = c.Spec.ClusterNetwork.Services.CIDRBlocks - } - } - if len(podCIDRs) == 0 && len(serviceCIDRs) == 0 { - return IPv4IPFamily, nil - } - - podsIPFamily, err := ipFamilyForCIDRStrings(podCIDRs) - if err != nil { - return InvalidIPFamily, fmt.Errorf("pods: %s", err) - } - if len(serviceCIDRs) == 0 { - return podsIPFamily, nil - } - - servicesIPFamily, err := ipFamilyForCIDRStrings(serviceCIDRs) - if err != nil { - return InvalidIPFamily, fmt.Errorf("services: %s", err) - } - if len(podCIDRs) == 0 { - return servicesIPFamily, nil - } - - if podsIPFamily == DualStackIPFamily { - return DualStackIPFamily, nil - } else if podsIPFamily != servicesIPFamily { - return InvalidIPFamily, errors.New("pods and services IP family mismatch") - } - - return podsIPFamily, nil -} - -func ipFamilyForCIDRStrings(cidrs []string) (ClusterIPFamily, error) { - if len(cidrs) > 2 { - return InvalidIPFamily, errors.New("too many CIDRs specified") - } - var foundIPv4 bool - var foundIPv6 bool - for _, cidr := range cidrs { - ip, _, err := net.ParseCIDR(cidr) - if err != nil { - return InvalidIPFamily, fmt.Errorf("could not parse CIDR: %s", err) - } - if ip.To4() != nil { - foundIPv4 = true - } else { - foundIPv6 = true - } - } - switch { - case foundIPv4 && foundIPv6: - return DualStackIPFamily, nil - case foundIPv4: - return IPv4IPFamily, nil - case foundIPv6: - return IPv6IPFamily, nil - default: - return InvalidIPFamily, nil - } -} - -// ClusterIPFamily defines the types of supported IP families. -type ClusterIPFamily int - -// Define the ClusterIPFamily constants. -const ( - InvalidIPFamily ClusterIPFamily = iota - IPv4IPFamily - IPv6IPFamily - DualStackIPFamily -) - -func (f ClusterIPFamily) String() string { - return [...]string{"InvalidIPFamily", "IPv4IPFamily", "IPv6IPFamily", "DualStackIPFamily"}[f] -} - -// +kubebuilder:object:root=true - -// ClusterList contains a list of Cluster. -// -// Deprecated: This type will be removed in one of the next releases. -type ClusterList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Cluster `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &Cluster{}, &ClusterList{}) -} - -// FailureDomains is a slice of FailureDomains. -type FailureDomains map[string]FailureDomainSpec - -// FilterControlPlane returns a FailureDomain slice containing only the domains suitable to be used -// for control plane nodes. -func (in FailureDomains) FilterControlPlane() FailureDomains { - res := make(FailureDomains) - for id, spec := range in { - if spec.ControlPlane { - res[id] = spec - } - } - return res -} - -// GetIDs returns a slice containing the ids for failure domains. -func (in FailureDomains) GetIDs() []*string { - ids := make([]*string, 0, len(in)) - for id := range in { - ids = append(ids, ptr.To(id)) - } - return ids -} - -// FailureDomainSpec is the Schema for Cluster API failure domains. -// It allows controllers to understand how many failure domains a cluster can optionally span across. -type FailureDomainSpec struct { - // ControlPlane determines if this failure domain is suitable for use by control plane machines. - // +optional - ControlPlane bool `json:"controlPlane"` - - // Attributes is a free form map of attributes an infrastructure provider might use or require. - // +optional - Attributes map[string]string `json:"attributes,omitempty"` -} diff --git a/api/v1alpha4/cluster_types_test.go b/api/v1alpha4/cluster_types_test.go deleted file mode 100644 index c78f8aee19df..000000000000 --- a/api/v1alpha4/cluster_types_test.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "testing" - - . "github.com/onsi/gomega" -) - -func TestClusterIPFamily(t *testing.T) { - clusterWithNetwork := func(podCIDRs, serviceCIDRs []string) *Cluster { - return &Cluster{ - Spec: ClusterSpec{ - ClusterNetwork: &ClusterNetwork{ - Pods: &NetworkRanges{ - CIDRBlocks: podCIDRs, - }, - Services: &NetworkRanges{ - CIDRBlocks: serviceCIDRs, - }, - }, - }, - } - } - - validAndUnambiguous := []struct { - name string - expectRes ClusterIPFamily - c *Cluster - }{ - { - name: "pods: ipv4, services: ipv4", - expectRes: IPv4IPFamily, - c: clusterWithNetwork([]string{"192.168.0.0/16"}, []string{"10.128.0.0/12"}), - }, - { - name: "pods: ipv4, services: nil", - expectRes: IPv4IPFamily, - c: clusterWithNetwork([]string{"192.168.0.0/16"}, nil), - }, - { - name: "pods: ipv6, services: nil", - expectRes: IPv6IPFamily, - c: clusterWithNetwork([]string{"fd00:100:96::/48"}, nil), - }, - { - name: "pods: ipv6, services: ipv6", - expectRes: IPv6IPFamily, - c: clusterWithNetwork([]string{"fd00:100:96::/48"}, []string{"fd00:100:64::/108"}), - }, - { - name: "pods: dual-stack, services: nil", - expectRes: DualStackIPFamily, - c: clusterWithNetwork([]string{"192.168.0.0/16", "fd00:100:96::/48"}, nil), - }, - { - name: "pods: dual-stack, services: ipv4", - expectRes: DualStackIPFamily, - c: clusterWithNetwork([]string{"192.168.0.0/16", "fd00:100:96::/48"}, []string{"10.128.0.0/12"}), - }, - { - name: "pods: dual-stack, services: ipv6", - expectRes: DualStackIPFamily, - c: clusterWithNetwork([]string{"192.168.0.0/16", "fd00:100:96::/48"}, []string{"fd00:100:64::/108"}), - }, - { - name: "pods: dual-stack, services: dual-stack", - expectRes: DualStackIPFamily, - c: clusterWithNetwork([]string{"192.168.0.0/16", "fd00:100:96::/48"}, []string{"10.128.0.0/12", "fd00:100:64::/108"}), - }, - { - name: "pods: nil, services: dual-stack", - expectRes: DualStackIPFamily, - c: clusterWithNetwork(nil, []string{"10.128.0.0/12", "fd00:100:64::/108"}), - }, - } - - for _, tt := range validAndUnambiguous { - t.Run(tt.name, func(t *testing.T) { - g := NewWithT(t) - ipFamily, err := tt.c.GetIPFamily() - g.Expect(ipFamily).To(Equal(tt.expectRes)) - g.Expect(err).ToNot(HaveOccurred()) - }) - } - - validButAmbiguous := []struct { - name string - expectRes ClusterIPFamily - c *Cluster - }{ - { - name: "pods: nil, services: nil", - // this could be ipv4, ipv6, or dual-stack; assume ipv4 for now though - expectRes: IPv4IPFamily, - c: clusterWithNetwork(nil, nil), - }, - { - name: "pods: nil, services: ipv4", - // this could be a dual-stack; assume ipv4 for now though - expectRes: IPv4IPFamily, - c: clusterWithNetwork(nil, []string{"10.128.0.0/12"}), - }, - { - name: "pods: nil, services: ipv6", - // this could be dual-stack; assume ipv6 for now though - expectRes: IPv6IPFamily, - c: clusterWithNetwork(nil, []string{"fd00:100:64::/108"}), - }, - } - - for _, tt := range validButAmbiguous { - t.Run(tt.name, func(t *testing.T) { - g := NewWithT(t) - ipFamily, err := tt.c.GetIPFamily() - g.Expect(ipFamily).To(Equal(tt.expectRes)) - g.Expect(err).ToNot(HaveOccurred()) - }) - } - - invalid := []struct { - name string - expectErr string - c *Cluster - }{ - { - name: "pods: ipv4, services: ipv6", - expectErr: "pods and services IP family mismatch", - c: clusterWithNetwork([]string{"192.168.0.0/16"}, []string{"fd00:100:64::/108"}), - }, - { - name: "pods: ipv6, services: ipv4", - expectErr: "pods and services IP family mismatch", - c: clusterWithNetwork([]string{"fd00:100:96::/48"}, []string{"10.128.0.0/12"}), - }, - { - name: "pods: ipv6, services: dual-stack", - expectErr: "pods and services IP family mismatch", - c: clusterWithNetwork([]string{"fd00:100:96::/48"}, []string{"10.128.0.0/12", "fd00:100:64::/108"}), - }, - { - name: "pods: ipv4, services: dual-stack", - expectErr: "pods and services IP family mismatch", - c: clusterWithNetwork([]string{"192.168.0.0/16"}, []string{"10.128.0.0/12", "fd00:100:64::/108"}), - }, - { - name: "pods: ipv4, services: dual-stack", - expectErr: "pods and services IP family mismatch", - c: clusterWithNetwork([]string{"192.168.0.0/16"}, []string{"10.128.0.0/12", "fd00:100:64::/108"}), - }, - { - name: "pods: bad cidr", - expectErr: "pods: could not parse CIDR", - c: clusterWithNetwork([]string{"foo"}, nil), - }, - { - name: "services: bad cidr", - expectErr: "services: could not parse CIDR", - c: clusterWithNetwork([]string{"192.168.0.0/16"}, []string{"foo"}), - }, - { - name: "pods: too many cidrs", - expectErr: "pods: too many CIDRs specified", - c: clusterWithNetwork([]string{"192.168.0.0/16", "fd00:100:96::/48", "10.128.0.0/12"}, nil), - }, - { - name: "services: too many cidrs", - expectErr: "services: too many CIDRs specified", - c: clusterWithNetwork(nil, []string{"192.168.0.0/16", "fd00:100:96::/48", "10.128.0.0/12"}), - }, - } - - for _, tt := range invalid { - t.Run(tt.name, func(t *testing.T) { - g := NewWithT(t) - ipFamily, err := tt.c.GetIPFamily() - g.Expect(err).To(HaveOccurred()) - g.Expect(err).To(MatchError(ContainSubstring(tt.expectErr))) - g.Expect(ipFamily).To(Equal(InvalidIPFamily)) - }) - } -} diff --git a/api/v1alpha4/clusterclass_types.go b/api/v1alpha4/clusterclass_types.go deleted file mode 100644 index 62a6413b70a5..000000000000 --- a/api/v1alpha4/clusterclass_types.go +++ /dev/null @@ -1,138 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:resource:path=clusterclasses,shortName=cc,scope=Namespaced,categories=cluster-api -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of ClusterClass" - -// ClusterClass is a template which can be used to create managed topologies. -// -// Deprecated: This type will be removed in one of the next releases. -type ClusterClass struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterClassSpec `json:"spec,omitempty"` -} - -// ClusterClassSpec describes the desired state of the ClusterClass. -type ClusterClassSpec struct { - // Infrastructure is a reference to a provider-specific template that holds - // the details for provisioning infrastructure specific cluster - // for the underlying provider. - // The underlying provider is responsible for the implementation - // of the template to an infrastructure cluster. - Infrastructure LocalObjectTemplate `json:"infrastructure,omitempty"` - - // ControlPlane is a reference to a local struct that holds the details - // for provisioning the Control Plane for the Cluster. - ControlPlane ControlPlaneClass `json:"controlPlane,omitempty"` - - // Workers describes the worker nodes for the cluster. - // It is a collection of node types which can be used to create - // the worker nodes of the cluster. - // +optional - Workers WorkersClass `json:"workers,omitempty"` -} - -// ControlPlaneClass defines the class for the control plane. -type ControlPlaneClass struct { - // Metadata is the metadata applied to the machines of the ControlPlane. - // At runtime this metadata is merged with the corresponding metadata from the topology. - // - // This field is supported if and only if the control plane provider template - // referenced is Machine based. - Metadata ObjectMeta `json:"metadata,omitempty"` - - // LocalObjectTemplate contains the reference to the control plane provider. - LocalObjectTemplate `json:",inline"` - - // MachineTemplate defines the metadata and infrastructure information - // for control plane machines. - // - // This field is supported if and only if the control plane provider template - // referenced above is Machine based and supports setting replicas. - // - // +optional - MachineInfrastructure *LocalObjectTemplate `json:"machineInfrastructure,omitempty"` -} - -// WorkersClass is a collection of deployment classes. -type WorkersClass struct { - // MachineDeployments is a list of machine deployment classes that can be used to create - // a set of worker nodes. - MachineDeployments []MachineDeploymentClass `json:"machineDeployments,omitempty"` -} - -// MachineDeploymentClass serves as a template to define a set of worker nodes of the cluster -// provisioned using the `ClusterClass`. -type MachineDeploymentClass struct { - // Class denotes a type of worker node present in the cluster, - // this name MUST be unique within a ClusterClass and can be referenced - // in the Cluster to create a managed MachineDeployment. - Class string `json:"class"` - - // Template is a local struct containing a collection of templates for creation of - // MachineDeployment objects representing a set of worker nodes. - Template MachineDeploymentClassTemplate `json:"template"` -} - -// MachineDeploymentClassTemplate defines how a MachineDeployment generated from a MachineDeploymentClass -// should look like. -type MachineDeploymentClassTemplate struct { - // Metadata is the metadata applied to the machines of the MachineDeployment. - // At runtime this metadata is merged with the corresponding metadata from the topology. - Metadata ObjectMeta `json:"metadata,omitempty"` - - // Bootstrap contains the bootstrap template reference to be used - // for the creation of worker Machines. - Bootstrap LocalObjectTemplate `json:"bootstrap"` - - // Infrastructure contains the infrastructure template reference to be used - // for the creation of worker Machines. - Infrastructure LocalObjectTemplate `json:"infrastructure"` -} - -// LocalObjectTemplate defines a template for a topology Class. -type LocalObjectTemplate struct { - // Ref is a required reference to a custom resource - // offered by a provider. - Ref *corev1.ObjectReference `json:"ref"` -} - -// +kubebuilder:object:root=true - -// ClusterClassList contains a list of Cluster. -// -// Deprecated: This type will be removed in one of the next releases. -type ClusterClassList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterClass `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &ClusterClass{}, &ClusterClassList{}) -} diff --git a/api/v1alpha4/common_types.go b/api/v1alpha4/common_types.go deleted file mode 100644 index 6893544c3eb9..000000000000 --- a/api/v1alpha4/common_types.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -const ( - // ClusterLabelName is the label set on machines linked to a cluster and - // external objects(bootstrap and infrastructure providers). - ClusterLabelName = "cluster.x-k8s.io/cluster-name" - - // ClusterTopologyLabelName is the label set on all the object which are managed as part of a ClusterTopology. - // - // Deprecated: use ClusterTopologyOwnedLabel instead. - ClusterTopologyLabelName = "cluster.x-k8s.io/topology" - - // ClusterTopologyOwnedLabel is the label set on all the object which are managed as part of a ClusterTopology. - ClusterTopologyOwnedLabel = "topology.cluster.x-k8s.io/owned" - - // ClusterTopologyMachineDeploymentLabelName is the label set on the generated MachineDeployment objects - // to track the name of the MachineDeployment topology it represents. - ClusterTopologyMachineDeploymentLabelName = "topology.cluster.x-k8s.io/deployment-name" - - // ProviderLabelName is the label set on components in the provider manifest. - // This label allows to easily identify all the components belonging to a provider; the clusterctl - // tool uses this label for implementing provider's lifecycle operations. - ProviderLabelName = "cluster.x-k8s.io/provider" - - // ClusterNameAnnotation is the annotation set on nodes identifying the name of the cluster the node belongs to. - ClusterNameAnnotation = "cluster.x-k8s.io/cluster-name" - - // ClusterNamespaceAnnotation is the annotation set on nodes identifying the namespace of the cluster the node belongs to. - ClusterNamespaceAnnotation = "cluster.x-k8s.io/cluster-namespace" - - // MachineAnnotation is the annotation set on nodes identifying the machine the node belongs to. - MachineAnnotation = "cluster.x-k8s.io/machine" - - // OwnerKindAnnotation is the annotation set on nodes identifying the owner kind. - OwnerKindAnnotation = "cluster.x-k8s.io/owner-kind" - - // OwnerNameAnnotation is the annotation set on nodes identifying the owner name. - OwnerNameAnnotation = "cluster.x-k8s.io/owner-name" - - // PausedAnnotation is an annotation that can be applied to any Cluster API - // object to prevent a controller from processing a resource. - // - // Controllers working with Cluster API objects must check the existence of this annotation - // on the reconciled object. - PausedAnnotation = "cluster.x-k8s.io/paused" - - // DisableMachineCreate is an annotation that can be used to signal a MachineSet to stop creating new machines. - // It is utilized in the OnDelete MachineDeploymentStrategy to allow the MachineDeployment controller to scale down - // older MachineSets when Machines are deleted and add the new replicas to the latest MachineSet. - DisableMachineCreate = "cluster.x-k8s.io/disable-machine-create" - - // WatchLabel is a label othat can be applied to any Cluster API object. - // - // Controllers which allow for selective reconciliation may check this label and proceed - // with reconciliation of the object only if this label and a configured value is present. - WatchLabel = "cluster.x-k8s.io/watch-filter" - - // DeleteMachineAnnotation marks control plane and worker nodes that will be given priority for deletion - // when KCP or a machineset scales down. This annotation is given top priority on all delete policies. - DeleteMachineAnnotation = "cluster.x-k8s.io/delete-machine" - - // TemplateClonedFromNameAnnotation is the infrastructure machine annotation that stores the name of the infrastructure template resource - // that was cloned for the machine. This annotation is set only during cloning a template. Older/adopted machines will not have this annotation. - TemplateClonedFromNameAnnotation = "cluster.x-k8s.io/cloned-from-name" - - // TemplateClonedFromGroupKindAnnotation is the infrastructure machine annotation that stores the group-kind of the infrastructure template resource - // that was cloned for the machine. This annotation is set only during cloning a template. Older/adopted machines will not have this annotation. - TemplateClonedFromGroupKindAnnotation = "cluster.x-k8s.io/cloned-from-groupkind" - - // MachineSkipRemediationAnnotation is the annotation used to mark the machines that should not be considered for remediation by MachineHealthCheck reconciler. - MachineSkipRemediationAnnotation = "cluster.x-k8s.io/skip-remediation" - - // ClusterSecretType defines the type of secret created by core components. - ClusterSecretType corev1.SecretType = "cluster.x-k8s.io/secret" //nolint:gosec - - // InterruptibleLabel is the label used to mark the nodes that run on interruptible instances. - InterruptibleLabel = "cluster.x-k8s.io/interruptible" - - // ManagedByAnnotation is an annotation that can be applied to InfraCluster resources to signify that - // some external system is managing the cluster infrastructure. - // - // Provider InfraCluster controllers will ignore resources with this annotation. - // An external controller must fulfill the contract of the InfraCluster resource. - // External infrastructure providers should ensure that the annotation, once set, cannot be removed. - ManagedByAnnotation = "cluster.x-k8s.io/managed-by" -) - -const ( - // TemplateSuffix is the object kind suffix used by template types. - TemplateSuffix = "Template" -) - -var ( - // ZeroDuration is a zero value of the metav1.Duration type. - ZeroDuration = metav1.Duration{} -) - -const ( - // MachineNodeNameIndex is used by the Machine Controller to index Machines by Node name, and add a watch on Nodes. - // - // Deprecated: Use api/v1alpha4/index.MachineNodeNameField instead. - MachineNodeNameIndex = "status.nodeRef.name" - - // MachineProviderIDIndex is used to index Machines by ProviderID. It's useful to find Machines - // in a management cluster from Nodes in a workload cluster. - // - // Deprecated: Use api/v1alpha4/index.MachineProviderIDField instead. - MachineProviderIDIndex = "spec.providerID" -) - -// MachineAddressType describes a valid MachineAddress type. -type MachineAddressType string - -// Define the MachineAddressType constants. -const ( - MachineHostName MachineAddressType = "Hostname" - MachineExternalIP MachineAddressType = "ExternalIP" - MachineInternalIP MachineAddressType = "InternalIP" - MachineExternalDNS MachineAddressType = "ExternalDNS" - MachineInternalDNS MachineAddressType = "InternalDNS" -) - -// MachineAddress contains information for the node's address. -type MachineAddress struct { - // Machine address type, one of Hostname, ExternalIP or InternalIP. - Type MachineAddressType `json:"type"` - - // The machine address. - Address string `json:"address"` -} - -// MachineAddresses is a slice of MachineAddress items to be used by infrastructure providers. -type MachineAddresses []MachineAddress - -// ObjectMeta is metadata that all persisted resources must have, which includes all objects -// users must create. This is a copy of customizable fields from metav1.ObjectMeta. -// -// ObjectMeta is embedded in `Machine.Spec`, `MachineDeployment.Template` and `MachineSet.Template`, -// which are not top-level Kubernetes objects. Given that metav1.ObjectMeta has lots of special cases -// and read-only fields which end up in the generated CRD validation, having it as a subset simplifies -// the API and some issues that can impact user experience. -// -// During the [upgrade to controller-tools@v2](https://github.com/kubernetes-sigs/cluster-api/pull/1054) -// for v1alpha2, we noticed a failure would occur running Cluster API test suite against the new CRDs, -// specifically `spec.metadata.creationTimestamp in body must be of type string: "null"`. -// The investigation showed that `controller-tools@v2` behaves differently than its previous version -// when handling types from [metav1](k8s.io/apimachinery/pkg/apis/meta/v1) package. -// -// In more details, we found that embedded (non-top level) types that embedded `metav1.ObjectMeta` -// had validation properties, including for `creationTimestamp` (metav1.Time). -// The `metav1.Time` type specifies a custom json marshaller that, when IsZero() is true, returns `null` -// which breaks validation because the field isn't marked as nullable. -// -// In future versions, controller-tools@v2 might allow overriding the type and validation for embedded -// types. When that happens, this hack should be revisited. -type ObjectMeta struct { - // Map of string keys and values that can be used to organize and categorize - // (scope and select) objects. May match selectors of replication controllers - // and services. - // More info: http://kubernetes.io/docs/user-guide/labels - // +optional - Labels map[string]string `json:"labels,omitempty"` - - // Annotations is an unstructured key value map stored with a resource that may be - // set by external tools to store and retrieve arbitrary metadata. They are not - // queryable and should be preserved when modifying objects. - // More info: http://kubernetes.io/docs/user-guide/annotations - // +optional - Annotations map[string]string `json:"annotations,omitempty"` -} diff --git a/api/v1alpha4/condition_consts.go b/api/v1alpha4/condition_consts.go deleted file mode 100644 index d3c84b66d035..000000000000 --- a/api/v1alpha4/condition_consts.go +++ /dev/null @@ -1,253 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -// ANCHOR: CommonConditions - -// Common ConditionTypes used by Cluster API objects. -const ( - // ReadyCondition defines the Ready condition type that summarizes the operational state of a Cluster API object. - ReadyCondition ConditionType = "Ready" -) - -// Common ConditionReason used by Cluster API objects. -const ( - // DeletingReason (Severity=Info) documents an condition not in Status=True because the underlying object it is currently being deleted. - DeletingReason = "Deleting" - - // DeletionFailedReason (Severity=Warning) documents an condition not in Status=True because the underlying object - // encountered problems during deletion. This is a warning because the reconciler will retry deletion. - DeletionFailedReason = "DeletionFailed" - - // DeletedReason (Severity=Info) documents an condition not in Status=True because the underlying object was deleted. - DeletedReason = "Deleted" - - // IncorrectExternalRefReason (Severity=Error) documents a CAPI object with an incorrect external object reference. - IncorrectExternalRefReason = "IncorrectExternalRef" -) - -const ( - // InfrastructureReadyCondition reports a summary of current status of the infrastructure object defined for this cluster/machine/machinepool. - // This condition is mirrored from the Ready condition in the infrastructure ref object, and - // the absence of this condition might signal problems in the reconcile external loops or the fact that - // the infrastructure provider does not implement the Ready condition yet. - InfrastructureReadyCondition ConditionType = "InfrastructureReady" - - // WaitingForInfrastructureFallbackReason (Severity=Info) documents a cluster/machine/machinepool waiting for the underlying infrastructure - // to be available. - // NOTE: This reason is used only as a fallback when the infrastructure object is not reporting its own ready condition. - WaitingForInfrastructureFallbackReason = "WaitingForInfrastructure" -) - -// ANCHOR_END: CommonConditions - -// Conditions and condition Reasons for the Cluster object. - -const ( - // ControlPlaneInitializedCondition reports if the cluster's control plane has been initialized such that the - // cluster's apiserver is reachable and at least one control plane Machine has a node reference. Once this - // condition is marked true, its value is never changed. See the ControlPlaneReady condition for an indication of - // the current readiness of the cluster's control plane. - ControlPlaneInitializedCondition ConditionType = "ControlPlaneInitialized" - - // MissingNodeRefReason (Severity=Info) documents a cluster waiting for at least one control plane Machine to have - // its node reference populated. - MissingNodeRefReason = "MissingNodeRef" - - // WaitingForControlPlaneProviderInitializedReason (Severity=Info) documents a cluster waiting for the control plane - // provider to report successful control plane initialization. - WaitingForControlPlaneProviderInitializedReason = "WaitingForControlPlaneProviderInitialized" - - // ControlPlaneReadyCondition reports the ready condition from the control plane object defined for this cluster. - // This condition is mirrored from the Ready condition in the control plane ref object, and - // the absence of this condition might signal problems in the reconcile external loops or the fact that - // the control plane provider does not implement the Ready condition yet. - ControlPlaneReadyCondition ConditionType = "ControlPlaneReady" - - // WaitingForControlPlaneFallbackReason (Severity=Info) documents a cluster waiting for the control plane - // to be available. - // NOTE: This reason is used only as a fallback when the control plane object is not reporting its own ready condition. - WaitingForControlPlaneFallbackReason = "WaitingForControlPlane" - - // WaitingForControlPlaneAvailableReason (Severity=Info) documents a Cluster API object - // waiting for the control plane machine to be available. - // - // NOTE: Having the control plane machine available is a pre-condition for joining additional control planes - // or workers nodes. - WaitingForControlPlaneAvailableReason = "WaitingForControlPlaneAvailable" -) - -// Conditions and condition Reasons for the Machine object. - -const ( - // BootstrapReadyCondition reports a summary of current status of the bootstrap object defined for this machine. - // This condition is mirrored from the Ready condition in the bootstrap ref object, and - // the absence of this condition might signal problems in the reconcile external loops or the fact that - // the bootstrap provider does not implement the Ready condition yet. - BootstrapReadyCondition ConditionType = "BootstrapReady" - - // WaitingForDataSecretFallbackReason (Severity=Info) documents a machine waiting for the bootstrap data secret - // to be available. - // NOTE: This reason is used only as a fallback when the bootstrap object is not reporting its own ready condition. - WaitingForDataSecretFallbackReason = "WaitingForDataSecret" - - // DrainingSucceededCondition provide evidence of the status of the node drain operation which happens during the machine - // deletion process. - DrainingSucceededCondition ConditionType = "DrainingSucceeded" - - // DrainingReason (Severity=Info) documents a machine node being drained. - DrainingReason = "Draining" - - // DrainingFailedReason (Severity=Warning) documents a machine node drain operation failed. - DrainingFailedReason = "DrainingFailed" - - // PreDrainDeleteHookSucceededCondition reports a machine waiting for a PreDrainDeleteHook before being delete. - PreDrainDeleteHookSucceededCondition ConditionType = "PreDrainDeleteHookSucceeded" - - // PreTerminateDeleteHookSucceededCondition reports a machine waiting for a PreDrainDeleteHook before being delete. - PreTerminateDeleteHookSucceededCondition ConditionType = "PreTerminateDeleteHookSucceeded" - - // WaitingExternalHookReason (Severity=Info) provide evidence that we are waiting for an external hook to complete. - WaitingExternalHookReason = "WaitingExternalHook" - - // VolumeDetachSucceededCondition reports a machine waiting for volumes to be detached. - VolumeDetachSucceededCondition ConditionType = "VolumeDetachSucceeded" - - // WaitingForVolumeDetachReason (Severity=Info) provide evidence that a machine node waiting for volumes to be attached. - WaitingForVolumeDetachReason = "WaitingForVolumeDetach" -) - -const ( - // MachineHealthCheckSuccededCondition is set on machines that have passed a healthcheck by the MachineHealthCheck controller. - // In the event that the health check fails it will be set to False. - MachineHealthCheckSuccededCondition ConditionType = "HealthCheckSucceeded" - - // MachineHasFailureReason is the reason used when a machine has either a FailureReason or a FailureMessage set on its status. - MachineHasFailureReason = "MachineHasFailure" - - // NodeStartupTimeoutReason is the reason used when a machine's node does not appear within the specified timeout. - NodeStartupTimeoutReason = "NodeStartupTimeout" - - // UnhealthyNodeConditionReason is the reason used when a machine's node has one of the MachineHealthCheck's unhealthy conditions. - UnhealthyNodeConditionReason = "UnhealthyNode" -) - -const ( - // MachineOwnerRemediatedCondition is set on machines that have failed a healthcheck by the MachineHealthCheck controller. - // MachineOwnerRemediatedCondition is set to False after a health check fails, but should be changed to True by the owning controller after remediation succeeds. - MachineOwnerRemediatedCondition ConditionType = "OwnerRemediated" - - // WaitingForRemediationReason is the reason used when a machine fails a health check and remediation is needed. - WaitingForRemediationReason = "WaitingForRemediation" - - // RemediationFailedReason is the reason used when a remediation owner fails to remediate an unhealthy machine. - RemediationFailedReason = "RemediationFailed" - - // RemediationInProgressReason is the reason used when an unhealthy machine is being remediated by the remediation owner. - RemediationInProgressReason = "RemediationInProgress" - - // ExternalRemediationTemplateAvailable is set on machinehealthchecks when MachineHealthCheck controller uses external remediation. - // ExternalRemediationTemplateAvailable is set to false if external remediation template is not found. - ExternalRemediationTemplateAvailable ConditionType = "ExternalRemediationTemplateAvailable" - - // ExternalRemediationTemplateNotFound is the reason used when a machine health check fails to find external remediation template. - ExternalRemediationTemplateNotFound = "ExternalRemediationTemplateNotFound" - - // ExternalRemediationRequestAvailable is set on machinehealthchecks when MachineHealthCheck controller uses external remediation. - // ExternalRemediationRequestAvailable is set to false if creating external remediation request fails. - ExternalRemediationRequestAvailable ConditionType = "ExternalRemediationRequestAvailable" - - // ExternalRemediationRequestCreationFailed is the reason used when a machine health check fails to create external remediation request. - ExternalRemediationRequestCreationFailed = "ExternalRemediationRequestCreationFailed" -) - -// Conditions and condition Reasons for the Machine's Node object. -const ( - // MachineNodeHealthyCondition provides info about the operational state of the Kubernetes node hosted on the machine by summarizing node conditions. - // If the conditions defined in a Kubernetes node (i.e., NodeReady, NodeMemoryPressure, NodeDiskPressure, NodePIDPressure, and NodeNetworkUnavailable) are in a healthy state, it will be set to True. - MachineNodeHealthyCondition ConditionType = "NodeHealthy" - - // WaitingForNodeRefReason (Severity=Info) documents a machine.spec.providerId is not assigned yet. - WaitingForNodeRefReason = "WaitingForNodeRef" - - // NodeProvisioningReason (Severity=Info) documents machine in the process of provisioning a node. - // NB. provisioning --> NodeRef == "". - NodeProvisioningReason = "NodeProvisioning" - - // NodeNotFoundReason (Severity=Error) documents a machine's node has previously been observed but is now gone. - // NB. provisioned --> NodeRef != "". - NodeNotFoundReason = "NodeNotFound" - - // NodeConditionsFailedReason (Severity=Warning) documents a node is not in a healthy state due to the failed state of at least 1 Kubelet condition. - NodeConditionsFailedReason = "NodeConditionsFailed" -) - -// Conditions and condition Reasons for the MachineHealthCheck object. - -const ( - // RemediationAllowedCondition is set on MachineHealthChecks to show the status of whether the MachineHealthCheck is - // allowed to remediate any Machines or whether it is blocked from remediating any further. - RemediationAllowedCondition ConditionType = "RemediationAllowed" - - // TooManyUnhealthyReason is the reason used when too many Machines are unhealthy and the MachineHealthCheck is blocked - // from making any further remediations. - TooManyUnhealthyReason = "TooManyUnhealthy" -) - -// Conditions and condition Reasons for MachineDeployments. - -const ( - // MachineDeploymentAvailableCondition means the MachineDeployment is available, that is, at least the minimum available - // machines required (i.e. Spec.Replicas-MaxUnavailable when MachineDeploymentStrategyType = RollingUpdate) are up and running for at least minReadySeconds. - MachineDeploymentAvailableCondition ConditionType = "Available" - - // WaitingForAvailableMachinesReason (Severity=Warning) reflects the fact that the required minimum number of machines for a machinedeployment are not available. - WaitingForAvailableMachinesReason = "WaitingForAvailableMachines" -) - -// Conditions and condition Reasons for MachineSets. - -const ( - // MachinesCreatedCondition documents that the machines controlled by the MachineSet are created. - // When this condition is false, it indicates that there was an error when cloning the infrastructure/bootstrap template or - // when generating the machine object. - MachinesCreatedCondition ConditionType = "MachinesCreated" - - // MachinesReadyCondition reports an aggregate of current status of the machines controlled by the MachineSet. - MachinesReadyCondition ConditionType = "MachinesReady" - - // BootstrapTemplateCloningFailedReason (Severity=Error) documents a MachineSet failing to - // clone the bootstrap template. - BootstrapTemplateCloningFailedReason = "BootstrapTemplateCloningFailed" - - // InfrastructureTemplateCloningFailedReason (Severity=Error) documents a MachineSet failing to - // clone the infrastructure template. - InfrastructureTemplateCloningFailedReason = "InfrastructureTemplateCloningFailed" - - // MachineCreationFailedReason (Severity=Error) documents a MachineSet failing to - // generate a machine object. - MachineCreationFailedReason = "MachineCreationFailed" - - // ResizedCondition documents a MachineSet is resizing the set of controlled machines. - ResizedCondition ConditionType = "Resized" - - // ScalingUpReason (Severity=Info) documents a MachineSet is increasing the number of replicas. - ScalingUpReason = "ScalingUp" - - // ScalingDownReason (Severity=Info) documents a MachineSet is decreasing the number of replicas. - ScalingDownReason = "ScalingDown" -) diff --git a/api/v1alpha4/condition_types.go b/api/v1alpha4/condition_types.go deleted file mode 100644 index 6c90c0b3e7c4..000000000000 --- a/api/v1alpha4/condition_types.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// ANCHOR: ConditionSeverity - -// ConditionSeverity expresses the severity of a Condition Type failing. -type ConditionSeverity string - -const ( - // ConditionSeverityError specifies that a condition with `Status=False` is an error. - ConditionSeverityError ConditionSeverity = "Error" - - // ConditionSeverityWarning specifies that a condition with `Status=False` is a warning. - ConditionSeverityWarning ConditionSeverity = "Warning" - - // ConditionSeverityInfo specifies that a condition with `Status=False` is informative. - ConditionSeverityInfo ConditionSeverity = "Info" - - // ConditionSeverityNone should apply only to conditions with `Status=True`. - ConditionSeverityNone ConditionSeverity = "" -) - -// ANCHOR_END: ConditionSeverity - -// ANCHOR: ConditionType - -// ConditionType is a valid value for Condition.Type. -type ConditionType string - -// ANCHOR_END: ConditionType - -// ANCHOR: Condition - -// Condition defines an observation of a Cluster API resource operational state. -type Condition struct { - // Type of condition in CamelCase or in foo.example.com/CamelCase. - // Many .condition.type values are consistent across resources like Available, but because arbitrary conditions - // can be useful (see .node.status.conditions), the ability to deconflict is important. - // +required - Type ConditionType `json:"type"` - - // Status of the condition, one of True, False, Unknown. - // +required - Status corev1.ConditionStatus `json:"status"` - - // Severity provides an explicit classification of Reason code, so the users or machines can immediately - // understand the current situation and act accordingly. - // The Severity field MUST be set only when Status=False. - // +optional - Severity ConditionSeverity `json:"severity,omitempty"` - - // Last time the condition transitioned from one status to another. - // This should be when the underlying condition changed. If that is not known, then using the time when - // the API field changed is acceptable. - // +required - LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"` - - // 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. - // +optional - Reason string `json:"reason,omitempty"` - - // A human readable message indicating details about the transition. - // This field may be empty. - // +optional - Message string `json:"message,omitempty"` -} - -// ANCHOR_END: Condition - -// ANCHOR: Conditions - -// Conditions provide observations of the operational state of a Cluster API resource. -type Conditions []Condition - -// ANCHOR_END: Conditions diff --git a/api/v1alpha4/conversion.go b/api/v1alpha4/conversion.go deleted file mode 100644 index 368dff1b1d94..000000000000 --- a/api/v1alpha4/conversion.go +++ /dev/null @@ -1,392 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - apiconversion "k8s.io/apimachinery/pkg/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" - - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -func (src *Cluster) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*clusterv1.Cluster) - - if err := Convert_v1alpha4_Cluster_To_v1beta1_Cluster(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &clusterv1.Cluster{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - if restored.Spec.Topology != nil { - if dst.Spec.Topology == nil { - dst.Spec.Topology = &clusterv1.Topology{} - } - dst.Spec.Topology.Variables = restored.Spec.Topology.Variables - - if restored.Spec.Topology.ControlPlane.MachineHealthCheck != nil { - dst.Spec.Topology.ControlPlane.MachineHealthCheck = restored.Spec.Topology.ControlPlane.MachineHealthCheck - } - - if restored.Spec.Topology.ControlPlane.NodeDrainTimeout != nil { - dst.Spec.Topology.ControlPlane.NodeDrainTimeout = restored.Spec.Topology.ControlPlane.NodeDrainTimeout - } - - if restored.Spec.Topology.ControlPlane.NodeVolumeDetachTimeout != nil { - dst.Spec.Topology.ControlPlane.NodeVolumeDetachTimeout = restored.Spec.Topology.ControlPlane.NodeVolumeDetachTimeout - } - - if restored.Spec.Topology.ControlPlane.NodeDeletionTimeout != nil { - dst.Spec.Topology.ControlPlane.NodeDeletionTimeout = restored.Spec.Topology.ControlPlane.NodeDeletionTimeout - } - - if restored.Spec.Topology.Workers != nil { - if dst.Spec.Topology.Workers == nil { - dst.Spec.Topology.Workers = &clusterv1.WorkersTopology{} - } - for i := range restored.Spec.Topology.Workers.MachineDeployments { - dst.Spec.Topology.Workers.MachineDeployments[i].FailureDomain = restored.Spec.Topology.Workers.MachineDeployments[i].FailureDomain - dst.Spec.Topology.Workers.MachineDeployments[i].Variables = restored.Spec.Topology.Workers.MachineDeployments[i].Variables - dst.Spec.Topology.Workers.MachineDeployments[i].NodeDrainTimeout = restored.Spec.Topology.Workers.MachineDeployments[i].NodeDrainTimeout - dst.Spec.Topology.Workers.MachineDeployments[i].NodeVolumeDetachTimeout = restored.Spec.Topology.Workers.MachineDeployments[i].NodeVolumeDetachTimeout - dst.Spec.Topology.Workers.MachineDeployments[i].NodeDeletionTimeout = restored.Spec.Topology.Workers.MachineDeployments[i].NodeDeletionTimeout - dst.Spec.Topology.Workers.MachineDeployments[i].MinReadySeconds = restored.Spec.Topology.Workers.MachineDeployments[i].MinReadySeconds - dst.Spec.Topology.Workers.MachineDeployments[i].Strategy = restored.Spec.Topology.Workers.MachineDeployments[i].Strategy - dst.Spec.Topology.Workers.MachineDeployments[i].MachineHealthCheck = restored.Spec.Topology.Workers.MachineDeployments[i].MachineHealthCheck - } - - dst.Spec.Topology.Workers.MachinePools = restored.Spec.Topology.Workers.MachinePools - } - } - - return nil -} - -func (dst *Cluster) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*clusterv1.Cluster) - - if err := Convert_v1beta1_Cluster_To_v1alpha4_Cluster(src, dst, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata - if err := utilconversion.MarshalData(src, dst); err != nil { - return err - } - - return nil -} - -func (src *ClusterList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*clusterv1.ClusterList) - - return Convert_v1alpha4_ClusterList_To_v1beta1_ClusterList(src, dst, nil) -} - -func (dst *ClusterList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*clusterv1.ClusterList) - - return Convert_v1beta1_ClusterList_To_v1alpha4_ClusterList(src, dst, nil) -} - -func (src *ClusterClass) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*clusterv1.ClusterClass) - - if err := Convert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &clusterv1.ClusterClass{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - dst.Spec.Patches = restored.Spec.Patches - dst.Spec.Variables = restored.Spec.Variables - dst.Spec.ControlPlane.MachineHealthCheck = restored.Spec.ControlPlane.MachineHealthCheck - dst.Spec.ControlPlane.NamingStrategy = restored.Spec.ControlPlane.NamingStrategy - dst.Spec.ControlPlane.NodeDrainTimeout = restored.Spec.ControlPlane.NodeDrainTimeout - dst.Spec.ControlPlane.NodeVolumeDetachTimeout = restored.Spec.ControlPlane.NodeVolumeDetachTimeout - dst.Spec.ControlPlane.NodeDeletionTimeout = restored.Spec.ControlPlane.NodeDeletionTimeout - dst.Spec.Workers.MachinePools = restored.Spec.Workers.MachinePools - - for i := range restored.Spec.Workers.MachineDeployments { - dst.Spec.Workers.MachineDeployments[i].MachineHealthCheck = restored.Spec.Workers.MachineDeployments[i].MachineHealthCheck - dst.Spec.Workers.MachineDeployments[i].FailureDomain = restored.Spec.Workers.MachineDeployments[i].FailureDomain - dst.Spec.Workers.MachineDeployments[i].NamingStrategy = restored.Spec.Workers.MachineDeployments[i].NamingStrategy - dst.Spec.Workers.MachineDeployments[i].NodeDrainTimeout = restored.Spec.Workers.MachineDeployments[i].NodeDrainTimeout - dst.Spec.Workers.MachineDeployments[i].NodeVolumeDetachTimeout = restored.Spec.Workers.MachineDeployments[i].NodeVolumeDetachTimeout - dst.Spec.Workers.MachineDeployments[i].NodeDeletionTimeout = restored.Spec.Workers.MachineDeployments[i].NodeDeletionTimeout - dst.Spec.Workers.MachineDeployments[i].MinReadySeconds = restored.Spec.Workers.MachineDeployments[i].MinReadySeconds - dst.Spec.Workers.MachineDeployments[i].Strategy = restored.Spec.Workers.MachineDeployments[i].Strategy - } - - dst.Status = restored.Status - - return nil -} - -func (dst *ClusterClass) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*clusterv1.ClusterClass) - - if err := Convert_v1beta1_ClusterClass_To_v1alpha4_ClusterClass(src, dst, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata - if err := utilconversion.MarshalData(src, dst); err != nil { - return err - } - - return nil -} - -func (src *ClusterClassList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*clusterv1.ClusterClassList) - - return Convert_v1alpha4_ClusterClassList_To_v1beta1_ClusterClassList(src, dst, nil) -} - -func (dst *ClusterClassList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*clusterv1.ClusterClassList) - - return Convert_v1beta1_ClusterClassList_To_v1alpha4_ClusterClassList(src, dst, nil) -} - -func (src *Machine) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*clusterv1.Machine) - - if err := Convert_v1alpha4_Machine_To_v1beta1_Machine(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &clusterv1.Machine{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - dst.Spec.NodeDeletionTimeout = restored.Spec.NodeDeletionTimeout - dst.Status.CertificatesExpiryDate = restored.Status.CertificatesExpiryDate - dst.Spec.NodeVolumeDetachTimeout = restored.Spec.NodeVolumeDetachTimeout - return nil -} - -func (dst *Machine) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*clusterv1.Machine) - - if err := Convert_v1beta1_Machine_To_v1alpha4_Machine(src, dst, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata - if err := utilconversion.MarshalData(src, dst); err != nil { - return err - } - - return nil -} - -func (src *MachineList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*clusterv1.MachineList) - - return Convert_v1alpha4_MachineList_To_v1beta1_MachineList(src, dst, nil) -} - -func (dst *MachineList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*clusterv1.MachineList) - - return Convert_v1beta1_MachineList_To_v1alpha4_MachineList(src, dst, nil) -} - -func (src *MachineSet) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*clusterv1.MachineSet) - - if err := Convert_v1alpha4_MachineSet_To_v1beta1_MachineSet(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &clusterv1.MachineSet{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - dst.Spec.Template.Spec.NodeDeletionTimeout = restored.Spec.Template.Spec.NodeDeletionTimeout - dst.Spec.Template.Spec.NodeVolumeDetachTimeout = restored.Spec.Template.Spec.NodeVolumeDetachTimeout - return nil -} - -func (dst *MachineSet) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*clusterv1.MachineSet) - - if err := Convert_v1beta1_MachineSet_To_v1alpha4_MachineSet(src, dst, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata - return utilconversion.MarshalData(src, dst) -} - -func (src *MachineSetList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*clusterv1.MachineSetList) - - return Convert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList(src, dst, nil) -} - -func (dst *MachineSetList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*clusterv1.MachineSetList) - - return Convert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList(src, dst, nil) -} - -func (src *MachineDeployment) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*clusterv1.MachineDeployment) - - if err := Convert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &clusterv1.MachineDeployment{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - dst.Spec.Template.Spec.NodeDeletionTimeout = restored.Spec.Template.Spec.NodeDeletionTimeout - dst.Spec.Template.Spec.NodeVolumeDetachTimeout = restored.Spec.Template.Spec.NodeVolumeDetachTimeout - dst.Spec.RolloutAfter = restored.Spec.RolloutAfter - return nil -} - -func (dst *MachineDeployment) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*clusterv1.MachineDeployment) - - if err := Convert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment(src, dst, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata - return utilconversion.MarshalData(src, dst) -} - -func (src *MachineDeploymentList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*clusterv1.MachineDeploymentList) - - return Convert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList(src, dst, nil) -} - -func (dst *MachineDeploymentList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*clusterv1.MachineDeploymentList) - - return Convert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(src, dst, nil) -} - -func (src *MachineHealthCheck) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*clusterv1.MachineHealthCheck) - - return Convert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck(src, dst, nil) -} - -func (dst *MachineHealthCheck) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*clusterv1.MachineHealthCheck) - - return Convert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(src, dst, nil) -} - -func (src *MachineHealthCheckList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*clusterv1.MachineHealthCheckList) - - return Convert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(src, dst, nil) -} - -func (dst *MachineHealthCheckList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*clusterv1.MachineHealthCheckList) - - return Convert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(src, dst, nil) -} - -func Convert_v1alpha4_MachineStatus_To_v1beta1_MachineStatus(in *MachineStatus, out *clusterv1.MachineStatus, s apiconversion.Scope) error { - // Status.version has been removed in v1beta1, thus requiring custom conversion function. the information will be dropped. - return autoConvert_v1alpha4_MachineStatus_To_v1beta1_MachineStatus(in, out, s) -} - -func Convert_v1beta1_ClusterClassSpec_To_v1alpha4_ClusterClassSpec(in *clusterv1.ClusterClassSpec, out *ClusterClassSpec, s apiconversion.Scope) error { - // spec.{variables,patches} has been added with v1beta1. - return autoConvert_v1beta1_ClusterClassSpec_To_v1alpha4_ClusterClassSpec(in, out, s) -} - -func Convert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec(in *clusterv1.MachineSpec, out *MachineSpec, s apiconversion.Scope) error { - // spec.nodeDeletionTimeout has been added with v1beta1. - return autoConvert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec(in, out, s) -} - -func Convert_v1beta1_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(in *clusterv1.MachineDeploymentSpec, out *MachineDeploymentSpec, s apiconversion.Scope) error { - return autoConvert_v1beta1_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(in, out, s) -} - -func Convert_v1beta1_Topology_To_v1alpha4_Topology(in *clusterv1.Topology, out *Topology, s apiconversion.Scope) error { - // spec.topology.variables has been added with v1beta1. - return autoConvert_v1beta1_Topology_To_v1alpha4_Topology(in, out, s) -} - -// Convert_v1beta1_MachineDeploymentTopology_To_v1alpha4_MachineDeploymentTopology is an autogenerated conversion function. -func Convert_v1beta1_MachineDeploymentTopology_To_v1alpha4_MachineDeploymentTopology(in *clusterv1.MachineDeploymentTopology, out *MachineDeploymentTopology, s apiconversion.Scope) error { - // MachineDeploymentTopology.FailureDomain has been added with v1beta1. - return autoConvert_v1beta1_MachineDeploymentTopology_To_v1alpha4_MachineDeploymentTopology(in, out, s) -} - -func Convert_v1beta1_MachineDeploymentClass_To_v1alpha4_MachineDeploymentClass(in *clusterv1.MachineDeploymentClass, out *MachineDeploymentClass, s apiconversion.Scope) error { - // machineDeploymentClass.machineHealthCheck has been added with v1beta1. - return autoConvert_v1beta1_MachineDeploymentClass_To_v1alpha4_MachineDeploymentClass(in, out, s) -} - -func Convert_v1beta1_ControlPlaneClass_To_v1alpha4_ControlPlaneClass(in *clusterv1.ControlPlaneClass, out *ControlPlaneClass, s apiconversion.Scope) error { - // controlPlaneClass.machineHealthCheck has been added with v1beta1. - return autoConvert_v1beta1_ControlPlaneClass_To_v1alpha4_ControlPlaneClass(in, out, s) -} - -func Convert_v1beta1_ControlPlaneTopology_To_v1alpha4_ControlPlaneTopology(in *clusterv1.ControlPlaneTopology, out *ControlPlaneTopology, s apiconversion.Scope) error { - // controlPlaneTopology.nodeDrainTimeout has been added with v1beta1. - return autoConvert_v1beta1_ControlPlaneTopology_To_v1alpha4_ControlPlaneTopology(in, out, s) -} - -func Convert_v1beta1_MachineStatus_To_v1alpha4_MachineStatus(in *clusterv1.MachineStatus, out *MachineStatus, s apiconversion.Scope) error { - // MachineStatus.CertificatesExpiryDate has been added in v1beta1. - return autoConvert_v1beta1_MachineStatus_To_v1alpha4_MachineStatus(in, out, s) -} - -func Convert_v1beta1_ClusterClass_To_v1alpha4_ClusterClass(in *clusterv1.ClusterClass, out *ClusterClass, s apiconversion.Scope) error { - // ClusterClass.Status has been added in v1beta1. - return autoConvert_v1beta1_ClusterClass_To_v1alpha4_ClusterClass(in, out, s) -} - -func Convert_v1beta1_WorkersClass_To_v1alpha4_WorkersClass(in *clusterv1.WorkersClass, out *WorkersClass, s apiconversion.Scope) error { - // WorkersClass.MachinePools has been added in v1beta1. - return autoConvert_v1beta1_WorkersClass_To_v1alpha4_WorkersClass(in, out, s) -} - -func Convert_v1beta1_WorkersTopology_To_v1alpha4_WorkersTopology(in *clusterv1.WorkersTopology, out *WorkersTopology, s apiconversion.Scope) error { - // WorkersTopology.MachinePools has been added in v1beta1. - return autoConvert_v1beta1_WorkersTopology_To_v1alpha4_WorkersTopology(in, out, s) -} diff --git a/api/v1alpha4/conversion_test.go b/api/v1alpha4/conversion_test.go deleted file mode 100644 index ce34632007d9..000000000000 --- a/api/v1alpha4/conversion_test.go +++ /dev/null @@ -1,148 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "strconv" - "testing" - - fuzz "github.com/google/gofuzz" - apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" - runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" - "k8s.io/utils/ptr" - - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -func TestFuzzyConversion(t *testing.T) { - t.Run("for Cluster", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &clusterv1.Cluster{}, - Spoke: &Cluster{}, - FuzzerFuncs: []fuzzer.FuzzerFuncs{ClusterJSONFuzzFuncs}, - })) - t.Run("for ClusterClass", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &clusterv1.ClusterClass{}, - Spoke: &ClusterClass{}, - FuzzerFuncs: []fuzzer.FuzzerFuncs{ClusterClassJSONFuzzFuncs}, - })) - - t.Run("for Machine", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &clusterv1.Machine{}, - Spoke: &Machine{}, - FuzzerFuncs: []fuzzer.FuzzerFuncs{MachineStatusFuzzFunc}, - })) - - t.Run("for MachineSet", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &clusterv1.MachineSet{}, - Spoke: &MachineSet{}, - })) - - t.Run("for MachineDeployment", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &clusterv1.MachineDeployment{}, - Spoke: &MachineDeployment{}, - })) - - t.Run("for MachineHealthCheck", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &clusterv1.MachineHealthCheck{}, - Spoke: &MachineHealthCheck{}, - })) -} - -func MachineStatusFuzzFunc(_ runtimeserializer.CodecFactory) []interface{} { - return []interface{}{ - MachineStatusFuzzer, - } -} - -func MachineStatusFuzzer(in *MachineStatus, c fuzz.Continue) { - c.FuzzNoCustom(in) - - // These fields have been removed in v1beta1 - // data is going to be lost, so we're forcing zero values to avoid round trip errors. - in.Version = nil -} - -func ClusterJSONFuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} { - return []interface{}{ - ClusterVariableFuzzer, - } -} - -func ClusterVariableFuzzer(in *clusterv1.ClusterVariable, c fuzz.Continue) { - c.FuzzNoCustom(in) - - // Not every random byte array is valid JSON, e.g. a string without `""`,so we're setting a valid value. - in.Value = apiextensionsv1.JSON{Raw: []byte("\"test-string\"")} -} - -func ClusterClassJSONFuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} { - return []interface{}{ - JSONPatchFuzzer, - JSONSchemaPropsFuzzer, - } -} - -func JSONPatchFuzzer(in *clusterv1.JSONPatch, c fuzz.Continue) { - c.FuzzNoCustom(in) - - // Not every random byte array is valid JSON, e.g. a string without `""`,so we're setting a valid value. - in.Value = &apiextensionsv1.JSON{Raw: []byte("5")} -} - -func JSONSchemaPropsFuzzer(in *clusterv1.JSONSchemaProps, c fuzz.Continue) { - // NOTE: We have to fuzz the individual fields manually, - // because we cannot call `FuzzNoCustom` as it would lead - // to an infinite recursion. - in.Type = c.RandString() - for i := 0; i < c.Intn(10); i++ { - in.Required = append(in.Required, c.RandString()) - } - in.MaxItems = ptr.To(c.Int63()) - in.MinItems = ptr.To(c.Int63()) - in.UniqueItems = c.RandBool() - in.Format = c.RandString() - in.MaxLength = ptr.To(c.Int63()) - in.MinLength = ptr.To(c.Int63()) - in.Pattern = c.RandString() - in.Maximum = ptr.To(c.Int63()) - in.Maximum = ptr.To(c.Int63()) - in.ExclusiveMaximum = c.RandBool() - in.Minimum = ptr.To(c.Int63()) - in.ExclusiveMinimum = c.RandBool() - - // Not every random byte array is valid JSON, e.g. a string without `""`,so we're setting valid values. - in.Enum = []apiextensionsv1.JSON{ - {Raw: []byte("\"a\"")}, - {Raw: []byte("\"b\"")}, - {Raw: []byte("\"c\"")}, - } - in.Default = &apiextensionsv1.JSON{Raw: []byte(strconv.FormatBool(c.RandBool()))} - - // We're using a copy of the current JSONSchemaProps, - // because we cannot recursively fuzz new schemas. - in.AdditionalProperties = in.DeepCopy() - - // We're using a copy of the current JSONSchemaProps, - // because we cannot recursively fuzz new schemas. - in.Properties = map[string]clusterv1.JSONSchemaProps{} - for i := 0; i < c.Intn(10); i++ { - in.Properties[c.RandString()] = *in.DeepCopy() - } - in.Items = in.DeepCopy() -} diff --git a/api/v1alpha4/doc.go b/api/v1alpha4/doc.go deleted file mode 100644 index 332a9cb32ec9..000000000000 --- a/api/v1alpha4/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains the v1alpha4 API implementation. -// +k8s:conversion-gen=sigs.k8s.io/cluster-api/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 cd8adb96d73e..000000000000 --- a/api/v1alpha4/groupversion_info.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains API Schema definitions for the cluster v1alpha4 API group -// +kubebuilder:object:generate=true -// +groupName=cluster.x-k8s.io -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -var ( - // GroupVersion is group version used to register these objects. - GroupVersion = schema.GroupVersion{Group: "cluster.x-k8s.io", Version: "v1alpha4"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme. - schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = schemeBuilder.AddToScheme - - objectTypes = []runtime.Object{} - - // localSchemeBuilder is used for type conversions. - localSchemeBuilder = schemeBuilder -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(GroupVersion, objectTypes...) - metav1.AddToGroupVersion(scheme, GroupVersion) - return nil -} diff --git a/api/v1alpha4/machine_phase_types.go b/api/v1alpha4/machine_phase_types.go deleted file mode 100644 index a2edb1107bf5..000000000000 --- a/api/v1alpha4/machine_phase_types.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -// MachinePhase is a string representation of a Machine Phase. -// -// This type is a high-level indicator of the status of the Machine as it is provisioned, -// from the API user’s perspective. -// -// The value should not be interpreted by any software components as a reliable indication -// of the actual state of the Machine, and controllers should not use the Machine Phase field -// value when making decisions about what action to take. -// -// Controllers should always look at the actual state of the Machine’s fields to make those decisions. -type MachinePhase string - -const ( - // MachinePhasePending is the first state a Machine is assigned by - // Cluster API Machine controller after being created. - MachinePhasePending = MachinePhase("Pending") - - // MachinePhaseProvisioning is the state when the - // Machine infrastructure is being created. - MachinePhaseProvisioning = MachinePhase("Provisioning") - - // MachinePhaseProvisioned is the state when its - // infrastructure has been created and configured. - MachinePhaseProvisioned = MachinePhase("Provisioned") - - // MachinePhaseRunning is the Machine state when it has - // become a Kubernetes Node in a Ready state. - MachinePhaseRunning = MachinePhase("Running") - - // MachinePhaseDeleting is the Machine state when a delete - // request has been sent to the API Server, - // but its infrastructure has not yet been fully deleted. - MachinePhaseDeleting = MachinePhase("Deleting") - - // MachinePhaseDeleted is the Machine state when the object - // and the related infrastructure is deleted and - // ready to be garbage collected by the API Server. - MachinePhaseDeleted = MachinePhase("Deleted") - - // MachinePhaseFailed is the Machine state when the system - // might require user intervention. - MachinePhaseFailed = MachinePhase("Failed") - - // MachinePhaseUnknown is returned if the Machine state cannot be determined. - MachinePhaseUnknown = MachinePhase("Unknown") -) diff --git a/api/v1alpha4/machine_types.go b/api/v1alpha4/machine_types.go deleted file mode 100644 index 6c9c7875cf74..000000000000 --- a/api/v1alpha4/machine_types.go +++ /dev/null @@ -1,282 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - capierrors "sigs.k8s.io/cluster-api/errors" -) - -const ( - // MachineFinalizer is set on PrepareForCreate callback. - MachineFinalizer = "machine.cluster.x-k8s.io" - - // MachineControlPlaneLabelName is the label set on machines or related objects that are part of a control plane. - MachineControlPlaneLabelName = "cluster.x-k8s.io/control-plane" - - // ExcludeNodeDrainingAnnotation annotation explicitly skips node draining if set. - ExcludeNodeDrainingAnnotation = "machine.cluster.x-k8s.io/exclude-node-draining" - - // MachineSetLabelName is the label set on machines if they're controlled by MachineSet. - MachineSetLabelName = "cluster.x-k8s.io/set-name" - - // MachineDeploymentLabelName is the label set on machines if they're controlled by MachineDeployment. - MachineDeploymentLabelName = "cluster.x-k8s.io/deployment-name" - - // PreDrainDeleteHookAnnotationPrefix annotation specifies the prefix we - // search each annotation for during the pre-drain.delete lifecycle hook - // to pause reconciliation of deletion. These hooks will prevent removal of - // draining the associated node until all are removed. - PreDrainDeleteHookAnnotationPrefix = "pre-drain.delete.hook.machine.cluster.x-k8s.io" - - // PreTerminateDeleteHookAnnotationPrefix annotation specifies the prefix we - // search each annotation for during the pre-terminate.delete lifecycle hook - // to pause reconciliation of deletion. These hooks will prevent removal of - // an instance from an infrastructure provider until all are removed. - PreTerminateDeleteHookAnnotationPrefix = "pre-terminate.delete.hook.machine.cluster.x-k8s.io" -) - -// ANCHOR: MachineSpec - -// MachineSpec defines the desired state of Machine. -type MachineSpec struct { - // ClusterName is the name of the Cluster this object belongs to. - // +kubebuilder:validation:MinLength=1 - ClusterName string `json:"clusterName"` - - // Bootstrap is a reference to a local struct which encapsulates - // fields to configure the Machine’s bootstrapping mechanism. - Bootstrap Bootstrap `json:"bootstrap"` - - // InfrastructureRef is a required reference to a custom resource - // offered by an infrastructure provider. - InfrastructureRef corev1.ObjectReference `json:"infrastructureRef"` - - // Version defines the desired Kubernetes version. - // This field is meant to be optionally used by bootstrap providers. - // +optional - Version *string `json:"version,omitempty"` - - // ProviderID is the identification ID of the machine provided by the provider. - // This field must match the provider ID as seen on the node object corresponding to this machine. - // This field is required by higher level consumers of cluster-api. Example use case is cluster autoscaler - // with cluster-api as provider. Clean-up logic in the autoscaler compares machines to nodes to find out - // machines at provider which could not get registered as Kubernetes nodes. With cluster-api as a - // generic out-of-tree provider for autoscaler, this field is required by autoscaler to be - // able to have a provider view of the list of machines. Another list of nodes is queried from the k8s apiserver - // and then a comparison is done to find out unregistered machines and are marked for delete. - // This field will be set by the actuators and consumed by higher level entities like autoscaler that will - // be interfacing with cluster-api as generic provider. - // +optional - ProviderID *string `json:"providerID,omitempty"` - - // FailureDomain is the failure domain the machine will be created in. - // Must match a key in the FailureDomains map stored on the cluster object. - // +optional - FailureDomain *string `json:"failureDomain,omitempty"` - - // NodeDrainTimeout is the total amount of time that the controller will spend on draining a node. - // The default value is 0, meaning that the node can be drained without any time limitations. - // NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` - // +optional - NodeDrainTimeout *metav1.Duration `json:"nodeDrainTimeout,omitempty"` -} - -// ANCHOR_END: MachineSpec - -// ANCHOR: MachineStatus - -// MachineStatus defines the observed state of Machine. -type MachineStatus struct { - // NodeRef will point to the corresponding Node if it exists. - // +optional - NodeRef *corev1.ObjectReference `json:"nodeRef,omitempty"` - - // NodeInfo is a set of ids/uuids to uniquely identify the node. - // More info: https://kubernetes.io/docs/concepts/nodes/node/#info - // +optional - NodeInfo *corev1.NodeSystemInfo `json:"nodeInfo,omitempty"` - - // LastUpdated identifies when the phase of the Machine last transitioned. - // +optional - LastUpdated *metav1.Time `json:"lastUpdated,omitempty"` - - // Version specifies the current version of Kubernetes running - // on the corresponding Node. This is meant to be a means of bubbling - // up status from the Node to the Machine. - // It is entirely optional, but useful for end-user UX if it’s present. - // +optional - Version *string `json:"version,omitempty"` - - // FailureReason will be set in the event that there is a terminal problem - // reconciling the Machine and will contain a succinct value suitable - // for machine interpretation. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the Machine's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of Machines - // can be added as events to the Machine object and/or logged in the - // controller's output. - // +optional - FailureReason *capierrors.MachineStatusError `json:"failureReason,omitempty"` - - // FailureMessage will be set in the event that there is a terminal problem - // reconciling the Machine and will contain a more verbose string suitable - // for logging and human consumption. - // - // This field should not be set for transitive errors that a controller - // faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the Machine's spec or the configuration of - // the controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the controller, or the - // responsible controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of Machines - // can be added as events to the Machine object and/or logged in the - // controller's output. - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` - - // Addresses is a list of addresses assigned to the machine. - // This field is copied from the infrastructure provider reference. - // +optional - Addresses MachineAddresses `json:"addresses,omitempty"` - - // Phase represents the current phase of machine actuation. - // E.g. Pending, Running, Terminating, Failed etc. - // +optional - Phase string `json:"phase,omitempty"` - - // BootstrapReady is the state of the bootstrap provider. - // +optional - BootstrapReady bool `json:"bootstrapReady"` - - // InfrastructureReady is the state of the infrastructure provider. - // +optional - InfrastructureReady bool `json:"infrastructureReady"` - - // ObservedGeneration is the latest generation observed by the controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // Conditions defines current service state of the Machine. - // +optional - Conditions Conditions `json:"conditions,omitempty"` -} - -// ANCHOR_END: MachineStatus - -// SetTypedPhase sets the Phase field to the string representation of MachinePhase. -func (m *MachineStatus) SetTypedPhase(p MachinePhase) { - m.Phase = string(p) -} - -// GetTypedPhase attempts to parse the Phase field and return -// the typed MachinePhase representation as described in `machine_phase_types.go`. -func (m *MachineStatus) GetTypedPhase() MachinePhase { - switch phase := MachinePhase(m.Phase); phase { - case - MachinePhasePending, - MachinePhaseProvisioning, - MachinePhaseProvisioned, - MachinePhaseRunning, - MachinePhaseDeleting, - MachinePhaseDeleted, - MachinePhaseFailed: - return phase - default: - return MachinePhaseUnknown - } -} - -// ANCHOR: Bootstrap - -// Bootstrap encapsulates fields to configure the Machine’s bootstrapping mechanism. -type Bootstrap struct { - // ConfigRef is a reference to a bootstrap provider-specific resource - // that holds configuration details. The reference is optional to - // allow users/operators to specify Bootstrap.DataSecretName without - // the need of a controller. - // +optional - ConfigRef *corev1.ObjectReference `json:"configRef,omitempty"` - - // DataSecretName is the name of the secret that stores the bootstrap data script. - // If nil, the Machine should remain in the Pending state. - // +optional - DataSecretName *string `json:"dataSecretName,omitempty"` -} - -// ANCHOR_END: Bootstrap - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:resource:path=machines,shortName=ma,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of Machine" -// +kubebuilder:printcolumn:name="ProviderID",type="string",JSONPath=".spec.providerID",description="Provider ID" -// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="Machine status such as Terminating/Pending/Running/Failed etc" -// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.version",description="Kubernetes version associated with this Machine" -// +kubebuilder:printcolumn:name="NodeName",type="string",JSONPath=".status.nodeRef.name",description="Node name associated with this machine",priority=1 - -// Machine is the Schema for the machines API. -// -// Deprecated: This type will be removed in one of the next releases. -type Machine struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec MachineSpec `json:"spec,omitempty"` - Status MachineStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (m *Machine) GetConditions() Conditions { - return m.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (m *Machine) SetConditions(conditions Conditions) { - m.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// MachineList contains a list of Machine. -// -// Deprecated: This type will be removed in one of the next releases. -type MachineList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []Machine `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &Machine{}, &MachineList{}) -} diff --git a/api/v1alpha4/machinedeployment_types.go b/api/v1alpha4/machinedeployment_types.go deleted file mode 100644 index dd71006fe24d..000000000000 --- a/api/v1alpha4/machinedeployment_types.go +++ /dev/null @@ -1,320 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" -) - -const ( - // MachineDeploymentTopologyFinalizer is the finalizer used by the topology MachineDeployment controller to - // clean up referenced template resources if necessary when a MachineDeployment is being deleted. - MachineDeploymentTopologyFinalizer = "machinedeployment.topology.cluster.x-k8s.io" -) - -// MachineDeploymentStrategyType defines the type of MachineDeployment rollout strategies. -type MachineDeploymentStrategyType string - -const ( - // RollingUpdateMachineDeploymentStrategyType replaces the old MachineSet by new one using rolling update - // i.e. gradually scale down the old MachineSet and scale up the new one. - RollingUpdateMachineDeploymentStrategyType MachineDeploymentStrategyType = "RollingUpdate" - - // OnDeleteMachineDeploymentStrategyType replaces old MachineSets when the deletion of the associated machines are completed. - OnDeleteMachineDeploymentStrategyType MachineDeploymentStrategyType = "OnDelete" - - // RevisionAnnotation is the revision annotation of a machine deployment's machine sets which records its rollout sequence. - RevisionAnnotation = "machinedeployment.clusters.x-k8s.io/revision" - - // RevisionHistoryAnnotation maintains the history of all old revisions that a machine set has served for a machine deployment. - RevisionHistoryAnnotation = "machinedeployment.clusters.x-k8s.io/revision-history" - - // DesiredReplicasAnnotation is the desired replicas for a machine deployment recorded as an annotation - // in its machine sets. Helps in separating scaling events from the rollout process and for - // determining if the new machine set for a deployment is really saturated. - DesiredReplicasAnnotation = "machinedeployment.clusters.x-k8s.io/desired-replicas" - - // MaxReplicasAnnotation is the maximum replicas a deployment can have at a given point, which - // is machinedeployment.spec.replicas + maxSurge. Used by the underlying machine sets to estimate their - // proportions in case the deployment has surge replicas. - MaxReplicasAnnotation = "machinedeployment.clusters.x-k8s.io/max-replicas" - - // MachineDeploymentUniqueLabel is the label applied to Machines - // in a MachineDeployment containing the hash of the template. - MachineDeploymentUniqueLabel = "machine-template-hash" -) - -// ANCHOR: MachineDeploymentSpec - -// MachineDeploymentSpec defines the desired state of MachineDeployment. -type MachineDeploymentSpec struct { - // ClusterName is the name of the Cluster this object belongs to. - // +kubebuilder:validation:MinLength=1 - ClusterName string `json:"clusterName"` - - // Number of desired machines. Defaults to 1. - // This is a pointer to distinguish between explicit zero and not specified. - // +optional - // +kubebuilder:default=1 - Replicas *int32 `json:"replicas,omitempty"` - - // Label selector for machines. Existing MachineSets whose machines are - // selected by this will be the ones affected by this deployment. - // It must match the machine template's labels. - Selector metav1.LabelSelector `json:"selector"` - - // Template describes the machines that will be created. - Template MachineTemplateSpec `json:"template"` - - // The deployment strategy to use to replace existing machines with - // new ones. - // +optional - Strategy *MachineDeploymentStrategy `json:"strategy,omitempty"` - - // Minimum number of seconds for which a newly created machine should - // be ready. - // Defaults to 0 (machine will be considered available as soon as it - // is ready) - // +optional - MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` - - // The number of old MachineSets to retain to allow rollback. - // This is a pointer to distinguish between explicit zero and not specified. - // Defaults to 1. - // +optional - RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"` - - // Indicates that the deployment is paused. - // +optional - Paused bool `json:"paused,omitempty"` - - // The maximum time in seconds for a deployment to make progress before it - // is considered to be failed. The deployment controller will continue to - // process failed deployments and a condition with a ProgressDeadlineExceeded - // reason will be surfaced in the deployment status. Note that progress will - // not be estimated during the time a deployment is paused. Defaults to 600s. - ProgressDeadlineSeconds *int32 `json:"progressDeadlineSeconds,omitempty"` -} - -// ANCHOR_END: MachineDeploymentSpec - -// ANCHOR: MachineDeploymentStrategy - -// MachineDeploymentStrategy describes how to replace existing machines -// with new ones. -type MachineDeploymentStrategy struct { - // Type of deployment. - // Default is RollingUpdate. - // +kubebuilder:validation:Enum=RollingUpdate;OnDelete - // +optional - Type MachineDeploymentStrategyType `json:"type,omitempty"` - - // Rolling update config params. Present only if - // MachineDeploymentStrategyType = RollingUpdate. - // +optional - RollingUpdate *MachineRollingUpdateDeployment `json:"rollingUpdate,omitempty"` -} - -// ANCHOR_END: MachineDeploymentStrategy - -// ANCHOR: MachineRollingUpdateDeployment - -// MachineRollingUpdateDeployment is used to control the desired behavior of rolling update. -type MachineRollingUpdateDeployment struct { - // The maximum number of machines that can be unavailable during the update. - // Value can be an absolute number (ex: 5) or a percentage of desired - // machines (ex: 10%). - // Absolute number is calculated from percentage by rounding down. - // This can not be 0 if MaxSurge is 0. - // Defaults to 0. - // Example: when this is set to 30%, the old MachineSet can be scaled - // down to 70% of desired machines immediately when the rolling update - // starts. Once new machines are ready, old MachineSet can be scaled - // down further, followed by scaling up the new MachineSet, ensuring - // that the total number of machines available at all times - // during the update is at least 70% of desired machines. - // +optional - MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` - - // The maximum number of machines that can be scheduled above the - // desired number of machines. - // Value can be an absolute number (ex: 5) or a percentage of - // desired machines (ex: 10%). - // This can not be 0 if MaxUnavailable is 0. - // Absolute number is calculated from percentage by rounding up. - // Defaults to 1. - // Example: when this is set to 30%, the new MachineSet can be scaled - // up immediately when the rolling update starts, such that the total - // number of old and new machines do not exceed 130% of desired - // machines. Once old machines have been killed, new MachineSet can - // be scaled up further, ensuring that total number of machines running - // at any time during the update is at most 130% of desired machines. - // +optional - MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` - - // DeletePolicy defines the policy used by the MachineDeployment to identify nodes to delete when downscaling. - // Valid values are "Random, "Newest", "Oldest" - // When no value is supplied, the default DeletePolicy of MachineSet is used - // +kubebuilder:validation:Enum=Random;Newest;Oldest - // +optional - DeletePolicy *string `json:"deletePolicy,omitempty"` -} - -// ANCHOR_END: MachineRollingUpdateDeployment - -// ANCHOR: MachineDeploymentStatus - -// MachineDeploymentStatus defines the observed state of MachineDeployment. -type MachineDeploymentStatus struct { - // The generation observed by the deployment controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // Selector is the same as the label selector but in the string format to avoid introspection - // by clients. The string will be in the same format as the query-param syntax. - // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors - // +optional - Selector string `json:"selector,omitempty"` - - // Total number of non-terminated machines targeted by this deployment - // (their labels match the selector). - // +optional - Replicas int32 `json:"replicas,omitempty"` - - // Total number of non-terminated machines targeted by this deployment - // that have the desired template spec. - // +optional - UpdatedReplicas int32 `json:"updatedReplicas,omitempty"` - - // Total number of ready machines targeted by this deployment. - // +optional - ReadyReplicas int32 `json:"readyReplicas,omitempty"` - - // Total number of available machines (ready for at least minReadySeconds) - // targeted by this deployment. - // +optional - AvailableReplicas int32 `json:"availableReplicas,omitempty"` - - // Total number of unavailable machines targeted by this deployment. - // This is the total number of machines that are still required for - // the deployment to have 100% available capacity. They may either - // be machines that are running but not yet available or machines - // that still have not been created. - // +optional - UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"` - - // Phase represents the current phase of a MachineDeployment (ScalingUp, ScalingDown, Running, Failed, or Unknown). - // +optional - Phase string `json:"phase,omitempty"` - - // Conditions defines current service state of the MachineDeployment. - // +optional - Conditions Conditions `json:"conditions,omitempty"` -} - -// ANCHOR_END: MachineDeploymentStatus - -// MachineDeploymentPhase indicates the progress of the machine deployment. -type MachineDeploymentPhase string - -const ( - // MachineDeploymentPhaseScalingUp indicates the MachineDeployment is scaling up. - MachineDeploymentPhaseScalingUp = MachineDeploymentPhase("ScalingUp") - - // MachineDeploymentPhaseScalingDown indicates the MachineDeployment is scaling down. - MachineDeploymentPhaseScalingDown = MachineDeploymentPhase("ScalingDown") - - // MachineDeploymentPhaseRunning indicates scaling has completed and all Machines are running. - MachineDeploymentPhaseRunning = MachineDeploymentPhase("Running") - - // MachineDeploymentPhaseFailed indicates there was a problem scaling and user intervention might be required. - MachineDeploymentPhaseFailed = MachineDeploymentPhase("Failed") - - // MachineDeploymentPhaseUnknown indicates the state of the MachineDeployment cannot be determined. - MachineDeploymentPhaseUnknown = MachineDeploymentPhase("Unknown") -) - -// SetTypedPhase sets the Phase field to the string representation of MachineDeploymentPhase. -func (md *MachineDeploymentStatus) SetTypedPhase(p MachineDeploymentPhase) { - md.Phase = string(p) -} - -// GetTypedPhase attempts to parse the Phase field and return -// the typed MachineDeploymentPhase representation. -func (md *MachineDeploymentStatus) GetTypedPhase() MachineDeploymentPhase { - switch phase := MachineDeploymentPhase(md.Phase); phase { - case - MachineDeploymentPhaseScalingDown, - MachineDeploymentPhaseScalingUp, - MachineDeploymentPhaseRunning, - MachineDeploymentPhaseFailed: - return phase - default: - return MachineDeploymentPhaseUnknown - } -} - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:resource:path=machinedeployments,shortName=md,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector -// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachineDeployment" -// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="MachineDeployment status such as ScalingUp/ScalingDown/Running/Failed/Unknown" -// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Total number of non-terminated machines targeted by this MachineDeployment" -// +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="Total number of ready machines targeted by this MachineDeployment" -// +kubebuilder:printcolumn:name="Updated",type=integer,JSONPath=".status.updatedReplicas",description="Total number of non-terminated machines targeted by this deployment that have the desired template spec" -// +kubebuilder:printcolumn:name="Unavailable",type=integer,JSONPath=".status.unavailableReplicas",description="Total number of unavailable machines targeted by this MachineDeployment" - -// MachineDeployment is the Schema for the machinedeployments API. -// -// Deprecated: This type will be removed in one of the next releases. -type MachineDeployment struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec MachineDeploymentSpec `json:"spec,omitempty"` - Status MachineDeploymentStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// MachineDeploymentList contains a list of MachineDeployment. -// -// Deprecated: This type will be removed in one of the next releases. -type MachineDeploymentList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []MachineDeployment `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &MachineDeployment{}, &MachineDeploymentList{}) -} - -// GetConditions returns the set of conditions for the machinedeployment. -func (m *MachineDeployment) GetConditions() Conditions { - return m.Status.Conditions -} - -// SetConditions updates the set of conditions on the machinedeployment. -func (m *MachineDeployment) SetConditions(conditions Conditions) { - m.Status.Conditions = conditions -} diff --git a/api/v1alpha4/machinehealthcheck_types.go b/api/v1alpha4/machinehealthcheck_types.go deleted file mode 100644 index 2933768ca88f..000000000000 --- a/api/v1alpha4/machinehealthcheck_types.go +++ /dev/null @@ -1,175 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" -) - -// ANCHOR: MachineHealthCheckSpec - -// MachineHealthCheckSpec defines the desired state of MachineHealthCheck. -type MachineHealthCheckSpec struct { - // ClusterName is the name of the Cluster this object belongs to. - // +kubebuilder:validation:MinLength=1 - ClusterName string `json:"clusterName"` - - // Label selector to match machines whose health will be exercised - Selector metav1.LabelSelector `json:"selector"` - - // UnhealthyConditions contains a list of the conditions that determine - // whether a node is considered unhealthy. The conditions are combined in a - // logical OR, i.e. if any of the conditions is met, the node is unhealthy. - // - // +kubebuilder:validation:MinItems=1 - UnhealthyConditions []UnhealthyCondition `json:"unhealthyConditions"` - - // Any further remediation is only allowed if at most "MaxUnhealthy" machines selected by - // "selector" are not healthy. - // +optional - MaxUnhealthy *intstr.IntOrString `json:"maxUnhealthy,omitempty"` - - // Any further remediation is only allowed if the number of machines selected by "selector" as not healthy - // is within the range of "UnhealthyRange". Takes precedence over MaxUnhealthy. - // Eg. "[3-5]" - This means that remediation will be allowed only when: - // (a) there are at least 3 unhealthy machines (and) - // (b) there are at most 5 unhealthy machines - // +optional - // +kubebuilder:validation:Pattern=^\[[0-9]+-[0-9]+\]$ - UnhealthyRange *string `json:"unhealthyRange,omitempty"` - - // Machines older than this duration without a node will be considered to have - // failed and will be remediated. - // If not set, this value is defaulted to 10 minutes. - // If you wish to disable this feature, set the value explicitly to 0. - // +optional - NodeStartupTimeout *metav1.Duration `json:"nodeStartupTimeout,omitempty"` - - // RemediationTemplate is a reference to a remediation template - // provided by an infrastructure provider. - // - // This field is completely optional, when filled, the MachineHealthCheck controller - // creates a new object from the template referenced and hands off remediation of the machine to - // a controller that lives outside of Cluster API. - // +optional - RemediationTemplate *corev1.ObjectReference `json:"remediationTemplate,omitempty"` -} - -// ANCHOR_END: MachineHealthCHeckSpec - -// ANCHOR: UnhealthyCondition - -// UnhealthyCondition represents a Node condition type and value with a timeout -// specified as a duration. When the named condition has been in the given -// status for at least the timeout value, a node is considered unhealthy. -type UnhealthyCondition struct { - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:MinLength=1 - Type corev1.NodeConditionType `json:"type"` - - // +kubebuilder:validation:Type=string - // +kubebuilder:validation:MinLength=1 - Status corev1.ConditionStatus `json:"status"` - - Timeout metav1.Duration `json:"timeout"` -} - -// ANCHOR_END: UnhealthyCondition - -// ANCHOR: MachineHealthCheckStatus - -// MachineHealthCheckStatus defines the observed state of MachineHealthCheck. -type MachineHealthCheckStatus struct { - // total number of machines counted by this machine health check - // +kubebuilder:validation:Minimum=0 - ExpectedMachines int32 `json:"expectedMachines,omitempty"` - - // total number of healthy machines counted by this machine health check - // +kubebuilder:validation:Minimum=0 - CurrentHealthy int32 `json:"currentHealthy,omitempty"` - - // RemediationsAllowed is the number of further remediations allowed by this machine health check before - // maxUnhealthy short circuiting will be applied - // +kubebuilder:validation:Minimum=0 - RemediationsAllowed int32 `json:"remediationsAllowed,omitempty"` - - // ObservedGeneration is the latest generation observed by the controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // Targets shows the current list of machines the machine health check is watching - // +optional - Targets []string `json:"targets,omitempty"` - - // Conditions defines current service state of the MachineHealthCheck. - // +optional - Conditions Conditions `json:"conditions,omitempty"` -} - -// ANCHOR_END: MachineHealthCheckStatus - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:resource:path=machinehealthchecks,shortName=mhc;mhcs,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachineHealthCheck" -// +kubebuilder:printcolumn:name="MaxUnhealthy",type="string",JSONPath=".spec.maxUnhealthy",description="Maximum number of unhealthy machines allowed" -// +kubebuilder:printcolumn:name="ExpectedMachines",type="integer",JSONPath=".status.expectedMachines",description="Number of machines currently monitored" -// +kubebuilder:printcolumn:name="CurrentHealthy",type="integer",JSONPath=".status.currentHealthy",description="Current observed healthy machines" - -// MachineHealthCheck is the Schema for the machinehealthchecks API. -// -// Deprecated: This type will be removed in one of the next releases. -type MachineHealthCheck struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - // Specification of machine health check policy - Spec MachineHealthCheckSpec `json:"spec,omitempty"` - - // Most recently observed status of MachineHealthCheck resource - Status MachineHealthCheckStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (m *MachineHealthCheck) GetConditions() Conditions { - return m.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (m *MachineHealthCheck) SetConditions(conditions Conditions) { - m.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// MachineHealthCheckList contains a list of MachineHealthCheck. -// -// Deprecated: This type will be removed in one of the next releases. -type MachineHealthCheckList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []MachineHealthCheck `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &MachineHealthCheck{}, &MachineHealthCheckList{}) -} diff --git a/api/v1alpha4/machineset_types.go b/api/v1alpha4/machineset_types.go deleted file mode 100644 index 59c2bb7a106c..000000000000 --- a/api/v1alpha4/machineset_types.go +++ /dev/null @@ -1,243 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - metav1validation "k8s.io/apimachinery/pkg/apis/meta/v1/validation" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/util/validation/field" - - capierrors "sigs.k8s.io/cluster-api/errors" -) - -const ( - // MachineSetTopologyFinalizer is the finalizer used by the topology MachineDeployment controller to - // clean up referenced template resources if necessary when a MachineSet is being deleted. - MachineSetTopologyFinalizer = "machineset.topology.cluster.x-k8s.io" -) - -// ANCHOR: MachineSetSpec - -// MachineSetSpec defines the desired state of MachineSet. -type MachineSetSpec struct { - // ClusterName is the name of the Cluster this object belongs to. - // +kubebuilder:validation:MinLength=1 - ClusterName string `json:"clusterName"` - - // Replicas is the number of desired replicas. - // This is a pointer to distinguish between explicit zero and unspecified. - // Defaults to 1. - // +optional - // +kubebuilder:default=1 - Replicas *int32 `json:"replicas,omitempty"` - - // MinReadySeconds is the minimum number of seconds for which a newly created machine should be ready. - // Defaults to 0 (machine will be considered available as soon as it is ready) - // +optional - MinReadySeconds int32 `json:"minReadySeconds,omitempty"` - - // DeletePolicy defines the policy used to identify nodes to delete when downscaling. - // Defaults to "Random". Valid values are "Random, "Newest", "Oldest" - // +kubebuilder:validation:Enum=Random;Newest;Oldest - DeletePolicy string `json:"deletePolicy,omitempty"` - - // Selector is a label query over machines that should match the replica count. - // Label keys and values that must match in order to be controlled by this MachineSet. - // It must match the machine template's labels. - // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - Selector metav1.LabelSelector `json:"selector"` - - // Template is the object that describes the machine that will be created if - // insufficient replicas are detected. - // Object references to custom resources are treated as templates. - // +optional - Template MachineTemplateSpec `json:"template,omitempty"` -} - -// ANCHOR_END: MachineSetSpec - -// ANCHOR: MachineTemplateSpec - -// MachineTemplateSpec describes the data needed to create a Machine from a template. -type MachineTemplateSpec struct { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - ObjectMeta `json:"metadata,omitempty"` - - // Specification of the desired behavior of the machine. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - // +optional - Spec MachineSpec `json:"spec,omitempty"` -} - -// ANCHOR_END: MachineTemplateSpec - -// MachineSetDeletePolicy defines how priority is assigned to nodes to delete when -// downscaling a MachineSet. Defaults to "Random". -type MachineSetDeletePolicy string - -const ( - // RandomMachineSetDeletePolicy prioritizes both Machines that have the annotation - // "cluster.x-k8s.io/delete-machine=yes" and Machines that are unhealthy - // (Status.FailureReason or Status.FailureMessage are set to a non-empty value). - // Finally, it picks Machines at random to delete. - RandomMachineSetDeletePolicy MachineSetDeletePolicy = "Random" - - // NewestMachineSetDeletePolicy prioritizes both Machines that have the annotation - // "cluster.x-k8s.io/delete-machine=yes" and Machines that are unhealthy - // (Status.FailureReason or Status.FailureMessage are set to a non-empty value). - // It then prioritizes the newest Machines for deletion based on the Machine's CreationTimestamp. - NewestMachineSetDeletePolicy MachineSetDeletePolicy = "Newest" - - // OldestMachineSetDeletePolicy prioritizes both Machines that have the annotation - // "cluster.x-k8s.io/delete-machine=yes" and Machines that are unhealthy - // (Status.FailureReason or Status.FailureMessage are set to a non-empty value). - // It then prioritizes the oldest Machines for deletion based on the Machine's CreationTimestamp. - OldestMachineSetDeletePolicy MachineSetDeletePolicy = "Oldest" -) - -// ANCHOR: MachineSetStatus - -// MachineSetStatus defines the observed state of MachineSet. -type MachineSetStatus struct { - // Selector is the same as the label selector but in the string format to avoid introspection - // by clients. The string will be in the same format as the query-param syntax. - // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors - // +optional - Selector string `json:"selector,omitempty"` - - // Replicas is the most recently observed number of replicas. - // +optional - Replicas int32 `json:"replicas,omitempty"` - - // The number of replicas that have labels matching the labels of the machine template of the MachineSet. - // +optional - FullyLabeledReplicas int32 `json:"fullyLabeledReplicas,omitempty"` - - // The number of ready replicas for this MachineSet. A machine is considered ready when the node has been created and is "Ready". - // +optional - ReadyReplicas int32 `json:"readyReplicas,omitempty"` - - // The number of available replicas (ready for at least minReadySeconds) for this MachineSet. - // +optional - AvailableReplicas int32 `json:"availableReplicas,omitempty"` - - // ObservedGeneration reflects the generation of the most recently observed MachineSet. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // In the event that there is a terminal problem reconciling the - // replicas, both FailureReason and FailureMessage will be set. FailureReason - // will be populated with a succinct value suitable for machine - // interpretation, while FailureMessage will contain a more verbose - // string suitable for logging and human consumption. - // - // These fields should not be set for transitive errors that a - // controller faces that are expected to be fixed automatically over - // time (like service outages), but instead indicate that something is - // fundamentally wrong with the MachineTemplate's spec or the configuration of - // the machine controller, and that manual intervention is required. Examples - // of terminal errors would be invalid combinations of settings in the - // spec, values that are unsupported by the machine controller, or the - // responsible machine controller itself being critically misconfigured. - // - // Any transient errors that occur during the reconciliation of Machines - // can be added as events to the MachineSet object and/or logged in the - // controller's output. - // +optional - FailureReason *capierrors.MachineSetStatusError `json:"failureReason,omitempty"` - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` - // Conditions defines current service state of the MachineSet. - // +optional - Conditions Conditions `json:"conditions,omitempty"` -} - -// ANCHOR_END: MachineSetStatus - -// Validate validates the MachineSet fields. -func (m *MachineSet) Validate() field.ErrorList { - errors := field.ErrorList{} - - // validate spec.selector and spec.template.labels - fldPath := field.NewPath("spec") - errors = append(errors, metav1validation.ValidateLabelSelector(&m.Spec.Selector, metav1validation.LabelSelectorValidationOptions{}, fldPath.Child("selector"))...) - if len(m.Spec.Selector.MatchLabels)+len(m.Spec.Selector.MatchExpressions) == 0 { - errors = append(errors, field.Invalid(fldPath.Child("selector"), m.Spec.Selector, "empty selector is not valid for MachineSet.")) - } - selector, err := metav1.LabelSelectorAsSelector(&m.Spec.Selector) - if err != nil { - errors = append(errors, field.Invalid(fldPath.Child("selector"), m.Spec.Selector, "invalid label selector.")) - } else { - labels := labels.Set(m.Spec.Template.Labels) - if !selector.Matches(labels) { - errors = append(errors, field.Invalid(fldPath.Child("template", "metadata", "labels"), m.Spec.Template.Labels, "`selector` does not match template `labels`")) - } - } - - return errors -} - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:resource:path=machinesets,shortName=ms,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector -// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".spec.clusterName",description="Cluster" -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachineSet" -// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Total number of non-terminated machines targeted by this machineset" -// +kubebuilder:printcolumn:name="Available",type="integer",JSONPath=".status.availableReplicas",description="Total number of available machines (ready for at least minReadySeconds)" -// +kubebuilder:printcolumn:name="Ready",type="integer",JSONPath=".status.readyReplicas",description="Total number of ready machines targeted by this machineset." - -// MachineSet is the Schema for the machinesets API. -// -// Deprecated: This type will be removed in one of the next releases. -type MachineSet struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec MachineSetSpec `json:"spec,omitempty"` - Status MachineSetStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// MachineSetList contains a list of MachineSet. -// -// Deprecated: This type will be removed in one of the next releases. -type MachineSetList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []MachineSet `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &MachineSet{}, &MachineSetList{}) -} - -// GetConditions returns the set of conditions for the MachineSet. -func (m *MachineSet) GetConditions() Conditions { - return m.Status.Conditions -} - -// SetConditions updates the set of conditions on the MachineSet. -func (m *MachineSet) SetConditions(conditions Conditions) { - m.Status.Conditions = conditions -} diff --git a/api/v1alpha4/zz_generated.conversion.go b/api/v1alpha4/zz_generated.conversion.go deleted file mode 100644 index e89720cc15fc..000000000000 --- a/api/v1alpha4/zz_generated.conversion.go +++ /dev/null @@ -1,1861 +0,0 @@ -//go:build !ignore_autogenerated_core -// +build !ignore_autogenerated_core - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - unsafe "unsafe" - - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - intstr "k8s.io/apimachinery/pkg/util/intstr" - v1beta1 "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((*APIEndpoint)(nil), (*v1beta1.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(a.(*APIEndpoint), b.(*v1beta1.APIEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.APIEndpoint)(nil), (*APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(a.(*v1beta1.APIEndpoint), b.(*APIEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Bootstrap)(nil), (*v1beta1.Bootstrap)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap(a.(*Bootstrap), b.(*v1beta1.Bootstrap), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Bootstrap)(nil), (*Bootstrap)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap(a.(*v1beta1.Bootstrap), b.(*Bootstrap), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Cluster)(nil), (*v1beta1.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Cluster_To_v1beta1_Cluster(a.(*Cluster), b.(*v1beta1.Cluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Cluster)(nil), (*Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Cluster_To_v1alpha4_Cluster(a.(*v1beta1.Cluster), b.(*Cluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterClass)(nil), (*v1beta1.ClusterClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass(a.(*ClusterClass), b.(*v1beta1.ClusterClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterClassList)(nil), (*v1beta1.ClusterClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterClassList_To_v1beta1_ClusterClassList(a.(*ClusterClassList), b.(*v1beta1.ClusterClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterClassList)(nil), (*ClusterClassList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterClassList_To_v1alpha4_ClusterClassList(a.(*v1beta1.ClusterClassList), b.(*ClusterClassList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterClassSpec)(nil), (*v1beta1.ClusterClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec(a.(*ClusterClassSpec), b.(*v1beta1.ClusterClassSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterList)(nil), (*v1beta1.ClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterList_To_v1beta1_ClusterList(a.(*ClusterList), b.(*v1beta1.ClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterList)(nil), (*ClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterList_To_v1alpha4_ClusterList(a.(*v1beta1.ClusterList), b.(*ClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterNetwork)(nil), (*v1beta1.ClusterNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterNetwork_To_v1beta1_ClusterNetwork(a.(*ClusterNetwork), b.(*v1beta1.ClusterNetwork), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterNetwork)(nil), (*ClusterNetwork)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterNetwork_To_v1alpha4_ClusterNetwork(a.(*v1beta1.ClusterNetwork), b.(*ClusterNetwork), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterSpec)(nil), (*v1beta1.ClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec(a.(*ClusterSpec), b.(*v1beta1.ClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterSpec)(nil), (*ClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec(a.(*v1beta1.ClusterSpec), b.(*ClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterStatus)(nil), (*v1beta1.ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(a.(*ClusterStatus), b.(*v1beta1.ClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterStatus)(nil), (*ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(a.(*v1beta1.ClusterStatus), b.(*ClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Condition)(nil), (*v1beta1.Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Condition_To_v1beta1_Condition(a.(*Condition), b.(*v1beta1.Condition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Condition)(nil), (*Condition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Condition_To_v1alpha4_Condition(a.(*v1beta1.Condition), b.(*Condition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ControlPlaneClass)(nil), (*v1beta1.ControlPlaneClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass(a.(*ControlPlaneClass), b.(*v1beta1.ControlPlaneClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ControlPlaneTopology)(nil), (*v1beta1.ControlPlaneTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(a.(*ControlPlaneTopology), b.(*v1beta1.ControlPlaneTopology), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*FailureDomainSpec)(nil), (*v1beta1.FailureDomainSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec(a.(*FailureDomainSpec), b.(*v1beta1.FailureDomainSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.FailureDomainSpec)(nil), (*FailureDomainSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(a.(*v1beta1.FailureDomainSpec), b.(*FailureDomainSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*LocalObjectTemplate)(nil), (*v1beta1.LocalObjectTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(a.(*LocalObjectTemplate), b.(*v1beta1.LocalObjectTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.LocalObjectTemplate)(nil), (*LocalObjectTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(a.(*v1beta1.LocalObjectTemplate), b.(*LocalObjectTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Machine)(nil), (*v1beta1.Machine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Machine_To_v1beta1_Machine(a.(*Machine), b.(*v1beta1.Machine), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Machine)(nil), (*Machine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Machine_To_v1alpha4_Machine(a.(*v1beta1.Machine), b.(*Machine), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineAddress)(nil), (*v1beta1.MachineAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineAddress_To_v1beta1_MachineAddress(a.(*MachineAddress), b.(*v1beta1.MachineAddress), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineAddress)(nil), (*MachineAddress)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineAddress_To_v1alpha4_MachineAddress(a.(*v1beta1.MachineAddress), b.(*MachineAddress), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineDeployment)(nil), (*v1beta1.MachineDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment(a.(*MachineDeployment), b.(*v1beta1.MachineDeployment), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeployment)(nil), (*MachineDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment(a.(*v1beta1.MachineDeployment), b.(*MachineDeployment), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentClass)(nil), (*v1beta1.MachineDeploymentClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(a.(*MachineDeploymentClass), b.(*v1beta1.MachineDeploymentClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentClassTemplate)(nil), (*v1beta1.MachineDeploymentClassTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate(a.(*MachineDeploymentClassTemplate), b.(*v1beta1.MachineDeploymentClassTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentClassTemplate)(nil), (*MachineDeploymentClassTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate(a.(*v1beta1.MachineDeploymentClassTemplate), b.(*MachineDeploymentClassTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentList)(nil), (*v1beta1.MachineDeploymentList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList(a.(*MachineDeploymentList), b.(*v1beta1.MachineDeploymentList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentList)(nil), (*MachineDeploymentList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(a.(*v1beta1.MachineDeploymentList), b.(*MachineDeploymentList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentSpec)(nil), (*v1beta1.MachineDeploymentSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(a.(*MachineDeploymentSpec), b.(*v1beta1.MachineDeploymentSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentStatus)(nil), (*v1beta1.MachineDeploymentStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(a.(*MachineDeploymentStatus), b.(*v1beta1.MachineDeploymentStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentStatus)(nil), (*MachineDeploymentStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(a.(*v1beta1.MachineDeploymentStatus), b.(*MachineDeploymentStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentStrategy)(nil), (*v1beta1.MachineDeploymentStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy(a.(*MachineDeploymentStrategy), b.(*v1beta1.MachineDeploymentStrategy), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineDeploymentStrategy)(nil), (*MachineDeploymentStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy(a.(*v1beta1.MachineDeploymentStrategy), b.(*MachineDeploymentStrategy), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineDeploymentTopology)(nil), (*v1beta1.MachineDeploymentTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(a.(*MachineDeploymentTopology), b.(*v1beta1.MachineDeploymentTopology), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineHealthCheck)(nil), (*v1beta1.MachineHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck(a.(*MachineHealthCheck), b.(*v1beta1.MachineHealthCheck), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineHealthCheck)(nil), (*MachineHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(a.(*v1beta1.MachineHealthCheck), b.(*MachineHealthCheck), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineHealthCheckList)(nil), (*v1beta1.MachineHealthCheckList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(a.(*MachineHealthCheckList), b.(*v1beta1.MachineHealthCheckList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineHealthCheckList)(nil), (*MachineHealthCheckList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(a.(*v1beta1.MachineHealthCheckList), b.(*MachineHealthCheckList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineHealthCheckSpec)(nil), (*v1beta1.MachineHealthCheckSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(a.(*MachineHealthCheckSpec), b.(*v1beta1.MachineHealthCheckSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineHealthCheckSpec)(nil), (*MachineHealthCheckSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(a.(*v1beta1.MachineHealthCheckSpec), b.(*MachineHealthCheckSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineHealthCheckStatus)(nil), (*v1beta1.MachineHealthCheckStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(a.(*MachineHealthCheckStatus), b.(*v1beta1.MachineHealthCheckStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineHealthCheckStatus)(nil), (*MachineHealthCheckStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(a.(*v1beta1.MachineHealthCheckStatus), b.(*MachineHealthCheckStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineList)(nil), (*v1beta1.MachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineList_To_v1beta1_MachineList(a.(*MachineList), b.(*v1beta1.MachineList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineList)(nil), (*MachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineList_To_v1alpha4_MachineList(a.(*v1beta1.MachineList), b.(*MachineList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineRollingUpdateDeployment)(nil), (*v1beta1.MachineRollingUpdateDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(a.(*MachineRollingUpdateDeployment), b.(*v1beta1.MachineRollingUpdateDeployment), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineRollingUpdateDeployment)(nil), (*MachineRollingUpdateDeployment)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(a.(*v1beta1.MachineRollingUpdateDeployment), b.(*MachineRollingUpdateDeployment), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineSet)(nil), (*v1beta1.MachineSet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineSet_To_v1beta1_MachineSet(a.(*MachineSet), b.(*v1beta1.MachineSet), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSet)(nil), (*MachineSet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineSet_To_v1alpha4_MachineSet(a.(*v1beta1.MachineSet), b.(*MachineSet), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineSetList)(nil), (*v1beta1.MachineSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList(a.(*MachineSetList), b.(*v1beta1.MachineSetList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSetList)(nil), (*MachineSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList(a.(*v1beta1.MachineSetList), b.(*MachineSetList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineSetSpec)(nil), (*v1beta1.MachineSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec(a.(*MachineSetSpec), b.(*v1beta1.MachineSetSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSetSpec)(nil), (*MachineSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec(a.(*v1beta1.MachineSetSpec), b.(*MachineSetSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineSetStatus)(nil), (*v1beta1.MachineSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus(a.(*MachineSetStatus), b.(*v1beta1.MachineSetStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineSetStatus)(nil), (*MachineSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus(a.(*v1beta1.MachineSetStatus), b.(*MachineSetStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineSpec)(nil), (*v1beta1.MachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec(a.(*MachineSpec), b.(*v1beta1.MachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachineTemplateSpec)(nil), (*v1beta1.MachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(a.(*MachineTemplateSpec), b.(*v1beta1.MachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachineTemplateSpec)(nil), (*MachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(a.(*v1beta1.MachineTemplateSpec), b.(*MachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NetworkRanges)(nil), (*v1beta1.NetworkRanges)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NetworkRanges_To_v1beta1_NetworkRanges(a.(*NetworkRanges), b.(*v1beta1.NetworkRanges), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.NetworkRanges)(nil), (*NetworkRanges)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NetworkRanges_To_v1alpha4_NetworkRanges(a.(*v1beta1.NetworkRanges), b.(*NetworkRanges), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ObjectMeta)(nil), (*v1beta1.ObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(a.(*ObjectMeta), b.(*v1beta1.ObjectMeta), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ObjectMeta)(nil), (*ObjectMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(a.(*v1beta1.ObjectMeta), b.(*ObjectMeta), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Topology)(nil), (*v1beta1.Topology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Topology_To_v1beta1_Topology(a.(*Topology), b.(*v1beta1.Topology), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*UnhealthyCondition)(nil), (*v1beta1.UnhealthyCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_UnhealthyCondition_To_v1beta1_UnhealthyCondition(a.(*UnhealthyCondition), b.(*v1beta1.UnhealthyCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.UnhealthyCondition)(nil), (*UnhealthyCondition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_UnhealthyCondition_To_v1alpha4_UnhealthyCondition(a.(*v1beta1.UnhealthyCondition), b.(*UnhealthyCondition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*WorkersClass)(nil), (*v1beta1.WorkersClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass(a.(*WorkersClass), b.(*v1beta1.WorkersClass), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*WorkersTopology)(nil), (*v1beta1.WorkersTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_WorkersTopology_To_v1beta1_WorkersTopology(a.(*WorkersTopology), b.(*v1beta1.WorkersTopology), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*MachineStatus)(nil), (*v1beta1.MachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachineStatus_To_v1beta1_MachineStatus(a.(*MachineStatus), b.(*v1beta1.MachineStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.ClusterClassSpec)(nil), (*ClusterClassSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterClassSpec_To_v1alpha4_ClusterClassSpec(a.(*v1beta1.ClusterClassSpec), b.(*ClusterClassSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.ClusterClass)(nil), (*ClusterClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterClass_To_v1alpha4_ClusterClass(a.(*v1beta1.ClusterClass), b.(*ClusterClass), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.ControlPlaneClass)(nil), (*ControlPlaneClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ControlPlaneClass_To_v1alpha4_ControlPlaneClass(a.(*v1beta1.ControlPlaneClass), b.(*ControlPlaneClass), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.ControlPlaneTopology)(nil), (*ControlPlaneTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ControlPlaneTopology_To_v1alpha4_ControlPlaneTopology(a.(*v1beta1.ControlPlaneTopology), b.(*ControlPlaneTopology), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.MachineDeploymentClass)(nil), (*MachineDeploymentClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineDeploymentClass_To_v1alpha4_MachineDeploymentClass(a.(*v1beta1.MachineDeploymentClass), b.(*MachineDeploymentClass), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.MachineDeploymentSpec)(nil), (*MachineDeploymentSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(a.(*v1beta1.MachineDeploymentSpec), b.(*MachineDeploymentSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.MachineDeploymentTopology)(nil), (*MachineDeploymentTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineDeploymentTopology_To_v1alpha4_MachineDeploymentTopology(a.(*v1beta1.MachineDeploymentTopology), b.(*MachineDeploymentTopology), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.MachineSpec)(nil), (*MachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec(a.(*v1beta1.MachineSpec), b.(*MachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.MachineStatus)(nil), (*MachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachineStatus_To_v1alpha4_MachineStatus(a.(*v1beta1.MachineStatus), b.(*MachineStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.Topology)(nil), (*Topology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Topology_To_v1alpha4_Topology(a.(*v1beta1.Topology), b.(*Topology), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.WorkersClass)(nil), (*WorkersClass)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_WorkersClass_To_v1alpha4_WorkersClass(a.(*v1beta1.WorkersClass), b.(*WorkersClass), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.WorkersTopology)(nil), (*WorkersTopology)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_WorkersTopology_To_v1alpha4_WorkersTopology(a.(*v1beta1.WorkersTopology), b.(*WorkersTopology), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in *APIEndpoint, out *v1beta1.APIEndpoint, s conversion.Scope) error { - out.Host = in.Host - out.Port = in.Port - return nil -} - -// Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint is an autogenerated conversion function. -func Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in *APIEndpoint, out *v1beta1.APIEndpoint, s conversion.Scope) error { - return autoConvert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in, out, s) -} - -func autoConvert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in *v1beta1.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { - out.Host = in.Host - out.Port = in.Port - return nil -} - -// Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint is an autogenerated conversion function. -func Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in *v1beta1.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { - return autoConvert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in, out, s) -} - -func autoConvert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap(in *Bootstrap, out *v1beta1.Bootstrap, s conversion.Scope) error { - out.ConfigRef = (*v1.ObjectReference)(unsafe.Pointer(in.ConfigRef)) - out.DataSecretName = (*string)(unsafe.Pointer(in.DataSecretName)) - return nil -} - -// Convert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap is an autogenerated conversion function. -func Convert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap(in *Bootstrap, out *v1beta1.Bootstrap, s conversion.Scope) error { - return autoConvert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap(in, out, s) -} - -func autoConvert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap(in *v1beta1.Bootstrap, out *Bootstrap, s conversion.Scope) error { - out.ConfigRef = (*v1.ObjectReference)(unsafe.Pointer(in.ConfigRef)) - out.DataSecretName = (*string)(unsafe.Pointer(in.DataSecretName)) - return nil -} - -// Convert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap is an autogenerated conversion function. -func Convert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap(in *v1beta1.Bootstrap, out *Bootstrap, s conversion.Scope) error { - return autoConvert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap(in, out, s) -} - -func autoConvert_v1alpha4_Cluster_To_v1beta1_Cluster(in *Cluster, out *v1beta1.Cluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_Cluster_To_v1beta1_Cluster is an autogenerated conversion function. -func Convert_v1alpha4_Cluster_To_v1beta1_Cluster(in *Cluster, out *v1beta1.Cluster, s conversion.Scope) error { - return autoConvert_v1alpha4_Cluster_To_v1beta1_Cluster(in, out, s) -} - -func autoConvert_v1beta1_Cluster_To_v1alpha4_Cluster(in *v1beta1.Cluster, out *Cluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_Cluster_To_v1alpha4_Cluster is an autogenerated conversion function. -func Convert_v1beta1_Cluster_To_v1alpha4_Cluster(in *v1beta1.Cluster, out *Cluster, s conversion.Scope) error { - return autoConvert_v1beta1_Cluster_To_v1alpha4_Cluster(in, out, s) -} - -func autoConvert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass(in *ClusterClass, out *v1beta1.ClusterClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass is an autogenerated conversion function. -func Convert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass(in *ClusterClass, out *v1beta1.ClusterClass, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass(in, out, s) -} - -func autoConvert_v1beta1_ClusterClass_To_v1alpha4_ClusterClass(in *v1beta1.ClusterClass, out *ClusterClass, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_ClusterClassSpec_To_v1alpha4_ClusterClassSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - // WARNING: in.Status requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_ClusterClassList_To_v1beta1_ClusterClassList(in *ClusterClassList, out *v1beta1.ClusterClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.ClusterClass, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_ClusterClass_To_v1beta1_ClusterClass(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_ClusterClassList_To_v1beta1_ClusterClassList is an autogenerated conversion function. -func Convert_v1alpha4_ClusterClassList_To_v1beta1_ClusterClassList(in *ClusterClassList, out *v1beta1.ClusterClassList, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterClassList_To_v1beta1_ClusterClassList(in, out, s) -} - -func autoConvert_v1beta1_ClusterClassList_To_v1alpha4_ClusterClassList(in *v1beta1.ClusterClassList, out *ClusterClassList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterClass, len(*in)) - for i := range *in { - if err := Convert_v1beta1_ClusterClass_To_v1alpha4_ClusterClass(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_ClusterClassList_To_v1alpha4_ClusterClassList is an autogenerated conversion function. -func Convert_v1beta1_ClusterClassList_To_v1alpha4_ClusterClassList(in *v1beta1.ClusterClassList, out *ClusterClassList, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterClassList_To_v1alpha4_ClusterClassList(in, out, s) -} - -func autoConvert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec(in *ClusterClassSpec, out *v1beta1.ClusterClassSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(&in.Infrastructure, &out.Infrastructure, s); err != nil { - return err - } - if err := Convert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass(&in.ControlPlane, &out.ControlPlane, s); err != nil { - return err - } - if err := Convert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass(&in.Workers, &out.Workers, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec is an autogenerated conversion function. -func Convert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec(in *ClusterClassSpec, out *v1beta1.ClusterClassSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterClassSpec_To_v1beta1_ClusterClassSpec(in, out, s) -} - -func autoConvert_v1beta1_ClusterClassSpec_To_v1alpha4_ClusterClassSpec(in *v1beta1.ClusterClassSpec, out *ClusterClassSpec, s conversion.Scope) error { - if err := Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(&in.Infrastructure, &out.Infrastructure, s); err != nil { - return err - } - if err := Convert_v1beta1_ControlPlaneClass_To_v1alpha4_ControlPlaneClass(&in.ControlPlane, &out.ControlPlane, s); err != nil { - return err - } - if err := Convert_v1beta1_WorkersClass_To_v1alpha4_WorkersClass(&in.Workers, &out.Workers, s); err != nil { - return err - } - // WARNING: in.Variables requires manual conversion: does not exist in peer-type - // WARNING: in.Patches requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_ClusterList_To_v1beta1_ClusterList(in *ClusterList, out *v1beta1.ClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.Cluster, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_Cluster_To_v1beta1_Cluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_ClusterList_To_v1beta1_ClusterList is an autogenerated conversion function. -func Convert_v1alpha4_ClusterList_To_v1beta1_ClusterList(in *ClusterList, out *v1beta1.ClusterList, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterList_To_v1beta1_ClusterList(in, out, s) -} - -func autoConvert_v1beta1_ClusterList_To_v1alpha4_ClusterList(in *v1beta1.ClusterList, out *ClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Cluster, len(*in)) - for i := range *in { - if err := Convert_v1beta1_Cluster_To_v1alpha4_Cluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_ClusterList_To_v1alpha4_ClusterList is an autogenerated conversion function. -func Convert_v1beta1_ClusterList_To_v1alpha4_ClusterList(in *v1beta1.ClusterList, out *ClusterList, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterList_To_v1alpha4_ClusterList(in, out, s) -} - -func autoConvert_v1alpha4_ClusterNetwork_To_v1beta1_ClusterNetwork(in *ClusterNetwork, out *v1beta1.ClusterNetwork, s conversion.Scope) error { - out.APIServerPort = (*int32)(unsafe.Pointer(in.APIServerPort)) - out.Services = (*v1beta1.NetworkRanges)(unsafe.Pointer(in.Services)) - out.Pods = (*v1beta1.NetworkRanges)(unsafe.Pointer(in.Pods)) - out.ServiceDomain = in.ServiceDomain - return nil -} - -// Convert_v1alpha4_ClusterNetwork_To_v1beta1_ClusterNetwork is an autogenerated conversion function. -func Convert_v1alpha4_ClusterNetwork_To_v1beta1_ClusterNetwork(in *ClusterNetwork, out *v1beta1.ClusterNetwork, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterNetwork_To_v1beta1_ClusterNetwork(in, out, s) -} - -func autoConvert_v1beta1_ClusterNetwork_To_v1alpha4_ClusterNetwork(in *v1beta1.ClusterNetwork, out *ClusterNetwork, s conversion.Scope) error { - out.APIServerPort = (*int32)(unsafe.Pointer(in.APIServerPort)) - out.Services = (*NetworkRanges)(unsafe.Pointer(in.Services)) - out.Pods = (*NetworkRanges)(unsafe.Pointer(in.Pods)) - out.ServiceDomain = in.ServiceDomain - return nil -} - -// Convert_v1beta1_ClusterNetwork_To_v1alpha4_ClusterNetwork is an autogenerated conversion function. -func Convert_v1beta1_ClusterNetwork_To_v1alpha4_ClusterNetwork(in *v1beta1.ClusterNetwork, out *ClusterNetwork, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterNetwork_To_v1alpha4_ClusterNetwork(in, out, s) -} - -func autoConvert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec(in *ClusterSpec, out *v1beta1.ClusterSpec, s conversion.Scope) error { - out.Paused = in.Paused - out.ClusterNetwork = (*v1beta1.ClusterNetwork)(unsafe.Pointer(in.ClusterNetwork)) - if err := Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { - return err - } - out.ControlPlaneRef = (*v1.ObjectReference)(unsafe.Pointer(in.ControlPlaneRef)) - out.InfrastructureRef = (*v1.ObjectReference)(unsafe.Pointer(in.InfrastructureRef)) - if in.Topology != nil { - in, out := &in.Topology, &out.Topology - *out = new(v1beta1.Topology) - if err := Convert_v1alpha4_Topology_To_v1beta1_Topology(*in, *out, s); err != nil { - return err - } - } else { - out.Topology = nil - } - return nil -} - -// Convert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec is an autogenerated conversion function. -func Convert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec(in *ClusterSpec, out *v1beta1.ClusterSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterSpec_To_v1beta1_ClusterSpec(in, out, s) -} - -func autoConvert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec(in *v1beta1.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { - out.Paused = in.Paused - out.ClusterNetwork = (*ClusterNetwork)(unsafe.Pointer(in.ClusterNetwork)) - if err := Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { - return err - } - out.ControlPlaneRef = (*v1.ObjectReference)(unsafe.Pointer(in.ControlPlaneRef)) - out.InfrastructureRef = (*v1.ObjectReference)(unsafe.Pointer(in.InfrastructureRef)) - if in.Topology != nil { - in, out := &in.Topology, &out.Topology - *out = new(Topology) - if err := Convert_v1beta1_Topology_To_v1alpha4_Topology(*in, *out, s); err != nil { - return err - } - } else { - out.Topology = nil - } - return nil -} - -// Convert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec is an autogenerated conversion function. -func Convert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec(in *v1beta1.ClusterSpec, out *ClusterSpec, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterSpec_To_v1alpha4_ClusterSpec(in, out, s) -} - -func autoConvert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(in *ClusterStatus, out *v1beta1.ClusterStatus, s conversion.Scope) error { - out.FailureDomains = *(*v1beta1.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) - out.FailureReason = (*errors.ClusterStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Phase = in.Phase - out.InfrastructureReady = in.InfrastructureReady - out.ControlPlaneReady = in.ControlPlaneReady - out.Conditions = *(*v1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - out.ObservedGeneration = in.ObservedGeneration - return nil -} - -// Convert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus is an autogenerated conversion function. -func Convert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(in *ClusterStatus, out *v1beta1.ClusterStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(in, out, s) -} - -func autoConvert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(in *v1beta1.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - out.FailureDomains = *(*FailureDomains)(unsafe.Pointer(&in.FailureDomains)) - out.FailureReason = (*errors.ClusterStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Phase = in.Phase - out.InfrastructureReady = in.InfrastructureReady - out.ControlPlaneReady = in.ControlPlaneReady - out.Conditions = *(*Conditions)(unsafe.Pointer(&in.Conditions)) - out.ObservedGeneration = in.ObservedGeneration - return nil -} - -// Convert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus is an autogenerated conversion function. -func Convert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(in *v1beta1.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(in, out, s) -} - -func autoConvert_v1alpha4_Condition_To_v1beta1_Condition(in *Condition, out *v1beta1.Condition, s conversion.Scope) error { - out.Type = v1beta1.ConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - out.Severity = v1beta1.ConditionSeverity(in.Severity) - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_v1alpha4_Condition_To_v1beta1_Condition is an autogenerated conversion function. -func Convert_v1alpha4_Condition_To_v1beta1_Condition(in *Condition, out *v1beta1.Condition, s conversion.Scope) error { - return autoConvert_v1alpha4_Condition_To_v1beta1_Condition(in, out, s) -} - -func autoConvert_v1beta1_Condition_To_v1alpha4_Condition(in *v1beta1.Condition, out *Condition, s conversion.Scope) error { - out.Type = ConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - out.Severity = ConditionSeverity(in.Severity) - out.LastTransitionTime = in.LastTransitionTime - out.Reason = in.Reason - out.Message = in.Message - return nil -} - -// Convert_v1beta1_Condition_To_v1alpha4_Condition is an autogenerated conversion function. -func Convert_v1beta1_Condition_To_v1alpha4_Condition(in *v1beta1.Condition, out *Condition, s conversion.Scope) error { - return autoConvert_v1beta1_Condition_To_v1alpha4_Condition(in, out, s) -} - -func autoConvert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass(in *ControlPlaneClass, out *v1beta1.ControlPlaneClass, s conversion.Scope) error { - if err := Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { - return err - } - if err := Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(&in.LocalObjectTemplate, &out.LocalObjectTemplate, s); err != nil { - return err - } - out.MachineInfrastructure = (*v1beta1.LocalObjectTemplate)(unsafe.Pointer(in.MachineInfrastructure)) - return nil -} - -// Convert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass is an autogenerated conversion function. -func Convert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass(in *ControlPlaneClass, out *v1beta1.ControlPlaneClass, s conversion.Scope) error { - return autoConvert_v1alpha4_ControlPlaneClass_To_v1beta1_ControlPlaneClass(in, out, s) -} - -func autoConvert_v1beta1_ControlPlaneClass_To_v1alpha4_ControlPlaneClass(in *v1beta1.ControlPlaneClass, out *ControlPlaneClass, s conversion.Scope) error { - if err := Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { - return err - } - if err := Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(&in.LocalObjectTemplate, &out.LocalObjectTemplate, s); err != nil { - return err - } - out.MachineInfrastructure = (*LocalObjectTemplate)(unsafe.Pointer(in.MachineInfrastructure)) - // WARNING: in.MachineHealthCheck requires manual conversion: does not exist in peer-type - // WARNING: in.NamingStrategy requires manual conversion: does not exist in peer-type - // WARNING: in.NodeDrainTimeout requires manual conversion: does not exist in peer-type - // WARNING: in.NodeVolumeDetachTimeout requires manual conversion: does not exist in peer-type - // WARNING: in.NodeDeletionTimeout requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(in *ControlPlaneTopology, out *v1beta1.ControlPlaneTopology, s conversion.Scope) error { - if err := Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { - return err - } - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - return nil -} - -// Convert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology is an autogenerated conversion function. -func Convert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(in *ControlPlaneTopology, out *v1beta1.ControlPlaneTopology, s conversion.Scope) error { - return autoConvert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(in, out, s) -} - -func autoConvert_v1beta1_ControlPlaneTopology_To_v1alpha4_ControlPlaneTopology(in *v1beta1.ControlPlaneTopology, out *ControlPlaneTopology, s conversion.Scope) error { - if err := Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { - return err - } - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - // WARNING: in.MachineHealthCheck requires manual conversion: does not exist in peer-type - // WARNING: in.NodeDrainTimeout requires manual conversion: does not exist in peer-type - // WARNING: in.NodeVolumeDetachTimeout requires manual conversion: does not exist in peer-type - // WARNING: in.NodeDeletionTimeout requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec(in *FailureDomainSpec, out *v1beta1.FailureDomainSpec, s conversion.Scope) error { - out.ControlPlane = in.ControlPlane - out.Attributes = *(*map[string]string)(unsafe.Pointer(&in.Attributes)) - return nil -} - -// Convert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec is an autogenerated conversion function. -func Convert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec(in *FailureDomainSpec, out *v1beta1.FailureDomainSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec(in, out, s) -} - -func autoConvert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(in *v1beta1.FailureDomainSpec, out *FailureDomainSpec, s conversion.Scope) error { - out.ControlPlane = in.ControlPlane - out.Attributes = *(*map[string]string)(unsafe.Pointer(&in.Attributes)) - return nil -} - -// Convert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec is an autogenerated conversion function. -func Convert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(in *v1beta1.FailureDomainSpec, out *FailureDomainSpec, s conversion.Scope) error { - return autoConvert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(in, out, s) -} - -func autoConvert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(in *LocalObjectTemplate, out *v1beta1.LocalObjectTemplate, s conversion.Scope) error { - out.Ref = (*v1.ObjectReference)(unsafe.Pointer(in.Ref)) - return nil -} - -// Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate is an autogenerated conversion function. -func Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(in *LocalObjectTemplate, out *v1beta1.LocalObjectTemplate, s conversion.Scope) error { - return autoConvert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(in, out, s) -} - -func autoConvert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(in *v1beta1.LocalObjectTemplate, out *LocalObjectTemplate, s conversion.Scope) error { - out.Ref = (*v1.ObjectReference)(unsafe.Pointer(in.Ref)) - return nil -} - -// Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate is an autogenerated conversion function. -func Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(in *v1beta1.LocalObjectTemplate, out *LocalObjectTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(in, out, s) -} - -func autoConvert_v1alpha4_Machine_To_v1beta1_Machine(in *Machine, out *v1beta1.Machine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_MachineStatus_To_v1beta1_MachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_Machine_To_v1beta1_Machine is an autogenerated conversion function. -func Convert_v1alpha4_Machine_To_v1beta1_Machine(in *Machine, out *v1beta1.Machine, s conversion.Scope) error { - return autoConvert_v1alpha4_Machine_To_v1beta1_Machine(in, out, s) -} - -func autoConvert_v1beta1_Machine_To_v1alpha4_Machine(in *v1beta1.Machine, out *Machine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_MachineStatus_To_v1alpha4_MachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_Machine_To_v1alpha4_Machine is an autogenerated conversion function. -func Convert_v1beta1_Machine_To_v1alpha4_Machine(in *v1beta1.Machine, out *Machine, s conversion.Scope) error { - return autoConvert_v1beta1_Machine_To_v1alpha4_Machine(in, out, s) -} - -func autoConvert_v1alpha4_MachineAddress_To_v1beta1_MachineAddress(in *MachineAddress, out *v1beta1.MachineAddress, s conversion.Scope) error { - out.Type = v1beta1.MachineAddressType(in.Type) - out.Address = in.Address - return nil -} - -// Convert_v1alpha4_MachineAddress_To_v1beta1_MachineAddress is an autogenerated conversion function. -func Convert_v1alpha4_MachineAddress_To_v1beta1_MachineAddress(in *MachineAddress, out *v1beta1.MachineAddress, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineAddress_To_v1beta1_MachineAddress(in, out, s) -} - -func autoConvert_v1beta1_MachineAddress_To_v1alpha4_MachineAddress(in *v1beta1.MachineAddress, out *MachineAddress, s conversion.Scope) error { - out.Type = MachineAddressType(in.Type) - out.Address = in.Address - return nil -} - -// Convert_v1beta1_MachineAddress_To_v1alpha4_MachineAddress is an autogenerated conversion function. -func Convert_v1beta1_MachineAddress_To_v1alpha4_MachineAddress(in *v1beta1.MachineAddress, out *MachineAddress, s conversion.Scope) error { - return autoConvert_v1beta1_MachineAddress_To_v1alpha4_MachineAddress(in, out, s) -} - -func autoConvert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment(in *MachineDeployment, out *v1beta1.MachineDeployment, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment(in *MachineDeployment, out *v1beta1.MachineDeployment, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment(in, out, s) -} - -func autoConvert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment(in *v1beta1.MachineDeployment, out *MachineDeployment, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment is an autogenerated conversion function. -func Convert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment(in *v1beta1.MachineDeployment, out *MachineDeployment, s conversion.Scope) error { - return autoConvert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment(in, out, s) -} - -func autoConvert_v1alpha4_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(in *MachineDeploymentClass, out *v1beta1.MachineDeploymentClass, s conversion.Scope) error { - out.Class = in.Class - if err := Convert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(in *MachineDeploymentClass, out *v1beta1.MachineDeploymentClass, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(in, out, s) -} - -func autoConvert_v1beta1_MachineDeploymentClass_To_v1alpha4_MachineDeploymentClass(in *v1beta1.MachineDeploymentClass, out *MachineDeploymentClass, s conversion.Scope) error { - out.Class = in.Class - if err := Convert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate(&in.Template, &out.Template, s); err != nil { - return err - } - // WARNING: in.MachineHealthCheck requires manual conversion: does not exist in peer-type - // WARNING: in.FailureDomain requires manual conversion: does not exist in peer-type - // WARNING: in.NamingStrategy requires manual conversion: does not exist in peer-type - // WARNING: in.NodeDrainTimeout requires manual conversion: does not exist in peer-type - // WARNING: in.NodeVolumeDetachTimeout requires manual conversion: does not exist in peer-type - // WARNING: in.NodeDeletionTimeout requires manual conversion: does not exist in peer-type - // WARNING: in.MinReadySeconds requires manual conversion: does not exist in peer-type - // WARNING: in.Strategy requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate(in *MachineDeploymentClassTemplate, out *v1beta1.MachineDeploymentClassTemplate, s conversion.Scope) error { - if err := Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { - return err - } - if err := Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(&in.Bootstrap, &out.Bootstrap, s); err != nil { - return err - } - if err := Convert_v1alpha4_LocalObjectTemplate_To_v1beta1_LocalObjectTemplate(&in.Infrastructure, &out.Infrastructure, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate(in *MachineDeploymentClassTemplate, out *v1beta1.MachineDeploymentClassTemplate, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentClassTemplate_To_v1beta1_MachineDeploymentClassTemplate(in, out, s) -} - -func autoConvert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate(in *v1beta1.MachineDeploymentClassTemplate, out *MachineDeploymentClassTemplate, s conversion.Scope) error { - if err := Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { - return err - } - if err := Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(&in.Bootstrap, &out.Bootstrap, s); err != nil { - return err - } - if err := Convert_v1beta1_LocalObjectTemplate_To_v1alpha4_LocalObjectTemplate(&in.Infrastructure, &out.Infrastructure, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate is an autogenerated conversion function. -func Convert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate(in *v1beta1.MachineDeploymentClassTemplate, out *MachineDeploymentClassTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_MachineDeploymentClassTemplate_To_v1alpha4_MachineDeploymentClassTemplate(in, out, s) -} - -func autoConvert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList(in *MachineDeploymentList, out *v1beta1.MachineDeploymentList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.MachineDeployment, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_MachineDeployment_To_v1beta1_MachineDeployment(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList(in *MachineDeploymentList, out *v1beta1.MachineDeploymentList, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentList_To_v1beta1_MachineDeploymentList(in, out, s) -} - -func autoConvert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(in *v1beta1.MachineDeploymentList, out *MachineDeploymentList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachineDeployment, len(*in)) - for i := range *in { - if err := Convert_v1beta1_MachineDeployment_To_v1alpha4_MachineDeployment(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList is an autogenerated conversion function. -func Convert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(in *v1beta1.MachineDeploymentList, out *MachineDeploymentList, s conversion.Scope) error { - return autoConvert_v1beta1_MachineDeploymentList_To_v1alpha4_MachineDeploymentList(in, out, s) -} - -func autoConvert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(in *MachineDeploymentSpec, out *v1beta1.MachineDeploymentSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - out.Selector = in.Selector - if err := Convert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - out.Strategy = (*v1beta1.MachineDeploymentStrategy)(unsafe.Pointer(in.Strategy)) - out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) - out.RevisionHistoryLimit = (*int32)(unsafe.Pointer(in.RevisionHistoryLimit)) - out.Paused = in.Paused - out.ProgressDeadlineSeconds = (*int32)(unsafe.Pointer(in.ProgressDeadlineSeconds)) - return nil -} - -// Convert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(in *MachineDeploymentSpec, out *v1beta1.MachineDeploymentSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentSpec_To_v1beta1_MachineDeploymentSpec(in, out, s) -} - -func autoConvert_v1beta1_MachineDeploymentSpec_To_v1alpha4_MachineDeploymentSpec(in *v1beta1.MachineDeploymentSpec, out *MachineDeploymentSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - // WARNING: in.RolloutAfter requires manual conversion: does not exist in peer-type - out.Selector = in.Selector - if err := Convert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - out.Strategy = (*MachineDeploymentStrategy)(unsafe.Pointer(in.Strategy)) - out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) - out.RevisionHistoryLimit = (*int32)(unsafe.Pointer(in.RevisionHistoryLimit)) - out.Paused = in.Paused - out.ProgressDeadlineSeconds = (*int32)(unsafe.Pointer(in.ProgressDeadlineSeconds)) - return nil -} - -func autoConvert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(in *MachineDeploymentStatus, out *v1beta1.MachineDeploymentStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - out.Selector = in.Selector - out.Replicas = in.Replicas - out.UpdatedReplicas = in.UpdatedReplicas - out.ReadyReplicas = in.ReadyReplicas - out.AvailableReplicas = in.AvailableReplicas - out.UnavailableReplicas = in.UnavailableReplicas - out.Phase = in.Phase - out.Conditions = *(*v1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(in *MachineDeploymentStatus, out *v1beta1.MachineDeploymentStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentStatus_To_v1beta1_MachineDeploymentStatus(in, out, s) -} - -func autoConvert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(in *v1beta1.MachineDeploymentStatus, out *MachineDeploymentStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - out.Selector = in.Selector - out.Replicas = in.Replicas - out.UpdatedReplicas = in.UpdatedReplicas - out.ReadyReplicas = in.ReadyReplicas - out.AvailableReplicas = in.AvailableReplicas - out.UnavailableReplicas = in.UnavailableReplicas - out.Phase = in.Phase - out.Conditions = *(*Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus is an autogenerated conversion function. -func Convert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(in *v1beta1.MachineDeploymentStatus, out *MachineDeploymentStatus, s conversion.Scope) error { - return autoConvert_v1beta1_MachineDeploymentStatus_To_v1alpha4_MachineDeploymentStatus(in, out, s) -} - -func autoConvert_v1alpha4_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy(in *MachineDeploymentStrategy, out *v1beta1.MachineDeploymentStrategy, s conversion.Scope) error { - out.Type = v1beta1.MachineDeploymentStrategyType(in.Type) - out.RollingUpdate = (*v1beta1.MachineRollingUpdateDeployment)(unsafe.Pointer(in.RollingUpdate)) - return nil -} - -// Convert_v1alpha4_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy(in *MachineDeploymentStrategy, out *v1beta1.MachineDeploymentStrategy, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentStrategy_To_v1beta1_MachineDeploymentStrategy(in, out, s) -} - -func autoConvert_v1beta1_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy(in *v1beta1.MachineDeploymentStrategy, out *MachineDeploymentStrategy, s conversion.Scope) error { - out.Type = MachineDeploymentStrategyType(in.Type) - out.RollingUpdate = (*MachineRollingUpdateDeployment)(unsafe.Pointer(in.RollingUpdate)) - return nil -} - -// Convert_v1beta1_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy is an autogenerated conversion function. -func Convert_v1beta1_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy(in *v1beta1.MachineDeploymentStrategy, out *MachineDeploymentStrategy, s conversion.Scope) error { - return autoConvert_v1beta1_MachineDeploymentStrategy_To_v1alpha4_MachineDeploymentStrategy(in, out, s) -} - -func autoConvert_v1alpha4_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(in *MachineDeploymentTopology, out *v1beta1.MachineDeploymentTopology, s conversion.Scope) error { - if err := Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { - return err - } - out.Class = in.Class - out.Name = in.Name - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - return nil -} - -// Convert_v1alpha4_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology is an autogenerated conversion function. -func Convert_v1alpha4_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(in *MachineDeploymentTopology, out *v1beta1.MachineDeploymentTopology, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(in, out, s) -} - -func autoConvert_v1beta1_MachineDeploymentTopology_To_v1alpha4_MachineDeploymentTopology(in *v1beta1.MachineDeploymentTopology, out *MachineDeploymentTopology, s conversion.Scope) error { - if err := Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(&in.Metadata, &out.Metadata, s); err != nil { - return err - } - out.Class = in.Class - out.Name = in.Name - // WARNING: in.FailureDomain requires manual conversion: does not exist in peer-type - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - // WARNING: in.MachineHealthCheck requires manual conversion: does not exist in peer-type - // WARNING: in.NodeDrainTimeout requires manual conversion: does not exist in peer-type - // WARNING: in.NodeVolumeDetachTimeout requires manual conversion: does not exist in peer-type - // WARNING: in.NodeDeletionTimeout requires manual conversion: does not exist in peer-type - // WARNING: in.MinReadySeconds requires manual conversion: does not exist in peer-type - // WARNING: in.Strategy requires manual conversion: does not exist in peer-type - // WARNING: in.Variables requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck(in *MachineHealthCheck, out *v1beta1.MachineHealthCheck, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck is an autogenerated conversion function. -func Convert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck(in *MachineHealthCheck, out *v1beta1.MachineHealthCheck, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineHealthCheck_To_v1beta1_MachineHealthCheck(in, out, s) -} - -func autoConvert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(in *v1beta1.MachineHealthCheck, out *MachineHealthCheck, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck is an autogenerated conversion function. -func Convert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(in *v1beta1.MachineHealthCheck, out *MachineHealthCheck, s conversion.Scope) error { - return autoConvert_v1beta1_MachineHealthCheck_To_v1alpha4_MachineHealthCheck(in, out, s) -} - -func autoConvert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(in *MachineHealthCheckList, out *v1beta1.MachineHealthCheckList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]v1beta1.MachineHealthCheck)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList is an autogenerated conversion function. -func Convert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(in *MachineHealthCheckList, out *v1beta1.MachineHealthCheckList, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineHealthCheckList_To_v1beta1_MachineHealthCheckList(in, out, s) -} - -func autoConvert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(in *v1beta1.MachineHealthCheckList, out *MachineHealthCheckList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - out.Items = *(*[]MachineHealthCheck)(unsafe.Pointer(&in.Items)) - return nil -} - -// Convert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList is an autogenerated conversion function. -func Convert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(in *v1beta1.MachineHealthCheckList, out *MachineHealthCheckList, s conversion.Scope) error { - return autoConvert_v1beta1_MachineHealthCheckList_To_v1alpha4_MachineHealthCheckList(in, out, s) -} - -func autoConvert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in *MachineHealthCheckSpec, out *v1beta1.MachineHealthCheckSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.Selector = in.Selector - out.UnhealthyConditions = *(*[]v1beta1.UnhealthyCondition)(unsafe.Pointer(&in.UnhealthyConditions)) - out.MaxUnhealthy = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnhealthy)) - out.UnhealthyRange = (*string)(unsafe.Pointer(in.UnhealthyRange)) - out.NodeStartupTimeout = (*metav1.Duration)(unsafe.Pointer(in.NodeStartupTimeout)) - out.RemediationTemplate = (*v1.ObjectReference)(unsafe.Pointer(in.RemediationTemplate)) - return nil -} - -// Convert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec is an autogenerated conversion function. -func Convert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in *MachineHealthCheckSpec, out *v1beta1.MachineHealthCheckSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineHealthCheckSpec_To_v1beta1_MachineHealthCheckSpec(in, out, s) -} - -func autoConvert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(in *v1beta1.MachineHealthCheckSpec, out *MachineHealthCheckSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.Selector = in.Selector - out.UnhealthyConditions = *(*[]UnhealthyCondition)(unsafe.Pointer(&in.UnhealthyConditions)) - out.MaxUnhealthy = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnhealthy)) - out.UnhealthyRange = (*string)(unsafe.Pointer(in.UnhealthyRange)) - out.NodeStartupTimeout = (*metav1.Duration)(unsafe.Pointer(in.NodeStartupTimeout)) - out.RemediationTemplate = (*v1.ObjectReference)(unsafe.Pointer(in.RemediationTemplate)) - return nil -} - -// Convert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec is an autogenerated conversion function. -func Convert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(in *v1beta1.MachineHealthCheckSpec, out *MachineHealthCheckSpec, s conversion.Scope) error { - return autoConvert_v1beta1_MachineHealthCheckSpec_To_v1alpha4_MachineHealthCheckSpec(in, out, s) -} - -func autoConvert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in *MachineHealthCheckStatus, out *v1beta1.MachineHealthCheckStatus, s conversion.Scope) error { - out.ExpectedMachines = in.ExpectedMachines - out.CurrentHealthy = in.CurrentHealthy - out.RemediationsAllowed = in.RemediationsAllowed - out.ObservedGeneration = in.ObservedGeneration - out.Targets = *(*[]string)(unsafe.Pointer(&in.Targets)) - out.Conditions = *(*v1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus is an autogenerated conversion function. -func Convert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in *MachineHealthCheckStatus, out *v1beta1.MachineHealthCheckStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineHealthCheckStatus_To_v1beta1_MachineHealthCheckStatus(in, out, s) -} - -func autoConvert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(in *v1beta1.MachineHealthCheckStatus, out *MachineHealthCheckStatus, s conversion.Scope) error { - out.ExpectedMachines = in.ExpectedMachines - out.CurrentHealthy = in.CurrentHealthy - out.RemediationsAllowed = in.RemediationsAllowed - out.ObservedGeneration = in.ObservedGeneration - out.Targets = *(*[]string)(unsafe.Pointer(&in.Targets)) - out.Conditions = *(*Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus is an autogenerated conversion function. -func Convert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(in *v1beta1.MachineHealthCheckStatus, out *MachineHealthCheckStatus, s conversion.Scope) error { - return autoConvert_v1beta1_MachineHealthCheckStatus_To_v1alpha4_MachineHealthCheckStatus(in, out, s) -} - -func autoConvert_v1alpha4_MachineList_To_v1beta1_MachineList(in *MachineList, out *v1beta1.MachineList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.Machine, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_Machine_To_v1beta1_Machine(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_MachineList_To_v1beta1_MachineList is an autogenerated conversion function. -func Convert_v1alpha4_MachineList_To_v1beta1_MachineList(in *MachineList, out *v1beta1.MachineList, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineList_To_v1beta1_MachineList(in, out, s) -} - -func autoConvert_v1beta1_MachineList_To_v1alpha4_MachineList(in *v1beta1.MachineList, out *MachineList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Machine, len(*in)) - for i := range *in { - if err := Convert_v1beta1_Machine_To_v1alpha4_Machine(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_MachineList_To_v1alpha4_MachineList is an autogenerated conversion function. -func Convert_v1beta1_MachineList_To_v1alpha4_MachineList(in *v1beta1.MachineList, out *MachineList, s conversion.Scope) error { - return autoConvert_v1beta1_MachineList_To_v1alpha4_MachineList(in, out, s) -} - -func autoConvert_v1alpha4_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(in *MachineRollingUpdateDeployment, out *v1beta1.MachineRollingUpdateDeployment, s conversion.Scope) error { - out.MaxUnavailable = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnavailable)) - out.MaxSurge = (*intstr.IntOrString)(unsafe.Pointer(in.MaxSurge)) - out.DeletePolicy = (*string)(unsafe.Pointer(in.DeletePolicy)) - return nil -} - -// Convert_v1alpha4_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment is an autogenerated conversion function. -func Convert_v1alpha4_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(in *MachineRollingUpdateDeployment, out *v1beta1.MachineRollingUpdateDeployment, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineRollingUpdateDeployment_To_v1beta1_MachineRollingUpdateDeployment(in, out, s) -} - -func autoConvert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(in *v1beta1.MachineRollingUpdateDeployment, out *MachineRollingUpdateDeployment, s conversion.Scope) error { - out.MaxUnavailable = (*intstr.IntOrString)(unsafe.Pointer(in.MaxUnavailable)) - out.MaxSurge = (*intstr.IntOrString)(unsafe.Pointer(in.MaxSurge)) - out.DeletePolicy = (*string)(unsafe.Pointer(in.DeletePolicy)) - return nil -} - -// Convert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment is an autogenerated conversion function. -func Convert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(in *v1beta1.MachineRollingUpdateDeployment, out *MachineRollingUpdateDeployment, s conversion.Scope) error { - return autoConvert_v1beta1_MachineRollingUpdateDeployment_To_v1alpha4_MachineRollingUpdateDeployment(in, out, s) -} - -func autoConvert_v1alpha4_MachineSet_To_v1beta1_MachineSet(in *MachineSet, out *v1beta1.MachineSet, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_MachineSet_To_v1beta1_MachineSet is an autogenerated conversion function. -func Convert_v1alpha4_MachineSet_To_v1beta1_MachineSet(in *MachineSet, out *v1beta1.MachineSet, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineSet_To_v1beta1_MachineSet(in, out, s) -} - -func autoConvert_v1beta1_MachineSet_To_v1alpha4_MachineSet(in *v1beta1.MachineSet, out *MachineSet, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_MachineSet_To_v1alpha4_MachineSet is an autogenerated conversion function. -func Convert_v1beta1_MachineSet_To_v1alpha4_MachineSet(in *v1beta1.MachineSet, out *MachineSet, s conversion.Scope) error { - return autoConvert_v1beta1_MachineSet_To_v1alpha4_MachineSet(in, out, s) -} - -func autoConvert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList(in *MachineSetList, out *v1beta1.MachineSetList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.MachineSet, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_MachineSet_To_v1beta1_MachineSet(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList is an autogenerated conversion function. -func Convert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList(in *MachineSetList, out *v1beta1.MachineSetList, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineSetList_To_v1beta1_MachineSetList(in, out, s) -} - -func autoConvert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList(in *v1beta1.MachineSetList, out *MachineSetList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachineSet, len(*in)) - for i := range *in { - if err := Convert_v1beta1_MachineSet_To_v1alpha4_MachineSet(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList is an autogenerated conversion function. -func Convert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList(in *v1beta1.MachineSetList, out *MachineSetList, s conversion.Scope) error { - return autoConvert_v1beta1_MachineSetList_To_v1alpha4_MachineSetList(in, out, s) -} - -func autoConvert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec(in *MachineSetSpec, out *v1beta1.MachineSetSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - out.MinReadySeconds = in.MinReadySeconds - out.DeletePolicy = in.DeletePolicy - out.Selector = in.Selector - if err := Convert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec is an autogenerated conversion function. -func Convert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec(in *MachineSetSpec, out *v1beta1.MachineSetSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineSetSpec_To_v1beta1_MachineSetSpec(in, out, s) -} - -func autoConvert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec(in *v1beta1.MachineSetSpec, out *MachineSetSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - out.MinReadySeconds = in.MinReadySeconds - out.DeletePolicy = in.DeletePolicy - out.Selector = in.Selector - if err := Convert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec is an autogenerated conversion function. -func Convert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec(in *v1beta1.MachineSetSpec, out *MachineSetSpec, s conversion.Scope) error { - return autoConvert_v1beta1_MachineSetSpec_To_v1alpha4_MachineSetSpec(in, out, s) -} - -func autoConvert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus(in *MachineSetStatus, out *v1beta1.MachineSetStatus, s conversion.Scope) error { - out.Selector = in.Selector - out.Replicas = in.Replicas - out.FullyLabeledReplicas = in.FullyLabeledReplicas - out.ReadyReplicas = in.ReadyReplicas - out.AvailableReplicas = in.AvailableReplicas - out.ObservedGeneration = in.ObservedGeneration - out.FailureReason = (*errors.MachineSetStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*v1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus is an autogenerated conversion function. -func Convert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus(in *MachineSetStatus, out *v1beta1.MachineSetStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineSetStatus_To_v1beta1_MachineSetStatus(in, out, s) -} - -func autoConvert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus(in *v1beta1.MachineSetStatus, out *MachineSetStatus, s conversion.Scope) error { - out.Selector = in.Selector - out.Replicas = in.Replicas - out.FullyLabeledReplicas = in.FullyLabeledReplicas - out.ReadyReplicas = in.ReadyReplicas - out.AvailableReplicas = in.AvailableReplicas - out.ObservedGeneration = in.ObservedGeneration - out.FailureReason = (*errors.MachineSetStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -// Convert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus is an autogenerated conversion function. -func Convert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus(in *v1beta1.MachineSetStatus, out *MachineSetStatus, s conversion.Scope) error { - return autoConvert_v1beta1_MachineSetStatus_To_v1alpha4_MachineSetStatus(in, out, s) -} - -func autoConvert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec(in *MachineSpec, out *v1beta1.MachineSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - if err := Convert_v1alpha4_Bootstrap_To_v1beta1_Bootstrap(&in.Bootstrap, &out.Bootstrap, s); err != nil { - return err - } - out.InfrastructureRef = in.InfrastructureRef - out.Version = (*string)(unsafe.Pointer(in.Version)) - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - out.FailureDomain = (*string)(unsafe.Pointer(in.FailureDomain)) - out.NodeDrainTimeout = (*metav1.Duration)(unsafe.Pointer(in.NodeDrainTimeout)) - return nil -} - -// Convert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec is an autogenerated conversion function. -func Convert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec(in *MachineSpec, out *v1beta1.MachineSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineSpec_To_v1beta1_MachineSpec(in, out, s) -} - -func autoConvert_v1beta1_MachineSpec_To_v1alpha4_MachineSpec(in *v1beta1.MachineSpec, out *MachineSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - if err := Convert_v1beta1_Bootstrap_To_v1alpha4_Bootstrap(&in.Bootstrap, &out.Bootstrap, s); err != nil { - return err - } - out.InfrastructureRef = in.InfrastructureRef - out.Version = (*string)(unsafe.Pointer(in.Version)) - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - out.FailureDomain = (*string)(unsafe.Pointer(in.FailureDomain)) - out.NodeDrainTimeout = (*metav1.Duration)(unsafe.Pointer(in.NodeDrainTimeout)) - // WARNING: in.NodeVolumeDetachTimeout requires manual conversion: does not exist in peer-type - // WARNING: in.NodeDeletionTimeout requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_MachineStatus_To_v1beta1_MachineStatus(in *MachineStatus, out *v1beta1.MachineStatus, s conversion.Scope) error { - out.NodeRef = (*v1.ObjectReference)(unsafe.Pointer(in.NodeRef)) - out.NodeInfo = (*v1.NodeSystemInfo)(unsafe.Pointer(in.NodeInfo)) - out.LastUpdated = (*metav1.Time)(unsafe.Pointer(in.LastUpdated)) - // WARNING: in.Version requires manual conversion: does not exist in peer-type - out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Addresses = *(*v1beta1.MachineAddresses)(unsafe.Pointer(&in.Addresses)) - out.Phase = in.Phase - out.BootstrapReady = in.BootstrapReady - out.InfrastructureReady = in.InfrastructureReady - out.ObservedGeneration = in.ObservedGeneration - out.Conditions = *(*v1beta1.Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -func autoConvert_v1beta1_MachineStatus_To_v1alpha4_MachineStatus(in *v1beta1.MachineStatus, out *MachineStatus, s conversion.Scope) error { - out.NodeRef = (*v1.ObjectReference)(unsafe.Pointer(in.NodeRef)) - out.NodeInfo = (*v1.NodeSystemInfo)(unsafe.Pointer(in.NodeInfo)) - out.LastUpdated = (*metav1.Time)(unsafe.Pointer(in.LastUpdated)) - out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Addresses = *(*MachineAddresses)(unsafe.Pointer(&in.Addresses)) - out.Phase = in.Phase - // WARNING: in.CertificatesExpiryDate requires manual conversion: does not exist in peer-type - out.BootstrapReady = in.BootstrapReady - out.InfrastructureReady = in.InfrastructureReady - out.ObservedGeneration = in.ObservedGeneration - out.Conditions = *(*Conditions)(unsafe.Pointer(&in.Conditions)) - return nil -} - -func autoConvert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(in *MachineTemplateSpec, out *v1beta1.MachineTemplateSpec, 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_MachineSpec_To_v1beta1_MachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(in *MachineTemplateSpec, out *v1beta1.MachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(in, out, s) -} - -func autoConvert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(in *v1beta1.MachineTemplateSpec, out *MachineTemplateSpec, 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_MachineSpec_To_v1alpha4_MachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec is an autogenerated conversion function. -func Convert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(in *v1beta1.MachineTemplateSpec, out *MachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(in, out, s) -} - -func autoConvert_v1alpha4_NetworkRanges_To_v1beta1_NetworkRanges(in *NetworkRanges, out *v1beta1.NetworkRanges, s conversion.Scope) error { - out.CIDRBlocks = *(*[]string)(unsafe.Pointer(&in.CIDRBlocks)) - return nil -} - -// Convert_v1alpha4_NetworkRanges_To_v1beta1_NetworkRanges is an autogenerated conversion function. -func Convert_v1alpha4_NetworkRanges_To_v1beta1_NetworkRanges(in *NetworkRanges, out *v1beta1.NetworkRanges, s conversion.Scope) error { - return autoConvert_v1alpha4_NetworkRanges_To_v1beta1_NetworkRanges(in, out, s) -} - -func autoConvert_v1beta1_NetworkRanges_To_v1alpha4_NetworkRanges(in *v1beta1.NetworkRanges, out *NetworkRanges, s conversion.Scope) error { - out.CIDRBlocks = *(*[]string)(unsafe.Pointer(&in.CIDRBlocks)) - return nil -} - -// Convert_v1beta1_NetworkRanges_To_v1alpha4_NetworkRanges is an autogenerated conversion function. -func Convert_v1beta1_NetworkRanges_To_v1alpha4_NetworkRanges(in *v1beta1.NetworkRanges, out *NetworkRanges, s conversion.Scope) error { - return autoConvert_v1beta1_NetworkRanges_To_v1alpha4_NetworkRanges(in, out, s) -} - -func autoConvert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in *ObjectMeta, out *v1beta1.ObjectMeta, s conversion.Scope) error { - out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) - out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations)) - return nil -} - -// Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta is an autogenerated conversion function. -func Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in *ObjectMeta, out *v1beta1.ObjectMeta, s conversion.Scope) error { - return autoConvert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in, out, s) -} - -func autoConvert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in *v1beta1.ObjectMeta, out *ObjectMeta, s conversion.Scope) error { - out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) - out.Annotations = *(*map[string]string)(unsafe.Pointer(&in.Annotations)) - return nil -} - -// Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta is an autogenerated conversion function. -func Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in *v1beta1.ObjectMeta, out *ObjectMeta, s conversion.Scope) error { - return autoConvert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in, out, s) -} - -func autoConvert_v1alpha4_Topology_To_v1beta1_Topology(in *Topology, out *v1beta1.Topology, s conversion.Scope) error { - out.Class = in.Class - out.Version = in.Version - out.RolloutAfter = (*metav1.Time)(unsafe.Pointer(in.RolloutAfter)) - if err := Convert_v1alpha4_ControlPlaneTopology_To_v1beta1_ControlPlaneTopology(&in.ControlPlane, &out.ControlPlane, s); err != nil { - return err - } - if in.Workers != nil { - in, out := &in.Workers, &out.Workers - *out = new(v1beta1.WorkersTopology) - if err := Convert_v1alpha4_WorkersTopology_To_v1beta1_WorkersTopology(*in, *out, s); err != nil { - return err - } - } else { - out.Workers = nil - } - return nil -} - -// Convert_v1alpha4_Topology_To_v1beta1_Topology is an autogenerated conversion function. -func Convert_v1alpha4_Topology_To_v1beta1_Topology(in *Topology, out *v1beta1.Topology, s conversion.Scope) error { - return autoConvert_v1alpha4_Topology_To_v1beta1_Topology(in, out, s) -} - -func autoConvert_v1beta1_Topology_To_v1alpha4_Topology(in *v1beta1.Topology, out *Topology, s conversion.Scope) error { - out.Class = in.Class - out.Version = in.Version - out.RolloutAfter = (*metav1.Time)(unsafe.Pointer(in.RolloutAfter)) - if err := Convert_v1beta1_ControlPlaneTopology_To_v1alpha4_ControlPlaneTopology(&in.ControlPlane, &out.ControlPlane, s); err != nil { - return err - } - if in.Workers != nil { - in, out := &in.Workers, &out.Workers - *out = new(WorkersTopology) - if err := Convert_v1beta1_WorkersTopology_To_v1alpha4_WorkersTopology(*in, *out, s); err != nil { - return err - } - } else { - out.Workers = nil - } - // WARNING: in.Variables requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_UnhealthyCondition_To_v1beta1_UnhealthyCondition(in *UnhealthyCondition, out *v1beta1.UnhealthyCondition, s conversion.Scope) error { - out.Type = v1.NodeConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - out.Timeout = in.Timeout - return nil -} - -// Convert_v1alpha4_UnhealthyCondition_To_v1beta1_UnhealthyCondition is an autogenerated conversion function. -func Convert_v1alpha4_UnhealthyCondition_To_v1beta1_UnhealthyCondition(in *UnhealthyCondition, out *v1beta1.UnhealthyCondition, s conversion.Scope) error { - return autoConvert_v1alpha4_UnhealthyCondition_To_v1beta1_UnhealthyCondition(in, out, s) -} - -func autoConvert_v1beta1_UnhealthyCondition_To_v1alpha4_UnhealthyCondition(in *v1beta1.UnhealthyCondition, out *UnhealthyCondition, s conversion.Scope) error { - out.Type = v1.NodeConditionType(in.Type) - out.Status = v1.ConditionStatus(in.Status) - out.Timeout = in.Timeout - return nil -} - -// Convert_v1beta1_UnhealthyCondition_To_v1alpha4_UnhealthyCondition is an autogenerated conversion function. -func Convert_v1beta1_UnhealthyCondition_To_v1alpha4_UnhealthyCondition(in *v1beta1.UnhealthyCondition, out *UnhealthyCondition, s conversion.Scope) error { - return autoConvert_v1beta1_UnhealthyCondition_To_v1alpha4_UnhealthyCondition(in, out, s) -} - -func autoConvert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass(in *WorkersClass, out *v1beta1.WorkersClass, s conversion.Scope) error { - if in.MachineDeployments != nil { - in, out := &in.MachineDeployments, &out.MachineDeployments - *out = make([]v1beta1.MachineDeploymentClass, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_MachineDeploymentClass_To_v1beta1_MachineDeploymentClass(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.MachineDeployments = nil - } - return nil -} - -// Convert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass is an autogenerated conversion function. -func Convert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass(in *WorkersClass, out *v1beta1.WorkersClass, s conversion.Scope) error { - return autoConvert_v1alpha4_WorkersClass_To_v1beta1_WorkersClass(in, out, s) -} - -func autoConvert_v1beta1_WorkersClass_To_v1alpha4_WorkersClass(in *v1beta1.WorkersClass, out *WorkersClass, s conversion.Scope) error { - if in.MachineDeployments != nil { - in, out := &in.MachineDeployments, &out.MachineDeployments - *out = make([]MachineDeploymentClass, len(*in)) - for i := range *in { - if err := Convert_v1beta1_MachineDeploymentClass_To_v1alpha4_MachineDeploymentClass(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.MachineDeployments = nil - } - // WARNING: in.MachinePools requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_WorkersTopology_To_v1beta1_WorkersTopology(in *WorkersTopology, out *v1beta1.WorkersTopology, s conversion.Scope) error { - if in.MachineDeployments != nil { - in, out := &in.MachineDeployments, &out.MachineDeployments - *out = make([]v1beta1.MachineDeploymentTopology, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_MachineDeploymentTopology_To_v1beta1_MachineDeploymentTopology(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.MachineDeployments = nil - } - return nil -} - -// Convert_v1alpha4_WorkersTopology_To_v1beta1_WorkersTopology is an autogenerated conversion function. -func Convert_v1alpha4_WorkersTopology_To_v1beta1_WorkersTopology(in *WorkersTopology, out *v1beta1.WorkersTopology, s conversion.Scope) error { - return autoConvert_v1alpha4_WorkersTopology_To_v1beta1_WorkersTopology(in, out, s) -} - -func autoConvert_v1beta1_WorkersTopology_To_v1alpha4_WorkersTopology(in *v1beta1.WorkersTopology, out *WorkersTopology, s conversion.Scope) error { - if in.MachineDeployments != nil { - in, out := &in.MachineDeployments, &out.MachineDeployments - *out = make([]MachineDeploymentTopology, len(*in)) - for i := range *in { - if err := Convert_v1beta1_MachineDeploymentTopology_To_v1alpha4_MachineDeploymentTopology(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.MachineDeployments = nil - } - // WARNING: in.MachinePools requires manual conversion: does not exist in peer-type - return nil -} diff --git a/api/v1alpha4/zz_generated.deepcopy.go b/api/v1alpha4/zz_generated.deepcopy.go deleted file mode 100644 index ac1ae21e3332..000000000000 --- a/api/v1alpha4/zz_generated.deepcopy.go +++ /dev/null @@ -1,1257 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/intstr" - "sigs.k8s.io/cluster-api/errors" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIEndpoint) DeepCopyInto(out *APIEndpoint) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIEndpoint. -func (in *APIEndpoint) DeepCopy() *APIEndpoint { - if in == nil { - return nil - } - out := new(APIEndpoint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Bootstrap) DeepCopyInto(out *Bootstrap) { - *out = *in - if in.ConfigRef != nil { - in, out := &in.ConfigRef, &out.ConfigRef - *out = new(v1.ObjectReference) - **out = **in - } - if in.DataSecretName != nil { - in, out := &in.DataSecretName, &out.DataSecretName - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Bootstrap. -func (in *Bootstrap) DeepCopy() *Bootstrap { - if in == nil { - return nil - } - out := new(Bootstrap) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Cluster) DeepCopyInto(out *Cluster) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Cluster. -func (in *Cluster) DeepCopy() *Cluster { - if in == nil { - return nil - } - out := new(Cluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Cluster) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterClass) DeepCopyInto(out *ClusterClass) { - *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 ClusterClass. -func (in *ClusterClass) DeepCopy() *ClusterClass { - if in == nil { - return nil - } - out := new(ClusterClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterClass) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterClassList) DeepCopyInto(out *ClusterClassList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClassList. -func (in *ClusterClassList) DeepCopy() *ClusterClassList { - if in == nil { - return nil - } - out := new(ClusterClassList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterClassList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterClassSpec) DeepCopyInto(out *ClusterClassSpec) { - *out = *in - in.Infrastructure.DeepCopyInto(&out.Infrastructure) - in.ControlPlane.DeepCopyInto(&out.ControlPlane) - in.Workers.DeepCopyInto(&out.Workers) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterClassSpec. -func (in *ClusterClassSpec) DeepCopy() *ClusterClassSpec { - if in == nil { - return nil - } - out := new(ClusterClassSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterList) DeepCopyInto(out *ClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Cluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterList. -func (in *ClusterList) DeepCopy() *ClusterList { - if in == nil { - return nil - } - out := new(ClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterNetwork) DeepCopyInto(out *ClusterNetwork) { - *out = *in - if in.APIServerPort != nil { - in, out := &in.APIServerPort, &out.APIServerPort - *out = new(int32) - **out = **in - } - if in.Services != nil { - in, out := &in.Services, &out.Services - *out = new(NetworkRanges) - (*in).DeepCopyInto(*out) - } - if in.Pods != nil { - in, out := &in.Pods, &out.Pods - *out = new(NetworkRanges) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterNetwork. -func (in *ClusterNetwork) DeepCopy() *ClusterNetwork { - if in == nil { - return nil - } - out := new(ClusterNetwork) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) { - *out = *in - if in.ClusterNetwork != nil { - in, out := &in.ClusterNetwork, &out.ClusterNetwork - *out = new(ClusterNetwork) - (*in).DeepCopyInto(*out) - } - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if in.ControlPlaneRef != nil { - in, out := &in.ControlPlaneRef, &out.ControlPlaneRef - *out = new(v1.ObjectReference) - **out = **in - } - if in.InfrastructureRef != nil { - in, out := &in.InfrastructureRef, &out.InfrastructureRef - *out = new(v1.ObjectReference) - **out = **in - } - if in.Topology != nil { - in, out := &in.Topology, &out.Topology - *out = new(Topology) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterSpec. -func (in *ClusterSpec) DeepCopy() *ClusterSpec { - if in == nil { - return nil - } - out := new(ClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterStatus) DeepCopyInto(out *ClusterStatus) { - *out = *in - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make(FailureDomains, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.ClusterStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus. -func (in *ClusterStatus) DeepCopy() *ClusterStatus { - if in == nil { - return nil - } - out := new(ClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Condition) DeepCopyInto(out *Condition) { - *out = *in - in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition. -func (in *Condition) DeepCopy() *Condition { - if in == nil { - return nil - } - out := new(Condition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in Conditions) DeepCopyInto(out *Conditions) { - { - in := &in - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Conditions. -func (in Conditions) DeepCopy() Conditions { - if in == nil { - return nil - } - out := new(Conditions) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ControlPlaneClass) DeepCopyInto(out *ControlPlaneClass) { - *out = *in - in.Metadata.DeepCopyInto(&out.Metadata) - in.LocalObjectTemplate.DeepCopyInto(&out.LocalObjectTemplate) - if in.MachineInfrastructure != nil { - in, out := &in.MachineInfrastructure, &out.MachineInfrastructure - *out = new(LocalObjectTemplate) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneClass. -func (in *ControlPlaneClass) DeepCopy() *ControlPlaneClass { - if in == nil { - return nil - } - out := new(ControlPlaneClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ControlPlaneTopology) DeepCopyInto(out *ControlPlaneTopology) { - *out = *in - in.Metadata.DeepCopyInto(&out.Metadata) - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneTopology. -func (in *ControlPlaneTopology) DeepCopy() *ControlPlaneTopology { - if in == nil { - return nil - } - out := new(ControlPlaneTopology) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FailureDomainSpec) DeepCopyInto(out *FailureDomainSpec) { - *out = *in - if in.Attributes != nil { - in, out := &in.Attributes, &out.Attributes - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailureDomainSpec. -func (in *FailureDomainSpec) DeepCopy() *FailureDomainSpec { - if in == nil { - return nil - } - out := new(FailureDomainSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in FailureDomains) DeepCopyInto(out *FailureDomains) { - { - in := &in - *out = make(FailureDomains, len(*in)) - for key, val := range *in { - (*out)[key] = *val.DeepCopy() - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailureDomains. -func (in FailureDomains) DeepCopy() FailureDomains { - if in == nil { - return nil - } - out := new(FailureDomains) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LocalObjectTemplate) DeepCopyInto(out *LocalObjectTemplate) { - *out = *in - if in.Ref != nil { - in, out := &in.Ref, &out.Ref - *out = new(v1.ObjectReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalObjectTemplate. -func (in *LocalObjectTemplate) DeepCopy() *LocalObjectTemplate { - if in == nil { - return nil - } - out := new(LocalObjectTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Machine) DeepCopyInto(out *Machine) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Machine. -func (in *Machine) DeepCopy() *Machine { - if in == nil { - return nil - } - out := new(Machine) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *Machine) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineAddress) DeepCopyInto(out *MachineAddress) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineAddress. -func (in *MachineAddress) DeepCopy() *MachineAddress { - if in == nil { - return nil - } - out := new(MachineAddress) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in MachineAddresses) DeepCopyInto(out *MachineAddresses) { - { - in := &in - *out = make(MachineAddresses, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineAddresses. -func (in MachineAddresses) DeepCopy() MachineAddresses { - if in == nil { - return nil - } - out := new(MachineAddresses) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeployment) DeepCopyInto(out *MachineDeployment) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeployment. -func (in *MachineDeployment) DeepCopy() *MachineDeployment { - if in == nil { - return nil - } - out := new(MachineDeployment) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineDeployment) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentClass) DeepCopyInto(out *MachineDeploymentClass) { - *out = *in - in.Template.DeepCopyInto(&out.Template) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClass. -func (in *MachineDeploymentClass) DeepCopy() *MachineDeploymentClass { - if in == nil { - return nil - } - out := new(MachineDeploymentClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentClassTemplate) DeepCopyInto(out *MachineDeploymentClassTemplate) { - *out = *in - in.Metadata.DeepCopyInto(&out.Metadata) - in.Bootstrap.DeepCopyInto(&out.Bootstrap) - in.Infrastructure.DeepCopyInto(&out.Infrastructure) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentClassTemplate. -func (in *MachineDeploymentClassTemplate) DeepCopy() *MachineDeploymentClassTemplate { - if in == nil { - return nil - } - out := new(MachineDeploymentClassTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentList) DeepCopyInto(out *MachineDeploymentList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachineDeployment, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentList. -func (in *MachineDeploymentList) DeepCopy() *MachineDeploymentList { - if in == nil { - return nil - } - out := new(MachineDeploymentList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineDeploymentList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentSpec) DeepCopyInto(out *MachineDeploymentSpec) { - *out = *in - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } - in.Selector.DeepCopyInto(&out.Selector) - in.Template.DeepCopyInto(&out.Template) - if in.Strategy != nil { - in, out := &in.Strategy, &out.Strategy - *out = new(MachineDeploymentStrategy) - (*in).DeepCopyInto(*out) - } - if in.MinReadySeconds != nil { - in, out := &in.MinReadySeconds, &out.MinReadySeconds - *out = new(int32) - **out = **in - } - if in.RevisionHistoryLimit != nil { - in, out := &in.RevisionHistoryLimit, &out.RevisionHistoryLimit - *out = new(int32) - **out = **in - } - if in.ProgressDeadlineSeconds != nil { - in, out := &in.ProgressDeadlineSeconds, &out.ProgressDeadlineSeconds - *out = new(int32) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentSpec. -func (in *MachineDeploymentSpec) DeepCopy() *MachineDeploymentSpec { - if in == nil { - return nil - } - out := new(MachineDeploymentSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentStatus) DeepCopyInto(out *MachineDeploymentStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentStatus. -func (in *MachineDeploymentStatus) DeepCopy() *MachineDeploymentStatus { - if in == nil { - return nil - } - out := new(MachineDeploymentStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentStrategy) DeepCopyInto(out *MachineDeploymentStrategy) { - *out = *in - if in.RollingUpdate != nil { - in, out := &in.RollingUpdate, &out.RollingUpdate - *out = new(MachineRollingUpdateDeployment) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentStrategy. -func (in *MachineDeploymentStrategy) DeepCopy() *MachineDeploymentStrategy { - if in == nil { - return nil - } - out := new(MachineDeploymentStrategy) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineDeploymentTopology) DeepCopyInto(out *MachineDeploymentTopology) { - *out = *in - in.Metadata.DeepCopyInto(&out.Metadata) - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineDeploymentTopology. -func (in *MachineDeploymentTopology) DeepCopy() *MachineDeploymentTopology { - if in == nil { - return nil - } - out := new(MachineDeploymentTopology) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineHealthCheck) DeepCopyInto(out *MachineHealthCheck) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheck. -func (in *MachineHealthCheck) DeepCopy() *MachineHealthCheck { - if in == nil { - return nil - } - out := new(MachineHealthCheck) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineHealthCheck) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineHealthCheckList) DeepCopyInto(out *MachineHealthCheckList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachineHealthCheck, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckList. -func (in *MachineHealthCheckList) DeepCopy() *MachineHealthCheckList { - if in == nil { - return nil - } - out := new(MachineHealthCheckList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineHealthCheckList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineHealthCheckSpec) DeepCopyInto(out *MachineHealthCheckSpec) { - *out = *in - in.Selector.DeepCopyInto(&out.Selector) - if in.UnhealthyConditions != nil { - in, out := &in.UnhealthyConditions, &out.UnhealthyConditions - *out = make([]UnhealthyCondition, len(*in)) - copy(*out, *in) - } - if in.MaxUnhealthy != nil { - in, out := &in.MaxUnhealthy, &out.MaxUnhealthy - *out = new(intstr.IntOrString) - **out = **in - } - if in.UnhealthyRange != nil { - in, out := &in.UnhealthyRange, &out.UnhealthyRange - *out = new(string) - **out = **in - } - if in.NodeStartupTimeout != nil { - in, out := &in.NodeStartupTimeout, &out.NodeStartupTimeout - *out = new(metav1.Duration) - **out = **in - } - if in.RemediationTemplate != nil { - in, out := &in.RemediationTemplate, &out.RemediationTemplate - *out = new(v1.ObjectReference) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckSpec. -func (in *MachineHealthCheckSpec) DeepCopy() *MachineHealthCheckSpec { - if in == nil { - return nil - } - out := new(MachineHealthCheckSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineHealthCheckStatus) DeepCopyInto(out *MachineHealthCheckStatus) { - *out = *in - if in.Targets != nil { - in, out := &in.Targets, &out.Targets - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineHealthCheckStatus. -func (in *MachineHealthCheckStatus) DeepCopy() *MachineHealthCheckStatus { - if in == nil { - return nil - } - out := new(MachineHealthCheckStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineList) DeepCopyInto(out *MachineList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]Machine, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineList. -func (in *MachineList) DeepCopy() *MachineList { - if in == nil { - return nil - } - out := new(MachineList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineRollingUpdateDeployment) DeepCopyInto(out *MachineRollingUpdateDeployment) { - *out = *in - if in.MaxUnavailable != nil { - in, out := &in.MaxUnavailable, &out.MaxUnavailable - *out = new(intstr.IntOrString) - **out = **in - } - if in.MaxSurge != nil { - in, out := &in.MaxSurge, &out.MaxSurge - *out = new(intstr.IntOrString) - **out = **in - } - if in.DeletePolicy != nil { - in, out := &in.DeletePolicy, &out.DeletePolicy - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineRollingUpdateDeployment. -func (in *MachineRollingUpdateDeployment) DeepCopy() *MachineRollingUpdateDeployment { - if in == nil { - return nil - } - out := new(MachineRollingUpdateDeployment) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSet) DeepCopyInto(out *MachineSet) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSet. -func (in *MachineSet) DeepCopy() *MachineSet { - if in == nil { - return nil - } - out := new(MachineSet) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineSet) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSetList) DeepCopyInto(out *MachineSetList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachineSet, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetList. -func (in *MachineSetList) DeepCopy() *MachineSetList { - if in == nil { - return nil - } - out := new(MachineSetList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachineSetList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSetSpec) DeepCopyInto(out *MachineSetSpec) { - *out = *in - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } - in.Selector.DeepCopyInto(&out.Selector) - in.Template.DeepCopyInto(&out.Template) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetSpec. -func (in *MachineSetSpec) DeepCopy() *MachineSetSpec { - if in == nil { - return nil - } - out := new(MachineSetSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSetStatus) DeepCopyInto(out *MachineSetStatus) { - *out = *in - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.MachineSetStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSetStatus. -func (in *MachineSetStatus) DeepCopy() *MachineSetStatus { - if in == nil { - return nil - } - out := new(MachineSetStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineSpec) DeepCopyInto(out *MachineSpec) { - *out = *in - in.Bootstrap.DeepCopyInto(&out.Bootstrap) - out.InfrastructureRef = in.InfrastructureRef - if in.Version != nil { - in, out := &in.Version, &out.Version - *out = new(string) - **out = **in - } - if in.ProviderID != nil { - in, out := &in.ProviderID, &out.ProviderID - *out = new(string) - **out = **in - } - if in.FailureDomain != nil { - in, out := &in.FailureDomain, &out.FailureDomain - *out = new(string) - **out = **in - } - if in.NodeDrainTimeout != nil { - in, out := &in.NodeDrainTimeout, &out.NodeDrainTimeout - *out = new(metav1.Duration) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineSpec. -func (in *MachineSpec) DeepCopy() *MachineSpec { - if in == nil { - return nil - } - out := new(MachineSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineStatus) DeepCopyInto(out *MachineStatus) { - *out = *in - if in.NodeRef != nil { - in, out := &in.NodeRef, &out.NodeRef - *out = new(v1.ObjectReference) - **out = **in - } - if in.NodeInfo != nil { - in, out := &in.NodeInfo, &out.NodeInfo - *out = new(v1.NodeSystemInfo) - **out = **in - } - if in.LastUpdated != nil { - in, out := &in.LastUpdated, &out.LastUpdated - *out = (*in).DeepCopy() - } - if in.Version != nil { - in, out := &in.Version, &out.Version - *out = new(string) - **out = **in - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.MachineStatusError) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make(MachineAddresses, len(*in)) - copy(*out, *in) - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineStatus. -func (in *MachineStatus) DeepCopy() *MachineStatus { - if in == nil { - return nil - } - out := new(MachineStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachineTemplateSpec) DeepCopyInto(out *MachineTemplateSpec) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachineTemplateSpec. -func (in *MachineTemplateSpec) DeepCopy() *MachineTemplateSpec { - if in == nil { - return nil - } - out := new(MachineTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NetworkRanges) DeepCopyInto(out *NetworkRanges) { - *out = *in - if in.CIDRBlocks != nil { - in, out := &in.CIDRBlocks, &out.CIDRBlocks - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkRanges. -func (in *NetworkRanges) DeepCopy() *NetworkRanges { - if in == nil { - return nil - } - out := new(NetworkRanges) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ObjectMeta) DeepCopyInto(out *ObjectMeta) { - *out = *in - if in.Labels != nil { - in, out := &in.Labels, &out.Labels - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.Annotations != nil { - in, out := &in.Annotations, &out.Annotations - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ObjectMeta. -func (in *ObjectMeta) DeepCopy() *ObjectMeta { - if in == nil { - return nil - } - out := new(ObjectMeta) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Topology) DeepCopyInto(out *Topology) { - *out = *in - if in.RolloutAfter != nil { - in, out := &in.RolloutAfter, &out.RolloutAfter - *out = (*in).DeepCopy() - } - in.ControlPlane.DeepCopyInto(&out.ControlPlane) - if in.Workers != nil { - in, out := &in.Workers, &out.Workers - *out = new(WorkersTopology) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Topology. -func (in *Topology) DeepCopy() *Topology { - if in == nil { - return nil - } - out := new(Topology) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *UnhealthyCondition) DeepCopyInto(out *UnhealthyCondition) { - *out = *in - out.Timeout = in.Timeout -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UnhealthyCondition. -func (in *UnhealthyCondition) DeepCopy() *UnhealthyCondition { - if in == nil { - return nil - } - out := new(UnhealthyCondition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WorkersClass) DeepCopyInto(out *WorkersClass) { - *out = *in - if in.MachineDeployments != nil { - in, out := &in.MachineDeployments, &out.MachineDeployments - *out = make([]MachineDeploymentClass, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkersClass. -func (in *WorkersClass) DeepCopy() *WorkersClass { - if in == nil { - return nil - } - out := new(WorkersClass) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *WorkersTopology) DeepCopyInto(out *WorkersTopology) { - *out = *in - if in.MachineDeployments != nil { - in, out := &in.MachineDeployments, &out.MachineDeployments - *out = make([]MachineDeploymentTopology, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkersTopology. -func (in *WorkersTopology) DeepCopy() *WorkersTopology { - if in == nil { - return nil - } - out := new(WorkersTopology) - in.DeepCopyInto(out) - return out -} diff --git a/bootstrap/kubeadm/api/v1alpha4/condition_consts.go b/bootstrap/kubeadm/api/v1alpha4/condition_consts.go deleted file mode 100644 index 631ab702ebf5..000000000000 --- a/bootstrap/kubeadm/api/v1alpha4/condition_consts.go +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - -// Conditions and condition Reasons for the KubeadmConfig object. - -const ( - // DataSecretAvailableCondition documents the status of the bootstrap secret generation process. - // - // NOTE: When the DataSecret generation starts the process completes immediately and within the - // same reconciliation, so the user will always see a transition from Wait to Generated without having - // evidence that BootstrapSecret generation is started/in progress. - DataSecretAvailableCondition clusterv1alpha4.ConditionType = "DataSecretAvailable" - - // WaitingForClusterInfrastructureReason (Severity=Info) document a bootstrap secret generation process - // waiting for the cluster infrastructure to be ready. - // - // NOTE: Having the cluster infrastructure ready is a pre-condition for starting to create machines; - // the KubeadmConfig controller ensure this pre-condition is satisfied. - WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure" - - // DataSecretGenerationFailedReason (Severity=Warning) documents a KubeadmConfig controller detecting - // an error while generating a data secret; those kind of errors are usually due to misconfigurations - // and user intervention is required to get them fixed. - DataSecretGenerationFailedReason = "DataSecretGenerationFailed" -) - -const ( - // CertificatesAvailableCondition documents that cluster certificates are available. - // - // NOTE: Cluster certificates are generated only for the KubeadmConfig object linked to the initial control plane - // machine, if the cluster is not using a control plane ref object, if the certificates are not provided - // by the users. - // IMPORTANT: This condition won't be re-created after clusterctl move. - CertificatesAvailableCondition clusterv1alpha4.ConditionType = "CertificatesAvailable" - - // CertificatesGenerationFailedReason (Severity=Warning) documents a KubeadmConfig controller detecting - // an error while generating certificates; those kind of errors are usually temporary and the controller - // automatically recover from them. - CertificatesGenerationFailedReason = "CertificatesGenerationFailed" - - // CertificatesCorruptedReason (Severity=Error) documents a KubeadmConfig controller detecting - // an error while retrieving certificates for a joining node. - CertificatesCorruptedReason = "CertificatesCorrupted" -) diff --git a/bootstrap/kubeadm/api/v1alpha4/conversion.go b/bootstrap/kubeadm/api/v1alpha4/conversion.go deleted file mode 100644 index 576fceebdf3f..000000000000 --- a/bootstrap/kubeadm/api/v1alpha4/conversion.go +++ /dev/null @@ -1,222 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - apiconversion "k8s.io/apimachinery/pkg/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" - - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -func (src *KubeadmConfig) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*bootstrapv1.KubeadmConfig) - - if err := Convert_v1alpha4_KubeadmConfig_To_v1beta1_KubeadmConfig(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &bootstrapv1.KubeadmConfig{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - dst.Spec.Files = restored.Spec.Files - - dst.Spec.Users = restored.Spec.Users - if restored.Spec.Users != nil { - for i := range restored.Spec.Users { - if restored.Spec.Users[i].PasswdFrom != nil { - dst.Spec.Users[i].PasswdFrom = restored.Spec.Users[i].PasswdFrom - } - } - } - - dst.Spec.Ignition = restored.Spec.Ignition - if restored.Spec.InitConfiguration != nil { - if dst.Spec.InitConfiguration == nil { - dst.Spec.InitConfiguration = &bootstrapv1.InitConfiguration{} - } - dst.Spec.InitConfiguration.Patches = restored.Spec.InitConfiguration.Patches - dst.Spec.InitConfiguration.SkipPhases = restored.Spec.InitConfiguration.SkipPhases - } - if restored.Spec.JoinConfiguration != nil { - if dst.Spec.JoinConfiguration == nil { - dst.Spec.JoinConfiguration = &bootstrapv1.JoinConfiguration{} - } - dst.Spec.JoinConfiguration.Patches = restored.Spec.JoinConfiguration.Patches - dst.Spec.JoinConfiguration.SkipPhases = restored.Spec.JoinConfiguration.SkipPhases - } - - if restored.Spec.JoinConfiguration != nil && restored.Spec.JoinConfiguration.NodeRegistration.ImagePullPolicy != "" { - if dst.Spec.JoinConfiguration == nil { - dst.Spec.JoinConfiguration = &bootstrapv1.JoinConfiguration{} - } - dst.Spec.JoinConfiguration.NodeRegistration.ImagePullPolicy = restored.Spec.JoinConfiguration.NodeRegistration.ImagePullPolicy - } - - if restored.Spec.InitConfiguration != nil && restored.Spec.InitConfiguration.NodeRegistration.ImagePullPolicy != "" { - if dst.Spec.InitConfiguration == nil { - dst.Spec.InitConfiguration = &bootstrapv1.InitConfiguration{} - } - dst.Spec.InitConfiguration.NodeRegistration.ImagePullPolicy = restored.Spec.InitConfiguration.NodeRegistration.ImagePullPolicy - } - - return nil -} - -func (dst *KubeadmConfig) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*bootstrapv1.KubeadmConfig) - - if err := Convert_v1beta1_KubeadmConfig_To_v1alpha4_KubeadmConfig(src, dst, nil); err != nil { - return err - } - // Preserve Hub data on down-conversion except for metadata. - return utilconversion.MarshalData(src, dst) -} - -func (src *KubeadmConfigList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*bootstrapv1.KubeadmConfigList) - - return Convert_v1alpha4_KubeadmConfigList_To_v1beta1_KubeadmConfigList(src, dst, nil) -} - -func (dst *KubeadmConfigList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*bootstrapv1.KubeadmConfigList) - - return Convert_v1beta1_KubeadmConfigList_To_v1alpha4_KubeadmConfigList(src, dst, nil) -} - -func (src *KubeadmConfigTemplate) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*bootstrapv1.KubeadmConfigTemplate) - - if err := Convert_v1alpha4_KubeadmConfigTemplate_To_v1beta1_KubeadmConfigTemplate(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &bootstrapv1.KubeadmConfigTemplate{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - dst.Spec.Template.Spec.Files = restored.Spec.Template.Spec.Files - - dst.Spec.Template.Spec.Users = restored.Spec.Template.Spec.Users - if restored.Spec.Template.Spec.Users != nil { - for i := range restored.Spec.Template.Spec.Users { - if restored.Spec.Template.Spec.Users[i].PasswdFrom != nil { - dst.Spec.Template.Spec.Users[i].PasswdFrom = restored.Spec.Template.Spec.Users[i].PasswdFrom - } - } - } - - dst.Spec.Template.ObjectMeta = restored.Spec.Template.ObjectMeta - - dst.Spec.Template.Spec.Ignition = restored.Spec.Template.Spec.Ignition - if restored.Spec.Template.Spec.InitConfiguration != nil { - if dst.Spec.Template.Spec.InitConfiguration == nil { - dst.Spec.Template.Spec.InitConfiguration = &bootstrapv1.InitConfiguration{} - } - dst.Spec.Template.Spec.InitConfiguration.Patches = restored.Spec.Template.Spec.InitConfiguration.Patches - dst.Spec.Template.Spec.InitConfiguration.SkipPhases = restored.Spec.Template.Spec.InitConfiguration.SkipPhases - } - if restored.Spec.Template.Spec.JoinConfiguration != nil { - if dst.Spec.Template.Spec.JoinConfiguration == nil { - dst.Spec.Template.Spec.JoinConfiguration = &bootstrapv1.JoinConfiguration{} - } - dst.Spec.Template.Spec.JoinConfiguration.Patches = restored.Spec.Template.Spec.JoinConfiguration.Patches - dst.Spec.Template.Spec.JoinConfiguration.SkipPhases = restored.Spec.Template.Spec.JoinConfiguration.SkipPhases - } - - if restored.Spec.Template.Spec.JoinConfiguration != nil && restored.Spec.Template.Spec.JoinConfiguration.NodeRegistration.ImagePullPolicy != "" { - if dst.Spec.Template.Spec.JoinConfiguration == nil { - dst.Spec.Template.Spec.JoinConfiguration = &bootstrapv1.JoinConfiguration{} - } - dst.Spec.Template.Spec.JoinConfiguration.NodeRegistration.ImagePullPolicy = restored.Spec.Template.Spec.JoinConfiguration.NodeRegistration.ImagePullPolicy - } - - if restored.Spec.Template.Spec.InitConfiguration != nil && restored.Spec.Template.Spec.InitConfiguration.NodeRegistration.ImagePullPolicy != "" { - if dst.Spec.Template.Spec.InitConfiguration == nil { - dst.Spec.Template.Spec.InitConfiguration = &bootstrapv1.InitConfiguration{} - } - dst.Spec.Template.Spec.InitConfiguration.NodeRegistration.ImagePullPolicy = restored.Spec.Template.Spec.InitConfiguration.NodeRegistration.ImagePullPolicy - } - - return nil -} - -func (dst *KubeadmConfigTemplate) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*bootstrapv1.KubeadmConfigTemplate) - - if err := Convert_v1beta1_KubeadmConfigTemplate_To_v1alpha4_KubeadmConfigTemplate(src, dst, nil); err != nil { - return err - } - // Preserve Hub data on down-conversion except for metadata. - return utilconversion.MarshalData(src, dst) -} - -func (src *KubeadmConfigTemplateList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*bootstrapv1.KubeadmConfigTemplateList) - - return Convert_v1alpha4_KubeadmConfigTemplateList_To_v1beta1_KubeadmConfigTemplateList(src, dst, nil) -} - -func (dst *KubeadmConfigTemplateList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*bootstrapv1.KubeadmConfigTemplateList) - - return Convert_v1beta1_KubeadmConfigTemplateList_To_v1alpha4_KubeadmConfigTemplateList(src, dst, nil) -} - -// Convert_v1beta1_KubeadmConfigSpec_To_v1alpha4_KubeadmConfigSpec is an autogenerated conversion function. -func Convert_v1beta1_KubeadmConfigSpec_To_v1alpha4_KubeadmConfigSpec(in *bootstrapv1.KubeadmConfigSpec, out *KubeadmConfigSpec, s apiconversion.Scope) error { - // KubeadmConfigSpec.Ignition does not exist in kubeadm v1alpha4 API. - return autoConvert_v1beta1_KubeadmConfigSpec_To_v1alpha4_KubeadmConfigSpec(in, out, s) -} - -func Convert_v1beta1_InitConfiguration_To_v1alpha4_InitConfiguration(in *bootstrapv1.InitConfiguration, out *InitConfiguration, s apiconversion.Scope) error { - // InitConfiguration.Patches does not exist in kubeadm v1alpha4 API. - return autoConvert_v1beta1_InitConfiguration_To_v1alpha4_InitConfiguration(in, out, s) -} - -func Convert_v1beta1_JoinConfiguration_To_v1alpha4_JoinConfiguration(in *bootstrapv1.JoinConfiguration, out *JoinConfiguration, s apiconversion.Scope) error { - // InitConfiguration.Patches does not exist in kubeadm v1alpha4 API. - return autoConvert_v1beta1_JoinConfiguration_To_v1alpha4_JoinConfiguration(in, out, s) -} - -func Convert_v1beta1_File_To_v1alpha4_File(in *bootstrapv1.File, out *File, s apiconversion.Scope) error { - // File.Append does not exist in kubeadm v1alpha4 API. - return autoConvert_v1beta1_File_To_v1alpha4_File(in, out, s) -} - -func Convert_v1beta1_User_To_v1alpha4_User(in *bootstrapv1.User, out *User, s apiconversion.Scope) error { - // User.PasswdFrom does not exist in kubeadm v1alpha4 API. - return autoConvert_v1beta1_User_To_v1alpha4_User(in, out, s) -} - -func Convert_v1beta1_NodeRegistrationOptions_To_v1alpha4_NodeRegistrationOptions(in *bootstrapv1.NodeRegistrationOptions, out *NodeRegistrationOptions, s apiconversion.Scope) error { - // NodeRegistrationOptions.ImagePullPolicy does not exit in - // kubeadm v1alpha4 API. - return autoConvert_v1beta1_NodeRegistrationOptions_To_v1alpha4_NodeRegistrationOptions(in, out, s) -} - -func Convert_v1beta1_KubeadmConfigTemplateResource_To_v1alpha4_KubeadmConfigTemplateResource(in *bootstrapv1.KubeadmConfigTemplateResource, out *KubeadmConfigTemplateResource, s apiconversion.Scope) error { - // KubeadmConfigTemplateResource.metadata does not exist in kubeadm v1alpha4. - return autoConvert_v1beta1_KubeadmConfigTemplateResource_To_v1alpha4_KubeadmConfigTemplateResource(in, out, s) -} diff --git a/bootstrap/kubeadm/api/v1alpha4/conversion_test.go b/bootstrap/kubeadm/api/v1alpha4/conversion_test.go deleted file mode 100644 index be6a5a20a9ab..000000000000 --- a/bootstrap/kubeadm/api/v1alpha4/conversion_test.go +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "testing" - - fuzz "github.com/google/gofuzz" - "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" - runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" - - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -const ( - fakeID = "abcdef" - fakeSecret = "abcdef0123456789" -) - -func TestFuzzyConversion(t *testing.T) { - t.Run("for KubeadmConfig", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &bootstrapv1.KubeadmConfig{}, - Spoke: &KubeadmConfig{}, - FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs}, - })) - t.Run("for KubeadmConfigTemplate", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &bootstrapv1.KubeadmConfigTemplate{}, - Spoke: &KubeadmConfigTemplate{}, - FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs}, - })) -} - -func fuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} { - return []interface{}{ - // This custom functions are needed when ConvertTo/ConvertFrom functions - // uses the json package to unmarshal the bootstrap token string. - // - // The Kubeadm BootstrapTokenString type ships with a custom - // json string representation, in particular it supplies a customized - // UnmarshalJSON function that can return an error if the string - // isn't in the correct form. - // - // This function effectively disables any fuzzing for the token by setting - // the values for ID and Secret to working alphanumeric values. - kubeadmBootstrapTokenStringFuzzerV1Beta1, - kubeadmBootstrapTokenStringFuzzerV1Alpha4, - } -} - -func kubeadmBootstrapTokenStringFuzzerV1Beta1(in *bootstrapv1.BootstrapTokenString, _ fuzz.Continue) { - in.ID = fakeID - in.Secret = fakeSecret -} - -func kubeadmBootstrapTokenStringFuzzerV1Alpha4(in *BootstrapTokenString, _ fuzz.Continue) { - in.ID = fakeID - in.Secret = fakeSecret -} diff --git a/bootstrap/kubeadm/api/v1alpha4/doc.go b/bootstrap/kubeadm/api/v1alpha4/doc.go deleted file mode 100644 index 728016c8f49a..000000000000 --- a/bootstrap/kubeadm/api/v1alpha4/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains the v1alpha4 API implementation. -// +k8s:conversion-gen=sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1 -// -// Deprecated: This package will be removed in one of the next releases. -package v1alpha4 diff --git a/bootstrap/kubeadm/api/v1alpha4/groupversion_info.go b/bootstrap/kubeadm/api/v1alpha4/groupversion_info.go deleted file mode 100644 index 310595ffc425..000000000000 --- a/bootstrap/kubeadm/api/v1alpha4/groupversion_info.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains API Schema definitions for the kubeadm v1alpha4 API group -// +kubebuilder:object:generate=true -// +groupName=bootstrap.cluster.x-k8s.io -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -var ( - // GroupVersion is group version used to register these objects. - GroupVersion = schema.GroupVersion{Group: "bootstrap.cluster.x-k8s.io", Version: "v1alpha4"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme. - schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = schemeBuilder.AddToScheme - - objectTypes = []runtime.Object{} - - // localSchemeBuilder is used for type conversions. - localSchemeBuilder = schemeBuilder -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(GroupVersion, objectTypes...) - metav1.AddToGroupVersion(scheme, GroupVersion) - return nil -} diff --git a/bootstrap/kubeadm/api/v1alpha4/kubeadm_types.go b/bootstrap/kubeadm/api/v1alpha4/kubeadm_types.go deleted file mode 100644 index 6e91e00ae28d..000000000000 --- a/bootstrap/kubeadm/api/v1alpha4/kubeadm_types.go +++ /dev/null @@ -1,502 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "fmt" - "strings" - - "github.com/pkg/errors" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - bootstrapapi "k8s.io/cluster-bootstrap/token/api" - bootstraputil "k8s.io/cluster-bootstrap/token/util" -) - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// InitConfiguration contains a list of elements that is specific "kubeadm init"-only runtime -// information. -type InitConfiguration struct { - metav1.TypeMeta `json:",inline"` - - // BootstrapTokens is respected at `kubeadm init` time and describes a set of Bootstrap Tokens to create. - // This information IS NOT uploaded to the kubeadm cluster configmap, partly because of its sensitive nature - // +optional - BootstrapTokens []BootstrapToken `json:"bootstrapTokens,omitempty"` - - // NodeRegistration holds fields that relate to registering the new control-plane node to the cluster. - // When used in the context of control plane nodes, NodeRegistration should remain consistent - // across both InitConfiguration and JoinConfiguration - // +optional - NodeRegistration NodeRegistrationOptions `json:"nodeRegistration,omitempty"` - - // LocalAPIEndpoint represents the endpoint of the API server instance that's deployed on this control plane node - // In HA setups, this differs from ClusterConfiguration.ControlPlaneEndpoint in the sense that ControlPlaneEndpoint - // is the global endpoint for the cluster, which then loadbalances the requests to each individual API server. This - // configuration object lets you customize what IP/DNS name and port the local API server advertises it's accessible - // on. By default, kubeadm tries to auto-detect the IP of the default interface and use that, but in case that process - // fails you may set the desired value here. - // +optional - LocalAPIEndpoint APIEndpoint `json:"localAPIEndpoint,omitempty"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ClusterConfiguration contains cluster-wide configuration for a kubeadm cluster. -type ClusterConfiguration struct { - metav1.TypeMeta `json:",inline"` - - // Etcd holds configuration for etcd. - // NB: This value defaults to a Local (stacked) etcd - // +optional - Etcd Etcd `json:"etcd,omitempty"` - - // Networking holds configuration for the networking topology of the cluster. - // NB: This value defaults to the Cluster object spec.clusterNetwork. - // +optional - Networking Networking `json:"networking,omitempty"` - - // KubernetesVersion is the target version of the control plane. - // NB: This value defaults to the Machine object spec.version - // +optional - KubernetesVersion string `json:"kubernetesVersion,omitempty"` - - // ControlPlaneEndpoint sets a stable IP address or DNS name for the control plane; it - // can be a valid IP address or a RFC-1123 DNS subdomain, both with optional TCP port. - // In case the ControlPlaneEndpoint is not specified, the AdvertiseAddress + BindPort - // are used; in case the ControlPlaneEndpoint is specified but without a TCP port, - // the BindPort is used. - // Possible usages are: - // e.g. In a cluster with more than one control plane instances, this field should be - // assigned the address of the external load balancer in front of the - // control plane instances. - // e.g. in environments with enforced node recycling, the ControlPlaneEndpoint - // could be used for assigning a stable DNS to the control plane. - // NB: This value defaults to the first value in the Cluster object status.apiEndpoints array. - // +optional - ControlPlaneEndpoint string `json:"controlPlaneEndpoint,omitempty"` - - // APIServer contains extra settings for the API server control plane component - // +optional - APIServer APIServer `json:"apiServer,omitempty"` - - // ControllerManager contains extra settings for the controller manager control plane component - // +optional - ControllerManager ControlPlaneComponent `json:"controllerManager,omitempty"` - - // Scheduler contains extra settings for the scheduler control plane component - // +optional - Scheduler ControlPlaneComponent `json:"scheduler,omitempty"` - - // DNS defines the options for the DNS add-on installed in the cluster. - // +optional - DNS DNS `json:"dns,omitempty"` - - // CertificatesDir specifies where to store or look for all required certificates. - // NB: if not provided, this will default to `/etc/kubernetes/pki` - // +optional - CertificatesDir string `json:"certificatesDir,omitempty"` - - // ImageRepository sets the container registry to pull images from. - // If empty, `registry.k8s.io` will be used by default; in case of kubernetes version is a CI build (kubernetes version starts with `ci/` or `ci-cross/`) - // `gcr.io/k8s-staging-ci-images` will be used as a default for control plane components and for kube-proxy, while `registry.k8s.io` - // will be used for all the other images. - // +optional - ImageRepository string `json:"imageRepository,omitempty"` - - // FeatureGates enabled by the user. - // +optional - FeatureGates map[string]bool `json:"featureGates,omitempty"` - - // The cluster name - // +optional - ClusterName string `json:"clusterName,omitempty"` -} - -// ControlPlaneComponent holds settings common to control plane component of the cluster. -type ControlPlaneComponent struct { - // ExtraArgs is an extra set of flags to pass to the control plane component. - // TODO: This is temporary and ideally we would like to switch all components to - // use ComponentConfig + ConfigMaps. - // +optional - ExtraArgs map[string]string `json:"extraArgs,omitempty"` - - // ExtraVolumes is an extra set of host volumes, mounted to the control plane component. - // +optional - ExtraVolumes []HostPathMount `json:"extraVolumes,omitempty"` -} - -// APIServer holds settings necessary for API server deployments in the cluster. -type APIServer struct { - ControlPlaneComponent `json:",inline"` - - // CertSANs sets extra Subject Alternative Names for the API Server signing cert. - // +optional - CertSANs []string `json:"certSANs,omitempty"` - - // TimeoutForControlPlane controls the timeout that we use for API server to appear - // +optional - TimeoutForControlPlane *metav1.Duration `json:"timeoutForControlPlane,omitempty"` -} - -// DNS defines the DNS addon that should be used in the cluster. -type DNS struct { - // ImageMeta allows to customize the image used for the DNS component - ImageMeta `json:",inline"` -} - -// ImageMeta allows to customize the image used for components that are not -// originated from the Kubernetes/Kubernetes release process. -type ImageMeta struct { - // ImageRepository sets the container registry to pull images from. - // if not set, the ImageRepository defined in ClusterConfiguration will be used instead. - // +optional - ImageRepository string `json:"imageRepository,omitempty"` - - // ImageTag allows to specify a tag for the image. - // In case this value is set, kubeadm does not change automatically the version of the above components during upgrades. - // +optional - ImageTag string `json:"imageTag,omitempty"` - - //TODO: evaluate if we need also a ImageName based on user feedbacks -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// ClusterStatus contains the cluster status. The ClusterStatus will be stored in the kubeadm-config -// ConfigMap in the cluster, and then updated by kubeadm when additional control plane instance joins or leaves the cluster. -// -// Deprecated: ClusterStatus has been removed from kubeadm v1beta3 API; This type is preserved only to support -// conversion to older versions of the kubeadm API. -type ClusterStatus struct { - metav1.TypeMeta `json:",inline"` - - // APIEndpoints currently available in the cluster, one for each control plane/api server instance. - // The key of the map is the IP of the host's default interface - APIEndpoints map[string]APIEndpoint `json:"apiEndpoints"` -} - -// APIEndpoint struct contains elements of API server instance deployed on a node. -type APIEndpoint struct { - // AdvertiseAddress sets the IP address for the API server to advertise. - // +optional - AdvertiseAddress string `json:"advertiseAddress,omitempty"` - - // BindPort sets the secure port for the API Server to bind to. - // Defaults to 6443. - // +optional - BindPort int32 `json:"bindPort,omitempty"` -} - -// NodeRegistrationOptions holds fields that relate to registering a new control-plane or node to the cluster, either via "kubeadm init" or "kubeadm join". -type NodeRegistrationOptions struct { - - // Name is the `.Metadata.Name` field of the Node API object that will be created in this `kubeadm init` or `kubeadm join` operation. - // This field is also used in the CommonName field of the kubelet's client certificate to the API server. - // Defaults to the hostname of the node if not provided. - // +optional - Name string `json:"name,omitempty"` - - // CRISocket is used to retrieve container runtime info. This information will be annotated to the Node API object, for later re-use - // +optional - CRISocket string `json:"criSocket,omitempty"` - - // Taints specifies the taints the Node API object should be registered with. If this field is unset, i.e. nil, in the `kubeadm init` process - // it will be defaulted to []v1.Taint{'node-role.kubernetes.io/master=""'}. If you don't want to taint your control-plane node, set this field to an - // empty slice, i.e. `taints: {}` in the YAML file. This field is solely used for Node registration. - Taints []corev1.Taint `json:"taints,omitempty"` - - // KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file - // kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config-1.X ConfigMap - // Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on. - // +optional - KubeletExtraArgs map[string]string `json:"kubeletExtraArgs,omitempty"` - - // IgnorePreflightErrors provides a slice of pre-flight errors to be ignored when the current node is registered. - // +optional - IgnorePreflightErrors []string `json:"ignorePreflightErrors,omitempty"` -} - -// Networking contains elements describing cluster's networking configuration. -type Networking struct { - // ServiceSubnet is the subnet used by k8s services. - // Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.pods.cidrBlocks, or - // to "10.96.0.0/12" if that's unset. - // +optional - ServiceSubnet string `json:"serviceSubnet,omitempty"` - // PodSubnet is the subnet used by pods. - // If unset, the API server will not allocate CIDR ranges for every node. - // Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.services.cidrBlocks if that is set - // +optional - PodSubnet string `json:"podSubnet,omitempty"` - // DNSDomain is the dns domain used by k8s services. Defaults to "cluster.local". - // +optional - DNSDomain string `json:"dnsDomain,omitempty"` -} - -// BootstrapToken describes one bootstrap token, stored as a Secret in the cluster. -type BootstrapToken struct { - // Token is used for establishing bidirectional trust between nodes and control-planes. - // Used for joining nodes in the cluster. - Token *BootstrapTokenString `json:"token"` - // Description sets a human-friendly message why this token exists and what it's used - // for, so other administrators can know its purpose. - // +optional - Description string `json:"description,omitempty"` - // TTL defines the time to live for this token. Defaults to 24h. - // Expires and TTL are mutually exclusive. - // +optional - TTL *metav1.Duration `json:"ttl,omitempty"` - // Expires specifies the timestamp when this token expires. Defaults to being set - // dynamically at runtime based on the TTL. Expires and TTL are mutually exclusive. - // +optional - Expires *metav1.Time `json:"expires,omitempty"` - // Usages describes the ways in which this token can be used. Can by default be used - // for establishing bidirectional trust, but that can be changed here. - // +optional - Usages []string `json:"usages,omitempty"` - // Groups specifies the extra groups that this token will authenticate as when/if - // used for authentication - // +optional - Groups []string `json:"groups,omitempty"` -} - -// Etcd contains elements describing Etcd configuration. -type Etcd struct { - - // Local provides configuration knobs for configuring the local etcd instance - // Local and External are mutually exclusive - // +optional - Local *LocalEtcd `json:"local,omitempty"` - - // External describes how to connect to an external etcd cluster - // Local and External are mutually exclusive - // +optional - External *ExternalEtcd `json:"external,omitempty"` -} - -// LocalEtcd describes that kubeadm should run an etcd cluster locally. -type LocalEtcd struct { - // ImageMeta allows to customize the container used for etcd - ImageMeta `json:",inline"` - - // DataDir is the directory etcd will place its data. - // Defaults to "/var/lib/etcd". - // +optional - DataDir string `json:"dataDir,omitempty"` - - // ExtraArgs are extra arguments provided to the etcd binary - // when run inside a static pod. - // +optional - ExtraArgs map[string]string `json:"extraArgs,omitempty"` - - // ServerCertSANs sets extra Subject Alternative Names for the etcd server signing cert. - // +optional - ServerCertSANs []string `json:"serverCertSANs,omitempty"` - // PeerCertSANs sets extra Subject Alternative Names for the etcd peer signing cert. - // +optional - PeerCertSANs []string `json:"peerCertSANs,omitempty"` -} - -// ExternalEtcd describes an external etcd cluster. -// Kubeadm has no knowledge of where certificate files live and they must be supplied. -type ExternalEtcd struct { - // Endpoints of etcd members. Required for ExternalEtcd. - Endpoints []string `json:"endpoints"` - - // CAFile is an SSL Certificate Authority file used to secure etcd communication. - // Required if using a TLS connection. - CAFile string `json:"caFile"` - - // CertFile is an SSL certification file used to secure etcd communication. - // Required if using a TLS connection. - CertFile string `json:"certFile"` - - // KeyFile is an SSL key file used to secure etcd communication. - // Required if using a TLS connection. - KeyFile string `json:"keyFile"` -} - -// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object - -// JoinConfiguration contains elements describing a particular node. -type JoinConfiguration struct { - metav1.TypeMeta `json:",inline"` - - // NodeRegistration holds fields that relate to registering the new control-plane node to the cluster. - // When used in the context of control plane nodes, NodeRegistration should remain consistent - // across both InitConfiguration and JoinConfiguration - // +optional - NodeRegistration NodeRegistrationOptions `json:"nodeRegistration,omitempty"` - - // CACertPath is the path to the SSL certificate authority used to - // secure comunications between node and control-plane. - // Defaults to "/etc/kubernetes/pki/ca.crt". - // +optional - // TODO: revisit when there is defaulting from k/k - CACertPath string `json:"caCertPath,omitempty"` - - // Discovery specifies the options for the kubelet to use during the TLS Bootstrap process - // +optional - // TODO: revisit when there is defaulting from k/k - Discovery Discovery `json:"discovery,omitempty"` - - // ControlPlane defines the additional control plane instance to be deployed on the joining node. - // If nil, no additional control plane instance will be deployed. - // +optional - ControlPlane *JoinControlPlane `json:"controlPlane,omitempty"` -} - -// JoinControlPlane contains elements describing an additional control plane instance to be deployed on the joining node. -type JoinControlPlane struct { - // LocalAPIEndpoint represents the endpoint of the API server instance to be deployed on this node. - // +optional - LocalAPIEndpoint APIEndpoint `json:"localAPIEndpoint,omitempty"` -} - -// Discovery specifies the options for the kubelet to use during the TLS Bootstrap process. -type Discovery struct { - // BootstrapToken is used to set the options for bootstrap token based discovery - // BootstrapToken and File are mutually exclusive - // +optional - BootstrapToken *BootstrapTokenDiscovery `json:"bootstrapToken,omitempty"` - - // File is used to specify a file or URL to a kubeconfig file from which to load cluster information - // BootstrapToken and File are mutually exclusive - // +optional - File *FileDiscovery `json:"file,omitempty"` - - // TLSBootstrapToken is a token used for TLS bootstrapping. - // If .BootstrapToken is set, this field is defaulted to .BootstrapToken.Token, but can be overridden. - // If .File is set, this field **must be set** in case the KubeConfigFile does not contain any other authentication information - // +optional - TLSBootstrapToken string `json:"tlsBootstrapToken,omitempty"` - - // Timeout modifies the discovery timeout - // +optional - Timeout *metav1.Duration `json:"timeout,omitempty"` -} - -// BootstrapTokenDiscovery is used to set the options for bootstrap token based discovery. -type BootstrapTokenDiscovery struct { - // Token is a token used to validate cluster information - // fetched from the control-plane. - Token string `json:"token"` - - // APIServerEndpoint is an IP or domain name to the API server from which info will be fetched. - // +optional - APIServerEndpoint string `json:"apiServerEndpoint,omitempty"` - - // CACertHashes specifies a set of public key pins to verify - // when token-based discovery is used. The root CA found during discovery - // must match one of these values. Specifying an empty set disables root CA - // pinning, which can be unsafe. Each hash is specified as ":", - // where the only currently supported type is "sha256". This is a hex-encoded - // SHA-256 hash of the Subject Public Key Info (SPKI) object in DER-encoded - // ASN.1. These hashes can be calculated using, for example, OpenSSL: - // openssl x509 -pubkey -in ca.crt openssl rsa -pubin -outform der 2>&/dev/null | openssl dgst -sha256 -hex - // +optional - CACertHashes []string `json:"caCertHashes,omitempty"` - - // UnsafeSkipCAVerification allows token-based discovery - // without CA verification via CACertHashes. This can weaken - // the security of kubeadm since other nodes can impersonate the control-plane. - // +optional - UnsafeSkipCAVerification bool `json:"unsafeSkipCAVerification,omitempty"` -} - -// FileDiscovery is used to specify a file or URL to a kubeconfig file from which to load cluster information. -type FileDiscovery struct { - // KubeConfigPath is used to specify the actual file path or URL to the kubeconfig file from which to load cluster information - KubeConfigPath string `json:"kubeConfigPath"` -} - -// HostPathMount contains elements describing volumes that are mounted from the -// host. -type HostPathMount struct { - // Name of the volume inside the pod template. - Name string `json:"name"` - // HostPath is the path in the host that will be mounted inside - // the pod. - HostPath string `json:"hostPath"` - // MountPath is the path inside the pod where hostPath will be mounted. - MountPath string `json:"mountPath"` - // ReadOnly controls write access to the volume - // +optional - ReadOnly bool `json:"readOnly,omitempty"` - // PathType is the type of the HostPath. - // +optional - PathType corev1.HostPathType `json:"pathType,omitempty"` -} - -// BootstrapTokenString is a token of the format abcdef.abcdef0123456789 that is used -// for both validation of the practically of the API server from a joining node's point -// of view and as an authentication method for the node in the bootstrap phase of -// "kubeadm join". This token is and should be short-lived. -// -// +kubebuilder:validation:Type=string -type BootstrapTokenString struct { - ID string `json:"-"` - Secret string `json:"-"` -} - -// MarshalJSON implements the json.Marshaler interface. -func (bts BootstrapTokenString) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf("%q", bts.String())), nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface. -func (bts *BootstrapTokenString) UnmarshalJSON(b []byte) error { - // If the token is represented as "", just return quickly without an error - if len(b) == 0 { - return nil - } - - // Remove unnecessary " characters coming from the JSON parser - token := strings.ReplaceAll(string(b), `"`, ``) - // Convert the string Token to a BootstrapTokenString object - newbts, err := NewBootstrapTokenString(token) - if err != nil { - return err - } - bts.ID = newbts.ID - bts.Secret = newbts.Secret - return nil -} - -// String returns the string representation of the BootstrapTokenString. -func (bts BootstrapTokenString) String() string { - if len(bts.ID) > 0 && len(bts.Secret) > 0 { - return bootstraputil.TokenFromIDAndSecret(bts.ID, bts.Secret) - } - return "" -} - -// NewBootstrapTokenString converts the given Bootstrap Token as a string -// to the BootstrapTokenString object used for serialization/deserialization -// and internal usage. It also automatically validates that the given token -// is of the right format. -func NewBootstrapTokenString(token string) (*BootstrapTokenString, error) { - substrs := bootstraputil.BootstrapTokenRegexp.FindStringSubmatch(token) - // TODO: Add a constant for the 3 value here, and explain better why it's needed (other than because how the regexp parsin works) - if len(substrs) != 3 { - return nil, errors.Errorf("the bootstrap token %q was not of the form %q", token, bootstrapapi.BootstrapTokenPattern) - } - - return &BootstrapTokenString{ID: substrs[1], Secret: substrs[2]}, nil -} diff --git a/bootstrap/kubeadm/api/v1alpha4/kubeadm_types_test.go b/bootstrap/kubeadm/api/v1alpha4/kubeadm_types_test.go deleted file mode 100644 index 9c2fdc6e5034..000000000000 --- a/bootstrap/kubeadm/api/v1alpha4/kubeadm_types_test.go +++ /dev/null @@ -1,188 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "encoding/json" - "testing" - - "github.com/google/go-cmp/cmp" - . "github.com/onsi/gomega" - "github.com/pkg/errors" -) - -func TestMarshalJSON(t *testing.T) { - var tests = []struct { - bts BootstrapTokenString - expected string - }{ - {BootstrapTokenString{ID: "abcdef", Secret: "abcdef0123456789"}, `"abcdef.abcdef0123456789"`}, - {BootstrapTokenString{ID: "foo", Secret: "bar"}, `"foo.bar"`}, - {BootstrapTokenString{ID: "h", Secret: "b"}, `"h.b"`}, - } - for _, rt := range tests { - t.Run(rt.bts.ID, func(t *testing.T) { - g := NewWithT(t) - - b, err := json.Marshal(rt.bts) - g.Expect(err).ToNot(HaveOccurred()) - g.Expect(string(b)).To(Equal(rt.expected)) - }) - } -} - -func TestUnmarshalJSON(t *testing.T) { - var tests = []struct { - input string - bts *BootstrapTokenString - expectedError bool - }{ - {`"f.s"`, &BootstrapTokenString{}, true}, - {`"abcdef."`, &BootstrapTokenString{}, true}, - {`"abcdef:abcdef0123456789"`, &BootstrapTokenString{}, true}, - {`abcdef.abcdef0123456789`, &BootstrapTokenString{}, true}, - {`"abcdef.abcdef0123456789`, &BootstrapTokenString{}, true}, - {`"abcdef.ABCDEF0123456789"`, &BootstrapTokenString{}, true}, - {`"abcdef.abcdef0123456789"`, &BootstrapTokenString{ID: "abcdef", Secret: "abcdef0123456789"}, false}, - {`"123456.aabbccddeeffgghh"`, &BootstrapTokenString{ID: "123456", Secret: "aabbccddeeffgghh"}, false}, - } - for _, rt := range tests { - t.Run(rt.input, func(t *testing.T) { - g := NewWithT(t) - - newbts := &BootstrapTokenString{} - err := json.Unmarshal([]byte(rt.input), newbts) - if rt.expectedError { - g.Expect(err).To(HaveOccurred()) - } else { - g.Expect(err).ToNot(HaveOccurred()) - } - g.Expect(newbts).To(BeComparableTo(rt.bts)) - }) - } -} - -func TestJSONRoundtrip(t *testing.T) { - var tests = []struct { - input string - bts *BootstrapTokenString - }{ - {`"abcdef.abcdef0123456789"`, nil}, - {"", &BootstrapTokenString{ID: "abcdef", Secret: "abcdef0123456789"}}, - } - for _, rt := range tests { - t.Run(rt.input, func(t *testing.T) { - g := NewWithT(t) - - g.Expect(roundtrip(rt.input, rt.bts)).To(Succeed()) - }) - } -} - -func roundtrip(input string, bts *BootstrapTokenString) error { - var b []byte - var err error - newbts := &BootstrapTokenString{} - // If string input was specified, roundtrip like this: string -> (unmarshal) -> object -> (marshal) -> string - if len(input) > 0 { - if err := json.Unmarshal([]byte(input), newbts); err != nil { - return errors.Wrap(err, "expected no unmarshal error, got error") - } - if b, err = json.Marshal(newbts); err != nil { - return errors.Wrap(err, "expected no marshal error, got error") - } - if input != string(b) { - return errors.Errorf( - "expected token: %s\n\t actual: %s", - input, - string(b), - ) - } - } else { // Otherwise, roundtrip like this: object -> (marshal) -> string -> (unmarshal) -> object - if b, err = json.Marshal(bts); err != nil { - return errors.Wrap(err, "expected no marshal error, got error") - } - if err := json.Unmarshal(b, newbts); err != nil { - return errors.Wrap(err, "expected no unmarshal error, got error") - } - if diff := cmp.Diff(bts, newbts); diff != "" { - return errors.Errorf( - "expected object: %v\n\t actual: %v\n\t got diff: %v", - bts, - newbts, - diff, - ) - } - } - return nil -} - -func TestTokenFromIDAndSecret(t *testing.T) { - var tests = []struct { - bts BootstrapTokenString - expected string - }{ - {BootstrapTokenString{ID: "foo", Secret: "bar"}, "foo.bar"}, - {BootstrapTokenString{ID: "abcdef", Secret: "abcdef0123456789"}, "abcdef.abcdef0123456789"}, - {BootstrapTokenString{ID: "h", Secret: "b"}, "h.b"}, - } - for _, rt := range tests { - t.Run(rt.bts.ID, func(t *testing.T) { - g := NewWithT(t) - - g.Expect(rt.bts.String()).To(Equal(rt.expected)) - }) - } -} - -func TestNewBootstrapTokenString(t *testing.T) { - var tests = []struct { - token string - expectedError bool - bts *BootstrapTokenString - }{ - {token: "", expectedError: true, bts: nil}, - {token: ".", expectedError: true, bts: nil}, - {token: "1234567890123456789012", expectedError: true, bts: nil}, // invalid parcel size - {token: "12345.1234567890123456", expectedError: true, bts: nil}, // invalid parcel size - {token: ".1234567890123456", expectedError: true, bts: nil}, // invalid parcel size - {token: "123456.", expectedError: true, bts: nil}, // invalid parcel size - {token: "123456:1234567890.123456", expectedError: true, bts: nil}, // invalid separation - {token: "abcdef:1234567890123456", expectedError: true, bts: nil}, // invalid separation - {token: "Abcdef.1234567890123456", expectedError: true, bts: nil}, // invalid token id - {token: "123456.AABBCCDDEEFFGGHH", expectedError: true, bts: nil}, // invalid token secret - {token: "123456.AABBCCD-EEFFGGHH", expectedError: true, bts: nil}, // invalid character - {token: "abc*ef.1234567890123456", expectedError: true, bts: nil}, // invalid character - {token: "abcdef.1234567890123456", expectedError: false, bts: &BootstrapTokenString{ID: "abcdef", Secret: "1234567890123456"}}, - {token: "123456.aabbccddeeffgghh", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "aabbccddeeffgghh"}}, - {token: "abcdef.abcdef0123456789", expectedError: false, bts: &BootstrapTokenString{ID: "abcdef", Secret: "abcdef0123456789"}}, - {token: "123456.1234560123456789", expectedError: false, bts: &BootstrapTokenString{ID: "123456", Secret: "1234560123456789"}}, - } - for _, rt := range tests { - t.Run(rt.token, func(t *testing.T) { - g := NewWithT(t) - - actual, err := NewBootstrapTokenString(rt.token) - if rt.expectedError { - g.Expect(err).To(HaveOccurred()) - } else { - g.Expect(err).ToNot(HaveOccurred()) - } - g.Expect(actual).To(BeComparableTo(rt.bts)) - }) - } -} diff --git a/bootstrap/kubeadm/api/v1alpha4/kubeadmconfig_types.go b/bootstrap/kubeadm/api/v1alpha4/kubeadmconfig_types.go deleted file mode 100644 index ccaea9dbcf35..000000000000 --- a/bootstrap/kubeadm/api/v1alpha4/kubeadmconfig_types.go +++ /dev/null @@ -1,337 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" -) - -// Format specifies the output format of the bootstrap data -// +kubebuilder:validation:Enum=cloud-config -type Format string - -const ( - // CloudConfig make the bootstrap data to be of cloud-config format. - CloudConfig Format = "cloud-config" -) - -// KubeadmConfigSpec defines the desired state of KubeadmConfig. -// Either ClusterConfiguration and InitConfiguration should be defined or the JoinConfiguration should be defined. -type KubeadmConfigSpec struct { - // ClusterConfiguration along with InitConfiguration are the configurations necessary for the init command - // +optional - ClusterConfiguration *ClusterConfiguration `json:"clusterConfiguration,omitempty"` - - // InitConfiguration along with ClusterConfiguration are the configurations necessary for the init command - // +optional - InitConfiguration *InitConfiguration `json:"initConfiguration,omitempty"` - - // JoinConfiguration is the kubeadm configuration for the join command - // +optional - JoinConfiguration *JoinConfiguration `json:"joinConfiguration,omitempty"` - - // Files specifies extra files to be passed to user_data upon creation. - // +optional - Files []File `json:"files,omitempty"` - - // DiskSetup specifies options for the creation of partition tables and file systems on devices. - // +optional - DiskSetup *DiskSetup `json:"diskSetup,omitempty"` - - // Mounts specifies a list of mount points to be setup. - // +optional - Mounts []MountPoints `json:"mounts,omitempty"` - - // PreKubeadmCommands specifies extra commands to run before kubeadm runs - // +optional - PreKubeadmCommands []string `json:"preKubeadmCommands,omitempty"` - - // PostKubeadmCommands specifies extra commands to run after kubeadm runs - // +optional - PostKubeadmCommands []string `json:"postKubeadmCommands,omitempty"` - - // Users specifies extra users to add - // +optional - Users []User `json:"users,omitempty"` - - // NTP specifies NTP configuration - // +optional - NTP *NTP `json:"ntp,omitempty"` - - // Format specifies the output format of the bootstrap data - // +optional - Format Format `json:"format,omitempty"` - - // Verbosity is the number for the kubeadm log level verbosity. - // It overrides the `--v` flag in kubeadm commands. - // +optional - Verbosity *int32 `json:"verbosity,omitempty"` - - // UseExperimentalRetryJoin replaces a basic kubeadm command with a shell - // script with retries for joins. - // - // This is meant to be an experimental temporary workaround on some environments - // where joins fail due to timing (and other issues). The long term goal is to add retries to - // kubeadm proper and use that functionality. - // - // This will add about 40KB to userdata - // - // For more information, refer to https://github.com/kubernetes-sigs/cluster-api/pull/2763#discussion_r397306055. - // +optional - UseExperimentalRetryJoin bool `json:"useExperimentalRetryJoin,omitempty"` -} - -// KubeadmConfigStatus defines the observed state of KubeadmConfig. -type KubeadmConfigStatus struct { - // Ready indicates the BootstrapData field is ready to be consumed - Ready bool `json:"ready,omitempty"` - - // DataSecretName is the name of the secret that stores the bootstrap data script. - // +optional - DataSecretName *string `json:"dataSecretName,omitempty"` - - // FailureReason will be set on non-retryable errors - // +optional - FailureReason string `json:"failureReason,omitempty"` - - // FailureMessage will be set on non-retryable errors - // +optional - FailureMessage string `json:"failureMessage,omitempty"` - - // ObservedGeneration is the latest generation observed by the controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // Conditions defines current service state of the KubeadmConfig. - // +optional - Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:resource:path=kubeadmconfigs,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of KubeadmConfig" - -// KubeadmConfig is the Schema for the kubeadmconfigs API. -// -// Deprecated: This type will be removed in one of the next releases. -type KubeadmConfig struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec KubeadmConfigSpec `json:"spec,omitempty"` - Status KubeadmConfigStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (c *KubeadmConfig) GetConditions() clusterv1alpha4.Conditions { - return c.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (c *KubeadmConfig) SetConditions(conditions clusterv1alpha4.Conditions) { - c.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// KubeadmConfigList contains a list of KubeadmConfig. -// -// Deprecated: This type will be removed in one of the next releases. -type KubeadmConfigList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []KubeadmConfig `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &KubeadmConfig{}, &KubeadmConfigList{}) -} - -// Encoding specifies the cloud-init file encoding. -// +kubebuilder:validation:Enum=base64;gzip;gzip+base64 -type Encoding string - -const ( - // Base64 implies the contents of the file are encoded as base64. - Base64 Encoding = "base64" - // Gzip implies the contents of the file are encoded with gzip. - Gzip Encoding = "gzip" - // GzipBase64 implies the contents of the file are first base64 encoded and then gzip encoded. - GzipBase64 Encoding = "gzip+base64" -) - -// File defines the input for generating write_files in cloud-init. -type File struct { - // Path specifies the full path on disk where to store the file. - Path string `json:"path"` - - // Owner specifies the ownership of the file, e.g. "root:root". - // +optional - Owner string `json:"owner,omitempty"` - - // Permissions specifies the permissions to assign to the file, e.g. "0640". - // +optional - Permissions string `json:"permissions,omitempty"` - - // Encoding specifies the encoding of the file contents. - // +optional - Encoding Encoding `json:"encoding,omitempty"` - - // Content is the actual content of the file. - // +optional - Content string `json:"content,omitempty"` - - // ContentFrom is a referenced source of content to populate the file. - // +optional - ContentFrom *FileSource `json:"contentFrom,omitempty"` -} - -// FileSource is a union of all possible external source types for file data. -// Only one field may be populated in any given instance. Developers adding new -// sources of data for target systems should add them here. -type FileSource struct { - // Secret represents a secret that should populate this file. - Secret SecretFileSource `json:"secret"` -} - -// SecretFileSource adapts a Secret into a FileSource. -// -// The contents of the target Secret's Data field will be presented -// as files using the keys in the Data field as the file names. -type SecretFileSource struct { - // Name of the secret in the KubeadmBootstrapConfig's namespace to use. - Name string `json:"name"` - - // Key is the key in the secret's data map for this value. - Key string `json:"key"` -} - -// User defines the input for a generated user in cloud-init. -type User struct { - // Name specifies the user name - Name string `json:"name"` - - // Gecos specifies the gecos to use for the user - // +optional - Gecos *string `json:"gecos,omitempty"` - - // Groups specifies the additional groups for the user - // +optional - Groups *string `json:"groups,omitempty"` - - // HomeDir specifies the home directory to use for the user - // +optional - HomeDir *string `json:"homeDir,omitempty"` - - // Inactive specifies whether to mark the user as inactive - // +optional - Inactive *bool `json:"inactive,omitempty"` - - // Shell specifies the user's shell - // +optional - Shell *string `json:"shell,omitempty"` - - // Passwd specifies a hashed password for the user - // +optional - Passwd *string `json:"passwd,omitempty"` - - // PrimaryGroup specifies the primary group for the user - // +optional - PrimaryGroup *string `json:"primaryGroup,omitempty"` - - // LockPassword specifies if password login should be disabled - // +optional - LockPassword *bool `json:"lockPassword,omitempty"` - - // Sudo specifies a sudo role for the user - // +optional - Sudo *string `json:"sudo,omitempty"` - - // SSHAuthorizedKeys specifies a list of ssh authorized keys for the user - // +optional - SSHAuthorizedKeys []string `json:"sshAuthorizedKeys,omitempty"` -} - -// NTP defines input for generated ntp in cloud-init. -type NTP struct { - // Servers specifies which NTP servers to use - // +optional - Servers []string `json:"servers,omitempty"` - - // Enabled specifies whether NTP should be enabled - // +optional - Enabled *bool `json:"enabled,omitempty"` -} - -// DiskSetup defines input for generated disk_setup and fs_setup in cloud-init. -type DiskSetup struct { - // Partitions specifies the list of the partitions to setup. - Partitions []Partition `json:"partitions,omitempty"` - // Filesystems specifies the list of file systems to setup. - Filesystems []Filesystem `json:"filesystems,omitempty"` -} - -// Partition defines how to create and layout a partition. -type Partition struct { - // Device is the name of the device. - Device string `json:"device"` - // Layout specifies the device layout. - // If it is true, a single partition will be created for the entire device. - // When layout is false, it means don't partition or ignore existing partitioning. - Layout bool `json:"layout"` - // Overwrite describes whether to skip checks and create the partition if a partition or filesystem is found on the device. - // Use with caution. Default is 'false'. - // +optional - Overwrite *bool `json:"overwrite,omitempty"` - // TableType specifies the tupe of partition table. The following are supported: - // 'mbr': default and setups a MS-DOS partition table - // 'gpt': setups a GPT partition table - // +optional - TableType *string `json:"tableType,omitempty"` -} - -// Filesystem defines the file systems to be created. -type Filesystem struct { - // Device specifies the device name - Device string `json:"device"` - // Filesystem specifies the file system type. - Filesystem string `json:"filesystem"` - // Label specifies the file system label to be used. If set to None, no label is used. - Label string `json:"label"` - // Partition specifies the partition to use. The valid options are: "auto|any", "auto", "any", "none", and , where NUM is the actual partition number. - // +optional - Partition *string `json:"partition,omitempty"` - // Overwrite defines whether or not to overwrite any existing filesystem. - // If true, any pre-existing file system will be destroyed. Use with Caution. - // +optional - Overwrite *bool `json:"overwrite,omitempty"` - // ReplaceFS is a special directive, used for Microsoft Azure that instructs cloud-init to replace a file system of . - // NOTE: unless you define a label, this requires the use of the 'any' partition directive. - // +optional - ReplaceFS *string `json:"replaceFS,omitempty"` - // ExtraOpts defined extra options to add to the command for creating the file system. - // +optional - ExtraOpts []string `json:"extraOpts,omitempty"` -} - -// MountPoints defines input for generated mounts in cloud-init. -type MountPoints []string diff --git a/bootstrap/kubeadm/api/v1alpha4/kubeadmconfigtemplate_types.go b/bootstrap/kubeadm/api/v1alpha4/kubeadmconfigtemplate_types.go deleted file mode 100644 index 31502d4d425a..000000000000 --- a/bootstrap/kubeadm/api/v1alpha4/kubeadmconfigtemplate_types.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// KubeadmConfigTemplateSpec defines the desired state of KubeadmConfigTemplate. -type KubeadmConfigTemplateSpec struct { - Template KubeadmConfigTemplateResource `json:"template"` -} - -// KubeadmConfigTemplateResource defines the Template structure. -type KubeadmConfigTemplateResource struct { - Spec KubeadmConfigSpec `json:"spec,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:resource:path=kubeadmconfigtemplates,scope=Namespaced,categories=cluster-api -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of KubeadmConfigTemplate" - -// KubeadmConfigTemplate is the Schema for the kubeadmconfigtemplates API. -// -// Deprecated: This type will be removed in one of the next releases. -type KubeadmConfigTemplate struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec KubeadmConfigTemplateSpec `json:"spec,omitempty"` -} - -// +kubebuilder:object:root=true - -// KubeadmConfigTemplateList contains a list of KubeadmConfigTemplate. -// -// Deprecated: This type will be removed in one of the next releases. -type KubeadmConfigTemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []KubeadmConfigTemplate `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &KubeadmConfigTemplate{}, &KubeadmConfigTemplateList{}) -} diff --git a/bootstrap/kubeadm/api/v1alpha4/zz_generated.conversion.go b/bootstrap/kubeadm/api/v1alpha4/zz_generated.conversion.go deleted file mode 100644 index bcc2c3a8cd72..000000000000 --- a/bootstrap/kubeadm/api/v1alpha4/zz_generated.conversion.go +++ /dev/null @@ -1,1540 +0,0 @@ -//go:build !ignore_autogenerated_kubeadm_bootstrap -// +build !ignore_autogenerated_kubeadm_bootstrap - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - unsafe "unsafe" - - corev1 "k8s.io/api/core/v1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" - v1beta1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*APIEndpoint)(nil), (*v1beta1.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(a.(*APIEndpoint), b.(*v1beta1.APIEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.APIEndpoint)(nil), (*APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(a.(*v1beta1.APIEndpoint), b.(*APIEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*APIServer)(nil), (*v1beta1.APIServer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_APIServer_To_v1beta1_APIServer(a.(*APIServer), b.(*v1beta1.APIServer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.APIServer)(nil), (*APIServer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_APIServer_To_v1alpha4_APIServer(a.(*v1beta1.APIServer), b.(*APIServer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*BootstrapToken)(nil), (*v1beta1.BootstrapToken)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_BootstrapToken_To_v1beta1_BootstrapToken(a.(*BootstrapToken), b.(*v1beta1.BootstrapToken), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.BootstrapToken)(nil), (*BootstrapToken)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_BootstrapToken_To_v1alpha4_BootstrapToken(a.(*v1beta1.BootstrapToken), b.(*BootstrapToken), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*BootstrapTokenDiscovery)(nil), (*v1beta1.BootstrapTokenDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_BootstrapTokenDiscovery_To_v1beta1_BootstrapTokenDiscovery(a.(*BootstrapTokenDiscovery), b.(*v1beta1.BootstrapTokenDiscovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.BootstrapTokenDiscovery)(nil), (*BootstrapTokenDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_BootstrapTokenDiscovery_To_v1alpha4_BootstrapTokenDiscovery(a.(*v1beta1.BootstrapTokenDiscovery), b.(*BootstrapTokenDiscovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*BootstrapTokenString)(nil), (*v1beta1.BootstrapTokenString)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_BootstrapTokenString_To_v1beta1_BootstrapTokenString(a.(*BootstrapTokenString), b.(*v1beta1.BootstrapTokenString), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.BootstrapTokenString)(nil), (*BootstrapTokenString)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_BootstrapTokenString_To_v1alpha4_BootstrapTokenString(a.(*v1beta1.BootstrapTokenString), b.(*BootstrapTokenString), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterConfiguration)(nil), (*v1beta1.ClusterConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterConfiguration_To_v1beta1_ClusterConfiguration(a.(*ClusterConfiguration), b.(*v1beta1.ClusterConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterConfiguration)(nil), (*ClusterConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterConfiguration_To_v1alpha4_ClusterConfiguration(a.(*v1beta1.ClusterConfiguration), b.(*ClusterConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterStatus)(nil), (*v1beta1.ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(a.(*ClusterStatus), b.(*v1beta1.ClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterStatus)(nil), (*ClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(a.(*v1beta1.ClusterStatus), b.(*ClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ControlPlaneComponent)(nil), (*v1beta1.ControlPlaneComponent)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(a.(*ControlPlaneComponent), b.(*v1beta1.ControlPlaneComponent), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ControlPlaneComponent)(nil), (*ControlPlaneComponent)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ControlPlaneComponent_To_v1alpha4_ControlPlaneComponent(a.(*v1beta1.ControlPlaneComponent), b.(*ControlPlaneComponent), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DNS)(nil), (*v1beta1.DNS)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DNS_To_v1beta1_DNS(a.(*DNS), b.(*v1beta1.DNS), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DNS)(nil), (*DNS)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DNS_To_v1alpha4_DNS(a.(*v1beta1.DNS), b.(*DNS), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Discovery)(nil), (*v1beta1.Discovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Discovery_To_v1beta1_Discovery(a.(*Discovery), b.(*v1beta1.Discovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Discovery)(nil), (*Discovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Discovery_To_v1alpha4_Discovery(a.(*v1beta1.Discovery), b.(*Discovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DiskSetup)(nil), (*v1beta1.DiskSetup)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DiskSetup_To_v1beta1_DiskSetup(a.(*DiskSetup), b.(*v1beta1.DiskSetup), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DiskSetup)(nil), (*DiskSetup)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DiskSetup_To_v1alpha4_DiskSetup(a.(*v1beta1.DiskSetup), b.(*DiskSetup), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Etcd)(nil), (*v1beta1.Etcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Etcd_To_v1beta1_Etcd(a.(*Etcd), b.(*v1beta1.Etcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Etcd)(nil), (*Etcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Etcd_To_v1alpha4_Etcd(a.(*v1beta1.Etcd), b.(*Etcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ExternalEtcd)(nil), (*v1beta1.ExternalEtcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ExternalEtcd_To_v1beta1_ExternalEtcd(a.(*ExternalEtcd), b.(*v1beta1.ExternalEtcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ExternalEtcd)(nil), (*ExternalEtcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ExternalEtcd_To_v1alpha4_ExternalEtcd(a.(*v1beta1.ExternalEtcd), b.(*ExternalEtcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*File)(nil), (*v1beta1.File)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_File_To_v1beta1_File(a.(*File), b.(*v1beta1.File), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*FileDiscovery)(nil), (*v1beta1.FileDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_FileDiscovery_To_v1beta1_FileDiscovery(a.(*FileDiscovery), b.(*v1beta1.FileDiscovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.FileDiscovery)(nil), (*FileDiscovery)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_FileDiscovery_To_v1alpha4_FileDiscovery(a.(*v1beta1.FileDiscovery), b.(*FileDiscovery), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*FileSource)(nil), (*v1beta1.FileSource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_FileSource_To_v1beta1_FileSource(a.(*FileSource), b.(*v1beta1.FileSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.FileSource)(nil), (*FileSource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_FileSource_To_v1alpha4_FileSource(a.(*v1beta1.FileSource), b.(*FileSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Filesystem)(nil), (*v1beta1.Filesystem)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Filesystem_To_v1beta1_Filesystem(a.(*Filesystem), b.(*v1beta1.Filesystem), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Filesystem)(nil), (*Filesystem)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Filesystem_To_v1alpha4_Filesystem(a.(*v1beta1.Filesystem), b.(*Filesystem), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*HostPathMount)(nil), (*v1beta1.HostPathMount)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_HostPathMount_To_v1beta1_HostPathMount(a.(*HostPathMount), b.(*v1beta1.HostPathMount), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.HostPathMount)(nil), (*HostPathMount)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_HostPathMount_To_v1alpha4_HostPathMount(a.(*v1beta1.HostPathMount), b.(*HostPathMount), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ImageMeta)(nil), (*v1beta1.ImageMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ImageMeta_To_v1beta1_ImageMeta(a.(*ImageMeta), b.(*v1beta1.ImageMeta), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ImageMeta)(nil), (*ImageMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ImageMeta_To_v1alpha4_ImageMeta(a.(*v1beta1.ImageMeta), b.(*ImageMeta), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*InitConfiguration)(nil), (*v1beta1.InitConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_InitConfiguration_To_v1beta1_InitConfiguration(a.(*InitConfiguration), b.(*v1beta1.InitConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*JoinConfiguration)(nil), (*v1beta1.JoinConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_JoinConfiguration_To_v1beta1_JoinConfiguration(a.(*JoinConfiguration), b.(*v1beta1.JoinConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*JoinControlPlane)(nil), (*v1beta1.JoinControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_JoinControlPlane_To_v1beta1_JoinControlPlane(a.(*JoinControlPlane), b.(*v1beta1.JoinControlPlane), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.JoinControlPlane)(nil), (*JoinControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_JoinControlPlane_To_v1alpha4_JoinControlPlane(a.(*v1beta1.JoinControlPlane), b.(*JoinControlPlane), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KubeadmConfig)(nil), (*v1beta1.KubeadmConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmConfig_To_v1beta1_KubeadmConfig(a.(*KubeadmConfig), b.(*v1beta1.KubeadmConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.KubeadmConfig)(nil), (*KubeadmConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmConfig_To_v1alpha4_KubeadmConfig(a.(*v1beta1.KubeadmConfig), b.(*KubeadmConfig), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KubeadmConfigList)(nil), (*v1beta1.KubeadmConfigList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmConfigList_To_v1beta1_KubeadmConfigList(a.(*KubeadmConfigList), b.(*v1beta1.KubeadmConfigList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.KubeadmConfigList)(nil), (*KubeadmConfigList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmConfigList_To_v1alpha4_KubeadmConfigList(a.(*v1beta1.KubeadmConfigList), b.(*KubeadmConfigList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KubeadmConfigSpec)(nil), (*v1beta1.KubeadmConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmConfigSpec_To_v1beta1_KubeadmConfigSpec(a.(*KubeadmConfigSpec), b.(*v1beta1.KubeadmConfigSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KubeadmConfigStatus)(nil), (*v1beta1.KubeadmConfigStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmConfigStatus_To_v1beta1_KubeadmConfigStatus(a.(*KubeadmConfigStatus), b.(*v1beta1.KubeadmConfigStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.KubeadmConfigStatus)(nil), (*KubeadmConfigStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmConfigStatus_To_v1alpha4_KubeadmConfigStatus(a.(*v1beta1.KubeadmConfigStatus), b.(*KubeadmConfigStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KubeadmConfigTemplate)(nil), (*v1beta1.KubeadmConfigTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmConfigTemplate_To_v1beta1_KubeadmConfigTemplate(a.(*KubeadmConfigTemplate), b.(*v1beta1.KubeadmConfigTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.KubeadmConfigTemplate)(nil), (*KubeadmConfigTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmConfigTemplate_To_v1alpha4_KubeadmConfigTemplate(a.(*v1beta1.KubeadmConfigTemplate), b.(*KubeadmConfigTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KubeadmConfigTemplateList)(nil), (*v1beta1.KubeadmConfigTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmConfigTemplateList_To_v1beta1_KubeadmConfigTemplateList(a.(*KubeadmConfigTemplateList), b.(*v1beta1.KubeadmConfigTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.KubeadmConfigTemplateList)(nil), (*KubeadmConfigTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmConfigTemplateList_To_v1alpha4_KubeadmConfigTemplateList(a.(*v1beta1.KubeadmConfigTemplateList), b.(*KubeadmConfigTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KubeadmConfigTemplateResource)(nil), (*v1beta1.KubeadmConfigTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmConfigTemplateResource_To_v1beta1_KubeadmConfigTemplateResource(a.(*KubeadmConfigTemplateResource), b.(*v1beta1.KubeadmConfigTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KubeadmConfigTemplateSpec)(nil), (*v1beta1.KubeadmConfigTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmConfigTemplateSpec_To_v1beta1_KubeadmConfigTemplateSpec(a.(*KubeadmConfigTemplateSpec), b.(*v1beta1.KubeadmConfigTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.KubeadmConfigTemplateSpec)(nil), (*KubeadmConfigTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmConfigTemplateSpec_To_v1alpha4_KubeadmConfigTemplateSpec(a.(*v1beta1.KubeadmConfigTemplateSpec), b.(*KubeadmConfigTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*LocalEtcd)(nil), (*v1beta1.LocalEtcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_LocalEtcd_To_v1beta1_LocalEtcd(a.(*LocalEtcd), b.(*v1beta1.LocalEtcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.LocalEtcd)(nil), (*LocalEtcd)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_LocalEtcd_To_v1alpha4_LocalEtcd(a.(*v1beta1.LocalEtcd), b.(*LocalEtcd), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NTP)(nil), (*v1beta1.NTP)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NTP_To_v1beta1_NTP(a.(*NTP), b.(*v1beta1.NTP), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.NTP)(nil), (*NTP)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NTP_To_v1alpha4_NTP(a.(*v1beta1.NTP), b.(*NTP), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Networking)(nil), (*v1beta1.Networking)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Networking_To_v1beta1_Networking(a.(*Networking), b.(*v1beta1.Networking), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Networking)(nil), (*Networking)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Networking_To_v1alpha4_Networking(a.(*v1beta1.Networking), b.(*Networking), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*NodeRegistrationOptions)(nil), (*v1beta1.NodeRegistrationOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(a.(*NodeRegistrationOptions), b.(*v1beta1.NodeRegistrationOptions), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Partition)(nil), (*v1beta1.Partition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Partition_To_v1beta1_Partition(a.(*Partition), b.(*v1beta1.Partition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Partition)(nil), (*Partition)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Partition_To_v1alpha4_Partition(a.(*v1beta1.Partition), b.(*Partition), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*SecretFileSource)(nil), (*v1beta1.SecretFileSource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_SecretFileSource_To_v1beta1_SecretFileSource(a.(*SecretFileSource), b.(*v1beta1.SecretFileSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.SecretFileSource)(nil), (*SecretFileSource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_SecretFileSource_To_v1alpha4_SecretFileSource(a.(*v1beta1.SecretFileSource), b.(*SecretFileSource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*User)(nil), (*v1beta1.User)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_User_To_v1beta1_User(a.(*User), b.(*v1beta1.User), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.File)(nil), (*File)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_File_To_v1alpha4_File(a.(*v1beta1.File), b.(*File), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.InitConfiguration)(nil), (*InitConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_InitConfiguration_To_v1alpha4_InitConfiguration(a.(*v1beta1.InitConfiguration), b.(*InitConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.JoinConfiguration)(nil), (*JoinConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_JoinConfiguration_To_v1alpha4_JoinConfiguration(a.(*v1beta1.JoinConfiguration), b.(*JoinConfiguration), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.KubeadmConfigSpec)(nil), (*KubeadmConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmConfigSpec_To_v1alpha4_KubeadmConfigSpec(a.(*v1beta1.KubeadmConfigSpec), b.(*KubeadmConfigSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.KubeadmConfigTemplateResource)(nil), (*KubeadmConfigTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmConfigTemplateResource_To_v1alpha4_KubeadmConfigTemplateResource(a.(*v1beta1.KubeadmConfigTemplateResource), b.(*KubeadmConfigTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.NodeRegistrationOptions)(nil), (*NodeRegistrationOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_NodeRegistrationOptions_To_v1alpha4_NodeRegistrationOptions(a.(*v1beta1.NodeRegistrationOptions), b.(*NodeRegistrationOptions), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.User)(nil), (*User)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_User_To_v1alpha4_User(a.(*v1beta1.User), b.(*User), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in *APIEndpoint, out *v1beta1.APIEndpoint, s conversion.Scope) error { - out.AdvertiseAddress = in.AdvertiseAddress - out.BindPort = in.BindPort - return nil -} - -// Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint is an autogenerated conversion function. -func Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in *APIEndpoint, out *v1beta1.APIEndpoint, s conversion.Scope) error { - return autoConvert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in, out, s) -} - -func autoConvert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in *v1beta1.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { - out.AdvertiseAddress = in.AdvertiseAddress - out.BindPort = in.BindPort - return nil -} - -// Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint is an autogenerated conversion function. -func Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in *v1beta1.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { - return autoConvert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in, out, s) -} - -func autoConvert_v1alpha4_APIServer_To_v1beta1_APIServer(in *APIServer, out *v1beta1.APIServer, s conversion.Scope) error { - if err := Convert_v1alpha4_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(&in.ControlPlaneComponent, &out.ControlPlaneComponent, s); err != nil { - return err - } - out.CertSANs = *(*[]string)(unsafe.Pointer(&in.CertSANs)) - out.TimeoutForControlPlane = (*v1.Duration)(unsafe.Pointer(in.TimeoutForControlPlane)) - return nil -} - -// Convert_v1alpha4_APIServer_To_v1beta1_APIServer is an autogenerated conversion function. -func Convert_v1alpha4_APIServer_To_v1beta1_APIServer(in *APIServer, out *v1beta1.APIServer, s conversion.Scope) error { - return autoConvert_v1alpha4_APIServer_To_v1beta1_APIServer(in, out, s) -} - -func autoConvert_v1beta1_APIServer_To_v1alpha4_APIServer(in *v1beta1.APIServer, out *APIServer, s conversion.Scope) error { - if err := Convert_v1beta1_ControlPlaneComponent_To_v1alpha4_ControlPlaneComponent(&in.ControlPlaneComponent, &out.ControlPlaneComponent, s); err != nil { - return err - } - out.CertSANs = *(*[]string)(unsafe.Pointer(&in.CertSANs)) - out.TimeoutForControlPlane = (*v1.Duration)(unsafe.Pointer(in.TimeoutForControlPlane)) - return nil -} - -// Convert_v1beta1_APIServer_To_v1alpha4_APIServer is an autogenerated conversion function. -func Convert_v1beta1_APIServer_To_v1alpha4_APIServer(in *v1beta1.APIServer, out *APIServer, s conversion.Scope) error { - return autoConvert_v1beta1_APIServer_To_v1alpha4_APIServer(in, out, s) -} - -func autoConvert_v1alpha4_BootstrapToken_To_v1beta1_BootstrapToken(in *BootstrapToken, out *v1beta1.BootstrapToken, s conversion.Scope) error { - out.Token = (*v1beta1.BootstrapTokenString)(unsafe.Pointer(in.Token)) - out.Description = in.Description - out.TTL = (*v1.Duration)(unsafe.Pointer(in.TTL)) - out.Expires = (*v1.Time)(unsafe.Pointer(in.Expires)) - out.Usages = *(*[]string)(unsafe.Pointer(&in.Usages)) - out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) - return nil -} - -// Convert_v1alpha4_BootstrapToken_To_v1beta1_BootstrapToken is an autogenerated conversion function. -func Convert_v1alpha4_BootstrapToken_To_v1beta1_BootstrapToken(in *BootstrapToken, out *v1beta1.BootstrapToken, s conversion.Scope) error { - return autoConvert_v1alpha4_BootstrapToken_To_v1beta1_BootstrapToken(in, out, s) -} - -func autoConvert_v1beta1_BootstrapToken_To_v1alpha4_BootstrapToken(in *v1beta1.BootstrapToken, out *BootstrapToken, s conversion.Scope) error { - out.Token = (*BootstrapTokenString)(unsafe.Pointer(in.Token)) - out.Description = in.Description - out.TTL = (*v1.Duration)(unsafe.Pointer(in.TTL)) - out.Expires = (*v1.Time)(unsafe.Pointer(in.Expires)) - out.Usages = *(*[]string)(unsafe.Pointer(&in.Usages)) - out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) - return nil -} - -// Convert_v1beta1_BootstrapToken_To_v1alpha4_BootstrapToken is an autogenerated conversion function. -func Convert_v1beta1_BootstrapToken_To_v1alpha4_BootstrapToken(in *v1beta1.BootstrapToken, out *BootstrapToken, s conversion.Scope) error { - return autoConvert_v1beta1_BootstrapToken_To_v1alpha4_BootstrapToken(in, out, s) -} - -func autoConvert_v1alpha4_BootstrapTokenDiscovery_To_v1beta1_BootstrapTokenDiscovery(in *BootstrapTokenDiscovery, out *v1beta1.BootstrapTokenDiscovery, s conversion.Scope) error { - out.Token = in.Token - out.APIServerEndpoint = in.APIServerEndpoint - out.CACertHashes = *(*[]string)(unsafe.Pointer(&in.CACertHashes)) - out.UnsafeSkipCAVerification = in.UnsafeSkipCAVerification - return nil -} - -// Convert_v1alpha4_BootstrapTokenDiscovery_To_v1beta1_BootstrapTokenDiscovery is an autogenerated conversion function. -func Convert_v1alpha4_BootstrapTokenDiscovery_To_v1beta1_BootstrapTokenDiscovery(in *BootstrapTokenDiscovery, out *v1beta1.BootstrapTokenDiscovery, s conversion.Scope) error { - return autoConvert_v1alpha4_BootstrapTokenDiscovery_To_v1beta1_BootstrapTokenDiscovery(in, out, s) -} - -func autoConvert_v1beta1_BootstrapTokenDiscovery_To_v1alpha4_BootstrapTokenDiscovery(in *v1beta1.BootstrapTokenDiscovery, out *BootstrapTokenDiscovery, s conversion.Scope) error { - out.Token = in.Token - out.APIServerEndpoint = in.APIServerEndpoint - out.CACertHashes = *(*[]string)(unsafe.Pointer(&in.CACertHashes)) - out.UnsafeSkipCAVerification = in.UnsafeSkipCAVerification - return nil -} - -// Convert_v1beta1_BootstrapTokenDiscovery_To_v1alpha4_BootstrapTokenDiscovery is an autogenerated conversion function. -func Convert_v1beta1_BootstrapTokenDiscovery_To_v1alpha4_BootstrapTokenDiscovery(in *v1beta1.BootstrapTokenDiscovery, out *BootstrapTokenDiscovery, s conversion.Scope) error { - return autoConvert_v1beta1_BootstrapTokenDiscovery_To_v1alpha4_BootstrapTokenDiscovery(in, out, s) -} - -func autoConvert_v1alpha4_BootstrapTokenString_To_v1beta1_BootstrapTokenString(in *BootstrapTokenString, out *v1beta1.BootstrapTokenString, s conversion.Scope) error { - out.ID = in.ID - out.Secret = in.Secret - return nil -} - -// Convert_v1alpha4_BootstrapTokenString_To_v1beta1_BootstrapTokenString is an autogenerated conversion function. -func Convert_v1alpha4_BootstrapTokenString_To_v1beta1_BootstrapTokenString(in *BootstrapTokenString, out *v1beta1.BootstrapTokenString, s conversion.Scope) error { - return autoConvert_v1alpha4_BootstrapTokenString_To_v1beta1_BootstrapTokenString(in, out, s) -} - -func autoConvert_v1beta1_BootstrapTokenString_To_v1alpha4_BootstrapTokenString(in *v1beta1.BootstrapTokenString, out *BootstrapTokenString, s conversion.Scope) error { - out.ID = in.ID - out.Secret = in.Secret - return nil -} - -// Convert_v1beta1_BootstrapTokenString_To_v1alpha4_BootstrapTokenString is an autogenerated conversion function. -func Convert_v1beta1_BootstrapTokenString_To_v1alpha4_BootstrapTokenString(in *v1beta1.BootstrapTokenString, out *BootstrapTokenString, s conversion.Scope) error { - return autoConvert_v1beta1_BootstrapTokenString_To_v1alpha4_BootstrapTokenString(in, out, s) -} - -func autoConvert_v1alpha4_ClusterConfiguration_To_v1beta1_ClusterConfiguration(in *ClusterConfiguration, out *v1beta1.ClusterConfiguration, s conversion.Scope) error { - if err := Convert_v1alpha4_Etcd_To_v1beta1_Etcd(&in.Etcd, &out.Etcd, s); err != nil { - return err - } - if err := Convert_v1alpha4_Networking_To_v1beta1_Networking(&in.Networking, &out.Networking, s); err != nil { - return err - } - out.KubernetesVersion = in.KubernetesVersion - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if err := Convert_v1alpha4_APIServer_To_v1beta1_APIServer(&in.APIServer, &out.APIServer, s); err != nil { - return err - } - if err := Convert_v1alpha4_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(&in.ControllerManager, &out.ControllerManager, s); err != nil { - return err - } - if err := Convert_v1alpha4_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(&in.Scheduler, &out.Scheduler, s); err != nil { - return err - } - if err := Convert_v1alpha4_DNS_To_v1beta1_DNS(&in.DNS, &out.DNS, s); err != nil { - return err - } - out.CertificatesDir = in.CertificatesDir - out.ImageRepository = in.ImageRepository - out.FeatureGates = *(*map[string]bool)(unsafe.Pointer(&in.FeatureGates)) - out.ClusterName = in.ClusterName - return nil -} - -// Convert_v1alpha4_ClusterConfiguration_To_v1beta1_ClusterConfiguration is an autogenerated conversion function. -func Convert_v1alpha4_ClusterConfiguration_To_v1beta1_ClusterConfiguration(in *ClusterConfiguration, out *v1beta1.ClusterConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterConfiguration_To_v1beta1_ClusterConfiguration(in, out, s) -} - -func autoConvert_v1beta1_ClusterConfiguration_To_v1alpha4_ClusterConfiguration(in *v1beta1.ClusterConfiguration, out *ClusterConfiguration, s conversion.Scope) error { - if err := Convert_v1beta1_Etcd_To_v1alpha4_Etcd(&in.Etcd, &out.Etcd, s); err != nil { - return err - } - if err := Convert_v1beta1_Networking_To_v1alpha4_Networking(&in.Networking, &out.Networking, s); err != nil { - return err - } - out.KubernetesVersion = in.KubernetesVersion - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - if err := Convert_v1beta1_APIServer_To_v1alpha4_APIServer(&in.APIServer, &out.APIServer, s); err != nil { - return err - } - if err := Convert_v1beta1_ControlPlaneComponent_To_v1alpha4_ControlPlaneComponent(&in.ControllerManager, &out.ControllerManager, s); err != nil { - return err - } - if err := Convert_v1beta1_ControlPlaneComponent_To_v1alpha4_ControlPlaneComponent(&in.Scheduler, &out.Scheduler, s); err != nil { - return err - } - if err := Convert_v1beta1_DNS_To_v1alpha4_DNS(&in.DNS, &out.DNS, s); err != nil { - return err - } - out.CertificatesDir = in.CertificatesDir - out.ImageRepository = in.ImageRepository - out.FeatureGates = *(*map[string]bool)(unsafe.Pointer(&in.FeatureGates)) - out.ClusterName = in.ClusterName - return nil -} - -// Convert_v1beta1_ClusterConfiguration_To_v1alpha4_ClusterConfiguration is an autogenerated conversion function. -func Convert_v1beta1_ClusterConfiguration_To_v1alpha4_ClusterConfiguration(in *v1beta1.ClusterConfiguration, out *ClusterConfiguration, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterConfiguration_To_v1alpha4_ClusterConfiguration(in, out, s) -} - -func autoConvert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(in *ClusterStatus, out *v1beta1.ClusterStatus, s conversion.Scope) error { - out.APIEndpoints = *(*map[string]v1beta1.APIEndpoint)(unsafe.Pointer(&in.APIEndpoints)) - return nil -} - -// Convert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus is an autogenerated conversion function. -func Convert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(in *ClusterStatus, out *v1beta1.ClusterStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterStatus_To_v1beta1_ClusterStatus(in, out, s) -} - -func autoConvert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(in *v1beta1.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - out.APIEndpoints = *(*map[string]APIEndpoint)(unsafe.Pointer(&in.APIEndpoints)) - return nil -} - -// Convert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus is an autogenerated conversion function. -func Convert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(in *v1beta1.ClusterStatus, out *ClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterStatus_To_v1alpha4_ClusterStatus(in, out, s) -} - -func autoConvert_v1alpha4_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(in *ControlPlaneComponent, out *v1beta1.ControlPlaneComponent, s conversion.Scope) error { - out.ExtraArgs = *(*map[string]string)(unsafe.Pointer(&in.ExtraArgs)) - out.ExtraVolumes = *(*[]v1beta1.HostPathMount)(unsafe.Pointer(&in.ExtraVolumes)) - return nil -} - -// Convert_v1alpha4_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent is an autogenerated conversion function. -func Convert_v1alpha4_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(in *ControlPlaneComponent, out *v1beta1.ControlPlaneComponent, s conversion.Scope) error { - return autoConvert_v1alpha4_ControlPlaneComponent_To_v1beta1_ControlPlaneComponent(in, out, s) -} - -func autoConvert_v1beta1_ControlPlaneComponent_To_v1alpha4_ControlPlaneComponent(in *v1beta1.ControlPlaneComponent, out *ControlPlaneComponent, s conversion.Scope) error { - out.ExtraArgs = *(*map[string]string)(unsafe.Pointer(&in.ExtraArgs)) - out.ExtraVolumes = *(*[]HostPathMount)(unsafe.Pointer(&in.ExtraVolumes)) - return nil -} - -// Convert_v1beta1_ControlPlaneComponent_To_v1alpha4_ControlPlaneComponent is an autogenerated conversion function. -func Convert_v1beta1_ControlPlaneComponent_To_v1alpha4_ControlPlaneComponent(in *v1beta1.ControlPlaneComponent, out *ControlPlaneComponent, s conversion.Scope) error { - return autoConvert_v1beta1_ControlPlaneComponent_To_v1alpha4_ControlPlaneComponent(in, out, s) -} - -func autoConvert_v1alpha4_DNS_To_v1beta1_DNS(in *DNS, out *v1beta1.DNS, s conversion.Scope) error { - if err := Convert_v1alpha4_ImageMeta_To_v1beta1_ImageMeta(&in.ImageMeta, &out.ImageMeta, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_DNS_To_v1beta1_DNS is an autogenerated conversion function. -func Convert_v1alpha4_DNS_To_v1beta1_DNS(in *DNS, out *v1beta1.DNS, s conversion.Scope) error { - return autoConvert_v1alpha4_DNS_To_v1beta1_DNS(in, out, s) -} - -func autoConvert_v1beta1_DNS_To_v1alpha4_DNS(in *v1beta1.DNS, out *DNS, s conversion.Scope) error { - if err := Convert_v1beta1_ImageMeta_To_v1alpha4_ImageMeta(&in.ImageMeta, &out.ImageMeta, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_DNS_To_v1alpha4_DNS is an autogenerated conversion function. -func Convert_v1beta1_DNS_To_v1alpha4_DNS(in *v1beta1.DNS, out *DNS, s conversion.Scope) error { - return autoConvert_v1beta1_DNS_To_v1alpha4_DNS(in, out, s) -} - -func autoConvert_v1alpha4_Discovery_To_v1beta1_Discovery(in *Discovery, out *v1beta1.Discovery, s conversion.Scope) error { - out.BootstrapToken = (*v1beta1.BootstrapTokenDiscovery)(unsafe.Pointer(in.BootstrapToken)) - out.File = (*v1beta1.FileDiscovery)(unsafe.Pointer(in.File)) - out.TLSBootstrapToken = in.TLSBootstrapToken - out.Timeout = (*v1.Duration)(unsafe.Pointer(in.Timeout)) - return nil -} - -// Convert_v1alpha4_Discovery_To_v1beta1_Discovery is an autogenerated conversion function. -func Convert_v1alpha4_Discovery_To_v1beta1_Discovery(in *Discovery, out *v1beta1.Discovery, s conversion.Scope) error { - return autoConvert_v1alpha4_Discovery_To_v1beta1_Discovery(in, out, s) -} - -func autoConvert_v1beta1_Discovery_To_v1alpha4_Discovery(in *v1beta1.Discovery, out *Discovery, s conversion.Scope) error { - out.BootstrapToken = (*BootstrapTokenDiscovery)(unsafe.Pointer(in.BootstrapToken)) - out.File = (*FileDiscovery)(unsafe.Pointer(in.File)) - out.TLSBootstrapToken = in.TLSBootstrapToken - out.Timeout = (*v1.Duration)(unsafe.Pointer(in.Timeout)) - return nil -} - -// Convert_v1beta1_Discovery_To_v1alpha4_Discovery is an autogenerated conversion function. -func Convert_v1beta1_Discovery_To_v1alpha4_Discovery(in *v1beta1.Discovery, out *Discovery, s conversion.Scope) error { - return autoConvert_v1beta1_Discovery_To_v1alpha4_Discovery(in, out, s) -} - -func autoConvert_v1alpha4_DiskSetup_To_v1beta1_DiskSetup(in *DiskSetup, out *v1beta1.DiskSetup, s conversion.Scope) error { - out.Partitions = *(*[]v1beta1.Partition)(unsafe.Pointer(&in.Partitions)) - out.Filesystems = *(*[]v1beta1.Filesystem)(unsafe.Pointer(&in.Filesystems)) - return nil -} - -// Convert_v1alpha4_DiskSetup_To_v1beta1_DiskSetup is an autogenerated conversion function. -func Convert_v1alpha4_DiskSetup_To_v1beta1_DiskSetup(in *DiskSetup, out *v1beta1.DiskSetup, s conversion.Scope) error { - return autoConvert_v1alpha4_DiskSetup_To_v1beta1_DiskSetup(in, out, s) -} - -func autoConvert_v1beta1_DiskSetup_To_v1alpha4_DiskSetup(in *v1beta1.DiskSetup, out *DiskSetup, s conversion.Scope) error { - out.Partitions = *(*[]Partition)(unsafe.Pointer(&in.Partitions)) - out.Filesystems = *(*[]Filesystem)(unsafe.Pointer(&in.Filesystems)) - return nil -} - -// Convert_v1beta1_DiskSetup_To_v1alpha4_DiskSetup is an autogenerated conversion function. -func Convert_v1beta1_DiskSetup_To_v1alpha4_DiskSetup(in *v1beta1.DiskSetup, out *DiskSetup, s conversion.Scope) error { - return autoConvert_v1beta1_DiskSetup_To_v1alpha4_DiskSetup(in, out, s) -} - -func autoConvert_v1alpha4_Etcd_To_v1beta1_Etcd(in *Etcd, out *v1beta1.Etcd, s conversion.Scope) error { - out.Local = (*v1beta1.LocalEtcd)(unsafe.Pointer(in.Local)) - out.External = (*v1beta1.ExternalEtcd)(unsafe.Pointer(in.External)) - return nil -} - -// Convert_v1alpha4_Etcd_To_v1beta1_Etcd is an autogenerated conversion function. -func Convert_v1alpha4_Etcd_To_v1beta1_Etcd(in *Etcd, out *v1beta1.Etcd, s conversion.Scope) error { - return autoConvert_v1alpha4_Etcd_To_v1beta1_Etcd(in, out, s) -} - -func autoConvert_v1beta1_Etcd_To_v1alpha4_Etcd(in *v1beta1.Etcd, out *Etcd, s conversion.Scope) error { - out.Local = (*LocalEtcd)(unsafe.Pointer(in.Local)) - out.External = (*ExternalEtcd)(unsafe.Pointer(in.External)) - return nil -} - -// Convert_v1beta1_Etcd_To_v1alpha4_Etcd is an autogenerated conversion function. -func Convert_v1beta1_Etcd_To_v1alpha4_Etcd(in *v1beta1.Etcd, out *Etcd, s conversion.Scope) error { - return autoConvert_v1beta1_Etcd_To_v1alpha4_Etcd(in, out, s) -} - -func autoConvert_v1alpha4_ExternalEtcd_To_v1beta1_ExternalEtcd(in *ExternalEtcd, out *v1beta1.ExternalEtcd, s conversion.Scope) error { - out.Endpoints = *(*[]string)(unsafe.Pointer(&in.Endpoints)) - out.CAFile = in.CAFile - out.CertFile = in.CertFile - out.KeyFile = in.KeyFile - return nil -} - -// Convert_v1alpha4_ExternalEtcd_To_v1beta1_ExternalEtcd is an autogenerated conversion function. -func Convert_v1alpha4_ExternalEtcd_To_v1beta1_ExternalEtcd(in *ExternalEtcd, out *v1beta1.ExternalEtcd, s conversion.Scope) error { - return autoConvert_v1alpha4_ExternalEtcd_To_v1beta1_ExternalEtcd(in, out, s) -} - -func autoConvert_v1beta1_ExternalEtcd_To_v1alpha4_ExternalEtcd(in *v1beta1.ExternalEtcd, out *ExternalEtcd, s conversion.Scope) error { - out.Endpoints = *(*[]string)(unsafe.Pointer(&in.Endpoints)) - out.CAFile = in.CAFile - out.CertFile = in.CertFile - out.KeyFile = in.KeyFile - return nil -} - -// Convert_v1beta1_ExternalEtcd_To_v1alpha4_ExternalEtcd is an autogenerated conversion function. -func Convert_v1beta1_ExternalEtcd_To_v1alpha4_ExternalEtcd(in *v1beta1.ExternalEtcd, out *ExternalEtcd, s conversion.Scope) error { - return autoConvert_v1beta1_ExternalEtcd_To_v1alpha4_ExternalEtcd(in, out, s) -} - -func autoConvert_v1alpha4_File_To_v1beta1_File(in *File, out *v1beta1.File, s conversion.Scope) error { - out.Path = in.Path - out.Owner = in.Owner - out.Permissions = in.Permissions - out.Encoding = v1beta1.Encoding(in.Encoding) - out.Content = in.Content - out.ContentFrom = (*v1beta1.FileSource)(unsafe.Pointer(in.ContentFrom)) - return nil -} - -// Convert_v1alpha4_File_To_v1beta1_File is an autogenerated conversion function. -func Convert_v1alpha4_File_To_v1beta1_File(in *File, out *v1beta1.File, s conversion.Scope) error { - return autoConvert_v1alpha4_File_To_v1beta1_File(in, out, s) -} - -func autoConvert_v1beta1_File_To_v1alpha4_File(in *v1beta1.File, out *File, s conversion.Scope) error { - out.Path = in.Path - out.Owner = in.Owner - out.Permissions = in.Permissions - out.Encoding = Encoding(in.Encoding) - // WARNING: in.Append requires manual conversion: does not exist in peer-type - out.Content = in.Content - out.ContentFrom = (*FileSource)(unsafe.Pointer(in.ContentFrom)) - return nil -} - -func autoConvert_v1alpha4_FileDiscovery_To_v1beta1_FileDiscovery(in *FileDiscovery, out *v1beta1.FileDiscovery, s conversion.Scope) error { - out.KubeConfigPath = in.KubeConfigPath - return nil -} - -// Convert_v1alpha4_FileDiscovery_To_v1beta1_FileDiscovery is an autogenerated conversion function. -func Convert_v1alpha4_FileDiscovery_To_v1beta1_FileDiscovery(in *FileDiscovery, out *v1beta1.FileDiscovery, s conversion.Scope) error { - return autoConvert_v1alpha4_FileDiscovery_To_v1beta1_FileDiscovery(in, out, s) -} - -func autoConvert_v1beta1_FileDiscovery_To_v1alpha4_FileDiscovery(in *v1beta1.FileDiscovery, out *FileDiscovery, s conversion.Scope) error { - out.KubeConfigPath = in.KubeConfigPath - return nil -} - -// Convert_v1beta1_FileDiscovery_To_v1alpha4_FileDiscovery is an autogenerated conversion function. -func Convert_v1beta1_FileDiscovery_To_v1alpha4_FileDiscovery(in *v1beta1.FileDiscovery, out *FileDiscovery, s conversion.Scope) error { - return autoConvert_v1beta1_FileDiscovery_To_v1alpha4_FileDiscovery(in, out, s) -} - -func autoConvert_v1alpha4_FileSource_To_v1beta1_FileSource(in *FileSource, out *v1beta1.FileSource, s conversion.Scope) error { - if err := Convert_v1alpha4_SecretFileSource_To_v1beta1_SecretFileSource(&in.Secret, &out.Secret, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_FileSource_To_v1beta1_FileSource is an autogenerated conversion function. -func Convert_v1alpha4_FileSource_To_v1beta1_FileSource(in *FileSource, out *v1beta1.FileSource, s conversion.Scope) error { - return autoConvert_v1alpha4_FileSource_To_v1beta1_FileSource(in, out, s) -} - -func autoConvert_v1beta1_FileSource_To_v1alpha4_FileSource(in *v1beta1.FileSource, out *FileSource, s conversion.Scope) error { - if err := Convert_v1beta1_SecretFileSource_To_v1alpha4_SecretFileSource(&in.Secret, &out.Secret, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_FileSource_To_v1alpha4_FileSource is an autogenerated conversion function. -func Convert_v1beta1_FileSource_To_v1alpha4_FileSource(in *v1beta1.FileSource, out *FileSource, s conversion.Scope) error { - return autoConvert_v1beta1_FileSource_To_v1alpha4_FileSource(in, out, s) -} - -func autoConvert_v1alpha4_Filesystem_To_v1beta1_Filesystem(in *Filesystem, out *v1beta1.Filesystem, s conversion.Scope) error { - out.Device = in.Device - out.Filesystem = in.Filesystem - out.Label = in.Label - out.Partition = (*string)(unsafe.Pointer(in.Partition)) - out.Overwrite = (*bool)(unsafe.Pointer(in.Overwrite)) - out.ReplaceFS = (*string)(unsafe.Pointer(in.ReplaceFS)) - out.ExtraOpts = *(*[]string)(unsafe.Pointer(&in.ExtraOpts)) - return nil -} - -// Convert_v1alpha4_Filesystem_To_v1beta1_Filesystem is an autogenerated conversion function. -func Convert_v1alpha4_Filesystem_To_v1beta1_Filesystem(in *Filesystem, out *v1beta1.Filesystem, s conversion.Scope) error { - return autoConvert_v1alpha4_Filesystem_To_v1beta1_Filesystem(in, out, s) -} - -func autoConvert_v1beta1_Filesystem_To_v1alpha4_Filesystem(in *v1beta1.Filesystem, out *Filesystem, s conversion.Scope) error { - out.Device = in.Device - out.Filesystem = in.Filesystem - out.Label = in.Label - out.Partition = (*string)(unsafe.Pointer(in.Partition)) - out.Overwrite = (*bool)(unsafe.Pointer(in.Overwrite)) - out.ReplaceFS = (*string)(unsafe.Pointer(in.ReplaceFS)) - out.ExtraOpts = *(*[]string)(unsafe.Pointer(&in.ExtraOpts)) - return nil -} - -// Convert_v1beta1_Filesystem_To_v1alpha4_Filesystem is an autogenerated conversion function. -func Convert_v1beta1_Filesystem_To_v1alpha4_Filesystem(in *v1beta1.Filesystem, out *Filesystem, s conversion.Scope) error { - return autoConvert_v1beta1_Filesystem_To_v1alpha4_Filesystem(in, out, s) -} - -func autoConvert_v1alpha4_HostPathMount_To_v1beta1_HostPathMount(in *HostPathMount, out *v1beta1.HostPathMount, s conversion.Scope) error { - out.Name = in.Name - out.HostPath = in.HostPath - out.MountPath = in.MountPath - out.ReadOnly = in.ReadOnly - out.PathType = corev1.HostPathType(in.PathType) - return nil -} - -// Convert_v1alpha4_HostPathMount_To_v1beta1_HostPathMount is an autogenerated conversion function. -func Convert_v1alpha4_HostPathMount_To_v1beta1_HostPathMount(in *HostPathMount, out *v1beta1.HostPathMount, s conversion.Scope) error { - return autoConvert_v1alpha4_HostPathMount_To_v1beta1_HostPathMount(in, out, s) -} - -func autoConvert_v1beta1_HostPathMount_To_v1alpha4_HostPathMount(in *v1beta1.HostPathMount, out *HostPathMount, s conversion.Scope) error { - out.Name = in.Name - out.HostPath = in.HostPath - out.MountPath = in.MountPath - out.ReadOnly = in.ReadOnly - out.PathType = corev1.HostPathType(in.PathType) - return nil -} - -// Convert_v1beta1_HostPathMount_To_v1alpha4_HostPathMount is an autogenerated conversion function. -func Convert_v1beta1_HostPathMount_To_v1alpha4_HostPathMount(in *v1beta1.HostPathMount, out *HostPathMount, s conversion.Scope) error { - return autoConvert_v1beta1_HostPathMount_To_v1alpha4_HostPathMount(in, out, s) -} - -func autoConvert_v1alpha4_ImageMeta_To_v1beta1_ImageMeta(in *ImageMeta, out *v1beta1.ImageMeta, s conversion.Scope) error { - out.ImageRepository = in.ImageRepository - out.ImageTag = in.ImageTag - return nil -} - -// Convert_v1alpha4_ImageMeta_To_v1beta1_ImageMeta is an autogenerated conversion function. -func Convert_v1alpha4_ImageMeta_To_v1beta1_ImageMeta(in *ImageMeta, out *v1beta1.ImageMeta, s conversion.Scope) error { - return autoConvert_v1alpha4_ImageMeta_To_v1beta1_ImageMeta(in, out, s) -} - -func autoConvert_v1beta1_ImageMeta_To_v1alpha4_ImageMeta(in *v1beta1.ImageMeta, out *ImageMeta, s conversion.Scope) error { - out.ImageRepository = in.ImageRepository - out.ImageTag = in.ImageTag - return nil -} - -// Convert_v1beta1_ImageMeta_To_v1alpha4_ImageMeta is an autogenerated conversion function. -func Convert_v1beta1_ImageMeta_To_v1alpha4_ImageMeta(in *v1beta1.ImageMeta, out *ImageMeta, s conversion.Scope) error { - return autoConvert_v1beta1_ImageMeta_To_v1alpha4_ImageMeta(in, out, s) -} - -func autoConvert_v1alpha4_InitConfiguration_To_v1beta1_InitConfiguration(in *InitConfiguration, out *v1beta1.InitConfiguration, s conversion.Scope) error { - out.BootstrapTokens = *(*[]v1beta1.BootstrapToken)(unsafe.Pointer(&in.BootstrapTokens)) - if err := Convert_v1alpha4_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(&in.NodeRegistration, &out.NodeRegistration, s); err != nil { - return err - } - if err := Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(&in.LocalAPIEndpoint, &out.LocalAPIEndpoint, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_InitConfiguration_To_v1beta1_InitConfiguration is an autogenerated conversion function. -func Convert_v1alpha4_InitConfiguration_To_v1beta1_InitConfiguration(in *InitConfiguration, out *v1beta1.InitConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha4_InitConfiguration_To_v1beta1_InitConfiguration(in, out, s) -} - -func autoConvert_v1beta1_InitConfiguration_To_v1alpha4_InitConfiguration(in *v1beta1.InitConfiguration, out *InitConfiguration, s conversion.Scope) error { - out.BootstrapTokens = *(*[]BootstrapToken)(unsafe.Pointer(&in.BootstrapTokens)) - if err := Convert_v1beta1_NodeRegistrationOptions_To_v1alpha4_NodeRegistrationOptions(&in.NodeRegistration, &out.NodeRegistration, s); err != nil { - return err - } - if err := Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(&in.LocalAPIEndpoint, &out.LocalAPIEndpoint, s); err != nil { - return err - } - // WARNING: in.SkipPhases requires manual conversion: does not exist in peer-type - // WARNING: in.Patches requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_JoinConfiguration_To_v1beta1_JoinConfiguration(in *JoinConfiguration, out *v1beta1.JoinConfiguration, s conversion.Scope) error { - if err := Convert_v1alpha4_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(&in.NodeRegistration, &out.NodeRegistration, s); err != nil { - return err - } - out.CACertPath = in.CACertPath - if err := Convert_v1alpha4_Discovery_To_v1beta1_Discovery(&in.Discovery, &out.Discovery, s); err != nil { - return err - } - out.ControlPlane = (*v1beta1.JoinControlPlane)(unsafe.Pointer(in.ControlPlane)) - return nil -} - -// Convert_v1alpha4_JoinConfiguration_To_v1beta1_JoinConfiguration is an autogenerated conversion function. -func Convert_v1alpha4_JoinConfiguration_To_v1beta1_JoinConfiguration(in *JoinConfiguration, out *v1beta1.JoinConfiguration, s conversion.Scope) error { - return autoConvert_v1alpha4_JoinConfiguration_To_v1beta1_JoinConfiguration(in, out, s) -} - -func autoConvert_v1beta1_JoinConfiguration_To_v1alpha4_JoinConfiguration(in *v1beta1.JoinConfiguration, out *JoinConfiguration, s conversion.Scope) error { - if err := Convert_v1beta1_NodeRegistrationOptions_To_v1alpha4_NodeRegistrationOptions(&in.NodeRegistration, &out.NodeRegistration, s); err != nil { - return err - } - out.CACertPath = in.CACertPath - if err := Convert_v1beta1_Discovery_To_v1alpha4_Discovery(&in.Discovery, &out.Discovery, s); err != nil { - return err - } - out.ControlPlane = (*JoinControlPlane)(unsafe.Pointer(in.ControlPlane)) - // WARNING: in.SkipPhases requires manual conversion: does not exist in peer-type - // WARNING: in.Patches requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_JoinControlPlane_To_v1beta1_JoinControlPlane(in *JoinControlPlane, out *v1beta1.JoinControlPlane, s conversion.Scope) error { - if err := Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(&in.LocalAPIEndpoint, &out.LocalAPIEndpoint, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_JoinControlPlane_To_v1beta1_JoinControlPlane is an autogenerated conversion function. -func Convert_v1alpha4_JoinControlPlane_To_v1beta1_JoinControlPlane(in *JoinControlPlane, out *v1beta1.JoinControlPlane, s conversion.Scope) error { - return autoConvert_v1alpha4_JoinControlPlane_To_v1beta1_JoinControlPlane(in, out, s) -} - -func autoConvert_v1beta1_JoinControlPlane_To_v1alpha4_JoinControlPlane(in *v1beta1.JoinControlPlane, out *JoinControlPlane, s conversion.Scope) error { - if err := Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(&in.LocalAPIEndpoint, &out.LocalAPIEndpoint, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_JoinControlPlane_To_v1alpha4_JoinControlPlane is an autogenerated conversion function. -func Convert_v1beta1_JoinControlPlane_To_v1alpha4_JoinControlPlane(in *v1beta1.JoinControlPlane, out *JoinControlPlane, s conversion.Scope) error { - return autoConvert_v1beta1_JoinControlPlane_To_v1alpha4_JoinControlPlane(in, out, s) -} - -func autoConvert_v1alpha4_KubeadmConfig_To_v1beta1_KubeadmConfig(in *KubeadmConfig, out *v1beta1.KubeadmConfig, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_KubeadmConfigSpec_To_v1beta1_KubeadmConfigSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_KubeadmConfigStatus_To_v1beta1_KubeadmConfigStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_KubeadmConfig_To_v1beta1_KubeadmConfig is an autogenerated conversion function. -func Convert_v1alpha4_KubeadmConfig_To_v1beta1_KubeadmConfig(in *KubeadmConfig, out *v1beta1.KubeadmConfig, s conversion.Scope) error { - return autoConvert_v1alpha4_KubeadmConfig_To_v1beta1_KubeadmConfig(in, out, s) -} - -func autoConvert_v1beta1_KubeadmConfig_To_v1alpha4_KubeadmConfig(in *v1beta1.KubeadmConfig, out *KubeadmConfig, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_KubeadmConfigSpec_To_v1alpha4_KubeadmConfigSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_KubeadmConfigStatus_To_v1alpha4_KubeadmConfigStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_KubeadmConfig_To_v1alpha4_KubeadmConfig is an autogenerated conversion function. -func Convert_v1beta1_KubeadmConfig_To_v1alpha4_KubeadmConfig(in *v1beta1.KubeadmConfig, out *KubeadmConfig, s conversion.Scope) error { - return autoConvert_v1beta1_KubeadmConfig_To_v1alpha4_KubeadmConfig(in, out, s) -} - -func autoConvert_v1alpha4_KubeadmConfigList_To_v1beta1_KubeadmConfigList(in *KubeadmConfigList, out *v1beta1.KubeadmConfigList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.KubeadmConfig, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_KubeadmConfig_To_v1beta1_KubeadmConfig(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_KubeadmConfigList_To_v1beta1_KubeadmConfigList is an autogenerated conversion function. -func Convert_v1alpha4_KubeadmConfigList_To_v1beta1_KubeadmConfigList(in *KubeadmConfigList, out *v1beta1.KubeadmConfigList, s conversion.Scope) error { - return autoConvert_v1alpha4_KubeadmConfigList_To_v1beta1_KubeadmConfigList(in, out, s) -} - -func autoConvert_v1beta1_KubeadmConfigList_To_v1alpha4_KubeadmConfigList(in *v1beta1.KubeadmConfigList, out *KubeadmConfigList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KubeadmConfig, len(*in)) - for i := range *in { - if err := Convert_v1beta1_KubeadmConfig_To_v1alpha4_KubeadmConfig(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_KubeadmConfigList_To_v1alpha4_KubeadmConfigList is an autogenerated conversion function. -func Convert_v1beta1_KubeadmConfigList_To_v1alpha4_KubeadmConfigList(in *v1beta1.KubeadmConfigList, out *KubeadmConfigList, s conversion.Scope) error { - return autoConvert_v1beta1_KubeadmConfigList_To_v1alpha4_KubeadmConfigList(in, out, s) -} - -func autoConvert_v1alpha4_KubeadmConfigSpec_To_v1beta1_KubeadmConfigSpec(in *KubeadmConfigSpec, out *v1beta1.KubeadmConfigSpec, s conversion.Scope) error { - out.ClusterConfiguration = (*v1beta1.ClusterConfiguration)(unsafe.Pointer(in.ClusterConfiguration)) - if in.InitConfiguration != nil { - in, out := &in.InitConfiguration, &out.InitConfiguration - *out = new(v1beta1.InitConfiguration) - if err := Convert_v1alpha4_InitConfiguration_To_v1beta1_InitConfiguration(*in, *out, s); err != nil { - return err - } - } else { - out.InitConfiguration = nil - } - if in.JoinConfiguration != nil { - in, out := &in.JoinConfiguration, &out.JoinConfiguration - *out = new(v1beta1.JoinConfiguration) - if err := Convert_v1alpha4_JoinConfiguration_To_v1beta1_JoinConfiguration(*in, *out, s); err != nil { - return err - } - } else { - out.JoinConfiguration = nil - } - if in.Files != nil { - in, out := &in.Files, &out.Files - *out = make([]v1beta1.File, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_File_To_v1beta1_File(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Files = nil - } - out.DiskSetup = (*v1beta1.DiskSetup)(unsafe.Pointer(in.DiskSetup)) - out.Mounts = *(*[]v1beta1.MountPoints)(unsafe.Pointer(&in.Mounts)) - out.PreKubeadmCommands = *(*[]string)(unsafe.Pointer(&in.PreKubeadmCommands)) - out.PostKubeadmCommands = *(*[]string)(unsafe.Pointer(&in.PostKubeadmCommands)) - if in.Users != nil { - in, out := &in.Users, &out.Users - *out = make([]v1beta1.User, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_User_To_v1beta1_User(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Users = nil - } - out.NTP = (*v1beta1.NTP)(unsafe.Pointer(in.NTP)) - out.Format = v1beta1.Format(in.Format) - out.Verbosity = (*int32)(unsafe.Pointer(in.Verbosity)) - out.UseExperimentalRetryJoin = in.UseExperimentalRetryJoin - return nil -} - -// Convert_v1alpha4_KubeadmConfigSpec_To_v1beta1_KubeadmConfigSpec is an autogenerated conversion function. -func Convert_v1alpha4_KubeadmConfigSpec_To_v1beta1_KubeadmConfigSpec(in *KubeadmConfigSpec, out *v1beta1.KubeadmConfigSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_KubeadmConfigSpec_To_v1beta1_KubeadmConfigSpec(in, out, s) -} - -func autoConvert_v1beta1_KubeadmConfigSpec_To_v1alpha4_KubeadmConfigSpec(in *v1beta1.KubeadmConfigSpec, out *KubeadmConfigSpec, s conversion.Scope) error { - out.ClusterConfiguration = (*ClusterConfiguration)(unsafe.Pointer(in.ClusterConfiguration)) - if in.InitConfiguration != nil { - in, out := &in.InitConfiguration, &out.InitConfiguration - *out = new(InitConfiguration) - if err := Convert_v1beta1_InitConfiguration_To_v1alpha4_InitConfiguration(*in, *out, s); err != nil { - return err - } - } else { - out.InitConfiguration = nil - } - if in.JoinConfiguration != nil { - in, out := &in.JoinConfiguration, &out.JoinConfiguration - *out = new(JoinConfiguration) - if err := Convert_v1beta1_JoinConfiguration_To_v1alpha4_JoinConfiguration(*in, *out, s); err != nil { - return err - } - } else { - out.JoinConfiguration = nil - } - if in.Files != nil { - in, out := &in.Files, &out.Files - *out = make([]File, len(*in)) - for i := range *in { - if err := Convert_v1beta1_File_To_v1alpha4_File(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Files = nil - } - out.DiskSetup = (*DiskSetup)(unsafe.Pointer(in.DiskSetup)) - out.Mounts = *(*[]MountPoints)(unsafe.Pointer(&in.Mounts)) - out.PreKubeadmCommands = *(*[]string)(unsafe.Pointer(&in.PreKubeadmCommands)) - out.PostKubeadmCommands = *(*[]string)(unsafe.Pointer(&in.PostKubeadmCommands)) - if in.Users != nil { - in, out := &in.Users, &out.Users - *out = make([]User, len(*in)) - for i := range *in { - if err := Convert_v1beta1_User_To_v1alpha4_User(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Users = nil - } - out.NTP = (*NTP)(unsafe.Pointer(in.NTP)) - out.Format = Format(in.Format) - out.Verbosity = (*int32)(unsafe.Pointer(in.Verbosity)) - out.UseExperimentalRetryJoin = in.UseExperimentalRetryJoin - // WARNING: in.Ignition requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_KubeadmConfigStatus_To_v1beta1_KubeadmConfigStatus(in *KubeadmConfigStatus, out *v1beta1.KubeadmConfigStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.DataSecretName = (*string)(unsafe.Pointer(in.DataSecretName)) - out.FailureReason = in.FailureReason - out.FailureMessage = in.FailureMessage - out.ObservedGeneration = in.ObservedGeneration - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1beta1.Conditions, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1alpha4_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - return nil -} - -// Convert_v1alpha4_KubeadmConfigStatus_To_v1beta1_KubeadmConfigStatus is an autogenerated conversion function. -func Convert_v1alpha4_KubeadmConfigStatus_To_v1beta1_KubeadmConfigStatus(in *KubeadmConfigStatus, out *v1beta1.KubeadmConfigStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_KubeadmConfigStatus_To_v1beta1_KubeadmConfigStatus(in, out, s) -} - -func autoConvert_v1beta1_KubeadmConfigStatus_To_v1alpha4_KubeadmConfigStatus(in *v1beta1.KubeadmConfigStatus, out *KubeadmConfigStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.DataSecretName = (*string)(unsafe.Pointer(in.DataSecretName)) - out.FailureReason = in.FailureReason - out.FailureMessage = in.FailureMessage - out.ObservedGeneration = in.ObservedGeneration - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1alpha4.Conditions, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1beta1_Condition_To_v1alpha4_Condition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - return nil -} - -// Convert_v1beta1_KubeadmConfigStatus_To_v1alpha4_KubeadmConfigStatus is an autogenerated conversion function. -func Convert_v1beta1_KubeadmConfigStatus_To_v1alpha4_KubeadmConfigStatus(in *v1beta1.KubeadmConfigStatus, out *KubeadmConfigStatus, s conversion.Scope) error { - return autoConvert_v1beta1_KubeadmConfigStatus_To_v1alpha4_KubeadmConfigStatus(in, out, s) -} - -func autoConvert_v1alpha4_KubeadmConfigTemplate_To_v1beta1_KubeadmConfigTemplate(in *KubeadmConfigTemplate, out *v1beta1.KubeadmConfigTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_KubeadmConfigTemplateSpec_To_v1beta1_KubeadmConfigTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_KubeadmConfigTemplate_To_v1beta1_KubeadmConfigTemplate is an autogenerated conversion function. -func Convert_v1alpha4_KubeadmConfigTemplate_To_v1beta1_KubeadmConfigTemplate(in *KubeadmConfigTemplate, out *v1beta1.KubeadmConfigTemplate, s conversion.Scope) error { - return autoConvert_v1alpha4_KubeadmConfigTemplate_To_v1beta1_KubeadmConfigTemplate(in, out, s) -} - -func autoConvert_v1beta1_KubeadmConfigTemplate_To_v1alpha4_KubeadmConfigTemplate(in *v1beta1.KubeadmConfigTemplate, out *KubeadmConfigTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_KubeadmConfigTemplateSpec_To_v1alpha4_KubeadmConfigTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_KubeadmConfigTemplate_To_v1alpha4_KubeadmConfigTemplate is an autogenerated conversion function. -func Convert_v1beta1_KubeadmConfigTemplate_To_v1alpha4_KubeadmConfigTemplate(in *v1beta1.KubeadmConfigTemplate, out *KubeadmConfigTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_KubeadmConfigTemplate_To_v1alpha4_KubeadmConfigTemplate(in, out, s) -} - -func autoConvert_v1alpha4_KubeadmConfigTemplateList_To_v1beta1_KubeadmConfigTemplateList(in *KubeadmConfigTemplateList, out *v1beta1.KubeadmConfigTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.KubeadmConfigTemplate, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_KubeadmConfigTemplate_To_v1beta1_KubeadmConfigTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_KubeadmConfigTemplateList_To_v1beta1_KubeadmConfigTemplateList is an autogenerated conversion function. -func Convert_v1alpha4_KubeadmConfigTemplateList_To_v1beta1_KubeadmConfigTemplateList(in *KubeadmConfigTemplateList, out *v1beta1.KubeadmConfigTemplateList, s conversion.Scope) error { - return autoConvert_v1alpha4_KubeadmConfigTemplateList_To_v1beta1_KubeadmConfigTemplateList(in, out, s) -} - -func autoConvert_v1beta1_KubeadmConfigTemplateList_To_v1alpha4_KubeadmConfigTemplateList(in *v1beta1.KubeadmConfigTemplateList, out *KubeadmConfigTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KubeadmConfigTemplate, len(*in)) - for i := range *in { - if err := Convert_v1beta1_KubeadmConfigTemplate_To_v1alpha4_KubeadmConfigTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_KubeadmConfigTemplateList_To_v1alpha4_KubeadmConfigTemplateList is an autogenerated conversion function. -func Convert_v1beta1_KubeadmConfigTemplateList_To_v1alpha4_KubeadmConfigTemplateList(in *v1beta1.KubeadmConfigTemplateList, out *KubeadmConfigTemplateList, s conversion.Scope) error { - return autoConvert_v1beta1_KubeadmConfigTemplateList_To_v1alpha4_KubeadmConfigTemplateList(in, out, s) -} - -func autoConvert_v1alpha4_KubeadmConfigTemplateResource_To_v1beta1_KubeadmConfigTemplateResource(in *KubeadmConfigTemplateResource, out *v1beta1.KubeadmConfigTemplateResource, s conversion.Scope) error { - if err := Convert_v1alpha4_KubeadmConfigSpec_To_v1beta1_KubeadmConfigSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_KubeadmConfigTemplateResource_To_v1beta1_KubeadmConfigTemplateResource is an autogenerated conversion function. -func Convert_v1alpha4_KubeadmConfigTemplateResource_To_v1beta1_KubeadmConfigTemplateResource(in *KubeadmConfigTemplateResource, out *v1beta1.KubeadmConfigTemplateResource, s conversion.Scope) error { - return autoConvert_v1alpha4_KubeadmConfigTemplateResource_To_v1beta1_KubeadmConfigTemplateResource(in, out, s) -} - -func autoConvert_v1beta1_KubeadmConfigTemplateResource_To_v1alpha4_KubeadmConfigTemplateResource(in *v1beta1.KubeadmConfigTemplateResource, out *KubeadmConfigTemplateResource, s conversion.Scope) error { - // WARNING: in.ObjectMeta requires manual conversion: does not exist in peer-type - if err := Convert_v1beta1_KubeadmConfigSpec_To_v1alpha4_KubeadmConfigSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha4_KubeadmConfigTemplateSpec_To_v1beta1_KubeadmConfigTemplateSpec(in *KubeadmConfigTemplateSpec, out *v1beta1.KubeadmConfigTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_KubeadmConfigTemplateResource_To_v1beta1_KubeadmConfigTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_KubeadmConfigTemplateSpec_To_v1beta1_KubeadmConfigTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha4_KubeadmConfigTemplateSpec_To_v1beta1_KubeadmConfigTemplateSpec(in *KubeadmConfigTemplateSpec, out *v1beta1.KubeadmConfigTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_KubeadmConfigTemplateSpec_To_v1beta1_KubeadmConfigTemplateSpec(in, out, s) -} - -func autoConvert_v1beta1_KubeadmConfigTemplateSpec_To_v1alpha4_KubeadmConfigTemplateSpec(in *v1beta1.KubeadmConfigTemplateSpec, out *KubeadmConfigTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta1_KubeadmConfigTemplateResource_To_v1alpha4_KubeadmConfigTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_KubeadmConfigTemplateSpec_To_v1alpha4_KubeadmConfigTemplateSpec is an autogenerated conversion function. -func Convert_v1beta1_KubeadmConfigTemplateSpec_To_v1alpha4_KubeadmConfigTemplateSpec(in *v1beta1.KubeadmConfigTemplateSpec, out *KubeadmConfigTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta1_KubeadmConfigTemplateSpec_To_v1alpha4_KubeadmConfigTemplateSpec(in, out, s) -} - -func autoConvert_v1alpha4_LocalEtcd_To_v1beta1_LocalEtcd(in *LocalEtcd, out *v1beta1.LocalEtcd, s conversion.Scope) error { - if err := Convert_v1alpha4_ImageMeta_To_v1beta1_ImageMeta(&in.ImageMeta, &out.ImageMeta, s); err != nil { - return err - } - out.DataDir = in.DataDir - out.ExtraArgs = *(*map[string]string)(unsafe.Pointer(&in.ExtraArgs)) - out.ServerCertSANs = *(*[]string)(unsafe.Pointer(&in.ServerCertSANs)) - out.PeerCertSANs = *(*[]string)(unsafe.Pointer(&in.PeerCertSANs)) - return nil -} - -// Convert_v1alpha4_LocalEtcd_To_v1beta1_LocalEtcd is an autogenerated conversion function. -func Convert_v1alpha4_LocalEtcd_To_v1beta1_LocalEtcd(in *LocalEtcd, out *v1beta1.LocalEtcd, s conversion.Scope) error { - return autoConvert_v1alpha4_LocalEtcd_To_v1beta1_LocalEtcd(in, out, s) -} - -func autoConvert_v1beta1_LocalEtcd_To_v1alpha4_LocalEtcd(in *v1beta1.LocalEtcd, out *LocalEtcd, s conversion.Scope) error { - if err := Convert_v1beta1_ImageMeta_To_v1alpha4_ImageMeta(&in.ImageMeta, &out.ImageMeta, s); err != nil { - return err - } - out.DataDir = in.DataDir - out.ExtraArgs = *(*map[string]string)(unsafe.Pointer(&in.ExtraArgs)) - out.ServerCertSANs = *(*[]string)(unsafe.Pointer(&in.ServerCertSANs)) - out.PeerCertSANs = *(*[]string)(unsafe.Pointer(&in.PeerCertSANs)) - return nil -} - -// Convert_v1beta1_LocalEtcd_To_v1alpha4_LocalEtcd is an autogenerated conversion function. -func Convert_v1beta1_LocalEtcd_To_v1alpha4_LocalEtcd(in *v1beta1.LocalEtcd, out *LocalEtcd, s conversion.Scope) error { - return autoConvert_v1beta1_LocalEtcd_To_v1alpha4_LocalEtcd(in, out, s) -} - -func autoConvert_v1alpha4_NTP_To_v1beta1_NTP(in *NTP, out *v1beta1.NTP, s conversion.Scope) error { - out.Servers = *(*[]string)(unsafe.Pointer(&in.Servers)) - out.Enabled = (*bool)(unsafe.Pointer(in.Enabled)) - return nil -} - -// Convert_v1alpha4_NTP_To_v1beta1_NTP is an autogenerated conversion function. -func Convert_v1alpha4_NTP_To_v1beta1_NTP(in *NTP, out *v1beta1.NTP, s conversion.Scope) error { - return autoConvert_v1alpha4_NTP_To_v1beta1_NTP(in, out, s) -} - -func autoConvert_v1beta1_NTP_To_v1alpha4_NTP(in *v1beta1.NTP, out *NTP, s conversion.Scope) error { - out.Servers = *(*[]string)(unsafe.Pointer(&in.Servers)) - out.Enabled = (*bool)(unsafe.Pointer(in.Enabled)) - return nil -} - -// Convert_v1beta1_NTP_To_v1alpha4_NTP is an autogenerated conversion function. -func Convert_v1beta1_NTP_To_v1alpha4_NTP(in *v1beta1.NTP, out *NTP, s conversion.Scope) error { - return autoConvert_v1beta1_NTP_To_v1alpha4_NTP(in, out, s) -} - -func autoConvert_v1alpha4_Networking_To_v1beta1_Networking(in *Networking, out *v1beta1.Networking, s conversion.Scope) error { - out.ServiceSubnet = in.ServiceSubnet - out.PodSubnet = in.PodSubnet - out.DNSDomain = in.DNSDomain - return nil -} - -// Convert_v1alpha4_Networking_To_v1beta1_Networking is an autogenerated conversion function. -func Convert_v1alpha4_Networking_To_v1beta1_Networking(in *Networking, out *v1beta1.Networking, s conversion.Scope) error { - return autoConvert_v1alpha4_Networking_To_v1beta1_Networking(in, out, s) -} - -func autoConvert_v1beta1_Networking_To_v1alpha4_Networking(in *v1beta1.Networking, out *Networking, s conversion.Scope) error { - out.ServiceSubnet = in.ServiceSubnet - out.PodSubnet = in.PodSubnet - out.DNSDomain = in.DNSDomain - return nil -} - -// Convert_v1beta1_Networking_To_v1alpha4_Networking is an autogenerated conversion function. -func Convert_v1beta1_Networking_To_v1alpha4_Networking(in *v1beta1.Networking, out *Networking, s conversion.Scope) error { - return autoConvert_v1beta1_Networking_To_v1alpha4_Networking(in, out, s) -} - -func autoConvert_v1alpha4_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(in *NodeRegistrationOptions, out *v1beta1.NodeRegistrationOptions, s conversion.Scope) error { - out.Name = in.Name - out.CRISocket = in.CRISocket - out.Taints = *(*[]corev1.Taint)(unsafe.Pointer(&in.Taints)) - out.KubeletExtraArgs = *(*map[string]string)(unsafe.Pointer(&in.KubeletExtraArgs)) - out.IgnorePreflightErrors = *(*[]string)(unsafe.Pointer(&in.IgnorePreflightErrors)) - return nil -} - -// Convert_v1alpha4_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions is an autogenerated conversion function. -func Convert_v1alpha4_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(in *NodeRegistrationOptions, out *v1beta1.NodeRegistrationOptions, s conversion.Scope) error { - return autoConvert_v1alpha4_NodeRegistrationOptions_To_v1beta1_NodeRegistrationOptions(in, out, s) -} - -func autoConvert_v1beta1_NodeRegistrationOptions_To_v1alpha4_NodeRegistrationOptions(in *v1beta1.NodeRegistrationOptions, out *NodeRegistrationOptions, s conversion.Scope) error { - out.Name = in.Name - out.CRISocket = in.CRISocket - out.Taints = *(*[]corev1.Taint)(unsafe.Pointer(&in.Taints)) - out.KubeletExtraArgs = *(*map[string]string)(unsafe.Pointer(&in.KubeletExtraArgs)) - out.IgnorePreflightErrors = *(*[]string)(unsafe.Pointer(&in.IgnorePreflightErrors)) - // WARNING: in.ImagePullPolicy requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_Partition_To_v1beta1_Partition(in *Partition, out *v1beta1.Partition, s conversion.Scope) error { - out.Device = in.Device - out.Layout = in.Layout - out.Overwrite = (*bool)(unsafe.Pointer(in.Overwrite)) - out.TableType = (*string)(unsafe.Pointer(in.TableType)) - return nil -} - -// Convert_v1alpha4_Partition_To_v1beta1_Partition is an autogenerated conversion function. -func Convert_v1alpha4_Partition_To_v1beta1_Partition(in *Partition, out *v1beta1.Partition, s conversion.Scope) error { - return autoConvert_v1alpha4_Partition_To_v1beta1_Partition(in, out, s) -} - -func autoConvert_v1beta1_Partition_To_v1alpha4_Partition(in *v1beta1.Partition, out *Partition, s conversion.Scope) error { - out.Device = in.Device - out.Layout = in.Layout - out.Overwrite = (*bool)(unsafe.Pointer(in.Overwrite)) - out.TableType = (*string)(unsafe.Pointer(in.TableType)) - return nil -} - -// Convert_v1beta1_Partition_To_v1alpha4_Partition is an autogenerated conversion function. -func Convert_v1beta1_Partition_To_v1alpha4_Partition(in *v1beta1.Partition, out *Partition, s conversion.Scope) error { - return autoConvert_v1beta1_Partition_To_v1alpha4_Partition(in, out, s) -} - -func autoConvert_v1alpha4_SecretFileSource_To_v1beta1_SecretFileSource(in *SecretFileSource, out *v1beta1.SecretFileSource, s conversion.Scope) error { - out.Name = in.Name - out.Key = in.Key - return nil -} - -// Convert_v1alpha4_SecretFileSource_To_v1beta1_SecretFileSource is an autogenerated conversion function. -func Convert_v1alpha4_SecretFileSource_To_v1beta1_SecretFileSource(in *SecretFileSource, out *v1beta1.SecretFileSource, s conversion.Scope) error { - return autoConvert_v1alpha4_SecretFileSource_To_v1beta1_SecretFileSource(in, out, s) -} - -func autoConvert_v1beta1_SecretFileSource_To_v1alpha4_SecretFileSource(in *v1beta1.SecretFileSource, out *SecretFileSource, s conversion.Scope) error { - out.Name = in.Name - out.Key = in.Key - return nil -} - -// Convert_v1beta1_SecretFileSource_To_v1alpha4_SecretFileSource is an autogenerated conversion function. -func Convert_v1beta1_SecretFileSource_To_v1alpha4_SecretFileSource(in *v1beta1.SecretFileSource, out *SecretFileSource, s conversion.Scope) error { - return autoConvert_v1beta1_SecretFileSource_To_v1alpha4_SecretFileSource(in, out, s) -} - -func autoConvert_v1alpha4_User_To_v1beta1_User(in *User, out *v1beta1.User, s conversion.Scope) error { - out.Name = in.Name - out.Gecos = (*string)(unsafe.Pointer(in.Gecos)) - out.Groups = (*string)(unsafe.Pointer(in.Groups)) - out.HomeDir = (*string)(unsafe.Pointer(in.HomeDir)) - out.Inactive = (*bool)(unsafe.Pointer(in.Inactive)) - out.Shell = (*string)(unsafe.Pointer(in.Shell)) - out.Passwd = (*string)(unsafe.Pointer(in.Passwd)) - out.PrimaryGroup = (*string)(unsafe.Pointer(in.PrimaryGroup)) - out.LockPassword = (*bool)(unsafe.Pointer(in.LockPassword)) - out.Sudo = (*string)(unsafe.Pointer(in.Sudo)) - out.SSHAuthorizedKeys = *(*[]string)(unsafe.Pointer(&in.SSHAuthorizedKeys)) - return nil -} - -// Convert_v1alpha4_User_To_v1beta1_User is an autogenerated conversion function. -func Convert_v1alpha4_User_To_v1beta1_User(in *User, out *v1beta1.User, s conversion.Scope) error { - return autoConvert_v1alpha4_User_To_v1beta1_User(in, out, s) -} - -func autoConvert_v1beta1_User_To_v1alpha4_User(in *v1beta1.User, out *User, s conversion.Scope) error { - out.Name = in.Name - out.Gecos = (*string)(unsafe.Pointer(in.Gecos)) - out.Groups = (*string)(unsafe.Pointer(in.Groups)) - out.HomeDir = (*string)(unsafe.Pointer(in.HomeDir)) - out.Inactive = (*bool)(unsafe.Pointer(in.Inactive)) - out.Shell = (*string)(unsafe.Pointer(in.Shell)) - out.Passwd = (*string)(unsafe.Pointer(in.Passwd)) - // WARNING: in.PasswdFrom requires manual conversion: does not exist in peer-type - out.PrimaryGroup = (*string)(unsafe.Pointer(in.PrimaryGroup)) - out.LockPassword = (*bool)(unsafe.Pointer(in.LockPassword)) - out.Sudo = (*string)(unsafe.Pointer(in.Sudo)) - out.SSHAuthorizedKeys = *(*[]string)(unsafe.Pointer(&in.SSHAuthorizedKeys)) - return nil -} diff --git a/bootstrap/kubeadm/api/v1alpha4/zz_generated.deepcopy.go b/bootstrap/kubeadm/api/v1alpha4/zz_generated.deepcopy.go deleted file mode 100644 index 085cafb92d56..000000000000 --- a/bootstrap/kubeadm/api/v1alpha4/zz_generated.deepcopy.go +++ /dev/null @@ -1,1041 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIEndpoint) DeepCopyInto(out *APIEndpoint) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIEndpoint. -func (in *APIEndpoint) DeepCopy() *APIEndpoint { - if in == nil { - return nil - } - out := new(APIEndpoint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIServer) DeepCopyInto(out *APIServer) { - *out = *in - in.ControlPlaneComponent.DeepCopyInto(&out.ControlPlaneComponent) - if in.CertSANs != nil { - in, out := &in.CertSANs, &out.CertSANs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.TimeoutForControlPlane != nil { - in, out := &in.TimeoutForControlPlane, &out.TimeoutForControlPlane - *out = new(v1.Duration) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServer. -func (in *APIServer) DeepCopy() *APIServer { - if in == nil { - return nil - } - out := new(APIServer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BootstrapToken) DeepCopyInto(out *BootstrapToken) { - *out = *in - if in.Token != nil { - in, out := &in.Token, &out.Token - *out = new(BootstrapTokenString) - **out = **in - } - if in.TTL != nil { - in, out := &in.TTL, &out.TTL - *out = new(v1.Duration) - **out = **in - } - if in.Expires != nil { - in, out := &in.Expires, &out.Expires - *out = (*in).DeepCopy() - } - if in.Usages != nil { - in, out := &in.Usages, &out.Usages - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Groups != nil { - in, out := &in.Groups, &out.Groups - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootstrapToken. -func (in *BootstrapToken) DeepCopy() *BootstrapToken { - if in == nil { - return nil - } - out := new(BootstrapToken) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BootstrapTokenDiscovery) DeepCopyInto(out *BootstrapTokenDiscovery) { - *out = *in - if in.CACertHashes != nil { - in, out := &in.CACertHashes, &out.CACertHashes - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootstrapTokenDiscovery. -func (in *BootstrapTokenDiscovery) DeepCopy() *BootstrapTokenDiscovery { - if in == nil { - return nil - } - out := new(BootstrapTokenDiscovery) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BootstrapTokenString) DeepCopyInto(out *BootstrapTokenString) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootstrapTokenString. -func (in *BootstrapTokenString) DeepCopy() *BootstrapTokenString { - if in == nil { - return nil - } - out := new(BootstrapTokenString) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterConfiguration) DeepCopyInto(out *ClusterConfiguration) { - *out = *in - out.TypeMeta = in.TypeMeta - in.Etcd.DeepCopyInto(&out.Etcd) - out.Networking = in.Networking - in.APIServer.DeepCopyInto(&out.APIServer) - in.ControllerManager.DeepCopyInto(&out.ControllerManager) - in.Scheduler.DeepCopyInto(&out.Scheduler) - out.DNS = in.DNS - if in.FeatureGates != nil { - in, out := &in.FeatureGates, &out.FeatureGates - *out = make(map[string]bool, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterConfiguration. -func (in *ClusterConfiguration) DeepCopy() *ClusterConfiguration { - if in == nil { - return nil - } - out := new(ClusterConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterConfiguration) 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 *ClusterStatus) DeepCopyInto(out *ClusterStatus) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.APIEndpoints != nil { - in, out := &in.APIEndpoints, &out.APIEndpoints - *out = make(map[string]APIEndpoint, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterStatus. -func (in *ClusterStatus) DeepCopy() *ClusterStatus { - if in == nil { - return nil - } - out := new(ClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterStatus) 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 *ControlPlaneComponent) DeepCopyInto(out *ControlPlaneComponent) { - *out = *in - if in.ExtraArgs != nil { - in, out := &in.ExtraArgs, &out.ExtraArgs - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ExtraVolumes != nil { - in, out := &in.ExtraVolumes, &out.ExtraVolumes - *out = make([]HostPathMount, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneComponent. -func (in *ControlPlaneComponent) DeepCopy() *ControlPlaneComponent { - if in == nil { - return nil - } - out := new(ControlPlaneComponent) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DNS) DeepCopyInto(out *DNS) { - *out = *in - out.ImageMeta = in.ImageMeta -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNS. -func (in *DNS) DeepCopy() *DNS { - if in == nil { - return nil - } - out := new(DNS) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Discovery) DeepCopyInto(out *Discovery) { - *out = *in - if in.BootstrapToken != nil { - in, out := &in.BootstrapToken, &out.BootstrapToken - *out = new(BootstrapTokenDiscovery) - (*in).DeepCopyInto(*out) - } - if in.File != nil { - in, out := &in.File, &out.File - *out = new(FileDiscovery) - **out = **in - } - if in.Timeout != nil { - in, out := &in.Timeout, &out.Timeout - *out = new(v1.Duration) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Discovery. -func (in *Discovery) DeepCopy() *Discovery { - if in == nil { - return nil - } - out := new(Discovery) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DiskSetup) DeepCopyInto(out *DiskSetup) { - *out = *in - if in.Partitions != nil { - in, out := &in.Partitions, &out.Partitions - *out = make([]Partition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Filesystems != nil { - in, out := &in.Filesystems, &out.Filesystems - *out = make([]Filesystem, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiskSetup. -func (in *DiskSetup) DeepCopy() *DiskSetup { - if in == nil { - return nil - } - out := new(DiskSetup) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Etcd) DeepCopyInto(out *Etcd) { - *out = *in - if in.Local != nil { - in, out := &in.Local, &out.Local - *out = new(LocalEtcd) - (*in).DeepCopyInto(*out) - } - if in.External != nil { - in, out := &in.External, &out.External - *out = new(ExternalEtcd) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Etcd. -func (in *Etcd) DeepCopy() *Etcd { - if in == nil { - return nil - } - out := new(Etcd) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ExternalEtcd) DeepCopyInto(out *ExternalEtcd) { - *out = *in - if in.Endpoints != nil { - in, out := &in.Endpoints, &out.Endpoints - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExternalEtcd. -func (in *ExternalEtcd) DeepCopy() *ExternalEtcd { - if in == nil { - return nil - } - out := new(ExternalEtcd) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *File) DeepCopyInto(out *File) { - *out = *in - if in.ContentFrom != nil { - in, out := &in.ContentFrom, &out.ContentFrom - *out = new(FileSource) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new File. -func (in *File) DeepCopy() *File { - if in == nil { - return nil - } - out := new(File) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FileDiscovery) DeepCopyInto(out *FileDiscovery) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FileDiscovery. -func (in *FileDiscovery) DeepCopy() *FileDiscovery { - if in == nil { - return nil - } - out := new(FileDiscovery) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *FileSource) DeepCopyInto(out *FileSource) { - *out = *in - out.Secret = in.Secret -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FileSource. -func (in *FileSource) DeepCopy() *FileSource { - if in == nil { - return nil - } - out := new(FileSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Filesystem) DeepCopyInto(out *Filesystem) { - *out = *in - if in.Partition != nil { - in, out := &in.Partition, &out.Partition - *out = new(string) - **out = **in - } - if in.Overwrite != nil { - in, out := &in.Overwrite, &out.Overwrite - *out = new(bool) - **out = **in - } - if in.ReplaceFS != nil { - in, out := &in.ReplaceFS, &out.ReplaceFS - *out = new(string) - **out = **in - } - if in.ExtraOpts != nil { - in, out := &in.ExtraOpts, &out.ExtraOpts - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filesystem. -func (in *Filesystem) DeepCopy() *Filesystem { - if in == nil { - return nil - } - out := new(Filesystem) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *HostPathMount) DeepCopyInto(out *HostPathMount) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostPathMount. -func (in *HostPathMount) DeepCopy() *HostPathMount { - if in == nil { - return nil - } - out := new(HostPathMount) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImageMeta) DeepCopyInto(out *ImageMeta) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageMeta. -func (in *ImageMeta) DeepCopy() *ImageMeta { - if in == nil { - return nil - } - out := new(ImageMeta) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *InitConfiguration) DeepCopyInto(out *InitConfiguration) { - *out = *in - out.TypeMeta = in.TypeMeta - if in.BootstrapTokens != nil { - in, out := &in.BootstrapTokens, &out.BootstrapTokens - *out = make([]BootstrapToken, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - in.NodeRegistration.DeepCopyInto(&out.NodeRegistration) - out.LocalAPIEndpoint = in.LocalAPIEndpoint -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InitConfiguration. -func (in *InitConfiguration) DeepCopy() *InitConfiguration { - if in == nil { - return nil - } - out := new(InitConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *InitConfiguration) 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 *JoinConfiguration) DeepCopyInto(out *JoinConfiguration) { - *out = *in - out.TypeMeta = in.TypeMeta - in.NodeRegistration.DeepCopyInto(&out.NodeRegistration) - in.Discovery.DeepCopyInto(&out.Discovery) - if in.ControlPlane != nil { - in, out := &in.ControlPlane, &out.ControlPlane - *out = new(JoinControlPlane) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JoinConfiguration. -func (in *JoinConfiguration) DeepCopy() *JoinConfiguration { - if in == nil { - return nil - } - out := new(JoinConfiguration) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *JoinConfiguration) 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 *JoinControlPlane) DeepCopyInto(out *JoinControlPlane) { - *out = *in - out.LocalAPIEndpoint = in.LocalAPIEndpoint -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JoinControlPlane. -func (in *JoinControlPlane) DeepCopy() *JoinControlPlane { - if in == nil { - return nil - } - out := new(JoinControlPlane) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeadmConfig) DeepCopyInto(out *KubeadmConfig) { - *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 KubeadmConfig. -func (in *KubeadmConfig) DeepCopy() *KubeadmConfig { - if in == nil { - return nil - } - out := new(KubeadmConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KubeadmConfig) 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 *KubeadmConfigList) DeepCopyInto(out *KubeadmConfigList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KubeadmConfig, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfigList. -func (in *KubeadmConfigList) DeepCopy() *KubeadmConfigList { - if in == nil { - return nil - } - out := new(KubeadmConfigList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KubeadmConfigList) 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 *KubeadmConfigSpec) DeepCopyInto(out *KubeadmConfigSpec) { - *out = *in - if in.ClusterConfiguration != nil { - in, out := &in.ClusterConfiguration, &out.ClusterConfiguration - *out = new(ClusterConfiguration) - (*in).DeepCopyInto(*out) - } - if in.InitConfiguration != nil { - in, out := &in.InitConfiguration, &out.InitConfiguration - *out = new(InitConfiguration) - (*in).DeepCopyInto(*out) - } - if in.JoinConfiguration != nil { - in, out := &in.JoinConfiguration, &out.JoinConfiguration - *out = new(JoinConfiguration) - (*in).DeepCopyInto(*out) - } - if in.Files != nil { - in, out := &in.Files, &out.Files - *out = make([]File, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.DiskSetup != nil { - in, out := &in.DiskSetup, &out.DiskSetup - *out = new(DiskSetup) - (*in).DeepCopyInto(*out) - } - if in.Mounts != nil { - in, out := &in.Mounts, &out.Mounts - *out = make([]MountPoints, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = make(MountPoints, len(*in)) - copy(*out, *in) - } - } - } - if in.PreKubeadmCommands != nil { - in, out := &in.PreKubeadmCommands, &out.PreKubeadmCommands - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.PostKubeadmCommands != nil { - in, out := &in.PostKubeadmCommands, &out.PostKubeadmCommands - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Users != nil { - in, out := &in.Users, &out.Users - *out = make([]User, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.NTP != nil { - in, out := &in.NTP, &out.NTP - *out = new(NTP) - (*in).DeepCopyInto(*out) - } - if in.Verbosity != nil { - in, out := &in.Verbosity, &out.Verbosity - *out = new(int32) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfigSpec. -func (in *KubeadmConfigSpec) DeepCopy() *KubeadmConfigSpec { - if in == nil { - return nil - } - out := new(KubeadmConfigSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeadmConfigStatus) DeepCopyInto(out *KubeadmConfigStatus) { - *out = *in - if in.DataSecretName != nil { - in, out := &in.DataSecretName, &out.DataSecretName - *out = new(string) - **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]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfigStatus. -func (in *KubeadmConfigStatus) DeepCopy() *KubeadmConfigStatus { - if in == nil { - return nil - } - out := new(KubeadmConfigStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeadmConfigTemplate) DeepCopyInto(out *KubeadmConfigTemplate) { - *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 KubeadmConfigTemplate. -func (in *KubeadmConfigTemplate) DeepCopy() *KubeadmConfigTemplate { - if in == nil { - return nil - } - out := new(KubeadmConfigTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KubeadmConfigTemplate) 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 *KubeadmConfigTemplateList) DeepCopyInto(out *KubeadmConfigTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KubeadmConfigTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfigTemplateList. -func (in *KubeadmConfigTemplateList) DeepCopy() *KubeadmConfigTemplateList { - if in == nil { - return nil - } - out := new(KubeadmConfigTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KubeadmConfigTemplateList) 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 *KubeadmConfigTemplateResource) DeepCopyInto(out *KubeadmConfigTemplateResource) { - *out = *in - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfigTemplateResource. -func (in *KubeadmConfigTemplateResource) DeepCopy() *KubeadmConfigTemplateResource { - if in == nil { - return nil - } - out := new(KubeadmConfigTemplateResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeadmConfigTemplateSpec) DeepCopyInto(out *KubeadmConfigTemplateSpec) { - *out = *in - in.Template.DeepCopyInto(&out.Template) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmConfigTemplateSpec. -func (in *KubeadmConfigTemplateSpec) DeepCopy() *KubeadmConfigTemplateSpec { - if in == nil { - return nil - } - out := new(KubeadmConfigTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LocalEtcd) DeepCopyInto(out *LocalEtcd) { - *out = *in - out.ImageMeta = in.ImageMeta - if in.ExtraArgs != nil { - in, out := &in.ExtraArgs, &out.ExtraArgs - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.ServerCertSANs != nil { - in, out := &in.ServerCertSANs, &out.ServerCertSANs - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.PeerCertSANs != nil { - in, out := &in.PeerCertSANs, &out.PeerCertSANs - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalEtcd. -func (in *LocalEtcd) DeepCopy() *LocalEtcd { - if in == nil { - return nil - } - out := new(LocalEtcd) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in MountPoints) DeepCopyInto(out *MountPoints) { - { - in := &in - *out = make(MountPoints, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MountPoints. -func (in MountPoints) DeepCopy() MountPoints { - if in == nil { - return nil - } - out := new(MountPoints) - in.DeepCopyInto(out) - return *out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NTP) DeepCopyInto(out *NTP) { - *out = *in - if in.Servers != nil { - in, out := &in.Servers, &out.Servers - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Enabled != nil { - in, out := &in.Enabled, &out.Enabled - *out = new(bool) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NTP. -func (in *NTP) DeepCopy() *NTP { - if in == nil { - return nil - } - out := new(NTP) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Networking) DeepCopyInto(out *Networking) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Networking. -func (in *Networking) DeepCopy() *Networking { - if in == nil { - return nil - } - out := new(Networking) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeRegistrationOptions) DeepCopyInto(out *NodeRegistrationOptions) { - *out = *in - if in.Taints != nil { - in, out := &in.Taints, &out.Taints - *out = make([]corev1.Taint, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.KubeletExtraArgs != nil { - in, out := &in.KubeletExtraArgs, &out.KubeletExtraArgs - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } - if in.IgnorePreflightErrors != nil { - in, out := &in.IgnorePreflightErrors, &out.IgnorePreflightErrors - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeRegistrationOptions. -func (in *NodeRegistrationOptions) DeepCopy() *NodeRegistrationOptions { - if in == nil { - return nil - } - out := new(NodeRegistrationOptions) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Partition) DeepCopyInto(out *Partition) { - *out = *in - if in.Overwrite != nil { - in, out := &in.Overwrite, &out.Overwrite - *out = new(bool) - **out = **in - } - if in.TableType != nil { - in, out := &in.TableType, &out.TableType - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Partition. -func (in *Partition) DeepCopy() *Partition { - if in == nil { - return nil - } - out := new(Partition) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SecretFileSource) DeepCopyInto(out *SecretFileSource) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretFileSource. -func (in *SecretFileSource) DeepCopy() *SecretFileSource { - if in == nil { - return nil - } - out := new(SecretFileSource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *User) DeepCopyInto(out *User) { - *out = *in - if in.Gecos != nil { - in, out := &in.Gecos, &out.Gecos - *out = new(string) - **out = **in - } - if in.Groups != nil { - in, out := &in.Groups, &out.Groups - *out = new(string) - **out = **in - } - if in.HomeDir != nil { - in, out := &in.HomeDir, &out.HomeDir - *out = new(string) - **out = **in - } - if in.Inactive != nil { - in, out := &in.Inactive, &out.Inactive - *out = new(bool) - **out = **in - } - if in.Shell != nil { - in, out := &in.Shell, &out.Shell - *out = new(string) - **out = **in - } - if in.Passwd != nil { - in, out := &in.Passwd, &out.Passwd - *out = new(string) - **out = **in - } - if in.PrimaryGroup != nil { - in, out := &in.PrimaryGroup, &out.PrimaryGroup - *out = new(string) - **out = **in - } - if in.LockPassword != nil { - in, out := &in.LockPassword, &out.LockPassword - *out = new(bool) - **out = **in - } - if in.Sudo != nil { - in, out := &in.Sudo, &out.Sudo - *out = new(string) - **out = **in - } - if in.SSHAuthorizedKeys != nil { - in, out := &in.SSHAuthorizedKeys, &out.SSHAuthorizedKeys - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new User. -func (in *User) DeepCopy() *User { - if in == nil { - return nil - } - out := new(User) - in.DeepCopyInto(out) - return out -} diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml index 0e2bcb9d5d85..93d253b7bd7a 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigs.yaml @@ -16,1012 +16,6 @@ spec: singular: kubeadmconfig scope: Namespaced versions: - - additionalPrinterColumns: - - description: Time duration since creation of KubeadmConfig - jsonPath: .metadata.creationTimestamp - name: Age - type: date - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - KubeadmConfig is the Schema for the kubeadmconfigs API. - - - Deprecated: This type will be removed in one of the next releases. - 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: |- - KubeadmConfigSpec defines the desired state of KubeadmConfig. - Either ClusterConfiguration and InitConfiguration should be defined or the JoinConfiguration should be defined. - properties: - clusterConfiguration: - description: ClusterConfiguration along with InitConfiguration are - the configurations necessary for the init command - properties: - apiServer: - description: APIServer contains extra settings for the API server - control plane component - properties: - certSANs: - description: CertSANs sets extra Subject Alternative Names - for the API Server signing cert. - items: - type: string - type: array - extraArgs: - additionalProperties: - type: string - description: |- - ExtraArgs is an extra set of flags to pass to the control plane component. - TODO: This is temporary and ideally we would like to switch all components to - use ComponentConfig + ConfigMaps. - type: object - extraVolumes: - description: ExtraVolumes is an extra set of host volumes, - mounted to the control plane component. - items: - description: |- - HostPathMount contains elements describing volumes that are mounted from the - host. - properties: - hostPath: - description: |- - HostPath is the path in the host that will be mounted inside - the pod. - type: string - mountPath: - description: MountPath is the path inside the pod where - hostPath will be mounted. - type: string - name: - description: Name of the volume inside the pod template. - type: string - pathType: - description: PathType is the type of the HostPath. - type: string - readOnly: - description: ReadOnly controls write access to the volume - type: boolean - required: - - hostPath - - mountPath - - name - type: object - type: array - timeoutForControlPlane: - description: TimeoutForControlPlane controls the timeout that - we use for API server to appear - type: string - type: object - 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 - certificatesDir: - description: |- - CertificatesDir specifies where to store or look for all required certificates. - NB: if not provided, this will default to `/etc/kubernetes/pki` - type: string - clusterName: - description: The cluster name - type: string - controlPlaneEndpoint: - description: |- - ControlPlaneEndpoint sets a stable IP address or DNS name for the control plane; it - can be a valid IP address or a RFC-1123 DNS subdomain, both with optional TCP port. - In case the ControlPlaneEndpoint is not specified, the AdvertiseAddress + BindPort - are used; in case the ControlPlaneEndpoint is specified but without a TCP port, - the BindPort is used. - Possible usages are: - e.g. In a cluster with more than one control plane instances, this field should be - assigned the address of the external load balancer in front of the - control plane instances. - e.g. in environments with enforced node recycling, the ControlPlaneEndpoint - could be used for assigning a stable DNS to the control plane. - NB: This value defaults to the first value in the Cluster object status.apiEndpoints array. - type: string - controllerManager: - description: ControllerManager contains extra settings for the - controller manager control plane component - properties: - extraArgs: - additionalProperties: - type: string - description: |- - ExtraArgs is an extra set of flags to pass to the control plane component. - TODO: This is temporary and ideally we would like to switch all components to - use ComponentConfig + ConfigMaps. - type: object - extraVolumes: - description: ExtraVolumes is an extra set of host volumes, - mounted to the control plane component. - items: - description: |- - HostPathMount contains elements describing volumes that are mounted from the - host. - properties: - hostPath: - description: |- - HostPath is the path in the host that will be mounted inside - the pod. - type: string - mountPath: - description: MountPath is the path inside the pod where - hostPath will be mounted. - type: string - name: - description: Name of the volume inside the pod template. - type: string - pathType: - description: PathType is the type of the HostPath. - type: string - readOnly: - description: ReadOnly controls write access to the volume - type: boolean - required: - - hostPath - - mountPath - - name - type: object - type: array - type: object - dns: - description: DNS defines the options for the DNS add-on installed - in the cluster. - properties: - imageRepository: - description: |- - ImageRepository sets the container registry to pull images from. - if not set, the ImageRepository defined in ClusterConfiguration will be used instead. - type: string - imageTag: - description: |- - ImageTag allows to specify a tag for the image. - In case this value is set, kubeadm does not change automatically the version of the above components during upgrades. - type: string - type: object - etcd: - description: |- - Etcd holds configuration for etcd. - NB: This value defaults to a Local (stacked) etcd - properties: - external: - description: |- - External describes how to connect to an external etcd cluster - Local and External are mutually exclusive - properties: - caFile: - description: |- - CAFile is an SSL Certificate Authority file used to secure etcd communication. - Required if using a TLS connection. - type: string - certFile: - description: |- - CertFile is an SSL certification file used to secure etcd communication. - Required if using a TLS connection. - type: string - endpoints: - description: Endpoints of etcd members. Required for ExternalEtcd. - items: - type: string - type: array - keyFile: - description: |- - KeyFile is an SSL key file used to secure etcd communication. - Required if using a TLS connection. - type: string - required: - - caFile - - certFile - - endpoints - - keyFile - type: object - local: - description: |- - Local provides configuration knobs for configuring the local etcd instance - Local and External are mutually exclusive - properties: - dataDir: - description: |- - DataDir is the directory etcd will place its data. - Defaults to "/var/lib/etcd". - type: string - extraArgs: - additionalProperties: - type: string - description: |- - ExtraArgs are extra arguments provided to the etcd binary - when run inside a static pod. - type: object - imageRepository: - description: |- - ImageRepository sets the container registry to pull images from. - if not set, the ImageRepository defined in ClusterConfiguration will be used instead. - type: string - imageTag: - description: |- - ImageTag allows to specify a tag for the image. - In case this value is set, kubeadm does not change automatically the version of the above components during upgrades. - type: string - peerCertSANs: - description: PeerCertSANs sets extra Subject Alternative - Names for the etcd peer signing cert. - items: - type: string - type: array - serverCertSANs: - description: ServerCertSANs sets extra Subject Alternative - Names for the etcd server signing cert. - items: - type: string - type: array - type: object - type: object - featureGates: - additionalProperties: - type: boolean - description: FeatureGates enabled by the user. - type: object - imageRepository: - description: |- - ImageRepository sets the container registry to pull images from. - If empty, `registry.k8s.io` will be used by default; in case of kubernetes version is a CI build (kubernetes version starts with `ci/` or `ci-cross/`) - `gcr.io/k8s-staging-ci-images` will be used as a default for control plane components and for kube-proxy, while `registry.k8s.io` - will be used for all the other images. - 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 - kubernetesVersion: - description: |- - KubernetesVersion is the target version of the control plane. - NB: This value defaults to the Machine object spec.version - type: string - networking: - description: |- - Networking holds configuration for the networking topology of the cluster. - NB: This value defaults to the Cluster object spec.clusterNetwork. - properties: - dnsDomain: - description: DNSDomain is the dns domain used by k8s services. - Defaults to "cluster.local". - type: string - podSubnet: - description: |- - PodSubnet is the subnet used by pods. - If unset, the API server will not allocate CIDR ranges for every node. - Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.services.cidrBlocks if that is set - type: string - serviceSubnet: - description: |- - ServiceSubnet is the subnet used by k8s services. - Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.pods.cidrBlocks, or - to "10.96.0.0/12" if that's unset. - type: string - type: object - scheduler: - description: Scheduler contains extra settings for the scheduler - control plane component - properties: - extraArgs: - additionalProperties: - type: string - description: |- - ExtraArgs is an extra set of flags to pass to the control plane component. - TODO: This is temporary and ideally we would like to switch all components to - use ComponentConfig + ConfigMaps. - type: object - extraVolumes: - description: ExtraVolumes is an extra set of host volumes, - mounted to the control plane component. - items: - description: |- - HostPathMount contains elements describing volumes that are mounted from the - host. - properties: - hostPath: - description: |- - HostPath is the path in the host that will be mounted inside - the pod. - type: string - mountPath: - description: MountPath is the path inside the pod where - hostPath will be mounted. - type: string - name: - description: Name of the volume inside the pod template. - type: string - pathType: - description: PathType is the type of the HostPath. - type: string - readOnly: - description: ReadOnly controls write access to the volume - type: boolean - required: - - hostPath - - mountPath - - name - type: object - type: array - type: object - type: object - diskSetup: - description: DiskSetup specifies options for the creation of partition - tables and file systems on devices. - properties: - filesystems: - description: Filesystems specifies the list of file systems to - setup. - items: - description: Filesystem defines the file systems to be created. - properties: - device: - description: Device specifies the device name - type: string - extraOpts: - description: ExtraOpts defined extra options to add to the - command for creating the file system. - items: - type: string - type: array - filesystem: - description: Filesystem specifies the file system type. - type: string - label: - description: Label specifies the file system label to be - used. If set to None, no label is used. - type: string - overwrite: - description: |- - Overwrite defines whether or not to overwrite any existing filesystem. - If true, any pre-existing file system will be destroyed. Use with Caution. - type: boolean - partition: - description: 'Partition specifies the partition to use. - The valid options are: "auto|any", "auto", "any", "none", - and , where NUM is the actual partition number.' - type: string - replaceFS: - description: |- - ReplaceFS is a special directive, used for Microsoft Azure that instructs cloud-init to replace a file system of . - NOTE: unless you define a label, this requires the use of the 'any' partition directive. - type: string - required: - - device - - filesystem - - label - type: object - type: array - partitions: - description: Partitions specifies the list of the partitions to - setup. - items: - description: Partition defines how to create and layout a partition. - properties: - device: - description: Device is the name of the device. - type: string - layout: - description: |- - Layout specifies the device layout. - If it is true, a single partition will be created for the entire device. - When layout is false, it means don't partition or ignore existing partitioning. - type: boolean - overwrite: - description: |- - Overwrite describes whether to skip checks and create the partition if a partition or filesystem is found on the device. - Use with caution. Default is 'false'. - type: boolean - tableType: - description: |- - TableType specifies the tupe of partition table. The following are supported: - 'mbr': default and setups a MS-DOS partition table - 'gpt': setups a GPT partition table - type: string - required: - - device - - layout - type: object - type: array - type: object - files: - description: Files specifies extra files to be passed to user_data - upon creation. - items: - description: File defines the input for generating write_files in - cloud-init. - properties: - content: - description: Content is the actual content of the file. - type: string - contentFrom: - description: ContentFrom is a referenced source of content to - populate the file. - properties: - secret: - description: Secret represents a secret that should populate - this file. - properties: - key: - description: Key is the key in the secret's data map - for this value. - type: string - name: - description: Name of the secret in the KubeadmBootstrapConfig's - namespace to use. - type: string - required: - - key - - name - type: object - required: - - secret - type: object - encoding: - description: Encoding specifies the encoding of the file contents. - enum: - - base64 - - gzip - - gzip+base64 - type: string - owner: - description: Owner specifies the ownership of the file, e.g. - "root:root". - type: string - path: - description: Path specifies the full path on disk where to store - the file. - type: string - permissions: - description: Permissions specifies the permissions to assign - to the file, e.g. "0640". - type: string - required: - - path - type: object - type: array - format: - description: Format specifies the output format of the bootstrap data - enum: - - cloud-config - type: string - initConfiguration: - description: InitConfiguration along with ClusterConfiguration are - the configurations necessary for the init command - 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 - bootstrapTokens: - description: |- - BootstrapTokens is respected at `kubeadm init` time and describes a set of Bootstrap Tokens to create. - This information IS NOT uploaded to the kubeadm cluster configmap, partly because of its sensitive nature - items: - description: BootstrapToken describes one bootstrap token, stored - as a Secret in the cluster. - properties: - description: - description: |- - Description sets a human-friendly message why this token exists and what it's used - for, so other administrators can know its purpose. - type: string - expires: - description: |- - Expires specifies the timestamp when this token expires. Defaults to being set - dynamically at runtime based on the TTL. Expires and TTL are mutually exclusive. - format: date-time - type: string - groups: - description: |- - Groups specifies the extra groups that this token will authenticate as when/if - used for authentication - items: - type: string - type: array - token: - description: |- - Token is used for establishing bidirectional trust between nodes and control-planes. - Used for joining nodes in the cluster. - type: string - ttl: - description: |- - TTL defines the time to live for this token. Defaults to 24h. - Expires and TTL are mutually exclusive. - type: string - usages: - description: |- - Usages describes the ways in which this token can be used. Can by default be used - for establishing bidirectional trust, but that can be changed here. - items: - type: string - type: array - required: - - token - type: object - type: array - 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 - localAPIEndpoint: - description: |- - LocalAPIEndpoint represents the endpoint of the API server instance that's deployed on this control plane node - In HA setups, this differs from ClusterConfiguration.ControlPlaneEndpoint in the sense that ControlPlaneEndpoint - is the global endpoint for the cluster, which then loadbalances the requests to each individual API server. This - configuration object lets you customize what IP/DNS name and port the local API server advertises it's accessible - on. By default, kubeadm tries to auto-detect the IP of the default interface and use that, but in case that process - fails you may set the desired value here. - properties: - advertiseAddress: - description: AdvertiseAddress sets the IP address for the - API server to advertise. - type: string - bindPort: - description: |- - BindPort sets the secure port for the API Server to bind to. - Defaults to 6443. - format: int32 - type: integer - type: object - nodeRegistration: - description: |- - NodeRegistration holds fields that relate to registering the new control-plane node to the cluster. - When used in the context of control plane nodes, NodeRegistration should remain consistent - across both InitConfiguration and JoinConfiguration - properties: - criSocket: - description: CRISocket is used to retrieve container runtime - info. This information will be annotated to the Node API - object, for later re-use - type: string - ignorePreflightErrors: - description: IgnorePreflightErrors provides a slice of pre-flight - errors to be ignored when the current node is registered. - items: - type: string - type: array - kubeletExtraArgs: - additionalProperties: - type: string - description: |- - KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file - kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config-1.X ConfigMap - Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on. - type: object - name: - description: |- - Name is the `.Metadata.Name` field of the Node API object that will be created in this `kubeadm init` or `kubeadm join` operation. - This field is also used in the CommonName field of the kubelet's client certificate to the API server. - Defaults to the hostname of the node if not provided. - type: string - taints: - description: |- - Taints specifies the taints the Node API object should be registered with. If this field is unset, i.e. nil, in the `kubeadm init` process - it will be defaulted to []v1.Taint{'node-role.kubernetes.io/master=""'}. If you don't want to taint your control-plane node, set this field to an - empty slice, i.e. `taints: {}` in the YAML file. This field is solely used for Node registration. - items: - description: |- - The node this Taint is attached to has the "effect" on - any pod that does not tolerate the Taint. - properties: - effect: - description: |- - Required. The effect of the taint on pods - that do not tolerate the taint. - Valid effects are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Required. The taint key to be applied to - a node. - type: string - timeAdded: - description: |- - TimeAdded represents the time at which the taint was added. - It is only written for NoExecute taints. - format: date-time - type: string - value: - description: The taint value corresponding to the taint - key. - type: string - required: - - effect - - key - type: object - type: array - type: object - type: object - joinConfiguration: - description: JoinConfiguration is the kubeadm configuration for the - join command - 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 - caCertPath: - description: |- - CACertPath is the path to the SSL certificate authority used to - secure comunications between node and control-plane. - Defaults to "/etc/kubernetes/pki/ca.crt". - TODO: revisit when there is defaulting from k/k - type: string - controlPlane: - description: |- - ControlPlane defines the additional control plane instance to be deployed on the joining node. - If nil, no additional control plane instance will be deployed. - properties: - localAPIEndpoint: - description: LocalAPIEndpoint represents the endpoint of the - API server instance to be deployed on this node. - properties: - advertiseAddress: - description: AdvertiseAddress sets the IP address for - the API server to advertise. - type: string - bindPort: - description: |- - BindPort sets the secure port for the API Server to bind to. - Defaults to 6443. - format: int32 - type: integer - type: object - type: object - discovery: - description: |- - Discovery specifies the options for the kubelet to use during the TLS Bootstrap process - TODO: revisit when there is defaulting from k/k - properties: - bootstrapToken: - description: |- - BootstrapToken is used to set the options for bootstrap token based discovery - BootstrapToken and File are mutually exclusive - properties: - apiServerEndpoint: - description: APIServerEndpoint is an IP or domain name - to the API server from which info will be fetched. - type: string - caCertHashes: - description: |- - CACertHashes specifies a set of public key pins to verify - when token-based discovery is used. The root CA found during discovery - must match one of these values. Specifying an empty set disables root CA - pinning, which can be unsafe. Each hash is specified as ":", - where the only currently supported type is "sha256". This is a hex-encoded - SHA-256 hash of the Subject Public Key Info (SPKI) object in DER-encoded - ASN.1. These hashes can be calculated using, for example, OpenSSL: - openssl x509 -pubkey -in ca.crt openssl rsa -pubin -outform der 2>&/dev/null | openssl dgst -sha256 -hex - items: - type: string - type: array - token: - description: |- - Token is a token used to validate cluster information - fetched from the control-plane. - type: string - unsafeSkipCAVerification: - description: |- - UnsafeSkipCAVerification allows token-based discovery - without CA verification via CACertHashes. This can weaken - the security of kubeadm since other nodes can impersonate the control-plane. - type: boolean - required: - - token - type: object - file: - description: |- - File is used to specify a file or URL to a kubeconfig file from which to load cluster information - BootstrapToken and File are mutually exclusive - properties: - kubeConfigPath: - description: KubeConfigPath is used to specify the actual - file path or URL to the kubeconfig file from which to - load cluster information - type: string - required: - - kubeConfigPath - type: object - timeout: - description: Timeout modifies the discovery timeout - type: string - tlsBootstrapToken: - description: |- - TLSBootstrapToken is a token used for TLS bootstrapping. - If .BootstrapToken is set, this field is defaulted to .BootstrapToken.Token, but can be overridden. - If .File is set, this field **must be set** in case the KubeConfigFile does not contain any other authentication information - type: string - type: object - 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 - nodeRegistration: - description: |- - NodeRegistration holds fields that relate to registering the new control-plane node to the cluster. - When used in the context of control plane nodes, NodeRegistration should remain consistent - across both InitConfiguration and JoinConfiguration - properties: - criSocket: - description: CRISocket is used to retrieve container runtime - info. This information will be annotated to the Node API - object, for later re-use - type: string - ignorePreflightErrors: - description: IgnorePreflightErrors provides a slice of pre-flight - errors to be ignored when the current node is registered. - items: - type: string - type: array - kubeletExtraArgs: - additionalProperties: - type: string - description: |- - KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file - kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config-1.X ConfigMap - Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on. - type: object - name: - description: |- - Name is the `.Metadata.Name` field of the Node API object that will be created in this `kubeadm init` or `kubeadm join` operation. - This field is also used in the CommonName field of the kubelet's client certificate to the API server. - Defaults to the hostname of the node if not provided. - type: string - taints: - description: |- - Taints specifies the taints the Node API object should be registered with. If this field is unset, i.e. nil, in the `kubeadm init` process - it will be defaulted to []v1.Taint{'node-role.kubernetes.io/master=""'}. If you don't want to taint your control-plane node, set this field to an - empty slice, i.e. `taints: {}` in the YAML file. This field is solely used for Node registration. - items: - description: |- - The node this Taint is attached to has the "effect" on - any pod that does not tolerate the Taint. - properties: - effect: - description: |- - Required. The effect of the taint on pods - that do not tolerate the taint. - Valid effects are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Required. The taint key to be applied to - a node. - type: string - timeAdded: - description: |- - TimeAdded represents the time at which the taint was added. - It is only written for NoExecute taints. - format: date-time - type: string - value: - description: The taint value corresponding to the taint - key. - type: string - required: - - effect - - key - type: object - type: array - type: object - type: object - mounts: - description: Mounts specifies a list of mount points to be setup. - items: - description: MountPoints defines input for generated mounts in cloud-init. - items: - type: string - type: array - type: array - ntp: - description: NTP specifies NTP configuration - properties: - enabled: - description: Enabled specifies whether NTP should be enabled - type: boolean - servers: - description: Servers specifies which NTP servers to use - items: - type: string - type: array - type: object - postKubeadmCommands: - description: PostKubeadmCommands specifies extra commands to run after - kubeadm runs - items: - type: string - type: array - preKubeadmCommands: - description: PreKubeadmCommands specifies extra commands to run before - kubeadm runs - items: - type: string - type: array - useExperimentalRetryJoin: - description: |- - UseExperimentalRetryJoin replaces a basic kubeadm command with a shell - script with retries for joins. - - - This is meant to be an experimental temporary workaround on some environments - where joins fail due to timing (and other issues). The long term goal is to add retries to - kubeadm proper and use that functionality. - - - This will add about 40KB to userdata - - - For more information, refer to https://github.com/kubernetes-sigs/cluster-api/pull/2763#discussion_r397306055. - type: boolean - users: - description: Users specifies extra users to add - items: - description: User defines the input for a generated user in cloud-init. - properties: - gecos: - description: Gecos specifies the gecos to use for the user - type: string - groups: - description: Groups specifies the additional groups for the - user - type: string - homeDir: - description: HomeDir specifies the home directory to use for - the user - type: string - inactive: - description: Inactive specifies whether to mark the user as - inactive - type: boolean - lockPassword: - description: LockPassword specifies if password login should - be disabled - type: boolean - name: - description: Name specifies the user name - type: string - passwd: - description: Passwd specifies a hashed password for the user - type: string - primaryGroup: - description: PrimaryGroup specifies the primary group for the - user - type: string - shell: - description: Shell specifies the user's shell - type: string - sshAuthorizedKeys: - description: SSHAuthorizedKeys specifies a list of ssh authorized - keys for the user - items: - type: string - type: array - sudo: - description: Sudo specifies a sudo role for the user - type: string - required: - - name - type: object - type: array - verbosity: - description: |- - Verbosity is the number for the kubeadm log level verbosity. - It overrides the `--v` flag in kubeadm commands. - format: int32 - type: integer - type: object - status: - description: KubeadmConfigStatus defines the observed state of KubeadmConfig. - properties: - conditions: - description: Conditions defines current service state of the KubeadmConfig. - 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 - dataSecretName: - description: DataSecretName is the name of the secret that stores - the bootstrap data script. - type: string - failureMessage: - description: FailureMessage will be set on non-retryable errors - type: string - failureReason: - description: FailureReason will be set on non-retryable errors - type: string - observedGeneration: - description: ObservedGeneration is the latest generation observed - by the controller. - format: int64 - type: integer - ready: - description: Ready indicates the BootstrapData field is ready to be - consumed - type: boolean - type: object - type: object - served: false - storage: false - subresources: - status: {} - additionalPrinterColumns: - description: Cluster jsonPath: .metadata.labels['cluster\.x-k8s\.io/cluster-name'] diff --git a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml index 4d827b868154..b9440fb5481e 100644 --- a/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml +++ b/bootstrap/kubeadm/config/crd/bases/bootstrap.cluster.x-k8s.io_kubeadmconfigtemplates.yaml @@ -16,977 +16,6 @@ spec: singular: kubeadmconfigtemplate scope: Namespaced versions: - - additionalPrinterColumns: - - description: Time duration since creation of KubeadmConfigTemplate - jsonPath: .metadata.creationTimestamp - name: Age - type: date - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - KubeadmConfigTemplate is the Schema for the kubeadmconfigtemplates API. - - - Deprecated: This type will be removed in one of the next releases. - 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: KubeadmConfigTemplateSpec defines the desired state of KubeadmConfigTemplate. - properties: - template: - description: KubeadmConfigTemplateResource defines the Template structure. - properties: - spec: - description: |- - KubeadmConfigSpec defines the desired state of KubeadmConfig. - Either ClusterConfiguration and InitConfiguration should be defined or the JoinConfiguration should be defined. - properties: - clusterConfiguration: - description: ClusterConfiguration along with InitConfiguration - are the configurations necessary for the init command - properties: - apiServer: - description: APIServer contains extra settings for the - API server control plane component - properties: - certSANs: - description: CertSANs sets extra Subject Alternative - Names for the API Server signing cert. - items: - type: string - type: array - extraArgs: - additionalProperties: - type: string - description: |- - ExtraArgs is an extra set of flags to pass to the control plane component. - TODO: This is temporary and ideally we would like to switch all components to - use ComponentConfig + ConfigMaps. - type: object - extraVolumes: - description: ExtraVolumes is an extra set of host - volumes, mounted to the control plane component. - items: - description: |- - HostPathMount contains elements describing volumes that are mounted from the - host. - properties: - hostPath: - description: |- - HostPath is the path in the host that will be mounted inside - the pod. - type: string - mountPath: - description: MountPath is the path inside the - pod where hostPath will be mounted. - type: string - name: - description: Name of the volume inside the pod - template. - type: string - pathType: - description: PathType is the type of the HostPath. - type: string - readOnly: - description: ReadOnly controls write access - to the volume - type: boolean - required: - - hostPath - - mountPath - - name - type: object - type: array - timeoutForControlPlane: - description: TimeoutForControlPlane controls the timeout - that we use for API server to appear - type: string - type: object - 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 - certificatesDir: - description: |- - CertificatesDir specifies where to store or look for all required certificates. - NB: if not provided, this will default to `/etc/kubernetes/pki` - type: string - clusterName: - description: The cluster name - type: string - controlPlaneEndpoint: - description: |- - ControlPlaneEndpoint sets a stable IP address or DNS name for the control plane; it - can be a valid IP address or a RFC-1123 DNS subdomain, both with optional TCP port. - In case the ControlPlaneEndpoint is not specified, the AdvertiseAddress + BindPort - are used; in case the ControlPlaneEndpoint is specified but without a TCP port, - the BindPort is used. - Possible usages are: - e.g. In a cluster with more than one control plane instances, this field should be - assigned the address of the external load balancer in front of the - control plane instances. - e.g. in environments with enforced node recycling, the ControlPlaneEndpoint - could be used for assigning a stable DNS to the control plane. - NB: This value defaults to the first value in the Cluster object status.apiEndpoints array. - type: string - controllerManager: - description: ControllerManager contains extra settings - for the controller manager control plane component - properties: - extraArgs: - additionalProperties: - type: string - description: |- - ExtraArgs is an extra set of flags to pass to the control plane component. - TODO: This is temporary and ideally we would like to switch all components to - use ComponentConfig + ConfigMaps. - type: object - extraVolumes: - description: ExtraVolumes is an extra set of host - volumes, mounted to the control plane component. - items: - description: |- - HostPathMount contains elements describing volumes that are mounted from the - host. - properties: - hostPath: - description: |- - HostPath is the path in the host that will be mounted inside - the pod. - type: string - mountPath: - description: MountPath is the path inside the - pod where hostPath will be mounted. - type: string - name: - description: Name of the volume inside the pod - template. - type: string - pathType: - description: PathType is the type of the HostPath. - type: string - readOnly: - description: ReadOnly controls write access - to the volume - type: boolean - required: - - hostPath - - mountPath - - name - type: object - type: array - type: object - dns: - description: DNS defines the options for the DNS add-on - installed in the cluster. - properties: - imageRepository: - description: |- - ImageRepository sets the container registry to pull images from. - if not set, the ImageRepository defined in ClusterConfiguration will be used instead. - type: string - imageTag: - description: |- - ImageTag allows to specify a tag for the image. - In case this value is set, kubeadm does not change automatically the version of the above components during upgrades. - type: string - type: object - etcd: - description: |- - Etcd holds configuration for etcd. - NB: This value defaults to a Local (stacked) etcd - properties: - external: - description: |- - External describes how to connect to an external etcd cluster - Local and External are mutually exclusive - properties: - caFile: - description: |- - CAFile is an SSL Certificate Authority file used to secure etcd communication. - Required if using a TLS connection. - type: string - certFile: - description: |- - CertFile is an SSL certification file used to secure etcd communication. - Required if using a TLS connection. - type: string - endpoints: - description: Endpoints of etcd members. Required - for ExternalEtcd. - items: - type: string - type: array - keyFile: - description: |- - KeyFile is an SSL key file used to secure etcd communication. - Required if using a TLS connection. - type: string - required: - - caFile - - certFile - - endpoints - - keyFile - type: object - local: - description: |- - Local provides configuration knobs for configuring the local etcd instance - Local and External are mutually exclusive - properties: - dataDir: - description: |- - DataDir is the directory etcd will place its data. - Defaults to "/var/lib/etcd". - type: string - extraArgs: - additionalProperties: - type: string - description: |- - ExtraArgs are extra arguments provided to the etcd binary - when run inside a static pod. - type: object - imageRepository: - description: |- - ImageRepository sets the container registry to pull images from. - if not set, the ImageRepository defined in ClusterConfiguration will be used instead. - type: string - imageTag: - description: |- - ImageTag allows to specify a tag for the image. - In case this value is set, kubeadm does not change automatically the version of the above components during upgrades. - type: string - peerCertSANs: - description: PeerCertSANs sets extra Subject Alternative - Names for the etcd peer signing cert. - items: - type: string - type: array - serverCertSANs: - description: ServerCertSANs sets extra Subject - Alternative Names for the etcd server signing - cert. - items: - type: string - type: array - type: object - type: object - featureGates: - additionalProperties: - type: boolean - description: FeatureGates enabled by the user. - type: object - imageRepository: - description: |- - ImageRepository sets the container registry to pull images from. - If empty, `registry.k8s.io` will be used by default; in case of kubernetes version is a CI build (kubernetes version starts with `ci/` or `ci-cross/`) - `gcr.io/k8s-staging-ci-images` will be used as a default for control plane components and for kube-proxy, while `registry.k8s.io` - will be used for all the other images. - 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 - kubernetesVersion: - description: |- - KubernetesVersion is the target version of the control plane. - NB: This value defaults to the Machine object spec.version - type: string - networking: - description: |- - Networking holds configuration for the networking topology of the cluster. - NB: This value defaults to the Cluster object spec.clusterNetwork. - properties: - dnsDomain: - description: DNSDomain is the dns domain used by k8s - services. Defaults to "cluster.local". - type: string - podSubnet: - description: |- - PodSubnet is the subnet used by pods. - If unset, the API server will not allocate CIDR ranges for every node. - Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.services.cidrBlocks if that is set - type: string - serviceSubnet: - description: |- - ServiceSubnet is the subnet used by k8s services. - Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.pods.cidrBlocks, or - to "10.96.0.0/12" if that's unset. - type: string - type: object - scheduler: - description: Scheduler contains extra settings for the - scheduler control plane component - properties: - extraArgs: - additionalProperties: - type: string - description: |- - ExtraArgs is an extra set of flags to pass to the control plane component. - TODO: This is temporary and ideally we would like to switch all components to - use ComponentConfig + ConfigMaps. - type: object - extraVolumes: - description: ExtraVolumes is an extra set of host - volumes, mounted to the control plane component. - items: - description: |- - HostPathMount contains elements describing volumes that are mounted from the - host. - properties: - hostPath: - description: |- - HostPath is the path in the host that will be mounted inside - the pod. - type: string - mountPath: - description: MountPath is the path inside the - pod where hostPath will be mounted. - type: string - name: - description: Name of the volume inside the pod - template. - type: string - pathType: - description: PathType is the type of the HostPath. - type: string - readOnly: - description: ReadOnly controls write access - to the volume - type: boolean - required: - - hostPath - - mountPath - - name - type: object - type: array - type: object - type: object - diskSetup: - description: DiskSetup specifies options for the creation - of partition tables and file systems on devices. - properties: - filesystems: - description: Filesystems specifies the list of file systems - to setup. - items: - description: Filesystem defines the file systems to - be created. - properties: - device: - description: Device specifies the device name - type: string - extraOpts: - description: ExtraOpts defined extra options to - add to the command for creating the file system. - items: - type: string - type: array - filesystem: - description: Filesystem specifies the file system - type. - type: string - label: - description: Label specifies the file system label - to be used. If set to None, no label is used. - type: string - overwrite: - description: |- - Overwrite defines whether or not to overwrite any existing filesystem. - If true, any pre-existing file system will be destroyed. Use with Caution. - type: boolean - partition: - description: 'Partition specifies the partition - to use. The valid options are: "auto|any", "auto", - "any", "none", and , where NUM is the actual - partition number.' - type: string - replaceFS: - description: |- - ReplaceFS is a special directive, used for Microsoft Azure that instructs cloud-init to replace a file system of . - NOTE: unless you define a label, this requires the use of the 'any' partition directive. - type: string - required: - - device - - filesystem - - label - type: object - type: array - partitions: - description: Partitions specifies the list of the partitions - to setup. - items: - description: Partition defines how to create and layout - a partition. - properties: - device: - description: Device is the name of the device. - type: string - layout: - description: |- - Layout specifies the device layout. - If it is true, a single partition will be created for the entire device. - When layout is false, it means don't partition or ignore existing partitioning. - type: boolean - overwrite: - description: |- - Overwrite describes whether to skip checks and create the partition if a partition or filesystem is found on the device. - Use with caution. Default is 'false'. - type: boolean - tableType: - description: |- - TableType specifies the tupe of partition table. The following are supported: - 'mbr': default and setups a MS-DOS partition table - 'gpt': setups a GPT partition table - type: string - required: - - device - - layout - type: object - type: array - type: object - files: - description: Files specifies extra files to be passed to user_data - upon creation. - items: - description: File defines the input for generating write_files - in cloud-init. - properties: - content: - description: Content is the actual content of the file. - type: string - contentFrom: - description: ContentFrom is a referenced source of content - to populate the file. - properties: - secret: - description: Secret represents a secret that should - populate this file. - properties: - key: - description: Key is the key in the secret's - data map for this value. - type: string - name: - description: Name of the secret in the KubeadmBootstrapConfig's - namespace to use. - type: string - required: - - key - - name - type: object - required: - - secret - type: object - encoding: - description: Encoding specifies the encoding of the - file contents. - enum: - - base64 - - gzip - - gzip+base64 - type: string - owner: - description: Owner specifies the ownership of the file, - e.g. "root:root". - type: string - path: - description: Path specifies the full path on disk where - to store the file. - type: string - permissions: - description: Permissions specifies the permissions to - assign to the file, e.g. "0640". - type: string - required: - - path - type: object - type: array - format: - description: Format specifies the output format of the bootstrap - data - enum: - - cloud-config - type: string - initConfiguration: - description: InitConfiguration along with ClusterConfiguration - are the configurations necessary for the init command - 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 - bootstrapTokens: - description: |- - BootstrapTokens is respected at `kubeadm init` time and describes a set of Bootstrap Tokens to create. - This information IS NOT uploaded to the kubeadm cluster configmap, partly because of its sensitive nature - items: - description: BootstrapToken describes one bootstrap - token, stored as a Secret in the cluster. - properties: - description: - description: |- - Description sets a human-friendly message why this token exists and what it's used - for, so other administrators can know its purpose. - type: string - expires: - description: |- - Expires specifies the timestamp when this token expires. Defaults to being set - dynamically at runtime based on the TTL. Expires and TTL are mutually exclusive. - format: date-time - type: string - groups: - description: |- - Groups specifies the extra groups that this token will authenticate as when/if - used for authentication - items: - type: string - type: array - token: - description: |- - Token is used for establishing bidirectional trust between nodes and control-planes. - Used for joining nodes in the cluster. - type: string - ttl: - description: |- - TTL defines the time to live for this token. Defaults to 24h. - Expires and TTL are mutually exclusive. - type: string - usages: - description: |- - Usages describes the ways in which this token can be used. Can by default be used - for establishing bidirectional trust, but that can be changed here. - items: - type: string - type: array - required: - - token - type: object - type: array - 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 - localAPIEndpoint: - description: |- - LocalAPIEndpoint represents the endpoint of the API server instance that's deployed on this control plane node - In HA setups, this differs from ClusterConfiguration.ControlPlaneEndpoint in the sense that ControlPlaneEndpoint - is the global endpoint for the cluster, which then loadbalances the requests to each individual API server. This - configuration object lets you customize what IP/DNS name and port the local API server advertises it's accessible - on. By default, kubeadm tries to auto-detect the IP of the default interface and use that, but in case that process - fails you may set the desired value here. - properties: - advertiseAddress: - description: AdvertiseAddress sets the IP address - for the API server to advertise. - type: string - bindPort: - description: |- - BindPort sets the secure port for the API Server to bind to. - Defaults to 6443. - format: int32 - type: integer - type: object - nodeRegistration: - description: |- - NodeRegistration holds fields that relate to registering the new control-plane node to the cluster. - When used in the context of control plane nodes, NodeRegistration should remain consistent - across both InitConfiguration and JoinConfiguration - properties: - criSocket: - description: CRISocket is used to retrieve container - runtime info. This information will be annotated - to the Node API object, for later re-use - type: string - ignorePreflightErrors: - description: IgnorePreflightErrors provides a slice - of pre-flight errors to be ignored when the current - node is registered. - items: - type: string - type: array - kubeletExtraArgs: - additionalProperties: - type: string - description: |- - KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file - kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config-1.X ConfigMap - Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on. - type: object - name: - description: |- - Name is the `.Metadata.Name` field of the Node API object that will be created in this `kubeadm init` or `kubeadm join` operation. - This field is also used in the CommonName field of the kubelet's client certificate to the API server. - Defaults to the hostname of the node if not provided. - type: string - taints: - description: |- - Taints specifies the taints the Node API object should be registered with. If this field is unset, i.e. nil, in the `kubeadm init` process - it will be defaulted to []v1.Taint{'node-role.kubernetes.io/master=""'}. If you don't want to taint your control-plane node, set this field to an - empty slice, i.e. `taints: {}` in the YAML file. This field is solely used for Node registration. - items: - description: |- - The node this Taint is attached to has the "effect" on - any pod that does not tolerate the Taint. - properties: - effect: - description: |- - Required. The effect of the taint on pods - that do not tolerate the taint. - Valid effects are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Required. The taint key to be applied - to a node. - type: string - timeAdded: - description: |- - TimeAdded represents the time at which the taint was added. - It is only written for NoExecute taints. - format: date-time - type: string - value: - description: The taint value corresponding to - the taint key. - type: string - required: - - effect - - key - type: object - type: array - type: object - type: object - joinConfiguration: - description: JoinConfiguration is the kubeadm configuration - for the join command - 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 - caCertPath: - description: |- - CACertPath is the path to the SSL certificate authority used to - secure comunications between node and control-plane. - Defaults to "/etc/kubernetes/pki/ca.crt". - TODO: revisit when there is defaulting from k/k - type: string - controlPlane: - description: |- - ControlPlane defines the additional control plane instance to be deployed on the joining node. - If nil, no additional control plane instance will be deployed. - properties: - localAPIEndpoint: - description: LocalAPIEndpoint represents the endpoint - of the API server instance to be deployed on this - node. - properties: - advertiseAddress: - description: AdvertiseAddress sets the IP address - for the API server to advertise. - type: string - bindPort: - description: |- - BindPort sets the secure port for the API Server to bind to. - Defaults to 6443. - format: int32 - type: integer - type: object - type: object - discovery: - description: |- - Discovery specifies the options for the kubelet to use during the TLS Bootstrap process - TODO: revisit when there is defaulting from k/k - properties: - bootstrapToken: - description: |- - BootstrapToken is used to set the options for bootstrap token based discovery - BootstrapToken and File are mutually exclusive - properties: - apiServerEndpoint: - description: APIServerEndpoint is an IP or domain - name to the API server from which info will - be fetched. - type: string - caCertHashes: - description: |- - CACertHashes specifies a set of public key pins to verify - when token-based discovery is used. The root CA found during discovery - must match one of these values. Specifying an empty set disables root CA - pinning, which can be unsafe. Each hash is specified as ":", - where the only currently supported type is "sha256". This is a hex-encoded - SHA-256 hash of the Subject Public Key Info (SPKI) object in DER-encoded - ASN.1. These hashes can be calculated using, for example, OpenSSL: - openssl x509 -pubkey -in ca.crt openssl rsa -pubin -outform der 2>&/dev/null | openssl dgst -sha256 -hex - items: - type: string - type: array - token: - description: |- - Token is a token used to validate cluster information - fetched from the control-plane. - type: string - unsafeSkipCAVerification: - description: |- - UnsafeSkipCAVerification allows token-based discovery - without CA verification via CACertHashes. This can weaken - the security of kubeadm since other nodes can impersonate the control-plane. - type: boolean - required: - - token - type: object - file: - description: |- - File is used to specify a file or URL to a kubeconfig file from which to load cluster information - BootstrapToken and File are mutually exclusive - properties: - kubeConfigPath: - description: KubeConfigPath is used to specify - the actual file path or URL to the kubeconfig - file from which to load cluster information - type: string - required: - - kubeConfigPath - type: object - timeout: - description: Timeout modifies the discovery timeout - type: string - tlsBootstrapToken: - description: |- - TLSBootstrapToken is a token used for TLS bootstrapping. - If .BootstrapToken is set, this field is defaulted to .BootstrapToken.Token, but can be overridden. - If .File is set, this field **must be set** in case the KubeConfigFile does not contain any other authentication information - type: string - type: object - 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 - nodeRegistration: - description: |- - NodeRegistration holds fields that relate to registering the new control-plane node to the cluster. - When used in the context of control plane nodes, NodeRegistration should remain consistent - across both InitConfiguration and JoinConfiguration - properties: - criSocket: - description: CRISocket is used to retrieve container - runtime info. This information will be annotated - to the Node API object, for later re-use - type: string - ignorePreflightErrors: - description: IgnorePreflightErrors provides a slice - of pre-flight errors to be ignored when the current - node is registered. - items: - type: string - type: array - kubeletExtraArgs: - additionalProperties: - type: string - description: |- - KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file - kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config-1.X ConfigMap - Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on. - type: object - name: - description: |- - Name is the `.Metadata.Name` field of the Node API object that will be created in this `kubeadm init` or `kubeadm join` operation. - This field is also used in the CommonName field of the kubelet's client certificate to the API server. - Defaults to the hostname of the node if not provided. - type: string - taints: - description: |- - Taints specifies the taints the Node API object should be registered with. If this field is unset, i.e. nil, in the `kubeadm init` process - it will be defaulted to []v1.Taint{'node-role.kubernetes.io/master=""'}. If you don't want to taint your control-plane node, set this field to an - empty slice, i.e. `taints: {}` in the YAML file. This field is solely used for Node registration. - items: - description: |- - The node this Taint is attached to has the "effect" on - any pod that does not tolerate the Taint. - properties: - effect: - description: |- - Required. The effect of the taint on pods - that do not tolerate the taint. - Valid effects are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Required. The taint key to be applied - to a node. - type: string - timeAdded: - description: |- - TimeAdded represents the time at which the taint was added. - It is only written for NoExecute taints. - format: date-time - type: string - value: - description: The taint value corresponding to - the taint key. - type: string - required: - - effect - - key - type: object - type: array - type: object - type: object - mounts: - description: Mounts specifies a list of mount points to be - setup. - items: - description: MountPoints defines input for generated mounts - in cloud-init. - items: - type: string - type: array - type: array - ntp: - description: NTP specifies NTP configuration - properties: - enabled: - description: Enabled specifies whether NTP should be enabled - type: boolean - servers: - description: Servers specifies which NTP servers to use - items: - type: string - type: array - type: object - postKubeadmCommands: - description: PostKubeadmCommands specifies extra commands - to run after kubeadm runs - items: - type: string - type: array - preKubeadmCommands: - description: PreKubeadmCommands specifies extra commands to - run before kubeadm runs - items: - type: string - type: array - useExperimentalRetryJoin: - description: |- - UseExperimentalRetryJoin replaces a basic kubeadm command with a shell - script with retries for joins. - - - This is meant to be an experimental temporary workaround on some environments - where joins fail due to timing (and other issues). The long term goal is to add retries to - kubeadm proper and use that functionality. - - - This will add about 40KB to userdata - - - For more information, refer to https://github.com/kubernetes-sigs/cluster-api/pull/2763#discussion_r397306055. - type: boolean - users: - description: Users specifies extra users to add - items: - description: User defines the input for a generated user - in cloud-init. - properties: - gecos: - description: Gecos specifies the gecos to use for the - user - type: string - groups: - description: Groups specifies the additional groups - for the user - type: string - homeDir: - description: HomeDir specifies the home directory to - use for the user - type: string - inactive: - description: Inactive specifies whether to mark the - user as inactive - type: boolean - lockPassword: - description: LockPassword specifies if password login - should be disabled - type: boolean - name: - description: Name specifies the user name - type: string - passwd: - description: Passwd specifies a hashed password for - the user - type: string - primaryGroup: - description: PrimaryGroup specifies the primary group - for the user - type: string - shell: - description: Shell specifies the user's shell - type: string - sshAuthorizedKeys: - description: SSHAuthorizedKeys specifies a list of ssh - authorized keys for the user - items: - type: string - type: array - sudo: - description: Sudo specifies a sudo role for the user - type: string - required: - - name - type: object - type: array - verbosity: - description: |- - Verbosity is the number for the kubeadm log level verbosity. - It overrides the `--v` flag in kubeadm commands. - format: int32 - type: integer - type: object - type: object - required: - - template - type: object - type: object - served: false - storage: false - subresources: {} - additionalPrinterColumns: - description: Time duration since creation of KubeadmConfigTemplate jsonPath: .metadata.creationTimestamp diff --git a/bootstrap/kubeadm/config/crd/kustomization.yaml b/bootstrap/kubeadm/config/crd/kustomization.yaml index 3f3a9e0d1ba1..e87704ac0b17 100644 --- a/bootstrap/kubeadm/config/crd/kustomization.yaml +++ b/bootstrap/kubeadm/config/crd/kustomization.yaml @@ -1,5 +1,4 @@ commonLabels: - cluster.x-k8s.io/v1alpha4: v1alpha4 cluster.x-k8s.io/v1beta1: v1beta1 # This kustomization.yaml is not intended to be run by itself, diff --git a/bootstrap/kubeadm/main.go b/bootstrap/kubeadm/main.go index 8f39d94aa4fb..28e6d789a228 100644 --- a/bootstrap/kubeadm/main.go +++ b/bootstrap/kubeadm/main.go @@ -44,7 +44,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/webhook" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - bootstrapv1alpha4 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" kubeadmbootstrapcontrollers "sigs.k8s.io/cluster-api/bootstrap/kubeadm/controllers" "sigs.k8s.io/cluster-api/bootstrap/kubeadm/internal/webhooks" @@ -89,7 +88,6 @@ func init() { _ = clientgoscheme.AddToScheme(scheme) _ = clusterv1.AddToScheme(scheme) _ = expv1.AddToScheme(scheme) - _ = bootstrapv1alpha4.AddToScheme(scheme) _ = bootstrapv1.AddToScheme(scheme) } diff --git a/cmd/clusterctl/client/cluster/inventory_test.go b/cmd/clusterctl/client/cluster/inventory_test.go index 417f938c1c73..9eaa6f7e29d1 100644 --- a/cmd/clusterctl/client/cluster/inventory_test.go +++ b/cmd/clusterctl/client/cluster/inventory_test.go @@ -27,7 +27,6 @@ import ( "k8s.io/apimachinery/pkg/util/wait" "sigs.k8s.io/controller-runtime/pkg/client" - clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/internal/test" ) @@ -88,6 +87,7 @@ func Test_inventoryClient_CheckInventoryCRDs(t *testing.T) { } var fooProvider = clusterctlv1.Provider{ObjectMeta: metav1.ObjectMeta{Name: "foo", Namespace: "ns1", ResourceVersion: "999"}} +var v1alpha4Contract = "v1alpha4" func Test_inventoryClient_List(t *testing.T) { type fields struct { @@ -302,7 +302,7 @@ func Test_CheckCAPIContract(t *testing.T) { }), }, args: args{ - options: []CheckCAPIContractOption{AllowCAPIContract{Contract: clusterv1alpha4.GroupVersion.Version}, AllowCAPIContract{Contract: test.PreviousCAPIContractNotSupported}}, + options: []CheckCAPIContractOption{AllowCAPIContract{Contract: v1alpha4Contract}, AllowCAPIContract{Contract: test.PreviousCAPIContractNotSupported}}, }, wantErr: false, }, diff --git a/cmd/clusterctl/client/upgrade.go b/cmd/clusterctl/client/upgrade.go index c4f4d0ba2002..5979c9461b72 100644 --- a/cmd/clusterctl/client/upgrade.go +++ b/cmd/clusterctl/client/upgrade.go @@ -24,7 +24,6 @@ import ( "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" clusterctlv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/cluster" @@ -57,11 +56,8 @@ func (c *clusterctlClient) PlanUpgrade(ctx context.Context, options PlanUpgradeO return nil, err } - // Ensure this command only runs against management clusters with the current Cluster API contract (default) or the previous one. - if err := clusterClient.ProviderInventory().CheckCAPIContract( - ctx, - cluster.AllowCAPIContract{Contract: clusterv1alpha4.GroupVersion.Version}, - ); err != nil { + // Ensure this command only runs against management clusters with the current Cluster API contract. + if err := clusterClient.ProviderInventory().CheckCAPIContract(ctx); err != nil { return nil, err } @@ -146,11 +142,8 @@ func (c *clusterctlClient) ApplyUpgrade(ctx context.Context, options ApplyUpgrad return err } - // Ensure this command only runs against management clusters with the current Cluster API contract (default) or the previous one. - if err := clusterClient.ProviderInventory().CheckCAPIContract( - ctx, - cluster.AllowCAPIContract{Contract: clusterv1alpha4.GroupVersion.Version}, - ); err != nil { + // Ensure this command only runs against management clusters with the current Cluster API contract. + if err := clusterClient.ProviderInventory().CheckCAPIContract(ctx); err != nil { return err } diff --git a/cmd/clusterctl/internal/test/contracts.go b/cmd/clusterctl/internal/test/contracts.go index 6b032b2c566e..ba8ab44a988b 100644 --- a/cmd/clusterctl/internal/test/contracts.go +++ b/cmd/clusterctl/internal/test/contracts.go @@ -17,12 +17,11 @@ limitations under the License. package test import ( - clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) // PreviousCAPIContractNotSupported define the previous Cluster API contract, not supported by this release of clusterctl. -var PreviousCAPIContractNotSupported = clusterv1alpha4.GroupVersion.Version +var PreviousCAPIContractNotSupported = "v1alpha4" // CurrentCAPIContract define the current Cluster API contract. var CurrentCAPIContract = clusterv1.GroupVersion.Version diff --git a/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml b/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml index 0e0e0cfb6ecc..30e4666a4b4a 100644 --- a/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml +++ b/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesetbindings.yaml @@ -16,102 +16,6 @@ spec: singular: clusterresourcesetbinding scope: Namespaced versions: - - additionalPrinterColumns: - - description: Time duration since creation of ClusterResourceSetBinding - jsonPath: .metadata.creationTimestamp - name: Age - type: date - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - ClusterResourceSetBinding lists all matching ClusterResourceSets with the cluster it belongs to. - - - Deprecated: This type will be removed in one of the next releases. - 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: ClusterResourceSetBindingSpec defines the desired state of - ClusterResourceSetBinding. - properties: - bindings: - description: Bindings is a list of ClusterResourceSets and their resources. - items: - description: ResourceSetBinding keeps info on all of the resources - in a ClusterResourceSet. - properties: - clusterResourceSetName: - description: ClusterResourceSetName is the name of the ClusterResourceSet - that is applied to the owner cluster of the binding. - type: string - resources: - description: Resources is a list of resources that the ClusterResourceSet - has. - items: - description: ResourceBinding shows the status of a resource - that belongs to a ClusterResourceSet matched by the owner - cluster of the ClusterResourceSetBinding object. - properties: - applied: - description: Applied is to track if a resource is applied - to the cluster or not. - type: boolean - hash: - description: |- - Hash is the hash of a resource's data. This can be used to decide if a resource is changed. - For "ApplyOnce" ClusterResourceSet.spec.strategy, this is no-op as that strategy does not act on change. - type: string - kind: - description: 'Kind of the resource. Supported kinds are: - Secrets and ConfigMaps.' - enum: - - Secret - - ConfigMap - type: string - lastAppliedTime: - description: LastAppliedTime identifies when this resource - was last applied to the cluster. - format: date-time - type: string - name: - description: Name of the resource that is in the same - namespace with ClusterResourceSet object. - minLength: 1 - type: string - required: - - applied - - kind - - name - type: object - type: array - required: - - clusterResourceSetName - type: object - type: array - type: object - type: object - served: false - storage: false - subresources: - status: {} - additionalPrinterColumns: - description: Time duration since creation of ClusterResourceSetBinding jsonPath: .metadata.creationTimestamp diff --git a/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml b/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml index 8162fcdc3e74..bf685bb567a9 100644 --- a/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml +++ b/config/crd/bases/addons.cluster.x-k8s.io_clusterresourcesets.yaml @@ -16,179 +16,6 @@ spec: singular: clusterresourceset scope: Namespaced versions: - - additionalPrinterColumns: - - description: Time duration since creation of ClusterResourceSet - jsonPath: .metadata.creationTimestamp - name: Age - type: date - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - ClusterResourceSet is the Schema for the clusterresourcesets API. - - - Deprecated: This type will be removed in one of the next releases. - 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: ClusterResourceSetSpec defines the desired state of ClusterResourceSet. - properties: - clusterSelector: - description: |- - Label selector for Clusters. The Clusters that are - selected by this will be the ones affected by this ClusterResourceSet. - It must match the Cluster labels. This field is immutable. - Label selector cannot be empty. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. - The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector applies - to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - resources: - description: Resources is a list of Secrets/ConfigMaps where each - contains 1 or more resources to be applied to remote clusters. - items: - description: ResourceRef specifies a resource. - properties: - kind: - description: 'Kind of the resource. Supported kinds are: Secrets - and ConfigMaps.' - enum: - - Secret - - ConfigMap - type: string - name: - description: Name of the resource that is in the same namespace - with ClusterResourceSet object. - minLength: 1 - type: string - required: - - kind - - name - type: object - type: array - strategy: - description: Strategy is the strategy to be used during applying resources. - Defaults to ApplyOnce. This field is immutable. - enum: - - ApplyOnce - type: string - required: - - clusterSelector - type: object - status: - description: ClusterResourceSetStatus defines the observed state of ClusterResourceSet. - properties: - conditions: - description: Conditions defines current state of the ClusterResourceSet. - 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 - observedGeneration: - description: ObservedGeneration reflects the generation of the most - recently observed ClusterResourceSet. - format: int64 - type: integer - type: object - type: object - served: false - storage: false - subresources: - status: {} - additionalPrinterColumns: - description: Time duration since creation of ClusterResourceSet jsonPath: .metadata.creationTimestamp diff --git a/config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml b/config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml index 4c0533672220..4a4afc49eb36 100644 --- a/config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml +++ b/config/crd/bases/cluster.x-k8s.io_clusterclasses.yaml @@ -18,411 +18,6 @@ spec: singular: clusterclass scope: Namespaced versions: - - additionalPrinterColumns: - - description: Time duration since creation of ClusterClass - jsonPath: .metadata.creationTimestamp - name: Age - type: date - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - ClusterClass is a template which can be used to create managed topologies. - - - Deprecated: This type will be removed in one of the next releases. - 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: ClusterClassSpec describes the desired state of the ClusterClass. - properties: - controlPlane: - description: |- - ControlPlane is a reference to a local struct that holds the details - for provisioning the Control Plane for the Cluster. - properties: - machineInfrastructure: - description: |- - MachineTemplate defines the metadata and infrastructure information - for control plane machines. - - - This field is supported if and only if the control plane provider template - referenced above is Machine based and supports setting replicas. - properties: - ref: - description: |- - Ref is a required reference to a custom resource - offered by a provider. - 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 - required: - - ref - type: object - metadata: - description: |- - Metadata is the metadata applied to the machines of the ControlPlane. - At runtime this metadata is merged with the corresponding metadata from the topology. - - - This field is supported if and only if the control plane provider template - referenced is Machine based. - 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 - ref: - description: |- - Ref is a required reference to a custom resource - offered by a provider. - 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 - required: - - ref - type: object - infrastructure: - description: |- - Infrastructure is a reference to a provider-specific template that holds - the details for provisioning infrastructure specific cluster - for the underlying provider. - The underlying provider is responsible for the implementation - of the template to an infrastructure cluster. - properties: - ref: - description: |- - Ref is a required reference to a custom resource - offered by a provider. - 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 - required: - - ref - type: object - workers: - description: |- - Workers describes the worker nodes for the cluster. - It is a collection of node types which can be used to create - the worker nodes of the cluster. - properties: - machineDeployments: - description: |- - MachineDeployments is a list of machine deployment classes that can be used to create - a set of worker nodes. - items: - description: |- - MachineDeploymentClass serves as a template to define a set of worker nodes of the cluster - provisioned using the `ClusterClass`. - properties: - class: - description: |- - Class denotes a type of worker node present in the cluster, - this name MUST be unique within a ClusterClass and can be referenced - in the Cluster to create a managed MachineDeployment. - type: string - template: - description: |- - Template is a local struct containing a collection of templates for creation of - MachineDeployment objects representing a set of worker nodes. - properties: - bootstrap: - description: |- - Bootstrap contains the bootstrap template reference to be used - for the creation of worker Machines. - properties: - ref: - description: |- - Ref is a required reference to a custom resource - offered by a provider. - 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 - required: - - ref - type: object - infrastructure: - description: |- - Infrastructure contains the infrastructure template reference to be used - for the creation of worker Machines. - properties: - ref: - description: |- - Ref is a required reference to a custom resource - offered by a provider. - 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 - required: - - ref - type: object - metadata: - description: |- - Metadata is the metadata applied to the machines of the MachineDeployment. - At runtime this metadata is merged with the corresponding metadata from the topology. - 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 - required: - - bootstrap - - infrastructure - type: object - required: - - class - - template - type: object - type: array - type: object - type: object - type: object - served: false - storage: false - subresources: {} - additionalPrinterColumns: - description: Time duration since creation of ClusterClass jsonPath: .metadata.creationTimestamp diff --git a/config/crd/bases/cluster.x-k8s.io_clusters.yaml b/config/crd/bases/cluster.x-k8s.io_clusters.yaml index dab896bd144c..bcf8523db055 100644 --- a/config/crd/bases/cluster.x-k8s.io_clusters.yaml +++ b/config/crd/bases/cluster.x-k8s.io_clusters.yaml @@ -18,419 +18,6 @@ spec: singular: cluster scope: Namespaced versions: - - additionalPrinterColumns: - - description: Time duration since creation of Cluster - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - description: Cluster status such as Pending/Provisioning/Provisioned/Deleting/Failed - jsonPath: .status.phase - name: Phase - type: string - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - Cluster is the Schema for the clusters API. - - - Deprecated: This type will be removed in one of the next releases. - 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: ClusterSpec defines the desired state of Cluster. - properties: - clusterNetwork: - description: Cluster network configuration. - properties: - apiServerPort: - description: |- - APIServerPort specifies the port the API Server should bind to. - Defaults to 6443. - format: int32 - type: integer - pods: - description: The network ranges from which Pod networks are allocated. - properties: - cidrBlocks: - items: - type: string - type: array - required: - - cidrBlocks - type: object - serviceDomain: - description: Domain name for services. - type: string - services: - description: The network ranges from which service VIPs are allocated. - properties: - cidrBlocks: - items: - type: string - type: array - required: - - cidrBlocks - type: object - type: object - controlPlaneEndpoint: - description: ControlPlaneEndpoint represents the endpoint used to - communicate with the control plane. - 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 - controlPlaneRef: - description: |- - ControlPlaneRef is an optional reference to a provider-specific resource that holds - the details for provisioning the Control Plane for a Cluster. - 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 - infrastructureRef: - description: |- - InfrastructureRef is a reference to a provider-specific resource that holds the details - for provisioning infrastructure for a cluster in said provider. - 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 - paused: - description: Paused can be used to prevent controllers from processing - the Cluster and all its associated objects. - type: boolean - topology: - description: |- - This encapsulates the topology for the cluster. - NOTE: It is required to enable the ClusterTopology - feature gate flag to activate managed topologies support; - this feature is highly experimental, and parts of it might still be not implemented. - properties: - class: - description: The name of the ClusterClass object to create the - topology. - type: string - controlPlane: - description: ControlPlane describes the cluster control plane. - properties: - metadata: - description: |- - Metadata is the metadata applied to the machines of the ControlPlane. - At runtime this metadata is merged with the corresponding metadata from the ClusterClass. - - - This field is supported if and only if the control plane provider template - referenced in the ClusterClass is Machine based. - 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 - replicas: - description: |- - Replicas is the number of control plane nodes. - If the value is nil, the ControlPlane object is created without the number of Replicas - and it's assumed that the control plane controller does not implement support for this field. - When specified against a control plane provider that lacks support for this field, this value will be ignored. - format: int32 - type: integer - type: object - rolloutAfter: - description: |- - RolloutAfter performs a rollout of the entire cluster one component at a time, - control plane first and then machine deployments. - format: date-time - type: string - version: - description: The Kubernetes version of the cluster. - type: string - workers: - description: |- - Workers encapsulates the different constructs that form the worker nodes - for the cluster. - properties: - machineDeployments: - description: MachineDeployments is a list of machine deployments - in the cluster. - items: - description: |- - MachineDeploymentTopology specifies the different parameters for a set of worker nodes in the topology. - This set of nodes is managed by a MachineDeployment object whose lifecycle is managed by the Cluster controller. - properties: - class: - description: |- - Class is the name of the MachineDeploymentClass used to create the set of worker nodes. - This should match one of the deployment classes defined in the ClusterClass object - mentioned in the `Cluster.Spec.Class` field. - type: string - metadata: - description: |- - Metadata is the metadata applied to the machines of the MachineDeployment. - At runtime this metadata is merged with the corresponding metadata from the ClusterClass. - 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 - name: - description: |- - Name is the unique identifier for this MachineDeploymentTopology. - The value is used with other unique identifiers to create a MachineDeployment's Name - (e.g. cluster's name, etc). In case the name is greater than the allowed maximum length, - the values are hashed together. - type: string - replicas: - description: |- - Replicas is the number of worker nodes belonging to this set. - If the value is nil, the MachineDeployment is created without the number of Replicas (defaulting to zero) - and it's assumed that an external entity (like cluster autoscaler) is responsible for the management - of this value. - format: int32 - type: integer - required: - - class - - name - type: object - type: array - type: object - required: - - class - - version - type: object - type: object - status: - description: ClusterStatus defines the observed state of Cluster. - properties: - conditions: - description: Conditions defines current service state of the cluster. - 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 - controlPlaneReady: - description: ControlPlaneReady defines if the control plane is ready. - type: boolean - 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 failure domain objects synced - from the infrastructure provider. - type: object - failureMessage: - description: |- - FailureMessage indicates that there is a fatal problem reconciling the - state, and will be set to a descriptive error message. - type: string - failureReason: - description: |- - FailureReason indicates that there is a fatal problem reconciling the - state, and will be set to a token value suitable for - programmatic interpretation. - type: string - infrastructureReady: - description: InfrastructureReady is the state of the infrastructure - provider. - type: boolean - observedGeneration: - description: ObservedGeneration is the latest generation observed - by the controller. - format: int64 - type: integer - phase: - description: |- - Phase represents the current phase of cluster actuation. - E.g. Pending, Running, Terminating, Failed etc. - type: string - type: object - type: object - served: false - storage: false - subresources: - status: {} - additionalPrinterColumns: - description: ClusterClass of this Cluster, empty if the Cluster is not using a ClusterClass diff --git a/config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml b/config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml index d0f75bf37d40..de60bab6b549 100644 --- a/config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machinedeployments.yaml @@ -18,503 +18,6 @@ spec: singular: machinedeployment scope: Namespaced versions: - - additionalPrinterColumns: - - description: Cluster - jsonPath: .spec.clusterName - name: Cluster - type: string - - description: Time duration since creation of MachineDeployment - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - description: MachineDeployment status such as ScalingUp/ScalingDown/Running/Failed/Unknown - jsonPath: .status.phase - name: Phase - type: string - - description: Total number of non-terminated machines targeted by this MachineDeployment - jsonPath: .status.replicas - name: Replicas - type: integer - - description: Total number of ready machines targeted by this MachineDeployment - jsonPath: .status.readyReplicas - name: Ready - type: integer - - description: Total number of non-terminated machines targeted by this deployment - that have the desired template spec - jsonPath: .status.updatedReplicas - name: Updated - type: integer - - description: Total number of unavailable machines targeted by this MachineDeployment - jsonPath: .status.unavailableReplicas - name: Unavailable - type: integer - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - MachineDeployment is the Schema for the machinedeployments API. - - - Deprecated: This type will be removed in one of the next releases. - 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: MachineDeploymentSpec defines the desired state of MachineDeployment. - properties: - clusterName: - description: ClusterName is the name of the Cluster this object belongs - to. - minLength: 1 - type: string - minReadySeconds: - description: |- - Minimum number of seconds for which a newly created machine should - be ready. - Defaults to 0 (machine will be considered available as soon as it - is ready) - format: int32 - type: integer - paused: - description: Indicates that the deployment is paused. - type: boolean - progressDeadlineSeconds: - description: |- - The maximum time in seconds for a deployment to make progress before it - is considered to be failed. The deployment controller will continue to - process failed deployments and a condition with a ProgressDeadlineExceeded - reason will be surfaced in the deployment status. Note that progress will - not be estimated during the time a deployment is paused. Defaults to 600s. - format: int32 - type: integer - replicas: - default: 1 - description: |- - Number of desired machines. Defaults to 1. - This is a pointer to distinguish between explicit zero and not specified. - format: int32 - type: integer - revisionHistoryLimit: - description: |- - The number of old MachineSets to retain to allow rollback. - This is a pointer to distinguish between explicit zero and not specified. - Defaults to 1. - format: int32 - type: integer - selector: - description: |- - Label selector for machines. Existing MachineSets whose machines are - selected by this will be the ones affected by this deployment. - It must match the machine template's labels. - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. - The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector applies - to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - strategy: - description: |- - The deployment strategy to use to replace existing machines with - new ones. - properties: - rollingUpdate: - description: |- - Rolling update config params. Present only if - MachineDeploymentStrategyType = RollingUpdate. - properties: - deletePolicy: - description: |- - DeletePolicy defines the policy used by the MachineDeployment to identify nodes to delete when downscaling. - Valid values are "Random, "Newest", "Oldest" - When no value is supplied, the default DeletePolicy of MachineSet is used - enum: - - Random - - Newest - - Oldest - type: string - maxSurge: - anyOf: - - type: integer - - type: string - description: |- - The maximum number of machines that can be scheduled above the - desired number of machines. - Value can be an absolute number (ex: 5) or a percentage of - desired machines (ex: 10%). - This can not be 0 if MaxUnavailable is 0. - Absolute number is calculated from percentage by rounding up. - Defaults to 1. - Example: when this is set to 30%, the new MachineSet can be scaled - up immediately when the rolling update starts, such that the total - number of old and new machines do not exceed 130% of desired - machines. Once old machines have been killed, new MachineSet can - be scaled up further, ensuring that total number of machines running - at any time during the update is at most 130% of desired machines. - x-kubernetes-int-or-string: true - maxUnavailable: - anyOf: - - type: integer - - type: string - description: |- - The maximum number of machines that can be unavailable during the update. - Value can be an absolute number (ex: 5) or a percentage of desired - machines (ex: 10%). - Absolute number is calculated from percentage by rounding down. - This can not be 0 if MaxSurge is 0. - Defaults to 0. - Example: when this is set to 30%, the old MachineSet can be scaled - down to 70% of desired machines immediately when the rolling update - starts. Once new machines are ready, old MachineSet can be scaled - down further, followed by scaling up the new MachineSet, ensuring - that the total number of machines available at all times - during the update is at least 70% of desired machines. - x-kubernetes-int-or-string: true - type: object - type: - description: |- - Type of deployment. - Default is RollingUpdate. - enum: - - RollingUpdate - - OnDelete - type: string - type: object - template: - description: Template describes the machines that will be created. - properties: - metadata: - description: |- - Standard object's metadata. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - 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: |- - Specification of the desired behavior of the machine. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - properties: - bootstrap: - description: |- - Bootstrap is a reference to a local struct which encapsulates - fields to configure the Machine’s bootstrapping mechanism. - properties: - configRef: - description: |- - ConfigRef is a reference to a bootstrap provider-specific resource - that holds configuration details. The reference is optional to - allow users/operators to specify Bootstrap.DataSecretName without - the need of a controller. - 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 - dataSecretName: - description: |- - DataSecretName is the name of the secret that stores the bootstrap data script. - If nil, the Machine should remain in the Pending state. - type: string - type: object - clusterName: - description: ClusterName is the name of the Cluster this object - belongs to. - minLength: 1 - type: string - failureDomain: - description: |- - FailureDomain is the failure domain the machine will be created in. - Must match a key in the FailureDomains map stored on the cluster object. - type: string - infrastructureRef: - description: |- - InfrastructureRef is a required reference to a custom resource - offered by an infrastructure provider. - 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 - nodeDrainTimeout: - description: |- - NodeDrainTimeout is the total amount of time that the controller will spend on draining a node. - The default value is 0, meaning that the node can be drained without any time limitations. - NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` - type: string - providerID: - description: |- - ProviderID is the identification ID of the machine provided by the provider. - This field must match the provider ID as seen on the node object corresponding to this machine. - This field is required by higher level consumers of cluster-api. Example use case is cluster autoscaler - with cluster-api as provider. Clean-up logic in the autoscaler compares machines to nodes to find out - machines at provider which could not get registered as Kubernetes nodes. With cluster-api as a - generic out-of-tree provider for autoscaler, this field is required by autoscaler to be - able to have a provider view of the list of machines. Another list of nodes is queried from the k8s apiserver - and then a comparison is done to find out unregistered machines and are marked for delete. - This field will be set by the actuators and consumed by higher level entities like autoscaler that will - be interfacing with cluster-api as generic provider. - type: string - version: - description: |- - Version defines the desired Kubernetes version. - This field is meant to be optionally used by bootstrap providers. - type: string - required: - - bootstrap - - clusterName - - infrastructureRef - type: object - type: object - required: - - clusterName - - selector - - template - type: object - status: - description: MachineDeploymentStatus defines the observed state of MachineDeployment. - properties: - availableReplicas: - description: |- - Total number of available machines (ready for at least minReadySeconds) - targeted by this deployment. - format: int32 - type: integer - conditions: - description: Conditions defines current service state of the MachineDeployment. - 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 - observedGeneration: - description: The generation observed by the deployment controller. - format: int64 - type: integer - phase: - description: Phase represents the current phase of a MachineDeployment - (ScalingUp, ScalingDown, Running, Failed, or Unknown). - type: string - readyReplicas: - description: Total number of ready machines targeted by this deployment. - format: int32 - type: integer - replicas: - description: |- - Total number of non-terminated machines targeted by this deployment - (their labels match the selector). - format: int32 - type: integer - selector: - description: |- - Selector is the same as the label selector but in the string format to avoid introspection - by clients. The string will be in the same format as the query-param syntax. - More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors - type: string - unavailableReplicas: - description: |- - Total number of unavailable machines targeted by this deployment. - This is the total number of machines that are still required for - the deployment to have 100% available capacity. They may either - be machines that are running but not yet available or machines - that still have not been created. - format: int32 - type: integer - updatedReplicas: - description: |- - Total number of non-terminated machines targeted by this deployment - that have the desired template spec. - format: int32 - type: integer - type: object - type: object - served: false - storage: false - subresources: - scale: - labelSelectorPath: .status.selector - specReplicasPath: .spec.replicas - statusReplicasPath: .status.replicas - status: {} - additionalPrinterColumns: - description: Cluster jsonPath: .spec.clusterName diff --git a/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml b/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml index ce66fb74035b..c0641371553d 100644 --- a/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machinehealthchecks.yaml @@ -19,296 +19,6 @@ spec: singular: machinehealthcheck scope: Namespaced versions: - - additionalPrinterColumns: - - description: Cluster - jsonPath: .spec.clusterName - name: Cluster - type: string - - description: Time duration since creation of MachineHealthCheck - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - description: Maximum number of unhealthy machines allowed - jsonPath: .spec.maxUnhealthy - name: MaxUnhealthy - type: string - - description: Number of machines currently monitored - jsonPath: .status.expectedMachines - name: ExpectedMachines - type: integer - - description: Current observed healthy machines - jsonPath: .status.currentHealthy - name: CurrentHealthy - type: integer - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - MachineHealthCheck is the Schema for the machinehealthchecks API. - - - Deprecated: This type will be removed in one of the next releases. - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: Specification of machine health check policy - properties: - clusterName: - description: ClusterName is the name of the Cluster this object belongs - to. - minLength: 1 - type: string - maxUnhealthy: - anyOf: - - type: integer - - type: string - description: |- - Any further remediation is only allowed if at most "MaxUnhealthy" machines selected by - "selector" are not healthy. - x-kubernetes-int-or-string: true - nodeStartupTimeout: - description: |- - Machines older than this duration without a node will be considered to have - failed and will be remediated. - If not set, this value is defaulted to 10 minutes. - If you wish to disable this feature, set the value explicitly to 0. - type: string - remediationTemplate: - description: |- - RemediationTemplate is a reference to a remediation template - provided by an infrastructure provider. - - - This field is completely optional, when filled, the MachineHealthCheck controller - creates a new object from the template referenced and hands off remediation of the machine to - a controller that lives outside of Cluster API. - 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 - selector: - description: Label selector to match machines whose health will be - exercised - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. - The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector applies - to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - unhealthyConditions: - description: |- - UnhealthyConditions contains a list of the conditions that determine - whether a node is considered unhealthy. The conditions are combined in a - logical OR, i.e. if any of the conditions is met, the node is unhealthy. - items: - description: |- - UnhealthyCondition represents a Node condition type and value with a timeout - specified as a duration. When the named condition has been in the given - status for at least the timeout value, a node is considered unhealthy. - properties: - status: - minLength: 1 - type: string - timeout: - type: string - type: - minLength: 1 - type: string - required: - - status - - timeout - - type - type: object - minItems: 1 - type: array - unhealthyRange: - description: |- - Any further remediation is only allowed if the number of machines selected by "selector" as not healthy - is within the range of "UnhealthyRange". Takes precedence over MaxUnhealthy. - Eg. "[3-5]" - This means that remediation will be allowed only when: - (a) there are at least 3 unhealthy machines (and) - (b) there are at most 5 unhealthy machines - pattern: ^\[[0-9]+-[0-9]+\]$ - type: string - required: - - clusterName - - selector - - unhealthyConditions - type: object - status: - description: Most recently observed status of MachineHealthCheck resource - properties: - conditions: - description: Conditions defines current service state of the MachineHealthCheck. - 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 - currentHealthy: - description: total number of healthy machines counted by this machine - health check - format: int32 - minimum: 0 - type: integer - expectedMachines: - description: total number of machines counted by this machine health - check - format: int32 - minimum: 0 - type: integer - observedGeneration: - description: ObservedGeneration is the latest generation observed - by the controller. - format: int64 - type: integer - remediationsAllowed: - description: |- - RemediationsAllowed is the number of further remediations allowed by this machine health check before - maxUnhealthy short circuiting will be applied - format: int32 - minimum: 0 - type: integer - targets: - description: Targets shows the current list of machines the machine - health check is watching - items: - type: string - type: array - type: object - type: object - served: false - storage: false - subresources: - status: {} - additionalPrinterColumns: - description: Cluster jsonPath: .spec.clusterName diff --git a/config/crd/bases/cluster.x-k8s.io_machinepools.yaml b/config/crd/bases/cluster.x-k8s.io_machinepools.yaml index 9899e48f7026..b5c0f3cc62f5 100644 --- a/config/crd/bases/cluster.x-k8s.io_machinepools.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machinepools.yaml @@ -18,439 +18,6 @@ spec: singular: machinepool scope: Namespaced versions: - - additionalPrinterColumns: - - description: Time duration since creation of MachinePool - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - description: MachinePool replicas count - jsonPath: .status.replicas - name: Replicas - type: string - - description: MachinePool status such as Terminating/Pending/Provisioning/Running/Failed - etc - jsonPath: .status.phase - name: Phase - type: string - - description: Kubernetes version associated with this MachinePool - jsonPath: .spec.template.spec.version - name: Version - type: string - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - MachinePool is the Schema for the machinepools API. - - - Deprecated: This type will be removed in one of the next releases. - 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: MachinePoolSpec defines the desired state of MachinePool. - properties: - clusterName: - description: ClusterName is the name of the Cluster this object belongs - to. - minLength: 1 - type: string - failureDomains: - description: FailureDomains is the list of failure domains this MachinePool - should be attached to. - items: - type: string - type: array - minReadySeconds: - description: |- - Minimum number of seconds for which a newly created machine instances should - be ready. - Defaults to 0 (machine instance will be considered available as soon as it - is ready) - format: int32 - type: integer - providerIDList: - description: |- - ProviderIDList are the identification IDs of machine instances provided by the provider. - This field must match the provider IDs as seen on the node objects corresponding to a machine pool's machine instances. - items: - type: string - type: array - replicas: - description: |- - Number of desired machines. Defaults to 1. - This is a pointer to distinguish between explicit zero and not specified. - format: int32 - type: integer - template: - description: Template describes the machines that will be created. - properties: - metadata: - description: |- - Standard object's metadata. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - 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: |- - Specification of the desired behavior of the machine. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - properties: - bootstrap: - description: |- - Bootstrap is a reference to a local struct which encapsulates - fields to configure the Machine’s bootstrapping mechanism. - properties: - configRef: - description: |- - ConfigRef is a reference to a bootstrap provider-specific resource - that holds configuration details. The reference is optional to - allow users/operators to specify Bootstrap.DataSecretName without - the need of a controller. - 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 - dataSecretName: - description: |- - DataSecretName is the name of the secret that stores the bootstrap data script. - If nil, the Machine should remain in the Pending state. - type: string - type: object - clusterName: - description: ClusterName is the name of the Cluster this object - belongs to. - minLength: 1 - type: string - failureDomain: - description: |- - FailureDomain is the failure domain the machine will be created in. - Must match a key in the FailureDomains map stored on the cluster object. - type: string - infrastructureRef: - description: |- - InfrastructureRef is a required reference to a custom resource - offered by an infrastructure provider. - 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 - nodeDrainTimeout: - description: |- - NodeDrainTimeout is the total amount of time that the controller will spend on draining a node. - The default value is 0, meaning that the node can be drained without any time limitations. - NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` - type: string - providerID: - description: |- - ProviderID is the identification ID of the machine provided by the provider. - This field must match the provider ID as seen on the node object corresponding to this machine. - This field is required by higher level consumers of cluster-api. Example use case is cluster autoscaler - with cluster-api as provider. Clean-up logic in the autoscaler compares machines to nodes to find out - machines at provider which could not get registered as Kubernetes nodes. With cluster-api as a - generic out-of-tree provider for autoscaler, this field is required by autoscaler to be - able to have a provider view of the list of machines. Another list of nodes is queried from the k8s apiserver - and then a comparison is done to find out unregistered machines and are marked for delete. - This field will be set by the actuators and consumed by higher level entities like autoscaler that will - be interfacing with cluster-api as generic provider. - type: string - version: - description: |- - Version defines the desired Kubernetes version. - This field is meant to be optionally used by bootstrap providers. - type: string - required: - - bootstrap - - clusterName - - infrastructureRef - type: object - type: object - required: - - clusterName - - template - type: object - status: - description: MachinePoolStatus defines the observed state of MachinePool. - properties: - availableReplicas: - description: The number of available replicas (ready for at least - minReadySeconds) for this MachinePool. - format: int32 - type: integer - bootstrapReady: - description: BootstrapReady is the state of the bootstrap provider. - type: boolean - conditions: - description: Conditions define the current service state of the MachinePool. - 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: |- - FailureMessage indicates that there is a problem reconciling the state, - and will be set to a descriptive error message. - type: string - failureReason: - description: |- - FailureReason indicates that there is a problem reconciling the state, and - will be set to a token value suitable for programmatic interpretation. - type: string - infrastructureReady: - description: InfrastructureReady is the state of the infrastructure - provider. - type: boolean - nodeRefs: - description: NodeRefs will point to the corresponding Nodes if it - they exist. - items: - description: |- - ObjectReference contains enough information to let you inspect or modify the referred object. - --- - New uses of this type are discouraged because of difficulty describing its usage when embedded in APIs. - 1. Ignored fields. It includes many fields which are not generally honored. For instance, ResourceVersion and FieldPath are both very rarely valid in actual usage. - 2. Invalid usage help. It is impossible to add specific help for individual usage. In most embedded usages, there are particular - restrictions like, "must refer only to types A and B" or "UID not honored" or "name must be restricted". - Those cannot be well described when embedded. - 3. Inconsistent validation. Because the usages are different, the validation rules are different by usage, which makes it hard for users to predict what will happen. - 4. The fields are both imprecise and overly precise. Kind is not a precise mapping to a URL. This can produce ambiguity - during interpretation and require a REST mapping. In most cases, the dependency is on the group,resource tuple - and the version of the actual struct is irrelevant. - 5. We cannot easily change it. Because this type is embedded in many locations, updates to this type - will affect numerous schemas. Don't make new APIs embed an underspecified API type they do not control. - - - Instead of using this type, create a locally provided and used type that is well-focused on your reference. - For example, ServiceReferences for admission registration: https://github.com/kubernetes/api/blob/release-1.17/admissionregistration/v1/types.go#L533 . - 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 - type: array - observedGeneration: - description: ObservedGeneration is the latest generation observed - by the controller. - format: int64 - type: integer - phase: - description: |- - Phase represents the current phase of cluster actuation. - E.g. Pending, Running, Terminating, Failed etc. - type: string - readyReplicas: - description: The number of ready replicas for this MachinePool. A - machine is considered ready when the node has been created and is - "Ready". - format: int32 - type: integer - replicas: - description: Replicas is the most recently observed number of replicas. - format: int32 - type: integer - unavailableReplicas: - description: |- - Total number of unavailable machine instances targeted by this machine pool. - This is the total number of machine instances that are still required for - the machine pool to have 100% available capacity. They may either - be machine instances that are running but not yet available or machine instances - that still have not been created. - format: int32 - type: integer - type: object - type: object - served: false - storage: false - subresources: - scale: - specReplicasPath: .spec.replicas - statusReplicasPath: .status.replicas - status: {} - additionalPrinterColumns: - description: Cluster jsonPath: .spec.clusterName diff --git a/config/crd/bases/cluster.x-k8s.io_machines.yaml b/config/crd/bases/cluster.x-k8s.io_machines.yaml index 14fc4efadfdf..61394998631c 100644 --- a/config/crd/bases/cluster.x-k8s.io_machines.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machines.yaml @@ -18,450 +18,6 @@ spec: singular: machine scope: Namespaced versions: - - additionalPrinterColumns: - - description: Cluster - jsonPath: .spec.clusterName - name: Cluster - type: string - - description: Time duration since creation of Machine - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - description: Provider ID - jsonPath: .spec.providerID - name: ProviderID - type: string - - description: Machine status such as Terminating/Pending/Running/Failed etc - jsonPath: .status.phase - name: Phase - type: string - - description: Kubernetes version associated with this Machine - jsonPath: .spec.version - name: Version - type: string - - description: Node name associated with this machine - jsonPath: .status.nodeRef.name - name: NodeName - priority: 1 - type: string - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - Machine is the Schema for the machines API. - - - Deprecated: This type will be removed in one of the next releases. - 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: MachineSpec defines the desired state of Machine. - properties: - bootstrap: - description: |- - Bootstrap is a reference to a local struct which encapsulates - fields to configure the Machine’s bootstrapping mechanism. - properties: - configRef: - description: |- - ConfigRef is a reference to a bootstrap provider-specific resource - that holds configuration details. The reference is optional to - allow users/operators to specify Bootstrap.DataSecretName without - the need of a controller. - 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 - dataSecretName: - description: |- - DataSecretName is the name of the secret that stores the bootstrap data script. - If nil, the Machine should remain in the Pending state. - type: string - type: object - clusterName: - description: ClusterName is the name of the Cluster this object belongs - to. - minLength: 1 - type: string - failureDomain: - description: |- - FailureDomain is the failure domain the machine will be created in. - Must match a key in the FailureDomains map stored on the cluster object. - type: string - infrastructureRef: - description: |- - InfrastructureRef is a required reference to a custom resource - offered by an infrastructure provider. - 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 - nodeDrainTimeout: - description: |- - NodeDrainTimeout is the total amount of time that the controller will spend on draining a node. - The default value is 0, meaning that the node can be drained without any time limitations. - NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` - type: string - providerID: - description: |- - ProviderID is the identification ID of the machine provided by the provider. - This field must match the provider ID as seen on the node object corresponding to this machine. - This field is required by higher level consumers of cluster-api. Example use case is cluster autoscaler - with cluster-api as provider. Clean-up logic in the autoscaler compares machines to nodes to find out - machines at provider which could not get registered as Kubernetes nodes. With cluster-api as a - generic out-of-tree provider for autoscaler, this field is required by autoscaler to be - able to have a provider view of the list of machines. Another list of nodes is queried from the k8s apiserver - and then a comparison is done to find out unregistered machines and are marked for delete. - This field will be set by the actuators and consumed by higher level entities like autoscaler that will - be interfacing with cluster-api as generic provider. - type: string - version: - description: |- - Version defines the desired Kubernetes version. - This field is meant to be optionally used by bootstrap providers. - type: string - required: - - bootstrap - - clusterName - - infrastructureRef - type: object - status: - description: MachineStatus defines the observed state of Machine. - properties: - addresses: - description: |- - Addresses is a list of addresses assigned to the machine. - This field is copied from the infrastructure provider reference. - 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 - bootstrapReady: - description: BootstrapReady is the state of the bootstrap provider. - type: boolean - conditions: - description: Conditions defines current service state of the Machine. - 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: |- - FailureMessage will be set in the event that there is a terminal problem - reconciling the Machine and will contain a more verbose string suitable - for logging and human consumption. - - - This field should not be set for transitive errors that a controller - faces that are expected to be fixed automatically over - time (like service outages), but instead indicate that something is - fundamentally wrong with the Machine's spec or the configuration of - the controller, and that manual intervention is required. Examples - of terminal errors would be invalid combinations of settings in the - spec, values that are unsupported by the controller, or the - responsible controller itself being critically misconfigured. - - - Any transient errors that occur during the reconciliation of Machines - can be added as events to the Machine object and/or logged in the - controller's output. - type: string - failureReason: - description: |- - FailureReason will be set in the event that there is a terminal problem - reconciling the Machine and will contain a succinct value suitable - for machine interpretation. - - - This field should not be set for transitive errors that a controller - faces that are expected to be fixed automatically over - time (like service outages), but instead indicate that something is - fundamentally wrong with the Machine's spec or the configuration of - the controller, and that manual intervention is required. Examples - of terminal errors would be invalid combinations of settings in the - spec, values that are unsupported by the controller, or the - responsible controller itself being critically misconfigured. - - - Any transient errors that occur during the reconciliation of Machines - can be added as events to the Machine object and/or logged in the - controller's output. - type: string - infrastructureReady: - description: InfrastructureReady is the state of the infrastructure - provider. - type: boolean - lastUpdated: - description: LastUpdated identifies when the phase of the Machine - last transitioned. - format: date-time - type: string - nodeInfo: - description: |- - NodeInfo is a set of ids/uuids to uniquely identify the node. - More info: https://kubernetes.io/docs/concepts/nodes/node/#info - properties: - architecture: - description: The Architecture reported by the node - type: string - bootID: - description: Boot ID reported by the node. - type: string - containerRuntimeVersion: - description: ContainerRuntime Version reported by the node through - runtime remote API (e.g. containerd://1.4.2). - type: string - kernelVersion: - description: Kernel Version reported by the node from 'uname -r' - (e.g. 3.16.0-0.bpo.4-amd64). - type: string - kubeProxyVersion: - description: KubeProxy Version reported by the node. - type: string - kubeletVersion: - description: Kubelet Version reported by the node. - type: string - machineID: - description: |- - MachineID reported by the node. For unique machine identification - in the cluster this field is preferred. Learn more from man(5) - machine-id: http://man7.org/linux/man-pages/man5/machine-id.5.html - type: string - operatingSystem: - description: The Operating System reported by the node - type: string - osImage: - description: OS Image reported by the node from /etc/os-release - (e.g. Debian GNU/Linux 7 (wheezy)). - type: string - systemUUID: - description: |- - SystemUUID reported by the node. For unique machine identification - MachineID is preferred. This field is specific to Red Hat hosts - https://access.redhat.com/documentation/en-us/red_hat_subscription_management/1/html/rhsm/uuid - type: string - required: - - architecture - - bootID - - containerRuntimeVersion - - kernelVersion - - kubeProxyVersion - - kubeletVersion - - machineID - - operatingSystem - - osImage - - systemUUID - type: object - nodeRef: - description: NodeRef will point to the corresponding Node if it exists. - 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 - observedGeneration: - description: ObservedGeneration is the latest generation observed - by the controller. - format: int64 - type: integer - phase: - description: |- - Phase represents the current phase of machine actuation. - E.g. Pending, Running, Terminating, Failed etc. - type: string - version: - description: |- - Version specifies the current version of Kubernetes running - on the corresponding Node. This is meant to be a means of bubbling - up status from the Node to the Machine. - It is entirely optional, but useful for end-user UX if it’s present. - type: string - type: object - type: object - served: false - storage: false - subresources: - status: {} - additionalPrinterColumns: - description: Cluster jsonPath: .spec.clusterName diff --git a/config/crd/bases/cluster.x-k8s.io_machinesets.yaml b/config/crd/bases/cluster.x-k8s.io_machinesets.yaml index 5f5691f99124..b4fded105524 100644 --- a/config/crd/bases/cluster.x-k8s.io_machinesets.yaml +++ b/config/crd/bases/cluster.x-k8s.io_machinesets.yaml @@ -18,429 +18,6 @@ spec: singular: machineset scope: Namespaced versions: - - additionalPrinterColumns: - - description: Cluster - jsonPath: .spec.clusterName - name: Cluster - type: string - - description: Time duration since creation of MachineSet - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - description: Total number of non-terminated machines targeted by this machineset - jsonPath: .status.replicas - name: Replicas - type: integer - - description: Total number of available machines (ready for at least minReadySeconds) - jsonPath: .status.availableReplicas - name: Available - type: integer - - description: Total number of ready machines targeted by this machineset. - jsonPath: .status.readyReplicas - name: Ready - type: integer - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - MachineSet is the Schema for the machinesets API. - - - Deprecated: This type will be removed in one of the next releases. - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: MachineSetSpec defines the desired state of MachineSet. - properties: - clusterName: - description: ClusterName is the name of the Cluster this object belongs - to. - minLength: 1 - type: string - deletePolicy: - description: |- - DeletePolicy defines the policy used to identify nodes to delete when downscaling. - Defaults to "Random". Valid values are "Random, "Newest", "Oldest" - enum: - - Random - - Newest - - Oldest - type: string - minReadySeconds: - description: |- - MinReadySeconds is the minimum number of seconds for which a newly created machine should be ready. - Defaults to 0 (machine will be considered available as soon as it is ready) - format: int32 - type: integer - replicas: - default: 1 - description: |- - Replicas is the number of desired replicas. - This is a pointer to distinguish between explicit zero and unspecified. - Defaults to 1. - format: int32 - type: integer - selector: - description: |- - Selector is a label query over machines that should match the replica count. - Label keys and values that must match in order to be controlled by this MachineSet. - It must match the machine template's labels. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors - properties: - matchExpressions: - description: matchExpressions is a list of label selector requirements. - The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector applies - to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - template: - description: |- - Template is the object that describes the machine that will be created if - insufficient replicas are detected. - Object references to custom resources are treated as templates. - properties: - metadata: - description: |- - Standard object's metadata. - More info: 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: |- - Specification of the desired behavior of the machine. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - properties: - bootstrap: - description: |- - Bootstrap is a reference to a local struct which encapsulates - fields to configure the Machine’s bootstrapping mechanism. - properties: - configRef: - description: |- - ConfigRef is a reference to a bootstrap provider-specific resource - that holds configuration details. The reference is optional to - allow users/operators to specify Bootstrap.DataSecretName without - the need of a controller. - 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 - dataSecretName: - description: |- - DataSecretName is the name of the secret that stores the bootstrap data script. - If nil, the Machine should remain in the Pending state. - type: string - type: object - clusterName: - description: ClusterName is the name of the Cluster this object - belongs to. - minLength: 1 - type: string - failureDomain: - description: |- - FailureDomain is the failure domain the machine will be created in. - Must match a key in the FailureDomains map stored on the cluster object. - type: string - infrastructureRef: - description: |- - InfrastructureRef is a required reference to a custom resource - offered by an infrastructure provider. - 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 - nodeDrainTimeout: - description: |- - NodeDrainTimeout is the total amount of time that the controller will spend on draining a node. - The default value is 0, meaning that the node can be drained without any time limitations. - NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` - type: string - providerID: - description: |- - ProviderID is the identification ID of the machine provided by the provider. - This field must match the provider ID as seen on the node object corresponding to this machine. - This field is required by higher level consumers of cluster-api. Example use case is cluster autoscaler - with cluster-api as provider. Clean-up logic in the autoscaler compares machines to nodes to find out - machines at provider which could not get registered as Kubernetes nodes. With cluster-api as a - generic out-of-tree provider for autoscaler, this field is required by autoscaler to be - able to have a provider view of the list of machines. Another list of nodes is queried from the k8s apiserver - and then a comparison is done to find out unregistered machines and are marked for delete. - This field will be set by the actuators and consumed by higher level entities like autoscaler that will - be interfacing with cluster-api as generic provider. - type: string - version: - description: |- - Version defines the desired Kubernetes version. - This field is meant to be optionally used by bootstrap providers. - type: string - required: - - bootstrap - - clusterName - - infrastructureRef - type: object - type: object - required: - - clusterName - - selector - type: object - status: - description: MachineSetStatus defines the observed state of MachineSet. - properties: - availableReplicas: - description: The number of available replicas (ready for at least - minReadySeconds) for this MachineSet. - format: int32 - type: integer - conditions: - description: Conditions defines current service state of the MachineSet. - 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: - type: string - failureReason: - description: |- - In the event that there is a terminal problem reconciling the - replicas, both FailureReason and FailureMessage will be set. FailureReason - will be populated with a succinct value suitable for machine - interpretation, while FailureMessage will contain a more verbose - string suitable for logging and human consumption. - - - These fields should not be set for transitive errors that a - controller faces that are expected to be fixed automatically over - time (like service outages), but instead indicate that something is - fundamentally wrong with the MachineTemplate's spec or the configuration of - the machine controller, and that manual intervention is required. Examples - of terminal errors would be invalid combinations of settings in the - spec, values that are unsupported by the machine controller, or the - responsible machine controller itself being critically misconfigured. - - - Any transient errors that occur during the reconciliation of Machines - can be added as events to the MachineSet object and/or logged in the - controller's output. - type: string - fullyLabeledReplicas: - description: The number of replicas that have labels matching the - labels of the machine template of the MachineSet. - format: int32 - type: integer - observedGeneration: - description: ObservedGeneration reflects the generation of the most - recently observed MachineSet. - format: int64 - type: integer - readyReplicas: - description: The number of ready replicas for this MachineSet. A machine - is considered ready when the node has been created and is "Ready". - format: int32 - type: integer - replicas: - description: Replicas is the most recently observed number of replicas. - format: int32 - type: integer - selector: - description: |- - Selector is the same as the label selector but in the string format to avoid introspection - by clients. The string will be in the same format as the query-param syntax. - More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors - type: string - type: object - type: object - served: false - storage: false - subresources: - scale: - labelSelectorPath: .status.selector - specReplicasPath: .spec.replicas - statusReplicasPath: .status.replicas - status: {} - additionalPrinterColumns: - description: Cluster jsonPath: .spec.clusterName diff --git a/controlplane/kubeadm/api/v1alpha4/condition_consts.go b/controlplane/kubeadm/api/v1alpha4/condition_consts.go deleted file mode 100644 index ea6909c4a28e..000000000000 --- a/controlplane/kubeadm/api/v1alpha4/condition_consts.go +++ /dev/null @@ -1,151 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - -// Conditions and condition Reasons for the KubeadmControlPlane object. - -const ( - // MachinesReadyCondition reports an aggregate of current status of the machines controlled by the KubeadmControlPlane. - MachinesReadyCondition clusterv1alpha4.ConditionType = "MachinesReady" -) - -const ( - // CertificatesAvailableCondition documents that cluster certificates were generated as part of the - // processing of a KubeadmControlPlane object. - CertificatesAvailableCondition clusterv1alpha4.ConditionType = "CertificatesAvailable" - - // CertificatesGenerationFailedReason (Severity=Warning) documents a KubeadmControlPlane controller detecting - // an error while generating certificates; those kind of errors are usually temporary and the controller - // automatically recover from them. - CertificatesGenerationFailedReason = "CertificatesGenerationFailed" -) - -const ( - // AvailableCondition documents that the first control plane instance has completed the kubeadm init operation - // and so the control plane is available and an API server instance is ready for processing requests. - AvailableCondition clusterv1alpha4.ConditionType = "Available" - - // WaitingForKubeadmInitReason (Severity=Info) documents a KubeadmControlPlane object waiting for the first - // control plane instance to complete the kubeadm init operation. - WaitingForKubeadmInitReason = "WaitingForKubeadmInit" -) - -const ( - // MachinesSpecUpToDateCondition documents that the spec of the machines controlled by the KubeadmControlPlane - // is up to date. When this condition is false, the KubeadmControlPlane is executing a rolling upgrade. - MachinesSpecUpToDateCondition clusterv1alpha4.ConditionType = "MachinesSpecUpToDate" - - // RollingUpdateInProgressReason (Severity=Warning) documents a KubeadmControlPlane object executing a - // rolling upgrade for aligning the machines spec to the desired state. - RollingUpdateInProgressReason = "RollingUpdateInProgress" -) - -const ( - // ResizedCondition documents a KubeadmControlPlane that is resizing the set of controlled machines. - ResizedCondition clusterv1alpha4.ConditionType = "Resized" - - // ScalingUpReason (Severity=Info) documents a KubeadmControlPlane that is increasing the number of replicas. - ScalingUpReason = "ScalingUp" - - // ScalingDownReason (Severity=Info) documents a KubeadmControlPlane that is decreasing the number of replicas. - ScalingDownReason = "ScalingDown" -) - -const ( - // ControlPlaneComponentsHealthyCondition reports the overall status of control plane components - // implemented as static pods generated by kubeadm including kube-api-server, kube-controller manager, - // kube-scheduler and etcd if managed. - ControlPlaneComponentsHealthyCondition clusterv1alpha4.ConditionType = "ControlPlaneComponentsHealthy" - - // ControlPlaneComponentsUnhealthyReason (Severity=Error) documents a control plane component not healthy. - ControlPlaneComponentsUnhealthyReason = "ControlPlaneComponentsUnhealthy" - - // ControlPlaneComponentsUnknownReason reports a control plane component in unknown status. - ControlPlaneComponentsUnknownReason = "ControlPlaneComponentsUnknown" - - // ControlPlaneComponentsInspectionFailedReason documents a failure in inspecting the control plane component status. - ControlPlaneComponentsInspectionFailedReason = "ControlPlaneComponentsInspectionFailed" - - // MachineAPIServerPodHealthyCondition reports a machine's kube-apiserver's operational status. - MachineAPIServerPodHealthyCondition clusterv1alpha4.ConditionType = "APIServerPodHealthy" - - // MachineControllerManagerPodHealthyCondition reports a machine's kube-controller-manager's health status. - MachineControllerManagerPodHealthyCondition clusterv1alpha4.ConditionType = "ControllerManagerPodHealthy" - - // MachineSchedulerPodHealthyCondition reports a machine's kube-scheduler's operational status. - MachineSchedulerPodHealthyCondition clusterv1alpha4.ConditionType = "SchedulerPodHealthy" - - // MachineEtcdPodHealthyCondition reports a machine's etcd pod's operational status. - // NOTE: This conditions exists only if a stacked etcd cluster is used. - MachineEtcdPodHealthyCondition clusterv1alpha4.ConditionType = "EtcdPodHealthy" - - // PodProvisioningReason (Severity=Info) documents a pod waiting to be provisioned i.e., Pod is in "Pending" phase. - PodProvisioningReason = "PodProvisioning" - - // PodMissingReason (Severity=Error) documents a pod does not exist. - PodMissingReason = "PodMissing" - - // PodFailedReason (Severity=Error) documents if a pod failed during provisioning i.e., e.g CrashLoopbackOff, ImagePullBackOff - // or if all the containers in a pod have terminated. - PodFailedReason = "PodFailed" - - // PodInspectionFailedReason documents a failure in inspecting the pod status. - PodInspectionFailedReason = "PodInspectionFailed" -) - -const ( - // EtcdClusterHealthyCondition documents the overall etcd cluster's health. - EtcdClusterHealthyCondition clusterv1alpha4.ConditionType = "EtcdClusterHealthyCondition" - - // EtcdClusterInspectionFailedReason documents a failure in inspecting the etcd cluster status. - EtcdClusterInspectionFailedReason = "EtcdClusterInspectionFailed" - - // EtcdClusterUnknownReason reports an etcd cluster in unknown status. - EtcdClusterUnknownReason = "EtcdClusterUnknown" - - // EtcdClusterUnhealthyReason (Severity=Error) is set when the etcd cluster is unhealthy. - EtcdClusterUnhealthyReason = "EtcdClusterUnhealthy" - - // MachineEtcdMemberHealthyCondition report the machine's etcd member's health status. - // NOTE: This conditions exists only if a stacked etcd cluster is used. - MachineEtcdMemberHealthyCondition clusterv1alpha4.ConditionType = "EtcdMemberHealthy" - - // EtcdMemberInspectionFailedReason documents a failure in inspecting the etcd member status. - EtcdMemberInspectionFailedReason = "MemberInspectionFailed" - - // EtcdMemberUnhealthyReason (Severity=Error) documents a Machine's etcd member is unhealthy. - EtcdMemberUnhealthyReason = "EtcdMemberUnhealthy" - - // MachinesCreatedCondition documents that the machines controlled by the KubeadmControlPlane are created. - // When this condition is false, it indicates that there was an error when cloning the infrastructure/bootstrap template or - // when generating the machine object. - MachinesCreatedCondition clusterv1alpha4.ConditionType = "MachinesCreated" - - // InfrastructureTemplateCloningFailedReason (Severity=Error) documents a KubeadmControlPlane failing to - // clone the infrastructure template. - InfrastructureTemplateCloningFailedReason = "InfrastructureTemplateCloningFailed" - - // BootstrapTemplateCloningFailedReason (Severity=Error) documents a KubeadmControlPlane failing to - // clone the bootstrap template. - BootstrapTemplateCloningFailedReason = "BootstrapTemplateCloningFailed" - - // MachineGenerationFailedReason (Severity=Error) documents a KubeadmControlPlane failing to - // generate a machine object. - MachineGenerationFailedReason = "MachineGenerationFailed" -) diff --git a/controlplane/kubeadm/api/v1alpha4/conversion.go b/controlplane/kubeadm/api/v1alpha4/conversion.go deleted file mode 100644 index 43c83dc97cff..000000000000 --- a/controlplane/kubeadm/api/v1alpha4/conversion.go +++ /dev/null @@ -1,293 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - apiconversion "k8s.io/apimachinery/pkg/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" - - bootstrapv1alpha4 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" - controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -func (src *KubeadmControlPlane) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*controlplanev1.KubeadmControlPlane) - - if err := Convert_v1alpha4_KubeadmControlPlane_To_v1beta1_KubeadmControlPlane(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &controlplanev1.KubeadmControlPlane{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - dst.Spec.KubeadmConfigSpec.Files = restored.Spec.KubeadmConfigSpec.Files - - dst.Spec.KubeadmConfigSpec.Users = restored.Spec.KubeadmConfigSpec.Users - if restored.Spec.KubeadmConfigSpec.Users != nil { - for i := range restored.Spec.KubeadmConfigSpec.Users { - if restored.Spec.KubeadmConfigSpec.Users[i].PasswdFrom != nil { - dst.Spec.KubeadmConfigSpec.Users[i].PasswdFrom = restored.Spec.KubeadmConfigSpec.Users[i].PasswdFrom - } - } - } - - dst.Spec.KubeadmConfigSpec.Ignition = restored.Spec.KubeadmConfigSpec.Ignition - if restored.Spec.KubeadmConfigSpec.InitConfiguration != nil { - if dst.Spec.KubeadmConfigSpec.InitConfiguration == nil { - dst.Spec.KubeadmConfigSpec.InitConfiguration = &bootstrapv1.InitConfiguration{} - } - dst.Spec.KubeadmConfigSpec.InitConfiguration.Patches = restored.Spec.KubeadmConfigSpec.InitConfiguration.Patches - dst.Spec.KubeadmConfigSpec.InitConfiguration.SkipPhases = restored.Spec.KubeadmConfigSpec.InitConfiguration.SkipPhases - } - if restored.Spec.KubeadmConfigSpec.JoinConfiguration != nil { - if dst.Spec.KubeadmConfigSpec.JoinConfiguration == nil { - dst.Spec.KubeadmConfigSpec.JoinConfiguration = &bootstrapv1.JoinConfiguration{} - } - dst.Spec.KubeadmConfigSpec.JoinConfiguration.Patches = restored.Spec.KubeadmConfigSpec.JoinConfiguration.Patches - dst.Spec.KubeadmConfigSpec.JoinConfiguration.SkipPhases = restored.Spec.KubeadmConfigSpec.JoinConfiguration.SkipPhases - } - - dst.Spec.MachineTemplate.NodeDeletionTimeout = restored.Spec.MachineTemplate.NodeDeletionTimeout - dst.Spec.RolloutBefore = restored.Spec.RolloutBefore - dst.Spec.MachineTemplate.NodeVolumeDetachTimeout = restored.Spec.MachineTemplate.NodeVolumeDetachTimeout - - if restored.Spec.KubeadmConfigSpec.JoinConfiguration != nil && restored.Spec.KubeadmConfigSpec.JoinConfiguration.NodeRegistration.ImagePullPolicy != "" { - if dst.Spec.KubeadmConfigSpec.JoinConfiguration == nil { - dst.Spec.KubeadmConfigSpec.JoinConfiguration = &bootstrapv1.JoinConfiguration{} - } - dst.Spec.KubeadmConfigSpec.JoinConfiguration.NodeRegistration.ImagePullPolicy = restored.Spec.KubeadmConfigSpec.JoinConfiguration.NodeRegistration.ImagePullPolicy - } - - if restored.Spec.KubeadmConfigSpec.InitConfiguration != nil && restored.Spec.KubeadmConfigSpec.InitConfiguration.NodeRegistration.ImagePullPolicy != "" { - if dst.Spec.KubeadmConfigSpec.InitConfiguration == nil { - dst.Spec.KubeadmConfigSpec.InitConfiguration = &bootstrapv1.InitConfiguration{} - } - dst.Spec.KubeadmConfigSpec.InitConfiguration.NodeRegistration.ImagePullPolicy = restored.Spec.KubeadmConfigSpec.InitConfiguration.NodeRegistration.ImagePullPolicy - } - - if restored.Spec.RemediationStrategy != nil { - dst.Spec.RemediationStrategy = restored.Spec.RemediationStrategy - } - if restored.Status.LastRemediation != nil { - dst.Status.LastRemediation = restored.Status.LastRemediation - } - - return nil -} - -func (dst *KubeadmControlPlane) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*controlplanev1.KubeadmControlPlane) - - if err := Convert_v1beta1_KubeadmControlPlane_To_v1alpha4_KubeadmControlPlane(src, dst, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata - return utilconversion.MarshalData(src, dst) -} - -func (src *KubeadmControlPlaneList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*controlplanev1.KubeadmControlPlaneList) - - return Convert_v1alpha4_KubeadmControlPlaneList_To_v1beta1_KubeadmControlPlaneList(src, dst, nil) -} - -func (dst *KubeadmControlPlaneList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*controlplanev1.KubeadmControlPlaneList) - - return Convert_v1beta1_KubeadmControlPlaneList_To_v1alpha4_KubeadmControlPlaneList(src, dst, nil) -} - -func (src *KubeadmControlPlaneTemplate) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*controlplanev1.KubeadmControlPlaneTemplate) - - if err := Convert_v1alpha4_KubeadmControlPlaneTemplate_To_v1beta1_KubeadmControlPlaneTemplate(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &controlplanev1.KubeadmControlPlaneTemplate{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - dst.Spec.Template.Spec.KubeadmConfigSpec.Files = restored.Spec.Template.Spec.KubeadmConfigSpec.Files - dst.Spec.Template.Spec.KubeadmConfigSpec.Users = restored.Spec.Template.Spec.KubeadmConfigSpec.Users - dst.Spec.Template.Spec.KubeadmConfigSpec.Ignition = restored.Spec.Template.Spec.KubeadmConfigSpec.Ignition - dst.Spec.Template.Spec.MachineTemplate = restored.Spec.Template.Spec.MachineTemplate - - if restored.Spec.Template.Spec.KubeadmConfigSpec.Users != nil { - for i := range restored.Spec.Template.Spec.KubeadmConfigSpec.Users { - if restored.Spec.Template.Spec.KubeadmConfigSpec.Users[i].PasswdFrom != nil { - dst.Spec.Template.Spec.KubeadmConfigSpec.Users[i].PasswdFrom = restored.Spec.Template.Spec.KubeadmConfigSpec.Users[i].PasswdFrom - } - } - } - - dst.Spec.Template.ObjectMeta = restored.Spec.Template.ObjectMeta - if restored.Spec.Template.Spec.MachineTemplate != nil { - dst.Spec.Template.Spec.MachineTemplate.ObjectMeta = restored.Spec.Template.Spec.MachineTemplate.ObjectMeta - } - - if restored.Spec.Template.Spec.KubeadmConfigSpec.InitConfiguration != nil { - if dst.Spec.Template.Spec.KubeadmConfigSpec.InitConfiguration == nil { - dst.Spec.Template.Spec.KubeadmConfigSpec.InitConfiguration = &bootstrapv1.InitConfiguration{} - } - dst.Spec.Template.Spec.KubeadmConfigSpec.InitConfiguration.Patches = restored.Spec.Template.Spec.KubeadmConfigSpec.InitConfiguration.Patches - dst.Spec.Template.Spec.KubeadmConfigSpec.InitConfiguration.SkipPhases = restored.Spec.Template.Spec.KubeadmConfigSpec.InitConfiguration.SkipPhases - } - if restored.Spec.Template.Spec.KubeadmConfigSpec.JoinConfiguration != nil { - if dst.Spec.Template.Spec.KubeadmConfigSpec.JoinConfiguration == nil { - dst.Spec.Template.Spec.KubeadmConfigSpec.JoinConfiguration = &bootstrapv1.JoinConfiguration{} - } - dst.Spec.Template.Spec.KubeadmConfigSpec.JoinConfiguration.Patches = restored.Spec.Template.Spec.KubeadmConfigSpec.JoinConfiguration.Patches - dst.Spec.Template.Spec.KubeadmConfigSpec.JoinConfiguration.SkipPhases = restored.Spec.Template.Spec.KubeadmConfigSpec.JoinConfiguration.SkipPhases - } - if dst.Spec.Template.Spec.MachineTemplate == nil { - dst.Spec.Template.Spec.MachineTemplate = restored.Spec.Template.Spec.MachineTemplate - } else if restored.Spec.Template.Spec.MachineTemplate != nil { - dst.Spec.Template.Spec.MachineTemplate.NodeDeletionTimeout = restored.Spec.Template.Spec.MachineTemplate.NodeDeletionTimeout - dst.Spec.Template.Spec.MachineTemplate.NodeVolumeDetachTimeout = restored.Spec.Template.Spec.MachineTemplate.NodeVolumeDetachTimeout - } - - dst.Spec.Template.Spec.RolloutBefore = restored.Spec.Template.Spec.RolloutBefore - - if restored.Spec.Template.Spec.KubeadmConfigSpec.JoinConfiguration != nil && restored.Spec.Template.Spec.KubeadmConfigSpec.JoinConfiguration.NodeRegistration.ImagePullPolicy != "" { - if dst.Spec.Template.Spec.KubeadmConfigSpec.JoinConfiguration == nil { - dst.Spec.Template.Spec.KubeadmConfigSpec.JoinConfiguration = &bootstrapv1.JoinConfiguration{} - } - dst.Spec.Template.Spec.KubeadmConfigSpec.JoinConfiguration.NodeRegistration.ImagePullPolicy = restored.Spec.Template.Spec.KubeadmConfigSpec.JoinConfiguration.NodeRegistration.ImagePullPolicy - } - - if restored.Spec.Template.Spec.KubeadmConfigSpec.InitConfiguration != nil && restored.Spec.Template.Spec.KubeadmConfigSpec.InitConfiguration.NodeRegistration.ImagePullPolicy != "" { - if dst.Spec.Template.Spec.KubeadmConfigSpec.InitConfiguration == nil { - dst.Spec.Template.Spec.KubeadmConfigSpec.InitConfiguration = &bootstrapv1.InitConfiguration{} - } - dst.Spec.Template.Spec.KubeadmConfigSpec.InitConfiguration.NodeRegistration.ImagePullPolicy = restored.Spec.Template.Spec.KubeadmConfigSpec.InitConfiguration.NodeRegistration.ImagePullPolicy - } - - if restored.Spec.Template.Spec.RemediationStrategy != nil { - dst.Spec.Template.Spec.RemediationStrategy = restored.Spec.Template.Spec.RemediationStrategy - } - - return nil -} - -func (dst *KubeadmControlPlaneTemplate) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*controlplanev1.KubeadmControlPlaneTemplate) - - if err := Convert_v1beta1_KubeadmControlPlaneTemplate_To_v1alpha4_KubeadmControlPlaneTemplate(src, dst, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata - return utilconversion.MarshalData(src, dst) -} - -func (src *KubeadmControlPlaneTemplateList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*controlplanev1.KubeadmControlPlaneTemplateList) - - return Convert_v1alpha4_KubeadmControlPlaneTemplateList_To_v1beta1_KubeadmControlPlaneTemplateList(src, dst, nil) -} - -func (dst *KubeadmControlPlaneTemplateList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*controlplanev1.KubeadmControlPlaneTemplateList) - - return Convert_v1beta1_KubeadmControlPlaneTemplateList_To_v1alpha4_KubeadmControlPlaneTemplateList(src, dst, nil) -} - -func Convert_v1alpha4_KubeadmControlPlaneSpec_To_v1beta1_KubeadmControlPlaneTemplateResourceSpec(in *KubeadmControlPlaneSpec, out *controlplanev1.KubeadmControlPlaneTemplateResourceSpec, s apiconversion.Scope) error { - out.MachineTemplate = &controlplanev1.KubeadmControlPlaneTemplateMachineTemplate{ - NodeDrainTimeout: in.MachineTemplate.NodeDrainTimeout, - } - - if err := bootstrapv1alpha4.Convert_v1alpha4_KubeadmConfigSpec_To_v1beta1_KubeadmConfigSpec(&in.KubeadmConfigSpec, &out.KubeadmConfigSpec, s); err != nil { - return err - } - - out.RolloutAfter = in.RolloutAfter - - if in.RolloutStrategy != nil { - out.RolloutStrategy = &controlplanev1.RolloutStrategy{} - if len(in.RolloutStrategy.Type) > 0 { - out.RolloutStrategy.Type = controlplanev1.RolloutStrategyType(in.RolloutStrategy.Type) - } - if in.RolloutStrategy.RollingUpdate != nil { - out.RolloutStrategy.RollingUpdate = &controlplanev1.RollingUpdate{} - - if in.RolloutStrategy.RollingUpdate.MaxSurge != nil { - out.RolloutStrategy.RollingUpdate.MaxSurge = in.RolloutStrategy.RollingUpdate.MaxSurge - } - } - } - - return nil -} - -func Convert_v1beta1_KubeadmControlPlaneTemplateResourceSpec_To_v1alpha4_KubeadmControlPlaneSpec(in *controlplanev1.KubeadmControlPlaneTemplateResourceSpec, out *KubeadmControlPlaneSpec, s apiconversion.Scope) error { - if in.MachineTemplate != nil { - out.MachineTemplate.NodeDrainTimeout = in.MachineTemplate.NodeDrainTimeout - } - - if err := bootstrapv1alpha4.Convert_v1beta1_KubeadmConfigSpec_To_v1alpha4_KubeadmConfigSpec(&in.KubeadmConfigSpec, &out.KubeadmConfigSpec, s); err != nil { - return err - } - - out.RolloutAfter = in.RolloutAfter - - if in.RolloutStrategy != nil { - out.RolloutStrategy = &RolloutStrategy{} - if len(in.RolloutStrategy.Type) > 0 { - out.RolloutStrategy.Type = RolloutStrategyType(in.RolloutStrategy.Type) - } - if in.RolloutStrategy.RollingUpdate != nil { - out.RolloutStrategy.RollingUpdate = &RollingUpdate{} - - if in.RolloutStrategy.RollingUpdate.MaxSurge != nil { - out.RolloutStrategy.RollingUpdate.MaxSurge = in.RolloutStrategy.RollingUpdate.MaxSurge - } - } - } - - return nil -} - -func Convert_v1beta1_KubeadmControlPlaneMachineTemplate_To_v1alpha4_KubeadmControlPlaneMachineTemplate(in *controlplanev1.KubeadmControlPlaneMachineTemplate, out *KubeadmControlPlaneMachineTemplate, s apiconversion.Scope) error { - // .NodeDrainTimeout was added in v1beta1. - return autoConvert_v1beta1_KubeadmControlPlaneMachineTemplate_To_v1alpha4_KubeadmControlPlaneMachineTemplate(in, out, s) -} - -func Convert_v1beta1_KubeadmControlPlaneSpec_To_v1alpha4_KubeadmControlPlaneSpec(in *controlplanev1.KubeadmControlPlaneSpec, out *KubeadmControlPlaneSpec, scope apiconversion.Scope) error { - // .RolloutBefore was added in v1beta1. - // .RemediationStrategy was added in v1beta1. - return autoConvert_v1beta1_KubeadmControlPlaneSpec_To_v1alpha4_KubeadmControlPlaneSpec(in, out, scope) -} - -func Convert_v1beta1_KubeadmControlPlaneStatus_To_v1alpha4_KubeadmControlPlaneStatus(in *controlplanev1.KubeadmControlPlaneStatus, out *KubeadmControlPlaneStatus, scope apiconversion.Scope) error { - // .LastRemediation was added in v1beta1. - return autoConvert_v1beta1_KubeadmControlPlaneStatus_To_v1alpha4_KubeadmControlPlaneStatus(in, out, scope) -} - -func Convert_v1beta1_KubeadmControlPlaneTemplateResource_To_v1alpha4_KubeadmControlPlaneTemplateResource(in *controlplanev1.KubeadmControlPlaneTemplateResource, out *KubeadmControlPlaneTemplateResource, scope apiconversion.Scope) error { - // .metadata and .spec.machineTemplate.metadata was added in v1beta1. - return autoConvert_v1beta1_KubeadmControlPlaneTemplateResource_To_v1alpha4_KubeadmControlPlaneTemplateResource(in, out, scope) -} diff --git a/controlplane/kubeadm/api/v1alpha4/conversion_test.go b/controlplane/kubeadm/api/v1alpha4/conversion_test.go deleted file mode 100644 index 8dc6687a1456..000000000000 --- a/controlplane/kubeadm/api/v1alpha4/conversion_test.go +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "testing" - - fuzz "github.com/google/gofuzz" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" - runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" - - clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - bootstrapv1alpha4 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" - controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -const ( - fakeID = "abcdef" - fakeSecret = "abcdef0123456789" -) - -func TestFuzzyConversion(t *testing.T) { - t.Run("for KubeadmControlPlane", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &controlplanev1.KubeadmControlPlane{}, - Spoke: &KubeadmControlPlane{}, - FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs}, - })) - - t.Run("for KubeadmControlPlaneTemplate", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &controlplanev1.KubeadmControlPlaneTemplate{}, - Spoke: &KubeadmControlPlaneTemplate{}, - FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs}, - })) -} - -func fuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} { - // This custom function is needed when ConvertTo/ConvertFrom functions - // uses the json package to unmarshal the bootstrap token string. - // - // The Kubeadm v1beta1.BootstrapTokenString type ships with a custom - // json string representation, in particular it supplies a customized - // UnmarshalJSON function that can return an error if the string - // isn't in the correct form. - // - // This function effectively disables any fuzzing for the token by setting - // the values for ID and Secret to working alphanumeric values. - return []interface{}{ - cabpkBootstrapTokenStringFuzzer, - kubeadmBootstrapTokenStringFuzzerV1Alpha4, - kubeadmControlPlaneTemplateResourceSpecFuzzerV1Alpha4, - } -} - -func cabpkBootstrapTokenStringFuzzer(in *bootstrapv1.BootstrapTokenString, _ fuzz.Continue) { - in.ID = fakeID - in.Secret = fakeSecret -} - -func kubeadmBootstrapTokenStringFuzzerV1Alpha4(in *bootstrapv1alpha4.BootstrapTokenString, _ fuzz.Continue) { - in.ID = fakeID - in.Secret = fakeSecret -} - -func kubeadmControlPlaneTemplateResourceSpecFuzzerV1Alpha4(in *KubeadmControlPlaneTemplateResource, c fuzz.Continue) { - c.Fuzz(in) - - // Fields have been dropped in KCPTemplate. - in.Spec.Replicas = nil - in.Spec.Version = "" - in.Spec.MachineTemplate.ObjectMeta = clusterv1alpha4.ObjectMeta{} - in.Spec.MachineTemplate.InfrastructureRef = corev1.ObjectReference{} -} diff --git a/controlplane/kubeadm/api/v1alpha4/doc.go b/controlplane/kubeadm/api/v1alpha4/doc.go deleted file mode 100644 index ad4ab46d822b..000000000000 --- a/controlplane/kubeadm/api/v1alpha4/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains the v1alpha4 API implementation. -// +k8s:conversion-gen=sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1 -// -// Deprecated: This package will be removed in one of the next releases. -package v1alpha4 diff --git a/controlplane/kubeadm/api/v1alpha4/groupversion_info.go b/controlplane/kubeadm/api/v1alpha4/groupversion_info.go deleted file mode 100644 index a8e6a7a1c325..000000000000 --- a/controlplane/kubeadm/api/v1alpha4/groupversion_info.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains API Schema definitions for the kubeadm v1alpha4 API group -// +kubebuilder:object:generate=true -// +groupName=controlplane.cluster.x-k8s.io -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -var ( - // GroupVersion is group version used to register these objects. - GroupVersion = schema.GroupVersion{Group: "controlplane.cluster.x-k8s.io", Version: "v1alpha4"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme. - schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = schemeBuilder.AddToScheme - - objectTypes = []runtime.Object{} - - // localSchemeBuilder is used for type conversions. - localSchemeBuilder = schemeBuilder -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(GroupVersion, objectTypes...) - metav1.AddToGroupVersion(scheme, GroupVersion) - return nil -} diff --git a/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go b/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go deleted file mode 100644 index b127c027fe33..000000000000 --- a/controlplane/kubeadm/api/v1alpha4/kubeadm_control_plane_types.go +++ /dev/null @@ -1,249 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/util/intstr" - - clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - bootstrapv1alpha4 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" - "sigs.k8s.io/cluster-api/errors" -) - -// RolloutStrategyType defines the rollout strategies for a KubeadmControlPlane. -type RolloutStrategyType string - -const ( - // RollingUpdateStrategyType replaces the old control planes by new one using rolling update - // i.e. gradually scale up or down the old control planes and scale up or down the new one. - RollingUpdateStrategyType RolloutStrategyType = "RollingUpdate" -) - -const ( - // KubeadmControlPlaneFinalizer is the finalizer applied to KubeadmControlPlane resources - // by its managing controller. - KubeadmControlPlaneFinalizer = "kubeadm.controlplane.cluster.x-k8s.io" - - // SkipCoreDNSAnnotation annotation explicitly skips reconciling CoreDNS if set. - SkipCoreDNSAnnotation = "controlplane.cluster.x-k8s.io/skip-coredns" - - // SkipKubeProxyAnnotation annotation explicitly skips reconciling kube-proxy if set. - SkipKubeProxyAnnotation = "controlplane.cluster.x-k8s.io/skip-kube-proxy" - - // KubeadmClusterConfigurationAnnotation is a machine annotation that stores the json-marshalled string of KCP ClusterConfiguration. - // This annotation is used to detect any changes in ClusterConfiguration and trigger machine rollout in KCP. - KubeadmClusterConfigurationAnnotation = "controlplane.cluster.x-k8s.io/kubeadm-cluster-configuration" -) - -// KubeadmControlPlaneSpec defines the desired state of KubeadmControlPlane. -type KubeadmControlPlaneSpec struct { - // Number of desired machines. Defaults to 1. When stacked etcd is used only - // odd numbers are permitted, as per [etcd best practice](https://etcd.io/docs/v3.3.12/faq/#why-an-odd-number-of-cluster-members). - // This is a pointer to distinguish between explicit zero and not specified. - // +optional - Replicas *int32 `json:"replicas,omitempty"` - - // Version defines the desired Kubernetes version. - Version string `json:"version"` - - // MachineTemplate contains information about how machines - // should be shaped when creating or updating a control plane. - MachineTemplate KubeadmControlPlaneMachineTemplate `json:"machineTemplate"` - - // KubeadmConfigSpec is a KubeadmConfigSpec - // to use for initializing and joining machines to the control plane. - KubeadmConfigSpec bootstrapv1alpha4.KubeadmConfigSpec `json:"kubeadmConfigSpec"` - - // RolloutAfter is a field to indicate a rollout should be performed - // after the specified time even if no changes have been made to the - // KubeadmControlPlane. - // - // +optional - RolloutAfter *metav1.Time `json:"rolloutAfter,omitempty"` - - // The RolloutStrategy to use to replace control plane machines with - // new ones. - // +optional - // +kubebuilder:default={type: "RollingUpdate", rollingUpdate: {maxSurge: 1}} - RolloutStrategy *RolloutStrategy `json:"rolloutStrategy,omitempty"` -} - -// KubeadmControlPlaneMachineTemplate defines the template for Machines -// in a KubeadmControlPlane object. -type KubeadmControlPlaneMachineTemplate struct { - // Standard object's metadata. - // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - // +optional - ObjectMeta clusterv1alpha4.ObjectMeta `json:"metadata,omitempty"` - - // InfrastructureRef is a required reference to a custom resource - // offered by an infrastructure provider. - InfrastructureRef corev1.ObjectReference `json:"infrastructureRef"` - - // NodeDrainTimeout is the total amount of time that the controller will spend on draining a controlplane node - // The default value is 0, meaning that the node can be drained without any time limitations. - // NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` - // +optional - NodeDrainTimeout *metav1.Duration `json:"nodeDrainTimeout,omitempty"` -} - -// RolloutStrategy describes how to replace existing machines -// with new ones. -type RolloutStrategy struct { - // Type of rollout. Currently the only supported strategy is - // "RollingUpdate". - // Default is RollingUpdate. - // +optional - Type RolloutStrategyType `json:"type,omitempty"` - - // Rolling update config params. Present only if - // RolloutStrategyType = RollingUpdate. - // +optional - RollingUpdate *RollingUpdate `json:"rollingUpdate,omitempty"` -} - -// RollingUpdate is used to control the desired behavior of rolling update. -type RollingUpdate struct { - // The maximum number of control planes that can be scheduled above or under the - // desired number of control planes. - // Value can be an absolute number 1 or 0. - // Defaults to 1. - // Example: when this is set to 1, the control plane can be scaled - // up immediately when the rolling update starts. - // +optional - MaxSurge *intstr.IntOrString `json:"maxSurge,omitempty"` -} - -// KubeadmControlPlaneStatus defines the observed state of KubeadmControlPlane. -type KubeadmControlPlaneStatus struct { - // Selector is the label selector in string format to avoid introspection - // by clients, and is used to provide the CRD-based integration for the - // scale subresource and additional integrations for things like kubectl - // describe.. The string will be in the same format as the query-param syntax. - // More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors - // +optional - Selector string `json:"selector,omitempty"` - - // Total number of non-terminated machines targeted by this control plane - // (their labels match the selector). - // +optional - Replicas int32 `json:"replicas,omitempty"` - - // Version represents the minimum Kubernetes version for the control plane machines - // in the cluster. - // +optional - Version *string `json:"version,omitempty"` - - // Total number of non-terminated machines targeted by this control plane - // that have the desired template spec. - // +optional - UpdatedReplicas int32 `json:"updatedReplicas,omitempty"` - - // Total number of fully running and ready control plane machines. - // +optional - ReadyReplicas int32 `json:"readyReplicas,omitempty"` - - // Total number of unavailable machines targeted by this control plane. - // This is the total number of machines that are still required for - // the deployment to have 100% available capacity. They may either - // be machines that are running but not yet ready or machines - // that still have not been created. - // +optional - UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"` - - // Initialized denotes whether or not the control plane has the - // uploaded kubeadm-config configmap. - // +optional - Initialized bool `json:"initialized"` - - // Ready denotes that the KubeadmControlPlane API Server is ready to - // receive requests. - // +optional - Ready bool `json:"ready"` - - // FailureReason indicates that there is a terminal problem reconciling the - // state, and will be set to a token value suitable for - // programmatic interpretation. - // +optional - FailureReason errors.KubeadmControlPlaneStatusError `json:"failureReason,omitempty"` - - // ErrorMessage indicates that there is a terminal problem reconciling the - // state, and will be set to a descriptive error message. - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` - - // ObservedGeneration is the latest generation observed by the controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // Conditions defines current service state of the KubeadmControlPlane. - // +optional - Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:resource:path=kubeadmcontrolplanes,shortName=kcp,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of KubeadmControlPlane" -// +kubebuilder:printcolumn:name="Initialized",type=boolean,JSONPath=".status.initialized",description="This denotes whether or not the control plane has the uploaded kubeadm-config configmap" -// +kubebuilder:printcolumn:name="API Server Available",type=boolean,JSONPath=".status.ready",description="KubeadmControlPlane API Server is ready to receive requests" -// +kubebuilder:printcolumn:name="Version",type=string,JSONPath=".spec.version",description="Kubernetes version associated with this control plane" -// +kubebuilder:printcolumn:name="Replicas",type=integer,JSONPath=".status.replicas",description="Total number of non-terminated machines targeted by this control plane" -// +kubebuilder:printcolumn:name="Ready",type=integer,JSONPath=".status.readyReplicas",description="Total number of fully running and ready control plane machines" -// +kubebuilder:printcolumn:name="Updated",type=integer,JSONPath=".status.updatedReplicas",description="Total number of non-terminated machines targeted by this control plane that have the desired template spec" -// +kubebuilder:printcolumn:name="Unavailable",type=integer,JSONPath=".status.unavailableReplicas",description="Total number of unavailable machines targeted by this control plane" - -// KubeadmControlPlane is the Schema for the KubeadmControlPlane API. -// -// Deprecated: This type will be removed in one of the next releases. -type KubeadmControlPlane struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec KubeadmControlPlaneSpec `json:"spec,omitempty"` - Status KubeadmControlPlaneStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (in *KubeadmControlPlane) GetConditions() clusterv1alpha4.Conditions { - return in.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (in *KubeadmControlPlane) SetConditions(conditions clusterv1alpha4.Conditions) { - in.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// KubeadmControlPlaneList contains a list of KubeadmControlPlane. -// -// Deprecated: This type will be removed in one of the next releases. -type KubeadmControlPlaneList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []KubeadmControlPlane `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &KubeadmControlPlane{}, &KubeadmControlPlaneList{}) -} diff --git a/controlplane/kubeadm/api/v1alpha4/kubeadmcontrolplanetemplate_types.go b/controlplane/kubeadm/api/v1alpha4/kubeadmcontrolplanetemplate_types.go deleted file mode 100644 index f3f0a8f73420..000000000000 --- a/controlplane/kubeadm/api/v1alpha4/kubeadmcontrolplanetemplate_types.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// KubeadmControlPlaneTemplateSpec defines the desired state of KubeadmControlPlaneTemplate. -type KubeadmControlPlaneTemplateSpec struct { - Template KubeadmControlPlaneTemplateResource `json:"template"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:resource:path=kubeadmcontrolplanetemplates,scope=Namespaced,categories=cluster-api -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of KubeadmControlPlaneTemplate" - -// KubeadmControlPlaneTemplate is the Schema for the kubeadmcontrolplanetemplates API. -// -// Deprecated: This type will be removed in one of the next releases. -type KubeadmControlPlaneTemplate struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec KubeadmControlPlaneTemplateSpec `json:"spec,omitempty"` -} - -// +kubebuilder:object:root=true - -// KubeadmControlPlaneTemplateList contains a list of KubeadmControlPlaneTemplate. -// -// Deprecated: This type will be removed in one of the next releases. -type KubeadmControlPlaneTemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []KubeadmControlPlaneTemplate `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &KubeadmControlPlaneTemplate{}, &KubeadmControlPlaneTemplateList{}) -} - -// KubeadmControlPlaneTemplateResource describes the data needed to create a KubeadmControlPlane from a template. -type KubeadmControlPlaneTemplateResource struct { - Spec KubeadmControlPlaneSpec `json:"spec"` -} diff --git a/controlplane/kubeadm/api/v1alpha4/zz_generated.conversion.go b/controlplane/kubeadm/api/v1alpha4/zz_generated.conversion.go deleted file mode 100644 index 43a665833f86..000000000000 --- a/controlplane/kubeadm/api/v1alpha4/zz_generated.conversion.go +++ /dev/null @@ -1,512 +0,0 @@ -//go:build !ignore_autogenerated_kubeadm_controlplane -// +build !ignore_autogenerated_kubeadm_controlplane - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - unsafe "unsafe" - - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - conversion "k8s.io/apimachinery/pkg/conversion" - runtime "k8s.io/apimachinery/pkg/runtime" - intstr "k8s.io/apimachinery/pkg/util/intstr" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" - kubeadmapiv1alpha4 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" - v1beta1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/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((*KubeadmControlPlane)(nil), (*v1beta1.KubeadmControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmControlPlane_To_v1beta1_KubeadmControlPlane(a.(*KubeadmControlPlane), b.(*v1beta1.KubeadmControlPlane), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.KubeadmControlPlane)(nil), (*KubeadmControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmControlPlane_To_v1alpha4_KubeadmControlPlane(a.(*v1beta1.KubeadmControlPlane), b.(*KubeadmControlPlane), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KubeadmControlPlaneList)(nil), (*v1beta1.KubeadmControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmControlPlaneList_To_v1beta1_KubeadmControlPlaneList(a.(*KubeadmControlPlaneList), b.(*v1beta1.KubeadmControlPlaneList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.KubeadmControlPlaneList)(nil), (*KubeadmControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmControlPlaneList_To_v1alpha4_KubeadmControlPlaneList(a.(*v1beta1.KubeadmControlPlaneList), b.(*KubeadmControlPlaneList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KubeadmControlPlaneMachineTemplate)(nil), (*v1beta1.KubeadmControlPlaneMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmControlPlaneMachineTemplate_To_v1beta1_KubeadmControlPlaneMachineTemplate(a.(*KubeadmControlPlaneMachineTemplate), b.(*v1beta1.KubeadmControlPlaneMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KubeadmControlPlaneSpec)(nil), (*v1beta1.KubeadmControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmControlPlaneSpec_To_v1beta1_KubeadmControlPlaneSpec(a.(*KubeadmControlPlaneSpec), b.(*v1beta1.KubeadmControlPlaneSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KubeadmControlPlaneStatus)(nil), (*v1beta1.KubeadmControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmControlPlaneStatus_To_v1beta1_KubeadmControlPlaneStatus(a.(*KubeadmControlPlaneStatus), b.(*v1beta1.KubeadmControlPlaneStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KubeadmControlPlaneTemplate)(nil), (*v1beta1.KubeadmControlPlaneTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmControlPlaneTemplate_To_v1beta1_KubeadmControlPlaneTemplate(a.(*KubeadmControlPlaneTemplate), b.(*v1beta1.KubeadmControlPlaneTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.KubeadmControlPlaneTemplate)(nil), (*KubeadmControlPlaneTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmControlPlaneTemplate_To_v1alpha4_KubeadmControlPlaneTemplate(a.(*v1beta1.KubeadmControlPlaneTemplate), b.(*KubeadmControlPlaneTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KubeadmControlPlaneTemplateList)(nil), (*v1beta1.KubeadmControlPlaneTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmControlPlaneTemplateList_To_v1beta1_KubeadmControlPlaneTemplateList(a.(*KubeadmControlPlaneTemplateList), b.(*v1beta1.KubeadmControlPlaneTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.KubeadmControlPlaneTemplateList)(nil), (*KubeadmControlPlaneTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmControlPlaneTemplateList_To_v1alpha4_KubeadmControlPlaneTemplateList(a.(*v1beta1.KubeadmControlPlaneTemplateList), b.(*KubeadmControlPlaneTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KubeadmControlPlaneTemplateResource)(nil), (*v1beta1.KubeadmControlPlaneTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmControlPlaneTemplateResource_To_v1beta1_KubeadmControlPlaneTemplateResource(a.(*KubeadmControlPlaneTemplateResource), b.(*v1beta1.KubeadmControlPlaneTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*KubeadmControlPlaneTemplateSpec)(nil), (*v1beta1.KubeadmControlPlaneTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmControlPlaneTemplateSpec_To_v1beta1_KubeadmControlPlaneTemplateSpec(a.(*KubeadmControlPlaneTemplateSpec), b.(*v1beta1.KubeadmControlPlaneTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.KubeadmControlPlaneTemplateSpec)(nil), (*KubeadmControlPlaneTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmControlPlaneTemplateSpec_To_v1alpha4_KubeadmControlPlaneTemplateSpec(a.(*v1beta1.KubeadmControlPlaneTemplateSpec), b.(*KubeadmControlPlaneTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*RollingUpdate)(nil), (*v1beta1.RollingUpdate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_RollingUpdate_To_v1beta1_RollingUpdate(a.(*RollingUpdate), b.(*v1beta1.RollingUpdate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.RollingUpdate)(nil), (*RollingUpdate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_RollingUpdate_To_v1alpha4_RollingUpdate(a.(*v1beta1.RollingUpdate), b.(*RollingUpdate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*RolloutStrategy)(nil), (*v1beta1.RolloutStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_RolloutStrategy_To_v1beta1_RolloutStrategy(a.(*RolloutStrategy), b.(*v1beta1.RolloutStrategy), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.RolloutStrategy)(nil), (*RolloutStrategy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_RolloutStrategy_To_v1alpha4_RolloutStrategy(a.(*v1beta1.RolloutStrategy), b.(*RolloutStrategy), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*KubeadmControlPlaneSpec)(nil), (*v1beta1.KubeadmControlPlaneTemplateResourceSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubeadmControlPlaneSpec_To_v1beta1_KubeadmControlPlaneTemplateResourceSpec(a.(*KubeadmControlPlaneSpec), b.(*v1beta1.KubeadmControlPlaneTemplateResourceSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.KubeadmControlPlaneMachineTemplate)(nil), (*KubeadmControlPlaneMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmControlPlaneMachineTemplate_To_v1alpha4_KubeadmControlPlaneMachineTemplate(a.(*v1beta1.KubeadmControlPlaneMachineTemplate), b.(*KubeadmControlPlaneMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.KubeadmControlPlaneSpec)(nil), (*KubeadmControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmControlPlaneSpec_To_v1alpha4_KubeadmControlPlaneSpec(a.(*v1beta1.KubeadmControlPlaneSpec), b.(*KubeadmControlPlaneSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.KubeadmControlPlaneStatus)(nil), (*KubeadmControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmControlPlaneStatus_To_v1alpha4_KubeadmControlPlaneStatus(a.(*v1beta1.KubeadmControlPlaneStatus), b.(*KubeadmControlPlaneStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.KubeadmControlPlaneTemplateResourceSpec)(nil), (*KubeadmControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmControlPlaneTemplateResourceSpec_To_v1alpha4_KubeadmControlPlaneSpec(a.(*v1beta1.KubeadmControlPlaneTemplateResourceSpec), b.(*KubeadmControlPlaneSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.KubeadmControlPlaneTemplateResource)(nil), (*KubeadmControlPlaneTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_KubeadmControlPlaneTemplateResource_To_v1alpha4_KubeadmControlPlaneTemplateResource(a.(*v1beta1.KubeadmControlPlaneTemplateResource), b.(*KubeadmControlPlaneTemplateResource), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha4_KubeadmControlPlane_To_v1beta1_KubeadmControlPlane(in *KubeadmControlPlane, out *v1beta1.KubeadmControlPlane, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_KubeadmControlPlaneSpec_To_v1beta1_KubeadmControlPlaneSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_KubeadmControlPlaneStatus_To_v1beta1_KubeadmControlPlaneStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_KubeadmControlPlane_To_v1beta1_KubeadmControlPlane is an autogenerated conversion function. -func Convert_v1alpha4_KubeadmControlPlane_To_v1beta1_KubeadmControlPlane(in *KubeadmControlPlane, out *v1beta1.KubeadmControlPlane, s conversion.Scope) error { - return autoConvert_v1alpha4_KubeadmControlPlane_To_v1beta1_KubeadmControlPlane(in, out, s) -} - -func autoConvert_v1beta1_KubeadmControlPlane_To_v1alpha4_KubeadmControlPlane(in *v1beta1.KubeadmControlPlane, out *KubeadmControlPlane, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_KubeadmControlPlaneSpec_To_v1alpha4_KubeadmControlPlaneSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_KubeadmControlPlaneStatus_To_v1alpha4_KubeadmControlPlaneStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_KubeadmControlPlane_To_v1alpha4_KubeadmControlPlane is an autogenerated conversion function. -func Convert_v1beta1_KubeadmControlPlane_To_v1alpha4_KubeadmControlPlane(in *v1beta1.KubeadmControlPlane, out *KubeadmControlPlane, s conversion.Scope) error { - return autoConvert_v1beta1_KubeadmControlPlane_To_v1alpha4_KubeadmControlPlane(in, out, s) -} - -func autoConvert_v1alpha4_KubeadmControlPlaneList_To_v1beta1_KubeadmControlPlaneList(in *KubeadmControlPlaneList, out *v1beta1.KubeadmControlPlaneList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.KubeadmControlPlane, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_KubeadmControlPlane_To_v1beta1_KubeadmControlPlane(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_KubeadmControlPlaneList_To_v1beta1_KubeadmControlPlaneList is an autogenerated conversion function. -func Convert_v1alpha4_KubeadmControlPlaneList_To_v1beta1_KubeadmControlPlaneList(in *KubeadmControlPlaneList, out *v1beta1.KubeadmControlPlaneList, s conversion.Scope) error { - return autoConvert_v1alpha4_KubeadmControlPlaneList_To_v1beta1_KubeadmControlPlaneList(in, out, s) -} - -func autoConvert_v1beta1_KubeadmControlPlaneList_To_v1alpha4_KubeadmControlPlaneList(in *v1beta1.KubeadmControlPlaneList, out *KubeadmControlPlaneList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KubeadmControlPlane, len(*in)) - for i := range *in { - if err := Convert_v1beta1_KubeadmControlPlane_To_v1alpha4_KubeadmControlPlane(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_KubeadmControlPlaneList_To_v1alpha4_KubeadmControlPlaneList is an autogenerated conversion function. -func Convert_v1beta1_KubeadmControlPlaneList_To_v1alpha4_KubeadmControlPlaneList(in *v1beta1.KubeadmControlPlaneList, out *KubeadmControlPlaneList, s conversion.Scope) error { - return autoConvert_v1beta1_KubeadmControlPlaneList_To_v1alpha4_KubeadmControlPlaneList(in, out, s) -} - -func autoConvert_v1alpha4_KubeadmControlPlaneMachineTemplate_To_v1beta1_KubeadmControlPlaneMachineTemplate(in *KubeadmControlPlaneMachineTemplate, out *v1beta1.KubeadmControlPlaneMachineTemplate, s conversion.Scope) error { - if err := apiv1alpha4.Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - out.InfrastructureRef = in.InfrastructureRef - out.NodeDrainTimeout = (*v1.Duration)(unsafe.Pointer(in.NodeDrainTimeout)) - return nil -} - -// Convert_v1alpha4_KubeadmControlPlaneMachineTemplate_To_v1beta1_KubeadmControlPlaneMachineTemplate is an autogenerated conversion function. -func Convert_v1alpha4_KubeadmControlPlaneMachineTemplate_To_v1beta1_KubeadmControlPlaneMachineTemplate(in *KubeadmControlPlaneMachineTemplate, out *v1beta1.KubeadmControlPlaneMachineTemplate, s conversion.Scope) error { - return autoConvert_v1alpha4_KubeadmControlPlaneMachineTemplate_To_v1beta1_KubeadmControlPlaneMachineTemplate(in, out, s) -} - -func autoConvert_v1beta1_KubeadmControlPlaneMachineTemplate_To_v1alpha4_KubeadmControlPlaneMachineTemplate(in *v1beta1.KubeadmControlPlaneMachineTemplate, out *KubeadmControlPlaneMachineTemplate, s conversion.Scope) error { - if err := apiv1alpha4.Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, s); err != nil { - return err - } - out.InfrastructureRef = in.InfrastructureRef - out.NodeDrainTimeout = (*v1.Duration)(unsafe.Pointer(in.NodeDrainTimeout)) - // WARNING: in.NodeVolumeDetachTimeout requires manual conversion: does not exist in peer-type - // WARNING: in.NodeDeletionTimeout requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_KubeadmControlPlaneSpec_To_v1beta1_KubeadmControlPlaneSpec(in *KubeadmControlPlaneSpec, out *v1beta1.KubeadmControlPlaneSpec, s conversion.Scope) error { - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - out.Version = in.Version - if err := Convert_v1alpha4_KubeadmControlPlaneMachineTemplate_To_v1beta1_KubeadmControlPlaneMachineTemplate(&in.MachineTemplate, &out.MachineTemplate, s); err != nil { - return err - } - if err := kubeadmapiv1alpha4.Convert_v1alpha4_KubeadmConfigSpec_To_v1beta1_KubeadmConfigSpec(&in.KubeadmConfigSpec, &out.KubeadmConfigSpec, s); err != nil { - return err - } - out.RolloutAfter = (*v1.Time)(unsafe.Pointer(in.RolloutAfter)) - out.RolloutStrategy = (*v1beta1.RolloutStrategy)(unsafe.Pointer(in.RolloutStrategy)) - return nil -} - -// Convert_v1alpha4_KubeadmControlPlaneSpec_To_v1beta1_KubeadmControlPlaneSpec is an autogenerated conversion function. -func Convert_v1alpha4_KubeadmControlPlaneSpec_To_v1beta1_KubeadmControlPlaneSpec(in *KubeadmControlPlaneSpec, out *v1beta1.KubeadmControlPlaneSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_KubeadmControlPlaneSpec_To_v1beta1_KubeadmControlPlaneSpec(in, out, s) -} - -func autoConvert_v1beta1_KubeadmControlPlaneSpec_To_v1alpha4_KubeadmControlPlaneSpec(in *v1beta1.KubeadmControlPlaneSpec, out *KubeadmControlPlaneSpec, s conversion.Scope) error { - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - out.Version = in.Version - if err := Convert_v1beta1_KubeadmControlPlaneMachineTemplate_To_v1alpha4_KubeadmControlPlaneMachineTemplate(&in.MachineTemplate, &out.MachineTemplate, s); err != nil { - return err - } - if err := kubeadmapiv1alpha4.Convert_v1beta1_KubeadmConfigSpec_To_v1alpha4_KubeadmConfigSpec(&in.KubeadmConfigSpec, &out.KubeadmConfigSpec, s); err != nil { - return err - } - // WARNING: in.RolloutBefore requires manual conversion: does not exist in peer-type - out.RolloutAfter = (*v1.Time)(unsafe.Pointer(in.RolloutAfter)) - out.RolloutStrategy = (*RolloutStrategy)(unsafe.Pointer(in.RolloutStrategy)) - // WARNING: in.RemediationStrategy requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_KubeadmControlPlaneStatus_To_v1beta1_KubeadmControlPlaneStatus(in *KubeadmControlPlaneStatus, out *v1beta1.KubeadmControlPlaneStatus, s conversion.Scope) error { - out.Selector = in.Selector - out.Replicas = in.Replicas - out.Version = (*string)(unsafe.Pointer(in.Version)) - out.UpdatedReplicas = in.UpdatedReplicas - out.ReadyReplicas = in.ReadyReplicas - out.UnavailableReplicas = in.UnavailableReplicas - out.Initialized = in.Initialized - out.Ready = in.Ready - out.FailureReason = errors.KubeadmControlPlaneStatusError(in.FailureReason) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.ObservedGeneration = in.ObservedGeneration - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1beta1.Conditions, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1alpha4_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - return nil -} - -// Convert_v1alpha4_KubeadmControlPlaneStatus_To_v1beta1_KubeadmControlPlaneStatus is an autogenerated conversion function. -func Convert_v1alpha4_KubeadmControlPlaneStatus_To_v1beta1_KubeadmControlPlaneStatus(in *KubeadmControlPlaneStatus, out *v1beta1.KubeadmControlPlaneStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_KubeadmControlPlaneStatus_To_v1beta1_KubeadmControlPlaneStatus(in, out, s) -} - -func autoConvert_v1beta1_KubeadmControlPlaneStatus_To_v1alpha4_KubeadmControlPlaneStatus(in *v1beta1.KubeadmControlPlaneStatus, out *KubeadmControlPlaneStatus, s conversion.Scope) error { - out.Selector = in.Selector - out.Replicas = in.Replicas - out.Version = (*string)(unsafe.Pointer(in.Version)) - out.UpdatedReplicas = in.UpdatedReplicas - out.ReadyReplicas = in.ReadyReplicas - out.UnavailableReplicas = in.UnavailableReplicas - out.Initialized = in.Initialized - out.Ready = in.Ready - out.FailureReason = errors.KubeadmControlPlaneStatusError(in.FailureReason) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.ObservedGeneration = in.ObservedGeneration - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1alpha4.Conditions, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1beta1_Condition_To_v1alpha4_Condition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - // WARNING: in.LastRemediation requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_KubeadmControlPlaneTemplate_To_v1beta1_KubeadmControlPlaneTemplate(in *KubeadmControlPlaneTemplate, out *v1beta1.KubeadmControlPlaneTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_KubeadmControlPlaneTemplateSpec_To_v1beta1_KubeadmControlPlaneTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_KubeadmControlPlaneTemplate_To_v1beta1_KubeadmControlPlaneTemplate is an autogenerated conversion function. -func Convert_v1alpha4_KubeadmControlPlaneTemplate_To_v1beta1_KubeadmControlPlaneTemplate(in *KubeadmControlPlaneTemplate, out *v1beta1.KubeadmControlPlaneTemplate, s conversion.Scope) error { - return autoConvert_v1alpha4_KubeadmControlPlaneTemplate_To_v1beta1_KubeadmControlPlaneTemplate(in, out, s) -} - -func autoConvert_v1beta1_KubeadmControlPlaneTemplate_To_v1alpha4_KubeadmControlPlaneTemplate(in *v1beta1.KubeadmControlPlaneTemplate, out *KubeadmControlPlaneTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_KubeadmControlPlaneTemplateSpec_To_v1alpha4_KubeadmControlPlaneTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_KubeadmControlPlaneTemplate_To_v1alpha4_KubeadmControlPlaneTemplate is an autogenerated conversion function. -func Convert_v1beta1_KubeadmControlPlaneTemplate_To_v1alpha4_KubeadmControlPlaneTemplate(in *v1beta1.KubeadmControlPlaneTemplate, out *KubeadmControlPlaneTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_KubeadmControlPlaneTemplate_To_v1alpha4_KubeadmControlPlaneTemplate(in, out, s) -} - -func autoConvert_v1alpha4_KubeadmControlPlaneTemplateList_To_v1beta1_KubeadmControlPlaneTemplateList(in *KubeadmControlPlaneTemplateList, out *v1beta1.KubeadmControlPlaneTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.KubeadmControlPlaneTemplate, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_KubeadmControlPlaneTemplate_To_v1beta1_KubeadmControlPlaneTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_KubeadmControlPlaneTemplateList_To_v1beta1_KubeadmControlPlaneTemplateList is an autogenerated conversion function. -func Convert_v1alpha4_KubeadmControlPlaneTemplateList_To_v1beta1_KubeadmControlPlaneTemplateList(in *KubeadmControlPlaneTemplateList, out *v1beta1.KubeadmControlPlaneTemplateList, s conversion.Scope) error { - return autoConvert_v1alpha4_KubeadmControlPlaneTemplateList_To_v1beta1_KubeadmControlPlaneTemplateList(in, out, s) -} - -func autoConvert_v1beta1_KubeadmControlPlaneTemplateList_To_v1alpha4_KubeadmControlPlaneTemplateList(in *v1beta1.KubeadmControlPlaneTemplateList, out *KubeadmControlPlaneTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KubeadmControlPlaneTemplate, len(*in)) - for i := range *in { - if err := Convert_v1beta1_KubeadmControlPlaneTemplate_To_v1alpha4_KubeadmControlPlaneTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_KubeadmControlPlaneTemplateList_To_v1alpha4_KubeadmControlPlaneTemplateList is an autogenerated conversion function. -func Convert_v1beta1_KubeadmControlPlaneTemplateList_To_v1alpha4_KubeadmControlPlaneTemplateList(in *v1beta1.KubeadmControlPlaneTemplateList, out *KubeadmControlPlaneTemplateList, s conversion.Scope) error { - return autoConvert_v1beta1_KubeadmControlPlaneTemplateList_To_v1alpha4_KubeadmControlPlaneTemplateList(in, out, s) -} - -func autoConvert_v1alpha4_KubeadmControlPlaneTemplateResource_To_v1beta1_KubeadmControlPlaneTemplateResource(in *KubeadmControlPlaneTemplateResource, out *v1beta1.KubeadmControlPlaneTemplateResource, s conversion.Scope) error { - if err := Convert_v1alpha4_KubeadmControlPlaneSpec_To_v1beta1_KubeadmControlPlaneTemplateResourceSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_KubeadmControlPlaneTemplateResource_To_v1beta1_KubeadmControlPlaneTemplateResource is an autogenerated conversion function. -func Convert_v1alpha4_KubeadmControlPlaneTemplateResource_To_v1beta1_KubeadmControlPlaneTemplateResource(in *KubeadmControlPlaneTemplateResource, out *v1beta1.KubeadmControlPlaneTemplateResource, s conversion.Scope) error { - return autoConvert_v1alpha4_KubeadmControlPlaneTemplateResource_To_v1beta1_KubeadmControlPlaneTemplateResource(in, out, s) -} - -func autoConvert_v1beta1_KubeadmControlPlaneTemplateResource_To_v1alpha4_KubeadmControlPlaneTemplateResource(in *v1beta1.KubeadmControlPlaneTemplateResource, out *KubeadmControlPlaneTemplateResource, s conversion.Scope) error { - // WARNING: in.ObjectMeta requires manual conversion: does not exist in peer-type - if err := Convert_v1beta1_KubeadmControlPlaneTemplateResourceSpec_To_v1alpha4_KubeadmControlPlaneSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha4_KubeadmControlPlaneTemplateSpec_To_v1beta1_KubeadmControlPlaneTemplateSpec(in *KubeadmControlPlaneTemplateSpec, out *v1beta1.KubeadmControlPlaneTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_KubeadmControlPlaneTemplateResource_To_v1beta1_KubeadmControlPlaneTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_KubeadmControlPlaneTemplateSpec_To_v1beta1_KubeadmControlPlaneTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha4_KubeadmControlPlaneTemplateSpec_To_v1beta1_KubeadmControlPlaneTemplateSpec(in *KubeadmControlPlaneTemplateSpec, out *v1beta1.KubeadmControlPlaneTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_KubeadmControlPlaneTemplateSpec_To_v1beta1_KubeadmControlPlaneTemplateSpec(in, out, s) -} - -func autoConvert_v1beta1_KubeadmControlPlaneTemplateSpec_To_v1alpha4_KubeadmControlPlaneTemplateSpec(in *v1beta1.KubeadmControlPlaneTemplateSpec, out *KubeadmControlPlaneTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta1_KubeadmControlPlaneTemplateResource_To_v1alpha4_KubeadmControlPlaneTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_KubeadmControlPlaneTemplateSpec_To_v1alpha4_KubeadmControlPlaneTemplateSpec is an autogenerated conversion function. -func Convert_v1beta1_KubeadmControlPlaneTemplateSpec_To_v1alpha4_KubeadmControlPlaneTemplateSpec(in *v1beta1.KubeadmControlPlaneTemplateSpec, out *KubeadmControlPlaneTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta1_KubeadmControlPlaneTemplateSpec_To_v1alpha4_KubeadmControlPlaneTemplateSpec(in, out, s) -} - -func autoConvert_v1alpha4_RollingUpdate_To_v1beta1_RollingUpdate(in *RollingUpdate, out *v1beta1.RollingUpdate, s conversion.Scope) error { - out.MaxSurge = (*intstr.IntOrString)(unsafe.Pointer(in.MaxSurge)) - return nil -} - -// Convert_v1alpha4_RollingUpdate_To_v1beta1_RollingUpdate is an autogenerated conversion function. -func Convert_v1alpha4_RollingUpdate_To_v1beta1_RollingUpdate(in *RollingUpdate, out *v1beta1.RollingUpdate, s conversion.Scope) error { - return autoConvert_v1alpha4_RollingUpdate_To_v1beta1_RollingUpdate(in, out, s) -} - -func autoConvert_v1beta1_RollingUpdate_To_v1alpha4_RollingUpdate(in *v1beta1.RollingUpdate, out *RollingUpdate, s conversion.Scope) error { - out.MaxSurge = (*intstr.IntOrString)(unsafe.Pointer(in.MaxSurge)) - return nil -} - -// Convert_v1beta1_RollingUpdate_To_v1alpha4_RollingUpdate is an autogenerated conversion function. -func Convert_v1beta1_RollingUpdate_To_v1alpha4_RollingUpdate(in *v1beta1.RollingUpdate, out *RollingUpdate, s conversion.Scope) error { - return autoConvert_v1beta1_RollingUpdate_To_v1alpha4_RollingUpdate(in, out, s) -} - -func autoConvert_v1alpha4_RolloutStrategy_To_v1beta1_RolloutStrategy(in *RolloutStrategy, out *v1beta1.RolloutStrategy, s conversion.Scope) error { - out.Type = v1beta1.RolloutStrategyType(in.Type) - out.RollingUpdate = (*v1beta1.RollingUpdate)(unsafe.Pointer(in.RollingUpdate)) - return nil -} - -// Convert_v1alpha4_RolloutStrategy_To_v1beta1_RolloutStrategy is an autogenerated conversion function. -func Convert_v1alpha4_RolloutStrategy_To_v1beta1_RolloutStrategy(in *RolloutStrategy, out *v1beta1.RolloutStrategy, s conversion.Scope) error { - return autoConvert_v1alpha4_RolloutStrategy_To_v1beta1_RolloutStrategy(in, out, s) -} - -func autoConvert_v1beta1_RolloutStrategy_To_v1alpha4_RolloutStrategy(in *v1beta1.RolloutStrategy, out *RolloutStrategy, s conversion.Scope) error { - out.Type = RolloutStrategyType(in.Type) - out.RollingUpdate = (*RollingUpdate)(unsafe.Pointer(in.RollingUpdate)) - return nil -} - -// Convert_v1beta1_RolloutStrategy_To_v1alpha4_RolloutStrategy is an autogenerated conversion function. -func Convert_v1beta1_RolloutStrategy_To_v1alpha4_RolloutStrategy(in *v1beta1.RolloutStrategy, out *RolloutStrategy, s conversion.Scope) error { - return autoConvert_v1beta1_RolloutStrategy_To_v1alpha4_RolloutStrategy(in, out, s) -} diff --git a/controlplane/kubeadm/api/v1alpha4/zz_generated.deepcopy.go b/controlplane/kubeadm/api/v1alpha4/zz_generated.deepcopy.go deleted file mode 100644 index 4ad231410886..000000000000 --- a/controlplane/kubeadm/api/v1alpha4/zz_generated.deepcopy.go +++ /dev/null @@ -1,302 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/intstr" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeadmControlPlane) DeepCopyInto(out *KubeadmControlPlane) { - *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 KubeadmControlPlane. -func (in *KubeadmControlPlane) DeepCopy() *KubeadmControlPlane { - if in == nil { - return nil - } - out := new(KubeadmControlPlane) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KubeadmControlPlane) 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 *KubeadmControlPlaneList) DeepCopyInto(out *KubeadmControlPlaneList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KubeadmControlPlane, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmControlPlaneList. -func (in *KubeadmControlPlaneList) DeepCopy() *KubeadmControlPlaneList { - if in == nil { - return nil - } - out := new(KubeadmControlPlaneList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KubeadmControlPlaneList) 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 *KubeadmControlPlaneMachineTemplate) DeepCopyInto(out *KubeadmControlPlaneMachineTemplate) { - *out = *in - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - out.InfrastructureRef = in.InfrastructureRef - if in.NodeDrainTimeout != nil { - in, out := &in.NodeDrainTimeout, &out.NodeDrainTimeout - *out = new(v1.Duration) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmControlPlaneMachineTemplate. -func (in *KubeadmControlPlaneMachineTemplate) DeepCopy() *KubeadmControlPlaneMachineTemplate { - if in == nil { - return nil - } - out := new(KubeadmControlPlaneMachineTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeadmControlPlaneSpec) DeepCopyInto(out *KubeadmControlPlaneSpec) { - *out = *in - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } - in.MachineTemplate.DeepCopyInto(&out.MachineTemplate) - in.KubeadmConfigSpec.DeepCopyInto(&out.KubeadmConfigSpec) - if in.RolloutAfter != nil { - in, out := &in.RolloutAfter, &out.RolloutAfter - *out = (*in).DeepCopy() - } - if in.RolloutStrategy != nil { - in, out := &in.RolloutStrategy, &out.RolloutStrategy - *out = new(RolloutStrategy) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmControlPlaneSpec. -func (in *KubeadmControlPlaneSpec) DeepCopy() *KubeadmControlPlaneSpec { - if in == nil { - return nil - } - out := new(KubeadmControlPlaneSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeadmControlPlaneStatus) DeepCopyInto(out *KubeadmControlPlaneStatus) { - *out = *in - if in.Version != nil { - in, out := &in.Version, &out.Version - *out = new(string) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1alpha4.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmControlPlaneStatus. -func (in *KubeadmControlPlaneStatus) DeepCopy() *KubeadmControlPlaneStatus { - if in == nil { - return nil - } - out := new(KubeadmControlPlaneStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeadmControlPlaneTemplate) DeepCopyInto(out *KubeadmControlPlaneTemplate) { - *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 KubeadmControlPlaneTemplate. -func (in *KubeadmControlPlaneTemplate) DeepCopy() *KubeadmControlPlaneTemplate { - if in == nil { - return nil - } - out := new(KubeadmControlPlaneTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KubeadmControlPlaneTemplate) 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 *KubeadmControlPlaneTemplateList) DeepCopyInto(out *KubeadmControlPlaneTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]KubeadmControlPlaneTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmControlPlaneTemplateList. -func (in *KubeadmControlPlaneTemplateList) DeepCopy() *KubeadmControlPlaneTemplateList { - if in == nil { - return nil - } - out := new(KubeadmControlPlaneTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *KubeadmControlPlaneTemplateList) 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 *KubeadmControlPlaneTemplateResource) DeepCopyInto(out *KubeadmControlPlaneTemplateResource) { - *out = *in - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmControlPlaneTemplateResource. -func (in *KubeadmControlPlaneTemplateResource) DeepCopy() *KubeadmControlPlaneTemplateResource { - if in == nil { - return nil - } - out := new(KubeadmControlPlaneTemplateResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *KubeadmControlPlaneTemplateSpec) DeepCopyInto(out *KubeadmControlPlaneTemplateSpec) { - *out = *in - in.Template.DeepCopyInto(&out.Template) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeadmControlPlaneTemplateSpec. -func (in *KubeadmControlPlaneTemplateSpec) DeepCopy() *KubeadmControlPlaneTemplateSpec { - if in == nil { - return nil - } - out := new(KubeadmControlPlaneTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RollingUpdate) DeepCopyInto(out *RollingUpdate) { - *out = *in - if in.MaxSurge != nil { - in, out := &in.MaxSurge, &out.MaxSurge - *out = new(intstr.IntOrString) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RollingUpdate. -func (in *RollingUpdate) DeepCopy() *RollingUpdate { - if in == nil { - return nil - } - out := new(RollingUpdate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RolloutStrategy) DeepCopyInto(out *RolloutStrategy) { - *out = *in - if in.RollingUpdate != nil { - in, out := &in.RollingUpdate, &out.RollingUpdate - *out = new(RollingUpdate) - (*in).DeepCopyInto(*out) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RolloutStrategy. -func (in *RolloutStrategy) DeepCopy() *RolloutStrategy { - if in == nil { - return nil - } - out := new(RolloutStrategy) - in.DeepCopyInto(out) - return out -} diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml index a64567ec2970..ff972248414b 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanes.yaml @@ -18,1249 +18,6 @@ spec: singular: kubeadmcontrolplane scope: Namespaced versions: - - additionalPrinterColumns: - - description: Time duration since creation of KubeadmControlPlane - jsonPath: .metadata.creationTimestamp - name: Age - type: date - - description: This denotes whether or not the control plane has the uploaded - kubeadm-config configmap - jsonPath: .status.initialized - name: Initialized - type: boolean - - description: KubeadmControlPlane API Server is ready to receive requests - jsonPath: .status.ready - name: API Server Available - type: boolean - - description: Kubernetes version associated with this control plane - jsonPath: .spec.version - name: Version - type: string - - description: Total number of non-terminated machines targeted by this control - plane - jsonPath: .status.replicas - name: Replicas - type: integer - - description: Total number of fully running and ready control plane machines - jsonPath: .status.readyReplicas - name: Ready - type: integer - - description: Total number of non-terminated machines targeted by this control - plane that have the desired template spec - jsonPath: .status.updatedReplicas - name: Updated - type: integer - - description: Total number of unavailable machines targeted by this control plane - jsonPath: .status.unavailableReplicas - name: Unavailable - type: integer - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - KubeadmControlPlane is the Schema for the KubeadmControlPlane API. - - - Deprecated: This type will be removed in one of the next releases. - 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: KubeadmControlPlaneSpec defines the desired state of KubeadmControlPlane. - properties: - kubeadmConfigSpec: - description: |- - KubeadmConfigSpec is a KubeadmConfigSpec - to use for initializing and joining machines to the control plane. - properties: - clusterConfiguration: - description: ClusterConfiguration along with InitConfiguration - are the configurations necessary for the init command - properties: - apiServer: - description: APIServer contains extra settings for the API - server control plane component - properties: - certSANs: - description: CertSANs sets extra Subject Alternative Names - for the API Server signing cert. - items: - type: string - type: array - extraArgs: - additionalProperties: - type: string - description: |- - ExtraArgs is an extra set of flags to pass to the control plane component. - TODO: This is temporary and ideally we would like to switch all components to - use ComponentConfig + ConfigMaps. - type: object - extraVolumes: - description: ExtraVolumes is an extra set of host volumes, - mounted to the control plane component. - items: - description: |- - HostPathMount contains elements describing volumes that are mounted from the - host. - properties: - hostPath: - description: |- - HostPath is the path in the host that will be mounted inside - the pod. - type: string - mountPath: - description: MountPath is the path inside the pod - where hostPath will be mounted. - type: string - name: - description: Name of the volume inside the pod template. - type: string - pathType: - description: PathType is the type of the HostPath. - type: string - readOnly: - description: ReadOnly controls write access to the - volume - type: boolean - required: - - hostPath - - mountPath - - name - type: object - type: array - timeoutForControlPlane: - description: TimeoutForControlPlane controls the timeout - that we use for API server to appear - type: string - type: object - 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 - certificatesDir: - description: |- - CertificatesDir specifies where to store or look for all required certificates. - NB: if not provided, this will default to `/etc/kubernetes/pki` - type: string - clusterName: - description: The cluster name - type: string - controlPlaneEndpoint: - description: |- - ControlPlaneEndpoint sets a stable IP address or DNS name for the control plane; it - can be a valid IP address or a RFC-1123 DNS subdomain, both with optional TCP port. - In case the ControlPlaneEndpoint is not specified, the AdvertiseAddress + BindPort - are used; in case the ControlPlaneEndpoint is specified but without a TCP port, - the BindPort is used. - Possible usages are: - e.g. In a cluster with more than one control plane instances, this field should be - assigned the address of the external load balancer in front of the - control plane instances. - e.g. in environments with enforced node recycling, the ControlPlaneEndpoint - could be used for assigning a stable DNS to the control plane. - NB: This value defaults to the first value in the Cluster object status.apiEndpoints array. - type: string - controllerManager: - description: ControllerManager contains extra settings for - the controller manager control plane component - properties: - extraArgs: - additionalProperties: - type: string - description: |- - ExtraArgs is an extra set of flags to pass to the control plane component. - TODO: This is temporary and ideally we would like to switch all components to - use ComponentConfig + ConfigMaps. - type: object - extraVolumes: - description: ExtraVolumes is an extra set of host volumes, - mounted to the control plane component. - items: - description: |- - HostPathMount contains elements describing volumes that are mounted from the - host. - properties: - hostPath: - description: |- - HostPath is the path in the host that will be mounted inside - the pod. - type: string - mountPath: - description: MountPath is the path inside the pod - where hostPath will be mounted. - type: string - name: - description: Name of the volume inside the pod template. - type: string - pathType: - description: PathType is the type of the HostPath. - type: string - readOnly: - description: ReadOnly controls write access to the - volume - type: boolean - required: - - hostPath - - mountPath - - name - type: object - type: array - type: object - dns: - description: DNS defines the options for the DNS add-on installed - in the cluster. - properties: - imageRepository: - description: |- - ImageRepository sets the container registry to pull images from. - if not set, the ImageRepository defined in ClusterConfiguration will be used instead. - type: string - imageTag: - description: |- - ImageTag allows to specify a tag for the image. - In case this value is set, kubeadm does not change automatically the version of the above components during upgrades. - type: string - type: object - etcd: - description: |- - Etcd holds configuration for etcd. - NB: This value defaults to a Local (stacked) etcd - properties: - external: - description: |- - External describes how to connect to an external etcd cluster - Local and External are mutually exclusive - properties: - caFile: - description: |- - CAFile is an SSL Certificate Authority file used to secure etcd communication. - Required if using a TLS connection. - type: string - certFile: - description: |- - CertFile is an SSL certification file used to secure etcd communication. - Required if using a TLS connection. - type: string - endpoints: - description: Endpoints of etcd members. Required for - ExternalEtcd. - items: - type: string - type: array - keyFile: - description: |- - KeyFile is an SSL key file used to secure etcd communication. - Required if using a TLS connection. - type: string - required: - - caFile - - certFile - - endpoints - - keyFile - type: object - local: - description: |- - Local provides configuration knobs for configuring the local etcd instance - Local and External are mutually exclusive - properties: - dataDir: - description: |- - DataDir is the directory etcd will place its data. - Defaults to "/var/lib/etcd". - type: string - extraArgs: - additionalProperties: - type: string - description: |- - ExtraArgs are extra arguments provided to the etcd binary - when run inside a static pod. - type: object - imageRepository: - description: |- - ImageRepository sets the container registry to pull images from. - if not set, the ImageRepository defined in ClusterConfiguration will be used instead. - type: string - imageTag: - description: |- - ImageTag allows to specify a tag for the image. - In case this value is set, kubeadm does not change automatically the version of the above components during upgrades. - type: string - peerCertSANs: - description: PeerCertSANs sets extra Subject Alternative - Names for the etcd peer signing cert. - items: - type: string - type: array - serverCertSANs: - description: ServerCertSANs sets extra Subject Alternative - Names for the etcd server signing cert. - items: - type: string - type: array - type: object - type: object - featureGates: - additionalProperties: - type: boolean - description: FeatureGates enabled by the user. - type: object - imageRepository: - description: |- - ImageRepository sets the container registry to pull images from. - If empty, `registry.k8s.io` will be used by default; in case of kubernetes version is a CI build (kubernetes version starts with `ci/` or `ci-cross/`) - `gcr.io/k8s-staging-ci-images` will be used as a default for control plane components and for kube-proxy, while `registry.k8s.io` - will be used for all the other images. - 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 - kubernetesVersion: - description: |- - KubernetesVersion is the target version of the control plane. - NB: This value defaults to the Machine object spec.version - type: string - networking: - description: |- - Networking holds configuration for the networking topology of the cluster. - NB: This value defaults to the Cluster object spec.clusterNetwork. - properties: - dnsDomain: - description: DNSDomain is the dns domain used by k8s services. - Defaults to "cluster.local". - type: string - podSubnet: - description: |- - PodSubnet is the subnet used by pods. - If unset, the API server will not allocate CIDR ranges for every node. - Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.services.cidrBlocks if that is set - type: string - serviceSubnet: - description: |- - ServiceSubnet is the subnet used by k8s services. - Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.pods.cidrBlocks, or - to "10.96.0.0/12" if that's unset. - type: string - type: object - scheduler: - description: Scheduler contains extra settings for the scheduler - control plane component - properties: - extraArgs: - additionalProperties: - type: string - description: |- - ExtraArgs is an extra set of flags to pass to the control plane component. - TODO: This is temporary and ideally we would like to switch all components to - use ComponentConfig + ConfigMaps. - type: object - extraVolumes: - description: ExtraVolumes is an extra set of host volumes, - mounted to the control plane component. - items: - description: |- - HostPathMount contains elements describing volumes that are mounted from the - host. - properties: - hostPath: - description: |- - HostPath is the path in the host that will be mounted inside - the pod. - type: string - mountPath: - description: MountPath is the path inside the pod - where hostPath will be mounted. - type: string - name: - description: Name of the volume inside the pod template. - type: string - pathType: - description: PathType is the type of the HostPath. - type: string - readOnly: - description: ReadOnly controls write access to the - volume - type: boolean - required: - - hostPath - - mountPath - - name - type: object - type: array - type: object - type: object - diskSetup: - description: DiskSetup specifies options for the creation of partition - tables and file systems on devices. - properties: - filesystems: - description: Filesystems specifies the list of file systems - to setup. - items: - description: Filesystem defines the file systems to be created. - properties: - device: - description: Device specifies the device name - type: string - extraOpts: - description: ExtraOpts defined extra options to add - to the command for creating the file system. - items: - type: string - type: array - filesystem: - description: Filesystem specifies the file system type. - type: string - label: - description: Label specifies the file system label to - be used. If set to None, no label is used. - type: string - overwrite: - description: |- - Overwrite defines whether or not to overwrite any existing filesystem. - If true, any pre-existing file system will be destroyed. Use with Caution. - type: boolean - partition: - description: 'Partition specifies the partition to use. - The valid options are: "auto|any", "auto", "any", - "none", and , where NUM is the actual partition - number.' - type: string - replaceFS: - description: |- - ReplaceFS is a special directive, used for Microsoft Azure that instructs cloud-init to replace a file system of . - NOTE: unless you define a label, this requires the use of the 'any' partition directive. - type: string - required: - - device - - filesystem - - label - type: object - type: array - partitions: - description: Partitions specifies the list of the partitions - to setup. - items: - description: Partition defines how to create and layout - a partition. - properties: - device: - description: Device is the name of the device. - type: string - layout: - description: |- - Layout specifies the device layout. - If it is true, a single partition will be created for the entire device. - When layout is false, it means don't partition or ignore existing partitioning. - type: boolean - overwrite: - description: |- - Overwrite describes whether to skip checks and create the partition if a partition or filesystem is found on the device. - Use with caution. Default is 'false'. - type: boolean - tableType: - description: |- - TableType specifies the tupe of partition table. The following are supported: - 'mbr': default and setups a MS-DOS partition table - 'gpt': setups a GPT partition table - type: string - required: - - device - - layout - type: object - type: array - type: object - files: - description: Files specifies extra files to be passed to user_data - upon creation. - items: - description: File defines the input for generating write_files - in cloud-init. - properties: - content: - description: Content is the actual content of the file. - type: string - contentFrom: - description: ContentFrom is a referenced source of content - to populate the file. - properties: - secret: - description: Secret represents a secret that should - populate this file. - properties: - key: - description: Key is the key in the secret's data - map for this value. - type: string - name: - description: Name of the secret in the KubeadmBootstrapConfig's - namespace to use. - type: string - required: - - key - - name - type: object - required: - - secret - type: object - encoding: - description: Encoding specifies the encoding of the file - contents. - enum: - - base64 - - gzip - - gzip+base64 - type: string - owner: - description: Owner specifies the ownership of the file, - e.g. "root:root". - type: string - path: - description: Path specifies the full path on disk where - to store the file. - type: string - permissions: - description: Permissions specifies the permissions to assign - to the file, e.g. "0640". - type: string - required: - - path - type: object - type: array - format: - description: Format specifies the output format of the bootstrap - data - enum: - - cloud-config - type: string - initConfiguration: - description: InitConfiguration along with ClusterConfiguration - are the configurations necessary for the init command - 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 - bootstrapTokens: - description: |- - BootstrapTokens is respected at `kubeadm init` time and describes a set of Bootstrap Tokens to create. - This information IS NOT uploaded to the kubeadm cluster configmap, partly because of its sensitive nature - items: - description: BootstrapToken describes one bootstrap token, - stored as a Secret in the cluster. - properties: - description: - description: |- - Description sets a human-friendly message why this token exists and what it's used - for, so other administrators can know its purpose. - type: string - expires: - description: |- - Expires specifies the timestamp when this token expires. Defaults to being set - dynamically at runtime based on the TTL. Expires and TTL are mutually exclusive. - format: date-time - type: string - groups: - description: |- - Groups specifies the extra groups that this token will authenticate as when/if - used for authentication - items: - type: string - type: array - token: - description: |- - Token is used for establishing bidirectional trust between nodes and control-planes. - Used for joining nodes in the cluster. - type: string - ttl: - description: |- - TTL defines the time to live for this token. Defaults to 24h. - Expires and TTL are mutually exclusive. - type: string - usages: - description: |- - Usages describes the ways in which this token can be used. Can by default be used - for establishing bidirectional trust, but that can be changed here. - items: - type: string - type: array - required: - - token - type: object - type: array - 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 - localAPIEndpoint: - description: |- - LocalAPIEndpoint represents the endpoint of the API server instance that's deployed on this control plane node - In HA setups, this differs from ClusterConfiguration.ControlPlaneEndpoint in the sense that ControlPlaneEndpoint - is the global endpoint for the cluster, which then loadbalances the requests to each individual API server. This - configuration object lets you customize what IP/DNS name and port the local API server advertises it's accessible - on. By default, kubeadm tries to auto-detect the IP of the default interface and use that, but in case that process - fails you may set the desired value here. - properties: - advertiseAddress: - description: AdvertiseAddress sets the IP address for - the API server to advertise. - type: string - bindPort: - description: |- - BindPort sets the secure port for the API Server to bind to. - Defaults to 6443. - format: int32 - type: integer - type: object - nodeRegistration: - description: |- - NodeRegistration holds fields that relate to registering the new control-plane node to the cluster. - When used in the context of control plane nodes, NodeRegistration should remain consistent - across both InitConfiguration and JoinConfiguration - properties: - criSocket: - description: CRISocket is used to retrieve container runtime - info. This information will be annotated to the Node - API object, for later re-use - type: string - ignorePreflightErrors: - description: IgnorePreflightErrors provides a slice of - pre-flight errors to be ignored when the current node - is registered. - items: - type: string - type: array - kubeletExtraArgs: - additionalProperties: - type: string - description: |- - KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file - kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config-1.X ConfigMap - Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on. - type: object - name: - description: |- - Name is the `.Metadata.Name` field of the Node API object that will be created in this `kubeadm init` or `kubeadm join` operation. - This field is also used in the CommonName field of the kubelet's client certificate to the API server. - Defaults to the hostname of the node if not provided. - type: string - taints: - description: |- - Taints specifies the taints the Node API object should be registered with. If this field is unset, i.e. nil, in the `kubeadm init` process - it will be defaulted to []v1.Taint{'node-role.kubernetes.io/master=""'}. If you don't want to taint your control-plane node, set this field to an - empty slice, i.e. `taints: {}` in the YAML file. This field is solely used for Node registration. - items: - description: |- - The node this Taint is attached to has the "effect" on - any pod that does not tolerate the Taint. - properties: - effect: - description: |- - Required. The effect of the taint on pods - that do not tolerate the taint. - Valid effects are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Required. The taint key to be applied - to a node. - type: string - timeAdded: - description: |- - TimeAdded represents the time at which the taint was added. - It is only written for NoExecute taints. - format: date-time - type: string - value: - description: The taint value corresponding to the - taint key. - type: string - required: - - effect - - key - type: object - type: array - type: object - type: object - joinConfiguration: - description: JoinConfiguration is the kubeadm configuration for - the join command - 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 - caCertPath: - description: |- - CACertPath is the path to the SSL certificate authority used to - secure comunications between node and control-plane. - Defaults to "/etc/kubernetes/pki/ca.crt". - TODO: revisit when there is defaulting from k/k - type: string - controlPlane: - description: |- - ControlPlane defines the additional control plane instance to be deployed on the joining node. - If nil, no additional control plane instance will be deployed. - properties: - localAPIEndpoint: - description: LocalAPIEndpoint represents the endpoint - of the API server instance to be deployed on this node. - properties: - advertiseAddress: - description: AdvertiseAddress sets the IP address - for the API server to advertise. - type: string - bindPort: - description: |- - BindPort sets the secure port for the API Server to bind to. - Defaults to 6443. - format: int32 - type: integer - type: object - type: object - discovery: - description: |- - Discovery specifies the options for the kubelet to use during the TLS Bootstrap process - TODO: revisit when there is defaulting from k/k - properties: - bootstrapToken: - description: |- - BootstrapToken is used to set the options for bootstrap token based discovery - BootstrapToken and File are mutually exclusive - properties: - apiServerEndpoint: - description: APIServerEndpoint is an IP or domain - name to the API server from which info will be fetched. - type: string - caCertHashes: - description: |- - CACertHashes specifies a set of public key pins to verify - when token-based discovery is used. The root CA found during discovery - must match one of these values. Specifying an empty set disables root CA - pinning, which can be unsafe. Each hash is specified as ":", - where the only currently supported type is "sha256". This is a hex-encoded - SHA-256 hash of the Subject Public Key Info (SPKI) object in DER-encoded - ASN.1. These hashes can be calculated using, for example, OpenSSL: - openssl x509 -pubkey -in ca.crt openssl rsa -pubin -outform der 2>&/dev/null | openssl dgst -sha256 -hex - items: - type: string - type: array - token: - description: |- - Token is a token used to validate cluster information - fetched from the control-plane. - type: string - unsafeSkipCAVerification: - description: |- - UnsafeSkipCAVerification allows token-based discovery - without CA verification via CACertHashes. This can weaken - the security of kubeadm since other nodes can impersonate the control-plane. - type: boolean - required: - - token - type: object - file: - description: |- - File is used to specify a file or URL to a kubeconfig file from which to load cluster information - BootstrapToken and File are mutually exclusive - properties: - kubeConfigPath: - description: KubeConfigPath is used to specify the - actual file path or URL to the kubeconfig file from - which to load cluster information - type: string - required: - - kubeConfigPath - type: object - timeout: - description: Timeout modifies the discovery timeout - type: string - tlsBootstrapToken: - description: |- - TLSBootstrapToken is a token used for TLS bootstrapping. - If .BootstrapToken is set, this field is defaulted to .BootstrapToken.Token, but can be overridden. - If .File is set, this field **must be set** in case the KubeConfigFile does not contain any other authentication information - type: string - type: object - 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 - nodeRegistration: - description: |- - NodeRegistration holds fields that relate to registering the new control-plane node to the cluster. - When used in the context of control plane nodes, NodeRegistration should remain consistent - across both InitConfiguration and JoinConfiguration - properties: - criSocket: - description: CRISocket is used to retrieve container runtime - info. This information will be annotated to the Node - API object, for later re-use - type: string - ignorePreflightErrors: - description: IgnorePreflightErrors provides a slice of - pre-flight errors to be ignored when the current node - is registered. - items: - type: string - type: array - kubeletExtraArgs: - additionalProperties: - type: string - description: |- - KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file - kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config-1.X ConfigMap - Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on. - type: object - name: - description: |- - Name is the `.Metadata.Name` field of the Node API object that will be created in this `kubeadm init` or `kubeadm join` operation. - This field is also used in the CommonName field of the kubelet's client certificate to the API server. - Defaults to the hostname of the node if not provided. - type: string - taints: - description: |- - Taints specifies the taints the Node API object should be registered with. If this field is unset, i.e. nil, in the `kubeadm init` process - it will be defaulted to []v1.Taint{'node-role.kubernetes.io/master=""'}. If you don't want to taint your control-plane node, set this field to an - empty slice, i.e. `taints: {}` in the YAML file. This field is solely used for Node registration. - items: - description: |- - The node this Taint is attached to has the "effect" on - any pod that does not tolerate the Taint. - properties: - effect: - description: |- - Required. The effect of the taint on pods - that do not tolerate the taint. - Valid effects are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Required. The taint key to be applied - to a node. - type: string - timeAdded: - description: |- - TimeAdded represents the time at which the taint was added. - It is only written for NoExecute taints. - format: date-time - type: string - value: - description: The taint value corresponding to the - taint key. - type: string - required: - - effect - - key - type: object - type: array - type: object - type: object - mounts: - description: Mounts specifies a list of mount points to be setup. - items: - description: MountPoints defines input for generated mounts - in cloud-init. - items: - type: string - type: array - type: array - ntp: - description: NTP specifies NTP configuration - properties: - enabled: - description: Enabled specifies whether NTP should be enabled - type: boolean - servers: - description: Servers specifies which NTP servers to use - items: - type: string - type: array - type: object - postKubeadmCommands: - description: PostKubeadmCommands specifies extra commands to run - after kubeadm runs - items: - type: string - type: array - preKubeadmCommands: - description: PreKubeadmCommands specifies extra commands to run - before kubeadm runs - items: - type: string - type: array - useExperimentalRetryJoin: - description: |- - UseExperimentalRetryJoin replaces a basic kubeadm command with a shell - script with retries for joins. - - - This is meant to be an experimental temporary workaround on some environments - where joins fail due to timing (and other issues). The long term goal is to add retries to - kubeadm proper and use that functionality. - - - This will add about 40KB to userdata - - - For more information, refer to https://github.com/kubernetes-sigs/cluster-api/pull/2763#discussion_r397306055. - type: boolean - users: - description: Users specifies extra users to add - items: - description: User defines the input for a generated user in - cloud-init. - properties: - gecos: - description: Gecos specifies the gecos to use for the user - type: string - groups: - description: Groups specifies the additional groups for - the user - type: string - homeDir: - description: HomeDir specifies the home directory to use - for the user - type: string - inactive: - description: Inactive specifies whether to mark the user - as inactive - type: boolean - lockPassword: - description: LockPassword specifies if password login should - be disabled - type: boolean - name: - description: Name specifies the user name - type: string - passwd: - description: Passwd specifies a hashed password for the - user - type: string - primaryGroup: - description: PrimaryGroup specifies the primary group for - the user - type: string - shell: - description: Shell specifies the user's shell - type: string - sshAuthorizedKeys: - description: SSHAuthorizedKeys specifies a list of ssh authorized - keys for the user - items: - type: string - type: array - sudo: - description: Sudo specifies a sudo role for the user - type: string - required: - - name - type: object - type: array - verbosity: - description: |- - Verbosity is the number for the kubeadm log level verbosity. - It overrides the `--v` flag in kubeadm commands. - format: int32 - type: integer - type: object - machineTemplate: - description: |- - MachineTemplate contains information about how machines - should be shaped when creating or updating a control plane. - properties: - infrastructureRef: - description: |- - InfrastructureRef is a required reference to a custom resource - offered by an infrastructure provider. - 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 - metadata: - description: |- - Standard object's metadata. - More info: 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 - nodeDrainTimeout: - description: |- - NodeDrainTimeout is the total amount of time that the controller will spend on draining a controlplane node - The default value is 0, meaning that the node can be drained without any time limitations. - NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` - type: string - required: - - infrastructureRef - type: object - replicas: - description: |- - Number of desired machines. Defaults to 1. When stacked etcd is used only - odd numbers are permitted, as per [etcd best practice](https://etcd.io/docs/v3.3.12/faq/#why-an-odd-number-of-cluster-members). - This is a pointer to distinguish between explicit zero and not specified. - format: int32 - type: integer - rolloutAfter: - description: |- - RolloutAfter is a field to indicate a rollout should be performed - after the specified time even if no changes have been made to the - KubeadmControlPlane. - format: date-time - type: string - rolloutStrategy: - default: - rollingUpdate: - maxSurge: 1 - type: RollingUpdate - description: |- - The RolloutStrategy to use to replace control plane machines with - new ones. - properties: - rollingUpdate: - description: |- - Rolling update config params. Present only if - RolloutStrategyType = RollingUpdate. - properties: - maxSurge: - anyOf: - - type: integer - - type: string - description: |- - The maximum number of control planes that can be scheduled above or under the - desired number of control planes. - Value can be an absolute number 1 or 0. - Defaults to 1. - Example: when this is set to 1, the control plane can be scaled - up immediately when the rolling update starts. - x-kubernetes-int-or-string: true - type: object - type: - description: |- - Type of rollout. Currently the only supported strategy is - "RollingUpdate". - Default is RollingUpdate. - type: string - type: object - version: - description: Version defines the desired Kubernetes version. - type: string - required: - - kubeadmConfigSpec - - machineTemplate - - version - type: object - status: - description: KubeadmControlPlaneStatus defines the observed state of KubeadmControlPlane. - properties: - conditions: - description: Conditions defines current service state of the KubeadmControlPlane. - 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: |- - ErrorMessage indicates that there is a terminal problem reconciling the - state, and will be set to a descriptive error message. - type: string - failureReason: - description: |- - FailureReason indicates that there is a terminal problem reconciling the - state, and will be set to a token value suitable for - programmatic interpretation. - type: string - initialized: - description: |- - Initialized denotes whether or not the control plane has the - uploaded kubeadm-config configmap. - type: boolean - observedGeneration: - description: ObservedGeneration is the latest generation observed - by the controller. - format: int64 - type: integer - ready: - description: |- - Ready denotes that the KubeadmControlPlane API Server is ready to - receive requests. - type: boolean - readyReplicas: - description: Total number of fully running and ready control plane - machines. - format: int32 - type: integer - replicas: - description: |- - Total number of non-terminated machines targeted by this control plane - (their labels match the selector). - format: int32 - type: integer - selector: - description: |- - Selector is the label selector in string format to avoid introspection - by clients, and is used to provide the CRD-based integration for the - scale subresource and additional integrations for things like kubectl - describe.. The string will be in the same format as the query-param syntax. - More info about label selectors: http://kubernetes.io/docs/user-guide/labels#label-selectors - type: string - unavailableReplicas: - description: |- - Total number of unavailable machines targeted by this control plane. - This is the total number of machines that are still required for - the deployment to have 100% available capacity. They may either - be machines that are running but not yet ready or machines - that still have not been created. - format: int32 - type: integer - updatedReplicas: - description: |- - Total number of non-terminated machines targeted by this control plane - that have the desired template spec. - format: int32 - type: integer - version: - description: |- - Version represents the minimum Kubernetes version for the control plane machines - in the cluster. - type: string - type: object - type: object - served: false - storage: false - subresources: - scale: - labelSelectorPath: .status.selector - specReplicasPath: .spec.replicas - statusReplicasPath: .status.replicas - status: {} - additionalPrinterColumns: - description: Cluster jsonPath: .metadata.labels['cluster\.x-k8s\.io/cluster-name'] diff --git a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml index 08221777769b..9e9ef432b0d1 100644 --- a/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml +++ b/controlplane/kubeadm/config/crd/bases/controlplane.cluster.x-k8s.io_kubeadmcontrolplanetemplates.yaml @@ -16,1135 +16,6 @@ spec: singular: kubeadmcontrolplanetemplate scope: Namespaced versions: - - additionalPrinterColumns: - - description: Time duration since creation of KubeadmControlPlaneTemplate - jsonPath: .metadata.creationTimestamp - name: Age - type: date - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - KubeadmControlPlaneTemplate is the Schema for the kubeadmcontrolplanetemplates API. - - - Deprecated: This type will be removed in one of the next releases. - 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: KubeadmControlPlaneTemplateSpec defines the desired state - of KubeadmControlPlaneTemplate. - properties: - template: - description: KubeadmControlPlaneTemplateResource describes the data - needed to create a KubeadmControlPlane from a template. - properties: - spec: - description: KubeadmControlPlaneSpec defines the desired state - of KubeadmControlPlane. - properties: - kubeadmConfigSpec: - description: |- - KubeadmConfigSpec is a KubeadmConfigSpec - to use for initializing and joining machines to the control plane. - properties: - clusterConfiguration: - description: ClusterConfiguration along with InitConfiguration - are the configurations necessary for the init command - properties: - apiServer: - description: APIServer contains extra settings for - the API server control plane component - properties: - certSANs: - description: CertSANs sets extra Subject Alternative - Names for the API Server signing cert. - items: - type: string - type: array - extraArgs: - additionalProperties: - type: string - description: |- - ExtraArgs is an extra set of flags to pass to the control plane component. - TODO: This is temporary and ideally we would like to switch all components to - use ComponentConfig + ConfigMaps. - type: object - extraVolumes: - description: ExtraVolumes is an extra set of host - volumes, mounted to the control plane component. - items: - description: |- - HostPathMount contains elements describing volumes that are mounted from the - host. - properties: - hostPath: - description: |- - HostPath is the path in the host that will be mounted inside - the pod. - type: string - mountPath: - description: MountPath is the path inside - the pod where hostPath will be mounted. - type: string - name: - description: Name of the volume inside the - pod template. - type: string - pathType: - description: PathType is the type of the - HostPath. - type: string - readOnly: - description: ReadOnly controls write access - to the volume - type: boolean - required: - - hostPath - - mountPath - - name - type: object - type: array - timeoutForControlPlane: - description: TimeoutForControlPlane controls the - timeout that we use for API server to appear - type: string - type: object - 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 - certificatesDir: - description: |- - CertificatesDir specifies where to store or look for all required certificates. - NB: if not provided, this will default to `/etc/kubernetes/pki` - type: string - clusterName: - description: The cluster name - type: string - controlPlaneEndpoint: - description: |- - ControlPlaneEndpoint sets a stable IP address or DNS name for the control plane; it - can be a valid IP address or a RFC-1123 DNS subdomain, both with optional TCP port. - In case the ControlPlaneEndpoint is not specified, the AdvertiseAddress + BindPort - are used; in case the ControlPlaneEndpoint is specified but without a TCP port, - the BindPort is used. - Possible usages are: - e.g. In a cluster with more than one control plane instances, this field should be - assigned the address of the external load balancer in front of the - control plane instances. - e.g. in environments with enforced node recycling, the ControlPlaneEndpoint - could be used for assigning a stable DNS to the control plane. - NB: This value defaults to the first value in the Cluster object status.apiEndpoints array. - type: string - controllerManager: - description: ControllerManager contains extra settings - for the controller manager control plane component - properties: - extraArgs: - additionalProperties: - type: string - description: |- - ExtraArgs is an extra set of flags to pass to the control plane component. - TODO: This is temporary and ideally we would like to switch all components to - use ComponentConfig + ConfigMaps. - type: object - extraVolumes: - description: ExtraVolumes is an extra set of host - volumes, mounted to the control plane component. - items: - description: |- - HostPathMount contains elements describing volumes that are mounted from the - host. - properties: - hostPath: - description: |- - HostPath is the path in the host that will be mounted inside - the pod. - type: string - mountPath: - description: MountPath is the path inside - the pod where hostPath will be mounted. - type: string - name: - description: Name of the volume inside the - pod template. - type: string - pathType: - description: PathType is the type of the - HostPath. - type: string - readOnly: - description: ReadOnly controls write access - to the volume - type: boolean - required: - - hostPath - - mountPath - - name - type: object - type: array - type: object - dns: - description: DNS defines the options for the DNS add-on - installed in the cluster. - properties: - imageRepository: - description: |- - ImageRepository sets the container registry to pull images from. - if not set, the ImageRepository defined in ClusterConfiguration will be used instead. - type: string - imageTag: - description: |- - ImageTag allows to specify a tag for the image. - In case this value is set, kubeadm does not change automatically the version of the above components during upgrades. - type: string - type: object - etcd: - description: |- - Etcd holds configuration for etcd. - NB: This value defaults to a Local (stacked) etcd - properties: - external: - description: |- - External describes how to connect to an external etcd cluster - Local and External are mutually exclusive - properties: - caFile: - description: |- - CAFile is an SSL Certificate Authority file used to secure etcd communication. - Required if using a TLS connection. - type: string - certFile: - description: |- - CertFile is an SSL certification file used to secure etcd communication. - Required if using a TLS connection. - type: string - endpoints: - description: Endpoints of etcd members. Required - for ExternalEtcd. - items: - type: string - type: array - keyFile: - description: |- - KeyFile is an SSL key file used to secure etcd communication. - Required if using a TLS connection. - type: string - required: - - caFile - - certFile - - endpoints - - keyFile - type: object - local: - description: |- - Local provides configuration knobs for configuring the local etcd instance - Local and External are mutually exclusive - properties: - dataDir: - description: |- - DataDir is the directory etcd will place its data. - Defaults to "/var/lib/etcd". - type: string - extraArgs: - additionalProperties: - type: string - description: |- - ExtraArgs are extra arguments provided to the etcd binary - when run inside a static pod. - type: object - imageRepository: - description: |- - ImageRepository sets the container registry to pull images from. - if not set, the ImageRepository defined in ClusterConfiguration will be used instead. - type: string - imageTag: - description: |- - ImageTag allows to specify a tag for the image. - In case this value is set, kubeadm does not change automatically the version of the above components during upgrades. - type: string - peerCertSANs: - description: PeerCertSANs sets extra Subject - Alternative Names for the etcd peer signing - cert. - items: - type: string - type: array - serverCertSANs: - description: ServerCertSANs sets extra Subject - Alternative Names for the etcd server signing - cert. - items: - type: string - type: array - type: object - type: object - featureGates: - additionalProperties: - type: boolean - description: FeatureGates enabled by the user. - type: object - imageRepository: - description: |- - ImageRepository sets the container registry to pull images from. - If empty, `registry.k8s.io` will be used by default; in case of kubernetes version is a CI build (kubernetes version starts with `ci/` or `ci-cross/`) - `gcr.io/k8s-staging-ci-images` will be used as a default for control plane components and for kube-proxy, while `registry.k8s.io` - will be used for all the other images. - 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 - kubernetesVersion: - description: |- - KubernetesVersion is the target version of the control plane. - NB: This value defaults to the Machine object spec.version - type: string - networking: - description: |- - Networking holds configuration for the networking topology of the cluster. - NB: This value defaults to the Cluster object spec.clusterNetwork. - properties: - dnsDomain: - description: DNSDomain is the dns domain used - by k8s services. Defaults to "cluster.local". - type: string - podSubnet: - description: |- - PodSubnet is the subnet used by pods. - If unset, the API server will not allocate CIDR ranges for every node. - Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.services.cidrBlocks if that is set - type: string - serviceSubnet: - description: |- - ServiceSubnet is the subnet used by k8s services. - Defaults to a comma-delimited string of the Cluster object's spec.clusterNetwork.pods.cidrBlocks, or - to "10.96.0.0/12" if that's unset. - type: string - type: object - scheduler: - description: Scheduler contains extra settings for - the scheduler control plane component - properties: - extraArgs: - additionalProperties: - type: string - description: |- - ExtraArgs is an extra set of flags to pass to the control plane component. - TODO: This is temporary and ideally we would like to switch all components to - use ComponentConfig + ConfigMaps. - type: object - extraVolumes: - description: ExtraVolumes is an extra set of host - volumes, mounted to the control plane component. - items: - description: |- - HostPathMount contains elements describing volumes that are mounted from the - host. - properties: - hostPath: - description: |- - HostPath is the path in the host that will be mounted inside - the pod. - type: string - mountPath: - description: MountPath is the path inside - the pod where hostPath will be mounted. - type: string - name: - description: Name of the volume inside the - pod template. - type: string - pathType: - description: PathType is the type of the - HostPath. - type: string - readOnly: - description: ReadOnly controls write access - to the volume - type: boolean - required: - - hostPath - - mountPath - - name - type: object - type: array - type: object - type: object - diskSetup: - description: DiskSetup specifies options for the creation - of partition tables and file systems on devices. - properties: - filesystems: - description: Filesystems specifies the list of file - systems to setup. - items: - description: Filesystem defines the file systems - to be created. - properties: - device: - description: Device specifies the device name - type: string - extraOpts: - description: ExtraOpts defined extra options - to add to the command for creating the file - system. - items: - type: string - type: array - filesystem: - description: Filesystem specifies the file system - type. - type: string - label: - description: Label specifies the file system - label to be used. If set to None, no label - is used. - type: string - overwrite: - description: |- - Overwrite defines whether or not to overwrite any existing filesystem. - If true, any pre-existing file system will be destroyed. Use with Caution. - type: boolean - partition: - description: 'Partition specifies the partition - to use. The valid options are: "auto|any", - "auto", "any", "none", and , where NUM - is the actual partition number.' - type: string - replaceFS: - description: |- - ReplaceFS is a special directive, used for Microsoft Azure that instructs cloud-init to replace a file system of . - NOTE: unless you define a label, this requires the use of the 'any' partition directive. - type: string - required: - - device - - filesystem - - label - type: object - type: array - partitions: - description: Partitions specifies the list of the - partitions to setup. - items: - description: Partition defines how to create and - layout a partition. - properties: - device: - description: Device is the name of the device. - type: string - layout: - description: |- - Layout specifies the device layout. - If it is true, a single partition will be created for the entire device. - When layout is false, it means don't partition or ignore existing partitioning. - type: boolean - overwrite: - description: |- - Overwrite describes whether to skip checks and create the partition if a partition or filesystem is found on the device. - Use with caution. Default is 'false'. - type: boolean - tableType: - description: |- - TableType specifies the tupe of partition table. The following are supported: - 'mbr': default and setups a MS-DOS partition table - 'gpt': setups a GPT partition table - type: string - required: - - device - - layout - type: object - type: array - type: object - files: - description: Files specifies extra files to be passed - to user_data upon creation. - items: - description: File defines the input for generating write_files - in cloud-init. - properties: - content: - description: Content is the actual content of the - file. - type: string - contentFrom: - description: ContentFrom is a referenced source - of content to populate the file. - properties: - secret: - description: Secret represents a secret that - should populate this file. - properties: - key: - description: Key is the key in the secret's - data map for this value. - type: string - name: - description: Name of the secret in the KubeadmBootstrapConfig's - namespace to use. - type: string - required: - - key - - name - type: object - required: - - secret - type: object - encoding: - description: Encoding specifies the encoding of - the file contents. - enum: - - base64 - - gzip - - gzip+base64 - type: string - owner: - description: Owner specifies the ownership of the - file, e.g. "root:root". - type: string - path: - description: Path specifies the full path on disk - where to store the file. - type: string - permissions: - description: Permissions specifies the permissions - to assign to the file, e.g. "0640". - type: string - required: - - path - type: object - type: array - format: - description: Format specifies the output format of the - bootstrap data - enum: - - cloud-config - type: string - initConfiguration: - description: InitConfiguration along with ClusterConfiguration - are the configurations necessary for the init command - 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 - bootstrapTokens: - description: |- - BootstrapTokens is respected at `kubeadm init` time and describes a set of Bootstrap Tokens to create. - This information IS NOT uploaded to the kubeadm cluster configmap, partly because of its sensitive nature - items: - description: BootstrapToken describes one bootstrap - token, stored as a Secret in the cluster. - properties: - description: - description: |- - Description sets a human-friendly message why this token exists and what it's used - for, so other administrators can know its purpose. - type: string - expires: - description: |- - Expires specifies the timestamp when this token expires. Defaults to being set - dynamically at runtime based on the TTL. Expires and TTL are mutually exclusive. - format: date-time - type: string - groups: - description: |- - Groups specifies the extra groups that this token will authenticate as when/if - used for authentication - items: - type: string - type: array - token: - description: |- - Token is used for establishing bidirectional trust between nodes and control-planes. - Used for joining nodes in the cluster. - type: string - ttl: - description: |- - TTL defines the time to live for this token. Defaults to 24h. - Expires and TTL are mutually exclusive. - type: string - usages: - description: |- - Usages describes the ways in which this token can be used. Can by default be used - for establishing bidirectional trust, but that can be changed here. - items: - type: string - type: array - required: - - token - type: object - type: array - 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 - localAPIEndpoint: - description: |- - LocalAPIEndpoint represents the endpoint of the API server instance that's deployed on this control plane node - In HA setups, this differs from ClusterConfiguration.ControlPlaneEndpoint in the sense that ControlPlaneEndpoint - is the global endpoint for the cluster, which then loadbalances the requests to each individual API server. This - configuration object lets you customize what IP/DNS name and port the local API server advertises it's accessible - on. By default, kubeadm tries to auto-detect the IP of the default interface and use that, but in case that process - fails you may set the desired value here. - properties: - advertiseAddress: - description: AdvertiseAddress sets the IP address - for the API server to advertise. - type: string - bindPort: - description: |- - BindPort sets the secure port for the API Server to bind to. - Defaults to 6443. - format: int32 - type: integer - type: object - nodeRegistration: - description: |- - NodeRegistration holds fields that relate to registering the new control-plane node to the cluster. - When used in the context of control plane nodes, NodeRegistration should remain consistent - across both InitConfiguration and JoinConfiguration - properties: - criSocket: - description: CRISocket is used to retrieve container - runtime info. This information will be annotated - to the Node API object, for later re-use - type: string - ignorePreflightErrors: - description: IgnorePreflightErrors provides a - slice of pre-flight errors to be ignored when - the current node is registered. - items: - type: string - type: array - kubeletExtraArgs: - additionalProperties: - type: string - description: |- - KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file - kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config-1.X ConfigMap - Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on. - type: object - name: - description: |- - Name is the `.Metadata.Name` field of the Node API object that will be created in this `kubeadm init` or `kubeadm join` operation. - This field is also used in the CommonName field of the kubelet's client certificate to the API server. - Defaults to the hostname of the node if not provided. - type: string - taints: - description: |- - Taints specifies the taints the Node API object should be registered with. If this field is unset, i.e. nil, in the `kubeadm init` process - it will be defaulted to []v1.Taint{'node-role.kubernetes.io/master=""'}. If you don't want to taint your control-plane node, set this field to an - empty slice, i.e. `taints: {}` in the YAML file. This field is solely used for Node registration. - items: - description: |- - The node this Taint is attached to has the "effect" on - any pod that does not tolerate the Taint. - properties: - effect: - description: |- - Required. The effect of the taint on pods - that do not tolerate the taint. - Valid effects are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Required. The taint key to - be applied to a node. - type: string - timeAdded: - description: |- - TimeAdded represents the time at which the taint was added. - It is only written for NoExecute taints. - format: date-time - type: string - value: - description: The taint value corresponding - to the taint key. - type: string - required: - - effect - - key - type: object - type: array - type: object - type: object - joinConfiguration: - description: JoinConfiguration is the kubeadm configuration - for the join command - 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 - caCertPath: - description: |- - CACertPath is the path to the SSL certificate authority used to - secure comunications between node and control-plane. - Defaults to "/etc/kubernetes/pki/ca.crt". - TODO: revisit when there is defaulting from k/k - type: string - controlPlane: - description: |- - ControlPlane defines the additional control plane instance to be deployed on the joining node. - If nil, no additional control plane instance will be deployed. - properties: - localAPIEndpoint: - description: LocalAPIEndpoint represents the endpoint - of the API server instance to be deployed on - this node. - properties: - advertiseAddress: - description: AdvertiseAddress sets the IP - address for the API server to advertise. - type: string - bindPort: - description: |- - BindPort sets the secure port for the API Server to bind to. - Defaults to 6443. - format: int32 - type: integer - type: object - type: object - discovery: - description: |- - Discovery specifies the options for the kubelet to use during the TLS Bootstrap process - TODO: revisit when there is defaulting from k/k - properties: - bootstrapToken: - description: |- - BootstrapToken is used to set the options for bootstrap token based discovery - BootstrapToken and File are mutually exclusive - properties: - apiServerEndpoint: - description: APIServerEndpoint is an IP or - domain name to the API server from which - info will be fetched. - type: string - caCertHashes: - description: |- - CACertHashes specifies a set of public key pins to verify - when token-based discovery is used. The root CA found during discovery - must match one of these values. Specifying an empty set disables root CA - pinning, which can be unsafe. Each hash is specified as ":", - where the only currently supported type is "sha256". This is a hex-encoded - SHA-256 hash of the Subject Public Key Info (SPKI) object in DER-encoded - ASN.1. These hashes can be calculated using, for example, OpenSSL: - openssl x509 -pubkey -in ca.crt openssl rsa -pubin -outform der 2>&/dev/null | openssl dgst -sha256 -hex - items: - type: string - type: array - token: - description: |- - Token is a token used to validate cluster information - fetched from the control-plane. - type: string - unsafeSkipCAVerification: - description: |- - UnsafeSkipCAVerification allows token-based discovery - without CA verification via CACertHashes. This can weaken - the security of kubeadm since other nodes can impersonate the control-plane. - type: boolean - required: - - token - type: object - file: - description: |- - File is used to specify a file or URL to a kubeconfig file from which to load cluster information - BootstrapToken and File are mutually exclusive - properties: - kubeConfigPath: - description: KubeConfigPath is used to specify - the actual file path or URL to the kubeconfig - file from which to load cluster information - type: string - required: - - kubeConfigPath - type: object - timeout: - description: Timeout modifies the discovery timeout - type: string - tlsBootstrapToken: - description: |- - TLSBootstrapToken is a token used for TLS bootstrapping. - If .BootstrapToken is set, this field is defaulted to .BootstrapToken.Token, but can be overridden. - If .File is set, this field **must be set** in case the KubeConfigFile does not contain any other authentication information - type: string - type: object - 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 - nodeRegistration: - description: |- - NodeRegistration holds fields that relate to registering the new control-plane node to the cluster. - When used in the context of control plane nodes, NodeRegistration should remain consistent - across both InitConfiguration and JoinConfiguration - properties: - criSocket: - description: CRISocket is used to retrieve container - runtime info. This information will be annotated - to the Node API object, for later re-use - type: string - ignorePreflightErrors: - description: IgnorePreflightErrors provides a - slice of pre-flight errors to be ignored when - the current node is registered. - items: - type: string - type: array - kubeletExtraArgs: - additionalProperties: - type: string - description: |- - KubeletExtraArgs passes through extra arguments to the kubelet. The arguments here are passed to the kubelet command line via the environment file - kubeadm writes at runtime for the kubelet to source. This overrides the generic base-level configuration in the kubelet-config-1.X ConfigMap - Flags have higher priority when parsing. These values are local and specific to the node kubeadm is executing on. - type: object - name: - description: |- - Name is the `.Metadata.Name` field of the Node API object that will be created in this `kubeadm init` or `kubeadm join` operation. - This field is also used in the CommonName field of the kubelet's client certificate to the API server. - Defaults to the hostname of the node if not provided. - type: string - taints: - description: |- - Taints specifies the taints the Node API object should be registered with. If this field is unset, i.e. nil, in the `kubeadm init` process - it will be defaulted to []v1.Taint{'node-role.kubernetes.io/master=""'}. If you don't want to taint your control-plane node, set this field to an - empty slice, i.e. `taints: {}` in the YAML file. This field is solely used for Node registration. - items: - description: |- - The node this Taint is attached to has the "effect" on - any pod that does not tolerate the Taint. - properties: - effect: - description: |- - Required. The effect of the taint on pods - that do not tolerate the taint. - Valid effects are NoSchedule, PreferNoSchedule and NoExecute. - type: string - key: - description: Required. The taint key to - be applied to a node. - type: string - timeAdded: - description: |- - TimeAdded represents the time at which the taint was added. - It is only written for NoExecute taints. - format: date-time - type: string - value: - description: The taint value corresponding - to the taint key. - type: string - required: - - effect - - key - type: object - type: array - type: object - type: object - mounts: - description: Mounts specifies a list of mount points to - be setup. - items: - description: MountPoints defines input for generated - mounts in cloud-init. - items: - type: string - type: array - type: array - ntp: - description: NTP specifies NTP configuration - properties: - enabled: - description: Enabled specifies whether NTP should - be enabled - type: boolean - servers: - description: Servers specifies which NTP servers to - use - items: - type: string - type: array - type: object - postKubeadmCommands: - description: PostKubeadmCommands specifies extra commands - to run after kubeadm runs - items: - type: string - type: array - preKubeadmCommands: - description: PreKubeadmCommands specifies extra commands - to run before kubeadm runs - items: - type: string - type: array - useExperimentalRetryJoin: - description: |- - UseExperimentalRetryJoin replaces a basic kubeadm command with a shell - script with retries for joins. - - - This is meant to be an experimental temporary workaround on some environments - where joins fail due to timing (and other issues). The long term goal is to add retries to - kubeadm proper and use that functionality. - - - This will add about 40KB to userdata - - - For more information, refer to https://github.com/kubernetes-sigs/cluster-api/pull/2763#discussion_r397306055. - type: boolean - users: - description: Users specifies extra users to add - items: - description: User defines the input for a generated - user in cloud-init. - properties: - gecos: - description: Gecos specifies the gecos to use for - the user - type: string - groups: - description: Groups specifies the additional groups - for the user - type: string - homeDir: - description: HomeDir specifies the home directory - to use for the user - type: string - inactive: - description: Inactive specifies whether to mark - the user as inactive - type: boolean - lockPassword: - description: LockPassword specifies if password - login should be disabled - type: boolean - name: - description: Name specifies the user name - type: string - passwd: - description: Passwd specifies a hashed password - for the user - type: string - primaryGroup: - description: PrimaryGroup specifies the primary - group for the user - type: string - shell: - description: Shell specifies the user's shell - type: string - sshAuthorizedKeys: - description: SSHAuthorizedKeys specifies a list - of ssh authorized keys for the user - items: - type: string - type: array - sudo: - description: Sudo specifies a sudo role for the - user - type: string - required: - - name - type: object - type: array - verbosity: - description: |- - Verbosity is the number for the kubeadm log level verbosity. - It overrides the `--v` flag in kubeadm commands. - format: int32 - type: integer - type: object - machineTemplate: - description: |- - MachineTemplate contains information about how machines - should be shaped when creating or updating a control plane. - properties: - infrastructureRef: - description: |- - InfrastructureRef is a required reference to a custom resource - offered by an infrastructure provider. - 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 - metadata: - description: |- - Standard object's metadata. - More info: 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 - nodeDrainTimeout: - description: |- - NodeDrainTimeout is the total amount of time that the controller will spend on draining a controlplane node - The default value is 0, meaning that the node can be drained without any time limitations. - NOTE: NodeDrainTimeout is different from `kubectl drain --timeout` - type: string - required: - - infrastructureRef - type: object - replicas: - description: |- - Number of desired machines. Defaults to 1. When stacked etcd is used only - odd numbers are permitted, as per [etcd best practice](https://etcd.io/docs/v3.3.12/faq/#why-an-odd-number-of-cluster-members). - This is a pointer to distinguish between explicit zero and not specified. - format: int32 - type: integer - rolloutAfter: - description: |- - RolloutAfter is a field to indicate a rollout should be performed - after the specified time even if no changes have been made to the - KubeadmControlPlane. - format: date-time - type: string - rolloutStrategy: - default: - rollingUpdate: - maxSurge: 1 - type: RollingUpdate - description: |- - The RolloutStrategy to use to replace control plane machines with - new ones. - properties: - rollingUpdate: - description: |- - Rolling update config params. Present only if - RolloutStrategyType = RollingUpdate. - properties: - maxSurge: - anyOf: - - type: integer - - type: string - description: |- - The maximum number of control planes that can be scheduled above or under the - desired number of control planes. - Value can be an absolute number 1 or 0. - Defaults to 1. - Example: when this is set to 1, the control plane can be scaled - up immediately when the rolling update starts. - x-kubernetes-int-or-string: true - type: object - type: - description: |- - Type of rollout. Currently the only supported strategy is - "RollingUpdate". - Default is RollingUpdate. - type: string - type: object - version: - description: Version defines the desired Kubernetes version. - type: string - required: - - kubeadmConfigSpec - - machineTemplate - - version - type: object - required: - - spec - type: object - required: - - template - type: object - type: object - served: false - storage: false - subresources: {} - additionalPrinterColumns: - description: Time duration since creation of KubeadmControlPlaneTemplate jsonPath: .metadata.creationTimestamp diff --git a/controlplane/kubeadm/config/crd/kustomization.yaml b/controlplane/kubeadm/config/crd/kustomization.yaml index 3861c212b187..caa1f2625ed6 100644 --- a/controlplane/kubeadm/config/crd/kustomization.yaml +++ b/controlplane/kubeadm/config/crd/kustomization.yaml @@ -1,5 +1,4 @@ commonLabels: - cluster.x-k8s.io/v1alpha4: v1alpha4 cluster.x-k8s.io/v1beta1: v1beta1 # This kustomization.yaml is not intended to be run by itself, diff --git a/controlplane/kubeadm/main.go b/controlplane/kubeadm/main.go index 1ba3c7b01c33..376256d4dddd 100644 --- a/controlplane/kubeadm/main.go +++ b/controlplane/kubeadm/main.go @@ -48,7 +48,6 @@ import ( clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" - controlplanev1alpha4 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" kubeadmcontrolplanecontrollers "sigs.k8s.io/cluster-api/controlplane/kubeadm/controllers" "sigs.k8s.io/cluster-api/controlplane/kubeadm/internal/etcd" @@ -91,7 +90,6 @@ var ( func init() { _ = clientgoscheme.AddToScheme(scheme) _ = clusterv1.AddToScheme(scheme) - _ = controlplanev1alpha4.AddToScheme(scheme) _ = controlplanev1.AddToScheme(scheme) _ = bootstrapv1.AddToScheme(scheme) _ = apiextensionsv1.AddToScheme(scheme) diff --git a/docs/book/src/introduction.md b/docs/book/src/introduction.md index 12d1164fadb8..3ed9ea7c9bec 100644 --- a/docs/book/src/introduction.md +++ b/docs/book/src/introduction.md @@ -15,19 +15,6 @@ Please read the [announcement](https://kubernetes.io/blog/2023/03/10/image-regis Also, this [guide](https://github.com/kubernetes/registry.k8s.io/tree/main/docs/mirroring) provide instructions about how to identify images to mirror and how to use mirrored images. - - - - ## Getting started * [Quick Start](./user/quick-start.md) diff --git a/docs/book/src/tasks/experimental-features/machine-pools.md b/docs/book/src/tasks/experimental-features/machine-pools.md index e4deebab695e..521550e2922b 100644 --- a/docs/book/src/tasks/experimental-features/machine-pools.md +++ b/docs/book/src/tasks/experimental-features/machine-pools.md @@ -1,16 +1,5 @@ # Experimental Feature: MachinePool (alpha) - - - The `MachinePool` feature provides a way to manage a set of machines by defining a common configuration, number of desired machine replicas etc. similar to `MachineDeployment`, except `MachineSet` controllers are responsible for the lifecycle management of the machines for `MachineDeployment`, whereas in `MachinePools`, each infrastructure provider has a specific solution for orchestrating these `Machines`. diff --git a/docs/book/src/tasks/upgrading-cluster-api-versions.md b/docs/book/src/tasks/upgrading-cluster-api-versions.md index b3d509920d5c..4fed3e94e2a8 100644 --- a/docs/book/src/tasks/upgrading-cluster-api-versions.md +++ b/docs/book/src/tasks/upgrading-cluster-api-versions.md @@ -16,21 +16,6 @@ Ensure that the version of Cluster API is compatible with the Kubernetes version Use [clusterctl to upgrade between versions of Cluster API 1.0.x](../clusterctl/commands/upgrade.md). -## Upgrading from Cluster API v1alpha3 (0.3.x) to Cluster API v1beta1 (1.0.x) - -For detailed information about the changes from `v1alpha3` to `v1beta1`, please refer to the [Cluster API v1alpha3 compared to v1alpha4 section] and the [Cluster API v1alpha4 compared to v1beta1 section]. - -Use [clusterctl to upgrade from Cluster API v0.3.x to Cluster API 1.0.x](../clusterctl/commands/upgrade.md). - -You should now be able to manage your resources using the `v1beta1` version of the Cluster API components. - -## Upgrading from Cluster API v1alpha4 (0.4.x) to Cluster API v1beta1 (1.0.x) - -For detailed information about the changes from `v1alpha4` to `v1beta1`, please refer to the [Cluster API v1alpha4 compared to v1beta1 section]. - -Use [clusterctl to upgrade from Cluster API v0.4.x to Cluster API 1.0.x](../clusterctl/commands/upgrade.md). - -You should now be able to manage your resources using the `v1alpha4` version of the Cluster API components. [components]: ../reference/glossary.md#provider-components diff --git a/exp/addons/api/v1alpha4/clusterresourceset_types.go b/exp/addons/api/v1alpha4/clusterresourceset_types.go deleted file mode 100644 index d06d3ffcc9e6..000000000000 --- a/exp/addons/api/v1alpha4/clusterresourceset_types.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" -) - -const ( - // ClusterResourceSetSecretType is the only accepted type of secret in resources. - ClusterResourceSetSecretType corev1.SecretType = "addons.cluster.x-k8s.io/resource-set" //nolint:gosec - - // ClusterResourceSetFinalizer is added to the ClusterResourceSet object for additional cleanup logic on deletion. - ClusterResourceSetFinalizer = "addons.cluster.x-k8s.io" -) - -// ANCHOR: ClusterResourceSetSpec - -// ClusterResourceSetSpec defines the desired state of ClusterResourceSet. -type ClusterResourceSetSpec struct { - // Label selector for Clusters. The Clusters that are - // selected by this will be the ones affected by this ClusterResourceSet. - // It must match the Cluster labels. This field is immutable. - // Label selector cannot be empty. - ClusterSelector metav1.LabelSelector `json:"clusterSelector"` - - // Resources is a list of Secrets/ConfigMaps where each contains 1 or more resources to be applied to remote clusters. - Resources []ResourceRef `json:"resources,omitempty"` - - // Strategy is the strategy to be used during applying resources. Defaults to ApplyOnce. This field is immutable. - // +kubebuilder:validation:Enum=ApplyOnce - // +optional - Strategy string `json:"strategy,omitempty"` -} - -// ANCHOR_END: ClusterResourceSetSpec - -// ClusterResourceSetResourceKind is a string representation of a ClusterResourceSet resource kind. -type ClusterResourceSetResourceKind string - -// Define the ClusterResourceSetResourceKind constants. -const ( - SecretClusterResourceSetResourceKind ClusterResourceSetResourceKind = "Secret" - ConfigMapClusterResourceSetResourceKind ClusterResourceSetResourceKind = "ConfigMap" -) - -// ResourceRef specifies a resource. -type ResourceRef struct { - // Name of the resource that is in the same namespace with ClusterResourceSet object. - // +kubebuilder:validation:MinLength=1 - Name string `json:"name"` - - // Kind of the resource. Supported kinds are: Secrets and ConfigMaps. - // +kubebuilder:validation:Enum=Secret;ConfigMap - Kind string `json:"kind"` -} - -// ClusterResourceSetStrategy is a string representation of a ClusterResourceSet Strategy. -type ClusterResourceSetStrategy string - -const ( - // ClusterResourceSetStrategyApplyOnce is the default strategy a ClusterResourceSet strategy is assigned by - // ClusterResourceSet controller after being created if not specified by user. - ClusterResourceSetStrategyApplyOnce ClusterResourceSetStrategy = "ApplyOnce" -) - -// SetTypedStrategy sets the Strategy field to the string representation of ClusterResourceSetStrategy. -func (c *ClusterResourceSetSpec) SetTypedStrategy(p ClusterResourceSetStrategy) { - c.Strategy = string(p) -} - -// ANCHOR: ClusterResourceSetStatus - -// ClusterResourceSetStatus defines the observed state of ClusterResourceSet. -type ClusterResourceSetStatus struct { - // ObservedGeneration reflects the generation of the most recently observed ClusterResourceSet. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // Conditions defines current state of the ClusterResourceSet. - // +optional - Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` -} - -// ANCHOR_END: ClusterResourceSetStatus - -// GetConditions returns the set of conditions for this object. -func (m *ClusterResourceSet) GetConditions() clusterv1alpha4.Conditions { - return m.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (m *ClusterResourceSet) SetConditions(conditions clusterv1alpha4.Conditions) { - m.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:resource:path=clusterresourcesets,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of ClusterResourceSet" - -// ClusterResourceSet is the Schema for the clusterresourcesets API. -// -// Deprecated: This type will be removed in one of the next releases. -type ClusterResourceSet struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec ClusterResourceSetSpec `json:"spec,omitempty"` - Status ClusterResourceSetStatus `json:"status,omitempty"` -} - -// +kubebuilder:object:root=true - -// ClusterResourceSetList contains a list of ClusterResourceSet. -// -// Deprecated: This type will be removed in one of the next releases. -type ClusterResourceSetList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterResourceSet `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &ClusterResourceSet{}, &ClusterResourceSetList{}) -} diff --git a/exp/addons/api/v1alpha4/clusterresourcesetbinding_types.go b/exp/addons/api/v1alpha4/clusterresourcesetbinding_types.go deleted file mode 100644 index 5cd2e123d0ea..000000000000 --- a/exp/addons/api/v1alpha4/clusterresourcesetbinding_types.go +++ /dev/null @@ -1,142 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "reflect" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// ANCHOR: ResourceBinding - -// ResourceBinding shows the status of a resource that belongs to a ClusterResourceSet matched by the owner cluster of the ClusterResourceSetBinding object. -type ResourceBinding struct { - // ResourceRef specifies a resource. - ResourceRef `json:",inline"` - - // Hash is the hash of a resource's data. This can be used to decide if a resource is changed. - // For "ApplyOnce" ClusterResourceSet.spec.strategy, this is no-op as that strategy does not act on change. - Hash string `json:"hash,omitempty"` - - // LastAppliedTime identifies when this resource was last applied to the cluster. - // +optional - LastAppliedTime *metav1.Time `json:"lastAppliedTime,omitempty"` - - // Applied is to track if a resource is applied to the cluster or not. - Applied bool `json:"applied"` -} - -// ANCHOR_END: ResourceBinding - -// ResourceSetBinding keeps info on all of the resources in a ClusterResourceSet. -type ResourceSetBinding struct { - // ClusterResourceSetName is the name of the ClusterResourceSet that is applied to the owner cluster of the binding. - ClusterResourceSetName string `json:"clusterResourceSetName"` - - // Resources is a list of resources that the ClusterResourceSet has. - Resources []ResourceBinding `json:"resources,omitempty"` -} - -// IsApplied returns true if the resource is applied to the cluster by checking the cluster's binding. -func (r *ResourceSetBinding) IsApplied(resourceRef ResourceRef) bool { - for _, resource := range r.Resources { - if reflect.DeepEqual(resource.ResourceRef, resourceRef) { - if resource.Applied { - return true - } - } - } - return false -} - -// SetBinding sets resourceBinding for a resource in resourceSetbinding either by updating the existing one or -// creating a new one. -func (r *ResourceSetBinding) SetBinding(resourceBinding ResourceBinding) { - for i := range r.Resources { - if reflect.DeepEqual(r.Resources[i].ResourceRef, resourceBinding.ResourceRef) { - r.Resources[i] = resourceBinding - return - } - } - r.Resources = append(r.Resources, resourceBinding) -} - -// GetOrCreateBinding returns the ResourceSetBinding for a given ClusterResourceSet if exists, -// otherwise creates one and updates ClusterResourceSet with it. -func (c *ClusterResourceSetBinding) GetOrCreateBinding(clusterResourceSet *ClusterResourceSet) *ResourceSetBinding { - for _, binding := range c.Spec.Bindings { - if binding.ClusterResourceSetName == clusterResourceSet.Name { - return binding - } - } - binding := &ResourceSetBinding{ClusterResourceSetName: clusterResourceSet.Name, Resources: []ResourceBinding{}} - c.Spec.Bindings = append(c.Spec.Bindings, binding) - return binding -} - -// DeleteBinding removes the ClusterResourceSet from the ClusterResourceSetBinding Bindings list. -func (c *ClusterResourceSetBinding) DeleteBinding(clusterResourceSet *ClusterResourceSet) { - for i, binding := range c.Spec.Bindings { - if binding.ClusterResourceSetName == clusterResourceSet.Name { - copy(c.Spec.Bindings[i:], c.Spec.Bindings[i+1:]) - c.Spec.Bindings = c.Spec.Bindings[:len(c.Spec.Bindings)-1] - break - } - } -} - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:resource:path=clusterresourcesetbindings,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of ClusterResourceSetBinding" - -// ClusterResourceSetBinding lists all matching ClusterResourceSets with the cluster it belongs to. -// -// Deprecated: This type will be removed in one of the next releases. -type ClusterResourceSetBinding struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - Spec ClusterResourceSetBindingSpec `json:"spec,omitempty"` -} - -// ANCHOR: ClusterResourceSetBindingSpec - -// ClusterResourceSetBindingSpec defines the desired state of ClusterResourceSetBinding. -type ClusterResourceSetBindingSpec struct { - // Bindings is a list of ClusterResourceSets and their resources. - Bindings []*ResourceSetBinding `json:"bindings,omitempty"` -} - -// ANCHOR_END: ClusterResourceSetBindingSpec - -// +kubebuilder:object:root=true - -// ClusterResourceSetBindingList contains a list of ClusterResourceSetBinding. -// -// Deprecated: This type will be removed in one of the next releases. -type ClusterResourceSetBindingList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []ClusterResourceSetBinding `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &ClusterResourceSetBinding{}, &ClusterResourceSetBindingList{}) -} diff --git a/exp/addons/api/v1alpha4/clusterresourcesetbinding_types_test.go b/exp/addons/api/v1alpha4/clusterresourcesetbinding_types_test.go deleted file mode 100644 index 24ce2bd3a438..000000000000 --- a/exp/addons/api/v1alpha4/clusterresourcesetbinding_types_test.go +++ /dev/null @@ -1,158 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "reflect" - "testing" - "time" - - . "github.com/onsi/gomega" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func TestIsResourceApplied(t *testing.T) { - resourceRefApplyFailed := ResourceRef{ - Name: "applyFailed", - Kind: "Secret", - } - resourceRefApplySucceeded := ResourceRef{ - Name: "ApplySucceeded", - Kind: "Secret", - } - resourceRefNotExist := ResourceRef{ - Name: "notExist", - Kind: "Secret", - } - CRSBinding := &ResourceSetBinding{ - ClusterResourceSetName: "test-clusterResourceSet", - Resources: []ResourceBinding{ - { - ResourceRef: resourceRefApplySucceeded, - Applied: true, - Hash: "xyz", - LastAppliedTime: &metav1.Time{Time: time.Now().UTC()}, - }, - { - ResourceRef: resourceRefApplyFailed, - Applied: false, - Hash: "", - LastAppliedTime: &metav1.Time{Time: time.Now().UTC()}, - }, - }, - } - - tests := []struct { - name string - resourceSetBinding *ResourceSetBinding - resourceRef ResourceRef - isApplied bool - }{ - { - name: "should return true if the resource is applied successfully", - resourceSetBinding: CRSBinding, - resourceRef: resourceRefApplySucceeded, - isApplied: true, - }, - { - name: "should return false if the resource apply failed", - resourceSetBinding: CRSBinding, - resourceRef: resourceRefApplyFailed, - isApplied: false, - }, - { - name: "should return false if the resource does not exist", - resourceSetBinding: CRSBinding, - resourceRef: resourceRefNotExist, - isApplied: false, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - gs := NewWithT(t) - gs.Expect(tt.resourceSetBinding.IsApplied(tt.resourceRef)).To(BeEquivalentTo(tt.isApplied)) - }) - } -} - -func TestSetResourceBinding(t *testing.T) { - resourceRefApplyFailed := ResourceRef{ - Name: "applyFailed", - Kind: "Secret", - } - - CRSBinding := &ResourceSetBinding{ - ClusterResourceSetName: "test-clusterResourceSet", - Resources: []ResourceBinding{ - { - ResourceRef: resourceRefApplyFailed, - Applied: false, - Hash: "", - LastAppliedTime: &metav1.Time{Time: time.Now().UTC()}, - }, - }, - } - updateFailedResourceBinding := ResourceBinding{ - ResourceRef: resourceRefApplyFailed, - Applied: true, - Hash: "xyz", - LastAppliedTime: &metav1.Time{Time: time.Now().UTC()}, - } - - newResourceBinding := ResourceBinding{ - ResourceRef: ResourceRef{ - Name: "newBinding", - Kind: "Secret", - }, - Applied: false, - Hash: "xyz", - LastAppliedTime: &metav1.Time{Time: time.Now().UTC()}, - } - - tests := []struct { - name string - resourceSetBinding *ResourceSetBinding - resourceBinding ResourceBinding - }{ - { - name: "should update resourceSetBinding with new resource binding if not exist", - resourceSetBinding: CRSBinding, - resourceBinding: newResourceBinding, - }, - { - name: "should update Applied if resource failed before", - resourceSetBinding: CRSBinding, - resourceBinding: updateFailedResourceBinding, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - gs := NewWithT(t) - tt.resourceSetBinding.SetBinding(tt.resourceBinding) - exist := false - for _, b := range tt.resourceSetBinding.Resources { - if reflect.DeepEqual(b.ResourceRef, tt.resourceBinding.ResourceRef) { - gs.Expect(tt.resourceBinding.Applied).To(BeEquivalentTo(b.Applied)) - exist = true - } - } - gs.Expect(exist).To(BeTrue()) - }) - } -} diff --git a/exp/addons/api/v1alpha4/condition_consts.go b/exp/addons/api/v1alpha4/condition_consts.go deleted file mode 100644 index 97dfd10b35dc..000000000000 --- a/exp/addons/api/v1alpha4/condition_consts.go +++ /dev/null @@ -1,42 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - -// Conditions and condition Reasons for the ClusterResourceSet object. - -const ( - // ResourcesAppliedCondition documents that all resources in the ClusterResourceSet object are applied to - // all matching clusters. This indicates all resources exist, and no errors during applying them to all clusters. - ResourcesAppliedCondition clusterv1.ConditionType = "ResourcesApplied" - - // RemoteClusterClientFailedReason (Severity=Error) documents failure during getting the remote cluster client. - RemoteClusterClientFailedReason = "RemoteClusterClientFailed" - - // ClusterMatchFailedReason (Severity=Warning) documents failure getting clusters that match the clusterSelector. - ClusterMatchFailedReason = "ClusterMatchFailed" - - // ApplyFailedReason (Severity=Warning) documents applying at least one of the resources to one of the matching clusters is failed. - ApplyFailedReason = "ApplyFailed" - - // RetrievingResourceFailedReason (Severity=Warning) documents at least one of the resources are not successfully retrieved. - RetrievingResourceFailedReason = "RetrievingResourceFailed" - - // WrongSecretTypeReason (Severity=Warning) documents at least one of the Secret's type in the resource list is not supported. - WrongSecretTypeReason = "WrongSecretType" -) diff --git a/exp/addons/api/v1alpha4/conversion.go b/exp/addons/api/v1alpha4/conversion.go deleted file mode 100644 index b1863ff4eaf6..000000000000 --- a/exp/addons/api/v1alpha4/conversion.go +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - apiconversion "k8s.io/apimachinery/pkg/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" - - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -func (src *ClusterResourceSet) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*addonsv1.ClusterResourceSet) - - return Convert_v1alpha4_ClusterResourceSet_To_v1beta1_ClusterResourceSet(src, dst, nil) -} - -func (dst *ClusterResourceSet) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*addonsv1.ClusterResourceSet) - - return Convert_v1beta1_ClusterResourceSet_To_v1alpha4_ClusterResourceSet(src, dst, nil) -} - -func (src *ClusterResourceSetList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*addonsv1.ClusterResourceSetList) - - return Convert_v1alpha4_ClusterResourceSetList_To_v1beta1_ClusterResourceSetList(src, dst, nil) -} - -func (dst *ClusterResourceSetList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*addonsv1.ClusterResourceSetList) - - return Convert_v1beta1_ClusterResourceSetList_To_v1alpha4_ClusterResourceSetList(src, dst, nil) -} - -func (src *ClusterResourceSetBinding) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*addonsv1.ClusterResourceSetBinding) - - if err := Convert_v1alpha4_ClusterResourceSetBinding_To_v1beta1_ClusterResourceSetBinding(src, dst, nil); err != nil { - return err - } - // Manually restore data. - restored := &addonsv1.ClusterResourceSetBinding{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - dst.Spec.ClusterName = restored.Spec.ClusterName - return nil -} - -func (dst *ClusterResourceSetBinding) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*addonsv1.ClusterResourceSetBinding) - - if err := Convert_v1beta1_ClusterResourceSetBinding_To_v1alpha4_ClusterResourceSetBinding(src, dst, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata - if err := utilconversion.MarshalData(src, dst); err != nil { - return err - } - - return nil -} - -func (src *ClusterResourceSetBindingList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*addonsv1.ClusterResourceSetBindingList) - - return Convert_v1alpha4_ClusterResourceSetBindingList_To_v1beta1_ClusterResourceSetBindingList(src, dst, nil) -} - -func (dst *ClusterResourceSetBindingList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*addonsv1.ClusterResourceSetBindingList) - - return Convert_v1beta1_ClusterResourceSetBindingList_To_v1alpha4_ClusterResourceSetBindingList(src, dst, nil) -} - -// Convert_v1beta1_ClusterResourceSetBindingSpec_To_v1alpha4_ClusterResourceSetBindingSpec is a conversion function. -func Convert_v1beta1_ClusterResourceSetBindingSpec_To_v1alpha4_ClusterResourceSetBindingSpec(in *addonsv1.ClusterResourceSetBindingSpec, out *ClusterResourceSetBindingSpec, s apiconversion.Scope) error { - // Spec.ClusterName does not exist in ClusterResourceSetBinding v1alpha4 API. - return autoConvert_v1beta1_ClusterResourceSetBindingSpec_To_v1alpha4_ClusterResourceSetBindingSpec(in, out, s) -} diff --git a/exp/addons/api/v1alpha4/conversion_test.go b/exp/addons/api/v1alpha4/conversion_test.go deleted file mode 100644 index 5c8eec356880..000000000000 --- a/exp/addons/api/v1alpha4/conversion_test.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "testing" - - addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -func TestFuzzyConversion(t *testing.T) { - t.Run("for ClusterResourceSet", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &addonsv1.ClusterResourceSet{}, - Spoke: &ClusterResourceSet{}, - })) - t.Run("for ClusterResourceSetBinding", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &addonsv1.ClusterResourceSetBinding{}, - Spoke: &ClusterResourceSetBinding{}, - })) -} diff --git a/exp/addons/api/v1alpha4/doc.go b/exp/addons/api/v1alpha4/doc.go deleted file mode 100644 index c4a81600ff18..000000000000 --- a/exp/addons/api/v1alpha4/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains the v1alpha4 API implementation. -// +k8s:conversion-gen=sigs.k8s.io/cluster-api/exp/addons/api/v1beta1 -// -// Deprecated: This package will be removed in one of the next releases. -package v1alpha4 diff --git a/exp/addons/api/v1alpha4/groupversion_info.go b/exp/addons/api/v1alpha4/groupversion_info.go deleted file mode 100644 index 251172cee4c3..000000000000 --- a/exp/addons/api/v1alpha4/groupversion_info.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains API Schema definitions for the addons v1alpha4 API group -// +kubebuilder:object:generate=true -// +groupName=addons.cluster.x-k8s.io -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -var ( - // GroupVersion is group version used to register these objects. - GroupVersion = schema.GroupVersion{Group: "addons.cluster.x-k8s.io", Version: "v1alpha4"} - - schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = schemeBuilder.AddToScheme - - objectTypes = []runtime.Object{} - - // localSchemeBuilder is used for type conversions. - localSchemeBuilder = schemeBuilder -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(GroupVersion, objectTypes...) - metav1.AddToGroupVersion(scheme, GroupVersion) - return nil -} diff --git a/exp/addons/api/v1alpha4/zz_generated.conversion.go b/exp/addons/api/v1alpha4/zz_generated.conversion.go deleted file mode 100644 index 3eafdc8da85a..000000000000 --- a/exp/addons/api/v1alpha4/zz_generated.conversion.go +++ /dev/null @@ -1,441 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - unsafe "unsafe" - - v1 "k8s.io/apimachinery/pkg/apis/meta/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" - v1beta1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" -) - -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((*ClusterResourceSet)(nil), (*v1beta1.ClusterResourceSet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterResourceSet_To_v1beta1_ClusterResourceSet(a.(*ClusterResourceSet), b.(*v1beta1.ClusterResourceSet), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterResourceSet)(nil), (*ClusterResourceSet)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterResourceSet_To_v1alpha4_ClusterResourceSet(a.(*v1beta1.ClusterResourceSet), b.(*ClusterResourceSet), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterResourceSetBinding)(nil), (*v1beta1.ClusterResourceSetBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterResourceSetBinding_To_v1beta1_ClusterResourceSetBinding(a.(*ClusterResourceSetBinding), b.(*v1beta1.ClusterResourceSetBinding), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterResourceSetBinding)(nil), (*ClusterResourceSetBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterResourceSetBinding_To_v1alpha4_ClusterResourceSetBinding(a.(*v1beta1.ClusterResourceSetBinding), b.(*ClusterResourceSetBinding), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterResourceSetBindingList)(nil), (*v1beta1.ClusterResourceSetBindingList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterResourceSetBindingList_To_v1beta1_ClusterResourceSetBindingList(a.(*ClusterResourceSetBindingList), b.(*v1beta1.ClusterResourceSetBindingList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterResourceSetBindingList)(nil), (*ClusterResourceSetBindingList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterResourceSetBindingList_To_v1alpha4_ClusterResourceSetBindingList(a.(*v1beta1.ClusterResourceSetBindingList), b.(*ClusterResourceSetBindingList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterResourceSetBindingSpec)(nil), (*v1beta1.ClusterResourceSetBindingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterResourceSetBindingSpec_To_v1beta1_ClusterResourceSetBindingSpec(a.(*ClusterResourceSetBindingSpec), b.(*v1beta1.ClusterResourceSetBindingSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterResourceSetList)(nil), (*v1beta1.ClusterResourceSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterResourceSetList_To_v1beta1_ClusterResourceSetList(a.(*ClusterResourceSetList), b.(*v1beta1.ClusterResourceSetList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterResourceSetList)(nil), (*ClusterResourceSetList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterResourceSetList_To_v1alpha4_ClusterResourceSetList(a.(*v1beta1.ClusterResourceSetList), b.(*ClusterResourceSetList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterResourceSetSpec)(nil), (*v1beta1.ClusterResourceSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterResourceSetSpec_To_v1beta1_ClusterResourceSetSpec(a.(*ClusterResourceSetSpec), b.(*v1beta1.ClusterResourceSetSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterResourceSetSpec)(nil), (*ClusterResourceSetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterResourceSetSpec_To_v1alpha4_ClusterResourceSetSpec(a.(*v1beta1.ClusterResourceSetSpec), b.(*ClusterResourceSetSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ClusterResourceSetStatus)(nil), (*v1beta1.ClusterResourceSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClusterResourceSetStatus_To_v1beta1_ClusterResourceSetStatus(a.(*ClusterResourceSetStatus), b.(*v1beta1.ClusterResourceSetStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterResourceSetStatus)(nil), (*ClusterResourceSetStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterResourceSetStatus_To_v1alpha4_ClusterResourceSetStatus(a.(*v1beta1.ClusterResourceSetStatus), b.(*ClusterResourceSetStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ResourceBinding)(nil), (*v1beta1.ResourceBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ResourceBinding_To_v1beta1_ResourceBinding(a.(*ResourceBinding), b.(*v1beta1.ResourceBinding), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ResourceBinding)(nil), (*ResourceBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ResourceBinding_To_v1alpha4_ResourceBinding(a.(*v1beta1.ResourceBinding), b.(*ResourceBinding), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ResourceRef)(nil), (*v1beta1.ResourceRef)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ResourceRef_To_v1beta1_ResourceRef(a.(*ResourceRef), b.(*v1beta1.ResourceRef), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ResourceRef)(nil), (*ResourceRef)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ResourceRef_To_v1alpha4_ResourceRef(a.(*v1beta1.ResourceRef), b.(*ResourceRef), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ResourceSetBinding)(nil), (*v1beta1.ResourceSetBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ResourceSetBinding_To_v1beta1_ResourceSetBinding(a.(*ResourceSetBinding), b.(*v1beta1.ResourceSetBinding), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ResourceSetBinding)(nil), (*ResourceSetBinding)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ResourceSetBinding_To_v1alpha4_ResourceSetBinding(a.(*v1beta1.ResourceSetBinding), b.(*ResourceSetBinding), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.ClusterResourceSetBindingSpec)(nil), (*ClusterResourceSetBindingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ClusterResourceSetBindingSpec_To_v1alpha4_ClusterResourceSetBindingSpec(a.(*v1beta1.ClusterResourceSetBindingSpec), b.(*ClusterResourceSetBindingSpec), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha4_ClusterResourceSet_To_v1beta1_ClusterResourceSet(in *ClusterResourceSet, out *v1beta1.ClusterResourceSet, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_ClusterResourceSetSpec_To_v1beta1_ClusterResourceSetSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_ClusterResourceSetStatus_To_v1beta1_ClusterResourceSetStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_ClusterResourceSet_To_v1beta1_ClusterResourceSet is an autogenerated conversion function. -func Convert_v1alpha4_ClusterResourceSet_To_v1beta1_ClusterResourceSet(in *ClusterResourceSet, out *v1beta1.ClusterResourceSet, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterResourceSet_To_v1beta1_ClusterResourceSet(in, out, s) -} - -func autoConvert_v1beta1_ClusterResourceSet_To_v1alpha4_ClusterResourceSet(in *v1beta1.ClusterResourceSet, out *ClusterResourceSet, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_ClusterResourceSetSpec_To_v1alpha4_ClusterResourceSetSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_ClusterResourceSetStatus_To_v1alpha4_ClusterResourceSetStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_ClusterResourceSet_To_v1alpha4_ClusterResourceSet is an autogenerated conversion function. -func Convert_v1beta1_ClusterResourceSet_To_v1alpha4_ClusterResourceSet(in *v1beta1.ClusterResourceSet, out *ClusterResourceSet, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterResourceSet_To_v1alpha4_ClusterResourceSet(in, out, s) -} - -func autoConvert_v1alpha4_ClusterResourceSetBinding_To_v1beta1_ClusterResourceSetBinding(in *ClusterResourceSetBinding, out *v1beta1.ClusterResourceSetBinding, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_ClusterResourceSetBindingSpec_To_v1beta1_ClusterResourceSetBindingSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_ClusterResourceSetBinding_To_v1beta1_ClusterResourceSetBinding is an autogenerated conversion function. -func Convert_v1alpha4_ClusterResourceSetBinding_To_v1beta1_ClusterResourceSetBinding(in *ClusterResourceSetBinding, out *v1beta1.ClusterResourceSetBinding, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterResourceSetBinding_To_v1beta1_ClusterResourceSetBinding(in, out, s) -} - -func autoConvert_v1beta1_ClusterResourceSetBinding_To_v1alpha4_ClusterResourceSetBinding(in *v1beta1.ClusterResourceSetBinding, out *ClusterResourceSetBinding, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_ClusterResourceSetBindingSpec_To_v1alpha4_ClusterResourceSetBindingSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_ClusterResourceSetBinding_To_v1alpha4_ClusterResourceSetBinding is an autogenerated conversion function. -func Convert_v1beta1_ClusterResourceSetBinding_To_v1alpha4_ClusterResourceSetBinding(in *v1beta1.ClusterResourceSetBinding, out *ClusterResourceSetBinding, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterResourceSetBinding_To_v1alpha4_ClusterResourceSetBinding(in, out, s) -} - -func autoConvert_v1alpha4_ClusterResourceSetBindingList_To_v1beta1_ClusterResourceSetBindingList(in *ClusterResourceSetBindingList, out *v1beta1.ClusterResourceSetBindingList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.ClusterResourceSetBinding, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_ClusterResourceSetBinding_To_v1beta1_ClusterResourceSetBinding(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_ClusterResourceSetBindingList_To_v1beta1_ClusterResourceSetBindingList is an autogenerated conversion function. -func Convert_v1alpha4_ClusterResourceSetBindingList_To_v1beta1_ClusterResourceSetBindingList(in *ClusterResourceSetBindingList, out *v1beta1.ClusterResourceSetBindingList, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterResourceSetBindingList_To_v1beta1_ClusterResourceSetBindingList(in, out, s) -} - -func autoConvert_v1beta1_ClusterResourceSetBindingList_To_v1alpha4_ClusterResourceSetBindingList(in *v1beta1.ClusterResourceSetBindingList, out *ClusterResourceSetBindingList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterResourceSetBinding, len(*in)) - for i := range *in { - if err := Convert_v1beta1_ClusterResourceSetBinding_To_v1alpha4_ClusterResourceSetBinding(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_ClusterResourceSetBindingList_To_v1alpha4_ClusterResourceSetBindingList is an autogenerated conversion function. -func Convert_v1beta1_ClusterResourceSetBindingList_To_v1alpha4_ClusterResourceSetBindingList(in *v1beta1.ClusterResourceSetBindingList, out *ClusterResourceSetBindingList, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterResourceSetBindingList_To_v1alpha4_ClusterResourceSetBindingList(in, out, s) -} - -func autoConvert_v1alpha4_ClusterResourceSetBindingSpec_To_v1beta1_ClusterResourceSetBindingSpec(in *ClusterResourceSetBindingSpec, out *v1beta1.ClusterResourceSetBindingSpec, s conversion.Scope) error { - out.Bindings = *(*[]*v1beta1.ResourceSetBinding)(unsafe.Pointer(&in.Bindings)) - return nil -} - -// Convert_v1alpha4_ClusterResourceSetBindingSpec_To_v1beta1_ClusterResourceSetBindingSpec is an autogenerated conversion function. -func Convert_v1alpha4_ClusterResourceSetBindingSpec_To_v1beta1_ClusterResourceSetBindingSpec(in *ClusterResourceSetBindingSpec, out *v1beta1.ClusterResourceSetBindingSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterResourceSetBindingSpec_To_v1beta1_ClusterResourceSetBindingSpec(in, out, s) -} - -func autoConvert_v1beta1_ClusterResourceSetBindingSpec_To_v1alpha4_ClusterResourceSetBindingSpec(in *v1beta1.ClusterResourceSetBindingSpec, out *ClusterResourceSetBindingSpec, s conversion.Scope) error { - out.Bindings = *(*[]*ResourceSetBinding)(unsafe.Pointer(&in.Bindings)) - // WARNING: in.ClusterName requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_ClusterResourceSetList_To_v1beta1_ClusterResourceSetList(in *ClusterResourceSetList, out *v1beta1.ClusterResourceSetList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.ClusterResourceSet, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_ClusterResourceSet_To_v1beta1_ClusterResourceSet(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_ClusterResourceSetList_To_v1beta1_ClusterResourceSetList is an autogenerated conversion function. -func Convert_v1alpha4_ClusterResourceSetList_To_v1beta1_ClusterResourceSetList(in *ClusterResourceSetList, out *v1beta1.ClusterResourceSetList, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterResourceSetList_To_v1beta1_ClusterResourceSetList(in, out, s) -} - -func autoConvert_v1beta1_ClusterResourceSetList_To_v1alpha4_ClusterResourceSetList(in *v1beta1.ClusterResourceSetList, out *ClusterResourceSetList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterResourceSet, len(*in)) - for i := range *in { - if err := Convert_v1beta1_ClusterResourceSet_To_v1alpha4_ClusterResourceSet(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_ClusterResourceSetList_To_v1alpha4_ClusterResourceSetList is an autogenerated conversion function. -func Convert_v1beta1_ClusterResourceSetList_To_v1alpha4_ClusterResourceSetList(in *v1beta1.ClusterResourceSetList, out *ClusterResourceSetList, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterResourceSetList_To_v1alpha4_ClusterResourceSetList(in, out, s) -} - -func autoConvert_v1alpha4_ClusterResourceSetSpec_To_v1beta1_ClusterResourceSetSpec(in *ClusterResourceSetSpec, out *v1beta1.ClusterResourceSetSpec, s conversion.Scope) error { - out.ClusterSelector = in.ClusterSelector - out.Resources = *(*[]v1beta1.ResourceRef)(unsafe.Pointer(&in.Resources)) - out.Strategy = in.Strategy - return nil -} - -// Convert_v1alpha4_ClusterResourceSetSpec_To_v1beta1_ClusterResourceSetSpec is an autogenerated conversion function. -func Convert_v1alpha4_ClusterResourceSetSpec_To_v1beta1_ClusterResourceSetSpec(in *ClusterResourceSetSpec, out *v1beta1.ClusterResourceSetSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterResourceSetSpec_To_v1beta1_ClusterResourceSetSpec(in, out, s) -} - -func autoConvert_v1beta1_ClusterResourceSetSpec_To_v1alpha4_ClusterResourceSetSpec(in *v1beta1.ClusterResourceSetSpec, out *ClusterResourceSetSpec, s conversion.Scope) error { - out.ClusterSelector = in.ClusterSelector - out.Resources = *(*[]ResourceRef)(unsafe.Pointer(&in.Resources)) - out.Strategy = in.Strategy - return nil -} - -// Convert_v1beta1_ClusterResourceSetSpec_To_v1alpha4_ClusterResourceSetSpec is an autogenerated conversion function. -func Convert_v1beta1_ClusterResourceSetSpec_To_v1alpha4_ClusterResourceSetSpec(in *v1beta1.ClusterResourceSetSpec, out *ClusterResourceSetSpec, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterResourceSetSpec_To_v1alpha4_ClusterResourceSetSpec(in, out, s) -} - -func autoConvert_v1alpha4_ClusterResourceSetStatus_To_v1beta1_ClusterResourceSetStatus(in *ClusterResourceSetStatus, out *v1beta1.ClusterResourceSetStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1beta1.Conditions, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1alpha4_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - return nil -} - -// Convert_v1alpha4_ClusterResourceSetStatus_To_v1beta1_ClusterResourceSetStatus is an autogenerated conversion function. -func Convert_v1alpha4_ClusterResourceSetStatus_To_v1beta1_ClusterResourceSetStatus(in *ClusterResourceSetStatus, out *v1beta1.ClusterResourceSetStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_ClusterResourceSetStatus_To_v1beta1_ClusterResourceSetStatus(in, out, s) -} - -func autoConvert_v1beta1_ClusterResourceSetStatus_To_v1alpha4_ClusterResourceSetStatus(in *v1beta1.ClusterResourceSetStatus, out *ClusterResourceSetStatus, s conversion.Scope) error { - out.ObservedGeneration = in.ObservedGeneration - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1alpha4.Conditions, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1beta1_Condition_To_v1alpha4_Condition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - return nil -} - -// Convert_v1beta1_ClusterResourceSetStatus_To_v1alpha4_ClusterResourceSetStatus is an autogenerated conversion function. -func Convert_v1beta1_ClusterResourceSetStatus_To_v1alpha4_ClusterResourceSetStatus(in *v1beta1.ClusterResourceSetStatus, out *ClusterResourceSetStatus, s conversion.Scope) error { - return autoConvert_v1beta1_ClusterResourceSetStatus_To_v1alpha4_ClusterResourceSetStatus(in, out, s) -} - -func autoConvert_v1alpha4_ResourceBinding_To_v1beta1_ResourceBinding(in *ResourceBinding, out *v1beta1.ResourceBinding, s conversion.Scope) error { - if err := Convert_v1alpha4_ResourceRef_To_v1beta1_ResourceRef(&in.ResourceRef, &out.ResourceRef, s); err != nil { - return err - } - out.Hash = in.Hash - out.LastAppliedTime = (*v1.Time)(unsafe.Pointer(in.LastAppliedTime)) - out.Applied = in.Applied - return nil -} - -// Convert_v1alpha4_ResourceBinding_To_v1beta1_ResourceBinding is an autogenerated conversion function. -func Convert_v1alpha4_ResourceBinding_To_v1beta1_ResourceBinding(in *ResourceBinding, out *v1beta1.ResourceBinding, s conversion.Scope) error { - return autoConvert_v1alpha4_ResourceBinding_To_v1beta1_ResourceBinding(in, out, s) -} - -func autoConvert_v1beta1_ResourceBinding_To_v1alpha4_ResourceBinding(in *v1beta1.ResourceBinding, out *ResourceBinding, s conversion.Scope) error { - if err := Convert_v1beta1_ResourceRef_To_v1alpha4_ResourceRef(&in.ResourceRef, &out.ResourceRef, s); err != nil { - return err - } - out.Hash = in.Hash - out.LastAppliedTime = (*v1.Time)(unsafe.Pointer(in.LastAppliedTime)) - out.Applied = in.Applied - return nil -} - -// Convert_v1beta1_ResourceBinding_To_v1alpha4_ResourceBinding is an autogenerated conversion function. -func Convert_v1beta1_ResourceBinding_To_v1alpha4_ResourceBinding(in *v1beta1.ResourceBinding, out *ResourceBinding, s conversion.Scope) error { - return autoConvert_v1beta1_ResourceBinding_To_v1alpha4_ResourceBinding(in, out, s) -} - -func autoConvert_v1alpha4_ResourceRef_To_v1beta1_ResourceRef(in *ResourceRef, out *v1beta1.ResourceRef, s conversion.Scope) error { - out.Name = in.Name - out.Kind = in.Kind - return nil -} - -// Convert_v1alpha4_ResourceRef_To_v1beta1_ResourceRef is an autogenerated conversion function. -func Convert_v1alpha4_ResourceRef_To_v1beta1_ResourceRef(in *ResourceRef, out *v1beta1.ResourceRef, s conversion.Scope) error { - return autoConvert_v1alpha4_ResourceRef_To_v1beta1_ResourceRef(in, out, s) -} - -func autoConvert_v1beta1_ResourceRef_To_v1alpha4_ResourceRef(in *v1beta1.ResourceRef, out *ResourceRef, s conversion.Scope) error { - out.Name = in.Name - out.Kind = in.Kind - return nil -} - -// Convert_v1beta1_ResourceRef_To_v1alpha4_ResourceRef is an autogenerated conversion function. -func Convert_v1beta1_ResourceRef_To_v1alpha4_ResourceRef(in *v1beta1.ResourceRef, out *ResourceRef, s conversion.Scope) error { - return autoConvert_v1beta1_ResourceRef_To_v1alpha4_ResourceRef(in, out, s) -} - -func autoConvert_v1alpha4_ResourceSetBinding_To_v1beta1_ResourceSetBinding(in *ResourceSetBinding, out *v1beta1.ResourceSetBinding, s conversion.Scope) error { - out.ClusterResourceSetName = in.ClusterResourceSetName - out.Resources = *(*[]v1beta1.ResourceBinding)(unsafe.Pointer(&in.Resources)) - return nil -} - -// Convert_v1alpha4_ResourceSetBinding_To_v1beta1_ResourceSetBinding is an autogenerated conversion function. -func Convert_v1alpha4_ResourceSetBinding_To_v1beta1_ResourceSetBinding(in *ResourceSetBinding, out *v1beta1.ResourceSetBinding, s conversion.Scope) error { - return autoConvert_v1alpha4_ResourceSetBinding_To_v1beta1_ResourceSetBinding(in, out, s) -} - -func autoConvert_v1beta1_ResourceSetBinding_To_v1alpha4_ResourceSetBinding(in *v1beta1.ResourceSetBinding, out *ResourceSetBinding, s conversion.Scope) error { - out.ClusterResourceSetName = in.ClusterResourceSetName - out.Resources = *(*[]ResourceBinding)(unsafe.Pointer(&in.Resources)) - return nil -} - -// Convert_v1beta1_ResourceSetBinding_To_v1alpha4_ResourceSetBinding is an autogenerated conversion function. -func Convert_v1beta1_ResourceSetBinding_To_v1alpha4_ResourceSetBinding(in *v1beta1.ResourceSetBinding, out *ResourceSetBinding, s conversion.Scope) error { - return autoConvert_v1beta1_ResourceSetBinding_To_v1alpha4_ResourceSetBinding(in, out, s) -} diff --git a/exp/addons/api/v1alpha4/zz_generated.deepcopy.go b/exp/addons/api/v1alpha4/zz_generated.deepcopy.go deleted file mode 100644 index 5b6977c751e3..000000000000 --- a/exp/addons/api/v1alpha4/zz_generated.deepcopy.go +++ /dev/null @@ -1,269 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - "k8s.io/apimachinery/pkg/runtime" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterResourceSet) DeepCopyInto(out *ClusterResourceSet) { - *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 ClusterResourceSet. -func (in *ClusterResourceSet) DeepCopy() *ClusterResourceSet { - if in == nil { - return nil - } - out := new(ClusterResourceSet) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterResourceSet) 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 *ClusterResourceSetBinding) DeepCopyInto(out *ClusterResourceSetBinding) { - *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 ClusterResourceSetBinding. -func (in *ClusterResourceSetBinding) DeepCopy() *ClusterResourceSetBinding { - if in == nil { - return nil - } - out := new(ClusterResourceSetBinding) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterResourceSetBinding) 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 *ClusterResourceSetBindingList) DeepCopyInto(out *ClusterResourceSetBindingList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterResourceSetBinding, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceSetBindingList. -func (in *ClusterResourceSetBindingList) DeepCopy() *ClusterResourceSetBindingList { - if in == nil { - return nil - } - out := new(ClusterResourceSetBindingList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterResourceSetBindingList) 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 *ClusterResourceSetBindingSpec) DeepCopyInto(out *ClusterResourceSetBindingSpec) { - *out = *in - if in.Bindings != nil { - in, out := &in.Bindings, &out.Bindings - *out = make([]*ResourceSetBinding, len(*in)) - for i := range *in { - if (*in)[i] != nil { - in, out := &(*in)[i], &(*out)[i] - *out = new(ResourceSetBinding) - (*in).DeepCopyInto(*out) - } - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceSetBindingSpec. -func (in *ClusterResourceSetBindingSpec) DeepCopy() *ClusterResourceSetBindingSpec { - if in == nil { - return nil - } - out := new(ClusterResourceSetBindingSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterResourceSetList) DeepCopyInto(out *ClusterResourceSetList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]ClusterResourceSet, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceSetList. -func (in *ClusterResourceSetList) DeepCopy() *ClusterResourceSetList { - if in == nil { - return nil - } - out := new(ClusterResourceSetList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ClusterResourceSetList) 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 *ClusterResourceSetSpec) DeepCopyInto(out *ClusterResourceSetSpec) { - *out = *in - in.ClusterSelector.DeepCopyInto(&out.ClusterSelector) - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = make([]ResourceRef, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceSetSpec. -func (in *ClusterResourceSetSpec) DeepCopy() *ClusterResourceSetSpec { - if in == nil { - return nil - } - out := new(ClusterResourceSetSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ClusterResourceSetStatus) DeepCopyInto(out *ClusterResourceSetStatus) { - *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]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterResourceSetStatus. -func (in *ClusterResourceSetStatus) DeepCopy() *ClusterResourceSetStatus { - if in == nil { - return nil - } - out := new(ClusterResourceSetStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceBinding) DeepCopyInto(out *ResourceBinding) { - *out = *in - out.ResourceRef = in.ResourceRef - if in.LastAppliedTime != nil { - in, out := &in.LastAppliedTime, &out.LastAppliedTime - *out = (*in).DeepCopy() - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceBinding. -func (in *ResourceBinding) DeepCopy() *ResourceBinding { - if in == nil { - return nil - } - out := new(ResourceBinding) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceRef) DeepCopyInto(out *ResourceRef) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceRef. -func (in *ResourceRef) DeepCopy() *ResourceRef { - if in == nil { - return nil - } - out := new(ResourceRef) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ResourceSetBinding) DeepCopyInto(out *ResourceSetBinding) { - *out = *in - if in.Resources != nil { - in, out := &in.Resources, &out.Resources - *out = make([]ResourceBinding, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSetBinding. -func (in *ResourceSetBinding) DeepCopy() *ResourceSetBinding { - if in == nil { - return nil - } - out := new(ResourceSetBinding) - in.DeepCopyInto(out) - return out -} diff --git a/exp/api/v1alpha4/condition_consts.go b/exp/api/v1alpha4/condition_consts.go deleted file mode 100644 index 813e49176030..000000000000 --- a/exp/api/v1alpha4/condition_consts.go +++ /dev/null @@ -1,30 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - -// Conditions and condition Reasons for the MachinePool object. - -const ( - // ReplicasReadyCondition reports an aggregate of current status of the replicas controlled by the MachinePool. - ReplicasReadyCondition clusterv1alpha4.ConditionType = "ReplicasReady" - - // WaitingForReplicasReadyReason (Severity=Info) documents a machinepool waiting for the required replicas - // to be ready. - WaitingForReplicasReadyReason = "WaitingForReplicasReady" -) diff --git a/exp/api/v1alpha4/conversion.go b/exp/api/v1alpha4/conversion.go deleted file mode 100644 index cb266a915b0c..000000000000 --- a/exp/api/v1alpha4/conversion.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "sigs.k8s.io/controller-runtime/pkg/conversion" - - expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -func (src *MachinePool) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*expv1.MachinePool) - - if err := Convert_v1alpha4_MachinePool_To_v1beta1_MachinePool(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &expv1.MachinePool{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - dst.Spec.Template.Spec.NodeDeletionTimeout = restored.Spec.Template.Spec.NodeDeletionTimeout - dst.Spec.Template.Spec.NodeVolumeDetachTimeout = restored.Spec.Template.Spec.NodeVolumeDetachTimeout - return nil -} - -func (dst *MachinePool) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*expv1.MachinePool) - - if err := Convert_v1beta1_MachinePool_To_v1alpha4_MachinePool(src, dst, nil); err != nil { - return err - } - return utilconversion.MarshalData(src, dst) -} - -func (src *MachinePoolList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*expv1.MachinePoolList) - - return Convert_v1alpha4_MachinePoolList_To_v1beta1_MachinePoolList(src, dst, nil) -} - -func (dst *MachinePoolList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*expv1.MachinePoolList) - - return Convert_v1beta1_MachinePoolList_To_v1alpha4_MachinePoolList(src, dst, nil) -} diff --git a/exp/api/v1alpha4/conversion_test.go b/exp/api/v1alpha4/conversion_test.go deleted file mode 100644 index bfba3b1fb598..000000000000 --- a/exp/api/v1alpha4/conversion_test.go +++ /dev/null @@ -1,34 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "testing" - - "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" - - expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -func TestFuzzyConversion(t *testing.T) { - t.Run("for MachinePool", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &expv1.MachinePool{}, - Spoke: &MachinePool{}, - FuzzerFuncs: []fuzzer.FuzzerFuncs{}, - })) -} diff --git a/exp/api/v1alpha4/doc.go b/exp/api/v1alpha4/doc.go deleted file mode 100644 index d27be39930b2..000000000000 --- a/exp/api/v1alpha4/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains the v1alpha4 API implementation. -// +k8s:conversion-gen=sigs.k8s.io/cluster-api/exp/api/v1beta1 -// -// Deprecated: This package will be removed in one of the next releases. -package v1alpha4 diff --git a/exp/api/v1alpha4/groupversion_info.go b/exp/api/v1alpha4/groupversion_info.go deleted file mode 100644 index 37de5e836e53..000000000000 --- a/exp/api/v1alpha4/groupversion_info.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains API Schema definitions for the exp v1alpha4 API group -// +kubebuilder:object:generate=true -// +groupName=cluster.x-k8s.io -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -var ( - // GroupVersion is group version used to register these objects. - GroupVersion = schema.GroupVersion{Group: "cluster.x-k8s.io", Version: "v1alpha4"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme. - schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = schemeBuilder.AddToScheme - - objectTypes = []runtime.Object{} - - // localSchemeBuilder is used for type conversions. - localSchemeBuilder = schemeBuilder -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(GroupVersion, objectTypes...) - metav1.AddToGroupVersion(scheme, GroupVersion) - return nil -} diff --git a/exp/api/v1alpha4/machinepool_types.go b/exp/api/v1alpha4/machinepool_types.go deleted file mode 100644 index d96f164a8b77..000000000000 --- a/exp/api/v1alpha4/machinepool_types.go +++ /dev/null @@ -1,247 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - capierrors "sigs.k8s.io/cluster-api/errors" -) - -const ( - // MachinePoolFinalizer is used to ensure deletion of dependencies (nodes, infra). - MachinePoolFinalizer = "machinepool.cluster.x-k8s.io" -) - -// ANCHOR: MachinePoolSpec - -// MachinePoolSpec defines the desired state of MachinePool. -type MachinePoolSpec struct { - // ClusterName is the name of the Cluster this object belongs to. - // +kubebuilder:validation:MinLength=1 - ClusterName string `json:"clusterName"` - - // Number of desired machines. Defaults to 1. - // This is a pointer to distinguish between explicit zero and not specified. - Replicas *int32 `json:"replicas,omitempty"` - - // Template describes the machines that will be created. - Template clusterv1alpha4.MachineTemplateSpec `json:"template"` - - // Minimum number of seconds for which a newly created machine instances should - // be ready. - // Defaults to 0 (machine instance will be considered available as soon as it - // is ready) - // +optional - MinReadySeconds *int32 `json:"minReadySeconds,omitempty"` - - // ProviderIDList are the identification IDs of machine instances provided by the provider. - // This field must match the provider IDs as seen on the node objects corresponding to a machine pool's machine instances. - // +optional - ProviderIDList []string `json:"providerIDList,omitempty"` - - // FailureDomains is the list of failure domains this MachinePool should be attached to. - FailureDomains []string `json:"failureDomains,omitempty"` -} - -// ANCHOR_END: MachinePoolSpec - -// ANCHOR: MachinePoolStatus - -// MachinePoolStatus defines the observed state of MachinePool. -type MachinePoolStatus struct { - // NodeRefs will point to the corresponding Nodes if it they exist. - // +optional - NodeRefs []corev1.ObjectReference `json:"nodeRefs,omitempty"` - - // Replicas is the most recently observed number of replicas. - // +optional - Replicas int32 `json:"replicas"` - - // The number of ready replicas for this MachinePool. A machine is considered ready when the node has been created and is "Ready". - // +optional - ReadyReplicas int32 `json:"readyReplicas,omitempty"` - - // The number of available replicas (ready for at least minReadySeconds) for this MachinePool. - // +optional - AvailableReplicas int32 `json:"availableReplicas,omitempty"` - - // Total number of unavailable machine instances targeted by this machine pool. - // This is the total number of machine instances that are still required for - // the machine pool to have 100% available capacity. They may either - // be machine instances that are running but not yet available or machine instances - // that still have not been created. - // +optional - UnavailableReplicas int32 `json:"unavailableReplicas,omitempty"` - - // FailureReason indicates that there is a problem reconciling the state, and - // will be set to a token value suitable for programmatic interpretation. - // +optional - FailureReason *capierrors.MachinePoolStatusFailure `json:"failureReason,omitempty"` - - // FailureMessage indicates that there is a problem reconciling the state, - // and will be set to a descriptive error message. - // +optional - FailureMessage *string `json:"failureMessage,omitempty"` - - // Phase represents the current phase of cluster actuation. - // E.g. Pending, Running, Terminating, Failed etc. - // +optional - Phase string `json:"phase,omitempty"` - - // BootstrapReady is the state of the bootstrap provider. - // +optional - BootstrapReady bool `json:"bootstrapReady"` - - // InfrastructureReady is the state of the infrastructure provider. - // +optional - InfrastructureReady bool `json:"infrastructureReady"` - - // ObservedGeneration is the latest generation observed by the controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // Conditions define the current service state of the MachinePool. - // +optional - Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` -} - -// ANCHOR_END: MachinePoolStatus - -// MachinePoolPhase is a string representation of a MachinePool Phase. -// -// This type is a high-level indicator of the status of the MachinePool as it is provisioned, -// from the API user’s perspective. -// -// The value should not be interpreted by any software components as a reliable indication -// of the actual state of the MachinePool, and controllers should not use the MachinePool Phase field -// value when making decisions about what action to take. -// -// Controllers should always look at the actual state of the MachinePool’s fields to make those decisions. -type MachinePoolPhase string - -const ( - // MachinePoolPhasePending is the first state a MachinePool is assigned by - // Cluster API MachinePool controller after being created. - MachinePoolPhasePending = MachinePoolPhase("Pending") - - // MachinePoolPhaseProvisioning is the state when the - // MachinePool infrastructure is being created or updated. - MachinePoolPhaseProvisioning = MachinePoolPhase("Provisioning") - - // MachinePoolPhaseProvisioned is the state when its - // infrastructure has been created and configured. - MachinePoolPhaseProvisioned = MachinePoolPhase("Provisioned") - - // MachinePoolPhaseRunning is the MachinePool state when its instances - // have become Kubernetes Nodes in the Ready state. - MachinePoolPhaseRunning = MachinePoolPhase("Running") - - // MachinePoolPhaseScalingUp is the MachinePool state when the - // MachinePool infrastructure is scaling up. - MachinePoolPhaseScalingUp = MachinePoolPhase("ScalingUp") - - // MachinePoolPhaseScalingDown is the MachinePool state when the - // MachinePool infrastructure is scaling down. - MachinePoolPhaseScalingDown = MachinePoolPhase("ScalingDown") - - // MachinePoolPhaseDeleting is the MachinePool state when a delete - // request has been sent to the API Server, - // but its infrastructure has not yet been fully deleted. - MachinePoolPhaseDeleting = MachinePoolPhase("Deleting") - - // MachinePoolPhaseFailed is the MachinePool state when the system - // might require user intervention. - MachinePoolPhaseFailed = MachinePoolPhase("Failed") - - // MachinePoolPhaseUnknown is returned if the MachinePool state cannot be determined. - MachinePoolPhaseUnknown = MachinePoolPhase("Unknown") -) - -// SetTypedPhase sets the Phase field to the string representation of MachinePoolPhase. -func (m *MachinePoolStatus) SetTypedPhase(p MachinePoolPhase) { - m.Phase = string(p) -} - -// GetTypedPhase attempts to parse the Phase field and return -// the typed MachinePoolPhase representation as described in `machinepool_phase_types.go`. -func (m *MachinePoolStatus) GetTypedPhase() MachinePoolPhase { - switch phase := MachinePoolPhase(m.Phase); phase { - case - MachinePoolPhasePending, - MachinePoolPhaseProvisioning, - MachinePoolPhaseProvisioned, - MachinePoolPhaseRunning, - MachinePoolPhaseScalingUp, - MachinePoolPhaseScalingDown, - MachinePoolPhaseDeleting, - MachinePoolPhaseFailed: - return phase - default: - return MachinePoolPhaseUnknown - } -} - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:resource:path=machinepools,shortName=mp,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of MachinePool" -// +kubebuilder:printcolumn:name="Replicas",type="string",JSONPath=".status.replicas",description="MachinePool replicas count" -// +kubebuilder:printcolumn:name="Phase",type="string",JSONPath=".status.phase",description="MachinePool status such as Terminating/Pending/Provisioning/Running/Failed etc" -// +kubebuilder:printcolumn:name="Version",type="string",JSONPath=".spec.template.spec.version",description="Kubernetes version associated with this MachinePool" -// +k8s:conversion-gen=false - -// MachinePool is the Schema for the machinepools API. -// -// Deprecated: This type will be removed in one of the next releases. -type MachinePool struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec MachinePoolSpec `json:"spec,omitempty"` - Status MachinePoolStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (m *MachinePool) GetConditions() clusterv1alpha4.Conditions { - return m.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (m *MachinePool) SetConditions(conditions clusterv1alpha4.Conditions) { - m.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// MachinePoolList contains a list of MachinePool. -// -// Deprecated: This type will be removed in one of the next releases. -type MachinePoolList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []MachinePool `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &MachinePool{}, &MachinePoolList{}) -} diff --git a/exp/api/v1alpha4/zz_generated.conversion.go b/exp/api/v1alpha4/zz_generated.conversion.go deleted file mode 100644 index 3609aa05f248..000000000000 --- a/exp/api/v1alpha4/zz_generated.conversion.go +++ /dev/null @@ -1,254 +0,0 @@ -//go:build !ignore_autogenerated -// +build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - unsafe "unsafe" - - 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" - v1beta1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" -) - -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((*MachinePool)(nil), (*v1beta1.MachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachinePool_To_v1beta1_MachinePool(a.(*MachinePool), b.(*v1beta1.MachinePool), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachinePool)(nil), (*MachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachinePool_To_v1alpha4_MachinePool(a.(*v1beta1.MachinePool), b.(*MachinePool), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachinePoolList)(nil), (*v1beta1.MachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachinePoolList_To_v1beta1_MachinePoolList(a.(*MachinePoolList), b.(*v1beta1.MachinePoolList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachinePoolList)(nil), (*MachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachinePoolList_To_v1alpha4_MachinePoolList(a.(*v1beta1.MachinePoolList), b.(*MachinePoolList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachinePoolSpec)(nil), (*v1beta1.MachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachinePoolSpec_To_v1beta1_MachinePoolSpec(a.(*MachinePoolSpec), b.(*v1beta1.MachinePoolSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachinePoolSpec)(nil), (*MachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachinePoolSpec_To_v1alpha4_MachinePoolSpec(a.(*v1beta1.MachinePoolSpec), b.(*MachinePoolSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*MachinePoolStatus)(nil), (*v1beta1.MachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MachinePoolStatus_To_v1beta1_MachinePoolStatus(a.(*MachinePoolStatus), b.(*v1beta1.MachinePoolStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.MachinePoolStatus)(nil), (*MachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_MachinePoolStatus_To_v1alpha4_MachinePoolStatus(a.(*v1beta1.MachinePoolStatus), b.(*MachinePoolStatus), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha4_MachinePool_To_v1beta1_MachinePool(in *MachinePool, out *v1beta1.MachinePool, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_MachinePoolSpec_To_v1beta1_MachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_MachinePoolStatus_To_v1beta1_MachinePoolStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_MachinePool_To_v1beta1_MachinePool is an autogenerated conversion function. -func Convert_v1alpha4_MachinePool_To_v1beta1_MachinePool(in *MachinePool, out *v1beta1.MachinePool, s conversion.Scope) error { - return autoConvert_v1alpha4_MachinePool_To_v1beta1_MachinePool(in, out, s) -} - -func autoConvert_v1beta1_MachinePool_To_v1alpha4_MachinePool(in *v1beta1.MachinePool, out *MachinePool, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_MachinePoolSpec_To_v1alpha4_MachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_MachinePoolStatus_To_v1alpha4_MachinePoolStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_MachinePool_To_v1alpha4_MachinePool is an autogenerated conversion function. -func Convert_v1beta1_MachinePool_To_v1alpha4_MachinePool(in *v1beta1.MachinePool, out *MachinePool, s conversion.Scope) error { - return autoConvert_v1beta1_MachinePool_To_v1alpha4_MachinePool(in, out, s) -} - -func autoConvert_v1alpha4_MachinePoolList_To_v1beta1_MachinePoolList(in *MachinePoolList, out *v1beta1.MachinePoolList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.MachinePool, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_MachinePool_To_v1beta1_MachinePool(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_MachinePoolList_To_v1beta1_MachinePoolList is an autogenerated conversion function. -func Convert_v1alpha4_MachinePoolList_To_v1beta1_MachinePoolList(in *MachinePoolList, out *v1beta1.MachinePoolList, s conversion.Scope) error { - return autoConvert_v1alpha4_MachinePoolList_To_v1beta1_MachinePoolList(in, out, s) -} - -func autoConvert_v1beta1_MachinePoolList_To_v1alpha4_MachinePoolList(in *v1beta1.MachinePoolList, out *MachinePoolList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachinePool, len(*in)) - for i := range *in { - if err := Convert_v1beta1_MachinePool_To_v1alpha4_MachinePool(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_MachinePoolList_To_v1alpha4_MachinePoolList is an autogenerated conversion function. -func Convert_v1beta1_MachinePoolList_To_v1alpha4_MachinePoolList(in *v1beta1.MachinePoolList, out *MachinePoolList, s conversion.Scope) error { - return autoConvert_v1beta1_MachinePoolList_To_v1alpha4_MachinePoolList(in, out, s) -} - -func autoConvert_v1alpha4_MachinePoolSpec_To_v1beta1_MachinePoolSpec(in *MachinePoolSpec, out *v1beta1.MachinePoolSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - if err := apiv1alpha4.Convert_v1alpha4_MachineTemplateSpec_To_v1beta1_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) - out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) - out.FailureDomains = *(*[]string)(unsafe.Pointer(&in.FailureDomains)) - return nil -} - -// Convert_v1alpha4_MachinePoolSpec_To_v1beta1_MachinePoolSpec is an autogenerated conversion function. -func Convert_v1alpha4_MachinePoolSpec_To_v1beta1_MachinePoolSpec(in *MachinePoolSpec, out *v1beta1.MachinePoolSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_MachinePoolSpec_To_v1beta1_MachinePoolSpec(in, out, s) -} - -func autoConvert_v1beta1_MachinePoolSpec_To_v1alpha4_MachinePoolSpec(in *v1beta1.MachinePoolSpec, out *MachinePoolSpec, s conversion.Scope) error { - out.ClusterName = in.ClusterName - out.Replicas = (*int32)(unsafe.Pointer(in.Replicas)) - if err := apiv1alpha4.Convert_v1beta1_MachineTemplateSpec_To_v1alpha4_MachineTemplateSpec(&in.Template, &out.Template, s); err != nil { - return err - } - out.MinReadySeconds = (*int32)(unsafe.Pointer(in.MinReadySeconds)) - out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) - out.FailureDomains = *(*[]string)(unsafe.Pointer(&in.FailureDomains)) - return nil -} - -// Convert_v1beta1_MachinePoolSpec_To_v1alpha4_MachinePoolSpec is an autogenerated conversion function. -func Convert_v1beta1_MachinePoolSpec_To_v1alpha4_MachinePoolSpec(in *v1beta1.MachinePoolSpec, out *MachinePoolSpec, s conversion.Scope) error { - return autoConvert_v1beta1_MachinePoolSpec_To_v1alpha4_MachinePoolSpec(in, out, s) -} - -func autoConvert_v1alpha4_MachinePoolStatus_To_v1beta1_MachinePoolStatus(in *MachinePoolStatus, out *v1beta1.MachinePoolStatus, s conversion.Scope) error { - out.NodeRefs = *(*[]v1.ObjectReference)(unsafe.Pointer(&in.NodeRefs)) - out.Replicas = in.Replicas - out.ReadyReplicas = in.ReadyReplicas - out.AvailableReplicas = in.AvailableReplicas - out.UnavailableReplicas = in.UnavailableReplicas - out.FailureReason = (*errors.MachinePoolStatusFailure)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Phase = in.Phase - out.BootstrapReady = in.BootstrapReady - out.InfrastructureReady = in.InfrastructureReady - out.ObservedGeneration = in.ObservedGeneration - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1beta1.Conditions, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1alpha4_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - return nil -} - -// Convert_v1alpha4_MachinePoolStatus_To_v1beta1_MachinePoolStatus is an autogenerated conversion function. -func Convert_v1alpha4_MachinePoolStatus_To_v1beta1_MachinePoolStatus(in *MachinePoolStatus, out *v1beta1.MachinePoolStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_MachinePoolStatus_To_v1beta1_MachinePoolStatus(in, out, s) -} - -func autoConvert_v1beta1_MachinePoolStatus_To_v1alpha4_MachinePoolStatus(in *v1beta1.MachinePoolStatus, out *MachinePoolStatus, s conversion.Scope) error { - out.NodeRefs = *(*[]v1.ObjectReference)(unsafe.Pointer(&in.NodeRefs)) - out.Replicas = in.Replicas - out.ReadyReplicas = in.ReadyReplicas - out.AvailableReplicas = in.AvailableReplicas - out.UnavailableReplicas = in.UnavailableReplicas - out.FailureReason = (*errors.MachinePoolStatusFailure)(unsafe.Pointer(in.FailureReason)) - out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Phase = in.Phase - out.BootstrapReady = in.BootstrapReady - out.InfrastructureReady = in.InfrastructureReady - out.ObservedGeneration = in.ObservedGeneration - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1alpha4.Conditions, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1beta1_Condition_To_v1alpha4_Condition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - return nil -} - -// Convert_v1beta1_MachinePoolStatus_To_v1alpha4_MachinePoolStatus is an autogenerated conversion function. -func Convert_v1beta1_MachinePoolStatus_To_v1alpha4_MachinePoolStatus(in *v1beta1.MachinePoolStatus, out *MachinePoolStatus, s conversion.Scope) error { - return autoConvert_v1beta1_MachinePoolStatus_To_v1alpha4_MachinePoolStatus(in, out, s) -} diff --git a/exp/api/v1alpha4/zz_generated.deepcopy.go b/exp/api/v1alpha4/zz_generated.deepcopy.go deleted file mode 100644 index d9931ddbd761..000000000000 --- a/exp/api/v1alpha4/zz_generated.deepcopy.go +++ /dev/null @@ -1,160 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - "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 *MachinePool) DeepCopyInto(out *MachinePool) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePool. -func (in *MachinePool) DeepCopy() *MachinePool { - if in == nil { - return nil - } - out := new(MachinePool) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachinePool) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachinePoolList) DeepCopyInto(out *MachinePoolList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]MachinePool, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolList. -func (in *MachinePoolList) DeepCopy() *MachinePoolList { - if in == nil { - return nil - } - out := new(MachinePoolList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *MachinePoolList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachinePoolSpec) DeepCopyInto(out *MachinePoolSpec) { - *out = *in - if in.Replicas != nil { - in, out := &in.Replicas, &out.Replicas - *out = new(int32) - **out = **in - } - in.Template.DeepCopyInto(&out.Template) - if in.MinReadySeconds != nil { - in, out := &in.MinReadySeconds, &out.MinReadySeconds - *out = new(int32) - **out = **in - } - if in.ProviderIDList != nil { - in, out := &in.ProviderIDList, &out.ProviderIDList - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolSpec. -func (in *MachinePoolSpec) DeepCopy() *MachinePoolSpec { - if in == nil { - return nil - } - out := new(MachinePoolSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MachinePoolStatus) DeepCopyInto(out *MachinePoolStatus) { - *out = *in - if in.NodeRefs != nil { - in, out := &in.NodeRefs, &out.NodeRefs - *out = make([]v1.ObjectReference, len(*in)) - copy(*out, *in) - } - if in.FailureReason != nil { - in, out := &in.FailureReason, &out.FailureReason - *out = new(errors.MachinePoolStatusFailure) - **out = **in - } - if in.FailureMessage != nil { - in, out := &in.FailureMessage, &out.FailureMessage - *out = new(string) - **out = **in - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1alpha4.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MachinePoolStatus. -func (in *MachinePoolStatus) DeepCopy() *MachinePoolStatus { - if in == nil { - return nil - } - out := new(MachinePoolStatus) - in.DeepCopyInto(out) - return out -} diff --git a/internal/runtime/test/v1alpha1/conversion.go b/internal/runtime/test/v1alpha1/conversion.go index 2e566c9c4b1b..8849af9a9e8a 100644 --- a/internal/runtime/test/v1alpha1/conversion.go +++ b/internal/runtime/test/v1alpha1/conversion.go @@ -19,19 +19,9 @@ package v1alpha1 import ( conversion "k8s.io/apimachinery/pkg/conversion" - clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" v1alpha2 "sigs.k8s.io/cluster-api/internal/runtime/test/v1alpha2" ) func Convert_v1alpha1_FakeResponse_To_v1alpha2_FakeResponse(in *FakeResponse, out *v1alpha2.FakeResponse, s conversion.Scope) error { return autoConvert_v1alpha1_FakeResponse_To_v1alpha2_FakeResponse(in, out, s) } - -func Convert_v1alpha4_Cluster_To_v1beta1_Cluster(in *clusterv1alpha4.Cluster, out *clusterv1.Cluster, s conversion.Scope) error { - return clusterv1alpha4.Convert_v1alpha4_Cluster_To_v1beta1_Cluster(in, out, s) -} - -func Convert_v1beta1_Cluster_To_v1alpha4_Cluster(in *clusterv1.Cluster, out *clusterv1alpha4.Cluster, s conversion.Scope) error { - return clusterv1alpha4.Convert_v1beta1_Cluster_To_v1alpha4_Cluster(in, out, s) -} diff --git a/internal/runtime/test/v1alpha1/fake_types.go b/internal/runtime/test/v1alpha1/fake_types.go index d4bb22302f78..8901d2c7ccf6 100644 --- a/internal/runtime/test/v1alpha1/fake_types.go +++ b/internal/runtime/test/v1alpha1/fake_types.go @@ -19,7 +19,7 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" runtimecatalog "sigs.k8s.io/cluster-api/exp/runtime/catalog" runtimehooksv1 "sigs.k8s.io/cluster-api/exp/runtime/hooks/api/v1alpha1" ) @@ -32,7 +32,7 @@ type FakeRequest struct { // CommonRequest contains Settings field common to all request types. runtimehooksv1.CommonRequest `json:",inline"` - Cluster clusterv1alpha4.Cluster + Cluster clusterv1.Cluster Second string First int @@ -61,7 +61,7 @@ type SecondFakeRequest struct { // CommonRequest contains Settings field common to all request types. runtimehooksv1.CommonRequest `json:",inline"` - Cluster clusterv1alpha4.Cluster + Cluster clusterv1.Cluster Second string First int @@ -90,7 +90,7 @@ type RetryableFakeRequest struct { // CommonRequest contains Settings field common to all request types. runtimehooksv1.CommonRequest `json:",inline"` - Cluster clusterv1alpha4.Cluster + Cluster clusterv1.Cluster Second string First int diff --git a/internal/runtime/test/v1alpha1/zz_generated.conversion.go b/internal/runtime/test/v1alpha1/zz_generated.conversion.go index 214fe03aabfd..5d5bb616b18b 100644 --- a/internal/runtime/test/v1alpha1/zz_generated.conversion.go +++ b/internal/runtime/test/v1alpha1/zz_generated.conversion.go @@ -24,8 +24,6 @@ package v1alpha1 import ( conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - v1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - v1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" v1alpha2 "sigs.k8s.io/cluster-api/internal/runtime/test/v1alpha2" ) @@ -56,24 +54,12 @@ func RegisterConversions(s *runtime.Scheme) error { }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha4.Cluster)(nil), (*v1beta1.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Cluster_To_v1beta1_Cluster(a.(*v1alpha4.Cluster), b.(*v1beta1.Cluster), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.Cluster)(nil), (*v1alpha4.Cluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Cluster_To_v1alpha4_Cluster(a.(*v1beta1.Cluster), b.(*v1alpha4.Cluster), scope) - }); err != nil { - return err - } return nil } func autoConvert_v1alpha1_FakeRequest_To_v1alpha2_FakeRequest(in *FakeRequest, out *v1alpha2.FakeRequest, s conversion.Scope) error { out.CommonRequest = in.CommonRequest - if err := Convert_v1alpha4_Cluster_To_v1beta1_Cluster(&in.Cluster, &out.Cluster, s); err != nil { - return err - } + out.Cluster = in.Cluster out.Second = in.Second out.First = in.First return nil @@ -86,9 +72,7 @@ func Convert_v1alpha1_FakeRequest_To_v1alpha2_FakeRequest(in *FakeRequest, out * func autoConvert_v1alpha2_FakeRequest_To_v1alpha1_FakeRequest(in *v1alpha2.FakeRequest, out *FakeRequest, s conversion.Scope) error { out.CommonRequest = in.CommonRequest - if err := Convert_v1beta1_Cluster_To_v1alpha4_Cluster(&in.Cluster, &out.Cluster, s); err != nil { - return err - } + out.Cluster = in.Cluster out.Second = in.Second out.First = in.First return nil diff --git a/main.go b/main.go index c4497f18b5e8..1740dc6e95b9 100644 --- a/main.go +++ b/main.go @@ -45,16 +45,13 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/webhook" - clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/api/v1beta1/index" "sigs.k8s.io/cluster-api/controllers" "sigs.k8s.io/cluster-api/controllers/remote" - addonsv1alpha4 "sigs.k8s.io/cluster-api/exp/addons/api/v1alpha4" addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" addonscontrollers "sigs.k8s.io/cluster-api/exp/addons/controllers" addonswebhooks "sigs.k8s.io/cluster-api/exp/addons/webhooks" - expv1alpha4 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" expcontrollers "sigs.k8s.io/cluster-api/exp/controllers" ipamv1 "sigs.k8s.io/cluster-api/exp/ipam/api/v1beta1" @@ -116,13 +113,10 @@ func init() { _ = clientgoscheme.AddToScheme(scheme) _ = apiextensionsv1.AddToScheme(scheme) - _ = clusterv1alpha4.AddToScheme(scheme) _ = clusterv1.AddToScheme(scheme) - _ = expv1alpha4.AddToScheme(scheme) _ = expv1.AddToScheme(scheme) - _ = addonsv1alpha4.AddToScheme(scheme) _ = addonsv1.AddToScheme(scheme) _ = runtimev1.AddToScheme(scheme) diff --git a/metadata.yaml b/metadata.yaml index c530fe96d594..d9a76e48db6f 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -30,6 +30,3 @@ releaseSeries: - major: 1 minor: 0 contract: v1beta1 - - major: 0 - minor: 4 - contract: v1alpha4 diff --git a/test/e2e/clusterctl_upgrade.go b/test/e2e/clusterctl_upgrade.go index c00e2aa3bd5c..fbae892be0c3 100644 --- a/test/e2e/clusterctl_upgrade.go +++ b/test/e2e/clusterctl_upgrade.go @@ -30,7 +30,6 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" - apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/sets" @@ -40,7 +39,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/yaml" - clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/client/config" "sigs.k8s.io/cluster-api/test/e2e/internal/log" @@ -553,12 +551,6 @@ func ClusterctlUpgradeSpec(ctx context.Context, inputGetter func() ClusterctlUpg Client: managementClusterProxy.GetClient(), Namespace: testNamespace.Name, }, input.E2EConfig.GetIntervals(specName, "wait-delete-cluster")...) - case discovery.ServerSupportsVersion(managementClusterProxy.GetClientSet().DiscoveryClient, clusterv1alpha4.GroupVersion) == nil: - Byf("Deleting all %s clusters in namespace %s in management cluster %s", clusterv1alpha4.GroupVersion, testNamespace.Name, managementClusterName) - deleteAllClustersAndWaitV1alpha4(ctx, framework.DeleteAllClustersAndWaitInput{ - Client: managementClusterProxy.GetClient(), - Namespace: testNamespace.Name, - }, input.E2EConfig.GetIntervals(specName, "wait-delete-cluster")...) default: log.Logf("Management Cluster does not appear to support CAPI resources.") } @@ -660,76 +652,6 @@ func calculateExpectedWorkerCount(ctx context.Context, c client.Client, e2eConfi return expectedWorkerCount } -// deleteAllClustersAndWaitV1alpha4 deletes all cluster resources in the given namespace and waits for them to be gone using the older API. -func deleteAllClustersAndWaitV1alpha4(ctx context.Context, input framework.DeleteAllClustersAndWaitInput, intervals ...interface{}) { - Expect(ctx).NotTo(BeNil(), "ctx is required for deleteAllClustersAndWaitOldAPI") - Expect(input.Client).ToNot(BeNil(), "Invalid argument. input.Client can't be nil when calling deleteAllClustersAndWaitOldAPI") - Expect(input.Namespace).ToNot(BeEmpty(), "Invalid argument. input.Namespace can't be empty when calling deleteAllClustersAndWaitOldAPI") - - clusters := getAllClustersByNamespaceV1alpha4(ctx, framework.GetAllClustersByNamespaceInput{ - Lister: input.Client, - Namespace: input.Namespace, - }) - - for _, c := range clusters { - deleteClusterV1alpha4(ctx, deleteClusterV1alpha4Input{ - Deleter: input.Client, - Cluster: c, - }) - } - - for _, c := range clusters { - log.Logf("Waiting for the Cluster %s to be deleted", klog.KObj(c)) - waitForClusterDeletedV1alpha4(ctx, waitForClusterDeletedV1alpha4Input{ - Getter: input.Client, - Cluster: c, - }, intervals...) - } -} - -// getAllClustersByNamespaceV1alpha4 returns the list of Cluster objects in a namespace using the older API. -func getAllClustersByNamespaceV1alpha4(ctx context.Context, input framework.GetAllClustersByNamespaceInput) []*clusterv1alpha4.Cluster { - clusterList := &clusterv1alpha4.ClusterList{} - Expect(input.Lister.List(ctx, clusterList, client.InNamespace(input.Namespace))).To(Succeed(), "Failed to list clusters in namespace %s", input.Namespace) - - clusters := make([]*clusterv1alpha4.Cluster, len(clusterList.Items)) - for i := range clusterList.Items { - clusters[i] = &clusterList.Items[i] - } - return clusters -} - -// deleteClusterV1alpha4Input is the input for deleteClusterV1alpha4. -type deleteClusterV1alpha4Input struct { - Deleter framework.Deleter - Cluster *clusterv1alpha4.Cluster -} - -// deleteClusterV1alpha4 deletes the cluster and waits for everything the cluster owned to actually be gone using the older API. -func deleteClusterV1alpha4(ctx context.Context, input deleteClusterV1alpha4Input) { - Byf("Deleting cluster %s", input.Cluster.GetName()) - Expect(input.Deleter.Delete(ctx, input.Cluster)).To(Succeed()) -} - -// waitForClusterDeletedV1alpha4Input is the input for waitForClusterDeletedV1alpha4. -type waitForClusterDeletedV1alpha4Input struct { - Getter framework.Getter - Cluster *clusterv1alpha4.Cluster -} - -// waitForClusterDeletedV1alpha4 waits until the cluster object has been deleted using the older API. -func waitForClusterDeletedV1alpha4(ctx context.Context, input waitForClusterDeletedV1alpha4Input, intervals ...interface{}) { - Byf("Waiting for cluster %s to be deleted", input.Cluster.GetName()) - Eventually(func() bool { - cluster := &clusterv1alpha4.Cluster{} - key := client.ObjectKey{ - Namespace: input.Cluster.GetNamespace(), - Name: input.Cluster.GetName(), - } - return apierrors.IsNotFound(input.Getter.Get(ctx, key, cluster)) - }, intervals...).Should(BeTrue()) -} - // validateMachineRollout compares preMachineList and postMachineList to detect a rollout. // Note: we are using unstructured lists because the Machines have different apiVersions. func validateMachineRollout(preMachineList, postMachineList *unstructured.UnstructuredList) bool { diff --git a/test/framework/clusterctl/clusterctl_helpers.go b/test/framework/clusterctl/clusterctl_helpers.go index d7060247bb8b..ec56339ad43a 100644 --- a/test/framework/clusterctl/clusterctl_helpers.go +++ b/test/framework/clusterctl/clusterctl_helpers.go @@ -184,10 +184,7 @@ func UpgradeManagementClusterAndWait(ctx context.Context, input UpgradeManagemen client := input.ClusterProxy.GetClient() log.Logf("Waiting for provider controllers to be running") - controllersDeployments := framework.GetControllerDeployments(ctx, framework.GetControllerDeploymentsInput{ - Lister: client, - ExcludeNamespaces: []string{"capi-webhook-system"}, // this namespace has been dropped in v1alpha4; this ensures we are not waiting for deployments being deleted as part of the upgrade process - }) + controllersDeployments := framework.GetControllerDeployments(ctx, framework.GetControllerDeploymentsInput{Lister: client}) Expect(controllersDeployments).ToNot(BeEmpty(), "The list of controller deployments should not be empty") for _, deployment := range controllersDeployments { framework.WaitForDeploymentsAvailable(ctx, framework.WaitForDeploymentsAvailableInput{ diff --git a/test/infrastructure/docker/api/v1alpha4/condition_consts.go b/test/infrastructure/docker/api/v1alpha4/condition_consts.go deleted file mode 100644 index 03349124600c..000000000000 --- a/test/infrastructure/docker/api/v1alpha4/condition_consts.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - -// Conditions and condition Reasons for the DockerMachine object. - -const ( - // ContainerProvisionedCondition documents the status of the provisioning of the container - // generated by a DockerMachine. - // - // NOTE: When the container provisioning starts the process completes almost immediately and within - // the same reconciliation, so the user will always see a transition from Wait to Provisioned without - // having evidence that the operation is started/is in progress. - ContainerProvisionedCondition clusterv1.ConditionType = "ContainerProvisioned" - - // WaitingForClusterInfrastructureReason (Severity=Info) documents a DockerMachine waiting for the cluster - // infrastructure to be ready before starting to create the container that provides the DockerMachine - // infrastructure. - WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure" - - // WaitingForBootstrapDataReason (Severity=Info) documents a DockerMachine waiting for the bootstrap - // script to be ready before starting to create the container that provides the DockerMachine infrastructure. - WaitingForBootstrapDataReason = "WaitingForBootstrapData" - - // ContainerProvisioningFailedReason (Severity=Warning) documents a DockerMachine controller detecting - // an error while provisioning the container that provides the DockerMachine infrastructure; those kind of - // errors are usually transient and failed provisioning are automatically re-tried by the controller. - ContainerProvisioningFailedReason = "ContainerProvisioningFailed" -) - -const ( - // BootstrapExecSucceededCondition provides an observation of the DockerMachine bootstrap process. - // It is set based on successful execution of bootstrap commands and on the existence of - // the /run/cluster-api/bootstrap-success.complete file. - // The condition gets generated after ContainerProvisionedCondition is True. - // - // NOTE as a difference from other providers, container provisioning and bootstrap are directly managed - // by the DockerMachine controller (not by cloud-init). - BootstrapExecSucceededCondition clusterv1.ConditionType = "BootstrapExecSucceeded" - - // BootstrappingReason documents (Severity=Info) a DockerMachine currently executing the bootstrap - // script that creates the Kubernetes node on the newly provisioned machine infrastructure. - BootstrappingReason = "Bootstrapping" - - // BootstrapFailedReason documents (Severity=Warning) a DockerMachine controller detecting an error while - // bootstrapping the Kubernetes node on the machine just provisioned; those kind of errors are usually - // transient and failed bootstrap are automatically re-tried by the controller. - BootstrapFailedReason = "BootstrapFailed" -) - -// Conditions and condition Reasons for the DockerCluster object. - -const ( - // LoadBalancerAvailableCondition documents the availability of the container that implements the cluster load balancer. - // - // NOTE: When the load balancer provisioning starts the process completes almost immediately and within - // the same reconciliation, so the user will always see a transition from no condition to available without - // having evidence that the operation is started/is in progress. - LoadBalancerAvailableCondition clusterv1.ConditionType = "LoadBalancerAvailable" - - // LoadBalancerProvisioningFailedReason (Severity=Warning) documents a DockerCluster controller detecting - // an error while provisioning the container that provides the cluster load balancer.; those kind of - // errors are usually transient and failed provisioning are automatically re-tried by the controller. - LoadBalancerProvisioningFailedReason = "LoadBalancerProvisioningFailed" -) diff --git a/test/infrastructure/docker/api/v1alpha4/conversion.go b/test/infrastructure/docker/api/v1alpha4/conversion.go deleted file mode 100644 index 6c7dc8507cd9..000000000000 --- a/test/infrastructure/docker/api/v1alpha4/conversion.go +++ /dev/null @@ -1,230 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - apiconversion "k8s.io/apimachinery/pkg/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" - - infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -func (src *DockerCluster) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.DockerCluster) - - if err := Convert_v1alpha4_DockerCluster_To_v1beta1_DockerCluster(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &infrav1.DockerCluster{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - if restored.Spec.LoadBalancer.CustomHAProxyConfigTemplateRef != nil { - dst.Spec.LoadBalancer.CustomHAProxyConfigTemplateRef = restored.Spec.LoadBalancer.CustomHAProxyConfigTemplateRef - } - - return nil -} - -func (dst *DockerCluster) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.DockerCluster) - - if err := Convert_v1beta1_DockerCluster_To_v1alpha4_DockerCluster(src, dst, nil); err != nil { - return err - } - - if err := utilconversion.MarshalData(src, dst); err != nil { - return err - } - - return nil -} - -func (src *DockerClusterList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.DockerClusterList) - - return Convert_v1alpha4_DockerClusterList_To_v1beta1_DockerClusterList(src, dst, nil) -} - -func (dst *DockerClusterList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.DockerClusterList) - - return Convert_v1beta1_DockerClusterList_To_v1alpha4_DockerClusterList(src, dst, nil) -} - -func (src *DockerClusterTemplate) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.DockerClusterTemplate) - - if err := Convert_v1alpha4_DockerClusterTemplate_To_v1beta1_DockerClusterTemplate(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &infrav1.DockerClusterTemplate{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - dst.Spec.Template.ObjectMeta = restored.Spec.Template.ObjectMeta - - if restored.Spec.Template.Spec.LoadBalancer.CustomHAProxyConfigTemplateRef != nil { - dst.Spec.Template.Spec.LoadBalancer.CustomHAProxyConfigTemplateRef = restored.Spec.Template.Spec.LoadBalancer.CustomHAProxyConfigTemplateRef - } - - return nil -} - -func (dst *DockerClusterTemplate) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.DockerClusterTemplate) - - if err := Convert_v1beta1_DockerClusterTemplate_To_v1alpha4_DockerClusterTemplate(src, dst, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata - if err := utilconversion.MarshalData(src, dst); err != nil { - return err - } - - return nil -} - -func (src *DockerClusterTemplateList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.DockerClusterTemplateList) - - return Convert_v1alpha4_DockerClusterTemplateList_To_v1beta1_DockerClusterTemplateList(src, dst, nil) -} - -func (dst *DockerClusterTemplateList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.DockerClusterTemplateList) - - return Convert_v1beta1_DockerClusterTemplateList_To_v1alpha4_DockerClusterTemplateList(src, dst, nil) -} - -func (src *DockerMachine) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.DockerMachine) - - if err := Convert_v1alpha4_DockerMachine_To_v1beta1_DockerMachine(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &infrav1.DockerMachine{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - if restored.Spec.BootstrapTimeout != nil { - dst.Spec.BootstrapTimeout = restored.Spec.BootstrapTimeout - } - - return nil -} - -func (dst *DockerMachine) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.DockerMachine) - - if err := Convert_v1beta1_DockerMachine_To_v1alpha4_DockerMachine(src, dst, nil); err != nil { - return err - } - - if err := utilconversion.MarshalData(src, dst); err != nil { - return err - } - - return nil -} - -func (src *DockerMachineList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.DockerMachineList) - - return Convert_v1alpha4_DockerMachineList_To_v1beta1_DockerMachineList(src, dst, nil) -} - -func (dst *DockerMachineList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.DockerMachineList) - - return Convert_v1beta1_DockerMachineList_To_v1alpha4_DockerMachineList(src, dst, nil) -} - -func (src *DockerMachineTemplate) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.DockerMachineTemplate) - - if err := Convert_v1alpha4_DockerMachineTemplate_To_v1beta1_DockerMachineTemplate(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &infrav1.DockerMachineTemplate{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - dst.Spec.Template.ObjectMeta = restored.Spec.Template.ObjectMeta - dst.Spec.Template.Spec.BootstrapTimeout = restored.Spec.Template.Spec.BootstrapTimeout - - return nil -} - -func (dst *DockerMachineTemplate) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.DockerMachineTemplate) - - if err := Convert_v1beta1_DockerMachineTemplate_To_v1alpha4_DockerMachineTemplate(src, dst, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata - if err := utilconversion.MarshalData(src, dst); err != nil { - return err - } - - return nil -} - -func (src *DockerMachineTemplateList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1.DockerMachineTemplateList) - - return Convert_v1alpha4_DockerMachineTemplateList_To_v1beta1_DockerMachineTemplateList(src, dst, nil) -} - -func (dst *DockerMachineTemplateList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1.DockerMachineTemplateList) - - return Convert_v1beta1_DockerMachineTemplateList_To_v1alpha4_DockerMachineTemplateList(src, dst, nil) -} - -func Convert_v1beta1_DockerClusterTemplateResource_To_v1alpha4_DockerClusterTemplateResource(in *infrav1.DockerClusterTemplateResource, out *DockerClusterTemplateResource, s apiconversion.Scope) error { - // NOTE: custom conversion func is required because spec.template.metadata has been added in v1beta1. - return autoConvert_v1beta1_DockerClusterTemplateResource_To_v1alpha4_DockerClusterTemplateResource(in, out, s) -} - -func Convert_v1beta1_DockerMachineTemplateResource_To_v1alpha4_DockerMachineTemplateResource(in *infrav1.DockerMachineTemplateResource, out *DockerMachineTemplateResource, s apiconversion.Scope) error { - // NOTE: custom conversion func is required because spec.template.metadata has been added in v1beta1. - return autoConvert_v1beta1_DockerMachineTemplateResource_To_v1alpha4_DockerMachineTemplateResource(in, out, s) -} - -func Convert_v1beta1_DockerLoadBalancer_To_v1alpha4_DockerLoadBalancer(in *infrav1.DockerLoadBalancer, out *DockerLoadBalancer, s apiconversion.Scope) error { - return autoConvert_v1beta1_DockerLoadBalancer_To_v1alpha4_DockerLoadBalancer(in, out, s) -} - -func Convert_v1beta1_DockerMachineSpec_To_v1alpha4_DockerMachineSpec(in *infrav1.DockerMachineSpec, out *DockerMachineSpec, s apiconversion.Scope) error { - return autoConvert_v1beta1_DockerMachineSpec_To_v1alpha4_DockerMachineSpec(in, out, s) -} diff --git a/test/infrastructure/docker/api/v1alpha4/conversion_test.go b/test/infrastructure/docker/api/v1alpha4/conversion_test.go deleted file mode 100644 index e48abaeedd51..000000000000 --- a/test/infrastructure/docker/api/v1alpha4/conversion_test.go +++ /dev/null @@ -1,46 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "testing" - - infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -func TestFuzzyConversion(t *testing.T) { - t.Run("for DockerCluster", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &infrav1.DockerCluster{}, - Spoke: &DockerCluster{}, - })) - - t.Run("for DockerClusterTemplate", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &infrav1.DockerClusterTemplate{}, - Spoke: &DockerClusterTemplate{}, - })) - - t.Run("for DockerMachine", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &infrav1.DockerMachine{}, - Spoke: &DockerMachine{}, - })) - - t.Run("for DockerMachineTemplate", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &infrav1.DockerMachineTemplate{}, - Spoke: &DockerMachineTemplate{}, - })) -} diff --git a/test/infrastructure/docker/api/v1alpha4/doc.go b/test/infrastructure/docker/api/v1alpha4/doc.go deleted file mode 100644 index 84ada15c3fd1..000000000000 --- a/test/infrastructure/docker/api/v1alpha4/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains the v1alpha4 API implementation. -// +k8s:conversion-gen=sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1 -// -// Deprecated: This package will be removed in one of the next releases. -package v1alpha4 diff --git a/test/infrastructure/docker/api/v1alpha4/dockercluster_types.go b/test/infrastructure/docker/api/v1alpha4/dockercluster_types.go deleted file mode 100644 index a38453c525e8..000000000000 --- a/test/infrastructure/docker/api/v1alpha4/dockercluster_types.go +++ /dev/null @@ -1,136 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" -) - -const ( - // ClusterFinalizer allows DockerClusterReconciler to clean up resources associated with DockerCluster before - // removing it from the apiserver. - ClusterFinalizer = "dockercluster.infrastructure.cluster.x-k8s.io" -) - -// DockerClusterSpec defines the desired state of DockerCluster. -type DockerClusterSpec 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. - // +optional - ControlPlaneEndpoint APIEndpoint `json:"controlPlaneEndpoint"` - - // FailureDomains are not usulaly defined on the spec. - // The docker provider is special since failure domains don't mean anything in a local docker environment. - // Instead, the docker cluster controller will simply copy these into the Status and allow the Cluster API - // controllers to do what they will with the defined failure domains. - // +optional - FailureDomains clusterv1alpha4.FailureDomains `json:"failureDomains,omitempty"` - - // LoadBalancer allows defining configurations for the cluster load balancer. - // +optional - LoadBalancer DockerLoadBalancer `json:"loadBalancer,omitempty"` -} - -// DockerLoadBalancer allows defining configurations for the cluster load balancer. -type DockerLoadBalancer struct { - // ImageMeta allows customizing the image used for the cluster load balancer. - ImageMeta `json:",inline"` -} - -// ImageMeta allows customizing the image used for components that are not -// originated from the Kubernetes/Kubernetes release process. -type ImageMeta struct { - // ImageRepository sets the container registry to pull the haproxy image from. - // if not set, "kindest" will be used instead. - // +optional - ImageRepository string `json:"imageRepository,omitempty"` - - // ImageTag allows to specify a tag for the haproxy image. - // if not set, "v20210715-a6da3463" will be used instead. - // +optional - ImageTag string `json:"imageTag,omitempty"` -} - -// DockerClusterStatus defines the observed state of DockerCluster. -type DockerClusterStatus struct { - // Ready denotes that the docker cluster (infrastructure) is ready. - Ready bool `json:"ready"` - - // FailureDomains don't mean much in CAPD since it's all local, but we can see how the rest of cluster API - // will use this if we populate it. - FailureDomains clusterv1alpha4.FailureDomains `json:"failureDomains,omitempty"` - - // Conditions defines current service state of the DockerCluster. - // +optional - Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` -} - -// APIEndpoint represents a reachable Kubernetes API endpoint. -type APIEndpoint struct { - // Host is the hostname on which the API server is serving. - Host string `json:"host"` - - // Port is the port on which the API server is serving. - Port int `json:"port"` -} - -// +kubebuilder:resource:path=dockerclusters,scope=Namespaced,categories=cluster-api -// +kubebuilder:subresource:status -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of DockerCluster" - -// DockerCluster is the Schema for the dockerclusters API. -// -// Deprecated: This type will be removed in one of the next releases. -type DockerCluster struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec DockerClusterSpec `json:"spec,omitempty"` - Status DockerClusterStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (c *DockerCluster) GetConditions() clusterv1alpha4.Conditions { - return c.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (c *DockerCluster) SetConditions(conditions clusterv1alpha4.Conditions) { - c.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// DockerClusterList contains a list of DockerCluster. -// -// Deprecated: This type will be removed in one of the next releases. -type DockerClusterList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []DockerCluster `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &DockerCluster{}, &DockerClusterList{}) -} diff --git a/test/infrastructure/docker/api/v1alpha4/dockerclustertemplate_types.go b/test/infrastructure/docker/api/v1alpha4/dockerclustertemplate_types.go deleted file mode 100644 index 479ea8161991..000000000000 --- a/test/infrastructure/docker/api/v1alpha4/dockerclustertemplate_types.go +++ /dev/null @@ -1,62 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// DockerClusterTemplateSpec defines the desired state of DockerClusterTemplate. -type DockerClusterTemplateSpec struct { - Template DockerClusterTemplateResource `json:"template"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of DockerClusterTemplate" - -// DockerClusterTemplate is the Schema for the dockerclustertemplates API. -// -// Deprecated: This type will be removed in one of the next releases. -type DockerClusterTemplate struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec DockerClusterTemplateSpec `json:"spec,omitempty"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:resource:path=dockerclustertemplates,scope=Namespaced,categories=cluster-api - -// DockerClusterTemplateList contains a list of DockerClusterTemplate. -// -// Deprecated: This type will be removed in one of the next releases. -type DockerClusterTemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []DockerClusterTemplate `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &DockerClusterTemplate{}, &DockerClusterTemplateList{}) -} - -// DockerClusterTemplateResource describes the data needed to create a DockerCluster from a template. -type DockerClusterTemplateResource struct { - Spec DockerClusterSpec `json:"spec"` -} diff --git a/test/infrastructure/docker/api/v1alpha4/dockermachine_types.go b/test/infrastructure/docker/api/v1alpha4/dockermachine_types.go deleted file mode 100644 index 4d973bd7658b..000000000000 --- a/test/infrastructure/docker/api/v1alpha4/dockermachine_types.go +++ /dev/null @@ -1,135 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" -) - -const ( - // MachineFinalizer allows ReconcileDockerMachine to clean up resources associated with AWSMachine before - // removing it from the apiserver. - MachineFinalizer = "dockermachine.infrastructure.cluster.x-k8s.io" -) - -// DockerMachineSpec defines the desired state of DockerMachine. -type DockerMachineSpec struct { - // ProviderID will be the container name in ProviderID format (docker:////) - // +optional - ProviderID *string `json:"providerID,omitempty"` - - // CustomImage allows customizing the container image that is used for - // running the machine - // +optional - CustomImage string `json:"customImage,omitempty"` - - // PreLoadImages allows to pre-load images in a newly created machine. This can be used to - // speed up tests by avoiding e.g. to download CNI images on all the containers. - // +optional - PreLoadImages []string `json:"preLoadImages,omitempty"` - - // ExtraMounts describes additional mount points for the node container - // These may be used to bind a hostPath - // +optional - ExtraMounts []Mount `json:"extraMounts,omitempty"` - - // Bootstrapped is true when the kubeadm bootstrapping has been run - // against this machine - // +optional - Bootstrapped bool `json:"bootstrapped,omitempty"` -} - -// Mount specifies a host volume to mount into a container. -// This is a simplified version of kind v1alpha4.Mount types. -type Mount struct { - // Path of the mount within the container. - ContainerPath string `json:"containerPath,omitempty"` - - // Path of the mount on the host. If the hostPath doesn't exist, then runtimes - // should report error. If the hostpath is a symbolic link, runtimes should - // follow the symlink and mount the real destination to container. - HostPath string `json:"hostPath,omitempty"` - - // If set, the mount is read-only. - // +optional - Readonly bool `json:"readOnly,omitempty"` -} - -// DockerMachineStatus defines the observed state of DockerMachine. -type DockerMachineStatus struct { - // Ready denotes that the machine (docker container) is ready - // +optional - Ready bool `json:"ready"` - - // LoadBalancerConfigured denotes that the machine has been - // added to the load balancer - // +optional - LoadBalancerConfigured bool `json:"loadBalancerConfigured,omitempty"` - - // Addresses contains the associated addresses for the docker machine. - // +optional - Addresses []clusterv1alpha4.MachineAddress `json:"addresses,omitempty"` - - // Conditions defines current service state of the DockerMachine. - // +optional - Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` -} - -// +kubebuilder:resource:path=dockermachines,scope=Namespaced,categories=cluster-api -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of DockerMachine" - -// DockerMachine is the Schema for the dockermachines API. -// -// Deprecated: This type will be removed in one of the next releases. -type DockerMachine struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec DockerMachineSpec `json:"spec,omitempty"` - Status DockerMachineStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (c *DockerMachine) GetConditions() clusterv1alpha4.Conditions { - return c.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (c *DockerMachine) SetConditions(conditions clusterv1alpha4.Conditions) { - c.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// DockerMachineList contains a list of DockerMachine. -// -// Deprecated: This type will be removed in one of the next releases. -type DockerMachineList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []DockerMachine `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &DockerMachine{}, &DockerMachineList{}) -} diff --git a/test/infrastructure/docker/api/v1alpha4/dockermachinetemplate_types.go b/test/infrastructure/docker/api/v1alpha4/dockermachinetemplate_types.go deleted file mode 100644 index 369f9829168d..000000000000 --- a/test/infrastructure/docker/api/v1alpha4/dockermachinetemplate_types.go +++ /dev/null @@ -1,63 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// DockerMachineTemplateSpec defines the desired state of DockerMachineTemplate. -type DockerMachineTemplateSpec struct { - Template DockerMachineTemplateResource `json:"template"` -} - -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:resource:path=dockermachinetemplates,scope=Namespaced,categories=cluster-api -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of DockerMachineTemplate" - -// DockerMachineTemplate is the Schema for the dockermachinetemplates API. -// -// Deprecated: This type will be removed in one of the next releases. -type DockerMachineTemplate struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec DockerMachineTemplateSpec `json:"spec,omitempty"` -} - -// +kubebuilder:object:root=true - -// DockerMachineTemplateList contains a list of DockerMachineTemplate. -// -// Deprecated: This type will be removed in one of the next releases. -type DockerMachineTemplateList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []DockerMachineTemplate `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &DockerMachineTemplate{}, &DockerMachineTemplateList{}) -} - -// DockerMachineTemplateResource describes the data needed to create a DockerMachine from a template. -type DockerMachineTemplateResource struct { - // Spec is the specification of the desired behavior of the machine. - Spec DockerMachineSpec `json:"spec"` -} diff --git a/test/infrastructure/docker/api/v1alpha4/groupversion_info.go b/test/infrastructure/docker/api/v1alpha4/groupversion_info.go deleted file mode 100644 index fc5e4dd0c4cc..000000000000 --- a/test/infrastructure/docker/api/v1alpha4/groupversion_info.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains API Schema definitions for the infrastructure v1alpha4 API group -// +kubebuilder:object:generate=true -// +groupName=infrastructure.cluster.x-k8s.io -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -var ( - // GroupVersion is group version used to register these objects. - GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1alpha4"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme. - schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = schemeBuilder.AddToScheme - - objectTypes = []runtime.Object{} - - // localSchemeBuilder is used for type conversions. - localSchemeBuilder = schemeBuilder -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(GroupVersion, objectTypes...) - metav1.AddToGroupVersion(scheme, GroupVersion) - return nil -} diff --git a/test/infrastructure/docker/api/v1alpha4/zz_generated.conversion.go b/test/infrastructure/docker/api/v1alpha4/zz_generated.conversion.go deleted file mode 100644 index 960ed662f0f9..000000000000 --- a/test/infrastructure/docker/api/v1alpha4/zz_generated.conversion.go +++ /dev/null @@ -1,916 +0,0 @@ -//go:build !ignore_autogenerated_capd -// +build !ignore_autogenerated_capd - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - unsafe "unsafe" - - 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" - v1beta1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" -) - -func init() { - localSchemeBuilder.Register(RegisterConversions) -} - -// RegisterConversions adds conversion functions to the given scheme. -// Public to allow building arbitrary schemes. -func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*APIEndpoint)(nil), (*v1beta1.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(a.(*APIEndpoint), b.(*v1beta1.APIEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.APIEndpoint)(nil), (*APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(a.(*v1beta1.APIEndpoint), b.(*APIEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerCluster)(nil), (*v1beta1.DockerCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerCluster_To_v1beta1_DockerCluster(a.(*DockerCluster), b.(*v1beta1.DockerCluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerCluster)(nil), (*DockerCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerCluster_To_v1alpha4_DockerCluster(a.(*v1beta1.DockerCluster), b.(*DockerCluster), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerClusterList)(nil), (*v1beta1.DockerClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerClusterList_To_v1beta1_DockerClusterList(a.(*DockerClusterList), b.(*v1beta1.DockerClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerClusterList)(nil), (*DockerClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerClusterList_To_v1alpha4_DockerClusterList(a.(*v1beta1.DockerClusterList), b.(*DockerClusterList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerClusterSpec)(nil), (*v1beta1.DockerClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerClusterSpec_To_v1beta1_DockerClusterSpec(a.(*DockerClusterSpec), b.(*v1beta1.DockerClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerClusterSpec)(nil), (*DockerClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerClusterSpec_To_v1alpha4_DockerClusterSpec(a.(*v1beta1.DockerClusterSpec), b.(*DockerClusterSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerClusterStatus)(nil), (*v1beta1.DockerClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerClusterStatus_To_v1beta1_DockerClusterStatus(a.(*DockerClusterStatus), b.(*v1beta1.DockerClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerClusterStatus)(nil), (*DockerClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerClusterStatus_To_v1alpha4_DockerClusterStatus(a.(*v1beta1.DockerClusterStatus), b.(*DockerClusterStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerClusterTemplate)(nil), (*v1beta1.DockerClusterTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerClusterTemplate_To_v1beta1_DockerClusterTemplate(a.(*DockerClusterTemplate), b.(*v1beta1.DockerClusterTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerClusterTemplate)(nil), (*DockerClusterTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerClusterTemplate_To_v1alpha4_DockerClusterTemplate(a.(*v1beta1.DockerClusterTemplate), b.(*DockerClusterTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerClusterTemplateList)(nil), (*v1beta1.DockerClusterTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerClusterTemplateList_To_v1beta1_DockerClusterTemplateList(a.(*DockerClusterTemplateList), b.(*v1beta1.DockerClusterTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerClusterTemplateList)(nil), (*DockerClusterTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerClusterTemplateList_To_v1alpha4_DockerClusterTemplateList(a.(*v1beta1.DockerClusterTemplateList), b.(*DockerClusterTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerClusterTemplateResource)(nil), (*v1beta1.DockerClusterTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerClusterTemplateResource_To_v1beta1_DockerClusterTemplateResource(a.(*DockerClusterTemplateResource), b.(*v1beta1.DockerClusterTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerClusterTemplateSpec)(nil), (*v1beta1.DockerClusterTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerClusterTemplateSpec_To_v1beta1_DockerClusterTemplateSpec(a.(*DockerClusterTemplateSpec), b.(*v1beta1.DockerClusterTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerClusterTemplateSpec)(nil), (*DockerClusterTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerClusterTemplateSpec_To_v1alpha4_DockerClusterTemplateSpec(a.(*v1beta1.DockerClusterTemplateSpec), b.(*DockerClusterTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerLoadBalancer)(nil), (*v1beta1.DockerLoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerLoadBalancer_To_v1beta1_DockerLoadBalancer(a.(*DockerLoadBalancer), b.(*v1beta1.DockerLoadBalancer), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerMachine)(nil), (*v1beta1.DockerMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerMachine_To_v1beta1_DockerMachine(a.(*DockerMachine), b.(*v1beta1.DockerMachine), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerMachine)(nil), (*DockerMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerMachine_To_v1alpha4_DockerMachine(a.(*v1beta1.DockerMachine), b.(*DockerMachine), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerMachineList)(nil), (*v1beta1.DockerMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerMachineList_To_v1beta1_DockerMachineList(a.(*DockerMachineList), b.(*v1beta1.DockerMachineList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerMachineList)(nil), (*DockerMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerMachineList_To_v1alpha4_DockerMachineList(a.(*v1beta1.DockerMachineList), b.(*DockerMachineList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerMachineSpec)(nil), (*v1beta1.DockerMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerMachineSpec_To_v1beta1_DockerMachineSpec(a.(*DockerMachineSpec), b.(*v1beta1.DockerMachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerMachineStatus)(nil), (*v1beta1.DockerMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerMachineStatus_To_v1beta1_DockerMachineStatus(a.(*DockerMachineStatus), b.(*v1beta1.DockerMachineStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerMachineStatus)(nil), (*DockerMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerMachineStatus_To_v1alpha4_DockerMachineStatus(a.(*v1beta1.DockerMachineStatus), b.(*DockerMachineStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerMachineTemplate)(nil), (*v1beta1.DockerMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerMachineTemplate_To_v1beta1_DockerMachineTemplate(a.(*DockerMachineTemplate), b.(*v1beta1.DockerMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerMachineTemplate)(nil), (*DockerMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerMachineTemplate_To_v1alpha4_DockerMachineTemplate(a.(*v1beta1.DockerMachineTemplate), b.(*DockerMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerMachineTemplateList)(nil), (*v1beta1.DockerMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerMachineTemplateList_To_v1beta1_DockerMachineTemplateList(a.(*DockerMachineTemplateList), b.(*v1beta1.DockerMachineTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerMachineTemplateList)(nil), (*DockerMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerMachineTemplateList_To_v1alpha4_DockerMachineTemplateList(a.(*v1beta1.DockerMachineTemplateList), b.(*DockerMachineTemplateList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerMachineTemplateResource)(nil), (*v1beta1.DockerMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerMachineTemplateResource_To_v1beta1_DockerMachineTemplateResource(a.(*DockerMachineTemplateResource), b.(*v1beta1.DockerMachineTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerMachineTemplateSpec)(nil), (*v1beta1.DockerMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerMachineTemplateSpec_To_v1beta1_DockerMachineTemplateSpec(a.(*DockerMachineTemplateSpec), b.(*v1beta1.DockerMachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerMachineTemplateSpec)(nil), (*DockerMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerMachineTemplateSpec_To_v1alpha4_DockerMachineTemplateSpec(a.(*v1beta1.DockerMachineTemplateSpec), b.(*DockerMachineTemplateSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*ImageMeta)(nil), (*v1beta1.ImageMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ImageMeta_To_v1beta1_ImageMeta(a.(*ImageMeta), b.(*v1beta1.ImageMeta), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.ImageMeta)(nil), (*ImageMeta)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_ImageMeta_To_v1alpha4_ImageMeta(a.(*v1beta1.ImageMeta), b.(*ImageMeta), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*Mount)(nil), (*v1beta1.Mount)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Mount_To_v1beta1_Mount(a.(*Mount), b.(*v1beta1.Mount), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.Mount)(nil), (*Mount)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_Mount_To_v1alpha4_Mount(a.(*v1beta1.Mount), b.(*Mount), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.DockerClusterTemplateResource)(nil), (*DockerClusterTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerClusterTemplateResource_To_v1alpha4_DockerClusterTemplateResource(a.(*v1beta1.DockerClusterTemplateResource), b.(*DockerClusterTemplateResource), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.DockerLoadBalancer)(nil), (*DockerLoadBalancer)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerLoadBalancer_To_v1alpha4_DockerLoadBalancer(a.(*v1beta1.DockerLoadBalancer), b.(*DockerLoadBalancer), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.DockerMachineSpec)(nil), (*DockerMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerMachineSpec_To_v1alpha4_DockerMachineSpec(a.(*v1beta1.DockerMachineSpec), b.(*DockerMachineSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.DockerMachineTemplateResource)(nil), (*DockerMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerMachineTemplateResource_To_v1alpha4_DockerMachineTemplateResource(a.(*v1beta1.DockerMachineTemplateResource), b.(*DockerMachineTemplateResource), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in *APIEndpoint, out *v1beta1.APIEndpoint, s conversion.Scope) error { - out.Host = in.Host - out.Port = in.Port - return nil -} - -// Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint is an autogenerated conversion function. -func Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in *APIEndpoint, out *v1beta1.APIEndpoint, s conversion.Scope) error { - return autoConvert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in, out, s) -} - -func autoConvert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in *v1beta1.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { - out.Host = in.Host - out.Port = in.Port - return nil -} - -// Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint is an autogenerated conversion function. -func Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in *v1beta1.APIEndpoint, out *APIEndpoint, s conversion.Scope) error { - return autoConvert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in, out, s) -} - -func autoConvert_v1alpha4_DockerCluster_To_v1beta1_DockerCluster(in *DockerCluster, out *v1beta1.DockerCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_DockerClusterSpec_To_v1beta1_DockerClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_DockerClusterStatus_To_v1beta1_DockerClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_DockerCluster_To_v1beta1_DockerCluster is an autogenerated conversion function. -func Convert_v1alpha4_DockerCluster_To_v1beta1_DockerCluster(in *DockerCluster, out *v1beta1.DockerCluster, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerCluster_To_v1beta1_DockerCluster(in, out, s) -} - -func autoConvert_v1beta1_DockerCluster_To_v1alpha4_DockerCluster(in *v1beta1.DockerCluster, out *DockerCluster, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_DockerClusterSpec_To_v1alpha4_DockerClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_DockerClusterStatus_To_v1alpha4_DockerClusterStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_DockerCluster_To_v1alpha4_DockerCluster is an autogenerated conversion function. -func Convert_v1beta1_DockerCluster_To_v1alpha4_DockerCluster(in *v1beta1.DockerCluster, out *DockerCluster, s conversion.Scope) error { - return autoConvert_v1beta1_DockerCluster_To_v1alpha4_DockerCluster(in, out, s) -} - -func autoConvert_v1alpha4_DockerClusterList_To_v1beta1_DockerClusterList(in *DockerClusterList, out *v1beta1.DockerClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.DockerCluster, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_DockerCluster_To_v1beta1_DockerCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_DockerClusterList_To_v1beta1_DockerClusterList is an autogenerated conversion function. -func Convert_v1alpha4_DockerClusterList_To_v1beta1_DockerClusterList(in *DockerClusterList, out *v1beta1.DockerClusterList, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerClusterList_To_v1beta1_DockerClusterList(in, out, s) -} - -func autoConvert_v1beta1_DockerClusterList_To_v1alpha4_DockerClusterList(in *v1beta1.DockerClusterList, out *DockerClusterList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DockerCluster, len(*in)) - for i := range *in { - if err := Convert_v1beta1_DockerCluster_To_v1alpha4_DockerCluster(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_DockerClusterList_To_v1alpha4_DockerClusterList is an autogenerated conversion function. -func Convert_v1beta1_DockerClusterList_To_v1alpha4_DockerClusterList(in *v1beta1.DockerClusterList, out *DockerClusterList, s conversion.Scope) error { - return autoConvert_v1beta1_DockerClusterList_To_v1alpha4_DockerClusterList(in, out, s) -} - -func autoConvert_v1alpha4_DockerClusterSpec_To_v1beta1_DockerClusterSpec(in *DockerClusterSpec, out *v1beta1.DockerClusterSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { - return err - } - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make(apiv1beta1.FailureDomains, len(*in)) - for key, val := range *in { - newVal := new(apiv1beta1.FailureDomainSpec) - if err := apiv1alpha4.Convert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec(&val, newVal, s); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.FailureDomains = nil - } - if err := Convert_v1alpha4_DockerLoadBalancer_To_v1beta1_DockerLoadBalancer(&in.LoadBalancer, &out.LoadBalancer, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_DockerClusterSpec_To_v1beta1_DockerClusterSpec is an autogenerated conversion function. -func Convert_v1alpha4_DockerClusterSpec_To_v1beta1_DockerClusterSpec(in *DockerClusterSpec, out *v1beta1.DockerClusterSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerClusterSpec_To_v1beta1_DockerClusterSpec(in, out, s) -} - -func autoConvert_v1beta1_DockerClusterSpec_To_v1alpha4_DockerClusterSpec(in *v1beta1.DockerClusterSpec, out *DockerClusterSpec, s conversion.Scope) error { - if err := Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { - return err - } - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make(apiv1alpha4.FailureDomains, len(*in)) - for key, val := range *in { - newVal := new(apiv1alpha4.FailureDomainSpec) - if err := apiv1alpha4.Convert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(&val, newVal, s); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.FailureDomains = nil - } - if err := Convert_v1beta1_DockerLoadBalancer_To_v1alpha4_DockerLoadBalancer(&in.LoadBalancer, &out.LoadBalancer, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_DockerClusterSpec_To_v1alpha4_DockerClusterSpec is an autogenerated conversion function. -func Convert_v1beta1_DockerClusterSpec_To_v1alpha4_DockerClusterSpec(in *v1beta1.DockerClusterSpec, out *DockerClusterSpec, s conversion.Scope) error { - return autoConvert_v1beta1_DockerClusterSpec_To_v1alpha4_DockerClusterSpec(in, out, s) -} - -func autoConvert_v1alpha4_DockerClusterStatus_To_v1beta1_DockerClusterStatus(in *DockerClusterStatus, out *v1beta1.DockerClusterStatus, s conversion.Scope) error { - out.Ready = in.Ready - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make(apiv1beta1.FailureDomains, len(*in)) - for key, val := range *in { - newVal := new(apiv1beta1.FailureDomainSpec) - if err := apiv1alpha4.Convert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec(&val, newVal, s); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.FailureDomains = nil - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1beta1.Conditions, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1alpha4_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - return nil -} - -// Convert_v1alpha4_DockerClusterStatus_To_v1beta1_DockerClusterStatus is an autogenerated conversion function. -func Convert_v1alpha4_DockerClusterStatus_To_v1beta1_DockerClusterStatus(in *DockerClusterStatus, out *v1beta1.DockerClusterStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerClusterStatus_To_v1beta1_DockerClusterStatus(in, out, s) -} - -func autoConvert_v1beta1_DockerClusterStatus_To_v1alpha4_DockerClusterStatus(in *v1beta1.DockerClusterStatus, out *DockerClusterStatus, s conversion.Scope) error { - out.Ready = in.Ready - if in.FailureDomains != nil { - in, out := &in.FailureDomains, &out.FailureDomains - *out = make(apiv1alpha4.FailureDomains, len(*in)) - for key, val := range *in { - newVal := new(apiv1alpha4.FailureDomainSpec) - if err := apiv1alpha4.Convert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(&val, newVal, s); err != nil { - return err - } - (*out)[key] = *newVal - } - } else { - out.FailureDomains = nil - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1alpha4.Conditions, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1beta1_Condition_To_v1alpha4_Condition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - return nil -} - -// Convert_v1beta1_DockerClusterStatus_To_v1alpha4_DockerClusterStatus is an autogenerated conversion function. -func Convert_v1beta1_DockerClusterStatus_To_v1alpha4_DockerClusterStatus(in *v1beta1.DockerClusterStatus, out *DockerClusterStatus, s conversion.Scope) error { - return autoConvert_v1beta1_DockerClusterStatus_To_v1alpha4_DockerClusterStatus(in, out, s) -} - -func autoConvert_v1alpha4_DockerClusterTemplate_To_v1beta1_DockerClusterTemplate(in *DockerClusterTemplate, out *v1beta1.DockerClusterTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_DockerClusterTemplateSpec_To_v1beta1_DockerClusterTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_DockerClusterTemplate_To_v1beta1_DockerClusterTemplate is an autogenerated conversion function. -func Convert_v1alpha4_DockerClusterTemplate_To_v1beta1_DockerClusterTemplate(in *DockerClusterTemplate, out *v1beta1.DockerClusterTemplate, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerClusterTemplate_To_v1beta1_DockerClusterTemplate(in, out, s) -} - -func autoConvert_v1beta1_DockerClusterTemplate_To_v1alpha4_DockerClusterTemplate(in *v1beta1.DockerClusterTemplate, out *DockerClusterTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_DockerClusterTemplateSpec_To_v1alpha4_DockerClusterTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_DockerClusterTemplate_To_v1alpha4_DockerClusterTemplate is an autogenerated conversion function. -func Convert_v1beta1_DockerClusterTemplate_To_v1alpha4_DockerClusterTemplate(in *v1beta1.DockerClusterTemplate, out *DockerClusterTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_DockerClusterTemplate_To_v1alpha4_DockerClusterTemplate(in, out, s) -} - -func autoConvert_v1alpha4_DockerClusterTemplateList_To_v1beta1_DockerClusterTemplateList(in *DockerClusterTemplateList, out *v1beta1.DockerClusterTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.DockerClusterTemplate, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_DockerClusterTemplate_To_v1beta1_DockerClusterTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_DockerClusterTemplateList_To_v1beta1_DockerClusterTemplateList is an autogenerated conversion function. -func Convert_v1alpha4_DockerClusterTemplateList_To_v1beta1_DockerClusterTemplateList(in *DockerClusterTemplateList, out *v1beta1.DockerClusterTemplateList, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerClusterTemplateList_To_v1beta1_DockerClusterTemplateList(in, out, s) -} - -func autoConvert_v1beta1_DockerClusterTemplateList_To_v1alpha4_DockerClusterTemplateList(in *v1beta1.DockerClusterTemplateList, out *DockerClusterTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DockerClusterTemplate, len(*in)) - for i := range *in { - if err := Convert_v1beta1_DockerClusterTemplate_To_v1alpha4_DockerClusterTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_DockerClusterTemplateList_To_v1alpha4_DockerClusterTemplateList is an autogenerated conversion function. -func Convert_v1beta1_DockerClusterTemplateList_To_v1alpha4_DockerClusterTemplateList(in *v1beta1.DockerClusterTemplateList, out *DockerClusterTemplateList, s conversion.Scope) error { - return autoConvert_v1beta1_DockerClusterTemplateList_To_v1alpha4_DockerClusterTemplateList(in, out, s) -} - -func autoConvert_v1alpha4_DockerClusterTemplateResource_To_v1beta1_DockerClusterTemplateResource(in *DockerClusterTemplateResource, out *v1beta1.DockerClusterTemplateResource, s conversion.Scope) error { - if err := Convert_v1alpha4_DockerClusterSpec_To_v1beta1_DockerClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_DockerClusterTemplateResource_To_v1beta1_DockerClusterTemplateResource is an autogenerated conversion function. -func Convert_v1alpha4_DockerClusterTemplateResource_To_v1beta1_DockerClusterTemplateResource(in *DockerClusterTemplateResource, out *v1beta1.DockerClusterTemplateResource, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerClusterTemplateResource_To_v1beta1_DockerClusterTemplateResource(in, out, s) -} - -func autoConvert_v1beta1_DockerClusterTemplateResource_To_v1alpha4_DockerClusterTemplateResource(in *v1beta1.DockerClusterTemplateResource, out *DockerClusterTemplateResource, s conversion.Scope) error { - // WARNING: in.ObjectMeta requires manual conversion: does not exist in peer-type - if err := Convert_v1beta1_DockerClusterSpec_To_v1alpha4_DockerClusterSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha4_DockerClusterTemplateSpec_To_v1beta1_DockerClusterTemplateSpec(in *DockerClusterTemplateSpec, out *v1beta1.DockerClusterTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_DockerClusterTemplateResource_To_v1beta1_DockerClusterTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_DockerClusterTemplateSpec_To_v1beta1_DockerClusterTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha4_DockerClusterTemplateSpec_To_v1beta1_DockerClusterTemplateSpec(in *DockerClusterTemplateSpec, out *v1beta1.DockerClusterTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerClusterTemplateSpec_To_v1beta1_DockerClusterTemplateSpec(in, out, s) -} - -func autoConvert_v1beta1_DockerClusterTemplateSpec_To_v1alpha4_DockerClusterTemplateSpec(in *v1beta1.DockerClusterTemplateSpec, out *DockerClusterTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta1_DockerClusterTemplateResource_To_v1alpha4_DockerClusterTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_DockerClusterTemplateSpec_To_v1alpha4_DockerClusterTemplateSpec is an autogenerated conversion function. -func Convert_v1beta1_DockerClusterTemplateSpec_To_v1alpha4_DockerClusterTemplateSpec(in *v1beta1.DockerClusterTemplateSpec, out *DockerClusterTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta1_DockerClusterTemplateSpec_To_v1alpha4_DockerClusterTemplateSpec(in, out, s) -} - -func autoConvert_v1alpha4_DockerLoadBalancer_To_v1beta1_DockerLoadBalancer(in *DockerLoadBalancer, out *v1beta1.DockerLoadBalancer, s conversion.Scope) error { - if err := Convert_v1alpha4_ImageMeta_To_v1beta1_ImageMeta(&in.ImageMeta, &out.ImageMeta, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_DockerLoadBalancer_To_v1beta1_DockerLoadBalancer is an autogenerated conversion function. -func Convert_v1alpha4_DockerLoadBalancer_To_v1beta1_DockerLoadBalancer(in *DockerLoadBalancer, out *v1beta1.DockerLoadBalancer, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerLoadBalancer_To_v1beta1_DockerLoadBalancer(in, out, s) -} - -func autoConvert_v1beta1_DockerLoadBalancer_To_v1alpha4_DockerLoadBalancer(in *v1beta1.DockerLoadBalancer, out *DockerLoadBalancer, s conversion.Scope) error { - if err := Convert_v1beta1_ImageMeta_To_v1alpha4_ImageMeta(&in.ImageMeta, &out.ImageMeta, s); err != nil { - return err - } - // WARNING: in.CustomHAProxyConfigTemplateRef requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_DockerMachine_To_v1beta1_DockerMachine(in *DockerMachine, out *v1beta1.DockerMachine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_DockerMachineSpec_To_v1beta1_DockerMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_DockerMachineStatus_To_v1beta1_DockerMachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_DockerMachine_To_v1beta1_DockerMachine is an autogenerated conversion function. -func Convert_v1alpha4_DockerMachine_To_v1beta1_DockerMachine(in *DockerMachine, out *v1beta1.DockerMachine, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerMachine_To_v1beta1_DockerMachine(in, out, s) -} - -func autoConvert_v1beta1_DockerMachine_To_v1alpha4_DockerMachine(in *v1beta1.DockerMachine, out *DockerMachine, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_DockerMachineSpec_To_v1alpha4_DockerMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_DockerMachineStatus_To_v1alpha4_DockerMachineStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_DockerMachine_To_v1alpha4_DockerMachine is an autogenerated conversion function. -func Convert_v1beta1_DockerMachine_To_v1alpha4_DockerMachine(in *v1beta1.DockerMachine, out *DockerMachine, s conversion.Scope) error { - return autoConvert_v1beta1_DockerMachine_To_v1alpha4_DockerMachine(in, out, s) -} - -func autoConvert_v1alpha4_DockerMachineList_To_v1beta1_DockerMachineList(in *DockerMachineList, out *v1beta1.DockerMachineList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.DockerMachine, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_DockerMachine_To_v1beta1_DockerMachine(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_DockerMachineList_To_v1beta1_DockerMachineList is an autogenerated conversion function. -func Convert_v1alpha4_DockerMachineList_To_v1beta1_DockerMachineList(in *DockerMachineList, out *v1beta1.DockerMachineList, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerMachineList_To_v1beta1_DockerMachineList(in, out, s) -} - -func autoConvert_v1beta1_DockerMachineList_To_v1alpha4_DockerMachineList(in *v1beta1.DockerMachineList, out *DockerMachineList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DockerMachine, len(*in)) - for i := range *in { - if err := Convert_v1beta1_DockerMachine_To_v1alpha4_DockerMachine(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_DockerMachineList_To_v1alpha4_DockerMachineList is an autogenerated conversion function. -func Convert_v1beta1_DockerMachineList_To_v1alpha4_DockerMachineList(in *v1beta1.DockerMachineList, out *DockerMachineList, s conversion.Scope) error { - return autoConvert_v1beta1_DockerMachineList_To_v1alpha4_DockerMachineList(in, out, s) -} - -func autoConvert_v1alpha4_DockerMachineSpec_To_v1beta1_DockerMachineSpec(in *DockerMachineSpec, out *v1beta1.DockerMachineSpec, s conversion.Scope) error { - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - out.CustomImage = in.CustomImage - out.PreLoadImages = *(*[]string)(unsafe.Pointer(&in.PreLoadImages)) - out.ExtraMounts = *(*[]v1beta1.Mount)(unsafe.Pointer(&in.ExtraMounts)) - out.Bootstrapped = in.Bootstrapped - return nil -} - -// Convert_v1alpha4_DockerMachineSpec_To_v1beta1_DockerMachineSpec is an autogenerated conversion function. -func Convert_v1alpha4_DockerMachineSpec_To_v1beta1_DockerMachineSpec(in *DockerMachineSpec, out *v1beta1.DockerMachineSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerMachineSpec_To_v1beta1_DockerMachineSpec(in, out, s) -} - -func autoConvert_v1beta1_DockerMachineSpec_To_v1alpha4_DockerMachineSpec(in *v1beta1.DockerMachineSpec, out *DockerMachineSpec, s conversion.Scope) error { - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - out.CustomImage = in.CustomImage - out.PreLoadImages = *(*[]string)(unsafe.Pointer(&in.PreLoadImages)) - out.ExtraMounts = *(*[]Mount)(unsafe.Pointer(&in.ExtraMounts)) - out.Bootstrapped = in.Bootstrapped - // WARNING: in.BootstrapTimeout requires manual conversion: does not exist in peer-type - return nil -} - -func autoConvert_v1alpha4_DockerMachineStatus_To_v1beta1_DockerMachineStatus(in *DockerMachineStatus, out *v1beta1.DockerMachineStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.LoadBalancerConfigured = in.LoadBalancerConfigured - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]apiv1beta1.MachineAddress, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1alpha4_MachineAddress_To_v1beta1_MachineAddress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Addresses = nil - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1beta1.Conditions, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1alpha4_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - return nil -} - -// Convert_v1alpha4_DockerMachineStatus_To_v1beta1_DockerMachineStatus is an autogenerated conversion function. -func Convert_v1alpha4_DockerMachineStatus_To_v1beta1_DockerMachineStatus(in *DockerMachineStatus, out *v1beta1.DockerMachineStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerMachineStatus_To_v1beta1_DockerMachineStatus(in, out, s) -} - -func autoConvert_v1beta1_DockerMachineStatus_To_v1alpha4_DockerMachineStatus(in *v1beta1.DockerMachineStatus, out *DockerMachineStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.LoadBalancerConfigured = in.LoadBalancerConfigured - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]apiv1alpha4.MachineAddress, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1beta1_MachineAddress_To_v1alpha4_MachineAddress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Addresses = nil - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1alpha4.Conditions, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1beta1_Condition_To_v1alpha4_Condition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - return nil -} - -// Convert_v1beta1_DockerMachineStatus_To_v1alpha4_DockerMachineStatus is an autogenerated conversion function. -func Convert_v1beta1_DockerMachineStatus_To_v1alpha4_DockerMachineStatus(in *v1beta1.DockerMachineStatus, out *DockerMachineStatus, s conversion.Scope) error { - return autoConvert_v1beta1_DockerMachineStatus_To_v1alpha4_DockerMachineStatus(in, out, s) -} - -func autoConvert_v1alpha4_DockerMachineTemplate_To_v1beta1_DockerMachineTemplate(in *DockerMachineTemplate, out *v1beta1.DockerMachineTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_DockerMachineTemplateSpec_To_v1beta1_DockerMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_DockerMachineTemplate_To_v1beta1_DockerMachineTemplate is an autogenerated conversion function. -func Convert_v1alpha4_DockerMachineTemplate_To_v1beta1_DockerMachineTemplate(in *DockerMachineTemplate, out *v1beta1.DockerMachineTemplate, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerMachineTemplate_To_v1beta1_DockerMachineTemplate(in, out, s) -} - -func autoConvert_v1beta1_DockerMachineTemplate_To_v1alpha4_DockerMachineTemplate(in *v1beta1.DockerMachineTemplate, out *DockerMachineTemplate, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_DockerMachineTemplateSpec_To_v1alpha4_DockerMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_DockerMachineTemplate_To_v1alpha4_DockerMachineTemplate is an autogenerated conversion function. -func Convert_v1beta1_DockerMachineTemplate_To_v1alpha4_DockerMachineTemplate(in *v1beta1.DockerMachineTemplate, out *DockerMachineTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_DockerMachineTemplate_To_v1alpha4_DockerMachineTemplate(in, out, s) -} - -func autoConvert_v1alpha4_DockerMachineTemplateList_To_v1beta1_DockerMachineTemplateList(in *DockerMachineTemplateList, out *v1beta1.DockerMachineTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.DockerMachineTemplate, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_DockerMachineTemplate_To_v1beta1_DockerMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_DockerMachineTemplateList_To_v1beta1_DockerMachineTemplateList is an autogenerated conversion function. -func Convert_v1alpha4_DockerMachineTemplateList_To_v1beta1_DockerMachineTemplateList(in *DockerMachineTemplateList, out *v1beta1.DockerMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerMachineTemplateList_To_v1beta1_DockerMachineTemplateList(in, out, s) -} - -func autoConvert_v1beta1_DockerMachineTemplateList_To_v1alpha4_DockerMachineTemplateList(in *v1beta1.DockerMachineTemplateList, out *DockerMachineTemplateList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DockerMachineTemplate, len(*in)) - for i := range *in { - if err := Convert_v1beta1_DockerMachineTemplate_To_v1alpha4_DockerMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_DockerMachineTemplateList_To_v1alpha4_DockerMachineTemplateList is an autogenerated conversion function. -func Convert_v1beta1_DockerMachineTemplateList_To_v1alpha4_DockerMachineTemplateList(in *v1beta1.DockerMachineTemplateList, out *DockerMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1beta1_DockerMachineTemplateList_To_v1alpha4_DockerMachineTemplateList(in, out, s) -} - -func autoConvert_v1alpha4_DockerMachineTemplateResource_To_v1beta1_DockerMachineTemplateResource(in *DockerMachineTemplateResource, out *v1beta1.DockerMachineTemplateResource, s conversion.Scope) error { - if err := Convert_v1alpha4_DockerMachineSpec_To_v1beta1_DockerMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_DockerMachineTemplateResource_To_v1beta1_DockerMachineTemplateResource is an autogenerated conversion function. -func Convert_v1alpha4_DockerMachineTemplateResource_To_v1beta1_DockerMachineTemplateResource(in *DockerMachineTemplateResource, out *v1beta1.DockerMachineTemplateResource, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerMachineTemplateResource_To_v1beta1_DockerMachineTemplateResource(in, out, s) -} - -func autoConvert_v1beta1_DockerMachineTemplateResource_To_v1alpha4_DockerMachineTemplateResource(in *v1beta1.DockerMachineTemplateResource, out *DockerMachineTemplateResource, s conversion.Scope) error { - // WARNING: in.ObjectMeta requires manual conversion: does not exist in peer-type - if err := Convert_v1beta1_DockerMachineSpec_To_v1alpha4_DockerMachineSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha4_DockerMachineTemplateSpec_To_v1beta1_DockerMachineTemplateSpec(in *DockerMachineTemplateSpec, out *v1beta1.DockerMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_DockerMachineTemplateResource_To_v1beta1_DockerMachineTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_DockerMachineTemplateSpec_To_v1beta1_DockerMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha4_DockerMachineTemplateSpec_To_v1beta1_DockerMachineTemplateSpec(in *DockerMachineTemplateSpec, out *v1beta1.DockerMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerMachineTemplateSpec_To_v1beta1_DockerMachineTemplateSpec(in, out, s) -} - -func autoConvert_v1beta1_DockerMachineTemplateSpec_To_v1alpha4_DockerMachineTemplateSpec(in *v1beta1.DockerMachineTemplateSpec, out *DockerMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1beta1_DockerMachineTemplateResource_To_v1alpha4_DockerMachineTemplateResource(&in.Template, &out.Template, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_DockerMachineTemplateSpec_To_v1alpha4_DockerMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1beta1_DockerMachineTemplateSpec_To_v1alpha4_DockerMachineTemplateSpec(in *v1beta1.DockerMachineTemplateSpec, out *DockerMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1beta1_DockerMachineTemplateSpec_To_v1alpha4_DockerMachineTemplateSpec(in, out, s) -} - -func autoConvert_v1alpha4_ImageMeta_To_v1beta1_ImageMeta(in *ImageMeta, out *v1beta1.ImageMeta, s conversion.Scope) error { - out.ImageRepository = in.ImageRepository - out.ImageTag = in.ImageTag - return nil -} - -// Convert_v1alpha4_ImageMeta_To_v1beta1_ImageMeta is an autogenerated conversion function. -func Convert_v1alpha4_ImageMeta_To_v1beta1_ImageMeta(in *ImageMeta, out *v1beta1.ImageMeta, s conversion.Scope) error { - return autoConvert_v1alpha4_ImageMeta_To_v1beta1_ImageMeta(in, out, s) -} - -func autoConvert_v1beta1_ImageMeta_To_v1alpha4_ImageMeta(in *v1beta1.ImageMeta, out *ImageMeta, s conversion.Scope) error { - out.ImageRepository = in.ImageRepository - out.ImageTag = in.ImageTag - return nil -} - -// Convert_v1beta1_ImageMeta_To_v1alpha4_ImageMeta is an autogenerated conversion function. -func Convert_v1beta1_ImageMeta_To_v1alpha4_ImageMeta(in *v1beta1.ImageMeta, out *ImageMeta, s conversion.Scope) error { - return autoConvert_v1beta1_ImageMeta_To_v1alpha4_ImageMeta(in, out, s) -} - -func autoConvert_v1alpha4_Mount_To_v1beta1_Mount(in *Mount, out *v1beta1.Mount, s conversion.Scope) error { - out.ContainerPath = in.ContainerPath - out.HostPath = in.HostPath - out.Readonly = in.Readonly - return nil -} - -// Convert_v1alpha4_Mount_To_v1beta1_Mount is an autogenerated conversion function. -func Convert_v1alpha4_Mount_To_v1beta1_Mount(in *Mount, out *v1beta1.Mount, s conversion.Scope) error { - return autoConvert_v1alpha4_Mount_To_v1beta1_Mount(in, out, s) -} - -func autoConvert_v1beta1_Mount_To_v1alpha4_Mount(in *v1beta1.Mount, out *Mount, s conversion.Scope) error { - out.ContainerPath = in.ContainerPath - out.HostPath = in.HostPath - out.Readonly = in.Readonly - return nil -} - -// Convert_v1beta1_Mount_To_v1alpha4_Mount is an autogenerated conversion function. -func Convert_v1beta1_Mount_To_v1alpha4_Mount(in *v1beta1.Mount, out *Mount, s conversion.Scope) error { - return autoConvert_v1beta1_Mount_To_v1alpha4_Mount(in, out, s) -} diff --git a/test/infrastructure/docker/api/v1alpha4/zz_generated.deepcopy.go b/test/infrastructure/docker/api/v1alpha4/zz_generated.deepcopy.go deleted file mode 100644 index a7466621e90c..000000000000 --- a/test/infrastructure/docker/api/v1alpha4/zz_generated.deepcopy.go +++ /dev/null @@ -1,495 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - "k8s.io/apimachinery/pkg/runtime" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *APIEndpoint) DeepCopyInto(out *APIEndpoint) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIEndpoint. -func (in *APIEndpoint) DeepCopy() *APIEndpoint { - if in == nil { - return nil - } - out := new(APIEndpoint) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerCluster) DeepCopyInto(out *DockerCluster) { - *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 DockerCluster. -func (in *DockerCluster) DeepCopy() *DockerCluster { - if in == nil { - return nil - } - out := new(DockerCluster) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerCluster) 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 *DockerClusterList) DeepCopyInto(out *DockerClusterList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DockerCluster, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerClusterList. -func (in *DockerClusterList) DeepCopy() *DockerClusterList { - if in == nil { - return nil - } - out := new(DockerClusterList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerClusterList) 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 *DockerClusterSpec) DeepCopyInto(out *DockerClusterSpec) { - *out = *in - out.ControlPlaneEndpoint = in.ControlPlaneEndpoint - 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() - } - } - out.LoadBalancer = in.LoadBalancer -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerClusterSpec. -func (in *DockerClusterSpec) DeepCopy() *DockerClusterSpec { - if in == nil { - return nil - } - out := new(DockerClusterSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerClusterStatus) DeepCopyInto(out *DockerClusterStatus) { - *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]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerClusterStatus. -func (in *DockerClusterStatus) DeepCopy() *DockerClusterStatus { - if in == nil { - return nil - } - out := new(DockerClusterStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerClusterTemplate) DeepCopyInto(out *DockerClusterTemplate) { - *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 DockerClusterTemplate. -func (in *DockerClusterTemplate) DeepCopy() *DockerClusterTemplate { - if in == nil { - return nil - } - out := new(DockerClusterTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerClusterTemplate) 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 *DockerClusterTemplateList) DeepCopyInto(out *DockerClusterTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DockerClusterTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerClusterTemplateList. -func (in *DockerClusterTemplateList) DeepCopy() *DockerClusterTemplateList { - if in == nil { - return nil - } - out := new(DockerClusterTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerClusterTemplateList) 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 *DockerClusterTemplateResource) DeepCopyInto(out *DockerClusterTemplateResource) { - *out = *in - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerClusterTemplateResource. -func (in *DockerClusterTemplateResource) DeepCopy() *DockerClusterTemplateResource { - if in == nil { - return nil - } - out := new(DockerClusterTemplateResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerClusterTemplateSpec) DeepCopyInto(out *DockerClusterTemplateSpec) { - *out = *in - in.Template.DeepCopyInto(&out.Template) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerClusterTemplateSpec. -func (in *DockerClusterTemplateSpec) DeepCopy() *DockerClusterTemplateSpec { - if in == nil { - return nil - } - out := new(DockerClusterTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerLoadBalancer) DeepCopyInto(out *DockerLoadBalancer) { - *out = *in - out.ImageMeta = in.ImageMeta -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerLoadBalancer. -func (in *DockerLoadBalancer) DeepCopy() *DockerLoadBalancer { - if in == nil { - return nil - } - out := new(DockerLoadBalancer) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerMachine) DeepCopyInto(out *DockerMachine) { - *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 DockerMachine. -func (in *DockerMachine) DeepCopy() *DockerMachine { - if in == nil { - return nil - } - out := new(DockerMachine) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerMachine) 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 *DockerMachineList) DeepCopyInto(out *DockerMachineList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DockerMachine, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachineList. -func (in *DockerMachineList) DeepCopy() *DockerMachineList { - if in == nil { - return nil - } - out := new(DockerMachineList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerMachineList) 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 *DockerMachineSpec) DeepCopyInto(out *DockerMachineSpec) { - *out = *in - if in.ProviderID != nil { - in, out := &in.ProviderID, &out.ProviderID - *out = new(string) - **out = **in - } - if in.PreLoadImages != nil { - in, out := &in.PreLoadImages, &out.PreLoadImages - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.ExtraMounts != nil { - in, out := &in.ExtraMounts, &out.ExtraMounts - *out = make([]Mount, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachineSpec. -func (in *DockerMachineSpec) DeepCopy() *DockerMachineSpec { - if in == nil { - return nil - } - out := new(DockerMachineSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerMachineStatus) DeepCopyInto(out *DockerMachineStatus) { - *out = *in - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]apiv1alpha4.MachineAddress, len(*in)) - copy(*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]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachineStatus. -func (in *DockerMachineStatus) DeepCopy() *DockerMachineStatus { - if in == nil { - return nil - } - out := new(DockerMachineStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerMachineTemplate) DeepCopyInto(out *DockerMachineTemplate) { - *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 DockerMachineTemplate. -func (in *DockerMachineTemplate) DeepCopy() *DockerMachineTemplate { - if in == nil { - return nil - } - out := new(DockerMachineTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerMachineTemplate) 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 *DockerMachineTemplateList) DeepCopyInto(out *DockerMachineTemplateList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DockerMachineTemplate, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachineTemplateList. -func (in *DockerMachineTemplateList) DeepCopy() *DockerMachineTemplateList { - if in == nil { - return nil - } - out := new(DockerMachineTemplateList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerMachineTemplateList) 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 *DockerMachineTemplateResource) DeepCopyInto(out *DockerMachineTemplateResource) { - *out = *in - in.Spec.DeepCopyInto(&out.Spec) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachineTemplateResource. -func (in *DockerMachineTemplateResource) DeepCopy() *DockerMachineTemplateResource { - if in == nil { - return nil - } - out := new(DockerMachineTemplateResource) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerMachineTemplateSpec) DeepCopyInto(out *DockerMachineTemplateSpec) { - *out = *in - in.Template.DeepCopyInto(&out.Template) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachineTemplateSpec. -func (in *DockerMachineTemplateSpec) DeepCopy() *DockerMachineTemplateSpec { - if in == nil { - return nil - } - out := new(DockerMachineTemplateSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ImageMeta) DeepCopyInto(out *ImageMeta) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ImageMeta. -func (in *ImageMeta) DeepCopy() *ImageMeta { - if in == nil { - return nil - } - out := new(ImageMeta) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *Mount) DeepCopyInto(out *Mount) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Mount. -func (in *Mount) DeepCopy() *Mount { - if in == nil { - return nil - } - out := new(Mount) - in.DeepCopyInto(out) - return out -} diff --git a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclusters.yaml b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclusters.yaml index 9d6ad6c8df99..725df8245928 100644 --- a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclusters.yaml +++ b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclusters.yaml @@ -16,174 +16,6 @@ spec: singular: dockercluster scope: Namespaced versions: - - additionalPrinterColumns: - - description: Time duration since creation of DockerCluster - jsonPath: .metadata.creationTimestamp - name: Age - type: date - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - DockerCluster is the Schema for the dockerclusters API. - - - Deprecated: This type will be removed in one of the next releases. - 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: DockerClusterSpec defines the desired state of DockerCluster. - properties: - controlPlaneEndpoint: - description: ControlPlaneEndpoint represents the endpoint used to - communicate with the control plane. - properties: - host: - description: Host is the hostname on which the API server is serving. - type: string - port: - description: Port is the port on which the API server is serving. - type: integer - required: - - host - - port - type: object - 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 are not usulaly defined on the spec. - The docker provider is special since failure domains don't mean anything in a local docker environment. - Instead, the docker cluster controller will simply copy these into the Status and allow the Cluster API - controllers to do what they will with the defined failure domains. - type: object - loadBalancer: - description: LoadBalancer allows defining configurations for the cluster - load balancer. - properties: - imageRepository: - description: |- - ImageRepository sets the container registry to pull the haproxy image from. - if not set, "kindest" will be used instead. - type: string - imageTag: - description: |- - ImageTag allows to specify a tag for the haproxy image. - if not set, "v20210715-a6da3463" will be used instead. - type: string - type: object - type: object - status: - description: DockerClusterStatus defines the observed state of DockerCluster. - properties: - conditions: - description: Conditions defines current service state of the DockerCluster. - 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 don't mean much in CAPD since it's all local, but we can see how the rest of cluster API - will use this if we populate it. - type: object - ready: - description: Ready denotes that the docker cluster (infrastructure) - is ready. - type: boolean - required: - - ready - type: object - type: object - served: false - storage: false - subresources: - status: {} - additionalPrinterColumns: - description: Cluster jsonPath: .metadata.labels['cluster\.x-k8s\.io/cluster-name'] diff --git a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclustertemplates.yaml b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclustertemplates.yaml index de20f6be1152..6895bd0dd04e 100644 --- a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclustertemplates.yaml +++ b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockerclustertemplates.yaml @@ -16,113 +16,6 @@ spec: singular: dockerclustertemplate scope: Namespaced versions: - - additionalPrinterColumns: - - description: Time duration since creation of DockerClusterTemplate - jsonPath: .metadata.creationTimestamp - name: Age - type: date - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - DockerClusterTemplate is the Schema for the dockerclustertemplates API. - - - Deprecated: This type will be removed in one of the next releases. - 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: DockerClusterTemplateSpec defines the desired state of DockerClusterTemplate. - properties: - template: - description: DockerClusterTemplateResource describes the data needed - to create a DockerCluster from a template. - properties: - spec: - description: DockerClusterSpec defines the desired state of DockerCluster. - properties: - controlPlaneEndpoint: - description: ControlPlaneEndpoint represents the endpoint - used to communicate with the control plane. - properties: - host: - description: Host is the hostname on which the API server - is serving. - type: string - port: - description: Port is the port on which the API server - is serving. - type: integer - required: - - host - - port - type: object - 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 are not usulaly defined on the spec. - The docker provider is special since failure domains don't mean anything in a local docker environment. - Instead, the docker cluster controller will simply copy these into the Status and allow the Cluster API - controllers to do what they will with the defined failure domains. - type: object - loadBalancer: - description: LoadBalancer allows defining configurations for - the cluster load balancer. - properties: - imageRepository: - description: |- - ImageRepository sets the container registry to pull the haproxy image from. - if not set, "kindest" will be used instead. - type: string - imageTag: - description: |- - ImageTag allows to specify a tag for the haproxy image. - if not set, "v20210715-a6da3463" will be used instead. - type: string - type: object - type: object - required: - - spec - type: object - required: - - template - type: object - type: object - served: false - storage: false - subresources: {} - additionalPrinterColumns: - description: Time duration since creation of DockerClusterTemplate jsonPath: .metadata.creationTimestamp diff --git a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachinepools.yaml b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachinepools.yaml index 141c76d35b53..db8cb58ce578 100644 --- a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachinepools.yaml +++ b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachinepools.yaml @@ -16,204 +16,6 @@ spec: singular: dockermachinepool scope: Namespaced versions: - - additionalPrinterColumns: - - description: Time duration since creation of DockerMachinePool - jsonPath: .metadata.creationTimestamp - name: Age - type: date - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - DockerMachinePool is the Schema for the dockermachinepools API. - - - Deprecated: This type will be removed in one of the next releases. - 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: DockerMachinePoolSpec defines the desired state of DockerMachinePool. - properties: - providerID: - description: ProviderID is the identification ID of the Machine Pool - type: string - providerIDList: - description: ProviderIDList is the list of identification IDs of machine - instances managed by this Machine Pool - items: - type: string - type: array - template: - description: Template contains the details used to build a replica - machine within the Machine Pool - properties: - customImage: - description: |- - CustomImage allows customizing the container image that is used for - running the machine - type: string - extraMounts: - description: |- - ExtraMounts describes additional mount points for the node container - These may be used to bind a hostPath - items: - description: |- - Mount specifies a host volume to mount into a container. - This is a simplified version of kind v1alpha4.Mount types. - properties: - containerPath: - description: Path of the mount within the container. - type: string - hostPath: - description: |- - Path of the mount on the host. If the hostPath doesn't exist, then runtimes - should report error. If the hostpath is a symbolic link, runtimes should - follow the symlink and mount the real destination to container. - type: string - readOnly: - description: If set, the mount is read-only. - type: boolean - type: object - type: array - preLoadImages: - description: |- - PreLoadImages allows to pre-load images in a newly created machine. This can be used to - speed up tests by avoiding e.g. to download CNI images on all the containers. - items: - type: string - type: array - type: object - type: object - status: - description: DockerMachinePoolStatus defines the observed state of DockerMachinePool. - properties: - conditions: - description: Conditions defines current service state of the DockerMachinePool. - 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 - instances: - description: Instances contains the status for each instance in the - pool - items: - description: DockerMachinePoolInstanceStatus contains status information - about a DockerMachinePool. - properties: - addresses: - description: Addresses contains the associated addresses for - the docker machine. - 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 - bootstrapped: - description: |- - Bootstrapped is true when the kubeadm bootstrapping has been run - against this machine - type: boolean - instanceName: - description: InstanceName is the identification of the Machine - Instance within the Machine Pool - type: string - providerID: - description: ProviderID is the provider identification of the - Machine Pool Instance - type: string - ready: - description: Ready denotes that the machine (docker container) - is ready - type: boolean - version: - description: Version defines the Kubernetes version for the - Machine Instance - type: string - type: object - type: array - observedGeneration: - description: The generation observed by the deployment controller. - format: int64 - type: integer - ready: - description: Ready denotes that the machine pool is ready - type: boolean - replicas: - description: Replicas is the most recently observed number of replicas. - format: int32 - type: integer - type: object - type: object - served: false - storage: false - subresources: - status: {} - additionalPrinterColumns: - description: Time duration since creation of DockerMachinePool jsonPath: .metadata.creationTimestamp diff --git a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachines.yaml b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachines.yaml index 0bf282834ec2..ab43eae5ec72 100644 --- a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachines.yaml +++ b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachines.yaml @@ -16,167 +16,6 @@ spec: singular: dockermachine scope: Namespaced versions: - - additionalPrinterColumns: - - description: Time duration since creation of DockerMachine - jsonPath: .metadata.creationTimestamp - name: Age - type: date - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - DockerMachine is the Schema for the dockermachines API. - - - Deprecated: This type will be removed in one of the next releases. - 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: DockerMachineSpec defines the desired state of DockerMachine. - properties: - bootstrapped: - description: |- - Bootstrapped is true when the kubeadm bootstrapping has been run - against this machine - type: boolean - customImage: - description: |- - CustomImage allows customizing the container image that is used for - running the machine - type: string - extraMounts: - description: |- - ExtraMounts describes additional mount points for the node container - These may be used to bind a hostPath - items: - description: |- - Mount specifies a host volume to mount into a container. - This is a simplified version of kind v1alpha4.Mount types. - properties: - containerPath: - description: Path of the mount within the container. - type: string - hostPath: - description: |- - Path of the mount on the host. If the hostPath doesn't exist, then runtimes - should report error. If the hostpath is a symbolic link, runtimes should - follow the symlink and mount the real destination to container. - type: string - readOnly: - description: If set, the mount is read-only. - type: boolean - type: object - type: array - preLoadImages: - description: |- - PreLoadImages allows to pre-load images in a newly created machine. This can be used to - speed up tests by avoiding e.g. to download CNI images on all the containers. - items: - type: string - type: array - providerID: - description: ProviderID will be the container name in ProviderID format - (docker:////) - type: string - type: object - status: - description: DockerMachineStatus defines the observed state of DockerMachine. - properties: - addresses: - description: Addresses contains the associated addresses for the docker - machine. - 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 DockerMachine. - 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 - loadBalancerConfigured: - description: |- - LoadBalancerConfigured denotes that the machine has been - added to the load balancer - type: boolean - ready: - description: Ready denotes that the machine (docker container) is - ready - type: boolean - type: object - type: object - served: false - storage: false - subresources: - status: {} - additionalPrinterColumns: - description: Cluster jsonPath: .metadata.labels['cluster\.x-k8s\.io/cluster-name'] diff --git a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachinetemplates.yaml b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachinetemplates.yaml index 623e444ae56c..5354abaec9f1 100644 --- a/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachinetemplates.yaml +++ b/test/infrastructure/docker/config/crd/bases/infrastructure.cluster.x-k8s.io_dockermachinetemplates.yaml @@ -16,104 +16,6 @@ spec: singular: dockermachinetemplate scope: Namespaced versions: - - additionalPrinterColumns: - - description: Time duration since creation of DockerMachineTemplate - jsonPath: .metadata.creationTimestamp - name: Age - type: date - deprecated: true - name: v1alpha4 - schema: - openAPIV3Schema: - description: |- - DockerMachineTemplate is the Schema for the dockermachinetemplates API. - - - Deprecated: This type will be removed in one of the next releases. - 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: DockerMachineTemplateSpec defines the desired state of DockerMachineTemplate. - properties: - template: - description: DockerMachineTemplateResource describes the data needed - to create a DockerMachine from a template. - properties: - spec: - description: Spec is the specification of the desired behavior - of the machine. - properties: - bootstrapped: - description: |- - Bootstrapped is true when the kubeadm bootstrapping has been run - against this machine - type: boolean - customImage: - description: |- - CustomImage allows customizing the container image that is used for - running the machine - type: string - extraMounts: - description: |- - ExtraMounts describes additional mount points for the node container - These may be used to bind a hostPath - items: - description: |- - Mount specifies a host volume to mount into a container. - This is a simplified version of kind v1alpha4.Mount types. - properties: - containerPath: - description: Path of the mount within the container. - type: string - hostPath: - description: |- - Path of the mount on the host. If the hostPath doesn't exist, then runtimes - should report error. If the hostpath is a symbolic link, runtimes should - follow the symlink and mount the real destination to container. - type: string - readOnly: - description: If set, the mount is read-only. - type: boolean - type: object - type: array - preLoadImages: - description: |- - PreLoadImages allows to pre-load images in a newly created machine. This can be used to - speed up tests by avoiding e.g. to download CNI images on all the containers. - items: - type: string - type: array - providerID: - description: ProviderID will be the container name in ProviderID - format (docker:////) - type: string - type: object - required: - - spec - type: object - required: - - template - type: object - type: object - served: false - storage: false - subresources: {} - additionalPrinterColumns: - description: Time duration since creation of DockerMachineTemplate jsonPath: .metadata.creationTimestamp diff --git a/test/infrastructure/docker/config/crd/kustomization.yaml b/test/infrastructure/docker/config/crd/kustomization.yaml index be5d8503c837..34dd07d870fd 100644 --- a/test/infrastructure/docker/config/crd/kustomization.yaml +++ b/test/infrastructure/docker/config/crd/kustomization.yaml @@ -1,5 +1,4 @@ commonLabels: - cluster.x-k8s.io/v1alpha4: v1alpha4 cluster.x-k8s.io/v1beta1: v1beta1 # This kustomization.yaml is not intended to be run by itself, diff --git a/test/infrastructure/docker/exp/api/v1alpha4/conversion.go b/test/infrastructure/docker/exp/api/v1alpha4/conversion.go deleted file mode 100644 index 68b10e18b247..000000000000 --- a/test/infrastructure/docker/exp/api/v1alpha4/conversion.go +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - apiconversion "k8s.io/apimachinery/pkg/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" - - infraexpv1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1beta1" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -func (src *DockerMachinePool) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infraexpv1.DockerMachinePool) - - if err := Convert_v1alpha4_DockerMachinePool_To_v1beta1_DockerMachinePool(src, dst, nil); err != nil { - return err - } - - // Manually restore data. - restored := &infraexpv1.DockerMachinePool{} - if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { - return err - } - - dst.Status.InfrastructureMachineKind = restored.Status.InfrastructureMachineKind - - return nil -} - -func (dst *DockerMachinePool) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infraexpv1.DockerMachinePool) - - if err := Convert_v1beta1_DockerMachinePool_To_v1alpha4_DockerMachinePool(src, dst, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion except for metadata - return utilconversion.MarshalData(src, dst) -} - -func (src *DockerMachinePoolList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infraexpv1.DockerMachinePoolList) - - return Convert_v1alpha4_DockerMachinePoolList_To_v1beta1_DockerMachinePoolList(src, dst, nil) -} - -func (dst *DockerMachinePoolList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infraexpv1.DockerMachinePoolList) - - return Convert_v1beta1_DockerMachinePoolList_To_v1alpha4_DockerMachinePoolList(src, dst, nil) -} - -func Convert_v1beta1_DockerMachinePoolStatus_To_v1alpha4_DockerMachinePoolStatus(in *infraexpv1.DockerMachinePoolStatus, out *DockerMachinePoolStatus, s apiconversion.Scope) error { - // NOTE: custom conversion func is required because Status.InfrastructureMachineKind has been added in v1beta1. - return autoConvert_v1beta1_DockerMachinePoolStatus_To_v1alpha4_DockerMachinePoolStatus(in, out, s) -} diff --git a/test/infrastructure/docker/exp/api/v1alpha4/conversion_test.go b/test/infrastructure/docker/exp/api/v1alpha4/conversion_test.go deleted file mode 100644 index 3df37e9fdbc6..000000000000 --- a/test/infrastructure/docker/exp/api/v1alpha4/conversion_test.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - "testing" - - infraexpv1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1beta1" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" -) - -func TestFuzzyConversion(t *testing.T) { - t.Run("for DockerMachinePool", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ - Hub: &infraexpv1.DockerMachinePool{}, - Spoke: &DockerMachinePool{}, - })) -} diff --git a/test/infrastructure/docker/exp/api/v1alpha4/doc.go b/test/infrastructure/docker/exp/api/v1alpha4/doc.go deleted file mode 100644 index a95ed73bec1a..000000000000 --- a/test/infrastructure/docker/exp/api/v1alpha4/doc.go +++ /dev/null @@ -1,21 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains the v1alpha4 API implementation. -// +k8s:conversion-gen=sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1beta1 -// -// Deprecated: This package will be removed in one of the next releases. -package v1alpha4 diff --git a/test/infrastructure/docker/exp/api/v1alpha4/dockermachinepool_types.go b/test/infrastructure/docker/exp/api/v1alpha4/dockermachinepool_types.go deleted file mode 100644 index 28f49fb77c6c..000000000000 --- a/test/infrastructure/docker/exp/api/v1alpha4/dockermachinepool_types.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - infrav1alpha4 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" -) - -const ( - // MachinePoolFinalizer allows ReconcileDockerMachinePool to clean up resources. - MachinePoolFinalizer = "dockermachinepool.infrastructure.cluster.x-k8s.io" -) - -// DockerMachinePoolMachineTemplate defines the desired state of DockerMachine. -type DockerMachinePoolMachineTemplate struct { - // CustomImage allows customizing the container image that is used for - // running the machine - // +optional - CustomImage string `json:"customImage,omitempty"` - - // PreLoadImages allows to pre-load images in a newly created machine. This can be used to - // speed up tests by avoiding e.g. to download CNI images on all the containers. - // +optional - PreLoadImages []string `json:"preLoadImages,omitempty"` - - // ExtraMounts describes additional mount points for the node container - // These may be used to bind a hostPath - // +optional - ExtraMounts []infrav1alpha4.Mount `json:"extraMounts,omitempty"` -} - -// DockerMachinePoolSpec defines the desired state of DockerMachinePool. -type DockerMachinePoolSpec struct { - // Template contains the details used to build a replica machine within the Machine Pool - // +optional - Template DockerMachinePoolMachineTemplate `json:"template"` - - // ProviderID is the identification ID of the Machine Pool - // +optional - ProviderID string `json:"providerID,omitempty"` - - // ProviderIDList is the list of identification IDs of machine instances managed by this Machine Pool - //+optional - ProviderIDList []string `json:"providerIDList,omitempty"` -} - -// DockerMachinePoolStatus defines the observed state of DockerMachinePool. -type DockerMachinePoolStatus struct { - // Ready denotes that the machine pool is ready - // +optional - Ready bool `json:"ready"` - - // Replicas is the most recently observed number of replicas. - // +optional - Replicas int32 `json:"replicas"` - - // The generation observed by the deployment controller. - // +optional - ObservedGeneration int64 `json:"observedGeneration,omitempty"` - - // Instances contains the status for each instance in the pool - // +optional - Instances []DockerMachinePoolInstanceStatus `json:"instances,omitempty"` - - // Conditions defines current service state of the DockerMachinePool. - // +optional - Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` -} - -// DockerMachinePoolInstanceStatus contains status information about a DockerMachinePool. -type DockerMachinePoolInstanceStatus struct { - // Addresses contains the associated addresses for the docker machine. - // +optional - Addresses []clusterv1alpha4.MachineAddress `json:"addresses,omitempty"` - - // InstanceName is the identification of the Machine Instance within the Machine Pool - InstanceName string `json:"instanceName,omitempty"` - - // ProviderID is the provider identification of the Machine Pool Instance - // +optional - ProviderID *string `json:"providerID,omitempty"` - - // Version defines the Kubernetes version for the Machine Instance - // +optional - Version *string `json:"version,omitempty"` - - // Ready denotes that the machine (docker container) is ready - // +optional - Ready bool `json:"ready"` - - // Bootstrapped is true when the kubeadm bootstrapping has been run - // against this machine - // +optional - Bootstrapped bool `json:"bootstrapped,omitempty"` -} - -// +kubebuilder:resource:path=dockermachinepools,scope=Namespaced,categories=cluster-api -// +kubebuilder:object:root=true -// +kubebuilder:unservedversion -// +kubebuilder:deprecatedversion -// +kubebuilder:subresource:status -// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Time duration since creation of DockerMachinePool" - -// DockerMachinePool is the Schema for the dockermachinepools API. -// -// Deprecated: This type will be removed in one of the next releases. -type DockerMachinePool struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec DockerMachinePoolSpec `json:"spec,omitempty"` - Status DockerMachinePoolStatus `json:"status,omitempty"` -} - -// GetConditions returns the set of conditions for this object. -func (c *DockerMachinePool) GetConditions() clusterv1alpha4.Conditions { - return c.Status.Conditions -} - -// SetConditions sets the conditions on this object. -func (c *DockerMachinePool) SetConditions(conditions clusterv1alpha4.Conditions) { - c.Status.Conditions = conditions -} - -// +kubebuilder:object:root=true - -// DockerMachinePoolList contains a list of DockerMachinePool. -// -// Deprecated: This type will be removed in one of the next releases. -type DockerMachinePoolList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []DockerMachinePool `json:"items"` -} - -func init() { - objectTypes = append(objectTypes, &DockerMachinePool{}, &DockerMachinePoolList{}) -} diff --git a/test/infrastructure/docker/exp/api/v1alpha4/groupversion_info.go b/test/infrastructure/docker/exp/api/v1alpha4/groupversion_info.go deleted file mode 100644 index 068abb9aae54..000000000000 --- a/test/infrastructure/docker/exp/api/v1alpha4/groupversion_info.go +++ /dev/null @@ -1,48 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package v1alpha4 contains API Schema definitions for the infrastructure v1alpha4 API group -// +kubebuilder:object:generate=true -// +groupName=infrastructure.cluster.x-k8s.io -package v1alpha4 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" -) - -var ( - // GroupVersion is group version used to register these objects. - GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1alpha4"} - - // SchemeBuilder is used to add go types to the GroupVersionKind scheme. - schemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) - - // AddToScheme adds the types in this group-version to the given scheme. - AddToScheme = schemeBuilder.AddToScheme - - objectTypes = []runtime.Object{} - - // localSchemeBuilder is used for type conversions. - localSchemeBuilder = schemeBuilder -) - -func addKnownTypes(scheme *runtime.Scheme) error { - scheme.AddKnownTypes(GroupVersion, objectTypes...) - metav1.AddToGroupVersion(scheme, GroupVersion) - return nil -} diff --git a/test/infrastructure/docker/exp/api/v1alpha4/zz_generated.conversion.go b/test/infrastructure/docker/exp/api/v1alpha4/zz_generated.conversion.go deleted file mode 100644 index 53081f3c8892..000000000000 --- a/test/infrastructure/docker/exp/api/v1alpha4/zz_generated.conversion.go +++ /dev/null @@ -1,344 +0,0 @@ -//go:build !ignore_autogenerated_capd -// +build !ignore_autogenerated_capd - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by conversion-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - unsafe "unsafe" - - 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" - dockerapiv1alpha4 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" - dockerapiv1beta1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" - v1beta1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1beta1" -) - -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((*DockerMachinePool)(nil), (*v1beta1.DockerMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerMachinePool_To_v1beta1_DockerMachinePool(a.(*DockerMachinePool), b.(*v1beta1.DockerMachinePool), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerMachinePool)(nil), (*DockerMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerMachinePool_To_v1alpha4_DockerMachinePool(a.(*v1beta1.DockerMachinePool), b.(*DockerMachinePool), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerMachinePoolInstanceStatus)(nil), (*v1beta1.DockerMachinePoolInstanceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerMachinePoolInstanceStatus_To_v1beta1_DockerMachinePoolInstanceStatus(a.(*DockerMachinePoolInstanceStatus), b.(*v1beta1.DockerMachinePoolInstanceStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerMachinePoolInstanceStatus)(nil), (*DockerMachinePoolInstanceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerMachinePoolInstanceStatus_To_v1alpha4_DockerMachinePoolInstanceStatus(a.(*v1beta1.DockerMachinePoolInstanceStatus), b.(*DockerMachinePoolInstanceStatus), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerMachinePoolList)(nil), (*v1beta1.DockerMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerMachinePoolList_To_v1beta1_DockerMachinePoolList(a.(*DockerMachinePoolList), b.(*v1beta1.DockerMachinePoolList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerMachinePoolList)(nil), (*DockerMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerMachinePoolList_To_v1alpha4_DockerMachinePoolList(a.(*v1beta1.DockerMachinePoolList), b.(*DockerMachinePoolList), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerMachinePoolMachineTemplate)(nil), (*v1beta1.DockerMachinePoolMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerMachinePoolMachineTemplate_To_v1beta1_DockerMachinePoolMachineTemplate(a.(*DockerMachinePoolMachineTemplate), b.(*v1beta1.DockerMachinePoolMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerMachinePoolMachineTemplate)(nil), (*DockerMachinePoolMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerMachinePoolMachineTemplate_To_v1alpha4_DockerMachinePoolMachineTemplate(a.(*v1beta1.DockerMachinePoolMachineTemplate), b.(*DockerMachinePoolMachineTemplate), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerMachinePoolSpec)(nil), (*v1beta1.DockerMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerMachinePoolSpec_To_v1beta1_DockerMachinePoolSpec(a.(*DockerMachinePoolSpec), b.(*v1beta1.DockerMachinePoolSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*v1beta1.DockerMachinePoolSpec)(nil), (*DockerMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerMachinePoolSpec_To_v1alpha4_DockerMachinePoolSpec(a.(*v1beta1.DockerMachinePoolSpec), b.(*DockerMachinePoolSpec), scope) - }); err != nil { - return err - } - if err := s.AddGeneratedConversionFunc((*DockerMachinePoolStatus)(nil), (*v1beta1.DockerMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_DockerMachinePoolStatus_To_v1beta1_DockerMachinePoolStatus(a.(*DockerMachinePoolStatus), b.(*v1beta1.DockerMachinePoolStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1beta1.DockerMachinePoolStatus)(nil), (*DockerMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1beta1_DockerMachinePoolStatus_To_v1alpha4_DockerMachinePoolStatus(a.(*v1beta1.DockerMachinePoolStatus), b.(*DockerMachinePoolStatus), scope) - }); err != nil { - return err - } - return nil -} - -func autoConvert_v1alpha4_DockerMachinePool_To_v1beta1_DockerMachinePool(in *DockerMachinePool, out *v1beta1.DockerMachinePool, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_DockerMachinePoolSpec_To_v1beta1_DockerMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1alpha4_DockerMachinePoolStatus_To_v1beta1_DockerMachinePoolStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_DockerMachinePool_To_v1beta1_DockerMachinePool is an autogenerated conversion function. -func Convert_v1alpha4_DockerMachinePool_To_v1beta1_DockerMachinePool(in *DockerMachinePool, out *v1beta1.DockerMachinePool, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerMachinePool_To_v1beta1_DockerMachinePool(in, out, s) -} - -func autoConvert_v1beta1_DockerMachinePool_To_v1alpha4_DockerMachinePool(in *v1beta1.DockerMachinePool, out *DockerMachinePool, s conversion.Scope) error { - out.ObjectMeta = in.ObjectMeta - if err := Convert_v1beta1_DockerMachinePoolSpec_To_v1alpha4_DockerMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { - return err - } - if err := Convert_v1beta1_DockerMachinePoolStatus_To_v1alpha4_DockerMachinePoolStatus(&in.Status, &out.Status, s); err != nil { - return err - } - return nil -} - -// Convert_v1beta1_DockerMachinePool_To_v1alpha4_DockerMachinePool is an autogenerated conversion function. -func Convert_v1beta1_DockerMachinePool_To_v1alpha4_DockerMachinePool(in *v1beta1.DockerMachinePool, out *DockerMachinePool, s conversion.Scope) error { - return autoConvert_v1beta1_DockerMachinePool_To_v1alpha4_DockerMachinePool(in, out, s) -} - -func autoConvert_v1alpha4_DockerMachinePoolInstanceStatus_To_v1beta1_DockerMachinePoolInstanceStatus(in *DockerMachinePoolInstanceStatus, out *v1beta1.DockerMachinePoolInstanceStatus, s conversion.Scope) error { - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]apiv1beta1.MachineAddress, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1alpha4_MachineAddress_To_v1beta1_MachineAddress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Addresses = nil - } - out.InstanceName = in.InstanceName - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - out.Version = (*string)(unsafe.Pointer(in.Version)) - out.Ready = in.Ready - out.Bootstrapped = in.Bootstrapped - return nil -} - -// Convert_v1alpha4_DockerMachinePoolInstanceStatus_To_v1beta1_DockerMachinePoolInstanceStatus is an autogenerated conversion function. -func Convert_v1alpha4_DockerMachinePoolInstanceStatus_To_v1beta1_DockerMachinePoolInstanceStatus(in *DockerMachinePoolInstanceStatus, out *v1beta1.DockerMachinePoolInstanceStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerMachinePoolInstanceStatus_To_v1beta1_DockerMachinePoolInstanceStatus(in, out, s) -} - -func autoConvert_v1beta1_DockerMachinePoolInstanceStatus_To_v1alpha4_DockerMachinePoolInstanceStatus(in *v1beta1.DockerMachinePoolInstanceStatus, out *DockerMachinePoolInstanceStatus, s conversion.Scope) error { - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]apiv1alpha4.MachineAddress, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1beta1_MachineAddress_To_v1alpha4_MachineAddress(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Addresses = nil - } - out.InstanceName = in.InstanceName - out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) - out.Version = (*string)(unsafe.Pointer(in.Version)) - out.Ready = in.Ready - out.Bootstrapped = in.Bootstrapped - return nil -} - -// Convert_v1beta1_DockerMachinePoolInstanceStatus_To_v1alpha4_DockerMachinePoolInstanceStatus is an autogenerated conversion function. -func Convert_v1beta1_DockerMachinePoolInstanceStatus_To_v1alpha4_DockerMachinePoolInstanceStatus(in *v1beta1.DockerMachinePoolInstanceStatus, out *DockerMachinePoolInstanceStatus, s conversion.Scope) error { - return autoConvert_v1beta1_DockerMachinePoolInstanceStatus_To_v1alpha4_DockerMachinePoolInstanceStatus(in, out, s) -} - -func autoConvert_v1alpha4_DockerMachinePoolList_To_v1beta1_DockerMachinePoolList(in *DockerMachinePoolList, out *v1beta1.DockerMachinePoolList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]v1beta1.DockerMachinePool, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_DockerMachinePool_To_v1beta1_DockerMachinePool(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1alpha4_DockerMachinePoolList_To_v1beta1_DockerMachinePoolList is an autogenerated conversion function. -func Convert_v1alpha4_DockerMachinePoolList_To_v1beta1_DockerMachinePoolList(in *DockerMachinePoolList, out *v1beta1.DockerMachinePoolList, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerMachinePoolList_To_v1beta1_DockerMachinePoolList(in, out, s) -} - -func autoConvert_v1beta1_DockerMachinePoolList_To_v1alpha4_DockerMachinePoolList(in *v1beta1.DockerMachinePoolList, out *DockerMachinePoolList, s conversion.Scope) error { - out.ListMeta = in.ListMeta - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DockerMachinePool, len(*in)) - for i := range *in { - if err := Convert_v1beta1_DockerMachinePool_To_v1alpha4_DockerMachinePool(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Items = nil - } - return nil -} - -// Convert_v1beta1_DockerMachinePoolList_To_v1alpha4_DockerMachinePoolList is an autogenerated conversion function. -func Convert_v1beta1_DockerMachinePoolList_To_v1alpha4_DockerMachinePoolList(in *v1beta1.DockerMachinePoolList, out *DockerMachinePoolList, s conversion.Scope) error { - return autoConvert_v1beta1_DockerMachinePoolList_To_v1alpha4_DockerMachinePoolList(in, out, s) -} - -func autoConvert_v1alpha4_DockerMachinePoolMachineTemplate_To_v1beta1_DockerMachinePoolMachineTemplate(in *DockerMachinePoolMachineTemplate, out *v1beta1.DockerMachinePoolMachineTemplate, s conversion.Scope) error { - out.CustomImage = in.CustomImage - out.PreLoadImages = *(*[]string)(unsafe.Pointer(&in.PreLoadImages)) - out.ExtraMounts = *(*[]dockerapiv1beta1.Mount)(unsafe.Pointer(&in.ExtraMounts)) - return nil -} - -// Convert_v1alpha4_DockerMachinePoolMachineTemplate_To_v1beta1_DockerMachinePoolMachineTemplate is an autogenerated conversion function. -func Convert_v1alpha4_DockerMachinePoolMachineTemplate_To_v1beta1_DockerMachinePoolMachineTemplate(in *DockerMachinePoolMachineTemplate, out *v1beta1.DockerMachinePoolMachineTemplate, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerMachinePoolMachineTemplate_To_v1beta1_DockerMachinePoolMachineTemplate(in, out, s) -} - -func autoConvert_v1beta1_DockerMachinePoolMachineTemplate_To_v1alpha4_DockerMachinePoolMachineTemplate(in *v1beta1.DockerMachinePoolMachineTemplate, out *DockerMachinePoolMachineTemplate, s conversion.Scope) error { - out.CustomImage = in.CustomImage - out.PreLoadImages = *(*[]string)(unsafe.Pointer(&in.PreLoadImages)) - out.ExtraMounts = *(*[]dockerapiv1alpha4.Mount)(unsafe.Pointer(&in.ExtraMounts)) - return nil -} - -// Convert_v1beta1_DockerMachinePoolMachineTemplate_To_v1alpha4_DockerMachinePoolMachineTemplate is an autogenerated conversion function. -func Convert_v1beta1_DockerMachinePoolMachineTemplate_To_v1alpha4_DockerMachinePoolMachineTemplate(in *v1beta1.DockerMachinePoolMachineTemplate, out *DockerMachinePoolMachineTemplate, s conversion.Scope) error { - return autoConvert_v1beta1_DockerMachinePoolMachineTemplate_To_v1alpha4_DockerMachinePoolMachineTemplate(in, out, s) -} - -func autoConvert_v1alpha4_DockerMachinePoolSpec_To_v1beta1_DockerMachinePoolSpec(in *DockerMachinePoolSpec, out *v1beta1.DockerMachinePoolSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_DockerMachinePoolMachineTemplate_To_v1beta1_DockerMachinePoolMachineTemplate(&in.Template, &out.Template, s); err != nil { - return err - } - out.ProviderID = in.ProviderID - out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) - return nil -} - -// Convert_v1alpha4_DockerMachinePoolSpec_To_v1beta1_DockerMachinePoolSpec is an autogenerated conversion function. -func Convert_v1alpha4_DockerMachinePoolSpec_To_v1beta1_DockerMachinePoolSpec(in *DockerMachinePoolSpec, out *v1beta1.DockerMachinePoolSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerMachinePoolSpec_To_v1beta1_DockerMachinePoolSpec(in, out, s) -} - -func autoConvert_v1beta1_DockerMachinePoolSpec_To_v1alpha4_DockerMachinePoolSpec(in *v1beta1.DockerMachinePoolSpec, out *DockerMachinePoolSpec, s conversion.Scope) error { - if err := Convert_v1beta1_DockerMachinePoolMachineTemplate_To_v1alpha4_DockerMachinePoolMachineTemplate(&in.Template, &out.Template, s); err != nil { - return err - } - out.ProviderID = in.ProviderID - out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) - return nil -} - -// Convert_v1beta1_DockerMachinePoolSpec_To_v1alpha4_DockerMachinePoolSpec is an autogenerated conversion function. -func Convert_v1beta1_DockerMachinePoolSpec_To_v1alpha4_DockerMachinePoolSpec(in *v1beta1.DockerMachinePoolSpec, out *DockerMachinePoolSpec, s conversion.Scope) error { - return autoConvert_v1beta1_DockerMachinePoolSpec_To_v1alpha4_DockerMachinePoolSpec(in, out, s) -} - -func autoConvert_v1alpha4_DockerMachinePoolStatus_To_v1beta1_DockerMachinePoolStatus(in *DockerMachinePoolStatus, out *v1beta1.DockerMachinePoolStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Replicas = in.Replicas - out.ObservedGeneration = in.ObservedGeneration - if in.Instances != nil { - in, out := &in.Instances, &out.Instances - *out = make([]v1beta1.DockerMachinePoolInstanceStatus, len(*in)) - for i := range *in { - if err := Convert_v1alpha4_DockerMachinePoolInstanceStatus_To_v1beta1_DockerMachinePoolInstanceStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Instances = nil - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1beta1.Conditions, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1alpha4_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - return nil -} - -// Convert_v1alpha4_DockerMachinePoolStatus_To_v1beta1_DockerMachinePoolStatus is an autogenerated conversion function. -func Convert_v1alpha4_DockerMachinePoolStatus_To_v1beta1_DockerMachinePoolStatus(in *DockerMachinePoolStatus, out *v1beta1.DockerMachinePoolStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_DockerMachinePoolStatus_To_v1beta1_DockerMachinePoolStatus(in, out, s) -} - -func autoConvert_v1beta1_DockerMachinePoolStatus_To_v1alpha4_DockerMachinePoolStatus(in *v1beta1.DockerMachinePoolStatus, out *DockerMachinePoolStatus, s conversion.Scope) error { - out.Ready = in.Ready - out.Replicas = in.Replicas - out.ObservedGeneration = in.ObservedGeneration - if in.Instances != nil { - in, out := &in.Instances, &out.Instances - *out = make([]DockerMachinePoolInstanceStatus, len(*in)) - for i := range *in { - if err := Convert_v1beta1_DockerMachinePoolInstanceStatus_To_v1alpha4_DockerMachinePoolInstanceStatus(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Instances = nil - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(apiv1alpha4.Conditions, len(*in)) - for i := range *in { - if err := apiv1alpha4.Convert_v1beta1_Condition_To_v1alpha4_Condition(&(*in)[i], &(*out)[i], s); err != nil { - return err - } - } - } else { - out.Conditions = nil - } - // WARNING: in.InfrastructureMachineKind requires manual conversion: does not exist in peer-type - return nil -} diff --git a/test/infrastructure/docker/exp/api/v1alpha4/zz_generated.deepcopy.go b/test/infrastructure/docker/exp/api/v1alpha4/zz_generated.deepcopy.go deleted file mode 100644 index 5753f735ae46..000000000000 --- a/test/infrastructure/docker/exp/api/v1alpha4/zz_generated.deepcopy.go +++ /dev/null @@ -1,191 +0,0 @@ -//go:build !ignore_autogenerated - -/* -Copyright The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Code generated by controller-gen. DO NOT EDIT. - -package v1alpha4 - -import ( - "k8s.io/apimachinery/pkg/runtime" - cluster_apiapiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - apiv1alpha4 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" -) - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerMachinePool) DeepCopyInto(out *DockerMachinePool) { - *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 DockerMachinePool. -func (in *DockerMachinePool) DeepCopy() *DockerMachinePool { - if in == nil { - return nil - } - out := new(DockerMachinePool) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerMachinePool) 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 *DockerMachinePoolInstanceStatus) DeepCopyInto(out *DockerMachinePoolInstanceStatus) { - *out = *in - if in.Addresses != nil { - in, out := &in.Addresses, &out.Addresses - *out = make([]cluster_apiapiv1alpha4.MachineAddress, len(*in)) - copy(*out, *in) - } - if in.ProviderID != nil { - in, out := &in.ProviderID, &out.ProviderID - *out = new(string) - **out = **in - } - if in.Version != nil { - in, out := &in.Version, &out.Version - *out = new(string) - **out = **in - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachinePoolInstanceStatus. -func (in *DockerMachinePoolInstanceStatus) DeepCopy() *DockerMachinePoolInstanceStatus { - if in == nil { - return nil - } - out := new(DockerMachinePoolInstanceStatus) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerMachinePoolList) DeepCopyInto(out *DockerMachinePoolList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]DockerMachinePool, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachinePoolList. -func (in *DockerMachinePoolList) DeepCopy() *DockerMachinePoolList { - if in == nil { - return nil - } - out := new(DockerMachinePoolList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *DockerMachinePoolList) 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 *DockerMachinePoolMachineTemplate) DeepCopyInto(out *DockerMachinePoolMachineTemplate) { - *out = *in - if in.PreLoadImages != nil { - in, out := &in.PreLoadImages, &out.PreLoadImages - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.ExtraMounts != nil { - in, out := &in.ExtraMounts, &out.ExtraMounts - *out = make([]apiv1alpha4.Mount, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachinePoolMachineTemplate. -func (in *DockerMachinePoolMachineTemplate) DeepCopy() *DockerMachinePoolMachineTemplate { - if in == nil { - return nil - } - out := new(DockerMachinePoolMachineTemplate) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerMachinePoolSpec) DeepCopyInto(out *DockerMachinePoolSpec) { - *out = *in - in.Template.DeepCopyInto(&out.Template) - if in.ProviderIDList != nil { - in, out := &in.ProviderIDList, &out.ProviderIDList - *out = make([]string, len(*in)) - copy(*out, *in) - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachinePoolSpec. -func (in *DockerMachinePoolSpec) DeepCopy() *DockerMachinePoolSpec { - if in == nil { - return nil - } - out := new(DockerMachinePoolSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DockerMachinePoolStatus) DeepCopyInto(out *DockerMachinePoolStatus) { - *out = *in - if in.Instances != nil { - in, out := &in.Instances, &out.Instances - *out = make([]DockerMachinePoolInstanceStatus, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make(cluster_apiapiv1alpha4.Conditions, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DockerMachinePoolStatus. -func (in *DockerMachinePoolStatus) DeepCopy() *DockerMachinePoolStatus { - if in == nil { - return nil - } - out := new(DockerMachinePoolStatus) - in.DeepCopyInto(out) - return out -} diff --git a/test/infrastructure/docker/main.go b/test/infrastructure/docker/main.go index 81a4670f77f0..7946f677d8dc 100644 --- a/test/infrastructure/docker/main.go +++ b/test/infrastructure/docker/main.go @@ -49,10 +49,8 @@ import ( expv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/test/infrastructure/container" - infrav1alpha4 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1alpha4" infrav1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/api/v1beta1" "sigs.k8s.io/cluster-api/test/infrastructure/docker/controllers" - infraexpv1alpha4 "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1alpha4" infraexpv1 "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/api/v1beta1" expcontrollers "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/controllers" infraexpwebhooks "sigs.k8s.io/cluster-api/test/infrastructure/docker/exp/webhooks" @@ -91,9 +89,7 @@ var ( func init() { _ = clientgoscheme.AddToScheme(scheme) - _ = infrav1alpha4.AddToScheme(scheme) _ = infrav1.AddToScheme(scheme) - _ = infraexpv1alpha4.AddToScheme(scheme) _ = infraexpv1.AddToScheme(scheme) _ = clusterv1.AddToScheme(scheme) _ = expv1.AddToScheme(scheme)