diff --git a/.gitignore b/.gitignore index 24ec630d9f..ac70858508 100644 --- a/.gitignore +++ b/.gitignore @@ -31,12 +31,8 @@ kubeconfig # Example and binary output directory /out -# bazel -/bazel-bin -/bazel-cluster-api-provider-aws -/bazel-genfiles -/bazel-out -/bazel-testlogs +# build +.build # vscode .vscode diff --git a/.golangci.yml b/.golangci.yml index 02a98c8bd2..72943a4506 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -22,7 +22,6 @@ linters: - ifshort - importas - ineffassign - - maligned - misspell - nakedret - nilerr @@ -53,9 +52,8 @@ linters-settings: # Maximum length of variable declaration measured in number of characters, after which linter won't suggest using short syntax. max-decl-chars: 50 importas: - no-unaliased: true + no-unaliased: false alias: - # Kubernetes - pkg: k8s.io/api/core/v1 alias: corev1 - pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 @@ -66,9 +64,88 @@ linters-settings: alias: apierrors - pkg: k8s.io/apimachinery/pkg/util/errors alias: kerrors - # Controller Runtime + - pkg: sigs.k8s.io/controller-runtime/pkg/conversion + alias: ctrlconversion + - pkg: sigs.k8s.io/cluster-api/util/conversion + alias: utilconversion + - pkg: k8s.io/apimachinery/pkg/conversion + alias: apiconversion + - pkg: sigs.k8s.io/cluster-api-provider-aws/api/v1beta1 + alias: infrav1 + - pkg: sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha3 + alias: expinfrav1alpha3 + - pkg: sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4 + alias: expinfrav1alpha4 + - pkg: sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1 + alias: expinfrav1 + - pkg: sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4 + alias: infrav1alpha4 + - pkg: sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3 + alias: infrav1alpha3 + - pkg: k8s.io/client-go/kubernetes/scheme + alias: cgscheme + - pkg: k8s.io/client-go/tools/record + alias: cgrecord + - pkg: sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha3 + alias: eksbootstrapv1alpha3 + - pkg: sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha4 + alias: eksbootstrapv1alpha4 + - pkg: sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1beta1 + alias: eksbootstrapv1 + - pkg: sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3 + alias: ekscontrolplanev1alpha3 + - pkg: sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4 + alias: ekscontrolplanev1alpha4 + - pkg: sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1 + alias: ekscontrolplanev1 + - pkg: "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/controllers" + alias: eksbootstrapcontrollers + - pkg: "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/controllers" + alias: ekscontrolplanecontrollers + - pkg: "sigs.k8s.io/cluster-api-provider-aws/exp/controllers" + alias: expcontrollers + - pkg: "k8s.io/apimachinery/pkg/runtime" + alias: runtime + - pkg: "k8s.io/apimachinery/pkg/runtime/serializer" + alias: runtimeserializer + - pkg: "k8s.io/apimachinery/pkg/runtime/serializer/yaml" + alias: yamlserializer + - pkg: "sigs.k8s.io/cluster-api/api/v1alpha3" + alias: clusterv1alpha3 + - pkg: "sigs.k8s.io/cluster-api/api/v1alpha4" + alias: clusterv1alpha4 + - pkg: "sigs.k8s.io/cluster-api/api/v1beta1" + alias: clusterv1 + - pkg: "sigs.k8s.io/cluster-api/util/defaulting" + alias: utildefaulting - pkg: sigs.k8s.io/controller-runtime alias: ctrl + - pkg: "k8s.io/apimachinery/pkg/api/errors" + alias: apierrors + - pkg: "sigs.k8s.io/controller-runtime/pkg/log" + alias: logf + - pkg: "github.com/google/gofuzz" + alias: fuzz + - pkg: "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/logs" + alias: awslogs + - pkg: "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/metrics" + alias: awsmetrics + - pkg: "sigs.k8s.io/cluster-api/errors" + alias: capierrors + - pkg: "github.com/aws/aws-sdk-go/aws/client" + alias: awsclient + - pkg: "github.com/aws/amazon-vpc-cni-k8s/pkg/apis/crd/v1alpha1" + alias: amazoncni + - pkg: "github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi" + alias: rgapi + - pkg: "crypto/rand" + alias: crand + - pkg: "sigs.k8s.io/controller-runtime/pkg/client" + alias: crclient + - pkg: "k8s.io/apimachinery/pkg/types" + alias: apimachinerytypes + - pkg: "sigs.k8s.io/cluster-api/exp/api/v1beta1" + alias: expclusterv1 staticcheck: go: "1.16" stylecheck: @@ -128,10 +205,10 @@ issues: - linters: - revive source: _ "embed" - # This directive allows the variable in defaults.go files to have underscore + # This directive allows the variable in defaults.go files to have underscore - linters: - revive - text: "var-naming: don't use underscores in Go names; func (.+) should be (.+)" + text: "var-naming: don't use underscores in Go names; func (.+) should be (.+)" path: .*/defaults.go # Disable unparam "always receives" which might not be really # useful when building libraries. @@ -140,7 +217,7 @@ issues: text: always receives - linters: - unparam - text: (.+) - (`t`|`g`) is unused + text: (.+) - (`t`|`g`) is unused - path: _test\.go text: cyclomatic complexity # Append should be able to assign to a different var/slice. @@ -155,4 +232,4 @@ run: - ".*conversion.*\\.go$" skip-dirs: - third_party - allow-parallel-runners: true \ No newline at end of file + allow-parallel-runners: true diff --git a/Makefile b/Makefile index 968ef879f0..7f449eb4d3 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,9 @@ TOOLS_DIR := hack/tools TOOLS_DIR_DEPS := $(TOOLS_DIR)/go.sum $(TOOLS_DIR)/go.mod $(TOOLS_DIR)/Makefile TOOLS_BIN_DIR := $(TOOLS_DIR)/bin +API_DIRS := cmd/clusterawsadm/api api exp/api controlplane/eks/api bootstrap/eks/api iam/api +API_SRCS := $(foreach dir, $(API_DIRS), $(call rwildcard,../../$(dir),*.go)) + BIN_DIR := bin REPO_ROOT := $(shell git rev-parse --show-toplevel) GH_ORG_NAME ?= kubernetes-sigs @@ -123,15 +126,6 @@ E2E_SKIP_EKS_UPGRADE ?= "true" # Set EKS_SOURCE_TEMPLATE to override the source template EKS_SOURCE_TEMPLATE ?= eks/cluster-template-eks-control-plane-only.yaml -#### We are disable Cluster API Framework tests for the time being for lack of resources -# With framework tests enables, tests exceed the 4 hour timeout. -GINKGO_SKIP ?= \[Cluster API Framework\] - -# If someone sets an explicit focus for Cluster API Framework, remove the skip -ifeq ($(findstring \[Cluster API Framework\],$(E2E_FOCUS)),\[Cluster API Framework\]) - override undefine GINKGO_SKIP -endif - # Enable Cluster API Framework tests for the purposes of running the PR blocking test ifeq ($(findstring \[PR-Blocking\],$(E2E_FOCUS)),\[PR-Blocking\]) override undefine GINKGO_SKIP @@ -183,11 +177,11 @@ generate-test-flavors: $(KUSTOMIZE) ## Generate test template flavors ./hack/gen-test-flavors.sh .PHONY: test-e2e ## Run e2e tests using clusterctl -test-e2e: $(GINKGO) $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) e2e-image ## Run e2e tests +test-e2e: $(GINKGO) $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) generate-test-flavors e2e-image ## Run e2e tests time $(GINKGO) -tags=e2e $(GINKGO_ARGS) -p ./test/e2e/suites/unmanaged/... -- -config-path="$(E2E_CONF_PATH)" $(E2E_ARGS) .PHONY: test-e2e-eks ## Run EKS e2e tests using clusterctl -test-e2e-eks: $(GINKGO) $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) e2e-image ## Run eks e2e tests +test-e2e-eks: generate-test-flavors $(GINKGO) $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) e2e-image ## Run eks e2e tests time $(GINKGO) -tags=e2e $(GINKGO_ARGS) ./test/e2e/suites/managed/... -- -config-path="$(E2E_EKS_CONF_PATH)" --source-template="$(EKS_SOURCE_TEMPLATE)" $(E2E_ARGS) $(EKS_E2E_ARGS) .PHONY: e2e-image @@ -198,7 +192,7 @@ CONFORMANCE_E2E_ARGS ?= -kubetest.config-file=$(KUBETEST_CONF_PATH) CONFORMANCE_E2E_ARGS += $(E2E_ARGS) CONFORMANCE_GINKGO_ARGS += $(GINKGO_ARGS) .PHONY: test-conformance -test-conformance: $(GINKGO) $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) e2e-image ## Run clusterctl based conformance test on workload cluster (requires Docker). +test-conformance: generate-test-flavors $(GINKGO) $(KIND) $(SSM_PLUGIN) $(KUSTOMIZE) e2e-image ## Run clusterctl based conformance test on workload cluster (requires Docker). time $(GINKGO) -tags=e2e -focus="conformance" $(CONFORMANCE_GINKGO_ARGS) ./test/e2e/suites/conformance/... -- -config-path="$(E2E_CONF_PATH)" $(CONFORMANCE_E2E_ARGS) .PHONY: test-cover @@ -244,88 +238,99 @@ modules: ## Runs go mod to ensure proper vendoring. .PHONY: generate generate: ## Generate code $(MAKE) generate-go - $(MAKE) generate-manifests - $(MAKE) generate-test-flavors $(MAKE) $(CRD_DOCS) -.PHONY: $(CRD_DOCS_DIR)/% -$(CRD_DOCS_DIR)/%: +$(CRD_DOCS_DIR)/%: $(API_SRCS) $(MAKE) -C docs/book src/crd/$* .PHONY: generate-go generate-go: $(MOCKGEN) - $(MAKE) generate-go-core - $(MAKE) generate-go-eks-bootstrap - $(MAKE) generate-go-eks-controlplane + $(MAKE) generate-go-apis go generate ./... -.PHONY: generate-go-core -generate-go-core: ## Runs Go related generate targets - $(MAKE) -B $(CONTROLLER_GEN) $(DEFAULTER_GEN) $(CONVERSION_GEN) +.PHONY: generate-go-apis +generate-go-apis: ## Runs Go related generate targets + $(MAKE) .build/generate-go-apis + +.build: + mkdir -p .build + +.build/generate-go-apis: .build $(API_SRCS) $(CONTROLLER_GEN) $(DEFAULTER_GEN) $(CONVERSION_GEN) $(CONTROLLER_GEN) \ paths=./api/... \ paths=./$(EXP_DIR)/api/... \ - object:headerFile=./hack/boilerplate/boilerplate.generatego.txt + paths=./bootstrap/eks/api/... \ + paths=./controlplane/eks/api/... \ + paths=./iam/api/... \ + output:crd:dir=config/crd/bases \ + object:headerFile=./hack/boilerplate/boilerplate.generatego.txt \ + crd:crdVersions=v1 \ + rbac:roleName=manager-role \ + webhook $(CONTROLLER_GEN) \ - paths=./cmd/clusterawsadm/api/... \ + paths=./cmd/... \ object:headerFile=./hack/boilerplate/boilerplate.generatego.txt - $(DEFAULTER_GEN) \ - --input-dirs=./cmd/clusterawsadm/api/bootstrap/v1alpha1,./cmd/clusterawsadm/api/iam/v1alpha1 \ - --v=0 $(GEN_OUTPUT_BASE) \ - --go-header-file=./hack/boilerplate/boilerplate.generatego.txt + $(MAKE) defaulters $(CONVERSION_GEN) \ --input-dirs=./api/v1alpha3 \ + --input-dirs=./api/v1alpha4 \ + --input-dirs=./cmd/clusterawsadm/api/bootstrap/v1alpha1 \ --extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha3 \ - --build-tag=ignore_autogenerated_core_v1alpha3 \ + --extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha4 \ + --build-tag=ignore_autogenerated_conversions \ --output-file-base=zz_generated.conversion $(GEN_OUTPUT_BASE) \ --go-header-file=./hack/boilerplate/boilerplate.generatego.txt - $(CONVERSION_GEN) \ - --input-dirs=./$(EXP_DIR)/api/v1alpha3 \ - --output-file-base=zz_generated.conversion \ - --go-header-file=./hack/boilerplate/boilerplate.generatego.txt $(GEN_OUTPUT_BASE) - -.PHONY: generate-go-eks-bootstrap -generate-go-eks-bootstrap: $(CONTROLLER_GEN) - $(CONTROLLER_GEN) \ - paths=./bootstrap/eks/api/... \ - object:headerFile=./hack/boilerplate/boilerplate.generatego.txt $(CONVERSION_GEN) \ --input-dirs=./bootstrap/eks/api/v1alpha3 \ + --input-dirs=./bootstrap/eks/api/v1alpha4 \ + --extra-peer-dirs=sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3 \ + --extra-peer-dirs=sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4 \ + --extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha3 \ + --extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha4 \ + --build-tag=ignore_autogenerated_conversions \ --output-file-base=zz_generated.conversion $(GEN_OUTPUT_BASE) \ --go-header-file=./hack/boilerplate/boilerplate.generatego.txt -.PHONY: generate-go-eks-controlplane -generate-go-eks-controlplane: $(CONTROLLER_GEN) $(CONVERSION_GEN) - $(CONTROLLER_GEN) \ - paths=./controlplane/eks/api/... \ - object:headerFile=./hack/boilerplate/boilerplate.generatego.txt $(CONVERSION_GEN) \ --input-dirs=./controlplane/eks/api/v1alpha3 \ + --input-dirs=./controlplane/eks/api/v1alpha4 \ + --extra-peer-dirs=sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3 \ + --extra-peer-dirs=sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4 \ + --extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha3 \ + --extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha4 \ + --build-tag=ignore_autogenerated_conversions \ --output-file-base=zz_generated.conversion $(GEN_OUTPUT_BASE) \ --go-header-file=./hack/boilerplate/boilerplate.generatego.txt -.PHONY: generate-manifests -generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc. - $(CONTROLLER_GEN) \ - paths=./api/... \ - paths=./$(EXP_DIR)/api/... \ - paths=./controlplane/eks/api/...\ - paths=./bootstrap/eks/api/... \ - crd:crdVersions=v1 \ - output:crd:dir=$(CRD_ROOT) \ - output:webhook:dir=$(WEBHOOK_ROOT) \ - webhook - $(CONTROLLER_GEN) \ - paths=./controllers/... \ - paths=./$(EXP_DIR)/controllers/... \ - paths=./bootstrap/eks/controllers/... \ - paths=./controlplane/eks/controllers/... \ - output:rbac:dir=$(RBAC_ROOT) \ - rbac:roleName=manager-role + $(CONVERSION_GEN) \ + --input-dirs=./$(EXP_DIR)/api/v1alpha3 \ + --input-dirs=./$(EXP_DIR)/api/v1alpha4 \ + --extra-peer-dirs=sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3 \ + --extra-peer-dirs=sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4 \ + --extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha3 \ + --extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha4 \ + --build-tag=ignore_autogenerated_conversions \ + --output-file-base=zz_generated.conversion $(GEN_OUTPUT_BASE) \ + --go-header-file=./hack/boilerplate/boilerplate.generatego.txt + + touch $@ + +.PHONY: defaulters +defaulters: $(DEFAULTER_GEN) + $(DEFAULTER_GEN) \ + --input-dirs=./api/v1alpha3 \ + --input-dirs=./api/v1alpha4 \ + --input-dirs=./api/v1beta1 \ + --input-dirs=./$(EXP_DIR)/api/v1beta1 \ + --input-dirs=./cmd/clusterawsadm/api/bootstrap/v1beta1 \ + --input-dirs=./cmd/clusterawsadm/api/bootstrap/v1alpha1 \ + --extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1beta1 \ + --v=0 $(GEN_OUTPUT_BASE) \ + --go-header-file=./hack/boilerplate/boilerplate.generatego.txt ## -------------------------------------- ## Docker @@ -585,6 +590,7 @@ verify: verify-boilerplate verify-modules verify-gen release-manifests .PHONY: verify-boilerplate verify-boilerplate: + -rm ./hack/tools/bin/*.sh ./hack/verify-boilerplate.sh .PHONY: verify-modules diff --git a/PROJECT b/PROJECT index 7f1390e59a..d00dd8b3dd 100644 --- a/PROJECT +++ b/PROJECT @@ -2,6 +2,7 @@ version: "2" domain: cluster.x-k8s.io repo: sigs.k8s.io/cluster-api-provider-aws resources: +# v1alpha3 types - group: infrastructure version: v1alpha3 kind: AWSMachine @@ -20,6 +21,13 @@ resources: - group: infrastructure version: v1alpha3 kind: AWSClusterControllerIdentity +- group: infrastructure + version: v1alpha3 + kind: AWSManagedControlPlanes +- group: infrastructure + version: v1alpha3 + kind: AWSManagedCluster +# v1alpha4 types - group: infrastructure version: v1alpha4 kind: AWSMachine @@ -41,3 +49,37 @@ resources: - group: infrastructure version: v1alpha4 kind: AWSClusterTemplate +- group: infrastructure + version: v1alpha4 + kind: AWSManagedControlPlanes +- group: infrastructure + version: v1alpha4 + kind: AWSManagedCluster +# v1beta1 types +- group: infrastructure + version: v1beta1 + kind: AWSMachine +- group: infrastructure + version: v1beta1 + kind: AWSCluster +- group: infrastructure + version: v1beta1 + kind: AWSMachineTemplate +- group: infrastructure + version: v1beta1 + kind: AWSClusterStaticIdentity +- group: infrastructure + version: v1beta1 + kind: AWSClusterRoleIdentity +- group: infrastructure + version: v1beta1 + kind: AWSClusterControllerIdentity +- group: infrastructure + version: v1beta1 + kind: AWSClusterTemplate +- group: infrastructure + version: v1beta1 + kind: AWSManagedControlPlanes +- group: infrastructure + version: v1beta1 + kind: AWSManagedCluster diff --git a/api/v1alpha3/awscluster_conversion.go b/api/v1alpha3/awscluster_conversion.go new file mode 100644 index 0000000000..e7d907a709 --- /dev/null +++ b/api/v1alpha3/awscluster_conversion.go @@ -0,0 +1,110 @@ +/* +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 v1alpha3 + +import ( + "unsafe" + + apiconversion "k8s.io/apimachinery/pkg/conversion" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + utilconversion "sigs.k8s.io/cluster-api/util/conversion" + "sigs.k8s.io/controller-runtime/pkg/conversion" +) + +// ConvertTo converts the v1alpha3 AWSCluster receiver to a v1beta1 AWSCluster. +func (r *AWSCluster) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSCluster) + + if err := Convert_v1alpha3_AWSCluster_To_v1beta1_AWSCluster(r, dst, nil); err != nil { + return err + } + // Manually restore data. + restored := &infrav1.AWSCluster{} + if ok, err := utilconversion.UnmarshalData(r, restored); err != nil || !ok { + return err + } + + if restored.Status.Bastion != nil { + if dst.Status.Bastion == nil { + dst.Status.Bastion = &infrav1.Instance{} + } + restoreInstance(restored.Status.Bastion, dst.Status.Bastion) + } + + return nil +} + +// ConvertFrom converts the v1beta1 AWSCluster receiver to a v1alpha3 AWSCluster. +func (r *AWSCluster) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1.AWSCluster) + + if err := Convert_v1beta1_AWSCluster_To_v1alpha3_AWSCluster(src, r, nil); err != nil { + return err + } + + // Preserve Hub data on down-conversion. + if err := utilconversion.MarshalData(src, r); err != nil { + return err + } + + return nil +} + +// ConvertTo converts the v1alpha3 AWSClusterList receiver to a v1beta1 AWSClusterList. +func (r *AWSClusterList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSClusterList) + + return Convert_v1alpha3_AWSClusterList_To_v1beta1_AWSClusterList(r, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSClusterList receiver to a v1alpha3 AWSClusterList. +func (r *AWSClusterList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1.AWSClusterList) + + return Convert_v1beta1_AWSClusterList_To_v1alpha3_AWSClusterList(src, r, nil) +} + + +// Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint . +func Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(in *clusterv1alpha3.APIEndpoint, out *clusterv1.APIEndpoint, s apiconversion.Scope) error { + return clusterv1alpha3.Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(in, out, s) +} + +// Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint . +func Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(in *clusterv1.APIEndpoint, out *clusterv1alpha3.APIEndpoint, s apiconversion.Scope) error { + return clusterv1alpha3.Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(in, out, s) +} + +// Convert_v1alpha3_Network_To_v1alpha4_NetworkStatus is based on the autogenerated function and handles the renaming of the Network struct to NetworkStatus +func Convert_v1alpha3_Network_To_v1beta1_NetworkStatus(in *Network, out *infrav1.NetworkStatus, s apiconversion.Scope) error { + out.SecurityGroups = *(*map[infrav1.SecurityGroupRole]infrav1.SecurityGroup)(unsafe.Pointer(&in.SecurityGroups)) + if err := Convert_v1alpha3_ClassicELB_To_v1beta1_ClassicELB(&in.APIServerELB, &out.APIServerELB, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_NetworkStatus_To_v1alpha3_Network is based on the autogenerated function and handles the renaming of the NetworkStatus struct to Network +func Convert_v1beta1_NetworkStatus_To_v1alpha3_Network(in *infrav1.NetworkStatus, out *Network, s apiconversion.Scope) error { + out.SecurityGroups = *(*map[SecurityGroupRole]SecurityGroup)(unsafe.Pointer(&in.SecurityGroups)) + if err := Convert_v1beta1_ClassicELB_To_v1alpha3_ClassicELB(&in.APIServerELB, &out.APIServerELB, s); err != nil { + return err + } + return nil +} diff --git a/api/v1alpha3/awscluster_types.go b/api/v1alpha3/awscluster_types.go index 6617335467..6b6c8f779d 100644 --- a/api/v1alpha3/awscluster_types.go +++ b/api/v1alpha3/awscluster_types.go @@ -18,7 +18,7 @@ package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" ) const ( @@ -44,7 +44,7 @@ type AWSClusterSpec struct { // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. // +optional - ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"` + ControlPlaneEndpoint clusterv1alpha3.APIEndpoint `json:"controlPlaneEndpoint"` // AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the // ones added by default. @@ -176,11 +176,11 @@ type AWSLoadBalancerSpec struct { // AWSClusterStatus defines the observed state of AWSCluster. type AWSClusterStatus struct { // +kubebuilder:default=false - Ready bool `json:"ready"` - Network Network `json:"network,omitempty"` - FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"` - Bastion *Instance `json:"bastion,omitempty"` - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Ready bool `json:"ready"` + Network Network `json:"network,omitempty"` + FailureDomains clusterv1alpha3.FailureDomains `json:"failureDomains,omitempty"` + Bastion *Instance `json:"bastion,omitempty"` + Conditions clusterv1alpha3.Conditions `json:"conditions,omitempty"` } // +kubebuilder:object:root=true @@ -191,6 +191,7 @@ type AWSClusterStatus struct { // +kubebuilder:printcolumn:name="VPC",type="string",JSONPath=".spec.networkSpec.vpc.id",description="AWS VPC the cluster is using" // +kubebuilder:printcolumn:name="Endpoint",type="string",JSONPath=".spec.controlPlaneEndpoint",description="API Endpoint",priority=1 // +kubebuilder:printcolumn:name="Bastion IP",type="string",JSONPath=".status.bastion.publicIp",description="Bastion IP address for breakglass access" +// +k8s:defaulter-gen=true // AWSCluster is the Schema for the awsclusters API. type AWSCluster struct { @@ -211,12 +212,12 @@ type AWSClusterList struct { } // GetConditions returns the observations of the operational state of the AWSCluster resource. -func (r *AWSCluster) GetConditions() clusterv1.Conditions { +func (r *AWSCluster) GetConditions() clusterv1alpha3.Conditions { return r.Status.Conditions } -// SetConditions sets the underlying service state of the AWSCluster to the predescribed clusterv1.Conditions. -func (r *AWSCluster) SetConditions(conditions clusterv1.Conditions) { +// SetConditions sets the underlying service state of the AWSCluster to the predescribed clusterv1alpha3.Conditions. +func (r *AWSCluster) SetConditions(conditions clusterv1alpha3.Conditions) { r.Status.Conditions = conditions } diff --git a/api/v1alpha3/awsidentity_conversion.go b/api/v1alpha3/awsidentity_conversion.go new file mode 100644 index 0000000000..4e0d31b566 --- /dev/null +++ b/api/v1alpha3/awsidentity_conversion.go @@ -0,0 +1,127 @@ +/* +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 v1alpha3 + +import ( + apiconversion "k8s.io/apimachinery/pkg/conversion" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + "sigs.k8s.io/controller-runtime/pkg/conversion" +) + +// ConvertTo converts the v1alpha3 AWSClusterStaticIdentity receiver to a v1beta1 AWSClusterStaticIdentity. +func (r *AWSClusterStaticIdentity) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSClusterStaticIdentity) + if err := Convert_v1alpha3_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity(r, dst, nil); err != nil { + return err + } + + dst.Spec.SecretRef = r.Spec.SecretRef.Name + return nil +} + +// ConvertFrom converts the v1beta1 AWSClusterStaticIdentity receiver to a v1alpha3 AWSClusterStaticIdentity. +func (r *AWSClusterStaticIdentity) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1.AWSClusterStaticIdentity) + + if err := Convert_v1beta1_AWSClusterStaticIdentity_To_v1alpha3_AWSClusterStaticIdentity(src, r, nil); err != nil { + return err + } + + r.Spec.SecretRef.Name = src.Spec.SecretRef + return nil +} + +// ConvertTo converts the v1alpha3 AWSClusterStaticIdentityList receiver to a v1beta1 AWSClusterStaticIdentityList. +func (r *AWSClusterStaticIdentityList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSClusterStaticIdentityList) + + return Convert_v1alpha3_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList(r, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSClusterStaticIdentityList receiver to a v1alpha3 AWSClusterStaticIdentityList. +func (r *AWSClusterStaticIdentityList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1.AWSClusterStaticIdentityList) + + return Convert_v1beta1_AWSClusterStaticIdentityList_To_v1alpha3_AWSClusterStaticIdentityList(src, r, nil) +} + +// ConvertTo converts the v1alpha3 AWSClusterRoleIdentity receiver to a v1beta1 AWSClusterRoleIdentity. +func (r *AWSClusterRoleIdentity) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSClusterRoleIdentity) + + return Convert_v1alpha3_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity(r, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSClusterRoleIdentity receiver to a v1alpha3 AWSClusterRoleIdentity. +func (r *AWSClusterRoleIdentity) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1.AWSClusterRoleIdentity) + + return Convert_v1beta1_AWSClusterRoleIdentity_To_v1alpha3_AWSClusterRoleIdentity(src, r, nil) +} + +// ConvertTo converts the v1alpha3 AWSClusterRoleIdentityList receiver to a v1beta1 AWSClusterRoleIdentityList. +func (r *AWSClusterRoleIdentityList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSClusterRoleIdentityList) + + return Convert_v1alpha3_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList(r, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSClusterRoleIdentityList receiver to a v1alpha3 AWSClusterRoleIdentityList. +func (r *AWSClusterRoleIdentityList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1.AWSClusterRoleIdentityList) + + return Convert_v1beta1_AWSClusterRoleIdentityList_To_v1alpha3_AWSClusterRoleIdentityList(src, r, nil) +} + +// ConvertTo converts the v1alpha3 AWSClusterControllerIdentity receiver to a v1beta1 AWSClusterControllerIdentity. +func (r *AWSClusterControllerIdentity) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSClusterControllerIdentity) + + return Convert_v1alpha3_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity(r, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSClusterControllerIdentity receiver to a v1alpha3 AWSClusterControllerIdentity. +func (r *AWSClusterControllerIdentity) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1.AWSClusterControllerIdentity) + + return Convert_v1beta1_AWSClusterControllerIdentity_To_v1alpha3_AWSClusterControllerIdentity(src, r, nil) +} + +// ConvertTo converts the v1alpha3 AWSClusterControllerIdentityList receiver to a v1beta1 AWSClusterControllerIdentityList. +func (r *AWSClusterControllerIdentityList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSClusterControllerIdentityList) + + return Convert_v1alpha3_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList(r, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSClusterControllerIdentityList receiver to a v1alpha3 AWSClusterControllerIdentityList. +func (r *AWSClusterControllerIdentityList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1.AWSClusterControllerIdentityList) + + return Convert_v1beta1_AWSClusterControllerIdentityList_To_v1alpha3_AWSClusterControllerIdentityList(src, r, nil) +} + + +// Convert_v1alpha3_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec . +func Convert_v1alpha3_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec(in *AWSClusterStaticIdentitySpec, out *infrav1.AWSClusterStaticIdentitySpec, s apiconversion.Scope) error { + return autoConvert_v1alpha3_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec(in, out, s) +} + +// Convert_v1beta1_AWSClusterStaticIdentitySpec_To_v1alpha3_AWSClusterStaticIdentitySpec . +func Convert_v1beta1_AWSClusterStaticIdentitySpec_To_v1alpha3_AWSClusterStaticIdentitySpec(in *infrav1.AWSClusterStaticIdentitySpec, out *AWSClusterStaticIdentitySpec, s apiconversion.Scope) error { + return autoConvert_v1beta1_AWSClusterStaticIdentitySpec_To_v1alpha3_AWSClusterStaticIdentitySpec(in, out, s) +} diff --git a/api/v1alpha3/awsidentity_types.go b/api/v1alpha3/awsidentity_types.go index 168665db80..f0e8440ff5 100644 --- a/api/v1alpha3/awsidentity_types.go +++ b/api/v1alpha3/awsidentity_types.go @@ -72,6 +72,7 @@ type AWSRoleSpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsclusterstaticidentities,scope=Cluster,categories=cluster-api,shortName=awssi +// +k8s:defaulter-gen=true // AWSClusterStaticIdentity is the Schema for the awsclusterstaticidentities API // It represents a reference to an AWS access key ID and secret access key, stored in a secret. @@ -105,6 +106,7 @@ type AWSClusterStaticIdentitySpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsclusterroleidentities,scope=Cluster,categories=cluster-api,shortName=awsri +// +k8s:defaulter-gen=true // AWSClusterRoleIdentity is the Schema for the awsclusterroleidentities API // It is used to assume a role using the provided sourceRef. @@ -148,6 +150,7 @@ type AWSClusterRoleIdentitySpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsclustercontrolleridentities,scope=Cluster,categories=cluster-api,shortName=awsci +// +k8s:defaulter-gen=true // AWSClusterControllerIdentity is the Schema for the awsclustercontrolleridentities API // It is used to grant access to use Cluster API Provider AWS Controller credentials. @@ -160,6 +163,7 @@ type AWSClusterControllerIdentity struct { } // +kubebuilder:object:root=true +// +k8s:defaulter-gen=true // AWSClusterControllerIdentityList contains a list of AWSClusterControllerIdentity. type AWSClusterControllerIdentityList struct { diff --git a/api/v1alpha3/awsmachine_conversion.go b/api/v1alpha3/awsmachine_conversion.go new file mode 100644 index 0000000000..8cd7fa9b06 --- /dev/null +++ b/api/v1alpha3/awsmachine_conversion.go @@ -0,0 +1,227 @@ +/* +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 v1alpha3 + +import ( + "unsafe" + + apiconversion "k8s.io/apimachinery/pkg/conversion" + "k8s.io/utils/pointer" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + utilconversion "sigs.k8s.io/cluster-api/util/conversion" + "sigs.k8s.io/controller-runtime/pkg/conversion" +) + +// ConvertTo converts the v1alpha3 AWSMachine receiver to a v1beta1 AWSMachine. +func (r *AWSMachine) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSMachine) + if err := Convert_v1alpha3_AWSMachine_To_v1beta1_AWSMachine(r, dst, nil); err != nil { + return err + } + // Manually restore data. + restored := &infrav1.AWSMachine{} + if ok, err := utilconversion.UnmarshalData(r, restored); err != nil || !ok { + return err + } + + restoreSpec(&restored.Spec, &dst.Spec) + + return nil +} + +func restoreSpec(restored, dst *infrav1.AWSMachineSpec) { + RestoreAMIReference(&restored.AMI, &dst.AMI) + if restored.RootVolume != nil { + if dst.RootVolume == nil { + dst.RootVolume = &infrav1.Volume{} + } + RestoreRootVolume(restored.RootVolume, dst.RootVolume) + } + if restored.NonRootVolumes != nil { + if dst.NonRootVolumes == nil { + dst.NonRootVolumes = []infrav1.Volume{} + } + restoreNonRootVolumes(restored.NonRootVolumes, dst.NonRootVolumes) + } +} + +// ConvertFrom converts the v1beta1 AWSMachine receiver to a v1alpha3 AWSMachine. +func (r *AWSMachine) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1.AWSMachine) + + if err := Convert_v1beta1_AWSMachine_To_v1alpha3_AWSMachine(src, r, nil); err != nil { + return err + } + // Preserve Hub data on down-conversion. + if err := utilconversion.MarshalData(src, r); err != nil { + return err + } + return nil +} + +// ConvertTo converts the v1alpha3 AWSMachineList receiver to a v1beta1 AWSMachineList. +func (r *AWSMachineList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSMachineList) + + return Convert_v1alpha3_AWSMachineList_To_v1beta1_AWSMachineList(r, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSMachineList receiver to a v1alpha3 AWSMachineList. +func (r *AWSMachineList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1.AWSMachineList) + + return Convert_v1beta1_AWSMachineList_To_v1alpha3_AWSMachineList(src, r, nil) +} + +// ConvertTo converts the v1alpha3 AWSMachineTemplate receiver to a v1beta1 AWSMachineTemplate. +func (r *AWSMachineTemplate) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSMachineTemplate) + if err := Convert_v1alpha3_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(r, dst, nil); err != nil { + return err + } + // Manually restore data. + restored := &infrav1.AWSMachineTemplate{} + if ok, err := utilconversion.UnmarshalData(r, restored); err != nil || !ok { + return err + } + + dst.Spec.Template.ObjectMeta = restored.Spec.Template.ObjectMeta + + restoreSpec(&restored.Spec.Template.Spec, &dst.Spec.Template.Spec) + + return nil +} + +// ConvertFrom converts the v1beta1 AWSMachineTemplate receiver to a v1alpha3 AWSMachineTemplate. +func (r *AWSMachineTemplate) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1.AWSMachineTemplate) + + if err := Convert_v1beta1_AWSMachineTemplate_To_v1alpha3_AWSMachineTemplate(src, r, nil); err != nil { + return err + } + // Preserve Hub data on down-conversion. + if err := utilconversion.MarshalData(src, r); err != nil { + return err + } + return nil +} + +// ConvertTo converts the v1alpha3 AWSMachineTemplateList receiver to a v1beta1 AWSMachineTemplateList. +func (r *AWSMachineTemplateList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSMachineTemplateList) + + return Convert_v1alpha3_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList(r, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSMachineTemplateList receiver to a v1alpha3 AWSMachineTemplateList. +func (r *AWSMachineTemplateList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1.AWSMachineTemplateList) + + return Convert_v1beta1_AWSMachineTemplateList_To_v1alpha3_AWSMachineTemplateList(src, r, nil) +} + + +// Convert_v1beta1_Volume_To_v1alpha3_Volume . +func Convert_v1beta1_Volume_To_v1alpha3_Volume(in *infrav1.Volume, out *Volume, s apiconversion.Scope) error { + return autoConvert_v1beta1_Volume_To_v1alpha3_Volume(in, out, s) +} + +// Convert_v1beta1_AWSMachineSpec_To_v1alpha3_AWSMachineSpec . +func Convert_v1beta1_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(in *infrav1.AWSMachineSpec, out *AWSMachineSpec, s apiconversion.Scope) error { + return autoConvert_v1beta1_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(in, out, s) +} + +// Convert_v1beta1_Instance_To_v1alpha3_Instance . +func Convert_v1beta1_Instance_To_v1alpha3_Instance(in *infrav1.Instance, out *Instance, s apiconversion.Scope) error { + return autoConvert_v1beta1_Instance_To_v1alpha3_Instance(in, out, s) +} + +// Manually restore the instance root device data. +// Assumes restored and dst are non-nil. +func restoreInstance(restored, dst *infrav1.Instance) { + dst.VolumeIDs = restored.VolumeIDs + + if restored.RootVolume != nil { + if dst.RootVolume == nil { + dst.RootVolume = &infrav1.Volume{} + } + RestoreRootVolume(restored.RootVolume, dst.RootVolume) + } + + if restored.NonRootVolumes != nil { + if dst.NonRootVolumes == nil { + dst.NonRootVolumes = []infrav1.Volume{} + } + restoreNonRootVolumes(restored.NonRootVolumes, dst.NonRootVolumes) + } +} + +// Convert_v1alpha3_AWSResourceReference_To_v1beta1_AMIReference is a conversion function. +func Convert_v1alpha3_AWSResourceReference_To_v1beta1_AMIReference(in *AWSResourceReference, out *infrav1.AMIReference, s apiconversion.Scope) error { + out.ID = (*string)(unsafe.Pointer(in.ID)) + return nil +} + +// Convert_v1beta1_AMIReference_To_v1alpha3_AWSResourceReference is a conversion function. +func Convert_v1beta1_AMIReference_To_v1alpha3_AWSResourceReference(in *infrav1.AMIReference, out *AWSResourceReference, s apiconversion.Scope) error { + out.ID = (*string)(unsafe.Pointer(in.ID)) + return nil +} + +// RestoreAMIReference manually restore the EKSOptimizedLookupType for AWSMachine and AWSMachineTemplate +// Assumes both restored and dst are non-nil. +func RestoreAMIReference(restored, dst *infrav1.AMIReference) { + if restored.EKSOptimizedLookupType == nil { + return + } + dst.EKSOptimizedLookupType = restored.EKSOptimizedLookupType +} + +// restoreNonRootVolumes manually restores the non-root volumes +// Assumes both restoredVolumes and dstVolumes are non-nil. +func restoreNonRootVolumes(restoredVolumes, dstVolumes []infrav1.Volume) { + // restoring the nonrootvolumes which are missing in dstVolumes + // restoring dstVolumes[i].Encrypted to nil in order to avoid v1beta1 --> v1alpha3 --> v1beta1 round trip errors + for i := range restoredVolumes { + if restoredVolumes[i].Encrypted == nil { + if len(dstVolumes) <= i { + dstVolumes = append(dstVolumes, restoredVolumes[i]) + } else { + dstVolumes[i].Encrypted = nil + } + } + dstVolumes[i].Throughput = restoredVolumes[i].Throughput + } +} + +// RestoreRootVolume manually restores the root volumes. +// Assumes both restored and dst are non-nil. +// Volume.Encrypted type changed from bool in v1alpha3 to *bool in v1beta1 +// Volume.Encrypted value as nil/&false in v1beta1 will convert to false in v1alpha3 by auto-conversion, so restoring it to nil in order to avoid v1beta1 --> v1alpha3 --> v1beta1 round trip errors +func RestoreRootVolume(restored, dst *infrav1.Volume) { + if dst.Encrypted == pointer.BoolPtr(true) { + return + } + if restored.Encrypted == nil { + dst.Encrypted = nil + } + dst.Throughput = restored.Throughput +} + +func Convert_v1beta1_AWSMachineTemplateResource_To_v1alpha3_AWSMachineTemplateResource(in *infrav1.AWSMachineTemplateResource, out *AWSMachineTemplateResource, s apiconversion.Scope) error { + return autoConvert_v1beta1_AWSMachineTemplateResource_To_v1alpha3_AWSMachineTemplateResource(in, out, s) +} diff --git a/api/v1alpha3/awsmachine_types.go b/api/v1alpha3/awsmachine_types.go index e4cae1be80..e97f9c69a6 100644 --- a/api/v1alpha3/awsmachine_types.go +++ b/api/v1alpha3/awsmachine_types.go @@ -18,7 +18,7 @@ package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" "sigs.k8s.io/cluster-api/errors" ) @@ -188,7 +188,7 @@ type AWSMachineStatus struct { Interruptible bool `json:"interruptible,omitempty"` // Addresses contains the AWS instance associated addresses. - Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"` + Addresses []clusterv1alpha3.MachineAddress `json:"addresses,omitempty"` // InstanceState is the state of the AWS instance for this machine. // +optional @@ -234,7 +234,7 @@ type AWSMachineStatus struct { // Conditions defines current service state of the AWSMachine. // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1alpha3.Conditions `json:"conditions,omitempty"` } // +kubebuilder:object:root=true @@ -245,6 +245,7 @@ type AWSMachineStatus struct { // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Machine ready status" // +kubebuilder:printcolumn:name="InstanceID",type="string",JSONPath=".spec.providerID",description="EC2 instance ID" // +kubebuilder:printcolumn:name="Machine",type="string",JSONPath=".metadata.ownerReferences[?(@.kind==\"Machine\")].name",description="Machine object which owns with this AWSMachine" +// +k8s:defaulter-gen=true // AWSMachine is the Schema for the awsmachines API type AWSMachine struct { @@ -256,12 +257,12 @@ type AWSMachine struct { } // GetConditions returns the observations of the operational state of the AWSMachine resource. -func (r *AWSMachine) GetConditions() clusterv1.Conditions { +func (r *AWSMachine) GetConditions() clusterv1alpha3.Conditions { return r.Status.Conditions } -// SetConditions sets the underlying service state of the AWSMachine to the predescribed clusterv1.Conditions. -func (r *AWSMachine) SetConditions(conditions clusterv1.Conditions) { +// SetConditions sets the underlying service state of the AWSMachine to the predescribed clusterv1alpha3.Conditions. +func (r *AWSMachine) SetConditions(conditions clusterv1alpha3.Conditions) { r.Status.Conditions = conditions } diff --git a/api/v1alpha3/conditions_consts.go b/api/v1alpha3/conditions_consts.go index 605c7aeca9..2cfffe173f 100644 --- a/api/v1alpha3/conditions_consts.go +++ b/api/v1alpha3/conditions_consts.go @@ -16,18 +16,18 @@ limitations under the License. package v1alpha3 -import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" +import clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" const ( // PrincipalCredentialRetrievedCondition reports on whether Principal credentials could be retrieved successfully. // A possible scenario, where retrieval is unsuccessful, is when SourcePrincipal is not authorized for assume role. - PrincipalCredentialRetrievedCondition clusterv1.ConditionType = "PrincipalCredentialRetrieved" + PrincipalCredentialRetrievedCondition clusterv1alpha3.ConditionType = "PrincipalCredentialRetrieved" // PrincipalCredentialRetrievalFailedReason used when errors occur during identity credential retrieval. PrincipalCredentialRetrievalFailedReason = "PrincipalCredentialRetrievalFailed" // CredentialProviderBuildFailedReason used when errors occur during building providers before trying credential retrieval. CredentialProviderBuildFailedReason = "CredentialProviderBuildFailed" // PrincipalUsageAllowedCondition reports on whether Principal and all the nested source identities are allowed to be used in the AWSCluster namespace. - PrincipalUsageAllowedCondition clusterv1.ConditionType = "PrincipalUsageAllowed" + PrincipalUsageAllowedCondition clusterv1alpha3.ConditionType = "PrincipalUsageAllowed" // PrincipalUsageUnauthorizedReason used when AWSCluster namespace is not in the identity's allowed namespaces list. PrincipalUsageUnauthorizedReason = "PrincipalUsageUnauthorized" // SourcePrincipalUsageUnauthorizedReason used when AWSCluster is not in the intersection of source identity allowed namespaces @@ -37,7 +37,7 @@ const ( const ( // VpcReadyCondition reports on the successful reconciliation of a VPC. - VpcReadyCondition clusterv1.ConditionType = "VpcReady" + VpcReadyCondition clusterv1alpha3.ConditionType = "VpcReady" // VpcCreationStartedReason used when attempting to create a VPC for a managed cluster. // Will not be applied to unmanaged clusters. VpcCreationStartedReason = "VpcCreationStarted" @@ -47,7 +47,7 @@ const ( const ( // SubnetsReadyCondition reports on the successful reconciliation of subnets. - SubnetsReadyCondition clusterv1.ConditionType = "SubnetsReady" + SubnetsReadyCondition clusterv1alpha3.ConditionType = "SubnetsReady" // SubnetsReconciliationFailedReason used to report failures while reconciling subnets. SubnetsReconciliationFailedReason = "SubnetsReconciliationFailed" ) @@ -55,7 +55,7 @@ const ( const ( // InternetGatewayReadyCondition reports on the successful reconciliation of internet gateways. // Only applicable to managed clusters. - InternetGatewayReadyCondition clusterv1.ConditionType = "InternetGatewayReady" + InternetGatewayReadyCondition clusterv1alpha3.ConditionType = "InternetGatewayReady" // InternetGatewayFailedReason used when errors occur during internet gateway reconciliation. InternetGatewayFailedReason = "InternetGatewayFailed" ) @@ -63,7 +63,7 @@ const ( const ( // NatGatewaysReadyCondition reports successful reconciliation of NAT gateways. // Only applicable to managed clusters. - NatGatewaysReadyCondition clusterv1.ConditionType = "NatGatewaysReady" + NatGatewaysReadyCondition clusterv1alpha3.ConditionType = "NatGatewaysReady" // NatGatewaysCreationStartedReason set once when creating new NAT gateways. NatGatewaysCreationStartedReason = "NatGatewaysCreationStarted" // NatGatewaysReconciliationFailedReason used when any errors occur during reconciliation of NAT gateways. @@ -73,7 +73,7 @@ const ( const ( // RouteTablesReadyCondition reports successful reconciliation of route tables. // Only applicable to managed clusters. - RouteTablesReadyCondition clusterv1.ConditionType = "RouteTablesReady" + RouteTablesReadyCondition clusterv1alpha3.ConditionType = "RouteTablesReady" // RouteTableReconciliationFailedReason used when any errors occur during reconciliation of route tables. RouteTableReconciliationFailedReason = "RouteTableReconciliationFailed" ) @@ -81,14 +81,14 @@ const ( const ( // SecondaryCidrsReadyCondition reports successful reconciliation of secondary CIDR blocks. // Only applicable to managed clusters. - SecondaryCidrsReadyCondition clusterv1.ConditionType = "SecondaryCidrsReady" + SecondaryCidrsReadyCondition clusterv1alpha3.ConditionType = "SecondaryCidrsReady" // SecondaryCidrReconciliationFailedReason used when any errors occur during reconciliation of secondary CIDR blocks. SecondaryCidrReconciliationFailedReason = "SecondaryCidrReconciliationFailed" ) const ( // ClusterSecurityGroupsReadyCondition reports successful reconciliation of security groups. - ClusterSecurityGroupsReadyCondition clusterv1.ConditionType = "ClusterSecurityGroupsReady" + ClusterSecurityGroupsReadyCondition clusterv1alpha3.ConditionType = "ClusterSecurityGroupsReady" // ClusterSecurityGroupReconciliationFailedReason used when any errors occur during reconciliation of security groups. ClusterSecurityGroupReconciliationFailedReason = "SecurityGroupReconciliationFailed" ) @@ -96,7 +96,7 @@ const ( const ( // BastionHostReadyCondition reports whether a bastion host is ready. Depending on the configuration, a cluster // may not require a bastion host and this condition will be skipped. - BastionHostReadyCondition clusterv1.ConditionType = "BastionHostReady" + BastionHostReadyCondition clusterv1alpha3.ConditionType = "BastionHostReady" // BastionCreationStartedReason used when creating a new bastion host. BastionCreationStartedReason = "BastionCreationStarted" // BastionHostFailedReason used when an error occurs during the creation of a bastion host. @@ -105,7 +105,7 @@ const ( const ( // LoadBalancerReadyCondition reports on whether a control plane load balancer was successfully reconciled. - LoadBalancerReadyCondition clusterv1.ConditionType = "LoadBalancerReady" + LoadBalancerReadyCondition clusterv1alpha3.ConditionType = "LoadBalancerReady" // WaitForDNSNameReason used while waiting for a DNS name for the API server to be populated. WaitForDNSNameReason = "WaitForDNSName" // WaitForDNSNameResolveReason used while waiting for DNS name to resolve. @@ -116,7 +116,7 @@ const ( const ( // InstanceReadyCondition reports on current status of the EC2 instance. Ready indicates the instance is in a Running state. - InstanceReadyCondition clusterv1.ConditionType = "InstanceReady" + InstanceReadyCondition clusterv1alpha3.ConditionType = "InstanceReady" // InstanceNotFoundReason used when the instance couldn't be retrieved. InstanceNotFoundReason = "InstanceNotFound" @@ -138,7 +138,7 @@ const ( const ( // SecurityGroupsReadyCondition indicates the security groups are up to date on the AWSMachine. - SecurityGroupsReadyCondition clusterv1.ConditionType = "SecurityGroupsReady" + SecurityGroupsReadyCondition clusterv1alpha3.ConditionType = "SecurityGroupsReady" // SecurityGroupsFailedReason used when the security groups could not be synced. SecurityGroupsFailedReason = "SecurityGroupsSyncFailed" @@ -148,7 +148,7 @@ const ( // ELBAttachedCondition will report true when a control plane is successfully registered with an ELB. // When set to false, severity can be an Error if the subnet is not found or unavailable in the instance's AZ. // Note this is only applicable to control plane machines. - ELBAttachedCondition clusterv1.ConditionType = "ELBAttached" + ELBAttachedCondition clusterv1alpha3.ConditionType = "ELBAttached" // ELBAttachFailedReason used when a control plane node fails to attach to the ELB. ELBAttachFailedReason = "ELBAttachFailed" diff --git a/api/v1alpha3/conversion.go b/api/v1alpha3/conversion.go deleted file mode 100644 index 5b8c94d57e..0000000000 --- a/api/v1alpha3/conversion.go +++ /dev/null @@ -1,413 +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 v1alpha3 - -import ( - "unsafe" - - apiconversion "k8s.io/apimachinery/pkg/conversion" - "k8s.io/utils/pointer" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - apiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" - utilconversion "sigs.k8s.io/cluster-api/util/conversion" - "sigs.k8s.io/controller-runtime/pkg/conversion" -) - -// ConvertTo converts the v1alpha3 AWSCluster receiver to a v1alpha4 AWSCluster. -func (r *AWSCluster) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSCluster) - - if err := Convert_v1alpha3_AWSCluster_To_v1alpha4_AWSCluster(r, dst, nil); err != nil { - return err - } - // Manually restore data. - restored := &v1alpha4.AWSCluster{} - if ok, err := utilconversion.UnmarshalData(r, restored); err != nil || !ok { - return err - } - - if restored.Status.Bastion != nil { - if dst.Status.Bastion == nil { - dst.Status.Bastion = &v1alpha4.Instance{} - } - restoreInstance(restored.Status.Bastion, dst.Status.Bastion) - } - - return nil -} - -// ConvertFrom converts the v1alpha4 AWSCluster receiver to a v1alpha3 AWSCluster. -func (r *AWSCluster) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSCluster) - - if err := Convert_v1alpha4_AWSCluster_To_v1alpha3_AWSCluster(src, r, nil); err != nil { - return err - } - - // Preserve Hub data on down-conversion. - if err := utilconversion.MarshalData(src, r); err != nil { - return err - } - - return nil -} - -// ConvertTo converts the v1alpha3 AWSClusterList receiver to a v1alpha4 AWSClusterList. -func (r *AWSClusterList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSClusterList) - - return Convert_v1alpha3_AWSClusterList_To_v1alpha4_AWSClusterList(r, dst, nil) -} - -// ConvertFrom converts the v1alpha4 AWSClusterList receiver to a v1alpha3 AWSClusterList. -func (r *AWSClusterList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSClusterList) - - return Convert_v1alpha4_AWSClusterList_To_v1alpha3_AWSClusterList(src, r, nil) -} - -// ConvertTo converts the v1alpha3 AWSMachine receiver to a v1alpha4 AWSMachine. -func (r *AWSMachine) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSMachine) - if err := Convert_v1alpha3_AWSMachine_To_v1alpha4_AWSMachine(r, dst, nil); err != nil { - return err - } - // Manually restore data. - restored := &v1alpha4.AWSMachine{} - if ok, err := utilconversion.UnmarshalData(r, restored); err != nil || !ok { - return err - } - - RestoreAMIReference(&restored.Spec.AMI, &dst.Spec.AMI) - if restored.Spec.RootVolume != nil { - if dst.Spec.RootVolume == nil { - dst.Spec.RootVolume = &v1alpha4.Volume{} - } - RestoreRootVolume(restored.Spec.RootVolume, dst.Spec.RootVolume) - } - if restored.Spec.NonRootVolumes != nil { - if dst.Spec.NonRootVolumes == nil { - dst.Spec.NonRootVolumes = []v1alpha4.Volume{} - } - restoreNonRootVolumes(restored.Spec.NonRootVolumes, dst.Spec.NonRootVolumes) - } - return nil -} - -// ConvertFrom converts the v1alpha4 AWSMachine receiver to a v1alpha3 AWSMachine. -func (r *AWSMachine) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSMachine) - - if err := Convert_v1alpha4_AWSMachine_To_v1alpha3_AWSMachine(src, r, nil); err != nil { - return err - } - // Preserve Hub data on down-conversion. - if err := utilconversion.MarshalData(src, r); err != nil { - return err - } - return nil -} - -// ConvertTo converts the v1alpha3 AWSMachineList receiver to a v1alpha4 AWSMachineList. -func (r *AWSMachineList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSMachineList) - - return Convert_v1alpha3_AWSMachineList_To_v1alpha4_AWSMachineList(r, dst, nil) -} - -// ConvertFrom converts the v1alpha4 AWSMachineList receiver to a v1alpha3 AWSMachineList. -func (r *AWSMachineList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSMachineList) - - return Convert_v1alpha4_AWSMachineList_To_v1alpha3_AWSMachineList(src, r, nil) -} - -// ConvertTo converts the v1alpha3 AWSMachineTemplate receiver to a v1alpha4 AWSMachineTemplate. -func (r *AWSMachineTemplate) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSMachineTemplate) - if err := Convert_v1alpha3_AWSMachineTemplate_To_v1alpha4_AWSMachineTemplate(r, dst, nil); err != nil { - return err - } - // Manually restore data. - restored := &v1alpha4.AWSMachineTemplate{} - if ok, err := utilconversion.UnmarshalData(r, restored); err != nil || !ok { - return err - } - - RestoreAMIReference(&restored.Spec.Template.Spec.AMI, &dst.Spec.Template.Spec.AMI) - if restored.Spec.Template.Spec.RootVolume != nil { - if dst.Spec.Template.Spec.RootVolume == nil { - dst.Spec.Template.Spec.RootVolume = &v1alpha4.Volume{} - } - RestoreRootVolume(restored.Spec.Template.Spec.RootVolume, dst.Spec.Template.Spec.RootVolume) - } - if restored.Spec.Template.Spec.NonRootVolumes != nil { - if dst.Spec.Template.Spec.NonRootVolumes == nil { - dst.Spec.Template.Spec.NonRootVolumes = []v1alpha4.Volume{} - } - restoreNonRootVolumes(restored.Spec.Template.Spec.NonRootVolumes, dst.Spec.Template.Spec.NonRootVolumes) - } - - return nil -} - -// ConvertFrom converts the v1alpha4 AWSMachineTemplate receiver to a v1alpha3 AWSMachineTemplate. -func (r *AWSMachineTemplate) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSMachineTemplate) - - if err := Convert_v1alpha4_AWSMachineTemplate_To_v1alpha3_AWSMachineTemplate(src, r, nil); err != nil { - return err - } - // Preserve Hub data on down-conversion. - if err := utilconversion.MarshalData(src, r); err != nil { - return err - } - return nil -} - -// ConvertTo converts the v1alpha3 AWSMachineTemplateList receiver to a v1alpha4 AWSMachineTemplateList. -func (r *AWSMachineTemplateList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSMachineTemplateList) - - return Convert_v1alpha3_AWSMachineTemplateList_To_v1alpha4_AWSMachineTemplateList(r, dst, nil) -} - -// ConvertFrom converts the v1alpha4 AWSMachineTemplateList receiver to a v1alpha3 AWSMachineTemplateList. -func (r *AWSMachineTemplateList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSMachineTemplateList) - - return Convert_v1alpha4_AWSMachineTemplateList_To_v1alpha3_AWSMachineTemplateList(src, r, nil) -} - -// ConvertTo converts the v1alpha3 AWSClusterStaticIdentity receiver to a v1alpha4 AWSClusterStaticIdentity. -func (r *AWSClusterStaticIdentity) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSClusterStaticIdentity) - if err := Convert_v1alpha3_AWSClusterStaticIdentity_To_v1alpha4_AWSClusterStaticIdentity(r, dst, nil); err != nil { - return err - } - - dst.Spec.SecretRef = r.Spec.SecretRef.Name - return nil -} - -// ConvertFrom converts the v1alpha4 AWSClusterStaticIdentity receiver to a v1alpha3 AWSClusterStaticIdentity. -func (r *AWSClusterStaticIdentity) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSClusterStaticIdentity) - - if err := Convert_v1alpha4_AWSClusterStaticIdentity_To_v1alpha3_AWSClusterStaticIdentity(src, r, nil); err != nil { - return err - } - - r.Spec.SecretRef.Name = src.Spec.SecretRef - return nil -} - -// ConvertTo converts the v1alpha3 AWSClusterStaticIdentityList receiver to a v1alpha4 AWSClusterStaticIdentityList. -func (r *AWSClusterStaticIdentityList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSClusterStaticIdentityList) - - return Convert_v1alpha3_AWSClusterStaticIdentityList_To_v1alpha4_AWSClusterStaticIdentityList(r, dst, nil) -} - -// ConvertFrom converts the v1alpha4 AWSClusterStaticIdentityList receiver to a v1alpha3 AWSClusterStaticIdentityList. -func (r *AWSClusterStaticIdentityList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSClusterStaticIdentityList) - - return Convert_v1alpha4_AWSClusterStaticIdentityList_To_v1alpha3_AWSClusterStaticIdentityList(src, r, nil) -} - -// ConvertTo converts the v1alpha3 AWSClusterRoleIdentity receiver to a v1alpha4 AWSClusterRoleIdentity. -func (r *AWSClusterRoleIdentity) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSClusterRoleIdentity) - - return Convert_v1alpha3_AWSClusterRoleIdentity_To_v1alpha4_AWSClusterRoleIdentity(r, dst, nil) -} - -// ConvertFrom converts the v1alpha4 AWSClusterRoleIdentity receiver to a v1alpha3 AWSClusterRoleIdentity. -func (r *AWSClusterRoleIdentity) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSClusterRoleIdentity) - - return Convert_v1alpha4_AWSClusterRoleIdentity_To_v1alpha3_AWSClusterRoleIdentity(src, r, nil) -} - -// ConvertTo converts the v1alpha3 AWSClusterRoleIdentityList receiver to a v1alpha4 AWSClusterRoleIdentityList. -func (r *AWSClusterRoleIdentityList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSClusterRoleIdentityList) - - return Convert_v1alpha3_AWSClusterRoleIdentityList_To_v1alpha4_AWSClusterRoleIdentityList(r, dst, nil) -} - -// ConvertFrom converts the v1alpha4 AWSClusterRoleIdentityList receiver to a v1alpha3 AWSClusterRoleIdentityList. -func (r *AWSClusterRoleIdentityList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSClusterRoleIdentityList) - - return Convert_v1alpha4_AWSClusterRoleIdentityList_To_v1alpha3_AWSClusterRoleIdentityList(src, r, nil) -} - -// ConvertTo converts the v1alpha3 AWSClusterControllerIdentity receiver to a v1alpha4 AWSClusterControllerIdentity. -func (r *AWSClusterControllerIdentity) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSClusterControllerIdentity) - - return Convert_v1alpha3_AWSClusterControllerIdentity_To_v1alpha4_AWSClusterControllerIdentity(r, dst, nil) -} - -// ConvertFrom converts the v1alpha4 AWSClusterControllerIdentity receiver to a v1alpha3 AWSClusterControllerIdentity. -func (r *AWSClusterControllerIdentity) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSClusterControllerIdentity) - - return Convert_v1alpha4_AWSClusterControllerIdentity_To_v1alpha3_AWSClusterControllerIdentity(src, r, nil) -} - -// ConvertTo converts the v1alpha3 AWSClusterControllerIdentityList receiver to a v1alpha4 AWSClusterControllerIdentityList. -func (r *AWSClusterControllerIdentityList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSClusterControllerIdentityList) - - return Convert_v1alpha3_AWSClusterControllerIdentityList_To_v1alpha4_AWSClusterControllerIdentityList(r, dst, nil) -} - -// ConvertFrom converts the v1alpha4 AWSClusterControllerIdentityList receiver to a v1alpha3 AWSClusterControllerIdentityList. -func (r *AWSClusterControllerIdentityList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSClusterControllerIdentityList) - - return Convert_v1alpha4_AWSClusterControllerIdentityList_To_v1alpha3_AWSClusterControllerIdentityList(src, r, nil) -} - -// Convert_v1alpha4_Volume_To_v1alpha3_Volume . -func Convert_v1alpha4_Volume_To_v1alpha3_Volume(in *v1alpha4.Volume, out *Volume, s apiconversion.Scope) error { - return autoConvert_v1alpha4_Volume_To_v1alpha3_Volume(in, out, s) -} - -// Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint . -func Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(in *apiv1alpha3.APIEndpoint, out *apiv1alpha4.APIEndpoint, s apiconversion.Scope) error { - return apiv1alpha3.Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(in, out, s) -} - -// Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint . -func Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(in *apiv1alpha4.APIEndpoint, out *apiv1alpha3.APIEndpoint, s apiconversion.Scope) error { - return apiv1alpha3.Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(in, out, s) -} - -// Convert_v1alpha3_AWSClusterStaticIdentitySpec_To_v1alpha4_AWSClusterStaticIdentitySpec . -func Convert_v1alpha3_AWSClusterStaticIdentitySpec_To_v1alpha4_AWSClusterStaticIdentitySpec(in *AWSClusterStaticIdentitySpec, out *v1alpha4.AWSClusterStaticIdentitySpec, s apiconversion.Scope) error { - return autoConvert_v1alpha3_AWSClusterStaticIdentitySpec_To_v1alpha4_AWSClusterStaticIdentitySpec(in, out, s) -} - -// Convert_v1alpha4_AWSClusterStaticIdentitySpec_To_v1alpha3_AWSClusterStaticIdentitySpec . -func Convert_v1alpha4_AWSClusterStaticIdentitySpec_To_v1alpha3_AWSClusterStaticIdentitySpec(in *v1alpha4.AWSClusterStaticIdentitySpec, out *AWSClusterStaticIdentitySpec, s apiconversion.Scope) error { - return autoConvert_v1alpha4_AWSClusterStaticIdentitySpec_To_v1alpha3_AWSClusterStaticIdentitySpec(in, out, s) -} - -// Convert_v1alpha4_AWSMachineSpec_To_v1alpha3_AWSMachineSpec . -func Convert_v1alpha4_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(in *v1alpha4.AWSMachineSpec, out *AWSMachineSpec, s apiconversion.Scope) error { - return autoConvert_v1alpha4_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(in, out, s) -} - -// Convert_v1alpha4_Instance_To_v1alpha3_Instance . -func Convert_v1alpha4_Instance_To_v1alpha3_Instance(in *v1alpha4.Instance, out *Instance, s apiconversion.Scope) error { - return autoConvert_v1alpha4_Instance_To_v1alpha3_Instance(in, out, s) -} - -// Convert_v1alpha3_Network_To_v1alpha4_NetworkStatus is based on the autogenerated function and handles the renaming of the Network struct to NetworkStatus -func Convert_v1alpha3_Network_To_v1alpha4_NetworkStatus(in *Network, out *v1alpha4.NetworkStatus, s apiconversion.Scope) error { - out.SecurityGroups = *(*map[v1alpha4.SecurityGroupRole]v1alpha4.SecurityGroup)(unsafe.Pointer(&in.SecurityGroups)) - if err := Convert_v1alpha3_ClassicELB_To_v1alpha4_ClassicELB(&in.APIServerELB, &out.APIServerELB, s); err != nil { - return err - } - return nil -} - -// Convert_v1alpha4_NetworkStatus_To_v1alpha3_Network is based on the autogenerated function and handles the renaming of the NetworkStatus struct to Network -func Convert_v1alpha4_NetworkStatus_To_v1alpha3_Network(in *v1alpha4.NetworkStatus, out *Network, s apiconversion.Scope) error { - out.SecurityGroups = *(*map[SecurityGroupRole]SecurityGroup)(unsafe.Pointer(&in.SecurityGroups)) - if err := Convert_v1alpha4_ClassicELB_To_v1alpha3_ClassicELB(&in.APIServerELB, &out.APIServerELB, s); err != nil { - return err - } - return nil -} - -// Manually restore the instance root device data. -// Assumes restored and dst are non-nil. -func restoreInstance(restored, dst *v1alpha4.Instance) { - dst.VolumeIDs = restored.VolumeIDs - - if restored.RootVolume != nil { - if dst.RootVolume == nil { - dst.RootVolume = &v1alpha4.Volume{} - } - RestoreRootVolume(restored.RootVolume, dst.RootVolume) - } - - if restored.NonRootVolumes != nil { - if dst.NonRootVolumes == nil { - dst.NonRootVolumes = []v1alpha4.Volume{} - } - restoreNonRootVolumes(restored.NonRootVolumes, dst.NonRootVolumes) - } -} - -// Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AMIReference is a conversion function. -func Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AMIReference(in *AWSResourceReference, out *v1alpha4.AMIReference, s apiconversion.Scope) error { - out.ID = (*string)(unsafe.Pointer(in.ID)) - return nil -} - -// Convert_v1alpha4_AMIReference_To_v1alpha3_AWSResourceReference is a conversion function. -func Convert_v1alpha4_AMIReference_To_v1alpha3_AWSResourceReference(in *v1alpha4.AMIReference, out *AWSResourceReference, s apiconversion.Scope) error { - out.ID = (*string)(unsafe.Pointer(in.ID)) - return nil -} - -// RestoreAMIReference manually restore the EKSOptimizedLookupType for AWSMachine and AWSMachineTemplate -// Assumes both restored and dst are non-nil. -func RestoreAMIReference(restored, dst *v1alpha4.AMIReference) { - if restored.EKSOptimizedLookupType == nil { - return - } - dst.EKSOptimizedLookupType = restored.EKSOptimizedLookupType -} - -// restoreNonRootVolumes manually restores the non-root volumes -// Assumes both restoredVolumes and dstVolumes are non-nil. -func restoreNonRootVolumes(restoredVolumes, dstVolumes []v1alpha4.Volume) { - // restoring the nonrootvolumes which are missing in dstVolumes - // restoring dstVolumes[i].Encrypted to nil in order to avoid v1alpha4 --> v1alpha3 --> v1alpha4 round trip errors - for i := range restoredVolumes { - if restoredVolumes[i].Encrypted == nil { - if len(dstVolumes) <= i { - dstVolumes = append(dstVolumes, restoredVolumes[i]) - } else { - dstVolumes[i].Encrypted = nil - } - } - dstVolumes[i].Throughput = restoredVolumes[i].Throughput - } -} - -// RestoreRootVolume manually restores the root volumes. -// Assumes both restored and dst are non-nil. -// Volume.Encrypted type changed from bool in v1alpha3 to *bool in v1alpha4 -// Volume.Encrypted value as nil/&false in v1alpha4 will convert to false in v1alpha3 by auto-conversion, so restoring it to nil in order to avoid v1alpha4 --> v1alpha3 --> v1alpha4 round trip errors -func RestoreRootVolume(restored, dst *v1alpha4.Volume) { - if dst.Encrypted == pointer.BoolPtr(true) { - return - } - if restored.Encrypted == nil { - dst.Encrypted = nil - } - dst.Throughput = restored.Throughput -} diff --git a/api/v1alpha3/conversion_test.go b/api/v1alpha3/conversion_test.go index e178caab81..77817afdc9 100644 --- a/api/v1alpha3/conversion_test.go +++ b/api/v1alpha3/conversion_test.go @@ -25,7 +25,7 @@ import ( "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" runtime "k8s.io/apimachinery/pkg/runtime" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" - v1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" ) @@ -40,14 +40,14 @@ func fuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} { func AWSClusterStaticIdentityFuzzer(obj *AWSClusterStaticIdentity, c fuzz.Continue) { c.FuzzNoCustom(obj) - // AWSClusterStaticIdentity.Spec.SecretRef.Namespace has been removed in v1alpha4, so setting it to nil in order to avoid v1alpha3 --> v1alpha4 --> v1alpha3 round trip errors. + // AWSClusterStaticIdentity.Spec.SecretRef.Namespace has been removed in v1beta1, so setting it to nil in order to avoid v1alpha3 --> --> v1alpha3 round trip errors. obj.Spec.SecretRef.Namespace = "" } func AWSMachineFuzzer(obj *AWSMachine, c fuzz.Continue) { c.FuzzNoCustom(obj) - // AWSMachine.Spec.AMI.ARN and AWSMachine.Spec.AMI.Filters has been removed in v1alpha4, so setting it to nil in order to avoid v1alpha3 --> v1alpha4 --> v1alpha3 round trip errors. + // AWSMachine.Spec.AMI.ARN and AWSMachine.Spec.AMI.Filters has been removed in v1beta1, so setting it to nil in order to avoid v1alpha3 --> --> v1alpha3 round trip errors. obj.Spec.AMI.ARN = nil obj.Spec.AMI.Filters = nil } @@ -55,7 +55,7 @@ func AWSMachineFuzzer(obj *AWSMachine, c fuzz.Continue) { func AWSMachineTemplateFuzzer(obj *AWSMachineTemplate, c fuzz.Continue) { c.FuzzNoCustom(obj) - // AWSMachineTemplate.Spec.Template.Spec.AMI.ARN and AWSMachineTemplate.Spec.Template.Spec.AMI.Filters has been removed in v1alpha4, so setting it to nil in order to avoid v1alpha3 --> v1alpha4 --> v1alpha3 round trip errors. + // AWSMachineTemplate.Spec.Template.Spec.AMI.ARN and AWSMachineTemplate.Spec.Template.Spec.AMI.Filters has been removed in v1beta1, so setting it to nil in order to avoid v1alpha3 --> v1beta1 --> v1alpha3 round trip errors. obj.Spec.Template.Spec.AMI.ARN = nil obj.Spec.Template.Spec.AMI.Filters = nil } @@ -64,44 +64,44 @@ func TestFuzzyConversion(t *testing.T) { g := NewWithT(t) scheme := runtime.NewScheme() g.Expect(AddToScheme(scheme)).To(Succeed()) - g.Expect(v1alpha4.AddToScheme(scheme)).To(Succeed()) + g.Expect(v1beta1.AddToScheme(scheme)).To(Succeed()) t.Run("for AWSCluster", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ Scheme: scheme, - Hub: &v1alpha4.AWSCluster{}, + Hub: &v1beta1.AWSCluster{}, Spoke: &AWSCluster{}, })) t.Run("for AWSMachine", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ Scheme: scheme, - Hub: &v1alpha4.AWSMachine{}, + Hub: &v1beta1.AWSMachine{}, Spoke: &AWSMachine{}, FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs}, })) t.Run("for AWSMachineTemplate", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ Scheme: scheme, - Hub: &v1alpha4.AWSMachineTemplate{}, + Hub: &v1beta1.AWSMachineTemplate{}, Spoke: &AWSMachineTemplate{}, FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs}, })) t.Run("for AWSClusterStaticIdentity", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ Scheme: scheme, - Hub: &v1alpha4.AWSClusterStaticIdentity{}, + Hub: &v1beta1.AWSClusterStaticIdentity{}, Spoke: &AWSClusterStaticIdentity{}, FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs}, })) t.Run("for AWSClusterControllerIdentity", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ Scheme: scheme, - Hub: &v1alpha4.AWSClusterControllerIdentity{}, + Hub: &v1beta1.AWSClusterControllerIdentity{}, Spoke: &AWSClusterControllerIdentity{}, })) t.Run("for AWSClusterRoleIdentity", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ Scheme: scheme, - Hub: &v1alpha4.AWSClusterRoleIdentity{}, + Hub: &v1beta1.AWSClusterRoleIdentity{}, Spoke: &AWSClusterRoleIdentity{}, })) } diff --git a/api/v1alpha3/defaults.go b/api/v1alpha3/defaults.go index 2c6e539811..c0b0851263 100644 --- a/api/v1alpha3/defaults.go +++ b/api/v1alpha3/defaults.go @@ -16,8 +16,6 @@ limitations under the License. package v1alpha3 -// TODO (richardcase): get this working with defaulter-gen - // SetDefaults_Bastion is used by defaulter-gen. func SetDefaults_Bastion(obj *Bastion) { //nolint:golint,stylecheck // Default to allow open access to the bastion host if no CIDR Blocks have been set diff --git a/api/v1alpha3/doc.go b/api/v1alpha3/doc.go index 8c6221959c..8d7bd1bc96 100644 --- a/api/v1alpha3/doc.go +++ b/api/v1alpha3/doc.go @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4 +// Package v1alpha3 contains the v1alpha3 API implementation. +// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-aws/api/v1beta1 package v1alpha3 diff --git a/api/v1alpha3/tags.go b/api/v1alpha3/tags.go index 5739616750..8330f87f4d 100644 --- a/api/v1alpha3/tags.go +++ b/api/v1alpha3/tags.go @@ -21,7 +21,7 @@ import ( "reflect" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" ) // Tags defines a map of tags. @@ -168,7 +168,7 @@ type BuildParams struct { // WithMachineName tags the namespaced machine name // The machine name will be tagged with key "MachineName". -func (b BuildParams) WithMachineName(m *clusterv1.Machine) BuildParams { +func (b BuildParams) WithMachineName(m *clusterv1alpha3.Machine) BuildParams { machineNamespacedName := types.NamespacedName{Namespace: m.Namespace, Name: m.Name} b.Additional[MachineNameTagKey] = machineNamespacedName.String() return b diff --git a/api/v1alpha3/types.go b/api/v1alpha3/types.go index 4704e690d8..80fd2f9f69 100644 --- a/api/v1alpha3/types.go +++ b/api/v1alpha3/types.go @@ -22,7 +22,7 @@ import ( "time" "k8s.io/apimachinery/pkg/util/sets" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" ) const ( @@ -638,7 +638,7 @@ type Instance struct { IAMProfile string `json:"iamProfile,omitempty"` // Addresses contains the AWS instance associated addresses. - Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"` + Addresses []clusterv1alpha3.MachineAddress `json:"addresses,omitempty"` // The private IPv4 address assigned to the instance. PrivateIP *string `json:"privateIp,omitempty"` diff --git a/api/v1alpha3/webhook_suite_test.go b/api/v1alpha3/webhook_suite_test.go index 41e24738d5..1bef368694 100644 --- a/api/v1alpha3/webhook_suite_test.go +++ b/api/v1alpha3/webhook_suite_test.go @@ -22,7 +22,7 @@ import ( "path" "testing" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" diff --git a/api/v1alpha3/zz_generated.conversion.go b/api/v1alpha3/zz_generated.conversion.go index b0edbdc62d..cde9966eeb 100644 --- a/api/v1alpha3/zz_generated.conversion.go +++ b/api/v1alpha3/zz_generated.conversion.go @@ -1,4 +1,4 @@ -// +build !ignore_autogenerated_core_v1alpha3 +// +build !ignore_autogenerated_conversions /* Copyright The Kubernetes Authors. @@ -27,9 +27,9 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - v1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" apiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" errors "sigs.k8s.io/cluster-api/errors" ) @@ -40,630 +40,620 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*AWSCluster)(nil), (*v1alpha4.AWSCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSCluster_To_v1alpha4_AWSCluster(a.(*AWSCluster), b.(*v1alpha4.AWSCluster), scope) + if err := s.AddGeneratedConversionFunc((*AWSCluster)(nil), (*v1beta1.AWSCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSCluster_To_v1beta1_AWSCluster(a.(*AWSCluster), b.(*v1beta1.AWSCluster), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSCluster)(nil), (*AWSCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSCluster_To_v1alpha3_AWSCluster(a.(*v1alpha4.AWSCluster), b.(*AWSCluster), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSCluster)(nil), (*AWSCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSCluster_To_v1alpha3_AWSCluster(a.(*v1beta1.AWSCluster), b.(*AWSCluster), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSClusterControllerIdentity)(nil), (*v1alpha4.AWSClusterControllerIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSClusterControllerIdentity_To_v1alpha4_AWSClusterControllerIdentity(a.(*AWSClusterControllerIdentity), b.(*v1alpha4.AWSClusterControllerIdentity), scope) + if err := s.AddGeneratedConversionFunc((*AWSClusterControllerIdentity)(nil), (*v1beta1.AWSClusterControllerIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity(a.(*AWSClusterControllerIdentity), b.(*v1beta1.AWSClusterControllerIdentity), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSClusterControllerIdentity)(nil), (*AWSClusterControllerIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSClusterControllerIdentity_To_v1alpha3_AWSClusterControllerIdentity(a.(*v1alpha4.AWSClusterControllerIdentity), b.(*AWSClusterControllerIdentity), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterControllerIdentity)(nil), (*AWSClusterControllerIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterControllerIdentity_To_v1alpha3_AWSClusterControllerIdentity(a.(*v1beta1.AWSClusterControllerIdentity), b.(*AWSClusterControllerIdentity), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSClusterControllerIdentityList)(nil), (*v1alpha4.AWSClusterControllerIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSClusterControllerIdentityList_To_v1alpha4_AWSClusterControllerIdentityList(a.(*AWSClusterControllerIdentityList), b.(*v1alpha4.AWSClusterControllerIdentityList), scope) + if err := s.AddGeneratedConversionFunc((*AWSClusterControllerIdentityList)(nil), (*v1beta1.AWSClusterControllerIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList(a.(*AWSClusterControllerIdentityList), b.(*v1beta1.AWSClusterControllerIdentityList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSClusterControllerIdentityList)(nil), (*AWSClusterControllerIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSClusterControllerIdentityList_To_v1alpha3_AWSClusterControllerIdentityList(a.(*v1alpha4.AWSClusterControllerIdentityList), b.(*AWSClusterControllerIdentityList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterControllerIdentityList)(nil), (*AWSClusterControllerIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterControllerIdentityList_To_v1alpha3_AWSClusterControllerIdentityList(a.(*v1beta1.AWSClusterControllerIdentityList), b.(*AWSClusterControllerIdentityList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSClusterControllerIdentitySpec)(nil), (*v1alpha4.AWSClusterControllerIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSClusterControllerIdentitySpec_To_v1alpha4_AWSClusterControllerIdentitySpec(a.(*AWSClusterControllerIdentitySpec), b.(*v1alpha4.AWSClusterControllerIdentitySpec), scope) + if err := s.AddGeneratedConversionFunc((*AWSClusterControllerIdentitySpec)(nil), (*v1beta1.AWSClusterControllerIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec(a.(*AWSClusterControllerIdentitySpec), b.(*v1beta1.AWSClusterControllerIdentitySpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSClusterControllerIdentitySpec)(nil), (*AWSClusterControllerIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSClusterControllerIdentitySpec_To_v1alpha3_AWSClusterControllerIdentitySpec(a.(*v1alpha4.AWSClusterControllerIdentitySpec), b.(*AWSClusterControllerIdentitySpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterControllerIdentitySpec)(nil), (*AWSClusterControllerIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterControllerIdentitySpec_To_v1alpha3_AWSClusterControllerIdentitySpec(a.(*v1beta1.AWSClusterControllerIdentitySpec), b.(*AWSClusterControllerIdentitySpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSClusterIdentitySpec)(nil), (*v1alpha4.AWSClusterIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSClusterIdentitySpec_To_v1alpha4_AWSClusterIdentitySpec(a.(*AWSClusterIdentitySpec), b.(*v1alpha4.AWSClusterIdentitySpec), scope) + if err := s.AddGeneratedConversionFunc((*AWSClusterIdentitySpec)(nil), (*v1beta1.AWSClusterIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(a.(*AWSClusterIdentitySpec), b.(*v1beta1.AWSClusterIdentitySpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSClusterIdentitySpec)(nil), (*AWSClusterIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSClusterIdentitySpec_To_v1alpha3_AWSClusterIdentitySpec(a.(*v1alpha4.AWSClusterIdentitySpec), b.(*AWSClusterIdentitySpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterIdentitySpec)(nil), (*AWSClusterIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterIdentitySpec_To_v1alpha3_AWSClusterIdentitySpec(a.(*v1beta1.AWSClusterIdentitySpec), b.(*AWSClusterIdentitySpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSClusterList)(nil), (*v1alpha4.AWSClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSClusterList_To_v1alpha4_AWSClusterList(a.(*AWSClusterList), b.(*v1alpha4.AWSClusterList), scope) + if err := s.AddGeneratedConversionFunc((*AWSClusterList)(nil), (*v1beta1.AWSClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSClusterList_To_v1beta1_AWSClusterList(a.(*AWSClusterList), b.(*v1beta1.AWSClusterList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSClusterList)(nil), (*AWSClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSClusterList_To_v1alpha3_AWSClusterList(a.(*v1alpha4.AWSClusterList), b.(*AWSClusterList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterList)(nil), (*AWSClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterList_To_v1alpha3_AWSClusterList(a.(*v1beta1.AWSClusterList), b.(*AWSClusterList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSClusterRoleIdentity)(nil), (*v1alpha4.AWSClusterRoleIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSClusterRoleIdentity_To_v1alpha4_AWSClusterRoleIdentity(a.(*AWSClusterRoleIdentity), b.(*v1alpha4.AWSClusterRoleIdentity), scope) + if err := s.AddGeneratedConversionFunc((*AWSClusterRoleIdentity)(nil), (*v1beta1.AWSClusterRoleIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity(a.(*AWSClusterRoleIdentity), b.(*v1beta1.AWSClusterRoleIdentity), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSClusterRoleIdentity)(nil), (*AWSClusterRoleIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSClusterRoleIdentity_To_v1alpha3_AWSClusterRoleIdentity(a.(*v1alpha4.AWSClusterRoleIdentity), b.(*AWSClusterRoleIdentity), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterRoleIdentity)(nil), (*AWSClusterRoleIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterRoleIdentity_To_v1alpha3_AWSClusterRoleIdentity(a.(*v1beta1.AWSClusterRoleIdentity), b.(*AWSClusterRoleIdentity), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSClusterRoleIdentityList)(nil), (*v1alpha4.AWSClusterRoleIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSClusterRoleIdentityList_To_v1alpha4_AWSClusterRoleIdentityList(a.(*AWSClusterRoleIdentityList), b.(*v1alpha4.AWSClusterRoleIdentityList), scope) + if err := s.AddGeneratedConversionFunc((*AWSClusterRoleIdentityList)(nil), (*v1beta1.AWSClusterRoleIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList(a.(*AWSClusterRoleIdentityList), b.(*v1beta1.AWSClusterRoleIdentityList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSClusterRoleIdentityList)(nil), (*AWSClusterRoleIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSClusterRoleIdentityList_To_v1alpha3_AWSClusterRoleIdentityList(a.(*v1alpha4.AWSClusterRoleIdentityList), b.(*AWSClusterRoleIdentityList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterRoleIdentityList)(nil), (*AWSClusterRoleIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterRoleIdentityList_To_v1alpha3_AWSClusterRoleIdentityList(a.(*v1beta1.AWSClusterRoleIdentityList), b.(*AWSClusterRoleIdentityList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSClusterRoleIdentitySpec)(nil), (*v1alpha4.AWSClusterRoleIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSClusterRoleIdentitySpec_To_v1alpha4_AWSClusterRoleIdentitySpec(a.(*AWSClusterRoleIdentitySpec), b.(*v1alpha4.AWSClusterRoleIdentitySpec), scope) + if err := s.AddGeneratedConversionFunc((*AWSClusterRoleIdentitySpec)(nil), (*v1beta1.AWSClusterRoleIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec(a.(*AWSClusterRoleIdentitySpec), b.(*v1beta1.AWSClusterRoleIdentitySpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSClusterRoleIdentitySpec)(nil), (*AWSClusterRoleIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSClusterRoleIdentitySpec_To_v1alpha3_AWSClusterRoleIdentitySpec(a.(*v1alpha4.AWSClusterRoleIdentitySpec), b.(*AWSClusterRoleIdentitySpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterRoleIdentitySpec)(nil), (*AWSClusterRoleIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterRoleIdentitySpec_To_v1alpha3_AWSClusterRoleIdentitySpec(a.(*v1beta1.AWSClusterRoleIdentitySpec), b.(*AWSClusterRoleIdentitySpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSClusterSpec)(nil), (*v1alpha4.AWSClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSClusterSpec_To_v1alpha4_AWSClusterSpec(a.(*AWSClusterSpec), b.(*v1alpha4.AWSClusterSpec), scope) + if err := s.AddGeneratedConversionFunc((*AWSClusterSpec)(nil), (*v1beta1.AWSClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSClusterSpec_To_v1beta1_AWSClusterSpec(a.(*AWSClusterSpec), b.(*v1beta1.AWSClusterSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSClusterSpec)(nil), (*AWSClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSClusterSpec_To_v1alpha3_AWSClusterSpec(a.(*v1alpha4.AWSClusterSpec), b.(*AWSClusterSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterSpec)(nil), (*AWSClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterSpec_To_v1alpha3_AWSClusterSpec(a.(*v1beta1.AWSClusterSpec), b.(*AWSClusterSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSClusterStaticIdentity)(nil), (*v1alpha4.AWSClusterStaticIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSClusterStaticIdentity_To_v1alpha4_AWSClusterStaticIdentity(a.(*AWSClusterStaticIdentity), b.(*v1alpha4.AWSClusterStaticIdentity), scope) + if err := s.AddGeneratedConversionFunc((*AWSClusterStaticIdentity)(nil), (*v1beta1.AWSClusterStaticIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity(a.(*AWSClusterStaticIdentity), b.(*v1beta1.AWSClusterStaticIdentity), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSClusterStaticIdentity)(nil), (*AWSClusterStaticIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSClusterStaticIdentity_To_v1alpha3_AWSClusterStaticIdentity(a.(*v1alpha4.AWSClusterStaticIdentity), b.(*AWSClusterStaticIdentity), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterStaticIdentity)(nil), (*AWSClusterStaticIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterStaticIdentity_To_v1alpha3_AWSClusterStaticIdentity(a.(*v1beta1.AWSClusterStaticIdentity), b.(*AWSClusterStaticIdentity), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSClusterStaticIdentityList)(nil), (*v1alpha4.AWSClusterStaticIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSClusterStaticIdentityList_To_v1alpha4_AWSClusterStaticIdentityList(a.(*AWSClusterStaticIdentityList), b.(*v1alpha4.AWSClusterStaticIdentityList), scope) + if err := s.AddGeneratedConversionFunc((*AWSClusterStaticIdentityList)(nil), (*v1beta1.AWSClusterStaticIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList(a.(*AWSClusterStaticIdentityList), b.(*v1beta1.AWSClusterStaticIdentityList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSClusterStaticIdentityList)(nil), (*AWSClusterStaticIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSClusterStaticIdentityList_To_v1alpha3_AWSClusterStaticIdentityList(a.(*v1alpha4.AWSClusterStaticIdentityList), b.(*AWSClusterStaticIdentityList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterStaticIdentityList)(nil), (*AWSClusterStaticIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterStaticIdentityList_To_v1alpha3_AWSClusterStaticIdentityList(a.(*v1beta1.AWSClusterStaticIdentityList), b.(*AWSClusterStaticIdentityList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSClusterStatus)(nil), (*v1alpha4.AWSClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSClusterStatus_To_v1alpha4_AWSClusterStatus(a.(*AWSClusterStatus), b.(*v1alpha4.AWSClusterStatus), scope) + if err := s.AddGeneratedConversionFunc((*AWSClusterStatus)(nil), (*v1beta1.AWSClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSClusterStatus_To_v1beta1_AWSClusterStatus(a.(*AWSClusterStatus), b.(*v1beta1.AWSClusterStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSClusterStatus)(nil), (*AWSClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSClusterStatus_To_v1alpha3_AWSClusterStatus(a.(*v1alpha4.AWSClusterStatus), b.(*AWSClusterStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterStatus)(nil), (*AWSClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterStatus_To_v1alpha3_AWSClusterStatus(a.(*v1beta1.AWSClusterStatus), b.(*AWSClusterStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSIdentityReference)(nil), (*v1alpha4.AWSIdentityReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSIdentityReference_To_v1alpha4_AWSIdentityReference(a.(*AWSIdentityReference), b.(*v1alpha4.AWSIdentityReference), scope) + if err := s.AddGeneratedConversionFunc((*AWSIdentityReference)(nil), (*v1beta1.AWSIdentityReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSIdentityReference_To_v1beta1_AWSIdentityReference(a.(*AWSIdentityReference), b.(*v1beta1.AWSIdentityReference), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSIdentityReference)(nil), (*AWSIdentityReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSIdentityReference_To_v1alpha3_AWSIdentityReference(a.(*v1alpha4.AWSIdentityReference), b.(*AWSIdentityReference), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSIdentityReference)(nil), (*AWSIdentityReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSIdentityReference_To_v1alpha3_AWSIdentityReference(a.(*v1beta1.AWSIdentityReference), b.(*AWSIdentityReference), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSLoadBalancerSpec)(nil), (*v1alpha4.AWSLoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSLoadBalancerSpec_To_v1alpha4_AWSLoadBalancerSpec(a.(*AWSLoadBalancerSpec), b.(*v1alpha4.AWSLoadBalancerSpec), scope) + if err := s.AddGeneratedConversionFunc((*AWSLoadBalancerSpec)(nil), (*v1beta1.AWSLoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSLoadBalancerSpec_To_v1beta1_AWSLoadBalancerSpec(a.(*AWSLoadBalancerSpec), b.(*v1beta1.AWSLoadBalancerSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSLoadBalancerSpec)(nil), (*AWSLoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSLoadBalancerSpec_To_v1alpha3_AWSLoadBalancerSpec(a.(*v1alpha4.AWSLoadBalancerSpec), b.(*AWSLoadBalancerSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSLoadBalancerSpec)(nil), (*AWSLoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSLoadBalancerSpec_To_v1alpha3_AWSLoadBalancerSpec(a.(*v1beta1.AWSLoadBalancerSpec), b.(*AWSLoadBalancerSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSMachine)(nil), (*v1alpha4.AWSMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSMachine_To_v1alpha4_AWSMachine(a.(*AWSMachine), b.(*v1alpha4.AWSMachine), scope) + if err := s.AddGeneratedConversionFunc((*AWSMachine)(nil), (*v1beta1.AWSMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSMachine_To_v1beta1_AWSMachine(a.(*AWSMachine), b.(*v1beta1.AWSMachine), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSMachine)(nil), (*AWSMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSMachine_To_v1alpha3_AWSMachine(a.(*v1alpha4.AWSMachine), b.(*AWSMachine), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachine)(nil), (*AWSMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachine_To_v1alpha3_AWSMachine(a.(*v1beta1.AWSMachine), b.(*AWSMachine), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSMachineList)(nil), (*v1alpha4.AWSMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSMachineList_To_v1alpha4_AWSMachineList(a.(*AWSMachineList), b.(*v1alpha4.AWSMachineList), scope) + if err := s.AddGeneratedConversionFunc((*AWSMachineList)(nil), (*v1beta1.AWSMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSMachineList_To_v1beta1_AWSMachineList(a.(*AWSMachineList), b.(*v1beta1.AWSMachineList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSMachineList)(nil), (*AWSMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSMachineList_To_v1alpha3_AWSMachineList(a.(*v1alpha4.AWSMachineList), b.(*AWSMachineList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachineList)(nil), (*AWSMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachineList_To_v1alpha3_AWSMachineList(a.(*v1beta1.AWSMachineList), b.(*AWSMachineList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSMachineSpec)(nil), (*v1alpha4.AWSMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSMachineSpec_To_v1alpha4_AWSMachineSpec(a.(*AWSMachineSpec), b.(*v1alpha4.AWSMachineSpec), scope) + if err := s.AddGeneratedConversionFunc((*AWSMachineSpec)(nil), (*v1beta1.AWSMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSMachineSpec_To_v1beta1_AWSMachineSpec(a.(*AWSMachineSpec), b.(*v1beta1.AWSMachineSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSMachineStatus)(nil), (*v1alpha4.AWSMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSMachineStatus_To_v1alpha4_AWSMachineStatus(a.(*AWSMachineStatus), b.(*v1alpha4.AWSMachineStatus), scope) + if err := s.AddGeneratedConversionFunc((*AWSMachineStatus)(nil), (*v1beta1.AWSMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSMachineStatus_To_v1beta1_AWSMachineStatus(a.(*AWSMachineStatus), b.(*v1beta1.AWSMachineStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSMachineStatus)(nil), (*AWSMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSMachineStatus_To_v1alpha3_AWSMachineStatus(a.(*v1alpha4.AWSMachineStatus), b.(*AWSMachineStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachineStatus)(nil), (*AWSMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachineStatus_To_v1alpha3_AWSMachineStatus(a.(*v1beta1.AWSMachineStatus), b.(*AWSMachineStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSMachineTemplate)(nil), (*v1alpha4.AWSMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSMachineTemplate_To_v1alpha4_AWSMachineTemplate(a.(*AWSMachineTemplate), b.(*v1alpha4.AWSMachineTemplate), scope) + if err := s.AddGeneratedConversionFunc((*AWSMachineTemplate)(nil), (*v1beta1.AWSMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(a.(*AWSMachineTemplate), b.(*v1beta1.AWSMachineTemplate), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSMachineTemplate)(nil), (*AWSMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSMachineTemplate_To_v1alpha3_AWSMachineTemplate(a.(*v1alpha4.AWSMachineTemplate), b.(*AWSMachineTemplate), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachineTemplate)(nil), (*AWSMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachineTemplate_To_v1alpha3_AWSMachineTemplate(a.(*v1beta1.AWSMachineTemplate), b.(*AWSMachineTemplate), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSMachineTemplateList)(nil), (*v1alpha4.AWSMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSMachineTemplateList_To_v1alpha4_AWSMachineTemplateList(a.(*AWSMachineTemplateList), b.(*v1alpha4.AWSMachineTemplateList), scope) + if err := s.AddGeneratedConversionFunc((*AWSMachineTemplateList)(nil), (*v1beta1.AWSMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList(a.(*AWSMachineTemplateList), b.(*v1beta1.AWSMachineTemplateList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSMachineTemplateList)(nil), (*AWSMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSMachineTemplateList_To_v1alpha3_AWSMachineTemplateList(a.(*v1alpha4.AWSMachineTemplateList), b.(*AWSMachineTemplateList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachineTemplateList)(nil), (*AWSMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachineTemplateList_To_v1alpha3_AWSMachineTemplateList(a.(*v1beta1.AWSMachineTemplateList), b.(*AWSMachineTemplateList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSMachineTemplateResource)(nil), (*v1alpha4.AWSMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSMachineTemplateResource_To_v1alpha4_AWSMachineTemplateResource(a.(*AWSMachineTemplateResource), b.(*v1alpha4.AWSMachineTemplateResource), scope) + if err := s.AddGeneratedConversionFunc((*AWSMachineTemplateResource)(nil), (*v1beta1.AWSMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource(a.(*AWSMachineTemplateResource), b.(*v1beta1.AWSMachineTemplateResource), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSMachineTemplateResource)(nil), (*AWSMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSMachineTemplateResource_To_v1alpha3_AWSMachineTemplateResource(a.(*v1alpha4.AWSMachineTemplateResource), b.(*AWSMachineTemplateResource), scope) + if err := s.AddGeneratedConversionFunc((*AWSMachineTemplateSpec)(nil), (*v1beta1.AWSMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec(a.(*AWSMachineTemplateSpec), b.(*v1beta1.AWSMachineTemplateSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSMachineTemplateSpec)(nil), (*v1alpha4.AWSMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSMachineTemplateSpec_To_v1alpha4_AWSMachineTemplateSpec(a.(*AWSMachineTemplateSpec), b.(*v1alpha4.AWSMachineTemplateSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachineTemplateSpec)(nil), (*AWSMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachineTemplateSpec_To_v1alpha3_AWSMachineTemplateSpec(a.(*v1beta1.AWSMachineTemplateSpec), b.(*AWSMachineTemplateSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSMachineTemplateSpec)(nil), (*AWSMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSMachineTemplateSpec_To_v1alpha3_AWSMachineTemplateSpec(a.(*v1alpha4.AWSMachineTemplateSpec), b.(*AWSMachineTemplateSpec), scope) + if err := s.AddGeneratedConversionFunc((*AWSResourceReference)(nil), (*v1beta1.AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSResourceReference_To_v1beta1_AWSResourceReference(a.(*AWSResourceReference), b.(*v1beta1.AWSResourceReference), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSResourceReference)(nil), (*v1alpha4.AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AWSResourceReference(a.(*AWSResourceReference), b.(*v1alpha4.AWSResourceReference), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSResourceReference)(nil), (*AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSResourceReference_To_v1alpha3_AWSResourceReference(a.(*v1beta1.AWSResourceReference), b.(*AWSResourceReference), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSResourceReference)(nil), (*AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSResourceReference_To_v1alpha3_AWSResourceReference(a.(*v1alpha4.AWSResourceReference), b.(*AWSResourceReference), scope) + if err := s.AddGeneratedConversionFunc((*AWSRoleSpec)(nil), (*v1beta1.AWSRoleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSRoleSpec_To_v1beta1_AWSRoleSpec(a.(*AWSRoleSpec), b.(*v1beta1.AWSRoleSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSRoleSpec)(nil), (*v1alpha4.AWSRoleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSRoleSpec_To_v1alpha4_AWSRoleSpec(a.(*AWSRoleSpec), b.(*v1alpha4.AWSRoleSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSRoleSpec)(nil), (*AWSRoleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSRoleSpec_To_v1alpha3_AWSRoleSpec(a.(*v1beta1.AWSRoleSpec), b.(*AWSRoleSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSRoleSpec)(nil), (*AWSRoleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSRoleSpec_To_v1alpha3_AWSRoleSpec(a.(*v1alpha4.AWSRoleSpec), b.(*AWSRoleSpec), scope) + if err := s.AddGeneratedConversionFunc((*AllowedNamespaces)(nil), (*v1beta1.AllowedNamespaces)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AllowedNamespaces_To_v1beta1_AllowedNamespaces(a.(*AllowedNamespaces), b.(*v1beta1.AllowedNamespaces), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AllowedNamespaces)(nil), (*v1alpha4.AllowedNamespaces)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AllowedNamespaces_To_v1alpha4_AllowedNamespaces(a.(*AllowedNamespaces), b.(*v1alpha4.AllowedNamespaces), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AllowedNamespaces)(nil), (*AllowedNamespaces)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AllowedNamespaces_To_v1alpha3_AllowedNamespaces(a.(*v1beta1.AllowedNamespaces), b.(*AllowedNamespaces), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AllowedNamespaces)(nil), (*AllowedNamespaces)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AllowedNamespaces_To_v1alpha3_AllowedNamespaces(a.(*v1alpha4.AllowedNamespaces), b.(*AllowedNamespaces), scope) + if err := s.AddGeneratedConversionFunc((*Bastion)(nil), (*v1beta1.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Bastion_To_v1beta1_Bastion(a.(*Bastion), b.(*v1beta1.Bastion), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Bastion)(nil), (*v1alpha4.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Bastion_To_v1alpha4_Bastion(a.(*Bastion), b.(*v1alpha4.Bastion), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.Bastion)(nil), (*Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Bastion_To_v1alpha3_Bastion(a.(*v1beta1.Bastion), b.(*Bastion), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.Bastion)(nil), (*Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Bastion_To_v1alpha3_Bastion(a.(*v1alpha4.Bastion), b.(*Bastion), scope) + if err := s.AddGeneratedConversionFunc((*BuildParams)(nil), (*v1beta1.BuildParams)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_BuildParams_To_v1beta1_BuildParams(a.(*BuildParams), b.(*v1beta1.BuildParams), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*BuildParams)(nil), (*v1alpha4.BuildParams)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_BuildParams_To_v1alpha4_BuildParams(a.(*BuildParams), b.(*v1alpha4.BuildParams), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.BuildParams)(nil), (*BuildParams)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_BuildParams_To_v1alpha3_BuildParams(a.(*v1beta1.BuildParams), b.(*BuildParams), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.BuildParams)(nil), (*BuildParams)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_BuildParams_To_v1alpha3_BuildParams(a.(*v1alpha4.BuildParams), b.(*BuildParams), scope) + if err := s.AddGeneratedConversionFunc((*CNIIngressRule)(nil), (*v1beta1.CNIIngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_CNIIngressRule_To_v1beta1_CNIIngressRule(a.(*CNIIngressRule), b.(*v1beta1.CNIIngressRule), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*CNIIngressRule)(nil), (*v1alpha4.CNIIngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_CNIIngressRule_To_v1alpha4_CNIIngressRule(a.(*CNIIngressRule), b.(*v1alpha4.CNIIngressRule), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.CNIIngressRule)(nil), (*CNIIngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_CNIIngressRule_To_v1alpha3_CNIIngressRule(a.(*v1beta1.CNIIngressRule), b.(*CNIIngressRule), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.CNIIngressRule)(nil), (*CNIIngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_CNIIngressRule_To_v1alpha3_CNIIngressRule(a.(*v1alpha4.CNIIngressRule), b.(*CNIIngressRule), scope) + if err := s.AddGeneratedConversionFunc((*CNISpec)(nil), (*v1beta1.CNISpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_CNISpec_To_v1beta1_CNISpec(a.(*CNISpec), b.(*v1beta1.CNISpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*CNISpec)(nil), (*v1alpha4.CNISpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_CNISpec_To_v1alpha4_CNISpec(a.(*CNISpec), b.(*v1alpha4.CNISpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.CNISpec)(nil), (*CNISpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_CNISpec_To_v1alpha3_CNISpec(a.(*v1beta1.CNISpec), b.(*CNISpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.CNISpec)(nil), (*CNISpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_CNISpec_To_v1alpha3_CNISpec(a.(*v1alpha4.CNISpec), b.(*CNISpec), scope) + if err := s.AddGeneratedConversionFunc((*ClassicELB)(nil), (*v1beta1.ClassicELB)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClassicELB_To_v1beta1_ClassicELB(a.(*ClassicELB), b.(*v1beta1.ClassicELB), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ClassicELB)(nil), (*v1alpha4.ClassicELB)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ClassicELB_To_v1alpha4_ClassicELB(a.(*ClassicELB), b.(*v1alpha4.ClassicELB), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ClassicELB)(nil), (*ClassicELB)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClassicELB_To_v1alpha3_ClassicELB(a.(*v1beta1.ClassicELB), b.(*ClassicELB), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ClassicELB)(nil), (*ClassicELB)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClassicELB_To_v1alpha3_ClassicELB(a.(*v1alpha4.ClassicELB), b.(*ClassicELB), scope) + if err := s.AddGeneratedConversionFunc((*ClassicELBAttributes)(nil), (*v1beta1.ClassicELBAttributes)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClassicELBAttributes_To_v1beta1_ClassicELBAttributes(a.(*ClassicELBAttributes), b.(*v1beta1.ClassicELBAttributes), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ClassicELBAttributes)(nil), (*v1alpha4.ClassicELBAttributes)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ClassicELBAttributes_To_v1alpha4_ClassicELBAttributes(a.(*ClassicELBAttributes), b.(*v1alpha4.ClassicELBAttributes), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ClassicELBAttributes)(nil), (*ClassicELBAttributes)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClassicELBAttributes_To_v1alpha3_ClassicELBAttributes(a.(*v1beta1.ClassicELBAttributes), b.(*ClassicELBAttributes), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ClassicELBAttributes)(nil), (*ClassicELBAttributes)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClassicELBAttributes_To_v1alpha3_ClassicELBAttributes(a.(*v1alpha4.ClassicELBAttributes), b.(*ClassicELBAttributes), scope) + if err := s.AddGeneratedConversionFunc((*ClassicELBHealthCheck)(nil), (*v1beta1.ClassicELBHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClassicELBHealthCheck_To_v1beta1_ClassicELBHealthCheck(a.(*ClassicELBHealthCheck), b.(*v1beta1.ClassicELBHealthCheck), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ClassicELBHealthCheck)(nil), (*v1alpha4.ClassicELBHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ClassicELBHealthCheck_To_v1alpha4_ClassicELBHealthCheck(a.(*ClassicELBHealthCheck), b.(*v1alpha4.ClassicELBHealthCheck), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ClassicELBHealthCheck)(nil), (*ClassicELBHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClassicELBHealthCheck_To_v1alpha3_ClassicELBHealthCheck(a.(*v1beta1.ClassicELBHealthCheck), b.(*ClassicELBHealthCheck), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ClassicELBHealthCheck)(nil), (*ClassicELBHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClassicELBHealthCheck_To_v1alpha3_ClassicELBHealthCheck(a.(*v1alpha4.ClassicELBHealthCheck), b.(*ClassicELBHealthCheck), scope) + if err := s.AddGeneratedConversionFunc((*ClassicELBListener)(nil), (*v1beta1.ClassicELBListener)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ClassicELBListener_To_v1beta1_ClassicELBListener(a.(*ClassicELBListener), b.(*v1beta1.ClassicELBListener), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ClassicELBListener)(nil), (*v1alpha4.ClassicELBListener)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ClassicELBListener_To_v1alpha4_ClassicELBListener(a.(*ClassicELBListener), b.(*v1alpha4.ClassicELBListener), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ClassicELBListener)(nil), (*ClassicELBListener)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClassicELBListener_To_v1alpha3_ClassicELBListener(a.(*v1beta1.ClassicELBListener), b.(*ClassicELBListener), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ClassicELBListener)(nil), (*ClassicELBListener)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ClassicELBListener_To_v1alpha3_ClassicELBListener(a.(*v1alpha4.ClassicELBListener), b.(*ClassicELBListener), scope) + if err := s.AddGeneratedConversionFunc((*CloudInit)(nil), (*v1beta1.CloudInit)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_CloudInit_To_v1beta1_CloudInit(a.(*CloudInit), b.(*v1beta1.CloudInit), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*CloudInit)(nil), (*v1alpha4.CloudInit)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_CloudInit_To_v1alpha4_CloudInit(a.(*CloudInit), b.(*v1alpha4.CloudInit), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.CloudInit)(nil), (*CloudInit)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_CloudInit_To_v1alpha3_CloudInit(a.(*v1beta1.CloudInit), b.(*CloudInit), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.CloudInit)(nil), (*CloudInit)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_CloudInit_To_v1alpha3_CloudInit(a.(*v1alpha4.CloudInit), b.(*CloudInit), scope) + if err := s.AddGeneratedConversionFunc((*Filter)(nil), (*v1beta1.Filter)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Filter_To_v1beta1_Filter(a.(*Filter), b.(*v1beta1.Filter), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Filter)(nil), (*v1alpha4.Filter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Filter_To_v1alpha4_Filter(a.(*Filter), b.(*v1alpha4.Filter), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.Filter)(nil), (*Filter)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Filter_To_v1alpha3_Filter(a.(*v1beta1.Filter), b.(*Filter), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.Filter)(nil), (*Filter)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Filter_To_v1alpha3_Filter(a.(*v1alpha4.Filter), b.(*Filter), scope) + if err := s.AddGeneratedConversionFunc((*IngressRule)(nil), (*v1beta1.IngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_IngressRule_To_v1beta1_IngressRule(a.(*IngressRule), b.(*v1beta1.IngressRule), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*IngressRule)(nil), (*v1alpha4.IngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_IngressRule_To_v1alpha4_IngressRule(a.(*IngressRule), b.(*v1alpha4.IngressRule), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.IngressRule)(nil), (*IngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_IngressRule_To_v1alpha3_IngressRule(a.(*v1beta1.IngressRule), b.(*IngressRule), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.IngressRule)(nil), (*IngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_IngressRule_To_v1alpha3_IngressRule(a.(*v1alpha4.IngressRule), b.(*IngressRule), scope) + if err := s.AddGeneratedConversionFunc((*Instance)(nil), (*v1beta1.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Instance_To_v1beta1_Instance(a.(*Instance), b.(*v1beta1.Instance), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Instance)(nil), (*v1alpha4.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Instance_To_v1alpha4_Instance(a.(*Instance), b.(*v1alpha4.Instance), scope) + if err := s.AddGeneratedConversionFunc((*NetworkSpec)(nil), (*v1beta1.NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_NetworkSpec_To_v1beta1_NetworkSpec(a.(*NetworkSpec), b.(*v1beta1.NetworkSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*NetworkSpec)(nil), (*v1alpha4.NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_NetworkSpec_To_v1alpha4_NetworkSpec(a.(*NetworkSpec), b.(*v1alpha4.NetworkSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.NetworkSpec)(nil), (*NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_NetworkSpec_To_v1alpha3_NetworkSpec(a.(*v1beta1.NetworkSpec), b.(*NetworkSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.NetworkSpec)(nil), (*NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NetworkSpec_To_v1alpha3_NetworkSpec(a.(*v1alpha4.NetworkSpec), b.(*NetworkSpec), scope) + if err := s.AddGeneratedConversionFunc((*RouteTable)(nil), (*v1beta1.RouteTable)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_RouteTable_To_v1beta1_RouteTable(a.(*RouteTable), b.(*v1beta1.RouteTable), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*RouteTable)(nil), (*v1alpha4.RouteTable)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_RouteTable_To_v1alpha4_RouteTable(a.(*RouteTable), b.(*v1alpha4.RouteTable), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.RouteTable)(nil), (*RouteTable)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_RouteTable_To_v1alpha3_RouteTable(a.(*v1beta1.RouteTable), b.(*RouteTable), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.RouteTable)(nil), (*RouteTable)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_RouteTable_To_v1alpha3_RouteTable(a.(*v1alpha4.RouteTable), b.(*RouteTable), scope) + if err := s.AddGeneratedConversionFunc((*SecurityGroup)(nil), (*v1beta1.SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_SecurityGroup_To_v1beta1_SecurityGroup(a.(*SecurityGroup), b.(*v1beta1.SecurityGroup), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*SecurityGroup)(nil), (*v1alpha4.SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_SecurityGroup_To_v1alpha4_SecurityGroup(a.(*SecurityGroup), b.(*v1alpha4.SecurityGroup), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.SecurityGroup)(nil), (*SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_SecurityGroup_To_v1alpha3_SecurityGroup(a.(*v1beta1.SecurityGroup), b.(*SecurityGroup), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.SecurityGroup)(nil), (*SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_SecurityGroup_To_v1alpha3_SecurityGroup(a.(*v1alpha4.SecurityGroup), b.(*SecurityGroup), scope) + if err := s.AddGeneratedConversionFunc((*SpotMarketOptions)(nil), (*v1beta1.SpotMarketOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_SpotMarketOptions_To_v1beta1_SpotMarketOptions(a.(*SpotMarketOptions), b.(*v1beta1.SpotMarketOptions), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*SpotMarketOptions)(nil), (*v1alpha4.SpotMarketOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_SpotMarketOptions_To_v1alpha4_SpotMarketOptions(a.(*SpotMarketOptions), b.(*v1alpha4.SpotMarketOptions), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.SpotMarketOptions)(nil), (*SpotMarketOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_SpotMarketOptions_To_v1alpha3_SpotMarketOptions(a.(*v1beta1.SpotMarketOptions), b.(*SpotMarketOptions), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.SpotMarketOptions)(nil), (*SpotMarketOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_SpotMarketOptions_To_v1alpha3_SpotMarketOptions(a.(*v1alpha4.SpotMarketOptions), b.(*SpotMarketOptions), scope) + if err := s.AddGeneratedConversionFunc((*SubnetSpec)(nil), (*v1beta1.SubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_SubnetSpec_To_v1beta1_SubnetSpec(a.(*SubnetSpec), b.(*v1beta1.SubnetSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*SubnetSpec)(nil), (*v1alpha4.SubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_SubnetSpec_To_v1alpha4_SubnetSpec(a.(*SubnetSpec), b.(*v1alpha4.SubnetSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.SubnetSpec)(nil), (*SubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_SubnetSpec_To_v1alpha3_SubnetSpec(a.(*v1beta1.SubnetSpec), b.(*SubnetSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.SubnetSpec)(nil), (*SubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_SubnetSpec_To_v1alpha3_SubnetSpec(a.(*v1alpha4.SubnetSpec), b.(*SubnetSpec), scope) + if err := s.AddGeneratedConversionFunc((*VPCSpec)(nil), (*v1beta1.VPCSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_VPCSpec_To_v1beta1_VPCSpec(a.(*VPCSpec), b.(*v1beta1.VPCSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*VPCSpec)(nil), (*v1alpha4.VPCSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_VPCSpec_To_v1alpha4_VPCSpec(a.(*VPCSpec), b.(*v1alpha4.VPCSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.VPCSpec)(nil), (*VPCSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_VPCSpec_To_v1alpha3_VPCSpec(a.(*v1beta1.VPCSpec), b.(*VPCSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.VPCSpec)(nil), (*VPCSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_VPCSpec_To_v1alpha3_VPCSpec(a.(*v1alpha4.VPCSpec), b.(*VPCSpec), scope) + if err := s.AddGeneratedConversionFunc((*Volume)(nil), (*v1beta1.Volume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Volume_To_v1beta1_Volume(a.(*Volume), b.(*v1beta1.Volume), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Volume)(nil), (*v1alpha4.Volume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Volume_To_v1alpha4_Volume(a.(*Volume), b.(*v1alpha4.Volume), scope) + if err := s.AddConversionFunc((*AWSClusterStaticIdentitySpec)(nil), (*v1beta1.AWSClusterStaticIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec(a.(*AWSClusterStaticIdentitySpec), b.(*v1beta1.AWSClusterStaticIdentitySpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*apiv1alpha3.APIEndpoint)(nil), (*apiv1alpha4.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(a.(*apiv1alpha3.APIEndpoint), b.(*apiv1alpha4.APIEndpoint), scope) + if err := s.AddConversionFunc((*AWSResourceReference)(nil), (*v1beta1.AMIReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSResourceReference_To_v1beta1_AMIReference(a.(*AWSResourceReference), b.(*v1beta1.AMIReference), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*AWSClusterStaticIdentitySpec)(nil), (*v1alpha4.AWSClusterStaticIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSClusterStaticIdentitySpec_To_v1alpha4_AWSClusterStaticIdentitySpec(a.(*AWSClusterStaticIdentitySpec), b.(*v1alpha4.AWSClusterStaticIdentitySpec), scope) + if err := s.AddConversionFunc((*Network)(nil), (*v1beta1.NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Network_To_v1beta1_NetworkStatus(a.(*Network), b.(*v1beta1.NetworkStatus), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*AWSResourceReference)(nil), (*v1alpha4.AMIReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AMIReference(a.(*AWSResourceReference), b.(*v1alpha4.AMIReference), scope) + if err := s.AddConversionFunc((*v1beta1.AMIReference)(nil), (*AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AMIReference_To_v1alpha3_AWSResourceReference(a.(*v1beta1.AMIReference), b.(*AWSResourceReference), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*Network)(nil), (*v1alpha4.NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Network_To_v1alpha4_NetworkStatus(a.(*Network), b.(*v1alpha4.NetworkStatus), scope) + if err := s.AddConversionFunc((*v1beta1.AWSClusterStaticIdentitySpec)(nil), (*AWSClusterStaticIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterStaticIdentitySpec_To_v1alpha3_AWSClusterStaticIdentitySpec(a.(*v1beta1.AWSClusterStaticIdentitySpec), b.(*AWSClusterStaticIdentitySpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha4.AMIReference)(nil), (*AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AMIReference_To_v1alpha3_AWSResourceReference(a.(*v1alpha4.AMIReference), b.(*AWSResourceReference), scope) + if err := s.AddConversionFunc((*v1beta1.AWSMachineSpec)(nil), (*AWSMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(a.(*v1beta1.AWSMachineSpec), b.(*AWSMachineSpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*apiv1alpha4.APIEndpoint)(nil), (*apiv1alpha3.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(a.(*apiv1alpha4.APIEndpoint), b.(*apiv1alpha3.APIEndpoint), scope) + if err := s.AddConversionFunc((*v1beta1.AWSMachineTemplateResource)(nil), (*AWSMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachineTemplateResource_To_v1alpha3_AWSMachineTemplateResource(a.(*v1beta1.AWSMachineTemplateResource), b.(*AWSMachineTemplateResource), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha4.AWSClusterStaticIdentitySpec)(nil), (*AWSClusterStaticIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSClusterStaticIdentitySpec_To_v1alpha3_AWSClusterStaticIdentitySpec(a.(*v1alpha4.AWSClusterStaticIdentitySpec), b.(*AWSClusterStaticIdentitySpec), scope) + if err := s.AddConversionFunc((*v1beta1.Instance)(nil), (*Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Instance_To_v1alpha3_Instance(a.(*v1beta1.Instance), b.(*Instance), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha4.AWSMachineSpec)(nil), (*AWSMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(a.(*v1alpha4.AWSMachineSpec), b.(*AWSMachineSpec), scope) + if err := s.AddConversionFunc((*v1beta1.NetworkStatus)(nil), (*Network)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_NetworkStatus_To_v1alpha3_Network(a.(*v1beta1.NetworkStatus), b.(*Network), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha4.Instance)(nil), (*Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Instance_To_v1alpha3_Instance(a.(*v1alpha4.Instance), b.(*Instance), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1alpha4.NetworkStatus)(nil), (*Network)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NetworkStatus_To_v1alpha3_Network(a.(*v1alpha4.NetworkStatus), b.(*Network), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1alpha4.Volume)(nil), (*Volume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Volume_To_v1alpha3_Volume(a.(*v1alpha4.Volume), b.(*Volume), scope) + if err := s.AddConversionFunc((*v1beta1.Volume)(nil), (*Volume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Volume_To_v1alpha3_Volume(a.(*v1beta1.Volume), b.(*Volume), scope) }); err != nil { return err } return nil } -func autoConvert_v1alpha3_AWSCluster_To_v1alpha4_AWSCluster(in *AWSCluster, out *v1alpha4.AWSCluster, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSCluster_To_v1beta1_AWSCluster(in *AWSCluster, out *v1beta1.AWSCluster, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_AWSClusterSpec_To_v1alpha4_AWSClusterSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_AWSClusterSpec_To_v1beta1_AWSClusterSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha3_AWSClusterStatus_To_v1alpha4_AWSClusterStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_AWSClusterStatus_To_v1beta1_AWSClusterStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha3_AWSCluster_To_v1alpha4_AWSCluster is an autogenerated conversion function. -func Convert_v1alpha3_AWSCluster_To_v1alpha4_AWSCluster(in *AWSCluster, out *v1alpha4.AWSCluster, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSCluster_To_v1alpha4_AWSCluster(in, out, s) +// Convert_v1alpha3_AWSCluster_To_v1beta1_AWSCluster is an autogenerated conversion function. +func Convert_v1alpha3_AWSCluster_To_v1beta1_AWSCluster(in *AWSCluster, out *v1beta1.AWSCluster, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSCluster_To_v1beta1_AWSCluster(in, out, s) } -func autoConvert_v1alpha4_AWSCluster_To_v1alpha3_AWSCluster(in *v1alpha4.AWSCluster, out *AWSCluster, s conversion.Scope) error { +func autoConvert_v1beta1_AWSCluster_To_v1alpha3_AWSCluster(in *v1beta1.AWSCluster, out *AWSCluster, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_AWSClusterSpec_To_v1alpha3_AWSClusterSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_AWSClusterSpec_To_v1alpha3_AWSClusterSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha4_AWSClusterStatus_To_v1alpha3_AWSClusterStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_AWSClusterStatus_To_v1alpha3_AWSClusterStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha4_AWSCluster_To_v1alpha3_AWSCluster is an autogenerated conversion function. -func Convert_v1alpha4_AWSCluster_To_v1alpha3_AWSCluster(in *v1alpha4.AWSCluster, out *AWSCluster, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSCluster_To_v1alpha3_AWSCluster(in, out, s) +// Convert_v1beta1_AWSCluster_To_v1alpha3_AWSCluster is an autogenerated conversion function. +func Convert_v1beta1_AWSCluster_To_v1alpha3_AWSCluster(in *v1beta1.AWSCluster, out *AWSCluster, s conversion.Scope) error { + return autoConvert_v1beta1_AWSCluster_To_v1alpha3_AWSCluster(in, out, s) } -func autoConvert_v1alpha3_AWSClusterControllerIdentity_To_v1alpha4_AWSClusterControllerIdentity(in *AWSClusterControllerIdentity, out *v1alpha4.AWSClusterControllerIdentity, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity(in *AWSClusterControllerIdentity, out *v1beta1.AWSClusterControllerIdentity, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_AWSClusterControllerIdentitySpec_To_v1alpha4_AWSClusterControllerIdentitySpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha3_AWSClusterControllerIdentity_To_v1alpha4_AWSClusterControllerIdentity is an autogenerated conversion function. -func Convert_v1alpha3_AWSClusterControllerIdentity_To_v1alpha4_AWSClusterControllerIdentity(in *AWSClusterControllerIdentity, out *v1alpha4.AWSClusterControllerIdentity, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSClusterControllerIdentity_To_v1alpha4_AWSClusterControllerIdentity(in, out, s) +// Convert_v1alpha3_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity is an autogenerated conversion function. +func Convert_v1alpha3_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity(in *AWSClusterControllerIdentity, out *v1beta1.AWSClusterControllerIdentity, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity(in, out, s) } -func autoConvert_v1alpha4_AWSClusterControllerIdentity_To_v1alpha3_AWSClusterControllerIdentity(in *v1alpha4.AWSClusterControllerIdentity, out *AWSClusterControllerIdentity, s conversion.Scope) error { +func autoConvert_v1beta1_AWSClusterControllerIdentity_To_v1alpha3_AWSClusterControllerIdentity(in *v1beta1.AWSClusterControllerIdentity, out *AWSClusterControllerIdentity, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_AWSClusterControllerIdentitySpec_To_v1alpha3_AWSClusterControllerIdentitySpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_AWSClusterControllerIdentitySpec_To_v1alpha3_AWSClusterControllerIdentitySpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha4_AWSClusterControllerIdentity_To_v1alpha3_AWSClusterControllerIdentity is an autogenerated conversion function. -func Convert_v1alpha4_AWSClusterControllerIdentity_To_v1alpha3_AWSClusterControllerIdentity(in *v1alpha4.AWSClusterControllerIdentity, out *AWSClusterControllerIdentity, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSClusterControllerIdentity_To_v1alpha3_AWSClusterControllerIdentity(in, out, s) +// Convert_v1beta1_AWSClusterControllerIdentity_To_v1alpha3_AWSClusterControllerIdentity is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterControllerIdentity_To_v1alpha3_AWSClusterControllerIdentity(in *v1beta1.AWSClusterControllerIdentity, out *AWSClusterControllerIdentity, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterControllerIdentity_To_v1alpha3_AWSClusterControllerIdentity(in, out, s) } -func autoConvert_v1alpha3_AWSClusterControllerIdentityList_To_v1alpha4_AWSClusterControllerIdentityList(in *AWSClusterControllerIdentityList, out *v1alpha4.AWSClusterControllerIdentityList, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList(in *AWSClusterControllerIdentityList, out *v1beta1.AWSClusterControllerIdentityList, s conversion.Scope) error { out.ListMeta = in.ListMeta - out.Items = *(*[]v1alpha4.AWSClusterControllerIdentity)(unsafe.Pointer(&in.Items)) + out.Items = *(*[]v1beta1.AWSClusterControllerIdentity)(unsafe.Pointer(&in.Items)) return nil } -// Convert_v1alpha3_AWSClusterControllerIdentityList_To_v1alpha4_AWSClusterControllerIdentityList is an autogenerated conversion function. -func Convert_v1alpha3_AWSClusterControllerIdentityList_To_v1alpha4_AWSClusterControllerIdentityList(in *AWSClusterControllerIdentityList, out *v1alpha4.AWSClusterControllerIdentityList, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSClusterControllerIdentityList_To_v1alpha4_AWSClusterControllerIdentityList(in, out, s) +// Convert_v1alpha3_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList is an autogenerated conversion function. +func Convert_v1alpha3_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList(in *AWSClusterControllerIdentityList, out *v1beta1.AWSClusterControllerIdentityList, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList(in, out, s) } -func autoConvert_v1alpha4_AWSClusterControllerIdentityList_To_v1alpha3_AWSClusterControllerIdentityList(in *v1alpha4.AWSClusterControllerIdentityList, out *AWSClusterControllerIdentityList, s conversion.Scope) error { +func autoConvert_v1beta1_AWSClusterControllerIdentityList_To_v1alpha3_AWSClusterControllerIdentityList(in *v1beta1.AWSClusterControllerIdentityList, out *AWSClusterControllerIdentityList, s conversion.Scope) error { out.ListMeta = in.ListMeta out.Items = *(*[]AWSClusterControllerIdentity)(unsafe.Pointer(&in.Items)) return nil } -// Convert_v1alpha4_AWSClusterControllerIdentityList_To_v1alpha3_AWSClusterControllerIdentityList is an autogenerated conversion function. -func Convert_v1alpha4_AWSClusterControllerIdentityList_To_v1alpha3_AWSClusterControllerIdentityList(in *v1alpha4.AWSClusterControllerIdentityList, out *AWSClusterControllerIdentityList, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSClusterControllerIdentityList_To_v1alpha3_AWSClusterControllerIdentityList(in, out, s) +// Convert_v1beta1_AWSClusterControllerIdentityList_To_v1alpha3_AWSClusterControllerIdentityList is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterControllerIdentityList_To_v1alpha3_AWSClusterControllerIdentityList(in *v1beta1.AWSClusterControllerIdentityList, out *AWSClusterControllerIdentityList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterControllerIdentityList_To_v1alpha3_AWSClusterControllerIdentityList(in, out, s) } -func autoConvert_v1alpha3_AWSClusterControllerIdentitySpec_To_v1alpha4_AWSClusterControllerIdentitySpec(in *AWSClusterControllerIdentitySpec, out *v1alpha4.AWSClusterControllerIdentitySpec, s conversion.Scope) error { - if err := Convert_v1alpha3_AWSClusterIdentitySpec_To_v1alpha4_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { +func autoConvert_v1alpha3_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec(in *AWSClusterControllerIdentitySpec, out *v1beta1.AWSClusterControllerIdentitySpec, s conversion.Scope) error { + if err := Convert_v1alpha3_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { return err } return nil } -// Convert_v1alpha3_AWSClusterControllerIdentitySpec_To_v1alpha4_AWSClusterControllerIdentitySpec is an autogenerated conversion function. -func Convert_v1alpha3_AWSClusterControllerIdentitySpec_To_v1alpha4_AWSClusterControllerIdentitySpec(in *AWSClusterControllerIdentitySpec, out *v1alpha4.AWSClusterControllerIdentitySpec, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSClusterControllerIdentitySpec_To_v1alpha4_AWSClusterControllerIdentitySpec(in, out, s) +// Convert_v1alpha3_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec is an autogenerated conversion function. +func Convert_v1alpha3_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec(in *AWSClusterControllerIdentitySpec, out *v1beta1.AWSClusterControllerIdentitySpec, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec(in, out, s) } -func autoConvert_v1alpha4_AWSClusterControllerIdentitySpec_To_v1alpha3_AWSClusterControllerIdentitySpec(in *v1alpha4.AWSClusterControllerIdentitySpec, out *AWSClusterControllerIdentitySpec, s conversion.Scope) error { - if err := Convert_v1alpha4_AWSClusterIdentitySpec_To_v1alpha3_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { +func autoConvert_v1beta1_AWSClusterControllerIdentitySpec_To_v1alpha3_AWSClusterControllerIdentitySpec(in *v1beta1.AWSClusterControllerIdentitySpec, out *AWSClusterControllerIdentitySpec, s conversion.Scope) error { + if err := Convert_v1beta1_AWSClusterIdentitySpec_To_v1alpha3_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { return err } return nil } -// Convert_v1alpha4_AWSClusterControllerIdentitySpec_To_v1alpha3_AWSClusterControllerIdentitySpec is an autogenerated conversion function. -func Convert_v1alpha4_AWSClusterControllerIdentitySpec_To_v1alpha3_AWSClusterControllerIdentitySpec(in *v1alpha4.AWSClusterControllerIdentitySpec, out *AWSClusterControllerIdentitySpec, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSClusterControllerIdentitySpec_To_v1alpha3_AWSClusterControllerIdentitySpec(in, out, s) +// Convert_v1beta1_AWSClusterControllerIdentitySpec_To_v1alpha3_AWSClusterControllerIdentitySpec is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterControllerIdentitySpec_To_v1alpha3_AWSClusterControllerIdentitySpec(in *v1beta1.AWSClusterControllerIdentitySpec, out *AWSClusterControllerIdentitySpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterControllerIdentitySpec_To_v1alpha3_AWSClusterControllerIdentitySpec(in, out, s) } -func autoConvert_v1alpha3_AWSClusterIdentitySpec_To_v1alpha4_AWSClusterIdentitySpec(in *AWSClusterIdentitySpec, out *v1alpha4.AWSClusterIdentitySpec, s conversion.Scope) error { - out.AllowedNamespaces = (*v1alpha4.AllowedNamespaces)(unsafe.Pointer(in.AllowedNamespaces)) +func autoConvert_v1alpha3_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(in *AWSClusterIdentitySpec, out *v1beta1.AWSClusterIdentitySpec, s conversion.Scope) error { + out.AllowedNamespaces = (*v1beta1.AllowedNamespaces)(unsafe.Pointer(in.AllowedNamespaces)) return nil } -// Convert_v1alpha3_AWSClusterIdentitySpec_To_v1alpha4_AWSClusterIdentitySpec is an autogenerated conversion function. -func Convert_v1alpha3_AWSClusterIdentitySpec_To_v1alpha4_AWSClusterIdentitySpec(in *AWSClusterIdentitySpec, out *v1alpha4.AWSClusterIdentitySpec, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSClusterIdentitySpec_To_v1alpha4_AWSClusterIdentitySpec(in, out, s) +// Convert_v1alpha3_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec is an autogenerated conversion function. +func Convert_v1alpha3_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(in *AWSClusterIdentitySpec, out *v1beta1.AWSClusterIdentitySpec, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(in, out, s) } -func autoConvert_v1alpha4_AWSClusterIdentitySpec_To_v1alpha3_AWSClusterIdentitySpec(in *v1alpha4.AWSClusterIdentitySpec, out *AWSClusterIdentitySpec, s conversion.Scope) error { +func autoConvert_v1beta1_AWSClusterIdentitySpec_To_v1alpha3_AWSClusterIdentitySpec(in *v1beta1.AWSClusterIdentitySpec, out *AWSClusterIdentitySpec, s conversion.Scope) error { out.AllowedNamespaces = (*AllowedNamespaces)(unsafe.Pointer(in.AllowedNamespaces)) return nil } -// Convert_v1alpha4_AWSClusterIdentitySpec_To_v1alpha3_AWSClusterIdentitySpec is an autogenerated conversion function. -func Convert_v1alpha4_AWSClusterIdentitySpec_To_v1alpha3_AWSClusterIdentitySpec(in *v1alpha4.AWSClusterIdentitySpec, out *AWSClusterIdentitySpec, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSClusterIdentitySpec_To_v1alpha3_AWSClusterIdentitySpec(in, out, s) +// Convert_v1beta1_AWSClusterIdentitySpec_To_v1alpha3_AWSClusterIdentitySpec is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterIdentitySpec_To_v1alpha3_AWSClusterIdentitySpec(in *v1beta1.AWSClusterIdentitySpec, out *AWSClusterIdentitySpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterIdentitySpec_To_v1alpha3_AWSClusterIdentitySpec(in, out, s) } -func autoConvert_v1alpha3_AWSClusterList_To_v1alpha4_AWSClusterList(in *AWSClusterList, out *v1alpha4.AWSClusterList, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSClusterList_To_v1beta1_AWSClusterList(in *AWSClusterList, out *v1beta1.AWSClusterList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha4.AWSCluster, len(*in)) + *out = make([]v1beta1.AWSCluster, len(*in)) for i := range *in { - if err := Convert_v1alpha3_AWSCluster_To_v1alpha4_AWSCluster(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_AWSCluster_To_v1beta1_AWSCluster(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -673,18 +663,18 @@ func autoConvert_v1alpha3_AWSClusterList_To_v1alpha4_AWSClusterList(in *AWSClust return nil } -// Convert_v1alpha3_AWSClusterList_To_v1alpha4_AWSClusterList is an autogenerated conversion function. -func Convert_v1alpha3_AWSClusterList_To_v1alpha4_AWSClusterList(in *AWSClusterList, out *v1alpha4.AWSClusterList, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSClusterList_To_v1alpha4_AWSClusterList(in, out, s) +// Convert_v1alpha3_AWSClusterList_To_v1beta1_AWSClusterList is an autogenerated conversion function. +func Convert_v1alpha3_AWSClusterList_To_v1beta1_AWSClusterList(in *AWSClusterList, out *v1beta1.AWSClusterList, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSClusterList_To_v1beta1_AWSClusterList(in, out, s) } -func autoConvert_v1alpha4_AWSClusterList_To_v1alpha3_AWSClusterList(in *v1alpha4.AWSClusterList, out *AWSClusterList, s conversion.Scope) error { +func autoConvert_v1beta1_AWSClusterList_To_v1alpha3_AWSClusterList(in *v1beta1.AWSClusterList, out *AWSClusterList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]AWSCluster, len(*in)) for i := range *in { - if err := Convert_v1alpha4_AWSCluster_To_v1alpha3_AWSCluster(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_AWSCluster_To_v1alpha3_AWSCluster(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -694,81 +684,81 @@ func autoConvert_v1alpha4_AWSClusterList_To_v1alpha3_AWSClusterList(in *v1alpha4 return nil } -// Convert_v1alpha4_AWSClusterList_To_v1alpha3_AWSClusterList is an autogenerated conversion function. -func Convert_v1alpha4_AWSClusterList_To_v1alpha3_AWSClusterList(in *v1alpha4.AWSClusterList, out *AWSClusterList, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSClusterList_To_v1alpha3_AWSClusterList(in, out, s) +// Convert_v1beta1_AWSClusterList_To_v1alpha3_AWSClusterList is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterList_To_v1alpha3_AWSClusterList(in *v1beta1.AWSClusterList, out *AWSClusterList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterList_To_v1alpha3_AWSClusterList(in, out, s) } -func autoConvert_v1alpha3_AWSClusterRoleIdentity_To_v1alpha4_AWSClusterRoleIdentity(in *AWSClusterRoleIdentity, out *v1alpha4.AWSClusterRoleIdentity, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity(in *AWSClusterRoleIdentity, out *v1beta1.AWSClusterRoleIdentity, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_AWSClusterRoleIdentitySpec_To_v1alpha4_AWSClusterRoleIdentitySpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha3_AWSClusterRoleIdentity_To_v1alpha4_AWSClusterRoleIdentity is an autogenerated conversion function. -func Convert_v1alpha3_AWSClusterRoleIdentity_To_v1alpha4_AWSClusterRoleIdentity(in *AWSClusterRoleIdentity, out *v1alpha4.AWSClusterRoleIdentity, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSClusterRoleIdentity_To_v1alpha4_AWSClusterRoleIdentity(in, out, s) +// Convert_v1alpha3_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity is an autogenerated conversion function. +func Convert_v1alpha3_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity(in *AWSClusterRoleIdentity, out *v1beta1.AWSClusterRoleIdentity, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity(in, out, s) } -func autoConvert_v1alpha4_AWSClusterRoleIdentity_To_v1alpha3_AWSClusterRoleIdentity(in *v1alpha4.AWSClusterRoleIdentity, out *AWSClusterRoleIdentity, s conversion.Scope) error { +func autoConvert_v1beta1_AWSClusterRoleIdentity_To_v1alpha3_AWSClusterRoleIdentity(in *v1beta1.AWSClusterRoleIdentity, out *AWSClusterRoleIdentity, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_AWSClusterRoleIdentitySpec_To_v1alpha3_AWSClusterRoleIdentitySpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_AWSClusterRoleIdentitySpec_To_v1alpha3_AWSClusterRoleIdentitySpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha4_AWSClusterRoleIdentity_To_v1alpha3_AWSClusterRoleIdentity is an autogenerated conversion function. -func Convert_v1alpha4_AWSClusterRoleIdentity_To_v1alpha3_AWSClusterRoleIdentity(in *v1alpha4.AWSClusterRoleIdentity, out *AWSClusterRoleIdentity, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSClusterRoleIdentity_To_v1alpha3_AWSClusterRoleIdentity(in, out, s) +// Convert_v1beta1_AWSClusterRoleIdentity_To_v1alpha3_AWSClusterRoleIdentity is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterRoleIdentity_To_v1alpha3_AWSClusterRoleIdentity(in *v1beta1.AWSClusterRoleIdentity, out *AWSClusterRoleIdentity, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterRoleIdentity_To_v1alpha3_AWSClusterRoleIdentity(in, out, s) } -func autoConvert_v1alpha3_AWSClusterRoleIdentityList_To_v1alpha4_AWSClusterRoleIdentityList(in *AWSClusterRoleIdentityList, out *v1alpha4.AWSClusterRoleIdentityList, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList(in *AWSClusterRoleIdentityList, out *v1beta1.AWSClusterRoleIdentityList, s conversion.Scope) error { out.ListMeta = in.ListMeta - out.Items = *(*[]v1alpha4.AWSClusterRoleIdentity)(unsafe.Pointer(&in.Items)) + out.Items = *(*[]v1beta1.AWSClusterRoleIdentity)(unsafe.Pointer(&in.Items)) return nil } -// Convert_v1alpha3_AWSClusterRoleIdentityList_To_v1alpha4_AWSClusterRoleIdentityList is an autogenerated conversion function. -func Convert_v1alpha3_AWSClusterRoleIdentityList_To_v1alpha4_AWSClusterRoleIdentityList(in *AWSClusterRoleIdentityList, out *v1alpha4.AWSClusterRoleIdentityList, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSClusterRoleIdentityList_To_v1alpha4_AWSClusterRoleIdentityList(in, out, s) +// Convert_v1alpha3_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList is an autogenerated conversion function. +func Convert_v1alpha3_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList(in *AWSClusterRoleIdentityList, out *v1beta1.AWSClusterRoleIdentityList, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList(in, out, s) } -func autoConvert_v1alpha4_AWSClusterRoleIdentityList_To_v1alpha3_AWSClusterRoleIdentityList(in *v1alpha4.AWSClusterRoleIdentityList, out *AWSClusterRoleIdentityList, s conversion.Scope) error { +func autoConvert_v1beta1_AWSClusterRoleIdentityList_To_v1alpha3_AWSClusterRoleIdentityList(in *v1beta1.AWSClusterRoleIdentityList, out *AWSClusterRoleIdentityList, s conversion.Scope) error { out.ListMeta = in.ListMeta out.Items = *(*[]AWSClusterRoleIdentity)(unsafe.Pointer(&in.Items)) return nil } -// Convert_v1alpha4_AWSClusterRoleIdentityList_To_v1alpha3_AWSClusterRoleIdentityList is an autogenerated conversion function. -func Convert_v1alpha4_AWSClusterRoleIdentityList_To_v1alpha3_AWSClusterRoleIdentityList(in *v1alpha4.AWSClusterRoleIdentityList, out *AWSClusterRoleIdentityList, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSClusterRoleIdentityList_To_v1alpha3_AWSClusterRoleIdentityList(in, out, s) +// Convert_v1beta1_AWSClusterRoleIdentityList_To_v1alpha3_AWSClusterRoleIdentityList is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterRoleIdentityList_To_v1alpha3_AWSClusterRoleIdentityList(in *v1beta1.AWSClusterRoleIdentityList, out *AWSClusterRoleIdentityList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterRoleIdentityList_To_v1alpha3_AWSClusterRoleIdentityList(in, out, s) } -func autoConvert_v1alpha3_AWSClusterRoleIdentitySpec_To_v1alpha4_AWSClusterRoleIdentitySpec(in *AWSClusterRoleIdentitySpec, out *v1alpha4.AWSClusterRoleIdentitySpec, s conversion.Scope) error { - if err := Convert_v1alpha3_AWSClusterIdentitySpec_To_v1alpha4_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { +func autoConvert_v1alpha3_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec(in *AWSClusterRoleIdentitySpec, out *v1beta1.AWSClusterRoleIdentitySpec, s conversion.Scope) error { + if err := Convert_v1alpha3_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { return err } - if err := Convert_v1alpha3_AWSRoleSpec_To_v1alpha4_AWSRoleSpec(&in.AWSRoleSpec, &out.AWSRoleSpec, s); err != nil { + if err := Convert_v1alpha3_AWSRoleSpec_To_v1beta1_AWSRoleSpec(&in.AWSRoleSpec, &out.AWSRoleSpec, s); err != nil { return err } out.ExternalID = in.ExternalID - out.SourceIdentityRef = (*v1alpha4.AWSIdentityReference)(unsafe.Pointer(in.SourceIdentityRef)) + out.SourceIdentityRef = (*v1beta1.AWSIdentityReference)(unsafe.Pointer(in.SourceIdentityRef)) return nil } -// Convert_v1alpha3_AWSClusterRoleIdentitySpec_To_v1alpha4_AWSClusterRoleIdentitySpec is an autogenerated conversion function. -func Convert_v1alpha3_AWSClusterRoleIdentitySpec_To_v1alpha4_AWSClusterRoleIdentitySpec(in *AWSClusterRoleIdentitySpec, out *v1alpha4.AWSClusterRoleIdentitySpec, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSClusterRoleIdentitySpec_To_v1alpha4_AWSClusterRoleIdentitySpec(in, out, s) +// Convert_v1alpha3_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec is an autogenerated conversion function. +func Convert_v1alpha3_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec(in *AWSClusterRoleIdentitySpec, out *v1beta1.AWSClusterRoleIdentitySpec, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec(in, out, s) } -func autoConvert_v1alpha4_AWSClusterRoleIdentitySpec_To_v1alpha3_AWSClusterRoleIdentitySpec(in *v1alpha4.AWSClusterRoleIdentitySpec, out *AWSClusterRoleIdentitySpec, s conversion.Scope) error { - if err := Convert_v1alpha4_AWSClusterIdentitySpec_To_v1alpha3_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { +func autoConvert_v1beta1_AWSClusterRoleIdentitySpec_To_v1alpha3_AWSClusterRoleIdentitySpec(in *v1beta1.AWSClusterRoleIdentitySpec, out *AWSClusterRoleIdentitySpec, s conversion.Scope) error { + if err := Convert_v1beta1_AWSClusterIdentitySpec_To_v1alpha3_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { return err } - if err := Convert_v1alpha4_AWSRoleSpec_To_v1alpha3_AWSRoleSpec(&in.AWSRoleSpec, &out.AWSRoleSpec, s); err != nil { + if err := Convert_v1beta1_AWSRoleSpec_To_v1alpha3_AWSRoleSpec(&in.AWSRoleSpec, &out.AWSRoleSpec, s); err != nil { return err } out.ExternalID = in.ExternalID @@ -776,44 +766,44 @@ func autoConvert_v1alpha4_AWSClusterRoleIdentitySpec_To_v1alpha3_AWSClusterRoleI return nil } -// Convert_v1alpha4_AWSClusterRoleIdentitySpec_To_v1alpha3_AWSClusterRoleIdentitySpec is an autogenerated conversion function. -func Convert_v1alpha4_AWSClusterRoleIdentitySpec_To_v1alpha3_AWSClusterRoleIdentitySpec(in *v1alpha4.AWSClusterRoleIdentitySpec, out *AWSClusterRoleIdentitySpec, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSClusterRoleIdentitySpec_To_v1alpha3_AWSClusterRoleIdentitySpec(in, out, s) +// Convert_v1beta1_AWSClusterRoleIdentitySpec_To_v1alpha3_AWSClusterRoleIdentitySpec is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterRoleIdentitySpec_To_v1alpha3_AWSClusterRoleIdentitySpec(in *v1beta1.AWSClusterRoleIdentitySpec, out *AWSClusterRoleIdentitySpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterRoleIdentitySpec_To_v1alpha3_AWSClusterRoleIdentitySpec(in, out, s) } -func autoConvert_v1alpha3_AWSClusterSpec_To_v1alpha4_AWSClusterSpec(in *AWSClusterSpec, out *v1alpha4.AWSClusterSpec, s conversion.Scope) error { - if err := Convert_v1alpha3_NetworkSpec_To_v1alpha4_NetworkSpec(&in.NetworkSpec, &out.NetworkSpec, s); err != nil { +func autoConvert_v1alpha3_AWSClusterSpec_To_v1beta1_AWSClusterSpec(in *AWSClusterSpec, out *v1beta1.AWSClusterSpec, s conversion.Scope) error { + if err := Convert_v1alpha3_NetworkSpec_To_v1beta1_NetworkSpec(&in.NetworkSpec, &out.NetworkSpec, s); err != nil { return err } out.Region = in.Region out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) - if err := Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + if err := apiv1alpha3.Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { return err } - out.AdditionalTags = *(*v1alpha4.Tags)(unsafe.Pointer(&in.AdditionalTags)) - out.ControlPlaneLoadBalancer = (*v1alpha4.AWSLoadBalancerSpec)(unsafe.Pointer(in.ControlPlaneLoadBalancer)) + out.AdditionalTags = *(*v1beta1.Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.ControlPlaneLoadBalancer = (*v1beta1.AWSLoadBalancerSpec)(unsafe.Pointer(in.ControlPlaneLoadBalancer)) out.ImageLookupFormat = in.ImageLookupFormat out.ImageLookupOrg = in.ImageLookupOrg out.ImageLookupBaseOS = in.ImageLookupBaseOS - if err := Convert_v1alpha3_Bastion_To_v1alpha4_Bastion(&in.Bastion, &out.Bastion, s); err != nil { + if err := Convert_v1alpha3_Bastion_To_v1beta1_Bastion(&in.Bastion, &out.Bastion, s); err != nil { return err } - out.IdentityRef = (*v1alpha4.AWSIdentityReference)(unsafe.Pointer(in.IdentityRef)) + out.IdentityRef = (*v1beta1.AWSIdentityReference)(unsafe.Pointer(in.IdentityRef)) return nil } -// Convert_v1alpha3_AWSClusterSpec_To_v1alpha4_AWSClusterSpec is an autogenerated conversion function. -func Convert_v1alpha3_AWSClusterSpec_To_v1alpha4_AWSClusterSpec(in *AWSClusterSpec, out *v1alpha4.AWSClusterSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSClusterSpec_To_v1alpha4_AWSClusterSpec(in, out, s) +// Convert_v1alpha3_AWSClusterSpec_To_v1beta1_AWSClusterSpec is an autogenerated conversion function. +func Convert_v1alpha3_AWSClusterSpec_To_v1beta1_AWSClusterSpec(in *AWSClusterSpec, out *v1beta1.AWSClusterSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSClusterSpec_To_v1beta1_AWSClusterSpec(in, out, s) } -func autoConvert_v1alpha4_AWSClusterSpec_To_v1alpha3_AWSClusterSpec(in *v1alpha4.AWSClusterSpec, out *AWSClusterSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_NetworkSpec_To_v1alpha3_NetworkSpec(&in.NetworkSpec, &out.NetworkSpec, s); err != nil { +func autoConvert_v1beta1_AWSClusterSpec_To_v1alpha3_AWSClusterSpec(in *v1beta1.AWSClusterSpec, out *AWSClusterSpec, s conversion.Scope) error { + if err := Convert_v1beta1_NetworkSpec_To_v1alpha3_NetworkSpec(&in.NetworkSpec, &out.NetworkSpec, s); err != nil { return err } out.Region = in.Region out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) - if err := Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + if err := apiv1alpha3.Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { return err } out.AdditionalTags = *(*Tags)(unsafe.Pointer(&in.AdditionalTags)) @@ -821,51 +811,51 @@ func autoConvert_v1alpha4_AWSClusterSpec_To_v1alpha3_AWSClusterSpec(in *v1alpha4 out.ImageLookupFormat = in.ImageLookupFormat out.ImageLookupOrg = in.ImageLookupOrg out.ImageLookupBaseOS = in.ImageLookupBaseOS - if err := Convert_v1alpha4_Bastion_To_v1alpha3_Bastion(&in.Bastion, &out.Bastion, s); err != nil { + if err := Convert_v1beta1_Bastion_To_v1alpha3_Bastion(&in.Bastion, &out.Bastion, s); err != nil { return err } out.IdentityRef = (*AWSIdentityReference)(unsafe.Pointer(in.IdentityRef)) return nil } -// Convert_v1alpha4_AWSClusterSpec_To_v1alpha3_AWSClusterSpec is an autogenerated conversion function. -func Convert_v1alpha4_AWSClusterSpec_To_v1alpha3_AWSClusterSpec(in *v1alpha4.AWSClusterSpec, out *AWSClusterSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSClusterSpec_To_v1alpha3_AWSClusterSpec(in, out, s) +// Convert_v1beta1_AWSClusterSpec_To_v1alpha3_AWSClusterSpec is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterSpec_To_v1alpha3_AWSClusterSpec(in *v1beta1.AWSClusterSpec, out *AWSClusterSpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterSpec_To_v1alpha3_AWSClusterSpec(in, out, s) } -func autoConvert_v1alpha3_AWSClusterStaticIdentity_To_v1alpha4_AWSClusterStaticIdentity(in *AWSClusterStaticIdentity, out *v1alpha4.AWSClusterStaticIdentity, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity(in *AWSClusterStaticIdentity, out *v1beta1.AWSClusterStaticIdentity, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_AWSClusterStaticIdentitySpec_To_v1alpha4_AWSClusterStaticIdentitySpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha3_AWSClusterStaticIdentity_To_v1alpha4_AWSClusterStaticIdentity is an autogenerated conversion function. -func Convert_v1alpha3_AWSClusterStaticIdentity_To_v1alpha4_AWSClusterStaticIdentity(in *AWSClusterStaticIdentity, out *v1alpha4.AWSClusterStaticIdentity, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSClusterStaticIdentity_To_v1alpha4_AWSClusterStaticIdentity(in, out, s) +// Convert_v1alpha3_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity is an autogenerated conversion function. +func Convert_v1alpha3_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity(in *AWSClusterStaticIdentity, out *v1beta1.AWSClusterStaticIdentity, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity(in, out, s) } -func autoConvert_v1alpha4_AWSClusterStaticIdentity_To_v1alpha3_AWSClusterStaticIdentity(in *v1alpha4.AWSClusterStaticIdentity, out *AWSClusterStaticIdentity, s conversion.Scope) error { +func autoConvert_v1beta1_AWSClusterStaticIdentity_To_v1alpha3_AWSClusterStaticIdentity(in *v1beta1.AWSClusterStaticIdentity, out *AWSClusterStaticIdentity, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_AWSClusterStaticIdentitySpec_To_v1alpha3_AWSClusterStaticIdentitySpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_AWSClusterStaticIdentitySpec_To_v1alpha3_AWSClusterStaticIdentitySpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha4_AWSClusterStaticIdentity_To_v1alpha3_AWSClusterStaticIdentity is an autogenerated conversion function. -func Convert_v1alpha4_AWSClusterStaticIdentity_To_v1alpha3_AWSClusterStaticIdentity(in *v1alpha4.AWSClusterStaticIdentity, out *AWSClusterStaticIdentity, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSClusterStaticIdentity_To_v1alpha3_AWSClusterStaticIdentity(in, out, s) +// Convert_v1beta1_AWSClusterStaticIdentity_To_v1alpha3_AWSClusterStaticIdentity is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterStaticIdentity_To_v1alpha3_AWSClusterStaticIdentity(in *v1beta1.AWSClusterStaticIdentity, out *AWSClusterStaticIdentity, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterStaticIdentity_To_v1alpha3_AWSClusterStaticIdentity(in, out, s) } -func autoConvert_v1alpha3_AWSClusterStaticIdentityList_To_v1alpha4_AWSClusterStaticIdentityList(in *AWSClusterStaticIdentityList, out *v1alpha4.AWSClusterStaticIdentityList, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList(in *AWSClusterStaticIdentityList, out *v1beta1.AWSClusterStaticIdentityList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha4.AWSClusterStaticIdentity, len(*in)) + *out = make([]v1beta1.AWSClusterStaticIdentity, len(*in)) for i := range *in { - if err := Convert_v1alpha3_AWSClusterStaticIdentity_To_v1alpha4_AWSClusterStaticIdentity(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -875,18 +865,18 @@ func autoConvert_v1alpha3_AWSClusterStaticIdentityList_To_v1alpha4_AWSClusterSta return nil } -// Convert_v1alpha3_AWSClusterStaticIdentityList_To_v1alpha4_AWSClusterStaticIdentityList is an autogenerated conversion function. -func Convert_v1alpha3_AWSClusterStaticIdentityList_To_v1alpha4_AWSClusterStaticIdentityList(in *AWSClusterStaticIdentityList, out *v1alpha4.AWSClusterStaticIdentityList, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSClusterStaticIdentityList_To_v1alpha4_AWSClusterStaticIdentityList(in, out, s) +// Convert_v1alpha3_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList is an autogenerated conversion function. +func Convert_v1alpha3_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList(in *AWSClusterStaticIdentityList, out *v1beta1.AWSClusterStaticIdentityList, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList(in, out, s) } -func autoConvert_v1alpha4_AWSClusterStaticIdentityList_To_v1alpha3_AWSClusterStaticIdentityList(in *v1alpha4.AWSClusterStaticIdentityList, out *AWSClusterStaticIdentityList, s conversion.Scope) error { +func autoConvert_v1beta1_AWSClusterStaticIdentityList_To_v1alpha3_AWSClusterStaticIdentityList(in *v1beta1.AWSClusterStaticIdentityList, out *AWSClusterStaticIdentityList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]AWSClusterStaticIdentity, len(*in)) for i := range *in { - if err := Convert_v1alpha4_AWSClusterStaticIdentity_To_v1alpha3_AWSClusterStaticIdentity(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_AWSClusterStaticIdentity_To_v1alpha3_AWSClusterStaticIdentity(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -896,111 +886,155 @@ func autoConvert_v1alpha4_AWSClusterStaticIdentityList_To_v1alpha3_AWSClusterSta return nil } -// Convert_v1alpha4_AWSClusterStaticIdentityList_To_v1alpha3_AWSClusterStaticIdentityList is an autogenerated conversion function. -func Convert_v1alpha4_AWSClusterStaticIdentityList_To_v1alpha3_AWSClusterStaticIdentityList(in *v1alpha4.AWSClusterStaticIdentityList, out *AWSClusterStaticIdentityList, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSClusterStaticIdentityList_To_v1alpha3_AWSClusterStaticIdentityList(in, out, s) +// Convert_v1beta1_AWSClusterStaticIdentityList_To_v1alpha3_AWSClusterStaticIdentityList is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterStaticIdentityList_To_v1alpha3_AWSClusterStaticIdentityList(in *v1beta1.AWSClusterStaticIdentityList, out *AWSClusterStaticIdentityList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterStaticIdentityList_To_v1alpha3_AWSClusterStaticIdentityList(in, out, s) } -func autoConvert_v1alpha3_AWSClusterStaticIdentitySpec_To_v1alpha4_AWSClusterStaticIdentitySpec(in *AWSClusterStaticIdentitySpec, out *v1alpha4.AWSClusterStaticIdentitySpec, s conversion.Scope) error { - if err := Convert_v1alpha3_AWSClusterIdentitySpec_To_v1alpha4_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { +func autoConvert_v1alpha3_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec(in *AWSClusterStaticIdentitySpec, out *v1beta1.AWSClusterStaticIdentitySpec, s conversion.Scope) error { + if err := Convert_v1alpha3_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { return err } // WARNING: in.SecretRef requires manual conversion: inconvertible types (k8s.io/api/core/v1.SecretReference vs string) return nil } -func autoConvert_v1alpha4_AWSClusterStaticIdentitySpec_To_v1alpha3_AWSClusterStaticIdentitySpec(in *v1alpha4.AWSClusterStaticIdentitySpec, out *AWSClusterStaticIdentitySpec, s conversion.Scope) error { - if err := Convert_v1alpha4_AWSClusterIdentitySpec_To_v1alpha3_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { +func autoConvert_v1beta1_AWSClusterStaticIdentitySpec_To_v1alpha3_AWSClusterStaticIdentitySpec(in *v1beta1.AWSClusterStaticIdentitySpec, out *AWSClusterStaticIdentitySpec, s conversion.Scope) error { + if err := Convert_v1beta1_AWSClusterIdentitySpec_To_v1alpha3_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { return err } // WARNING: in.SecretRef requires manual conversion: inconvertible types (string vs k8s.io/api/core/v1.SecretReference) return nil } -func autoConvert_v1alpha3_AWSClusterStatus_To_v1alpha4_AWSClusterStatus(in *AWSClusterStatus, out *v1alpha4.AWSClusterStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSClusterStatus_To_v1beta1_AWSClusterStatus(in *AWSClusterStatus, out *v1beta1.AWSClusterStatus, s conversion.Scope) error { out.Ready = in.Ready - if err := Convert_v1alpha3_Network_To_v1alpha4_NetworkStatus(&in.Network, &out.Network, s); err != nil { + if err := Convert_v1alpha3_Network_To_v1beta1_NetworkStatus(&in.Network, &out.Network, s); err != nil { return err } - out.FailureDomains = *(*apiv1alpha4.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) + 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 := apiv1alpha3.Convert_v1alpha3_FailureDomainSpec_To_v1beta1_FailureDomainSpec(&val, newVal, s); err != nil { + return err + } + (*out)[key] = *newVal + } + } else { + out.FailureDomains = nil + } if in.Bastion != nil { in, out := &in.Bastion, &out.Bastion - *out = new(v1alpha4.Instance) - if err := Convert_v1alpha3_Instance_To_v1alpha4_Instance(*in, *out, s); err != nil { + *out = new(v1beta1.Instance) + if err := Convert_v1alpha3_Instance_To_v1beta1_Instance(*in, *out, s); err != nil { return err } } else { out.Bastion = nil } - out.Conditions = *(*apiv1alpha4.Conditions)(unsafe.Pointer(&in.Conditions)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(apiv1beta1.Conditions, len(*in)) + for i := range *in { + if err := apiv1alpha3.Convert_v1alpha3_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } return nil } -// Convert_v1alpha3_AWSClusterStatus_To_v1alpha4_AWSClusterStatus is an autogenerated conversion function. -func Convert_v1alpha3_AWSClusterStatus_To_v1alpha4_AWSClusterStatus(in *AWSClusterStatus, out *v1alpha4.AWSClusterStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSClusterStatus_To_v1alpha4_AWSClusterStatus(in, out, s) +// Convert_v1alpha3_AWSClusterStatus_To_v1beta1_AWSClusterStatus is an autogenerated conversion function. +func Convert_v1alpha3_AWSClusterStatus_To_v1beta1_AWSClusterStatus(in *AWSClusterStatus, out *v1beta1.AWSClusterStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSClusterStatus_To_v1beta1_AWSClusterStatus(in, out, s) } -func autoConvert_v1alpha4_AWSClusterStatus_To_v1alpha3_AWSClusterStatus(in *v1alpha4.AWSClusterStatus, out *AWSClusterStatus, s conversion.Scope) error { +func autoConvert_v1beta1_AWSClusterStatus_To_v1alpha3_AWSClusterStatus(in *v1beta1.AWSClusterStatus, out *AWSClusterStatus, s conversion.Scope) error { out.Ready = in.Ready - if err := Convert_v1alpha4_NetworkStatus_To_v1alpha3_Network(&in.Network, &out.Network, s); err != nil { + if err := Convert_v1beta1_NetworkStatus_To_v1alpha3_Network(&in.Network, &out.Network, s); err != nil { return err } - out.FailureDomains = *(*apiv1alpha3.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make(apiv1alpha3.FailureDomains, len(*in)) + for key, val := range *in { + newVal := new(apiv1alpha3.FailureDomainSpec) + if err := apiv1alpha3.Convert_v1beta1_FailureDomainSpec_To_v1alpha3_FailureDomainSpec(&val, newVal, s); err != nil { + return err + } + (*out)[key] = *newVal + } + } else { + out.FailureDomains = nil + } if in.Bastion != nil { in, out := &in.Bastion, &out.Bastion *out = new(Instance) - if err := Convert_v1alpha4_Instance_To_v1alpha3_Instance(*in, *out, s); err != nil { + if err := Convert_v1beta1_Instance_To_v1alpha3_Instance(*in, *out, s); err != nil { return err } } else { out.Bastion = nil } - out.Conditions = *(*apiv1alpha3.Conditions)(unsafe.Pointer(&in.Conditions)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(apiv1alpha3.Conditions, len(*in)) + for i := range *in { + if err := apiv1alpha3.Convert_v1beta1_Condition_To_v1alpha3_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } return nil } -// Convert_v1alpha4_AWSClusterStatus_To_v1alpha3_AWSClusterStatus is an autogenerated conversion function. -func Convert_v1alpha4_AWSClusterStatus_To_v1alpha3_AWSClusterStatus(in *v1alpha4.AWSClusterStatus, out *AWSClusterStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSClusterStatus_To_v1alpha3_AWSClusterStatus(in, out, s) +// Convert_v1beta1_AWSClusterStatus_To_v1alpha3_AWSClusterStatus is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterStatus_To_v1alpha3_AWSClusterStatus(in *v1beta1.AWSClusterStatus, out *AWSClusterStatus, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterStatus_To_v1alpha3_AWSClusterStatus(in, out, s) } -func autoConvert_v1alpha3_AWSIdentityReference_To_v1alpha4_AWSIdentityReference(in *AWSIdentityReference, out *v1alpha4.AWSIdentityReference, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSIdentityReference_To_v1beta1_AWSIdentityReference(in *AWSIdentityReference, out *v1beta1.AWSIdentityReference, s conversion.Scope) error { out.Name = in.Name - out.Kind = v1alpha4.AWSIdentityKind(in.Kind) + out.Kind = v1beta1.AWSIdentityKind(in.Kind) return nil } -// Convert_v1alpha3_AWSIdentityReference_To_v1alpha4_AWSIdentityReference is an autogenerated conversion function. -func Convert_v1alpha3_AWSIdentityReference_To_v1alpha4_AWSIdentityReference(in *AWSIdentityReference, out *v1alpha4.AWSIdentityReference, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSIdentityReference_To_v1alpha4_AWSIdentityReference(in, out, s) +// Convert_v1alpha3_AWSIdentityReference_To_v1beta1_AWSIdentityReference is an autogenerated conversion function. +func Convert_v1alpha3_AWSIdentityReference_To_v1beta1_AWSIdentityReference(in *AWSIdentityReference, out *v1beta1.AWSIdentityReference, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSIdentityReference_To_v1beta1_AWSIdentityReference(in, out, s) } -func autoConvert_v1alpha4_AWSIdentityReference_To_v1alpha3_AWSIdentityReference(in *v1alpha4.AWSIdentityReference, out *AWSIdentityReference, s conversion.Scope) error { +func autoConvert_v1beta1_AWSIdentityReference_To_v1alpha3_AWSIdentityReference(in *v1beta1.AWSIdentityReference, out *AWSIdentityReference, s conversion.Scope) error { out.Name = in.Name out.Kind = AWSIdentityKind(in.Kind) return nil } -// Convert_v1alpha4_AWSIdentityReference_To_v1alpha3_AWSIdentityReference is an autogenerated conversion function. -func Convert_v1alpha4_AWSIdentityReference_To_v1alpha3_AWSIdentityReference(in *v1alpha4.AWSIdentityReference, out *AWSIdentityReference, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSIdentityReference_To_v1alpha3_AWSIdentityReference(in, out, s) +// Convert_v1beta1_AWSIdentityReference_To_v1alpha3_AWSIdentityReference is an autogenerated conversion function. +func Convert_v1beta1_AWSIdentityReference_To_v1alpha3_AWSIdentityReference(in *v1beta1.AWSIdentityReference, out *AWSIdentityReference, s conversion.Scope) error { + return autoConvert_v1beta1_AWSIdentityReference_To_v1alpha3_AWSIdentityReference(in, out, s) } -func autoConvert_v1alpha3_AWSLoadBalancerSpec_To_v1alpha4_AWSLoadBalancerSpec(in *AWSLoadBalancerSpec, out *v1alpha4.AWSLoadBalancerSpec, s conversion.Scope) error { - out.Scheme = (*v1alpha4.ClassicELBScheme)(unsafe.Pointer(in.Scheme)) +func autoConvert_v1alpha3_AWSLoadBalancerSpec_To_v1beta1_AWSLoadBalancerSpec(in *AWSLoadBalancerSpec, out *v1beta1.AWSLoadBalancerSpec, s conversion.Scope) error { + out.Scheme = (*v1beta1.ClassicELBScheme)(unsafe.Pointer(in.Scheme)) out.CrossZoneLoadBalancing = in.CrossZoneLoadBalancing out.Subnets = *(*[]string)(unsafe.Pointer(&in.Subnets)) out.AdditionalSecurityGroups = *(*[]string)(unsafe.Pointer(&in.AdditionalSecurityGroups)) return nil } -// Convert_v1alpha3_AWSLoadBalancerSpec_To_v1alpha4_AWSLoadBalancerSpec is an autogenerated conversion function. -func Convert_v1alpha3_AWSLoadBalancerSpec_To_v1alpha4_AWSLoadBalancerSpec(in *AWSLoadBalancerSpec, out *v1alpha4.AWSLoadBalancerSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSLoadBalancerSpec_To_v1alpha4_AWSLoadBalancerSpec(in, out, s) +// Convert_v1alpha3_AWSLoadBalancerSpec_To_v1beta1_AWSLoadBalancerSpec is an autogenerated conversion function. +func Convert_v1alpha3_AWSLoadBalancerSpec_To_v1beta1_AWSLoadBalancerSpec(in *AWSLoadBalancerSpec, out *v1beta1.AWSLoadBalancerSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSLoadBalancerSpec_To_v1beta1_AWSLoadBalancerSpec(in, out, s) } -func autoConvert_v1alpha4_AWSLoadBalancerSpec_To_v1alpha3_AWSLoadBalancerSpec(in *v1alpha4.AWSLoadBalancerSpec, out *AWSLoadBalancerSpec, s conversion.Scope) error { +func autoConvert_v1beta1_AWSLoadBalancerSpec_To_v1alpha3_AWSLoadBalancerSpec(in *v1beta1.AWSLoadBalancerSpec, out *AWSLoadBalancerSpec, s conversion.Scope) error { out.Scheme = (*ClassicELBScheme)(unsafe.Pointer(in.Scheme)) out.CrossZoneLoadBalancing = in.CrossZoneLoadBalancing out.Subnets = *(*[]string)(unsafe.Pointer(&in.Subnets)) @@ -1008,50 +1042,50 @@ func autoConvert_v1alpha4_AWSLoadBalancerSpec_To_v1alpha3_AWSLoadBalancerSpec(in return nil } -// Convert_v1alpha4_AWSLoadBalancerSpec_To_v1alpha3_AWSLoadBalancerSpec is an autogenerated conversion function. -func Convert_v1alpha4_AWSLoadBalancerSpec_To_v1alpha3_AWSLoadBalancerSpec(in *v1alpha4.AWSLoadBalancerSpec, out *AWSLoadBalancerSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSLoadBalancerSpec_To_v1alpha3_AWSLoadBalancerSpec(in, out, s) +// Convert_v1beta1_AWSLoadBalancerSpec_To_v1alpha3_AWSLoadBalancerSpec is an autogenerated conversion function. +func Convert_v1beta1_AWSLoadBalancerSpec_To_v1alpha3_AWSLoadBalancerSpec(in *v1beta1.AWSLoadBalancerSpec, out *AWSLoadBalancerSpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSLoadBalancerSpec_To_v1alpha3_AWSLoadBalancerSpec(in, out, s) } -func autoConvert_v1alpha3_AWSMachine_To_v1alpha4_AWSMachine(in *AWSMachine, out *v1alpha4.AWSMachine, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSMachine_To_v1beta1_AWSMachine(in *AWSMachine, out *v1beta1.AWSMachine, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_AWSMachineSpec_To_v1alpha4_AWSMachineSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_AWSMachineSpec_To_v1beta1_AWSMachineSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha3_AWSMachineStatus_To_v1alpha4_AWSMachineStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_AWSMachineStatus_To_v1beta1_AWSMachineStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha3_AWSMachine_To_v1alpha4_AWSMachine is an autogenerated conversion function. -func Convert_v1alpha3_AWSMachine_To_v1alpha4_AWSMachine(in *AWSMachine, out *v1alpha4.AWSMachine, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSMachine_To_v1alpha4_AWSMachine(in, out, s) +// Convert_v1alpha3_AWSMachine_To_v1beta1_AWSMachine is an autogenerated conversion function. +func Convert_v1alpha3_AWSMachine_To_v1beta1_AWSMachine(in *AWSMachine, out *v1beta1.AWSMachine, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSMachine_To_v1beta1_AWSMachine(in, out, s) } -func autoConvert_v1alpha4_AWSMachine_To_v1alpha3_AWSMachine(in *v1alpha4.AWSMachine, out *AWSMachine, s conversion.Scope) error { +func autoConvert_v1beta1_AWSMachine_To_v1alpha3_AWSMachine(in *v1beta1.AWSMachine, out *AWSMachine, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha4_AWSMachineStatus_To_v1alpha3_AWSMachineStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_AWSMachineStatus_To_v1alpha3_AWSMachineStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha4_AWSMachine_To_v1alpha3_AWSMachine is an autogenerated conversion function. -func Convert_v1alpha4_AWSMachine_To_v1alpha3_AWSMachine(in *v1alpha4.AWSMachine, out *AWSMachine, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSMachine_To_v1alpha3_AWSMachine(in, out, s) +// Convert_v1beta1_AWSMachine_To_v1alpha3_AWSMachine is an autogenerated conversion function. +func Convert_v1beta1_AWSMachine_To_v1alpha3_AWSMachine(in *v1beta1.AWSMachine, out *AWSMachine, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachine_To_v1alpha3_AWSMachine(in, out, s) } -func autoConvert_v1alpha3_AWSMachineList_To_v1alpha4_AWSMachineList(in *AWSMachineList, out *v1alpha4.AWSMachineList, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSMachineList_To_v1beta1_AWSMachineList(in *AWSMachineList, out *v1beta1.AWSMachineList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha4.AWSMachine, len(*in)) + *out = make([]v1beta1.AWSMachine, len(*in)) for i := range *in { - if err := Convert_v1alpha3_AWSMachine_To_v1alpha4_AWSMachine(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_AWSMachine_To_v1beta1_AWSMachine(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1061,18 +1095,18 @@ func autoConvert_v1alpha3_AWSMachineList_To_v1alpha4_AWSMachineList(in *AWSMachi return nil } -// Convert_v1alpha3_AWSMachineList_To_v1alpha4_AWSMachineList is an autogenerated conversion function. -func Convert_v1alpha3_AWSMachineList_To_v1alpha4_AWSMachineList(in *AWSMachineList, out *v1alpha4.AWSMachineList, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSMachineList_To_v1alpha4_AWSMachineList(in, out, s) +// Convert_v1alpha3_AWSMachineList_To_v1beta1_AWSMachineList is an autogenerated conversion function. +func Convert_v1alpha3_AWSMachineList_To_v1beta1_AWSMachineList(in *AWSMachineList, out *v1beta1.AWSMachineList, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSMachineList_To_v1beta1_AWSMachineList(in, out, s) } -func autoConvert_v1alpha4_AWSMachineList_To_v1alpha3_AWSMachineList(in *v1alpha4.AWSMachineList, out *AWSMachineList, s conversion.Scope) error { +func autoConvert_v1beta1_AWSMachineList_To_v1alpha3_AWSMachineList(in *v1beta1.AWSMachineList, out *AWSMachineList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]AWSMachine, len(*in)) for i := range *in { - if err := Convert_v1alpha4_AWSMachine_To_v1alpha3_AWSMachine(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_AWSMachine_To_v1alpha3_AWSMachine(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1082,32 +1116,32 @@ func autoConvert_v1alpha4_AWSMachineList_To_v1alpha3_AWSMachineList(in *v1alpha4 return nil } -// Convert_v1alpha4_AWSMachineList_To_v1alpha3_AWSMachineList is an autogenerated conversion function. -func Convert_v1alpha4_AWSMachineList_To_v1alpha3_AWSMachineList(in *v1alpha4.AWSMachineList, out *AWSMachineList, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSMachineList_To_v1alpha3_AWSMachineList(in, out, s) +// Convert_v1beta1_AWSMachineList_To_v1alpha3_AWSMachineList is an autogenerated conversion function. +func Convert_v1beta1_AWSMachineList_To_v1alpha3_AWSMachineList(in *v1beta1.AWSMachineList, out *AWSMachineList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachineList_To_v1alpha3_AWSMachineList(in, out, s) } -func autoConvert_v1alpha3_AWSMachineSpec_To_v1alpha4_AWSMachineSpec(in *AWSMachineSpec, out *v1alpha4.AWSMachineSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSMachineSpec_To_v1beta1_AWSMachineSpec(in *AWSMachineSpec, out *v1beta1.AWSMachineSpec, s conversion.Scope) error { out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) out.InstanceID = (*string)(unsafe.Pointer(in.InstanceID)) - if err := Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AMIReference(&in.AMI, &out.AMI, s); err != nil { + if err := Convert_v1alpha3_AWSResourceReference_To_v1beta1_AMIReference(&in.AMI, &out.AMI, s); err != nil { return err } out.ImageLookupFormat = in.ImageLookupFormat out.ImageLookupOrg = in.ImageLookupOrg out.ImageLookupBaseOS = in.ImageLookupBaseOS out.InstanceType = in.InstanceType - out.AdditionalTags = *(*v1alpha4.Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.AdditionalTags = *(*v1beta1.Tags)(unsafe.Pointer(&in.AdditionalTags)) out.IAMInstanceProfile = in.IAMInstanceProfile out.PublicIP = (*bool)(unsafe.Pointer(in.PublicIP)) - out.AdditionalSecurityGroups = *(*[]v1alpha4.AWSResourceReference)(unsafe.Pointer(&in.AdditionalSecurityGroups)) + out.AdditionalSecurityGroups = *(*[]v1beta1.AWSResourceReference)(unsafe.Pointer(&in.AdditionalSecurityGroups)) out.FailureDomain = (*string)(unsafe.Pointer(in.FailureDomain)) - out.Subnet = (*v1alpha4.AWSResourceReference)(unsafe.Pointer(in.Subnet)) + out.Subnet = (*v1beta1.AWSResourceReference)(unsafe.Pointer(in.Subnet)) out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) if in.RootVolume != nil { in, out := &in.RootVolume, &out.RootVolume - *out = new(v1alpha4.Volume) - if err := Convert_v1alpha3_Volume_To_v1alpha4_Volume(*in, *out, s); err != nil { + *out = new(v1beta1.Volume) + if err := Convert_v1alpha3_Volume_To_v1beta1_Volume(*in, *out, s); err != nil { return err } } else { @@ -1115,9 +1149,9 @@ func autoConvert_v1alpha3_AWSMachineSpec_To_v1alpha4_AWSMachineSpec(in *AWSMachi } if in.NonRootVolumes != nil { in, out := &in.NonRootVolumes, &out.NonRootVolumes - *out = make([]v1alpha4.Volume, len(*in)) + *out = make([]v1beta1.Volume, len(*in)) for i := range *in { - if err := Convert_v1alpha3_Volume_To_v1alpha4_Volume(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_Volume_To_v1beta1_Volume(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1126,23 +1160,23 @@ func autoConvert_v1alpha3_AWSMachineSpec_To_v1alpha4_AWSMachineSpec(in *AWSMachi } out.NetworkInterfaces = *(*[]string)(unsafe.Pointer(&in.NetworkInterfaces)) out.UncompressedUserData = (*bool)(unsafe.Pointer(in.UncompressedUserData)) - if err := Convert_v1alpha3_CloudInit_To_v1alpha4_CloudInit(&in.CloudInit, &out.CloudInit, s); err != nil { + if err := Convert_v1alpha3_CloudInit_To_v1beta1_CloudInit(&in.CloudInit, &out.CloudInit, s); err != nil { return err } - out.SpotMarketOptions = (*v1alpha4.SpotMarketOptions)(unsafe.Pointer(in.SpotMarketOptions)) + out.SpotMarketOptions = (*v1beta1.SpotMarketOptions)(unsafe.Pointer(in.SpotMarketOptions)) out.Tenancy = in.Tenancy return nil } -// Convert_v1alpha3_AWSMachineSpec_To_v1alpha4_AWSMachineSpec is an autogenerated conversion function. -func Convert_v1alpha3_AWSMachineSpec_To_v1alpha4_AWSMachineSpec(in *AWSMachineSpec, out *v1alpha4.AWSMachineSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSMachineSpec_To_v1alpha4_AWSMachineSpec(in, out, s) +// Convert_v1alpha3_AWSMachineSpec_To_v1beta1_AWSMachineSpec is an autogenerated conversion function. +func Convert_v1alpha3_AWSMachineSpec_To_v1beta1_AWSMachineSpec(in *AWSMachineSpec, out *v1beta1.AWSMachineSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSMachineSpec_To_v1beta1_AWSMachineSpec(in, out, s) } -func autoConvert_v1alpha4_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(in *v1alpha4.AWSMachineSpec, out *AWSMachineSpec, s conversion.Scope) error { +func autoConvert_v1beta1_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(in *v1beta1.AWSMachineSpec, out *AWSMachineSpec, s conversion.Scope) error { out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) out.InstanceID = (*string)(unsafe.Pointer(in.InstanceID)) - if err := Convert_v1alpha4_AMIReference_To_v1alpha3_AWSResourceReference(&in.AMI, &out.AMI, s); err != nil { + if err := Convert_v1beta1_AMIReference_To_v1alpha3_AWSResourceReference(&in.AMI, &out.AMI, s); err != nil { return err } out.ImageLookupFormat = in.ImageLookupFormat @@ -1159,7 +1193,7 @@ func autoConvert_v1alpha4_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(in *v1alpha4 if in.RootVolume != nil { in, out := &in.RootVolume, &out.RootVolume *out = new(Volume) - if err := Convert_v1alpha4_Volume_To_v1alpha3_Volume(*in, *out, s); err != nil { + if err := Convert_v1beta1_Volume_To_v1alpha3_Volume(*in, *out, s); err != nil { return err } } else { @@ -1169,7 +1203,7 @@ func autoConvert_v1alpha4_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(in *v1alpha4 in, out := &in.NonRootVolumes, &out.NonRootVolumes *out = make([]Volume, len(*in)) for i := range *in { - if err := Convert_v1alpha4_Volume_To_v1alpha3_Volume(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_Volume_To_v1alpha3_Volume(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1178,7 +1212,7 @@ func autoConvert_v1alpha4_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(in *v1alpha4 } out.NetworkInterfaces = *(*[]string)(unsafe.Pointer(&in.NetworkInterfaces)) out.UncompressedUserData = (*bool)(unsafe.Pointer(in.UncompressedUserData)) - if err := Convert_v1alpha4_CloudInit_To_v1alpha3_CloudInit(&in.CloudInit, &out.CloudInit, s); err != nil { + if err := Convert_v1beta1_CloudInit_To_v1alpha3_CloudInit(&in.CloudInit, &out.CloudInit, s); err != nil { return err } out.SpotMarketOptions = (*SpotMarketOptions)(unsafe.Pointer(in.SpotMarketOptions)) @@ -1186,71 +1220,111 @@ func autoConvert_v1alpha4_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(in *v1alpha4 return nil } -func autoConvert_v1alpha3_AWSMachineStatus_To_v1alpha4_AWSMachineStatus(in *AWSMachineStatus, out *v1alpha4.AWSMachineStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSMachineStatus_To_v1beta1_AWSMachineStatus(in *AWSMachineStatus, out *v1beta1.AWSMachineStatus, s conversion.Scope) error { out.Ready = in.Ready out.Interruptible = in.Interruptible - out.Addresses = *(*[]apiv1alpha4.MachineAddress)(unsafe.Pointer(&in.Addresses)) - out.InstanceState = (*v1alpha4.InstanceState)(unsafe.Pointer(in.InstanceState)) + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]apiv1beta1.MachineAddress, len(*in)) + for i := range *in { + if err := apiv1alpha3.Convert_v1alpha3_MachineAddress_To_v1beta1_MachineAddress(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Addresses = nil + } + out.InstanceState = (*v1beta1.InstanceState)(unsafe.Pointer(in.InstanceState)) out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*apiv1alpha4.Conditions)(unsafe.Pointer(&in.Conditions)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(apiv1beta1.Conditions, len(*in)) + for i := range *in { + if err := apiv1alpha3.Convert_v1alpha3_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } return nil } -// Convert_v1alpha3_AWSMachineStatus_To_v1alpha4_AWSMachineStatus is an autogenerated conversion function. -func Convert_v1alpha3_AWSMachineStatus_To_v1alpha4_AWSMachineStatus(in *AWSMachineStatus, out *v1alpha4.AWSMachineStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSMachineStatus_To_v1alpha4_AWSMachineStatus(in, out, s) +// Convert_v1alpha3_AWSMachineStatus_To_v1beta1_AWSMachineStatus is an autogenerated conversion function. +func Convert_v1alpha3_AWSMachineStatus_To_v1beta1_AWSMachineStatus(in *AWSMachineStatus, out *v1beta1.AWSMachineStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSMachineStatus_To_v1beta1_AWSMachineStatus(in, out, s) } -func autoConvert_v1alpha4_AWSMachineStatus_To_v1alpha3_AWSMachineStatus(in *v1alpha4.AWSMachineStatus, out *AWSMachineStatus, s conversion.Scope) error { +func autoConvert_v1beta1_AWSMachineStatus_To_v1alpha3_AWSMachineStatus(in *v1beta1.AWSMachineStatus, out *AWSMachineStatus, s conversion.Scope) error { out.Ready = in.Ready out.Interruptible = in.Interruptible - out.Addresses = *(*[]apiv1alpha3.MachineAddress)(unsafe.Pointer(&in.Addresses)) + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]apiv1alpha3.MachineAddress, len(*in)) + for i := range *in { + if err := apiv1alpha3.Convert_v1beta1_MachineAddress_To_v1alpha3_MachineAddress(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Addresses = nil + } out.InstanceState = (*InstanceState)(unsafe.Pointer(in.InstanceState)) out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*apiv1alpha3.Conditions)(unsafe.Pointer(&in.Conditions)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(apiv1alpha3.Conditions, len(*in)) + for i := range *in { + if err := apiv1alpha3.Convert_v1beta1_Condition_To_v1alpha3_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } return nil } -// Convert_v1alpha4_AWSMachineStatus_To_v1alpha3_AWSMachineStatus is an autogenerated conversion function. -func Convert_v1alpha4_AWSMachineStatus_To_v1alpha3_AWSMachineStatus(in *v1alpha4.AWSMachineStatus, out *AWSMachineStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSMachineStatus_To_v1alpha3_AWSMachineStatus(in, out, s) +// Convert_v1beta1_AWSMachineStatus_To_v1alpha3_AWSMachineStatus is an autogenerated conversion function. +func Convert_v1beta1_AWSMachineStatus_To_v1alpha3_AWSMachineStatus(in *v1beta1.AWSMachineStatus, out *AWSMachineStatus, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachineStatus_To_v1alpha3_AWSMachineStatus(in, out, s) } -func autoConvert_v1alpha3_AWSMachineTemplate_To_v1alpha4_AWSMachineTemplate(in *AWSMachineTemplate, out *v1alpha4.AWSMachineTemplate, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(in *AWSMachineTemplate, out *v1beta1.AWSMachineTemplate, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_AWSMachineTemplateSpec_To_v1alpha4_AWSMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha3_AWSMachineTemplate_To_v1alpha4_AWSMachineTemplate is an autogenerated conversion function. -func Convert_v1alpha3_AWSMachineTemplate_To_v1alpha4_AWSMachineTemplate(in *AWSMachineTemplate, out *v1alpha4.AWSMachineTemplate, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSMachineTemplate_To_v1alpha4_AWSMachineTemplate(in, out, s) +// Convert_v1alpha3_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate is an autogenerated conversion function. +func Convert_v1alpha3_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(in *AWSMachineTemplate, out *v1beta1.AWSMachineTemplate, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(in, out, s) } -func autoConvert_v1alpha4_AWSMachineTemplate_To_v1alpha3_AWSMachineTemplate(in *v1alpha4.AWSMachineTemplate, out *AWSMachineTemplate, s conversion.Scope) error { +func autoConvert_v1beta1_AWSMachineTemplate_To_v1alpha3_AWSMachineTemplate(in *v1beta1.AWSMachineTemplate, out *AWSMachineTemplate, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_AWSMachineTemplateSpec_To_v1alpha3_AWSMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_AWSMachineTemplateSpec_To_v1alpha3_AWSMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha4_AWSMachineTemplate_To_v1alpha3_AWSMachineTemplate is an autogenerated conversion function. -func Convert_v1alpha4_AWSMachineTemplate_To_v1alpha3_AWSMachineTemplate(in *v1alpha4.AWSMachineTemplate, out *AWSMachineTemplate, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSMachineTemplate_To_v1alpha3_AWSMachineTemplate(in, out, s) +// Convert_v1beta1_AWSMachineTemplate_To_v1alpha3_AWSMachineTemplate is an autogenerated conversion function. +func Convert_v1beta1_AWSMachineTemplate_To_v1alpha3_AWSMachineTemplate(in *v1beta1.AWSMachineTemplate, out *AWSMachineTemplate, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachineTemplate_To_v1alpha3_AWSMachineTemplate(in, out, s) } -func autoConvert_v1alpha3_AWSMachineTemplateList_To_v1alpha4_AWSMachineTemplateList(in *AWSMachineTemplateList, out *v1alpha4.AWSMachineTemplateList, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList(in *AWSMachineTemplateList, out *v1beta1.AWSMachineTemplateList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha4.AWSMachineTemplate, len(*in)) + *out = make([]v1beta1.AWSMachineTemplate, len(*in)) for i := range *in { - if err := Convert_v1alpha3_AWSMachineTemplate_To_v1alpha4_AWSMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1260,18 +1334,18 @@ func autoConvert_v1alpha3_AWSMachineTemplateList_To_v1alpha4_AWSMachineTemplateL return nil } -// Convert_v1alpha3_AWSMachineTemplateList_To_v1alpha4_AWSMachineTemplateList is an autogenerated conversion function. -func Convert_v1alpha3_AWSMachineTemplateList_To_v1alpha4_AWSMachineTemplateList(in *AWSMachineTemplateList, out *v1alpha4.AWSMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSMachineTemplateList_To_v1alpha4_AWSMachineTemplateList(in, out, s) +// Convert_v1alpha3_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList is an autogenerated conversion function. +func Convert_v1alpha3_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList(in *AWSMachineTemplateList, out *v1beta1.AWSMachineTemplateList, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList(in, out, s) } -func autoConvert_v1alpha4_AWSMachineTemplateList_To_v1alpha3_AWSMachineTemplateList(in *v1alpha4.AWSMachineTemplateList, out *AWSMachineTemplateList, s conversion.Scope) error { +func autoConvert_v1beta1_AWSMachineTemplateList_To_v1alpha3_AWSMachineTemplateList(in *v1beta1.AWSMachineTemplateList, out *AWSMachineTemplateList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]AWSMachineTemplate, len(*in)) for i := range *in { - if err := Convert_v1alpha4_AWSMachineTemplate_To_v1alpha3_AWSMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_AWSMachineTemplate_To_v1alpha3_AWSMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1281,84 +1355,80 @@ func autoConvert_v1alpha4_AWSMachineTemplateList_To_v1alpha3_AWSMachineTemplateL return nil } -// Convert_v1alpha4_AWSMachineTemplateList_To_v1alpha3_AWSMachineTemplateList is an autogenerated conversion function. -func Convert_v1alpha4_AWSMachineTemplateList_To_v1alpha3_AWSMachineTemplateList(in *v1alpha4.AWSMachineTemplateList, out *AWSMachineTemplateList, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSMachineTemplateList_To_v1alpha3_AWSMachineTemplateList(in, out, s) +// Convert_v1beta1_AWSMachineTemplateList_To_v1alpha3_AWSMachineTemplateList is an autogenerated conversion function. +func Convert_v1beta1_AWSMachineTemplateList_To_v1alpha3_AWSMachineTemplateList(in *v1beta1.AWSMachineTemplateList, out *AWSMachineTemplateList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachineTemplateList_To_v1alpha3_AWSMachineTemplateList(in, out, s) } -func autoConvert_v1alpha3_AWSMachineTemplateResource_To_v1alpha4_AWSMachineTemplateResource(in *AWSMachineTemplateResource, out *v1alpha4.AWSMachineTemplateResource, s conversion.Scope) error { - if err := Convert_v1alpha3_AWSMachineSpec_To_v1alpha4_AWSMachineSpec(&in.Spec, &out.Spec, s); err != nil { +func autoConvert_v1alpha3_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource(in *AWSMachineTemplateResource, out *v1beta1.AWSMachineTemplateResource, s conversion.Scope) error { + if err := Convert_v1alpha3_AWSMachineSpec_To_v1beta1_AWSMachineSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha3_AWSMachineTemplateResource_To_v1alpha4_AWSMachineTemplateResource is an autogenerated conversion function. -func Convert_v1alpha3_AWSMachineTemplateResource_To_v1alpha4_AWSMachineTemplateResource(in *AWSMachineTemplateResource, out *v1alpha4.AWSMachineTemplateResource, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSMachineTemplateResource_To_v1alpha4_AWSMachineTemplateResource(in, out, s) +// Convert_v1alpha3_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource is an autogenerated conversion function. +func Convert_v1alpha3_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource(in *AWSMachineTemplateResource, out *v1beta1.AWSMachineTemplateResource, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource(in, out, s) } -func autoConvert_v1alpha4_AWSMachineTemplateResource_To_v1alpha3_AWSMachineTemplateResource(in *v1alpha4.AWSMachineTemplateResource, out *AWSMachineTemplateResource, s conversion.Scope) error { - if err := Convert_v1alpha4_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(&in.Spec, &out.Spec, s); err != nil { +func autoConvert_v1beta1_AWSMachineTemplateResource_To_v1alpha3_AWSMachineTemplateResource(in *v1beta1.AWSMachineTemplateResource, out *AWSMachineTemplateResource, s conversion.Scope) error { + // WARNING: in.ObjectMeta requires manual conversion: does not exist in peer-type + if err := Convert_v1beta1_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha4_AWSMachineTemplateResource_To_v1alpha3_AWSMachineTemplateResource is an autogenerated conversion function. -func Convert_v1alpha4_AWSMachineTemplateResource_To_v1alpha3_AWSMachineTemplateResource(in *v1alpha4.AWSMachineTemplateResource, out *AWSMachineTemplateResource, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSMachineTemplateResource_To_v1alpha3_AWSMachineTemplateResource(in, out, s) -} - -func autoConvert_v1alpha3_AWSMachineTemplateSpec_To_v1alpha4_AWSMachineTemplateSpec(in *AWSMachineTemplateSpec, out *v1alpha4.AWSMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha3_AWSMachineTemplateResource_To_v1alpha4_AWSMachineTemplateResource(&in.Template, &out.Template, s); err != nil { +func autoConvert_v1alpha3_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec(in *AWSMachineTemplateSpec, out *v1beta1.AWSMachineTemplateSpec, s conversion.Scope) error { + if err := Convert_v1alpha3_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource(&in.Template, &out.Template, s); err != nil { return err } return nil } -// Convert_v1alpha3_AWSMachineTemplateSpec_To_v1alpha4_AWSMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha3_AWSMachineTemplateSpec_To_v1alpha4_AWSMachineTemplateSpec(in *AWSMachineTemplateSpec, out *v1alpha4.AWSMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSMachineTemplateSpec_To_v1alpha4_AWSMachineTemplateSpec(in, out, s) +// Convert_v1alpha3_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec is an autogenerated conversion function. +func Convert_v1alpha3_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec(in *AWSMachineTemplateSpec, out *v1beta1.AWSMachineTemplateSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec(in, out, s) } -func autoConvert_v1alpha4_AWSMachineTemplateSpec_To_v1alpha3_AWSMachineTemplateSpec(in *v1alpha4.AWSMachineTemplateSpec, out *AWSMachineTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_AWSMachineTemplateResource_To_v1alpha3_AWSMachineTemplateResource(&in.Template, &out.Template, s); err != nil { +func autoConvert_v1beta1_AWSMachineTemplateSpec_To_v1alpha3_AWSMachineTemplateSpec(in *v1beta1.AWSMachineTemplateSpec, out *AWSMachineTemplateSpec, s conversion.Scope) error { + if err := Convert_v1beta1_AWSMachineTemplateResource_To_v1alpha3_AWSMachineTemplateResource(&in.Template, &out.Template, s); err != nil { return err } return nil } -// Convert_v1alpha4_AWSMachineTemplateSpec_To_v1alpha3_AWSMachineTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha4_AWSMachineTemplateSpec_To_v1alpha3_AWSMachineTemplateSpec(in *v1alpha4.AWSMachineTemplateSpec, out *AWSMachineTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSMachineTemplateSpec_To_v1alpha3_AWSMachineTemplateSpec(in, out, s) +// Convert_v1beta1_AWSMachineTemplateSpec_To_v1alpha3_AWSMachineTemplateSpec is an autogenerated conversion function. +func Convert_v1beta1_AWSMachineTemplateSpec_To_v1alpha3_AWSMachineTemplateSpec(in *v1beta1.AWSMachineTemplateSpec, out *AWSMachineTemplateSpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachineTemplateSpec_To_v1alpha3_AWSMachineTemplateSpec(in, out, s) } -func autoConvert_v1alpha3_AWSResourceReference_To_v1alpha4_AWSResourceReference(in *AWSResourceReference, out *v1alpha4.AWSResourceReference, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSResourceReference_To_v1beta1_AWSResourceReference(in *AWSResourceReference, out *v1beta1.AWSResourceReference, s conversion.Scope) error { out.ID = (*string)(unsafe.Pointer(in.ID)) out.ARN = (*string)(unsafe.Pointer(in.ARN)) - out.Filters = *(*[]v1alpha4.Filter)(unsafe.Pointer(&in.Filters)) + out.Filters = *(*[]v1beta1.Filter)(unsafe.Pointer(&in.Filters)) return nil } -// Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AWSResourceReference is an autogenerated conversion function. -func Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AWSResourceReference(in *AWSResourceReference, out *v1alpha4.AWSResourceReference, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSResourceReference_To_v1alpha4_AWSResourceReference(in, out, s) +// Convert_v1alpha3_AWSResourceReference_To_v1beta1_AWSResourceReference is an autogenerated conversion function. +func Convert_v1alpha3_AWSResourceReference_To_v1beta1_AWSResourceReference(in *AWSResourceReference, out *v1beta1.AWSResourceReference, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSResourceReference_To_v1beta1_AWSResourceReference(in, out, s) } -func autoConvert_v1alpha4_AWSResourceReference_To_v1alpha3_AWSResourceReference(in *v1alpha4.AWSResourceReference, out *AWSResourceReference, s conversion.Scope) error { +func autoConvert_v1beta1_AWSResourceReference_To_v1alpha3_AWSResourceReference(in *v1beta1.AWSResourceReference, out *AWSResourceReference, s conversion.Scope) error { out.ID = (*string)(unsafe.Pointer(in.ID)) out.ARN = (*string)(unsafe.Pointer(in.ARN)) out.Filters = *(*[]Filter)(unsafe.Pointer(&in.Filters)) return nil } -// Convert_v1alpha4_AWSResourceReference_To_v1alpha3_AWSResourceReference is an autogenerated conversion function. -func Convert_v1alpha4_AWSResourceReference_To_v1alpha3_AWSResourceReference(in *v1alpha4.AWSResourceReference, out *AWSResourceReference, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSResourceReference_To_v1alpha3_AWSResourceReference(in, out, s) +// Convert_v1beta1_AWSResourceReference_To_v1alpha3_AWSResourceReference is an autogenerated conversion function. +func Convert_v1beta1_AWSResourceReference_To_v1alpha3_AWSResourceReference(in *v1beta1.AWSResourceReference, out *AWSResourceReference, s conversion.Scope) error { + return autoConvert_v1beta1_AWSResourceReference_To_v1alpha3_AWSResourceReference(in, out, s) } -func autoConvert_v1alpha3_AWSRoleSpec_To_v1alpha4_AWSRoleSpec(in *AWSRoleSpec, out *v1alpha4.AWSRoleSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSRoleSpec_To_v1beta1_AWSRoleSpec(in *AWSRoleSpec, out *v1beta1.AWSRoleSpec, s conversion.Scope) error { out.RoleArn = in.RoleArn out.SessionName = in.SessionName out.DurationSeconds = in.DurationSeconds @@ -1367,12 +1437,12 @@ func autoConvert_v1alpha3_AWSRoleSpec_To_v1alpha4_AWSRoleSpec(in *AWSRoleSpec, o return nil } -// Convert_v1alpha3_AWSRoleSpec_To_v1alpha4_AWSRoleSpec is an autogenerated conversion function. -func Convert_v1alpha3_AWSRoleSpec_To_v1alpha4_AWSRoleSpec(in *AWSRoleSpec, out *v1alpha4.AWSRoleSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSRoleSpec_To_v1alpha4_AWSRoleSpec(in, out, s) +// Convert_v1alpha3_AWSRoleSpec_To_v1beta1_AWSRoleSpec is an autogenerated conversion function. +func Convert_v1alpha3_AWSRoleSpec_To_v1beta1_AWSRoleSpec(in *AWSRoleSpec, out *v1beta1.AWSRoleSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSRoleSpec_To_v1beta1_AWSRoleSpec(in, out, s) } -func autoConvert_v1alpha4_AWSRoleSpec_To_v1alpha3_AWSRoleSpec(in *v1alpha4.AWSRoleSpec, out *AWSRoleSpec, s conversion.Scope) error { +func autoConvert_v1beta1_AWSRoleSpec_To_v1alpha3_AWSRoleSpec(in *v1beta1.AWSRoleSpec, out *AWSRoleSpec, s conversion.Scope) error { out.RoleArn = in.RoleArn out.SessionName = in.SessionName out.DurationSeconds = in.DurationSeconds @@ -1381,34 +1451,34 @@ func autoConvert_v1alpha4_AWSRoleSpec_To_v1alpha3_AWSRoleSpec(in *v1alpha4.AWSRo return nil } -// Convert_v1alpha4_AWSRoleSpec_To_v1alpha3_AWSRoleSpec is an autogenerated conversion function. -func Convert_v1alpha4_AWSRoleSpec_To_v1alpha3_AWSRoleSpec(in *v1alpha4.AWSRoleSpec, out *AWSRoleSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSRoleSpec_To_v1alpha3_AWSRoleSpec(in, out, s) +// Convert_v1beta1_AWSRoleSpec_To_v1alpha3_AWSRoleSpec is an autogenerated conversion function. +func Convert_v1beta1_AWSRoleSpec_To_v1alpha3_AWSRoleSpec(in *v1beta1.AWSRoleSpec, out *AWSRoleSpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSRoleSpec_To_v1alpha3_AWSRoleSpec(in, out, s) } -func autoConvert_v1alpha3_AllowedNamespaces_To_v1alpha4_AllowedNamespaces(in *AllowedNamespaces, out *v1alpha4.AllowedNamespaces, s conversion.Scope) error { +func autoConvert_v1alpha3_AllowedNamespaces_To_v1beta1_AllowedNamespaces(in *AllowedNamespaces, out *v1beta1.AllowedNamespaces, s conversion.Scope) error { out.NamespaceList = *(*[]string)(unsafe.Pointer(&in.NamespaceList)) out.Selector = in.Selector return nil } -// Convert_v1alpha3_AllowedNamespaces_To_v1alpha4_AllowedNamespaces is an autogenerated conversion function. -func Convert_v1alpha3_AllowedNamespaces_To_v1alpha4_AllowedNamespaces(in *AllowedNamespaces, out *v1alpha4.AllowedNamespaces, s conversion.Scope) error { - return autoConvert_v1alpha3_AllowedNamespaces_To_v1alpha4_AllowedNamespaces(in, out, s) +// Convert_v1alpha3_AllowedNamespaces_To_v1beta1_AllowedNamespaces is an autogenerated conversion function. +func Convert_v1alpha3_AllowedNamespaces_To_v1beta1_AllowedNamespaces(in *AllowedNamespaces, out *v1beta1.AllowedNamespaces, s conversion.Scope) error { + return autoConvert_v1alpha3_AllowedNamespaces_To_v1beta1_AllowedNamespaces(in, out, s) } -func autoConvert_v1alpha4_AllowedNamespaces_To_v1alpha3_AllowedNamespaces(in *v1alpha4.AllowedNamespaces, out *AllowedNamespaces, s conversion.Scope) error { +func autoConvert_v1beta1_AllowedNamespaces_To_v1alpha3_AllowedNamespaces(in *v1beta1.AllowedNamespaces, out *AllowedNamespaces, s conversion.Scope) error { out.NamespaceList = *(*[]string)(unsafe.Pointer(&in.NamespaceList)) out.Selector = in.Selector return nil } -// Convert_v1alpha4_AllowedNamespaces_To_v1alpha3_AllowedNamespaces is an autogenerated conversion function. -func Convert_v1alpha4_AllowedNamespaces_To_v1alpha3_AllowedNamespaces(in *v1alpha4.AllowedNamespaces, out *AllowedNamespaces, s conversion.Scope) error { - return autoConvert_v1alpha4_AllowedNamespaces_To_v1alpha3_AllowedNamespaces(in, out, s) +// Convert_v1beta1_AllowedNamespaces_To_v1alpha3_AllowedNamespaces is an autogenerated conversion function. +func Convert_v1beta1_AllowedNamespaces_To_v1alpha3_AllowedNamespaces(in *v1beta1.AllowedNamespaces, out *AllowedNamespaces, s conversion.Scope) error { + return autoConvert_v1beta1_AllowedNamespaces_To_v1alpha3_AllowedNamespaces(in, out, s) } -func autoConvert_v1alpha3_Bastion_To_v1alpha4_Bastion(in *Bastion, out *v1alpha4.Bastion, s conversion.Scope) error { +func autoConvert_v1alpha3_Bastion_To_v1beta1_Bastion(in *Bastion, out *v1beta1.Bastion, s conversion.Scope) error { out.Enabled = in.Enabled out.DisableIngressRules = in.DisableIngressRules out.AllowedCIDRBlocks = *(*[]string)(unsafe.Pointer(&in.AllowedCIDRBlocks)) @@ -1417,12 +1487,12 @@ func autoConvert_v1alpha3_Bastion_To_v1alpha4_Bastion(in *Bastion, out *v1alpha4 return nil } -// Convert_v1alpha3_Bastion_To_v1alpha4_Bastion is an autogenerated conversion function. -func Convert_v1alpha3_Bastion_To_v1alpha4_Bastion(in *Bastion, out *v1alpha4.Bastion, s conversion.Scope) error { - return autoConvert_v1alpha3_Bastion_To_v1alpha4_Bastion(in, out, s) +// Convert_v1alpha3_Bastion_To_v1beta1_Bastion is an autogenerated conversion function. +func Convert_v1alpha3_Bastion_To_v1beta1_Bastion(in *Bastion, out *v1beta1.Bastion, s conversion.Scope) error { + return autoConvert_v1alpha3_Bastion_To_v1beta1_Bastion(in, out, s) } -func autoConvert_v1alpha4_Bastion_To_v1alpha3_Bastion(in *v1alpha4.Bastion, out *Bastion, s conversion.Scope) error { +func autoConvert_v1beta1_Bastion_To_v1alpha3_Bastion(in *v1beta1.Bastion, out *Bastion, s conversion.Scope) error { out.Enabled = in.Enabled out.DisableIngressRules = in.DisableIngressRules out.AllowedCIDRBlocks = *(*[]string)(unsafe.Pointer(&in.AllowedCIDRBlocks)) @@ -1431,27 +1501,27 @@ func autoConvert_v1alpha4_Bastion_To_v1alpha3_Bastion(in *v1alpha4.Bastion, out return nil } -// Convert_v1alpha4_Bastion_To_v1alpha3_Bastion is an autogenerated conversion function. -func Convert_v1alpha4_Bastion_To_v1alpha3_Bastion(in *v1alpha4.Bastion, out *Bastion, s conversion.Scope) error { - return autoConvert_v1alpha4_Bastion_To_v1alpha3_Bastion(in, out, s) +// Convert_v1beta1_Bastion_To_v1alpha3_Bastion is an autogenerated conversion function. +func Convert_v1beta1_Bastion_To_v1alpha3_Bastion(in *v1beta1.Bastion, out *Bastion, s conversion.Scope) error { + return autoConvert_v1beta1_Bastion_To_v1alpha3_Bastion(in, out, s) } -func autoConvert_v1alpha3_BuildParams_To_v1alpha4_BuildParams(in *BuildParams, out *v1alpha4.BuildParams, s conversion.Scope) error { - out.Lifecycle = v1alpha4.ResourceLifecycle(in.Lifecycle) +func autoConvert_v1alpha3_BuildParams_To_v1beta1_BuildParams(in *BuildParams, out *v1beta1.BuildParams, s conversion.Scope) error { + out.Lifecycle = v1beta1.ResourceLifecycle(in.Lifecycle) out.ClusterName = in.ClusterName out.ResourceID = in.ResourceID out.Name = (*string)(unsafe.Pointer(in.Name)) out.Role = (*string)(unsafe.Pointer(in.Role)) - out.Additional = *(*v1alpha4.Tags)(unsafe.Pointer(&in.Additional)) + out.Additional = *(*v1beta1.Tags)(unsafe.Pointer(&in.Additional)) return nil } -// Convert_v1alpha3_BuildParams_To_v1alpha4_BuildParams is an autogenerated conversion function. -func Convert_v1alpha3_BuildParams_To_v1alpha4_BuildParams(in *BuildParams, out *v1alpha4.BuildParams, s conversion.Scope) error { - return autoConvert_v1alpha3_BuildParams_To_v1alpha4_BuildParams(in, out, s) +// Convert_v1alpha3_BuildParams_To_v1beta1_BuildParams is an autogenerated conversion function. +func Convert_v1alpha3_BuildParams_To_v1beta1_BuildParams(in *BuildParams, out *v1beta1.BuildParams, s conversion.Scope) error { + return autoConvert_v1alpha3_BuildParams_To_v1beta1_BuildParams(in, out, s) } -func autoConvert_v1alpha4_BuildParams_To_v1alpha3_BuildParams(in *v1alpha4.BuildParams, out *BuildParams, s conversion.Scope) error { +func autoConvert_v1beta1_BuildParams_To_v1alpha3_BuildParams(in *v1beta1.BuildParams, out *BuildParams, s conversion.Scope) error { out.Lifecycle = ResourceLifecycle(in.Lifecycle) out.ClusterName = in.ClusterName out.ResourceID = in.ResourceID @@ -1461,25 +1531,25 @@ func autoConvert_v1alpha4_BuildParams_To_v1alpha3_BuildParams(in *v1alpha4.Build return nil } -// Convert_v1alpha4_BuildParams_To_v1alpha3_BuildParams is an autogenerated conversion function. -func Convert_v1alpha4_BuildParams_To_v1alpha3_BuildParams(in *v1alpha4.BuildParams, out *BuildParams, s conversion.Scope) error { - return autoConvert_v1alpha4_BuildParams_To_v1alpha3_BuildParams(in, out, s) +// Convert_v1beta1_BuildParams_To_v1alpha3_BuildParams is an autogenerated conversion function. +func Convert_v1beta1_BuildParams_To_v1alpha3_BuildParams(in *v1beta1.BuildParams, out *BuildParams, s conversion.Scope) error { + return autoConvert_v1beta1_BuildParams_To_v1alpha3_BuildParams(in, out, s) } -func autoConvert_v1alpha3_CNIIngressRule_To_v1alpha4_CNIIngressRule(in *CNIIngressRule, out *v1alpha4.CNIIngressRule, s conversion.Scope) error { +func autoConvert_v1alpha3_CNIIngressRule_To_v1beta1_CNIIngressRule(in *CNIIngressRule, out *v1beta1.CNIIngressRule, s conversion.Scope) error { out.Description = in.Description - out.Protocol = v1alpha4.SecurityGroupProtocol(in.Protocol) + out.Protocol = v1beta1.SecurityGroupProtocol(in.Protocol) out.FromPort = in.FromPort out.ToPort = in.ToPort return nil } -// Convert_v1alpha3_CNIIngressRule_To_v1alpha4_CNIIngressRule is an autogenerated conversion function. -func Convert_v1alpha3_CNIIngressRule_To_v1alpha4_CNIIngressRule(in *CNIIngressRule, out *v1alpha4.CNIIngressRule, s conversion.Scope) error { - return autoConvert_v1alpha3_CNIIngressRule_To_v1alpha4_CNIIngressRule(in, out, s) +// Convert_v1alpha3_CNIIngressRule_To_v1beta1_CNIIngressRule is an autogenerated conversion function. +func Convert_v1alpha3_CNIIngressRule_To_v1beta1_CNIIngressRule(in *CNIIngressRule, out *v1beta1.CNIIngressRule, s conversion.Scope) error { + return autoConvert_v1alpha3_CNIIngressRule_To_v1beta1_CNIIngressRule(in, out, s) } -func autoConvert_v1alpha4_CNIIngressRule_To_v1alpha3_CNIIngressRule(in *v1alpha4.CNIIngressRule, out *CNIIngressRule, s conversion.Scope) error { +func autoConvert_v1beta1_CNIIngressRule_To_v1alpha3_CNIIngressRule(in *v1beta1.CNIIngressRule, out *CNIIngressRule, s conversion.Scope) error { out.Description = in.Description out.Protocol = SecurityGroupProtocol(in.Protocol) out.FromPort = in.FromPort @@ -1487,53 +1557,53 @@ func autoConvert_v1alpha4_CNIIngressRule_To_v1alpha3_CNIIngressRule(in *v1alpha4 return nil } -// Convert_v1alpha4_CNIIngressRule_To_v1alpha3_CNIIngressRule is an autogenerated conversion function. -func Convert_v1alpha4_CNIIngressRule_To_v1alpha3_CNIIngressRule(in *v1alpha4.CNIIngressRule, out *CNIIngressRule, s conversion.Scope) error { - return autoConvert_v1alpha4_CNIIngressRule_To_v1alpha3_CNIIngressRule(in, out, s) +// Convert_v1beta1_CNIIngressRule_To_v1alpha3_CNIIngressRule is an autogenerated conversion function. +func Convert_v1beta1_CNIIngressRule_To_v1alpha3_CNIIngressRule(in *v1beta1.CNIIngressRule, out *CNIIngressRule, s conversion.Scope) error { + return autoConvert_v1beta1_CNIIngressRule_To_v1alpha3_CNIIngressRule(in, out, s) } -func autoConvert_v1alpha3_CNISpec_To_v1alpha4_CNISpec(in *CNISpec, out *v1alpha4.CNISpec, s conversion.Scope) error { - out.CNIIngressRules = *(*v1alpha4.CNIIngressRules)(unsafe.Pointer(&in.CNIIngressRules)) +func autoConvert_v1alpha3_CNISpec_To_v1beta1_CNISpec(in *CNISpec, out *v1beta1.CNISpec, s conversion.Scope) error { + out.CNIIngressRules = *(*v1beta1.CNIIngressRules)(unsafe.Pointer(&in.CNIIngressRules)) return nil } -// Convert_v1alpha3_CNISpec_To_v1alpha4_CNISpec is an autogenerated conversion function. -func Convert_v1alpha3_CNISpec_To_v1alpha4_CNISpec(in *CNISpec, out *v1alpha4.CNISpec, s conversion.Scope) error { - return autoConvert_v1alpha3_CNISpec_To_v1alpha4_CNISpec(in, out, s) +// Convert_v1alpha3_CNISpec_To_v1beta1_CNISpec is an autogenerated conversion function. +func Convert_v1alpha3_CNISpec_To_v1beta1_CNISpec(in *CNISpec, out *v1beta1.CNISpec, s conversion.Scope) error { + return autoConvert_v1alpha3_CNISpec_To_v1beta1_CNISpec(in, out, s) } -func autoConvert_v1alpha4_CNISpec_To_v1alpha3_CNISpec(in *v1alpha4.CNISpec, out *CNISpec, s conversion.Scope) error { +func autoConvert_v1beta1_CNISpec_To_v1alpha3_CNISpec(in *v1beta1.CNISpec, out *CNISpec, s conversion.Scope) error { out.CNIIngressRules = *(*CNIIngressRules)(unsafe.Pointer(&in.CNIIngressRules)) return nil } -// Convert_v1alpha4_CNISpec_To_v1alpha3_CNISpec is an autogenerated conversion function. -func Convert_v1alpha4_CNISpec_To_v1alpha3_CNISpec(in *v1alpha4.CNISpec, out *CNISpec, s conversion.Scope) error { - return autoConvert_v1alpha4_CNISpec_To_v1alpha3_CNISpec(in, out, s) +// Convert_v1beta1_CNISpec_To_v1alpha3_CNISpec is an autogenerated conversion function. +func Convert_v1beta1_CNISpec_To_v1alpha3_CNISpec(in *v1beta1.CNISpec, out *CNISpec, s conversion.Scope) error { + return autoConvert_v1beta1_CNISpec_To_v1alpha3_CNISpec(in, out, s) } -func autoConvert_v1alpha3_ClassicELB_To_v1alpha4_ClassicELB(in *ClassicELB, out *v1alpha4.ClassicELB, s conversion.Scope) error { +func autoConvert_v1alpha3_ClassicELB_To_v1beta1_ClassicELB(in *ClassicELB, out *v1beta1.ClassicELB, s conversion.Scope) error { out.Name = in.Name out.DNSName = in.DNSName - out.Scheme = v1alpha4.ClassicELBScheme(in.Scheme) + out.Scheme = v1beta1.ClassicELBScheme(in.Scheme) out.AvailabilityZones = *(*[]string)(unsafe.Pointer(&in.AvailabilityZones)) out.SubnetIDs = *(*[]string)(unsafe.Pointer(&in.SubnetIDs)) out.SecurityGroupIDs = *(*[]string)(unsafe.Pointer(&in.SecurityGroupIDs)) - out.Listeners = *(*[]v1alpha4.ClassicELBListener)(unsafe.Pointer(&in.Listeners)) - out.HealthCheck = (*v1alpha4.ClassicELBHealthCheck)(unsafe.Pointer(in.HealthCheck)) - if err := Convert_v1alpha3_ClassicELBAttributes_To_v1alpha4_ClassicELBAttributes(&in.Attributes, &out.Attributes, s); err != nil { + out.Listeners = *(*[]v1beta1.ClassicELBListener)(unsafe.Pointer(&in.Listeners)) + out.HealthCheck = (*v1beta1.ClassicELBHealthCheck)(unsafe.Pointer(in.HealthCheck)) + if err := Convert_v1alpha3_ClassicELBAttributes_To_v1beta1_ClassicELBAttributes(&in.Attributes, &out.Attributes, s); err != nil { return err } out.Tags = *(*map[string]string)(unsafe.Pointer(&in.Tags)) return nil } -// Convert_v1alpha3_ClassicELB_To_v1alpha4_ClassicELB is an autogenerated conversion function. -func Convert_v1alpha3_ClassicELB_To_v1alpha4_ClassicELB(in *ClassicELB, out *v1alpha4.ClassicELB, s conversion.Scope) error { - return autoConvert_v1alpha3_ClassicELB_To_v1alpha4_ClassicELB(in, out, s) +// Convert_v1alpha3_ClassicELB_To_v1beta1_ClassicELB is an autogenerated conversion function. +func Convert_v1alpha3_ClassicELB_To_v1beta1_ClassicELB(in *ClassicELB, out *v1beta1.ClassicELB, s conversion.Scope) error { + return autoConvert_v1alpha3_ClassicELB_To_v1beta1_ClassicELB(in, out, s) } -func autoConvert_v1alpha4_ClassicELB_To_v1alpha3_ClassicELB(in *v1alpha4.ClassicELB, out *ClassicELB, s conversion.Scope) error { +func autoConvert_v1beta1_ClassicELB_To_v1alpha3_ClassicELB(in *v1beta1.ClassicELB, out *ClassicELB, s conversion.Scope) error { out.Name = in.Name out.DNSName = in.DNSName out.Scheme = ClassicELBScheme(in.Scheme) @@ -1542,41 +1612,41 @@ func autoConvert_v1alpha4_ClassicELB_To_v1alpha3_ClassicELB(in *v1alpha4.Classic out.SecurityGroupIDs = *(*[]string)(unsafe.Pointer(&in.SecurityGroupIDs)) out.Listeners = *(*[]ClassicELBListener)(unsafe.Pointer(&in.Listeners)) out.HealthCheck = (*ClassicELBHealthCheck)(unsafe.Pointer(in.HealthCheck)) - if err := Convert_v1alpha4_ClassicELBAttributes_To_v1alpha3_ClassicELBAttributes(&in.Attributes, &out.Attributes, s); err != nil { + if err := Convert_v1beta1_ClassicELBAttributes_To_v1alpha3_ClassicELBAttributes(&in.Attributes, &out.Attributes, s); err != nil { return err } out.Tags = *(*map[string]string)(unsafe.Pointer(&in.Tags)) return nil } -// Convert_v1alpha4_ClassicELB_To_v1alpha3_ClassicELB is an autogenerated conversion function. -func Convert_v1alpha4_ClassicELB_To_v1alpha3_ClassicELB(in *v1alpha4.ClassicELB, out *ClassicELB, s conversion.Scope) error { - return autoConvert_v1alpha4_ClassicELB_To_v1alpha3_ClassicELB(in, out, s) +// Convert_v1beta1_ClassicELB_To_v1alpha3_ClassicELB is an autogenerated conversion function. +func Convert_v1beta1_ClassicELB_To_v1alpha3_ClassicELB(in *v1beta1.ClassicELB, out *ClassicELB, s conversion.Scope) error { + return autoConvert_v1beta1_ClassicELB_To_v1alpha3_ClassicELB(in, out, s) } -func autoConvert_v1alpha3_ClassicELBAttributes_To_v1alpha4_ClassicELBAttributes(in *ClassicELBAttributes, out *v1alpha4.ClassicELBAttributes, s conversion.Scope) error { +func autoConvert_v1alpha3_ClassicELBAttributes_To_v1beta1_ClassicELBAttributes(in *ClassicELBAttributes, out *v1beta1.ClassicELBAttributes, s conversion.Scope) error { out.IdleTimeout = time.Duration(in.IdleTimeout) out.CrossZoneLoadBalancing = in.CrossZoneLoadBalancing return nil } -// Convert_v1alpha3_ClassicELBAttributes_To_v1alpha4_ClassicELBAttributes is an autogenerated conversion function. -func Convert_v1alpha3_ClassicELBAttributes_To_v1alpha4_ClassicELBAttributes(in *ClassicELBAttributes, out *v1alpha4.ClassicELBAttributes, s conversion.Scope) error { - return autoConvert_v1alpha3_ClassicELBAttributes_To_v1alpha4_ClassicELBAttributes(in, out, s) +// Convert_v1alpha3_ClassicELBAttributes_To_v1beta1_ClassicELBAttributes is an autogenerated conversion function. +func Convert_v1alpha3_ClassicELBAttributes_To_v1beta1_ClassicELBAttributes(in *ClassicELBAttributes, out *v1beta1.ClassicELBAttributes, s conversion.Scope) error { + return autoConvert_v1alpha3_ClassicELBAttributes_To_v1beta1_ClassicELBAttributes(in, out, s) } -func autoConvert_v1alpha4_ClassicELBAttributes_To_v1alpha3_ClassicELBAttributes(in *v1alpha4.ClassicELBAttributes, out *ClassicELBAttributes, s conversion.Scope) error { +func autoConvert_v1beta1_ClassicELBAttributes_To_v1alpha3_ClassicELBAttributes(in *v1beta1.ClassicELBAttributes, out *ClassicELBAttributes, s conversion.Scope) error { out.IdleTimeout = time.Duration(in.IdleTimeout) out.CrossZoneLoadBalancing = in.CrossZoneLoadBalancing return nil } -// Convert_v1alpha4_ClassicELBAttributes_To_v1alpha3_ClassicELBAttributes is an autogenerated conversion function. -func Convert_v1alpha4_ClassicELBAttributes_To_v1alpha3_ClassicELBAttributes(in *v1alpha4.ClassicELBAttributes, out *ClassicELBAttributes, s conversion.Scope) error { - return autoConvert_v1alpha4_ClassicELBAttributes_To_v1alpha3_ClassicELBAttributes(in, out, s) +// Convert_v1beta1_ClassicELBAttributes_To_v1alpha3_ClassicELBAttributes is an autogenerated conversion function. +func Convert_v1beta1_ClassicELBAttributes_To_v1alpha3_ClassicELBAttributes(in *v1beta1.ClassicELBAttributes, out *ClassicELBAttributes, s conversion.Scope) error { + return autoConvert_v1beta1_ClassicELBAttributes_To_v1alpha3_ClassicELBAttributes(in, out, s) } -func autoConvert_v1alpha3_ClassicELBHealthCheck_To_v1alpha4_ClassicELBHealthCheck(in *ClassicELBHealthCheck, out *v1alpha4.ClassicELBHealthCheck, s conversion.Scope) error { +func autoConvert_v1alpha3_ClassicELBHealthCheck_To_v1beta1_ClassicELBHealthCheck(in *ClassicELBHealthCheck, out *v1beta1.ClassicELBHealthCheck, s conversion.Scope) error { out.Target = in.Target out.Interval = time.Duration(in.Interval) out.Timeout = time.Duration(in.Timeout) @@ -1585,12 +1655,12 @@ func autoConvert_v1alpha3_ClassicELBHealthCheck_To_v1alpha4_ClassicELBHealthChec return nil } -// Convert_v1alpha3_ClassicELBHealthCheck_To_v1alpha4_ClassicELBHealthCheck is an autogenerated conversion function. -func Convert_v1alpha3_ClassicELBHealthCheck_To_v1alpha4_ClassicELBHealthCheck(in *ClassicELBHealthCheck, out *v1alpha4.ClassicELBHealthCheck, s conversion.Scope) error { - return autoConvert_v1alpha3_ClassicELBHealthCheck_To_v1alpha4_ClassicELBHealthCheck(in, out, s) +// Convert_v1alpha3_ClassicELBHealthCheck_To_v1beta1_ClassicELBHealthCheck is an autogenerated conversion function. +func Convert_v1alpha3_ClassicELBHealthCheck_To_v1beta1_ClassicELBHealthCheck(in *ClassicELBHealthCheck, out *v1beta1.ClassicELBHealthCheck, s conversion.Scope) error { + return autoConvert_v1alpha3_ClassicELBHealthCheck_To_v1beta1_ClassicELBHealthCheck(in, out, s) } -func autoConvert_v1alpha4_ClassicELBHealthCheck_To_v1alpha3_ClassicELBHealthCheck(in *v1alpha4.ClassicELBHealthCheck, out *ClassicELBHealthCheck, s conversion.Scope) error { +func autoConvert_v1beta1_ClassicELBHealthCheck_To_v1alpha3_ClassicELBHealthCheck(in *v1beta1.ClassicELBHealthCheck, out *ClassicELBHealthCheck, s conversion.Scope) error { out.Target = in.Target out.Interval = time.Duration(in.Interval) out.Timeout = time.Duration(in.Timeout) @@ -1599,25 +1669,25 @@ func autoConvert_v1alpha4_ClassicELBHealthCheck_To_v1alpha3_ClassicELBHealthChec return nil } -// Convert_v1alpha4_ClassicELBHealthCheck_To_v1alpha3_ClassicELBHealthCheck is an autogenerated conversion function. -func Convert_v1alpha4_ClassicELBHealthCheck_To_v1alpha3_ClassicELBHealthCheck(in *v1alpha4.ClassicELBHealthCheck, out *ClassicELBHealthCheck, s conversion.Scope) error { - return autoConvert_v1alpha4_ClassicELBHealthCheck_To_v1alpha3_ClassicELBHealthCheck(in, out, s) +// Convert_v1beta1_ClassicELBHealthCheck_To_v1alpha3_ClassicELBHealthCheck is an autogenerated conversion function. +func Convert_v1beta1_ClassicELBHealthCheck_To_v1alpha3_ClassicELBHealthCheck(in *v1beta1.ClassicELBHealthCheck, out *ClassicELBHealthCheck, s conversion.Scope) error { + return autoConvert_v1beta1_ClassicELBHealthCheck_To_v1alpha3_ClassicELBHealthCheck(in, out, s) } -func autoConvert_v1alpha3_ClassicELBListener_To_v1alpha4_ClassicELBListener(in *ClassicELBListener, out *v1alpha4.ClassicELBListener, s conversion.Scope) error { - out.Protocol = v1alpha4.ClassicELBProtocol(in.Protocol) +func autoConvert_v1alpha3_ClassicELBListener_To_v1beta1_ClassicELBListener(in *ClassicELBListener, out *v1beta1.ClassicELBListener, s conversion.Scope) error { + out.Protocol = v1beta1.ClassicELBProtocol(in.Protocol) out.Port = in.Port - out.InstanceProtocol = v1alpha4.ClassicELBProtocol(in.InstanceProtocol) + out.InstanceProtocol = v1beta1.ClassicELBProtocol(in.InstanceProtocol) out.InstancePort = in.InstancePort return nil } -// Convert_v1alpha3_ClassicELBListener_To_v1alpha4_ClassicELBListener is an autogenerated conversion function. -func Convert_v1alpha3_ClassicELBListener_To_v1alpha4_ClassicELBListener(in *ClassicELBListener, out *v1alpha4.ClassicELBListener, s conversion.Scope) error { - return autoConvert_v1alpha3_ClassicELBListener_To_v1alpha4_ClassicELBListener(in, out, s) +// Convert_v1alpha3_ClassicELBListener_To_v1beta1_ClassicELBListener is an autogenerated conversion function. +func Convert_v1alpha3_ClassicELBListener_To_v1beta1_ClassicELBListener(in *ClassicELBListener, out *v1beta1.ClassicELBListener, s conversion.Scope) error { + return autoConvert_v1alpha3_ClassicELBListener_To_v1beta1_ClassicELBListener(in, out, s) } -func autoConvert_v1alpha4_ClassicELBListener_To_v1alpha3_ClassicELBListener(in *v1alpha4.ClassicELBListener, out *ClassicELBListener, s conversion.Scope) error { +func autoConvert_v1beta1_ClassicELBListener_To_v1alpha3_ClassicELBListener(in *v1beta1.ClassicELBListener, out *ClassicELBListener, s conversion.Scope) error { out.Protocol = ClassicELBProtocol(in.Protocol) out.Port = in.Port out.InstanceProtocol = ClassicELBProtocol(in.InstanceProtocol) @@ -1625,25 +1695,25 @@ func autoConvert_v1alpha4_ClassicELBListener_To_v1alpha3_ClassicELBListener(in * return nil } -// Convert_v1alpha4_ClassicELBListener_To_v1alpha3_ClassicELBListener is an autogenerated conversion function. -func Convert_v1alpha4_ClassicELBListener_To_v1alpha3_ClassicELBListener(in *v1alpha4.ClassicELBListener, out *ClassicELBListener, s conversion.Scope) error { - return autoConvert_v1alpha4_ClassicELBListener_To_v1alpha3_ClassicELBListener(in, out, s) +// Convert_v1beta1_ClassicELBListener_To_v1alpha3_ClassicELBListener is an autogenerated conversion function. +func Convert_v1beta1_ClassicELBListener_To_v1alpha3_ClassicELBListener(in *v1beta1.ClassicELBListener, out *ClassicELBListener, s conversion.Scope) error { + return autoConvert_v1beta1_ClassicELBListener_To_v1alpha3_ClassicELBListener(in, out, s) } -func autoConvert_v1alpha3_CloudInit_To_v1alpha4_CloudInit(in *CloudInit, out *v1alpha4.CloudInit, s conversion.Scope) error { +func autoConvert_v1alpha3_CloudInit_To_v1beta1_CloudInit(in *CloudInit, out *v1beta1.CloudInit, s conversion.Scope) error { out.InsecureSkipSecretsManager = in.InsecureSkipSecretsManager out.SecretCount = in.SecretCount out.SecretPrefix = in.SecretPrefix - out.SecureSecretsBackend = v1alpha4.SecretBackend(in.SecureSecretsBackend) + out.SecureSecretsBackend = v1beta1.SecretBackend(in.SecureSecretsBackend) return nil } -// Convert_v1alpha3_CloudInit_To_v1alpha4_CloudInit is an autogenerated conversion function. -func Convert_v1alpha3_CloudInit_To_v1alpha4_CloudInit(in *CloudInit, out *v1alpha4.CloudInit, s conversion.Scope) error { - return autoConvert_v1alpha3_CloudInit_To_v1alpha4_CloudInit(in, out, s) +// Convert_v1alpha3_CloudInit_To_v1beta1_CloudInit is an autogenerated conversion function. +func Convert_v1alpha3_CloudInit_To_v1beta1_CloudInit(in *CloudInit, out *v1beta1.CloudInit, s conversion.Scope) error { + return autoConvert_v1alpha3_CloudInit_To_v1beta1_CloudInit(in, out, s) } -func autoConvert_v1alpha4_CloudInit_To_v1alpha3_CloudInit(in *v1alpha4.CloudInit, out *CloudInit, s conversion.Scope) error { +func autoConvert_v1beta1_CloudInit_To_v1alpha3_CloudInit(in *v1beta1.CloudInit, out *CloudInit, s conversion.Scope) error { out.InsecureSkipSecretsManager = in.InsecureSkipSecretsManager out.SecretCount = in.SecretCount out.SecretPrefix = in.SecretPrefix @@ -1651,36 +1721,36 @@ func autoConvert_v1alpha4_CloudInit_To_v1alpha3_CloudInit(in *v1alpha4.CloudInit return nil } -// Convert_v1alpha4_CloudInit_To_v1alpha3_CloudInit is an autogenerated conversion function. -func Convert_v1alpha4_CloudInit_To_v1alpha3_CloudInit(in *v1alpha4.CloudInit, out *CloudInit, s conversion.Scope) error { - return autoConvert_v1alpha4_CloudInit_To_v1alpha3_CloudInit(in, out, s) +// Convert_v1beta1_CloudInit_To_v1alpha3_CloudInit is an autogenerated conversion function. +func Convert_v1beta1_CloudInit_To_v1alpha3_CloudInit(in *v1beta1.CloudInit, out *CloudInit, s conversion.Scope) error { + return autoConvert_v1beta1_CloudInit_To_v1alpha3_CloudInit(in, out, s) } -func autoConvert_v1alpha3_Filter_To_v1alpha4_Filter(in *Filter, out *v1alpha4.Filter, s conversion.Scope) error { +func autoConvert_v1alpha3_Filter_To_v1beta1_Filter(in *Filter, out *v1beta1.Filter, s conversion.Scope) error { out.Name = in.Name out.Values = *(*[]string)(unsafe.Pointer(&in.Values)) return nil } -// Convert_v1alpha3_Filter_To_v1alpha4_Filter is an autogenerated conversion function. -func Convert_v1alpha3_Filter_To_v1alpha4_Filter(in *Filter, out *v1alpha4.Filter, s conversion.Scope) error { - return autoConvert_v1alpha3_Filter_To_v1alpha4_Filter(in, out, s) +// Convert_v1alpha3_Filter_To_v1beta1_Filter is an autogenerated conversion function. +func Convert_v1alpha3_Filter_To_v1beta1_Filter(in *Filter, out *v1beta1.Filter, s conversion.Scope) error { + return autoConvert_v1alpha3_Filter_To_v1beta1_Filter(in, out, s) } -func autoConvert_v1alpha4_Filter_To_v1alpha3_Filter(in *v1alpha4.Filter, out *Filter, s conversion.Scope) error { +func autoConvert_v1beta1_Filter_To_v1alpha3_Filter(in *v1beta1.Filter, out *Filter, s conversion.Scope) error { out.Name = in.Name out.Values = *(*[]string)(unsafe.Pointer(&in.Values)) return nil } -// Convert_v1alpha4_Filter_To_v1alpha3_Filter is an autogenerated conversion function. -func Convert_v1alpha4_Filter_To_v1alpha3_Filter(in *v1alpha4.Filter, out *Filter, s conversion.Scope) error { - return autoConvert_v1alpha4_Filter_To_v1alpha3_Filter(in, out, s) +// Convert_v1beta1_Filter_To_v1alpha3_Filter is an autogenerated conversion function. +func Convert_v1beta1_Filter_To_v1alpha3_Filter(in *v1beta1.Filter, out *Filter, s conversion.Scope) error { + return autoConvert_v1beta1_Filter_To_v1alpha3_Filter(in, out, s) } -func autoConvert_v1alpha3_IngressRule_To_v1alpha4_IngressRule(in *IngressRule, out *v1alpha4.IngressRule, s conversion.Scope) error { +func autoConvert_v1alpha3_IngressRule_To_v1beta1_IngressRule(in *IngressRule, out *v1beta1.IngressRule, s conversion.Scope) error { out.Description = in.Description - out.Protocol = v1alpha4.SecurityGroupProtocol(in.Protocol) + out.Protocol = v1beta1.SecurityGroupProtocol(in.Protocol) out.FromPort = in.FromPort out.ToPort = in.ToPort out.CidrBlocks = *(*[]string)(unsafe.Pointer(&in.CidrBlocks)) @@ -1688,12 +1758,12 @@ func autoConvert_v1alpha3_IngressRule_To_v1alpha4_IngressRule(in *IngressRule, o return nil } -// Convert_v1alpha3_IngressRule_To_v1alpha4_IngressRule is an autogenerated conversion function. -func Convert_v1alpha3_IngressRule_To_v1alpha4_IngressRule(in *IngressRule, out *v1alpha4.IngressRule, s conversion.Scope) error { - return autoConvert_v1alpha3_IngressRule_To_v1alpha4_IngressRule(in, out, s) +// Convert_v1alpha3_IngressRule_To_v1beta1_IngressRule is an autogenerated conversion function. +func Convert_v1alpha3_IngressRule_To_v1beta1_IngressRule(in *IngressRule, out *v1beta1.IngressRule, s conversion.Scope) error { + return autoConvert_v1alpha3_IngressRule_To_v1beta1_IngressRule(in, out, s) } -func autoConvert_v1alpha4_IngressRule_To_v1alpha3_IngressRule(in *v1alpha4.IngressRule, out *IngressRule, s conversion.Scope) error { +func autoConvert_v1beta1_IngressRule_To_v1alpha3_IngressRule(in *v1beta1.IngressRule, out *IngressRule, s conversion.Scope) error { out.Description = in.Description out.Protocol = SecurityGroupProtocol(in.Protocol) out.FromPort = in.FromPort @@ -1703,14 +1773,14 @@ func autoConvert_v1alpha4_IngressRule_To_v1alpha3_IngressRule(in *v1alpha4.Ingre return nil } -// Convert_v1alpha4_IngressRule_To_v1alpha3_IngressRule is an autogenerated conversion function. -func Convert_v1alpha4_IngressRule_To_v1alpha3_IngressRule(in *v1alpha4.IngressRule, out *IngressRule, s conversion.Scope) error { - return autoConvert_v1alpha4_IngressRule_To_v1alpha3_IngressRule(in, out, s) +// Convert_v1beta1_IngressRule_To_v1alpha3_IngressRule is an autogenerated conversion function. +func Convert_v1beta1_IngressRule_To_v1alpha3_IngressRule(in *v1beta1.IngressRule, out *IngressRule, s conversion.Scope) error { + return autoConvert_v1beta1_IngressRule_To_v1alpha3_IngressRule(in, out, s) } -func autoConvert_v1alpha3_Instance_To_v1alpha4_Instance(in *Instance, out *v1alpha4.Instance, s conversion.Scope) error { +func autoConvert_v1alpha3_Instance_To_v1beta1_Instance(in *Instance, out *v1beta1.Instance, s conversion.Scope) error { out.ID = in.ID - out.State = v1alpha4.InstanceState(in.State) + out.State = v1beta1.InstanceState(in.State) out.Type = in.Type out.SubnetID = in.SubnetID out.ImageID = in.ImageID @@ -1718,15 +1788,25 @@ func autoConvert_v1alpha3_Instance_To_v1alpha4_Instance(in *Instance, out *v1alp out.SecurityGroupIDs = *(*[]string)(unsafe.Pointer(&in.SecurityGroupIDs)) out.UserData = (*string)(unsafe.Pointer(in.UserData)) out.IAMProfile = in.IAMProfile - out.Addresses = *(*[]apiv1alpha4.MachineAddress)(unsafe.Pointer(&in.Addresses)) + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]apiv1beta1.MachineAddress, len(*in)) + for i := range *in { + if err := apiv1alpha3.Convert_v1alpha3_MachineAddress_To_v1beta1_MachineAddress(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Addresses = nil + } out.PrivateIP = (*string)(unsafe.Pointer(in.PrivateIP)) out.PublicIP = (*string)(unsafe.Pointer(in.PublicIP)) out.ENASupport = (*bool)(unsafe.Pointer(in.ENASupport)) out.EBSOptimized = (*bool)(unsafe.Pointer(in.EBSOptimized)) if in.RootVolume != nil { in, out := &in.RootVolume, &out.RootVolume - *out = new(v1alpha4.Volume) - if err := Convert_v1alpha3_Volume_To_v1alpha4_Volume(*in, *out, s); err != nil { + *out = new(v1beta1.Volume) + if err := Convert_v1alpha3_Volume_To_v1beta1_Volume(*in, *out, s); err != nil { return err } } else { @@ -1734,9 +1814,9 @@ func autoConvert_v1alpha3_Instance_To_v1alpha4_Instance(in *Instance, out *v1alp } if in.NonRootVolumes != nil { in, out := &in.NonRootVolumes, &out.NonRootVolumes - *out = make([]v1alpha4.Volume, len(*in)) + *out = make([]v1beta1.Volume, len(*in)) for i := range *in { - if err := Convert_v1alpha3_Volume_To_v1alpha4_Volume(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_Volume_To_v1beta1_Volume(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1746,17 +1826,17 @@ func autoConvert_v1alpha3_Instance_To_v1alpha4_Instance(in *Instance, out *v1alp out.NetworkInterfaces = *(*[]string)(unsafe.Pointer(&in.NetworkInterfaces)) out.Tags = *(*map[string]string)(unsafe.Pointer(&in.Tags)) out.AvailabilityZone = in.AvailabilityZone - out.SpotMarketOptions = (*v1alpha4.SpotMarketOptions)(unsafe.Pointer(in.SpotMarketOptions)) + out.SpotMarketOptions = (*v1beta1.SpotMarketOptions)(unsafe.Pointer(in.SpotMarketOptions)) out.Tenancy = in.Tenancy return nil } -// Convert_v1alpha3_Instance_To_v1alpha4_Instance is an autogenerated conversion function. -func Convert_v1alpha3_Instance_To_v1alpha4_Instance(in *Instance, out *v1alpha4.Instance, s conversion.Scope) error { - return autoConvert_v1alpha3_Instance_To_v1alpha4_Instance(in, out, s) +// Convert_v1alpha3_Instance_To_v1beta1_Instance is an autogenerated conversion function. +func Convert_v1alpha3_Instance_To_v1beta1_Instance(in *Instance, out *v1beta1.Instance, s conversion.Scope) error { + return autoConvert_v1alpha3_Instance_To_v1beta1_Instance(in, out, s) } -func autoConvert_v1alpha4_Instance_To_v1alpha3_Instance(in *v1alpha4.Instance, out *Instance, s conversion.Scope) error { +func autoConvert_v1beta1_Instance_To_v1alpha3_Instance(in *v1beta1.Instance, out *Instance, s conversion.Scope) error { out.ID = in.ID out.State = InstanceState(in.State) out.Type = in.Type @@ -1766,7 +1846,17 @@ func autoConvert_v1alpha4_Instance_To_v1alpha3_Instance(in *v1alpha4.Instance, o out.SecurityGroupIDs = *(*[]string)(unsafe.Pointer(&in.SecurityGroupIDs)) out.UserData = (*string)(unsafe.Pointer(in.UserData)) out.IAMProfile = in.IAMProfile - out.Addresses = *(*[]apiv1alpha3.MachineAddress)(unsafe.Pointer(&in.Addresses)) + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]apiv1alpha3.MachineAddress, len(*in)) + for i := range *in { + if err := apiv1alpha3.Convert_v1beta1_MachineAddress_To_v1alpha3_MachineAddress(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Addresses = nil + } out.PrivateIP = (*string)(unsafe.Pointer(in.PrivateIP)) out.PublicIP = (*string)(unsafe.Pointer(in.PublicIP)) out.ENASupport = (*bool)(unsafe.Pointer(in.ENASupport)) @@ -1774,7 +1864,7 @@ func autoConvert_v1alpha4_Instance_To_v1alpha3_Instance(in *v1alpha4.Instance, o if in.RootVolume != nil { in, out := &in.RootVolume, &out.RootVolume *out = new(Volume) - if err := Convert_v1alpha4_Volume_To_v1alpha3_Volume(*in, *out, s); err != nil { + if err := Convert_v1beta1_Volume_To_v1alpha3_Volume(*in, *out, s); err != nil { return err } } else { @@ -1784,7 +1874,7 @@ func autoConvert_v1alpha4_Instance_To_v1alpha3_Instance(in *v1alpha4.Instance, o in, out := &in.NonRootVolumes, &out.NonRootVolumes *out = make([]Volume, len(*in)) for i := range *in { - if err := Convert_v1alpha4_Volume_To_v1alpha3_Volume(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_Volume_To_v1alpha3_Volume(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -1800,23 +1890,23 @@ func autoConvert_v1alpha4_Instance_To_v1alpha3_Instance(in *v1alpha4.Instance, o return nil } -func autoConvert_v1alpha3_NetworkSpec_To_v1alpha4_NetworkSpec(in *NetworkSpec, out *v1alpha4.NetworkSpec, s conversion.Scope) error { - if err := Convert_v1alpha3_VPCSpec_To_v1alpha4_VPCSpec(&in.VPC, &out.VPC, s); err != nil { +func autoConvert_v1alpha3_NetworkSpec_To_v1beta1_NetworkSpec(in *NetworkSpec, out *v1beta1.NetworkSpec, s conversion.Scope) error { + if err := Convert_v1alpha3_VPCSpec_To_v1beta1_VPCSpec(&in.VPC, &out.VPC, s); err != nil { return err } - out.Subnets = *(*v1alpha4.Subnets)(unsafe.Pointer(&in.Subnets)) - out.CNI = (*v1alpha4.CNISpec)(unsafe.Pointer(in.CNI)) - out.SecurityGroupOverrides = *(*map[v1alpha4.SecurityGroupRole]string)(unsafe.Pointer(&in.SecurityGroupOverrides)) + out.Subnets = *(*v1beta1.Subnets)(unsafe.Pointer(&in.Subnets)) + out.CNI = (*v1beta1.CNISpec)(unsafe.Pointer(in.CNI)) + out.SecurityGroupOverrides = *(*map[v1beta1.SecurityGroupRole]string)(unsafe.Pointer(&in.SecurityGroupOverrides)) return nil } -// Convert_v1alpha3_NetworkSpec_To_v1alpha4_NetworkSpec is an autogenerated conversion function. -func Convert_v1alpha3_NetworkSpec_To_v1alpha4_NetworkSpec(in *NetworkSpec, out *v1alpha4.NetworkSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_NetworkSpec_To_v1alpha4_NetworkSpec(in, out, s) +// Convert_v1alpha3_NetworkSpec_To_v1beta1_NetworkSpec is an autogenerated conversion function. +func Convert_v1alpha3_NetworkSpec_To_v1beta1_NetworkSpec(in *NetworkSpec, out *v1beta1.NetworkSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_NetworkSpec_To_v1beta1_NetworkSpec(in, out, s) } -func autoConvert_v1alpha4_NetworkSpec_To_v1alpha3_NetworkSpec(in *v1alpha4.NetworkSpec, out *NetworkSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_VPCSpec_To_v1alpha3_VPCSpec(&in.VPC, &out.VPC, s); err != nil { +func autoConvert_v1beta1_NetworkSpec_To_v1alpha3_NetworkSpec(in *v1beta1.NetworkSpec, out *NetworkSpec, s conversion.Scope) error { + if err := Convert_v1beta1_VPCSpec_To_v1alpha3_VPCSpec(&in.VPC, &out.VPC, s); err != nil { return err } out.Subnets = *(*Subnets)(unsafe.Pointer(&in.Subnets)) @@ -1825,45 +1915,45 @@ func autoConvert_v1alpha4_NetworkSpec_To_v1alpha3_NetworkSpec(in *v1alpha4.Netwo return nil } -// Convert_v1alpha4_NetworkSpec_To_v1alpha3_NetworkSpec is an autogenerated conversion function. -func Convert_v1alpha4_NetworkSpec_To_v1alpha3_NetworkSpec(in *v1alpha4.NetworkSpec, out *NetworkSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_NetworkSpec_To_v1alpha3_NetworkSpec(in, out, s) +// Convert_v1beta1_NetworkSpec_To_v1alpha3_NetworkSpec is an autogenerated conversion function. +func Convert_v1beta1_NetworkSpec_To_v1alpha3_NetworkSpec(in *v1beta1.NetworkSpec, out *NetworkSpec, s conversion.Scope) error { + return autoConvert_v1beta1_NetworkSpec_To_v1alpha3_NetworkSpec(in, out, s) } -func autoConvert_v1alpha3_RouteTable_To_v1alpha4_RouteTable(in *RouteTable, out *v1alpha4.RouteTable, s conversion.Scope) error { +func autoConvert_v1alpha3_RouteTable_To_v1beta1_RouteTable(in *RouteTable, out *v1beta1.RouteTable, s conversion.Scope) error { out.ID = in.ID return nil } -// Convert_v1alpha3_RouteTable_To_v1alpha4_RouteTable is an autogenerated conversion function. -func Convert_v1alpha3_RouteTable_To_v1alpha4_RouteTable(in *RouteTable, out *v1alpha4.RouteTable, s conversion.Scope) error { - return autoConvert_v1alpha3_RouteTable_To_v1alpha4_RouteTable(in, out, s) +// Convert_v1alpha3_RouteTable_To_v1beta1_RouteTable is an autogenerated conversion function. +func Convert_v1alpha3_RouteTable_To_v1beta1_RouteTable(in *RouteTable, out *v1beta1.RouteTable, s conversion.Scope) error { + return autoConvert_v1alpha3_RouteTable_To_v1beta1_RouteTable(in, out, s) } -func autoConvert_v1alpha4_RouteTable_To_v1alpha3_RouteTable(in *v1alpha4.RouteTable, out *RouteTable, s conversion.Scope) error { +func autoConvert_v1beta1_RouteTable_To_v1alpha3_RouteTable(in *v1beta1.RouteTable, out *RouteTable, s conversion.Scope) error { out.ID = in.ID return nil } -// Convert_v1alpha4_RouteTable_To_v1alpha3_RouteTable is an autogenerated conversion function. -func Convert_v1alpha4_RouteTable_To_v1alpha3_RouteTable(in *v1alpha4.RouteTable, out *RouteTable, s conversion.Scope) error { - return autoConvert_v1alpha4_RouteTable_To_v1alpha3_RouteTable(in, out, s) +// Convert_v1beta1_RouteTable_To_v1alpha3_RouteTable is an autogenerated conversion function. +func Convert_v1beta1_RouteTable_To_v1alpha3_RouteTable(in *v1beta1.RouteTable, out *RouteTable, s conversion.Scope) error { + return autoConvert_v1beta1_RouteTable_To_v1alpha3_RouteTable(in, out, s) } -func autoConvert_v1alpha3_SecurityGroup_To_v1alpha4_SecurityGroup(in *SecurityGroup, out *v1alpha4.SecurityGroup, s conversion.Scope) error { +func autoConvert_v1alpha3_SecurityGroup_To_v1beta1_SecurityGroup(in *SecurityGroup, out *v1beta1.SecurityGroup, s conversion.Scope) error { out.ID = in.ID out.Name = in.Name - out.IngressRules = *(*v1alpha4.IngressRules)(unsafe.Pointer(&in.IngressRules)) - out.Tags = *(*v1alpha4.Tags)(unsafe.Pointer(&in.Tags)) + out.IngressRules = *(*v1beta1.IngressRules)(unsafe.Pointer(&in.IngressRules)) + out.Tags = *(*v1beta1.Tags)(unsafe.Pointer(&in.Tags)) return nil } -// Convert_v1alpha3_SecurityGroup_To_v1alpha4_SecurityGroup is an autogenerated conversion function. -func Convert_v1alpha3_SecurityGroup_To_v1alpha4_SecurityGroup(in *SecurityGroup, out *v1alpha4.SecurityGroup, s conversion.Scope) error { - return autoConvert_v1alpha3_SecurityGroup_To_v1alpha4_SecurityGroup(in, out, s) +// Convert_v1alpha3_SecurityGroup_To_v1beta1_SecurityGroup is an autogenerated conversion function. +func Convert_v1alpha3_SecurityGroup_To_v1beta1_SecurityGroup(in *SecurityGroup, out *v1beta1.SecurityGroup, s conversion.Scope) error { + return autoConvert_v1alpha3_SecurityGroup_To_v1beta1_SecurityGroup(in, out, s) } -func autoConvert_v1alpha4_SecurityGroup_To_v1alpha3_SecurityGroup(in *v1alpha4.SecurityGroup, out *SecurityGroup, s conversion.Scope) error { +func autoConvert_v1beta1_SecurityGroup_To_v1alpha3_SecurityGroup(in *v1beta1.SecurityGroup, out *SecurityGroup, s conversion.Scope) error { out.ID = in.ID out.Name = in.Name out.IngressRules = *(*IngressRules)(unsafe.Pointer(&in.IngressRules)) @@ -1871,48 +1961,48 @@ func autoConvert_v1alpha4_SecurityGroup_To_v1alpha3_SecurityGroup(in *v1alpha4.S return nil } -// Convert_v1alpha4_SecurityGroup_To_v1alpha3_SecurityGroup is an autogenerated conversion function. -func Convert_v1alpha4_SecurityGroup_To_v1alpha3_SecurityGroup(in *v1alpha4.SecurityGroup, out *SecurityGroup, s conversion.Scope) error { - return autoConvert_v1alpha4_SecurityGroup_To_v1alpha3_SecurityGroup(in, out, s) +// Convert_v1beta1_SecurityGroup_To_v1alpha3_SecurityGroup is an autogenerated conversion function. +func Convert_v1beta1_SecurityGroup_To_v1alpha3_SecurityGroup(in *v1beta1.SecurityGroup, out *SecurityGroup, s conversion.Scope) error { + return autoConvert_v1beta1_SecurityGroup_To_v1alpha3_SecurityGroup(in, out, s) } -func autoConvert_v1alpha3_SpotMarketOptions_To_v1alpha4_SpotMarketOptions(in *SpotMarketOptions, out *v1alpha4.SpotMarketOptions, s conversion.Scope) error { +func autoConvert_v1alpha3_SpotMarketOptions_To_v1beta1_SpotMarketOptions(in *SpotMarketOptions, out *v1beta1.SpotMarketOptions, s conversion.Scope) error { out.MaxPrice = (*string)(unsafe.Pointer(in.MaxPrice)) return nil } -// Convert_v1alpha3_SpotMarketOptions_To_v1alpha4_SpotMarketOptions is an autogenerated conversion function. -func Convert_v1alpha3_SpotMarketOptions_To_v1alpha4_SpotMarketOptions(in *SpotMarketOptions, out *v1alpha4.SpotMarketOptions, s conversion.Scope) error { - return autoConvert_v1alpha3_SpotMarketOptions_To_v1alpha4_SpotMarketOptions(in, out, s) +// Convert_v1alpha3_SpotMarketOptions_To_v1beta1_SpotMarketOptions is an autogenerated conversion function. +func Convert_v1alpha3_SpotMarketOptions_To_v1beta1_SpotMarketOptions(in *SpotMarketOptions, out *v1beta1.SpotMarketOptions, s conversion.Scope) error { + return autoConvert_v1alpha3_SpotMarketOptions_To_v1beta1_SpotMarketOptions(in, out, s) } -func autoConvert_v1alpha4_SpotMarketOptions_To_v1alpha3_SpotMarketOptions(in *v1alpha4.SpotMarketOptions, out *SpotMarketOptions, s conversion.Scope) error { +func autoConvert_v1beta1_SpotMarketOptions_To_v1alpha3_SpotMarketOptions(in *v1beta1.SpotMarketOptions, out *SpotMarketOptions, s conversion.Scope) error { out.MaxPrice = (*string)(unsafe.Pointer(in.MaxPrice)) return nil } -// Convert_v1alpha4_SpotMarketOptions_To_v1alpha3_SpotMarketOptions is an autogenerated conversion function. -func Convert_v1alpha4_SpotMarketOptions_To_v1alpha3_SpotMarketOptions(in *v1alpha4.SpotMarketOptions, out *SpotMarketOptions, s conversion.Scope) error { - return autoConvert_v1alpha4_SpotMarketOptions_To_v1alpha3_SpotMarketOptions(in, out, s) +// Convert_v1beta1_SpotMarketOptions_To_v1alpha3_SpotMarketOptions is an autogenerated conversion function. +func Convert_v1beta1_SpotMarketOptions_To_v1alpha3_SpotMarketOptions(in *v1beta1.SpotMarketOptions, out *SpotMarketOptions, s conversion.Scope) error { + return autoConvert_v1beta1_SpotMarketOptions_To_v1alpha3_SpotMarketOptions(in, out, s) } -func autoConvert_v1alpha3_SubnetSpec_To_v1alpha4_SubnetSpec(in *SubnetSpec, out *v1alpha4.SubnetSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_SubnetSpec_To_v1beta1_SubnetSpec(in *SubnetSpec, out *v1beta1.SubnetSpec, s conversion.Scope) error { out.ID = in.ID out.CidrBlock = in.CidrBlock out.AvailabilityZone = in.AvailabilityZone out.IsPublic = in.IsPublic out.RouteTableID = (*string)(unsafe.Pointer(in.RouteTableID)) out.NatGatewayID = (*string)(unsafe.Pointer(in.NatGatewayID)) - out.Tags = *(*v1alpha4.Tags)(unsafe.Pointer(&in.Tags)) + out.Tags = *(*v1beta1.Tags)(unsafe.Pointer(&in.Tags)) return nil } -// Convert_v1alpha3_SubnetSpec_To_v1alpha4_SubnetSpec is an autogenerated conversion function. -func Convert_v1alpha3_SubnetSpec_To_v1alpha4_SubnetSpec(in *SubnetSpec, out *v1alpha4.SubnetSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_SubnetSpec_To_v1alpha4_SubnetSpec(in, out, s) +// Convert_v1alpha3_SubnetSpec_To_v1beta1_SubnetSpec is an autogenerated conversion function. +func Convert_v1alpha3_SubnetSpec_To_v1beta1_SubnetSpec(in *SubnetSpec, out *v1beta1.SubnetSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_SubnetSpec_To_v1beta1_SubnetSpec(in, out, s) } -func autoConvert_v1alpha4_SubnetSpec_To_v1alpha3_SubnetSpec(in *v1alpha4.SubnetSpec, out *SubnetSpec, s conversion.Scope) error { +func autoConvert_v1beta1_SubnetSpec_To_v1alpha3_SubnetSpec(in *v1beta1.SubnetSpec, out *SubnetSpec, s conversion.Scope) error { out.ID = in.ID out.CidrBlock = in.CidrBlock out.AvailabilityZone = in.AvailabilityZone @@ -1923,27 +2013,27 @@ func autoConvert_v1alpha4_SubnetSpec_To_v1alpha3_SubnetSpec(in *v1alpha4.SubnetS return nil } -// Convert_v1alpha4_SubnetSpec_To_v1alpha3_SubnetSpec is an autogenerated conversion function. -func Convert_v1alpha4_SubnetSpec_To_v1alpha3_SubnetSpec(in *v1alpha4.SubnetSpec, out *SubnetSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_SubnetSpec_To_v1alpha3_SubnetSpec(in, out, s) +// Convert_v1beta1_SubnetSpec_To_v1alpha3_SubnetSpec is an autogenerated conversion function. +func Convert_v1beta1_SubnetSpec_To_v1alpha3_SubnetSpec(in *v1beta1.SubnetSpec, out *SubnetSpec, s conversion.Scope) error { + return autoConvert_v1beta1_SubnetSpec_To_v1alpha3_SubnetSpec(in, out, s) } -func autoConvert_v1alpha3_VPCSpec_To_v1alpha4_VPCSpec(in *VPCSpec, out *v1alpha4.VPCSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_VPCSpec_To_v1beta1_VPCSpec(in *VPCSpec, out *v1beta1.VPCSpec, s conversion.Scope) error { out.ID = in.ID out.CidrBlock = in.CidrBlock out.InternetGatewayID = (*string)(unsafe.Pointer(in.InternetGatewayID)) - out.Tags = *(*v1alpha4.Tags)(unsafe.Pointer(&in.Tags)) + out.Tags = *(*v1beta1.Tags)(unsafe.Pointer(&in.Tags)) out.AvailabilityZoneUsageLimit = (*int)(unsafe.Pointer(in.AvailabilityZoneUsageLimit)) - out.AvailabilityZoneSelection = (*v1alpha4.AZSelectionScheme)(unsafe.Pointer(in.AvailabilityZoneSelection)) + out.AvailabilityZoneSelection = (*v1beta1.AZSelectionScheme)(unsafe.Pointer(in.AvailabilityZoneSelection)) return nil } -// Convert_v1alpha3_VPCSpec_To_v1alpha4_VPCSpec is an autogenerated conversion function. -func Convert_v1alpha3_VPCSpec_To_v1alpha4_VPCSpec(in *VPCSpec, out *v1alpha4.VPCSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_VPCSpec_To_v1alpha4_VPCSpec(in, out, s) +// Convert_v1alpha3_VPCSpec_To_v1beta1_VPCSpec is an autogenerated conversion function. +func Convert_v1alpha3_VPCSpec_To_v1beta1_VPCSpec(in *VPCSpec, out *v1beta1.VPCSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_VPCSpec_To_v1beta1_VPCSpec(in, out, s) } -func autoConvert_v1alpha4_VPCSpec_To_v1alpha3_VPCSpec(in *v1alpha4.VPCSpec, out *VPCSpec, s conversion.Scope) error { +func autoConvert_v1beta1_VPCSpec_To_v1alpha3_VPCSpec(in *v1beta1.VPCSpec, out *VPCSpec, s conversion.Scope) error { out.ID = in.ID out.CidrBlock = in.CidrBlock out.InternetGatewayID = (*string)(unsafe.Pointer(in.InternetGatewayID)) @@ -1953,15 +2043,15 @@ func autoConvert_v1alpha4_VPCSpec_To_v1alpha3_VPCSpec(in *v1alpha4.VPCSpec, out return nil } -// Convert_v1alpha4_VPCSpec_To_v1alpha3_VPCSpec is an autogenerated conversion function. -func Convert_v1alpha4_VPCSpec_To_v1alpha3_VPCSpec(in *v1alpha4.VPCSpec, out *VPCSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_VPCSpec_To_v1alpha3_VPCSpec(in, out, s) +// Convert_v1beta1_VPCSpec_To_v1alpha3_VPCSpec is an autogenerated conversion function. +func Convert_v1beta1_VPCSpec_To_v1alpha3_VPCSpec(in *v1beta1.VPCSpec, out *VPCSpec, s conversion.Scope) error { + return autoConvert_v1beta1_VPCSpec_To_v1alpha3_VPCSpec(in, out, s) } -func autoConvert_v1alpha3_Volume_To_v1alpha4_Volume(in *Volume, out *v1alpha4.Volume, s conversion.Scope) error { +func autoConvert_v1alpha3_Volume_To_v1beta1_Volume(in *Volume, out *v1beta1.Volume, s conversion.Scope) error { out.DeviceName = in.DeviceName out.Size = in.Size - out.Type = v1alpha4.VolumeType(in.Type) + out.Type = v1beta1.VolumeType(in.Type) out.IOPS = in.IOPS if err := v1.Convert_bool_To_Pointer_bool(&in.Encrypted, &out.Encrypted, s); err != nil { return err @@ -1970,12 +2060,12 @@ func autoConvert_v1alpha3_Volume_To_v1alpha4_Volume(in *Volume, out *v1alpha4.Vo return nil } -// Convert_v1alpha3_Volume_To_v1alpha4_Volume is an autogenerated conversion function. -func Convert_v1alpha3_Volume_To_v1alpha4_Volume(in *Volume, out *v1alpha4.Volume, s conversion.Scope) error { - return autoConvert_v1alpha3_Volume_To_v1alpha4_Volume(in, out, s) +// Convert_v1alpha3_Volume_To_v1beta1_Volume is an autogenerated conversion function. +func Convert_v1alpha3_Volume_To_v1beta1_Volume(in *Volume, out *v1beta1.Volume, s conversion.Scope) error { + return autoConvert_v1alpha3_Volume_To_v1beta1_Volume(in, out, s) } -func autoConvert_v1alpha4_Volume_To_v1alpha3_Volume(in *v1alpha4.Volume, out *Volume, s conversion.Scope) error { +func autoConvert_v1beta1_Volume_To_v1alpha3_Volume(in *v1beta1.Volume, out *Volume, s conversion.Scope) error { out.DeviceName = in.DeviceName out.Size = in.Size out.Type = string(in.Type) diff --git a/api/v1alpha3/zz_generated.defaults.go b/api/v1alpha3/zz_generated.defaults.go new file mode 100644 index 0000000000..816a56f7f1 --- /dev/null +++ b/api/v1alpha3/zz_generated.defaults.go @@ -0,0 +1,38 @@ +// +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 defaulter-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + scheme.AddTypeDefaultingFunc(&AWSCluster{}, func(obj interface{}) { SetObjectDefaults_AWSCluster(obj.(*AWSCluster)) }) + return nil +} + +func SetObjectDefaults_AWSCluster(in *AWSCluster) { + SetDefaults_NetworkSpec(&in.Spec.NetworkSpec) + SetDefaults_Bastion(&in.Spec.Bastion) +} diff --git a/api/v1alpha4/awscluster_conversion.go b/api/v1alpha4/awscluster_conversion.go new file mode 100644 index 0000000000..d5ada93fba --- /dev/null +++ b/api/v1alpha4/awscluster_conversion.go @@ -0,0 +1,105 @@ +/* +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" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + utilconversion "sigs.k8s.io/cluster-api/util/conversion" + "sigs.k8s.io/controller-runtime/pkg/conversion" +) + +// ConvertTo converts the v1alpha4 AWSCluster receiver to a v1beta1 AWSCluster. +func (src *AWSCluster) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSCluster) + + return Convert_v1alpha4_AWSCluster_To_v1beta1_AWSCluster(src, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSCluster receiver to a v1alpha4 AWSCluster. +func (r *AWSCluster) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1.AWSCluster) + + return Convert_v1beta1_AWSCluster_To_v1alpha4_AWSCluster(src, r, nil) +} + + +// ConvertTo converts the v1alpha3 AWSCluster receiver to a v1beta1 AWSCluster. +func (r *AWSClusterTemplate) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSClusterTemplate) + + if err := Convert_v1alpha4_AWSClusterTemplate_To_v1beta1_AWSClusterTemplate(r, dst, nil); err != nil { + return err + } + + // Manually restore data. + restored := &infrav1.AWSClusterTemplate{} + if ok, err := utilconversion.UnmarshalData(r, restored); err != nil || !ok { + return err + } + + dst.Spec.Template.ObjectMeta = restored.Spec.Template.ObjectMeta + + return nil +} + +// ConvertFrom converts the v1beta1 AWSCluster receiver to a v1alpha3 AWSCluster. +func (r *AWSClusterTemplate) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1.AWSClusterTemplate) + + if err := Convert_v1beta1_AWSClusterTemplate_To_v1alpha4_AWSClusterTemplate(src, r, nil); err != nil { + return err + } + + // Preserve Hub data on down-conversion. + if err := utilconversion.MarshalData(src, r); err != nil { + return err + } + + return nil +} + +func Convert_v1beta1_AWSClusterTemplateResource_To_v1alpha4_AWSClusterTemplateResource(in *infrav1.AWSClusterTemplateResource, out *AWSClusterTemplateResource, s apiconversion.Scope) error { + return autoConvert_v1beta1_AWSClusterTemplateResource_To_v1alpha4_AWSClusterTemplateResource(in, out, s) +} + +// Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint . +func Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in *clusterv1alpha4.APIEndpoint, out *clusterv1.APIEndpoint, s apiconversion.Scope) error { + return clusterv1alpha4.Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in, out, s) +} + +// Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint . +func Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in *clusterv1.APIEndpoint, out *clusterv1alpha4.APIEndpoint, s apiconversion.Scope) error { + return clusterv1alpha4.Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in, out, s) +} + + +// ConvertTo converts the v1alpha4 AWSClusterList receiver to a v1beta1 AWSClusterList. +func (src *AWSClusterList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSClusterList) + + return Convert_v1alpha4_AWSClusterList_To_v1beta1_AWSClusterList(src, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSClusterList receiver to a v1alpha4 AWSClusterList. +func (r *AWSClusterList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1.AWSClusterList) + + return Convert_v1beta1_AWSClusterList_To_v1alpha4_AWSClusterList(src, r, nil) +} diff --git a/api/v1alpha4/awscluster_types.go b/api/v1alpha4/awscluster_types.go index 0785b7a836..ba12ff0a55 100644 --- a/api/v1alpha4/awscluster_types.go +++ b/api/v1alpha4/awscluster_types.go @@ -18,7 +18,7 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" ) const ( @@ -44,7 +44,7 @@ type AWSClusterSpec struct { // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. // +optional - ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"` + ControlPlaneEndpoint clusterv1alpha4.APIEndpoint `json:"controlPlaneEndpoint"` // AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the // ones added by default. @@ -176,22 +176,22 @@ type AWSLoadBalancerSpec struct { // AWSClusterStatus defines the observed state of AWSCluster type AWSClusterStatus struct { // +kubebuilder:default=false - Ready bool `json:"ready"` - Network NetworkStatus `json:"networkStatus,omitempty"` - FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"` - Bastion *Instance `json:"bastion,omitempty"` - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Ready bool `json:"ready"` + Network NetworkStatus `json:"networkStatus,omitempty"` + FailureDomains clusterv1alpha4.FailureDomains `json:"failureDomains,omitempty"` + Bastion *Instance `json:"bastion,omitempty"` + Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` } // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsclusters,scope=Namespaced,categories=cluster-api,shortName=awsc -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AWSCluster belongs" // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Cluster infrastructure is ready for EC2 instances" // +kubebuilder:printcolumn:name="VPC",type="string",JSONPath=".spec.network.vpc.id",description="AWS VPC the cluster is using" // +kubebuilder:printcolumn:name="Endpoint",type="string",JSONPath=".spec.controlPlaneEndpoint",description="API Endpoint",priority=1 // +kubebuilder:printcolumn:name="Bastion IP",type="string",JSONPath=".status.bastion.publicIp",description="Bastion IP address for breakglass access" +// +k8s:defaulter-gen=true // AWSCluster is the Schema for the awsclusters API. type AWSCluster struct { @@ -212,12 +212,12 @@ type AWSClusterList struct { } // GetConditions returns the observations of the operational state of the AWSCluster resource. -func (r *AWSCluster) GetConditions() clusterv1.Conditions { +func (r *AWSCluster) GetConditions() clusterv1alpha4.Conditions { return r.Status.Conditions } -// SetConditions sets the underlying service state of the AWSCluster to the predescribed clusterv1.Conditions. -func (r *AWSCluster) SetConditions(conditions clusterv1.Conditions) { +// SetConditions sets the underlying service state of the AWSCluster to the predescribed clusterv1alpha4.Conditions. +func (r *AWSCluster) SetConditions(conditions clusterv1alpha4.Conditions) { r.Status.Conditions = conditions } diff --git a/api/v1alpha4/awsclustertemplate_types.go b/api/v1alpha4/awsclustertemplate_types.go index 846d78a27e..a5ec9b4dd4 100644 --- a/api/v1alpha4/awsclustertemplate_types.go +++ b/api/v1alpha4/awsclustertemplate_types.go @@ -27,7 +27,6 @@ type AWSClusterTemplateSpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsclustertemplates,scope=Namespaced,categories=cluster-api,shortName=awsct -// +kubebuilder:storageversion // AWSClusterTemplate is the Schema for the awsclustertemplates API. type AWSClusterTemplate struct { diff --git a/api/v1alpha4/awsidentity_conversion.go b/api/v1alpha4/awsidentity_conversion.go new file mode 100644 index 0000000000..7146e5d00a --- /dev/null +++ b/api/v1alpha4/awsidentity_conversion.go @@ -0,0 +1,101 @@ +/* +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 ( + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + "sigs.k8s.io/controller-runtime/pkg/conversion" +) + +// ConvertTo converts the v1alpha4 AWSClusterControllerIdentity receiver to a v1beta1 AWSClusterControllerIdentity. +func (src *AWSClusterControllerIdentity) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSClusterControllerIdentity) + return Convert_v1alpha4_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity(src, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSClusterControllerIdentity to a v1alpha4 AWSClusterControllerIdentity. +func (dst *AWSClusterControllerIdentity) ConvertFrom(srcRaw conversion.Hub) error{ + src := srcRaw.(*infrav1.AWSClusterControllerIdentity) + + return Convert_v1beta1_AWSClusterControllerIdentity_To_v1alpha4_AWSClusterControllerIdentity(src, dst, nil) +} + +// ConvertTo converts the v1alpha4 AWSClusterControllerIdentityList receiver to a v1beta1 AWSClusterControllerIdentityList. +func (src *AWSClusterControllerIdentityList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSClusterControllerIdentityList) + return Convert_v1alpha4_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList(src, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSClusterControllerIdentityList to a v1alpha4 AWSClusterControllerIdentityList. +func (dst *AWSClusterControllerIdentityList) ConvertFrom(srcRaw conversion.Hub) error{ + src := srcRaw.(*infrav1.AWSClusterControllerIdentityList) + + return Convert_v1beta1_AWSClusterControllerIdentityList_To_v1alpha4_AWSClusterControllerIdentityList(src, dst, nil) +} + +// ConvertTo converts the v1alpha4 AWSClusterRoleIdentity receiver to a v1beta1 AWSClusterRoleIdentity. +func (src *AWSClusterRoleIdentity) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSClusterRoleIdentity) + return Convert_v1alpha4_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity(src, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSClusterRoleIdentity to a v1alpha4 AWSClusterRoleIdentity. +func (dst *AWSClusterRoleIdentity) ConvertFrom(srcRaw conversion.Hub) error{ + src := srcRaw.(*infrav1.AWSClusterRoleIdentity) + + return Convert_v1beta1_AWSClusterRoleIdentity_To_v1alpha4_AWSClusterRoleIdentity(src, dst, nil) +} + +// ConvertTo converts the v1alpha4 AWSClusterRoleIdentityList receiver to a v1beta1 AWSClusterRoleIdentityList. +func (src *AWSClusterRoleIdentityList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSClusterRoleIdentityList) + return Convert_v1alpha4_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList(src, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSClusterRoleIdentityList to a v1alpha4 AWSClusterRoleIdentityList. +func (dst *AWSClusterRoleIdentityList) ConvertFrom(srcRaw conversion.Hub) error{ + src := srcRaw.(*infrav1.AWSClusterRoleIdentityList) + + return Convert_v1beta1_AWSClusterRoleIdentityList_To_v1alpha4_AWSClusterRoleIdentityList(src, dst, nil) +} + + +// ConvertTo converts the v1alpha4 AWSClusterStaticIdentity receiver to a v1beta1 AWSClusterStaticIdentity. +func (src *AWSClusterStaticIdentity) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSClusterStaticIdentity) + return Convert_v1alpha4_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity(src, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSClusterStaticIdentity to a v1alpha4 AWSClusterStaticIdentity. +func (dst *AWSClusterStaticIdentity) ConvertFrom(srcRaw conversion.Hub) error{ + src := srcRaw.(*infrav1.AWSClusterStaticIdentity) + + return Convert_v1beta1_AWSClusterStaticIdentity_To_v1alpha4_AWSClusterStaticIdentity(src, dst, nil) +} + +// ConvertTo converts the v1alpha4 AWSClusterStaticIdentityList receiver to a v1beta1 AWSClusterStaticIdentityList. +func (src *AWSClusterStaticIdentityList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSClusterStaticIdentityList) + return Convert_v1alpha4_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList(src, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSClusterStaticIdentityList to a v1alpha4 AWSClusterStaticIdentityList. +func (dst *AWSClusterStaticIdentityList) ConvertFrom(srcRaw conversion.Hub) error{ + src := srcRaw.(*infrav1.AWSClusterStaticIdentityList) + + return Convert_v1beta1_AWSClusterStaticIdentityList_To_v1alpha4_AWSClusterStaticIdentityList(src, dst, nil) +} diff --git a/api/v1alpha4/awsidentity_types.go b/api/v1alpha4/awsidentity_types.go index ab57d70075..8fc596fdad 100644 --- a/api/v1alpha4/awsidentity_types.go +++ b/api/v1alpha4/awsidentity_types.go @@ -71,7 +71,7 @@ type AWSRoleSpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsclusterstaticidentities,scope=Cluster,categories=cluster-api,shortName=awssi -// +kubebuilder:storageversion +// +k8s:defaulter-gen=true // AWSClusterStaticIdentity is the Schema for the awsclusterstaticidentities API // It represents a reference to an AWS access key ID and secret access key, stored in a secret. @@ -84,6 +84,7 @@ type AWSClusterStaticIdentity struct { } // +kubebuilder:object:root=true +// +k8s:defaulter-gen=true // AWSClusterStaticIdentityList contains a list of AWSClusterStaticIdentity. type AWSClusterStaticIdentityList struct { @@ -105,7 +106,7 @@ type AWSClusterStaticIdentitySpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsclusterroleidentities,scope=Cluster,categories=cluster-api,shortName=awsri -// +kubebuilder:storageversion +// +k8s:defaulter-gen=true // AWSClusterRoleIdentity is the Schema for the awsclusterroleidentities API // It is used to assume a role using the provided sourceRef. @@ -118,6 +119,7 @@ type AWSClusterRoleIdentity struct { } // +kubebuilder:object:root=true +// +k8s:defaulter-gen=true // AWSClusterRoleIdentityList contains a list of AWSClusterRoleIdentity. type AWSClusterRoleIdentityList struct { @@ -149,7 +151,7 @@ type AWSClusterRoleIdentitySpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsclustercontrolleridentities,scope=Cluster,categories=cluster-api,shortName=awsci -// +kubebuilder:storageversion +// +k8s:defaulter-gen=true // AWSClusterControllerIdentity is the Schema for the awsclustercontrolleridentities API // It is used to grant access to use Cluster API Provider AWS Controller credentials. diff --git a/api/v1alpha4/awsmachine_conversion.go b/api/v1alpha4/awsmachine_conversion.go new file mode 100644 index 0000000000..cc1e71f81b --- /dev/null +++ b/api/v1alpha4/awsmachine_conversion.go @@ -0,0 +1,103 @@ +/* +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" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + utilconversion "sigs.k8s.io/cluster-api/util/conversion" + "sigs.k8s.io/controller-runtime/pkg/conversion" +) + +// ConvertTo converts the v1alpha4 AWSMachine receiver to a v1beta1 AWSMachine. +func (src *AWSMachine) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSMachine) + return Convert_v1alpha4_AWSMachine_To_v1beta1_AWSMachine(src, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSMachine to a v1alpha4 AWSMachine. +func (dst *AWSMachine) ConvertFrom(srcRaw conversion.Hub) error{ + src := srcRaw.(*infrav1.AWSMachine) + + return Convert_v1beta1_AWSMachine_To_v1alpha4_AWSMachine(src, dst, nil) +} + +// ConvertTo converts the v1alpha4 AWSMachineList receiver to a v1beta1 AWSMachineList. +func (src *AWSMachineList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSMachineList) + return Convert_v1alpha4_AWSMachineList_To_v1beta1_AWSMachineList(src, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSMachineList to a v1alpha4 AWSMachineList. +func (dst *AWSMachineList) ConvertFrom(srcRaw conversion.Hub) error{ + src := srcRaw.(*infrav1.AWSMachineList) + + return Convert_v1beta1_AWSMachineList_To_v1alpha4_AWSMachineList(src, dst, nil) +} + +// ConvertTo converts the v1alpha3 AWSCluster receiver to a v1beta1 AWSCluster. +func (r *AWSMachineTemplate) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSMachineTemplate) + + if err := Convert_v1alpha4_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(r, dst, nil); err != nil { + return err + } + + // Manually restore data. + restored := &infrav1.AWSMachineTemplate{} + if ok, err := utilconversion.UnmarshalData(r, restored); err != nil || !ok { + return err + } + + dst.Spec.Template.ObjectMeta = restored.Spec.Template.ObjectMeta + + return nil +} + +// ConvertFrom converts the v1beta1 AWSCluster receiver to a v1alpha3 AWSCluster. +func (r *AWSMachineTemplate) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1.AWSMachineTemplate) + + if err := Convert_v1beta1_AWSMachineTemplate_To_v1alpha4_AWSMachineTemplate(src, r, nil); err != nil { + return err + } + + // Preserve Hub data on down-conversion. + if err := utilconversion.MarshalData(src, r); err != nil { + return err + } + + return nil +} + +// ConvertTo converts the v1alpha4 AWSMachineTemplateList receiver to a v1beta1 AWSMachineTemplateList. +func (src *AWSMachineTemplateList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1.AWSMachineTemplateList) + return Convert_v1alpha4_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList(src, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSMachineTemplateList to a v1alpha4 AWSMachineTemplateList. +func (dst *AWSMachineTemplateList) ConvertFrom(srcRaw conversion.Hub) error{ + src := srcRaw.(*infrav1.AWSMachineTemplateList) + + return Convert_v1beta1_AWSMachineTemplateList_To_v1alpha4_AWSMachineTemplateList(src, dst, nil) +} + + +func Convert_v1beta1_AWSMachineTemplateResource_To_v1alpha4_AWSMachineTemplateResource(in *infrav1.AWSMachineTemplateResource, out *AWSMachineTemplateResource, s apiconversion.Scope) error { + return autoConvert_v1beta1_AWSMachineTemplateResource_To_v1alpha4_AWSMachineTemplateResource(in, out, s) +} diff --git a/api/v1alpha4/awsmachine_types.go b/api/v1alpha4/awsmachine_types.go index c42262d0d6..8df306b45b 100644 --- a/api/v1alpha4/awsmachine_types.go +++ b/api/v1alpha4/awsmachine_types.go @@ -18,7 +18,7 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" "sigs.k8s.io/cluster-api/errors" ) @@ -190,7 +190,7 @@ type AWSMachineStatus struct { Interruptible bool `json:"interruptible,omitempty"` // Addresses contains the AWS instance associated addresses. - Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"` + Addresses []clusterv1alpha4.MachineAddress `json:"addresses,omitempty"` // InstanceState is the state of the AWS instance for this machine. // +optional @@ -236,12 +236,11 @@ type AWSMachineStatus struct { // Conditions defines current service state of the AWSMachine. // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` } // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsmachines,scope=Namespaced,categories=cluster-api,shortName=awsm -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AWSMachine belongs" // +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.instanceState",description="EC2 instance state" @@ -259,12 +258,12 @@ type AWSMachine struct { } // GetConditions returns the observations of the operational state of the AWSMachine resource. -func (r *AWSMachine) GetConditions() clusterv1.Conditions { +func (r *AWSMachine) GetConditions() clusterv1alpha4.Conditions { return r.Status.Conditions } -// SetConditions sets the underlying service state of the AWSMachine to the predescribed clusterv1.Conditions. -func (r *AWSMachine) SetConditions(conditions clusterv1.Conditions) { +// SetConditions sets the underlying service state of the AWSMachine to the predescribed clusterv1alpha4.Conditions. +func (r *AWSMachine) SetConditions(conditions clusterv1alpha4.Conditions) { r.Status.Conditions = conditions } diff --git a/api/v1alpha4/awsmachinetemplate_types.go b/api/v1alpha4/awsmachinetemplate_types.go index 9de9b7da64..edb149ab8a 100644 --- a/api/v1alpha4/awsmachinetemplate_types.go +++ b/api/v1alpha4/awsmachinetemplate_types.go @@ -27,7 +27,6 @@ type AWSMachineTemplateSpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsmachinetemplates,scope=Namespaced,categories=cluster-api,shortName=awsmt -// +kubebuilder:storageversion // AWSMachineTemplate is the Schema for the awsmachinetemplates API type AWSMachineTemplate struct { diff --git a/api/v1alpha4/conditions_consts.go b/api/v1alpha4/conditions_consts.go index 6cf83d4f72..14bb932271 100644 --- a/api/v1alpha4/conditions_consts.go +++ b/api/v1alpha4/conditions_consts.go @@ -16,18 +16,18 @@ limitations under the License. package v1alpha4 -import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" +import clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" const ( // PrincipalCredentialRetrievedCondition reports on whether Principal credentials could be retrieved successfully. // A possible scenario, where retrieval is unsuccessful, is when SourcePrincipal is not authorized for assume role. - PrincipalCredentialRetrievedCondition clusterv1.ConditionType = "PrincipalCredentialRetrieved" + PrincipalCredentialRetrievedCondition clusterv1alpha4.ConditionType = "PrincipalCredentialRetrieved" // PrincipalCredentialRetrievalFailedReason used when errors occur during identity credential retrieval. PrincipalCredentialRetrievalFailedReason = "PrincipalCredentialRetrievalFailed" // CredentialProviderBuildFailedReason used when errors occur during building providers before trying credential retrieval. CredentialProviderBuildFailedReason = "CredentialProviderBuildFailed" // PrincipalUsageAllowedCondition reports on whether Principal and all the nested source identities are allowed to be used in the AWSCluster namespace. - PrincipalUsageAllowedCondition clusterv1.ConditionType = "PrincipalUsageAllowed" + PrincipalUsageAllowedCondition clusterv1alpha4.ConditionType = "PrincipalUsageAllowed" // PrincipalUsageUnauthorizedReason used when AWSCluster namespace is not in the identity's allowed namespaces list. PrincipalUsageUnauthorizedReason = "PrincipalUsageUnauthorized" // SourcePrincipalUsageUnauthorizedReason used when AWSCluster is not in the intersection of source identity allowed namespaces @@ -37,7 +37,7 @@ const ( const ( // VpcReadyCondition reports on the successful reconciliation of a VPC. - VpcReadyCondition clusterv1.ConditionType = "VpcReady" + VpcReadyCondition clusterv1alpha4.ConditionType = "VpcReady" // VpcCreationStartedReason used when attempting to create a VPC for a managed cluster. // Will not be applied to unmanaged clusters. VpcCreationStartedReason = "VpcCreationStarted" @@ -47,7 +47,7 @@ const ( const ( // SubnetsReadyCondition reports on the successful reconciliation of subnets. - SubnetsReadyCondition clusterv1.ConditionType = "SubnetsReady" + SubnetsReadyCondition clusterv1alpha4.ConditionType = "SubnetsReady" // SubnetsReconciliationFailedReason used to report failures while reconciling subnets. SubnetsReconciliationFailedReason = "SubnetsReconciliationFailed" ) @@ -55,7 +55,7 @@ const ( const ( // InternetGatewayReadyCondition reports on the successful reconciliation of internet gateways. // Only applicable to managed clusters. - InternetGatewayReadyCondition clusterv1.ConditionType = "InternetGatewayReady" + InternetGatewayReadyCondition clusterv1alpha4.ConditionType = "InternetGatewayReady" // InternetGatewayFailedReason used when errors occur during internet gateway reconciliation. InternetGatewayFailedReason = "InternetGatewayFailed" ) @@ -63,7 +63,7 @@ const ( const ( // NatGatewaysReadyCondition reports successful reconciliation of NAT gateways. // Only applicable to managed clusters. - NatGatewaysReadyCondition clusterv1.ConditionType = "NatGatewaysReady" + NatGatewaysReadyCondition clusterv1alpha4.ConditionType = "NatGatewaysReady" // NatGatewaysCreationStartedReason set once when creating new NAT gateways. NatGatewaysCreationStartedReason = "NatGatewaysCreationStarted" // NatGatewaysReconciliationFailedReason used when any errors occur during reconciliation of NAT gateways. @@ -73,7 +73,7 @@ const ( const ( // RouteTablesReadyCondition reports successful reconciliation of route tables. // Only applicable to managed clusters. - RouteTablesReadyCondition clusterv1.ConditionType = "RouteTablesReady" + RouteTablesReadyCondition clusterv1alpha4.ConditionType = "RouteTablesReady" // RouteTableReconciliationFailedReason used when any errors occur during reconciliation of route tables. RouteTableReconciliationFailedReason = "RouteTableReconciliationFailed" ) @@ -81,14 +81,14 @@ const ( const ( // SecondaryCidrsReadyCondition reports successful reconciliation of secondary CIDR blocks. // Only applicable to managed clusters. - SecondaryCidrsReadyCondition clusterv1.ConditionType = "SecondaryCidrsReady" + SecondaryCidrsReadyCondition clusterv1alpha4.ConditionType = "SecondaryCidrsReady" // SecondaryCidrReconciliationFailedReason used when any errors occur during reconciliation of secondary CIDR blocks. SecondaryCidrReconciliationFailedReason = "SecondaryCidrReconciliationFailed" ) const ( // ClusterSecurityGroupsReadyCondition reports successful reconciliation of security groups. - ClusterSecurityGroupsReadyCondition clusterv1.ConditionType = "ClusterSecurityGroupsReady" + ClusterSecurityGroupsReadyCondition clusterv1alpha4.ConditionType = "ClusterSecurityGroupsReady" // ClusterSecurityGroupReconciliationFailedReason used when any errors occur during reconciliation of security groups. ClusterSecurityGroupReconciliationFailedReason = "SecurityGroupReconciliationFailed" ) @@ -96,7 +96,7 @@ const ( const ( // BastionHostReadyCondition reports whether a bastion host is ready. Depending on the configuration, a cluster // may not require a bastion host and this condition will be skipped. - BastionHostReadyCondition clusterv1.ConditionType = "BastionHostReady" + BastionHostReadyCondition clusterv1alpha4.ConditionType = "BastionHostReady" // BastionCreationStartedReason used when creating a new bastion host. BastionCreationStartedReason = "BastionCreationStarted" // BastionHostFailedReason used when an error occurs during the creation of a bastion host. @@ -105,7 +105,7 @@ const ( const ( // LoadBalancerReadyCondition reports on whether a control plane load balancer was successfully reconciled. - LoadBalancerReadyCondition clusterv1.ConditionType = "LoadBalancerReady" + LoadBalancerReadyCondition clusterv1alpha4.ConditionType = "LoadBalancerReady" // WaitForDNSNameReason used while waiting for a DNS name for the API server to be populated. WaitForDNSNameReason = "WaitForDNSName" // WaitForDNSNameResolveReason used while waiting for DNS name to resolve. @@ -116,7 +116,7 @@ const ( const ( // InstanceReadyCondition reports on current status of the EC2 instance. Ready indicates the instance is in a Running state. - InstanceReadyCondition clusterv1.ConditionType = "InstanceReady" + InstanceReadyCondition clusterv1alpha4.ConditionType = "InstanceReady" // InstanceNotFoundReason used when the instance couldn't be retrieved. InstanceNotFoundReason = "InstanceNotFound" @@ -138,7 +138,7 @@ const ( const ( // SecurityGroupsReadyCondition indicates the security groups are up to date on the AWSMachine. - SecurityGroupsReadyCondition clusterv1.ConditionType = "SecurityGroupsReady" + SecurityGroupsReadyCondition clusterv1alpha4.ConditionType = "SecurityGroupsReady" // SecurityGroupsFailedReason used when the security groups could not be synced. SecurityGroupsFailedReason = "SecurityGroupsSyncFailed" @@ -149,7 +149,7 @@ const ( // When set to false, severity can be an Error if the subnet is not found or unavailable in the instance's AZ. // Note this is only applicable to control plane machines. // Only applicable to control plane machines. - ELBAttachedCondition clusterv1.ConditionType = "ELBAttached" + ELBAttachedCondition clusterv1alpha4.ConditionType = "ELBAttached" // ELBAttachFailedReason used when a control plane node fails to attach to the ELB. ELBAttachFailedReason = "ELBAttachFailed" diff --git a/api/v1alpha4/conversion.go b/api/v1alpha4/conversion.go index 2e1b14c3dc..82f4d56d56 100644 --- a/api/v1alpha4/conversion.go +++ b/api/v1alpha4/conversion.go @@ -16,38 +16,18 @@ limitations under the License. package v1alpha4 -// Hub marks AWSCluster as a conversion hub. -func (*AWSCluster) Hub() {} - -// Hub marks AWSClusterList as a conversion hub. -func (*AWSClusterList) Hub() {} - -// Hub marks AWSMachine as a conversion hub. -func (*AWSMachine) Hub() {} - -// Hub marks AWSMachineList as a conversion hub. -func (*AWSMachineList) Hub() {} - -// Hub marks AWSMachineTemplate as a conversion hub. -func (*AWSMachineTemplate) Hub() {} - -// Hub marks AWSMachineTemplateList as a conversion hub. -func (*AWSMachineTemplateList) Hub() {} - -// Hub marks AWSClusterStaticIdentity as a conversion hub. -func (*AWSClusterStaticIdentity) Hub() {} - -// Hub marks AWSClusterStaticIdentityList as a conversion hub. -func (*AWSClusterStaticIdentityList) Hub() {} - -// Hub marks AWSClusterRoleIdentity as a conversion hub. -func (*AWSClusterRoleIdentity) Hub() {} - -// Hub marks AWSClusterRoleIdentityList as a conversion hub. -func (*AWSClusterRoleIdentityList) Hub() {} - -// Hub marks AWSClusterControllerIdentity as a conversion hub. -func (*AWSClusterControllerIdentity) Hub() {} - -// Hub marks AWSClusterControllerIdentityList as a conversion hub. -func (*AWSClusterControllerIdentityList) Hub() {} +import ( + apiconversion "k8s.io/apimachinery/pkg/conversion" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" +) + +// Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint . +func Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in *clusterv1alpha4.ObjectMeta, out *clusterv1.ObjectMeta, s apiconversion.Scope) error { + return clusterv1alpha4.Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in, out, s) +} + +// Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint . +func Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in *clusterv1.ObjectMeta, out *clusterv1alpha4.ObjectMeta, s apiconversion.Scope) error { + return clusterv1alpha4.Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in, out, s) +} diff --git a/api/v1alpha4/conversion_test.go b/api/v1alpha4/conversion_test.go new file mode 100644 index 0000000000..475bbab05e --- /dev/null +++ b/api/v1alpha4/conversion_test.go @@ -0,0 +1,70 @@ +/* +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" + + runtime "k8s.io/apimachinery/pkg/runtime" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + utilconversion "sigs.k8s.io/cluster-api/util/conversion" +) + +func TestFuzzyConversion(t *testing.T) { + g := NewWithT(t) + scheme := runtime.NewScheme() + g.Expect(AddToScheme(scheme)).To(Succeed()) + g.Expect(v1beta1.AddToScheme(scheme)).To(Succeed()) + + t.Run("for AWSCluster", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1beta1.AWSCluster{}, + Spoke: &AWSCluster{}, + })) + + t.Run("for AWSMachine", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1beta1.AWSMachine{}, + Spoke: &AWSMachine{}, + })) + + t.Run("for AWSMachineTemplate", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1beta1.AWSMachineTemplate{}, + Spoke: &AWSMachineTemplate{}, + })) + + t.Run("for AWSClusterStaticIdentity", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1beta1.AWSClusterStaticIdentity{}, + Spoke: &AWSClusterStaticIdentity{}, + })) + + t.Run("for AWSClusterControllerIdentity", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1beta1.AWSClusterControllerIdentity{}, + Spoke: &AWSClusterControllerIdentity{}, + })) + + t.Run("for AWSClusterRoleIdentity", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1beta1.AWSClusterRoleIdentity{}, + Spoke: &AWSClusterRoleIdentity{}, + })) +} diff --git a/api/v1alpha4/defaults.go b/api/v1alpha4/defaults.go index 2cbb38d6f7..ee45fbfcae 100644 --- a/api/v1alpha4/defaults.go +++ b/api/v1alpha4/defaults.go @@ -18,11 +18,9 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" + clusterv1alpha4 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" ) -// TODO (richardcase): get this working with defaulter-gen - // SetDefaults_Bastion is used by defaulter-gen. func SetDefaults_Bastion(obj *Bastion) { //nolint:golint,stylecheck // Default to allow open access to the bastion host if no CIDR Blocks have been set @@ -59,6 +57,6 @@ func SetDefaults_Labels(obj *metav1.ObjectMeta) { //nolint:golint,stylecheck // Defaults to set label if no labels have been set if obj.Labels == nil { obj.Labels = map[string]string{ - clusterv1.ClusterctlMoveHierarchyLabelName: ""} + clusterv1alpha4.ClusterctlMoveHierarchyLabelName: ""} } } diff --git a/api/v1alpha4/doc.go b/api/v1alpha4/doc.go index 0ab416e390..478cb82417 100644 --- a/api/v1alpha4/doc.go +++ b/api/v1alpha4/doc.go @@ -14,7 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +gencrdrefdocs:force // +groupName=infrastructure.cluster.x-k8s.io +// Package v1alpha4 contains the v1alpha4 API implementation. +// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-aws/api/v1beta1 package v1alpha4 diff --git a/api/v1alpha4/groupversion_info.go b/api/v1alpha4/groupversion_info.go index 7953553546..0986718ae3 100644 --- a/api/v1alpha4/groupversion_info.go +++ b/api/v1alpha4/groupversion_info.go @@ -33,4 +33,6 @@ var ( // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme + + localSchemeBuilder = SchemeBuilder.SchemeBuilder ) diff --git a/api/v1alpha4/tags.go b/api/v1alpha4/tags.go index 4a4ad9625e..7269f45e86 100644 --- a/api/v1alpha4/tags.go +++ b/api/v1alpha4/tags.go @@ -21,7 +21,7 @@ import ( "reflect" "k8s.io/apimachinery/pkg/types" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" ) // Tags defines a map of tags. @@ -169,7 +169,7 @@ type BuildParams struct { // WithMachineName tags the namespaced machine name // The machine name will be tagged with key "MachineName". -func (b BuildParams) WithMachineName(m *clusterv1.Machine) BuildParams { +func (b BuildParams) WithMachineName(m *clusterv1alpha4.Machine) BuildParams { machineNamespacedName := types.NamespacedName{Namespace: m.Namespace, Name: m.Name} b.Additional[MachineNameTagKey] = machineNamespacedName.String() return b diff --git a/api/v1alpha4/types.go b/api/v1alpha4/types.go index 70d277a7b9..9f580a6459 100644 --- a/api/v1alpha4/types.go +++ b/api/v1alpha4/types.go @@ -22,7 +22,7 @@ import ( "time" "k8s.io/apimachinery/pkg/util/sets" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" ) const ( @@ -656,7 +656,7 @@ type Instance struct { IAMProfile string `json:"iamProfile,omitempty"` // Addresses contains the AWS instance associated addresses. - Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"` + Addresses []clusterv1alpha4.MachineAddress `json:"addresses,omitempty"` // The private IPv4 address assigned to the instance. PrivateIP *string `json:"privateIp,omitempty"` diff --git a/api/v1alpha4/validate.go b/api/v1alpha4/validate.go index cca9ac5fdd..e1a18979e8 100644 --- a/api/v1alpha4/validate.go +++ b/api/v1alpha4/validate.go @@ -19,15 +19,10 @@ package v1alpha4 import ( "fmt" "net" - "regexp" "k8s.io/apimachinery/pkg/util/validation/field" ) -var ( - sshKeyValidNameRegex = regexp.MustCompile(`^[[:graph:]]+([[:print:]]*[[:graph:]]+)*$`) -) - // Validate will validate the bastion fields. func (b *Bastion) Validate() []*field.Error { var errs field.ErrorList @@ -48,16 +43,3 @@ func (b *Bastion) Validate() []*field.Error { } return errs } - -func validateSSHKeyName(sshKeyName *string) field.ErrorList { - var allErrs field.ErrorList - switch { - case sshKeyName == nil: - // nil is accepted - case sshKeyName != nil && *sshKeyName == "": - // empty string is accepted - case sshKeyName != nil && !sshKeyValidNameRegex.Match([]byte(*sshKeyName)): - allErrs = append(allErrs, field.Invalid(field.NewPath("sshKeyName"), sshKeyName, "Name is invalid. Must be specified in ASCII and must not start or end in whitespace")) - } - return allErrs -} diff --git a/api/v1alpha4/zz_generated.conversion.go b/api/v1alpha4/zz_generated.conversion.go new file mode 100644 index 0000000000..39ad0966b9 --- /dev/null +++ b/api/v1alpha4/zz_generated.conversion.go @@ -0,0 +1,2209 @@ +// +build !ignore_autogenerated_conversions + +/* +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 ( + time "time" + unsafe "unsafe" + + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" + errors "sigs.k8s.io/cluster-api/errors" +) + +func init() { + localSchemeBuilder.Register(RegisterConversions) +} + +// RegisterConversions adds conversion functions to the given scheme. +// Public to allow building arbitrary schemes. +func RegisterConversions(s *runtime.Scheme) error { + if err := s.AddGeneratedConversionFunc((*AMIReference)(nil), (*v1beta1.AMIReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AMIReference_To_v1beta1_AMIReference(a.(*AMIReference), b.(*v1beta1.AMIReference), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AMIReference)(nil), (*AMIReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AMIReference_To_v1alpha4_AMIReference(a.(*v1beta1.AMIReference), b.(*AMIReference), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSCluster)(nil), (*v1beta1.AWSCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSCluster_To_v1beta1_AWSCluster(a.(*AWSCluster), b.(*v1beta1.AWSCluster), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSCluster)(nil), (*AWSCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSCluster_To_v1alpha4_AWSCluster(a.(*v1beta1.AWSCluster), b.(*AWSCluster), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSClusterControllerIdentity)(nil), (*v1beta1.AWSClusterControllerIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity(a.(*AWSClusterControllerIdentity), b.(*v1beta1.AWSClusterControllerIdentity), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterControllerIdentity)(nil), (*AWSClusterControllerIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterControllerIdentity_To_v1alpha4_AWSClusterControllerIdentity(a.(*v1beta1.AWSClusterControllerIdentity), b.(*AWSClusterControllerIdentity), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSClusterControllerIdentityList)(nil), (*v1beta1.AWSClusterControllerIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList(a.(*AWSClusterControllerIdentityList), b.(*v1beta1.AWSClusterControllerIdentityList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterControllerIdentityList)(nil), (*AWSClusterControllerIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterControllerIdentityList_To_v1alpha4_AWSClusterControllerIdentityList(a.(*v1beta1.AWSClusterControllerIdentityList), b.(*AWSClusterControllerIdentityList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSClusterControllerIdentitySpec)(nil), (*v1beta1.AWSClusterControllerIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec(a.(*AWSClusterControllerIdentitySpec), b.(*v1beta1.AWSClusterControllerIdentitySpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterControllerIdentitySpec)(nil), (*AWSClusterControllerIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterControllerIdentitySpec_To_v1alpha4_AWSClusterControllerIdentitySpec(a.(*v1beta1.AWSClusterControllerIdentitySpec), b.(*AWSClusterControllerIdentitySpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSClusterIdentitySpec)(nil), (*v1beta1.AWSClusterIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(a.(*AWSClusterIdentitySpec), b.(*v1beta1.AWSClusterIdentitySpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterIdentitySpec)(nil), (*AWSClusterIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterIdentitySpec_To_v1alpha4_AWSClusterIdentitySpec(a.(*v1beta1.AWSClusterIdentitySpec), b.(*AWSClusterIdentitySpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSClusterList)(nil), (*v1beta1.AWSClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSClusterList_To_v1beta1_AWSClusterList(a.(*AWSClusterList), b.(*v1beta1.AWSClusterList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterList)(nil), (*AWSClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterList_To_v1alpha4_AWSClusterList(a.(*v1beta1.AWSClusterList), b.(*AWSClusterList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSClusterRoleIdentity)(nil), (*v1beta1.AWSClusterRoleIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity(a.(*AWSClusterRoleIdentity), b.(*v1beta1.AWSClusterRoleIdentity), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterRoleIdentity)(nil), (*AWSClusterRoleIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterRoleIdentity_To_v1alpha4_AWSClusterRoleIdentity(a.(*v1beta1.AWSClusterRoleIdentity), b.(*AWSClusterRoleIdentity), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSClusterRoleIdentityList)(nil), (*v1beta1.AWSClusterRoleIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList(a.(*AWSClusterRoleIdentityList), b.(*v1beta1.AWSClusterRoleIdentityList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterRoleIdentityList)(nil), (*AWSClusterRoleIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterRoleIdentityList_To_v1alpha4_AWSClusterRoleIdentityList(a.(*v1beta1.AWSClusterRoleIdentityList), b.(*AWSClusterRoleIdentityList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSClusterRoleIdentitySpec)(nil), (*v1beta1.AWSClusterRoleIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec(a.(*AWSClusterRoleIdentitySpec), b.(*v1beta1.AWSClusterRoleIdentitySpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterRoleIdentitySpec)(nil), (*AWSClusterRoleIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterRoleIdentitySpec_To_v1alpha4_AWSClusterRoleIdentitySpec(a.(*v1beta1.AWSClusterRoleIdentitySpec), b.(*AWSClusterRoleIdentitySpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSClusterSpec)(nil), (*v1beta1.AWSClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSClusterSpec_To_v1beta1_AWSClusterSpec(a.(*AWSClusterSpec), b.(*v1beta1.AWSClusterSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterSpec)(nil), (*AWSClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterSpec_To_v1alpha4_AWSClusterSpec(a.(*v1beta1.AWSClusterSpec), b.(*AWSClusterSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSClusterStaticIdentity)(nil), (*v1beta1.AWSClusterStaticIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity(a.(*AWSClusterStaticIdentity), b.(*v1beta1.AWSClusterStaticIdentity), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterStaticIdentity)(nil), (*AWSClusterStaticIdentity)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterStaticIdentity_To_v1alpha4_AWSClusterStaticIdentity(a.(*v1beta1.AWSClusterStaticIdentity), b.(*AWSClusterStaticIdentity), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSClusterStaticIdentityList)(nil), (*v1beta1.AWSClusterStaticIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList(a.(*AWSClusterStaticIdentityList), b.(*v1beta1.AWSClusterStaticIdentityList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterStaticIdentityList)(nil), (*AWSClusterStaticIdentityList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterStaticIdentityList_To_v1alpha4_AWSClusterStaticIdentityList(a.(*v1beta1.AWSClusterStaticIdentityList), b.(*AWSClusterStaticIdentityList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSClusterStaticIdentitySpec)(nil), (*v1beta1.AWSClusterStaticIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec(a.(*AWSClusterStaticIdentitySpec), b.(*v1beta1.AWSClusterStaticIdentitySpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterStaticIdentitySpec)(nil), (*AWSClusterStaticIdentitySpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterStaticIdentitySpec_To_v1alpha4_AWSClusterStaticIdentitySpec(a.(*v1beta1.AWSClusterStaticIdentitySpec), b.(*AWSClusterStaticIdentitySpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSClusterStatus)(nil), (*v1beta1.AWSClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSClusterStatus_To_v1beta1_AWSClusterStatus(a.(*AWSClusterStatus), b.(*v1beta1.AWSClusterStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterStatus)(nil), (*AWSClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterStatus_To_v1alpha4_AWSClusterStatus(a.(*v1beta1.AWSClusterStatus), b.(*AWSClusterStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSClusterTemplate)(nil), (*v1beta1.AWSClusterTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSClusterTemplate_To_v1beta1_AWSClusterTemplate(a.(*AWSClusterTemplate), b.(*v1beta1.AWSClusterTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterTemplate)(nil), (*AWSClusterTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterTemplate_To_v1alpha4_AWSClusterTemplate(a.(*v1beta1.AWSClusterTemplate), b.(*AWSClusterTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSClusterTemplateList)(nil), (*v1beta1.AWSClusterTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSClusterTemplateList_To_v1beta1_AWSClusterTemplateList(a.(*AWSClusterTemplateList), b.(*v1beta1.AWSClusterTemplateList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterTemplateList)(nil), (*AWSClusterTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterTemplateList_To_v1alpha4_AWSClusterTemplateList(a.(*v1beta1.AWSClusterTemplateList), b.(*AWSClusterTemplateList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSClusterTemplateResource)(nil), (*v1beta1.AWSClusterTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSClusterTemplateResource_To_v1beta1_AWSClusterTemplateResource(a.(*AWSClusterTemplateResource), b.(*v1beta1.AWSClusterTemplateResource), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSClusterTemplateSpec)(nil), (*v1beta1.AWSClusterTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSClusterTemplateSpec_To_v1beta1_AWSClusterTemplateSpec(a.(*AWSClusterTemplateSpec), b.(*v1beta1.AWSClusterTemplateSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSClusterTemplateSpec)(nil), (*AWSClusterTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterTemplateSpec_To_v1alpha4_AWSClusterTemplateSpec(a.(*v1beta1.AWSClusterTemplateSpec), b.(*AWSClusterTemplateSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSIdentityReference)(nil), (*v1beta1.AWSIdentityReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSIdentityReference_To_v1beta1_AWSIdentityReference(a.(*AWSIdentityReference), b.(*v1beta1.AWSIdentityReference), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSIdentityReference)(nil), (*AWSIdentityReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSIdentityReference_To_v1alpha4_AWSIdentityReference(a.(*v1beta1.AWSIdentityReference), b.(*AWSIdentityReference), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSLoadBalancerSpec)(nil), (*v1beta1.AWSLoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSLoadBalancerSpec_To_v1beta1_AWSLoadBalancerSpec(a.(*AWSLoadBalancerSpec), b.(*v1beta1.AWSLoadBalancerSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSLoadBalancerSpec)(nil), (*AWSLoadBalancerSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSLoadBalancerSpec_To_v1alpha4_AWSLoadBalancerSpec(a.(*v1beta1.AWSLoadBalancerSpec), b.(*AWSLoadBalancerSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSMachine)(nil), (*v1beta1.AWSMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSMachine_To_v1beta1_AWSMachine(a.(*AWSMachine), b.(*v1beta1.AWSMachine), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachine)(nil), (*AWSMachine)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachine_To_v1alpha4_AWSMachine(a.(*v1beta1.AWSMachine), b.(*AWSMachine), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSMachineList)(nil), (*v1beta1.AWSMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSMachineList_To_v1beta1_AWSMachineList(a.(*AWSMachineList), b.(*v1beta1.AWSMachineList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachineList)(nil), (*AWSMachineList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachineList_To_v1alpha4_AWSMachineList(a.(*v1beta1.AWSMachineList), b.(*AWSMachineList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSMachineSpec)(nil), (*v1beta1.AWSMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSMachineSpec_To_v1beta1_AWSMachineSpec(a.(*AWSMachineSpec), b.(*v1beta1.AWSMachineSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachineSpec)(nil), (*AWSMachineSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachineSpec_To_v1alpha4_AWSMachineSpec(a.(*v1beta1.AWSMachineSpec), b.(*AWSMachineSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSMachineStatus)(nil), (*v1beta1.AWSMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSMachineStatus_To_v1beta1_AWSMachineStatus(a.(*AWSMachineStatus), b.(*v1beta1.AWSMachineStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachineStatus)(nil), (*AWSMachineStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachineStatus_To_v1alpha4_AWSMachineStatus(a.(*v1beta1.AWSMachineStatus), b.(*AWSMachineStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSMachineTemplate)(nil), (*v1beta1.AWSMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(a.(*AWSMachineTemplate), b.(*v1beta1.AWSMachineTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachineTemplate)(nil), (*AWSMachineTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachineTemplate_To_v1alpha4_AWSMachineTemplate(a.(*v1beta1.AWSMachineTemplate), b.(*AWSMachineTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSMachineTemplateList)(nil), (*v1beta1.AWSMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList(a.(*AWSMachineTemplateList), b.(*v1beta1.AWSMachineTemplateList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachineTemplateList)(nil), (*AWSMachineTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachineTemplateList_To_v1alpha4_AWSMachineTemplateList(a.(*v1beta1.AWSMachineTemplateList), b.(*AWSMachineTemplateList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSMachineTemplateResource)(nil), (*v1beta1.AWSMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource(a.(*AWSMachineTemplateResource), b.(*v1beta1.AWSMachineTemplateResource), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSMachineTemplateSpec)(nil), (*v1beta1.AWSMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec(a.(*AWSMachineTemplateSpec), b.(*v1beta1.AWSMachineTemplateSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachineTemplateSpec)(nil), (*AWSMachineTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachineTemplateSpec_To_v1alpha4_AWSMachineTemplateSpec(a.(*v1beta1.AWSMachineTemplateSpec), b.(*AWSMachineTemplateSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSResourceReference)(nil), (*v1beta1.AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSResourceReference_To_v1beta1_AWSResourceReference(a.(*AWSResourceReference), b.(*v1beta1.AWSResourceReference), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSResourceReference)(nil), (*AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSResourceReference_To_v1alpha4_AWSResourceReference(a.(*v1beta1.AWSResourceReference), b.(*AWSResourceReference), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSRoleSpec)(nil), (*v1beta1.AWSRoleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSRoleSpec_To_v1beta1_AWSRoleSpec(a.(*AWSRoleSpec), b.(*v1beta1.AWSRoleSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSRoleSpec)(nil), (*AWSRoleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSRoleSpec_To_v1alpha4_AWSRoleSpec(a.(*v1beta1.AWSRoleSpec), b.(*AWSRoleSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AllowedNamespaces)(nil), (*v1beta1.AllowedNamespaces)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AllowedNamespaces_To_v1beta1_AllowedNamespaces(a.(*AllowedNamespaces), b.(*v1beta1.AllowedNamespaces), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AllowedNamespaces)(nil), (*AllowedNamespaces)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AllowedNamespaces_To_v1alpha4_AllowedNamespaces(a.(*v1beta1.AllowedNamespaces), b.(*AllowedNamespaces), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Bastion)(nil), (*v1beta1.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Bastion_To_v1beta1_Bastion(a.(*Bastion), b.(*v1beta1.Bastion), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.Bastion)(nil), (*Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Bastion_To_v1alpha4_Bastion(a.(*v1beta1.Bastion), b.(*Bastion), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*BuildParams)(nil), (*v1beta1.BuildParams)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_BuildParams_To_v1beta1_BuildParams(a.(*BuildParams), b.(*v1beta1.BuildParams), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.BuildParams)(nil), (*BuildParams)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_BuildParams_To_v1alpha4_BuildParams(a.(*v1beta1.BuildParams), b.(*BuildParams), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*CNIIngressRule)(nil), (*v1beta1.CNIIngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_CNIIngressRule_To_v1beta1_CNIIngressRule(a.(*CNIIngressRule), b.(*v1beta1.CNIIngressRule), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.CNIIngressRule)(nil), (*CNIIngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_CNIIngressRule_To_v1alpha4_CNIIngressRule(a.(*v1beta1.CNIIngressRule), b.(*CNIIngressRule), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*CNISpec)(nil), (*v1beta1.CNISpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_CNISpec_To_v1beta1_CNISpec(a.(*CNISpec), b.(*v1beta1.CNISpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.CNISpec)(nil), (*CNISpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_CNISpec_To_v1alpha4_CNISpec(a.(*v1beta1.CNISpec), b.(*CNISpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClassicELB)(nil), (*v1beta1.ClassicELB)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ClassicELB_To_v1beta1_ClassicELB(a.(*ClassicELB), b.(*v1beta1.ClassicELB), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ClassicELB)(nil), (*ClassicELB)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClassicELB_To_v1alpha4_ClassicELB(a.(*v1beta1.ClassicELB), b.(*ClassicELB), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClassicELBAttributes)(nil), (*v1beta1.ClassicELBAttributes)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ClassicELBAttributes_To_v1beta1_ClassicELBAttributes(a.(*ClassicELBAttributes), b.(*v1beta1.ClassicELBAttributes), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ClassicELBAttributes)(nil), (*ClassicELBAttributes)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClassicELBAttributes_To_v1alpha4_ClassicELBAttributes(a.(*v1beta1.ClassicELBAttributes), b.(*ClassicELBAttributes), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClassicELBHealthCheck)(nil), (*v1beta1.ClassicELBHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ClassicELBHealthCheck_To_v1beta1_ClassicELBHealthCheck(a.(*ClassicELBHealthCheck), b.(*v1beta1.ClassicELBHealthCheck), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ClassicELBHealthCheck)(nil), (*ClassicELBHealthCheck)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClassicELBHealthCheck_To_v1alpha4_ClassicELBHealthCheck(a.(*v1beta1.ClassicELBHealthCheck), b.(*ClassicELBHealthCheck), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClassicELBListener)(nil), (*v1beta1.ClassicELBListener)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ClassicELBListener_To_v1beta1_ClassicELBListener(a.(*ClassicELBListener), b.(*v1beta1.ClassicELBListener), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ClassicELBListener)(nil), (*ClassicELBListener)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClassicELBListener_To_v1alpha4_ClassicELBListener(a.(*v1beta1.ClassicELBListener), b.(*ClassicELBListener), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*CloudInit)(nil), (*v1beta1.CloudInit)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_CloudInit_To_v1beta1_CloudInit(a.(*CloudInit), b.(*v1beta1.CloudInit), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.CloudInit)(nil), (*CloudInit)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_CloudInit_To_v1alpha4_CloudInit(a.(*v1beta1.CloudInit), b.(*CloudInit), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Filter)(nil), (*v1beta1.Filter)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Filter_To_v1beta1_Filter(a.(*Filter), b.(*v1beta1.Filter), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.Filter)(nil), (*Filter)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Filter_To_v1alpha4_Filter(a.(*v1beta1.Filter), b.(*Filter), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*IngressRule)(nil), (*v1beta1.IngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_IngressRule_To_v1beta1_IngressRule(a.(*IngressRule), b.(*v1beta1.IngressRule), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.IngressRule)(nil), (*IngressRule)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_IngressRule_To_v1alpha4_IngressRule(a.(*v1beta1.IngressRule), b.(*IngressRule), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Instance)(nil), (*v1beta1.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Instance_To_v1beta1_Instance(a.(*Instance), b.(*v1beta1.Instance), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.Instance)(nil), (*Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Instance_To_v1alpha4_Instance(a.(*v1beta1.Instance), b.(*Instance), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*NetworkSpec)(nil), (*v1beta1.NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_NetworkSpec_To_v1beta1_NetworkSpec(a.(*NetworkSpec), b.(*v1beta1.NetworkSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.NetworkSpec)(nil), (*NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_NetworkSpec_To_v1alpha4_NetworkSpec(a.(*v1beta1.NetworkSpec), b.(*NetworkSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*NetworkStatus)(nil), (*v1beta1.NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_NetworkStatus_To_v1beta1_NetworkStatus(a.(*NetworkStatus), b.(*v1beta1.NetworkStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.NetworkStatus)(nil), (*NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_NetworkStatus_To_v1alpha4_NetworkStatus(a.(*v1beta1.NetworkStatus), b.(*NetworkStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*RouteTable)(nil), (*v1beta1.RouteTable)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_RouteTable_To_v1beta1_RouteTable(a.(*RouteTable), b.(*v1beta1.RouteTable), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.RouteTable)(nil), (*RouteTable)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_RouteTable_To_v1alpha4_RouteTable(a.(*v1beta1.RouteTable), b.(*RouteTable), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*SecurityGroup)(nil), (*v1beta1.SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_SecurityGroup_To_v1beta1_SecurityGroup(a.(*SecurityGroup), b.(*v1beta1.SecurityGroup), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.SecurityGroup)(nil), (*SecurityGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_SecurityGroup_To_v1alpha4_SecurityGroup(a.(*v1beta1.SecurityGroup), b.(*SecurityGroup), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*SpotMarketOptions)(nil), (*v1beta1.SpotMarketOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_SpotMarketOptions_To_v1beta1_SpotMarketOptions(a.(*SpotMarketOptions), b.(*v1beta1.SpotMarketOptions), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.SpotMarketOptions)(nil), (*SpotMarketOptions)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_SpotMarketOptions_To_v1alpha4_SpotMarketOptions(a.(*v1beta1.SpotMarketOptions), b.(*SpotMarketOptions), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*SubnetSpec)(nil), (*v1beta1.SubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_SubnetSpec_To_v1beta1_SubnetSpec(a.(*SubnetSpec), b.(*v1beta1.SubnetSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.SubnetSpec)(nil), (*SubnetSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_SubnetSpec_To_v1alpha4_SubnetSpec(a.(*v1beta1.SubnetSpec), b.(*SubnetSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*VPCSpec)(nil), (*v1beta1.VPCSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_VPCSpec_To_v1beta1_VPCSpec(a.(*VPCSpec), b.(*v1beta1.VPCSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.VPCSpec)(nil), (*VPCSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_VPCSpec_To_v1alpha4_VPCSpec(a.(*v1beta1.VPCSpec), b.(*VPCSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Volume)(nil), (*v1beta1.Volume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Volume_To_v1beta1_Volume(a.(*Volume), b.(*v1beta1.Volume), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.Volume)(nil), (*Volume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Volume_To_v1alpha4_Volume(a.(*v1beta1.Volume), b.(*Volume), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta1.AWSClusterTemplateResource)(nil), (*AWSClusterTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSClusterTemplateResource_To_v1alpha4_AWSClusterTemplateResource(a.(*v1beta1.AWSClusterTemplateResource), b.(*AWSClusterTemplateResource), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta1.AWSMachineTemplateResource)(nil), (*AWSMachineTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachineTemplateResource_To_v1alpha4_AWSMachineTemplateResource(a.(*v1beta1.AWSMachineTemplateResource), b.(*AWSMachineTemplateResource), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha4_AMIReference_To_v1beta1_AMIReference(in *AMIReference, out *v1beta1.AMIReference, s conversion.Scope) error { + out.ID = (*string)(unsafe.Pointer(in.ID)) + out.EKSOptimizedLookupType = (*v1beta1.EKSAMILookupType)(unsafe.Pointer(in.EKSOptimizedLookupType)) + return nil +} + +// Convert_v1alpha4_AMIReference_To_v1beta1_AMIReference is an autogenerated conversion function. +func Convert_v1alpha4_AMIReference_To_v1beta1_AMIReference(in *AMIReference, out *v1beta1.AMIReference, s conversion.Scope) error { + return autoConvert_v1alpha4_AMIReference_To_v1beta1_AMIReference(in, out, s) +} + +func autoConvert_v1beta1_AMIReference_To_v1alpha4_AMIReference(in *v1beta1.AMIReference, out *AMIReference, s conversion.Scope) error { + out.ID = (*string)(unsafe.Pointer(in.ID)) + out.EKSOptimizedLookupType = (*EKSAMILookupType)(unsafe.Pointer(in.EKSOptimizedLookupType)) + return nil +} + +// Convert_v1beta1_AMIReference_To_v1alpha4_AMIReference is an autogenerated conversion function. +func Convert_v1beta1_AMIReference_To_v1alpha4_AMIReference(in *v1beta1.AMIReference, out *AMIReference, s conversion.Scope) error { + return autoConvert_v1beta1_AMIReference_To_v1alpha4_AMIReference(in, out, s) +} + +func autoConvert_v1alpha4_AWSCluster_To_v1beta1_AWSCluster(in *AWSCluster, out *v1beta1.AWSCluster, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_AWSClusterSpec_To_v1beta1_AWSClusterSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_AWSClusterStatus_To_v1beta1_AWSClusterStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSCluster_To_v1beta1_AWSCluster is an autogenerated conversion function. +func Convert_v1alpha4_AWSCluster_To_v1beta1_AWSCluster(in *AWSCluster, out *v1beta1.AWSCluster, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSCluster_To_v1beta1_AWSCluster(in, out, s) +} + +func autoConvert_v1beta1_AWSCluster_To_v1alpha4_AWSCluster(in *v1beta1.AWSCluster, out *AWSCluster, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_AWSClusterSpec_To_v1alpha4_AWSClusterSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_AWSClusterStatus_To_v1alpha4_AWSClusterStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AWSCluster_To_v1alpha4_AWSCluster is an autogenerated conversion function. +func Convert_v1beta1_AWSCluster_To_v1alpha4_AWSCluster(in *v1beta1.AWSCluster, out *AWSCluster, s conversion.Scope) error { + return autoConvert_v1beta1_AWSCluster_To_v1alpha4_AWSCluster(in, out, s) +} + +func autoConvert_v1alpha4_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity(in *AWSClusterControllerIdentity, out *v1beta1.AWSClusterControllerIdentity, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity(in *AWSClusterControllerIdentity, out *v1beta1.AWSClusterControllerIdentity, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterControllerIdentity_To_v1beta1_AWSClusterControllerIdentity(in, out, s) +} + +func autoConvert_v1beta1_AWSClusterControllerIdentity_To_v1alpha4_AWSClusterControllerIdentity(in *v1beta1.AWSClusterControllerIdentity, out *AWSClusterControllerIdentity, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_AWSClusterControllerIdentitySpec_To_v1alpha4_AWSClusterControllerIdentitySpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AWSClusterControllerIdentity_To_v1alpha4_AWSClusterControllerIdentity is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterControllerIdentity_To_v1alpha4_AWSClusterControllerIdentity(in *v1beta1.AWSClusterControllerIdentity, out *AWSClusterControllerIdentity, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterControllerIdentity_To_v1alpha4_AWSClusterControllerIdentity(in, out, s) +} + +func autoConvert_v1alpha4_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList(in *AWSClusterControllerIdentityList, out *v1beta1.AWSClusterControllerIdentityList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1beta1.AWSClusterControllerIdentity)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha4_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList(in *AWSClusterControllerIdentityList, out *v1beta1.AWSClusterControllerIdentityList, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterControllerIdentityList_To_v1beta1_AWSClusterControllerIdentityList(in, out, s) +} + +func autoConvert_v1beta1_AWSClusterControllerIdentityList_To_v1alpha4_AWSClusterControllerIdentityList(in *v1beta1.AWSClusterControllerIdentityList, out *AWSClusterControllerIdentityList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]AWSClusterControllerIdentity)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1beta1_AWSClusterControllerIdentityList_To_v1alpha4_AWSClusterControllerIdentityList is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterControllerIdentityList_To_v1alpha4_AWSClusterControllerIdentityList(in *v1beta1.AWSClusterControllerIdentityList, out *AWSClusterControllerIdentityList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterControllerIdentityList_To_v1alpha4_AWSClusterControllerIdentityList(in, out, s) +} + +func autoConvert_v1alpha4_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec(in *AWSClusterControllerIdentitySpec, out *v1beta1.AWSClusterControllerIdentitySpec, s conversion.Scope) error { + if err := Convert_v1alpha4_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec(in *AWSClusterControllerIdentitySpec, out *v1beta1.AWSClusterControllerIdentitySpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterControllerIdentitySpec_To_v1beta1_AWSClusterControllerIdentitySpec(in, out, s) +} + +func autoConvert_v1beta1_AWSClusterControllerIdentitySpec_To_v1alpha4_AWSClusterControllerIdentitySpec(in *v1beta1.AWSClusterControllerIdentitySpec, out *AWSClusterControllerIdentitySpec, s conversion.Scope) error { + if err := Convert_v1beta1_AWSClusterIdentitySpec_To_v1alpha4_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AWSClusterControllerIdentitySpec_To_v1alpha4_AWSClusterControllerIdentitySpec is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterControllerIdentitySpec_To_v1alpha4_AWSClusterControllerIdentitySpec(in *v1beta1.AWSClusterControllerIdentitySpec, out *AWSClusterControllerIdentitySpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterControllerIdentitySpec_To_v1alpha4_AWSClusterControllerIdentitySpec(in, out, s) +} + +func autoConvert_v1alpha4_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(in *AWSClusterIdentitySpec, out *v1beta1.AWSClusterIdentitySpec, s conversion.Scope) error { + out.AllowedNamespaces = (*v1beta1.AllowedNamespaces)(unsafe.Pointer(in.AllowedNamespaces)) + return nil +} + +// Convert_v1alpha4_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(in *AWSClusterIdentitySpec, out *v1beta1.AWSClusterIdentitySpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(in, out, s) +} + +func autoConvert_v1beta1_AWSClusterIdentitySpec_To_v1alpha4_AWSClusterIdentitySpec(in *v1beta1.AWSClusterIdentitySpec, out *AWSClusterIdentitySpec, s conversion.Scope) error { + out.AllowedNamespaces = (*AllowedNamespaces)(unsafe.Pointer(in.AllowedNamespaces)) + return nil +} + +// Convert_v1beta1_AWSClusterIdentitySpec_To_v1alpha4_AWSClusterIdentitySpec is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterIdentitySpec_To_v1alpha4_AWSClusterIdentitySpec(in *v1beta1.AWSClusterIdentitySpec, out *AWSClusterIdentitySpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterIdentitySpec_To_v1alpha4_AWSClusterIdentitySpec(in, out, s) +} + +func autoConvert_v1alpha4_AWSClusterList_To_v1beta1_AWSClusterList(in *AWSClusterList, out *v1beta1.AWSClusterList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta1.AWSCluster, len(*in)) + for i := range *in { + if err := Convert_v1alpha4_AWSCluster_To_v1beta1_AWSCluster(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha4_AWSClusterList_To_v1beta1_AWSClusterList is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterList_To_v1beta1_AWSClusterList(in *AWSClusterList, out *v1beta1.AWSClusterList, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterList_To_v1beta1_AWSClusterList(in, out, s) +} + +func autoConvert_v1beta1_AWSClusterList_To_v1alpha4_AWSClusterList(in *v1beta1.AWSClusterList, out *AWSClusterList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSCluster, len(*in)) + for i := range *in { + if err := Convert_v1beta1_AWSCluster_To_v1alpha4_AWSCluster(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_AWSClusterList_To_v1alpha4_AWSClusterList is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterList_To_v1alpha4_AWSClusterList(in *v1beta1.AWSClusterList, out *AWSClusterList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterList_To_v1alpha4_AWSClusterList(in, out, s) +} + +func autoConvert_v1alpha4_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity(in *AWSClusterRoleIdentity, out *v1beta1.AWSClusterRoleIdentity, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity(in *AWSClusterRoleIdentity, out *v1beta1.AWSClusterRoleIdentity, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterRoleIdentity_To_v1beta1_AWSClusterRoleIdentity(in, out, s) +} + +func autoConvert_v1beta1_AWSClusterRoleIdentity_To_v1alpha4_AWSClusterRoleIdentity(in *v1beta1.AWSClusterRoleIdentity, out *AWSClusterRoleIdentity, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_AWSClusterRoleIdentitySpec_To_v1alpha4_AWSClusterRoleIdentitySpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AWSClusterRoleIdentity_To_v1alpha4_AWSClusterRoleIdentity is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterRoleIdentity_To_v1alpha4_AWSClusterRoleIdentity(in *v1beta1.AWSClusterRoleIdentity, out *AWSClusterRoleIdentity, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterRoleIdentity_To_v1alpha4_AWSClusterRoleIdentity(in, out, s) +} + +func autoConvert_v1alpha4_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList(in *AWSClusterRoleIdentityList, out *v1beta1.AWSClusterRoleIdentityList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1beta1.AWSClusterRoleIdentity)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha4_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList(in *AWSClusterRoleIdentityList, out *v1beta1.AWSClusterRoleIdentityList, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterRoleIdentityList_To_v1beta1_AWSClusterRoleIdentityList(in, out, s) +} + +func autoConvert_v1beta1_AWSClusterRoleIdentityList_To_v1alpha4_AWSClusterRoleIdentityList(in *v1beta1.AWSClusterRoleIdentityList, out *AWSClusterRoleIdentityList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]AWSClusterRoleIdentity)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1beta1_AWSClusterRoleIdentityList_To_v1alpha4_AWSClusterRoleIdentityList is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterRoleIdentityList_To_v1alpha4_AWSClusterRoleIdentityList(in *v1beta1.AWSClusterRoleIdentityList, out *AWSClusterRoleIdentityList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterRoleIdentityList_To_v1alpha4_AWSClusterRoleIdentityList(in, out, s) +} + +func autoConvert_v1alpha4_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec(in *AWSClusterRoleIdentitySpec, out *v1beta1.AWSClusterRoleIdentitySpec, s conversion.Scope) error { + if err := Convert_v1alpha4_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { + return err + } + if err := Convert_v1alpha4_AWSRoleSpec_To_v1beta1_AWSRoleSpec(&in.AWSRoleSpec, &out.AWSRoleSpec, s); err != nil { + return err + } + out.ExternalID = in.ExternalID + out.SourceIdentityRef = (*v1beta1.AWSIdentityReference)(unsafe.Pointer(in.SourceIdentityRef)) + return nil +} + +// Convert_v1alpha4_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec(in *AWSClusterRoleIdentitySpec, out *v1beta1.AWSClusterRoleIdentitySpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterRoleIdentitySpec_To_v1beta1_AWSClusterRoleIdentitySpec(in, out, s) +} + +func autoConvert_v1beta1_AWSClusterRoleIdentitySpec_To_v1alpha4_AWSClusterRoleIdentitySpec(in *v1beta1.AWSClusterRoleIdentitySpec, out *AWSClusterRoleIdentitySpec, s conversion.Scope) error { + if err := Convert_v1beta1_AWSClusterIdentitySpec_To_v1alpha4_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { + return err + } + if err := Convert_v1beta1_AWSRoleSpec_To_v1alpha4_AWSRoleSpec(&in.AWSRoleSpec, &out.AWSRoleSpec, s); err != nil { + return err + } + out.ExternalID = in.ExternalID + out.SourceIdentityRef = (*AWSIdentityReference)(unsafe.Pointer(in.SourceIdentityRef)) + return nil +} + +// Convert_v1beta1_AWSClusterRoleIdentitySpec_To_v1alpha4_AWSClusterRoleIdentitySpec is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterRoleIdentitySpec_To_v1alpha4_AWSClusterRoleIdentitySpec(in *v1beta1.AWSClusterRoleIdentitySpec, out *AWSClusterRoleIdentitySpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterRoleIdentitySpec_To_v1alpha4_AWSClusterRoleIdentitySpec(in, out, s) +} + +func autoConvert_v1alpha4_AWSClusterSpec_To_v1beta1_AWSClusterSpec(in *AWSClusterSpec, out *v1beta1.AWSClusterSpec, s conversion.Scope) error { + if err := Convert_v1alpha4_NetworkSpec_To_v1beta1_NetworkSpec(&in.NetworkSpec, &out.NetworkSpec, s); err != nil { + return err + } + out.Region = in.Region + out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) + if err := apiv1alpha4.Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + out.AdditionalTags = *(*v1beta1.Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.ControlPlaneLoadBalancer = (*v1beta1.AWSLoadBalancerSpec)(unsafe.Pointer(in.ControlPlaneLoadBalancer)) + out.ImageLookupFormat = in.ImageLookupFormat + out.ImageLookupOrg = in.ImageLookupOrg + out.ImageLookupBaseOS = in.ImageLookupBaseOS + if err := Convert_v1alpha4_Bastion_To_v1beta1_Bastion(&in.Bastion, &out.Bastion, s); err != nil { + return err + } + out.IdentityRef = (*v1beta1.AWSIdentityReference)(unsafe.Pointer(in.IdentityRef)) + return nil +} + +// Convert_v1alpha4_AWSClusterSpec_To_v1beta1_AWSClusterSpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterSpec_To_v1beta1_AWSClusterSpec(in *AWSClusterSpec, out *v1beta1.AWSClusterSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterSpec_To_v1beta1_AWSClusterSpec(in, out, s) +} + +func autoConvert_v1beta1_AWSClusterSpec_To_v1alpha4_AWSClusterSpec(in *v1beta1.AWSClusterSpec, out *AWSClusterSpec, s conversion.Scope) error { + if err := Convert_v1beta1_NetworkSpec_To_v1alpha4_NetworkSpec(&in.NetworkSpec, &out.NetworkSpec, s); err != nil { + return err + } + out.Region = in.Region + out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) + if err := apiv1alpha4.Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + out.AdditionalTags = *(*Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.ControlPlaneLoadBalancer = (*AWSLoadBalancerSpec)(unsafe.Pointer(in.ControlPlaneLoadBalancer)) + out.ImageLookupFormat = in.ImageLookupFormat + out.ImageLookupOrg = in.ImageLookupOrg + out.ImageLookupBaseOS = in.ImageLookupBaseOS + if err := Convert_v1beta1_Bastion_To_v1alpha4_Bastion(&in.Bastion, &out.Bastion, s); err != nil { + return err + } + out.IdentityRef = (*AWSIdentityReference)(unsafe.Pointer(in.IdentityRef)) + return nil +} + +// Convert_v1beta1_AWSClusterSpec_To_v1alpha4_AWSClusterSpec is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterSpec_To_v1alpha4_AWSClusterSpec(in *v1beta1.AWSClusterSpec, out *AWSClusterSpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterSpec_To_v1alpha4_AWSClusterSpec(in, out, s) +} + +func autoConvert_v1alpha4_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity(in *AWSClusterStaticIdentity, out *v1beta1.AWSClusterStaticIdentity, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity(in *AWSClusterStaticIdentity, out *v1beta1.AWSClusterStaticIdentity, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterStaticIdentity_To_v1beta1_AWSClusterStaticIdentity(in, out, s) +} + +func autoConvert_v1beta1_AWSClusterStaticIdentity_To_v1alpha4_AWSClusterStaticIdentity(in *v1beta1.AWSClusterStaticIdentity, out *AWSClusterStaticIdentity, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_AWSClusterStaticIdentitySpec_To_v1alpha4_AWSClusterStaticIdentitySpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AWSClusterStaticIdentity_To_v1alpha4_AWSClusterStaticIdentity is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterStaticIdentity_To_v1alpha4_AWSClusterStaticIdentity(in *v1beta1.AWSClusterStaticIdentity, out *AWSClusterStaticIdentity, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterStaticIdentity_To_v1alpha4_AWSClusterStaticIdentity(in, out, s) +} + +func autoConvert_v1alpha4_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList(in *AWSClusterStaticIdentityList, out *v1beta1.AWSClusterStaticIdentityList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1beta1.AWSClusterStaticIdentity)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha4_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList(in *AWSClusterStaticIdentityList, out *v1beta1.AWSClusterStaticIdentityList, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterStaticIdentityList_To_v1beta1_AWSClusterStaticIdentityList(in, out, s) +} + +func autoConvert_v1beta1_AWSClusterStaticIdentityList_To_v1alpha4_AWSClusterStaticIdentityList(in *v1beta1.AWSClusterStaticIdentityList, out *AWSClusterStaticIdentityList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]AWSClusterStaticIdentity)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1beta1_AWSClusterStaticIdentityList_To_v1alpha4_AWSClusterStaticIdentityList is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterStaticIdentityList_To_v1alpha4_AWSClusterStaticIdentityList(in *v1beta1.AWSClusterStaticIdentityList, out *AWSClusterStaticIdentityList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterStaticIdentityList_To_v1alpha4_AWSClusterStaticIdentityList(in, out, s) +} + +func autoConvert_v1alpha4_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec(in *AWSClusterStaticIdentitySpec, out *v1beta1.AWSClusterStaticIdentitySpec, s conversion.Scope) error { + if err := Convert_v1alpha4_AWSClusterIdentitySpec_To_v1beta1_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { + return err + } + out.SecretRef = in.SecretRef + return nil +} + +// Convert_v1alpha4_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec(in *AWSClusterStaticIdentitySpec, out *v1beta1.AWSClusterStaticIdentitySpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterStaticIdentitySpec_To_v1beta1_AWSClusterStaticIdentitySpec(in, out, s) +} + +func autoConvert_v1beta1_AWSClusterStaticIdentitySpec_To_v1alpha4_AWSClusterStaticIdentitySpec(in *v1beta1.AWSClusterStaticIdentitySpec, out *AWSClusterStaticIdentitySpec, s conversion.Scope) error { + if err := Convert_v1beta1_AWSClusterIdentitySpec_To_v1alpha4_AWSClusterIdentitySpec(&in.AWSClusterIdentitySpec, &out.AWSClusterIdentitySpec, s); err != nil { + return err + } + out.SecretRef = in.SecretRef + return nil +} + +// Convert_v1beta1_AWSClusterStaticIdentitySpec_To_v1alpha4_AWSClusterStaticIdentitySpec is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterStaticIdentitySpec_To_v1alpha4_AWSClusterStaticIdentitySpec(in *v1beta1.AWSClusterStaticIdentitySpec, out *AWSClusterStaticIdentitySpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterStaticIdentitySpec_To_v1alpha4_AWSClusterStaticIdentitySpec(in, out, s) +} + +func autoConvert_v1alpha4_AWSClusterStatus_To_v1beta1_AWSClusterStatus(in *AWSClusterStatus, out *v1beta1.AWSClusterStatus, s conversion.Scope) error { + out.Ready = in.Ready + if err := Convert_v1alpha4_NetworkStatus_To_v1beta1_NetworkStatus(&in.Network, &out.Network, 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 in.Bastion != nil { + in, out := &in.Bastion, &out.Bastion + *out = new(v1beta1.Instance) + if err := Convert_v1alpha4_Instance_To_v1beta1_Instance(*in, *out, s); err != nil { + return err + } + } else { + out.Bastion = 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_AWSClusterStatus_To_v1beta1_AWSClusterStatus is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterStatus_To_v1beta1_AWSClusterStatus(in *AWSClusterStatus, out *v1beta1.AWSClusterStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterStatus_To_v1beta1_AWSClusterStatus(in, out, s) +} + +func autoConvert_v1beta1_AWSClusterStatus_To_v1alpha4_AWSClusterStatus(in *v1beta1.AWSClusterStatus, out *AWSClusterStatus, s conversion.Scope) error { + out.Ready = in.Ready + if err := Convert_v1beta1_NetworkStatus_To_v1alpha4_NetworkStatus(&in.Network, &out.Network, 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 in.Bastion != nil { + in, out := &in.Bastion, &out.Bastion + *out = new(Instance) + if err := Convert_v1beta1_Instance_To_v1alpha4_Instance(*in, *out, s); err != nil { + return err + } + } else { + out.Bastion = 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_AWSClusterStatus_To_v1alpha4_AWSClusterStatus is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterStatus_To_v1alpha4_AWSClusterStatus(in *v1beta1.AWSClusterStatus, out *AWSClusterStatus, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterStatus_To_v1alpha4_AWSClusterStatus(in, out, s) +} + +func autoConvert_v1alpha4_AWSClusterTemplate_To_v1beta1_AWSClusterTemplate(in *AWSClusterTemplate, out *v1beta1.AWSClusterTemplate, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_AWSClusterTemplateSpec_To_v1beta1_AWSClusterTemplateSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSClusterTemplate_To_v1beta1_AWSClusterTemplate is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterTemplate_To_v1beta1_AWSClusterTemplate(in *AWSClusterTemplate, out *v1beta1.AWSClusterTemplate, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterTemplate_To_v1beta1_AWSClusterTemplate(in, out, s) +} + +func autoConvert_v1beta1_AWSClusterTemplate_To_v1alpha4_AWSClusterTemplate(in *v1beta1.AWSClusterTemplate, out *AWSClusterTemplate, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_AWSClusterTemplateSpec_To_v1alpha4_AWSClusterTemplateSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AWSClusterTemplate_To_v1alpha4_AWSClusterTemplate is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterTemplate_To_v1alpha4_AWSClusterTemplate(in *v1beta1.AWSClusterTemplate, out *AWSClusterTemplate, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterTemplate_To_v1alpha4_AWSClusterTemplate(in, out, s) +} + +func autoConvert_v1alpha4_AWSClusterTemplateList_To_v1beta1_AWSClusterTemplateList(in *AWSClusterTemplateList, out *v1beta1.AWSClusterTemplateList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta1.AWSClusterTemplate, len(*in)) + for i := range *in { + if err := Convert_v1alpha4_AWSClusterTemplate_To_v1beta1_AWSClusterTemplate(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha4_AWSClusterTemplateList_To_v1beta1_AWSClusterTemplateList is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterTemplateList_To_v1beta1_AWSClusterTemplateList(in *AWSClusterTemplateList, out *v1beta1.AWSClusterTemplateList, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterTemplateList_To_v1beta1_AWSClusterTemplateList(in, out, s) +} + +func autoConvert_v1beta1_AWSClusterTemplateList_To_v1alpha4_AWSClusterTemplateList(in *v1beta1.AWSClusterTemplateList, out *AWSClusterTemplateList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSClusterTemplate, len(*in)) + for i := range *in { + if err := Convert_v1beta1_AWSClusterTemplate_To_v1alpha4_AWSClusterTemplate(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_AWSClusterTemplateList_To_v1alpha4_AWSClusterTemplateList is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterTemplateList_To_v1alpha4_AWSClusterTemplateList(in *v1beta1.AWSClusterTemplateList, out *AWSClusterTemplateList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterTemplateList_To_v1alpha4_AWSClusterTemplateList(in, out, s) +} + +func autoConvert_v1alpha4_AWSClusterTemplateResource_To_v1beta1_AWSClusterTemplateResource(in *AWSClusterTemplateResource, out *v1beta1.AWSClusterTemplateResource, s conversion.Scope) error { + if err := Convert_v1alpha4_AWSClusterSpec_To_v1beta1_AWSClusterSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSClusterTemplateResource_To_v1beta1_AWSClusterTemplateResource is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterTemplateResource_To_v1beta1_AWSClusterTemplateResource(in *AWSClusterTemplateResource, out *v1beta1.AWSClusterTemplateResource, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterTemplateResource_To_v1beta1_AWSClusterTemplateResource(in, out, s) +} + +func autoConvert_v1beta1_AWSClusterTemplateResource_To_v1alpha4_AWSClusterTemplateResource(in *v1beta1.AWSClusterTemplateResource, out *AWSClusterTemplateResource, s conversion.Scope) error { + // WARNING: in.ObjectMeta requires manual conversion: does not exist in peer-type + if err := Convert_v1beta1_AWSClusterSpec_To_v1alpha4_AWSClusterSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha4_AWSClusterTemplateSpec_To_v1beta1_AWSClusterTemplateSpec(in *AWSClusterTemplateSpec, out *v1beta1.AWSClusterTemplateSpec, s conversion.Scope) error { + if err := Convert_v1alpha4_AWSClusterTemplateResource_To_v1beta1_AWSClusterTemplateResource(&in.Template, &out.Template, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSClusterTemplateSpec_To_v1beta1_AWSClusterTemplateSpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterTemplateSpec_To_v1beta1_AWSClusterTemplateSpec(in *AWSClusterTemplateSpec, out *v1beta1.AWSClusterTemplateSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterTemplateSpec_To_v1beta1_AWSClusterTemplateSpec(in, out, s) +} + +func autoConvert_v1beta1_AWSClusterTemplateSpec_To_v1alpha4_AWSClusterTemplateSpec(in *v1beta1.AWSClusterTemplateSpec, out *AWSClusterTemplateSpec, s conversion.Scope) error { + if err := Convert_v1beta1_AWSClusterTemplateResource_To_v1alpha4_AWSClusterTemplateResource(&in.Template, &out.Template, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AWSClusterTemplateSpec_To_v1alpha4_AWSClusterTemplateSpec is an autogenerated conversion function. +func Convert_v1beta1_AWSClusterTemplateSpec_To_v1alpha4_AWSClusterTemplateSpec(in *v1beta1.AWSClusterTemplateSpec, out *AWSClusterTemplateSpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSClusterTemplateSpec_To_v1alpha4_AWSClusterTemplateSpec(in, out, s) +} + +func autoConvert_v1alpha4_AWSIdentityReference_To_v1beta1_AWSIdentityReference(in *AWSIdentityReference, out *v1beta1.AWSIdentityReference, s conversion.Scope) error { + out.Name = in.Name + out.Kind = v1beta1.AWSIdentityKind(in.Kind) + return nil +} + +// Convert_v1alpha4_AWSIdentityReference_To_v1beta1_AWSIdentityReference is an autogenerated conversion function. +func Convert_v1alpha4_AWSIdentityReference_To_v1beta1_AWSIdentityReference(in *AWSIdentityReference, out *v1beta1.AWSIdentityReference, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSIdentityReference_To_v1beta1_AWSIdentityReference(in, out, s) +} + +func autoConvert_v1beta1_AWSIdentityReference_To_v1alpha4_AWSIdentityReference(in *v1beta1.AWSIdentityReference, out *AWSIdentityReference, s conversion.Scope) error { + out.Name = in.Name + out.Kind = AWSIdentityKind(in.Kind) + return nil +} + +// Convert_v1beta1_AWSIdentityReference_To_v1alpha4_AWSIdentityReference is an autogenerated conversion function. +func Convert_v1beta1_AWSIdentityReference_To_v1alpha4_AWSIdentityReference(in *v1beta1.AWSIdentityReference, out *AWSIdentityReference, s conversion.Scope) error { + return autoConvert_v1beta1_AWSIdentityReference_To_v1alpha4_AWSIdentityReference(in, out, s) +} + +func autoConvert_v1alpha4_AWSLoadBalancerSpec_To_v1beta1_AWSLoadBalancerSpec(in *AWSLoadBalancerSpec, out *v1beta1.AWSLoadBalancerSpec, s conversion.Scope) error { + out.Scheme = (*v1beta1.ClassicELBScheme)(unsafe.Pointer(in.Scheme)) + out.CrossZoneLoadBalancing = in.CrossZoneLoadBalancing + out.Subnets = *(*[]string)(unsafe.Pointer(&in.Subnets)) + out.AdditionalSecurityGroups = *(*[]string)(unsafe.Pointer(&in.AdditionalSecurityGroups)) + return nil +} + +// Convert_v1alpha4_AWSLoadBalancerSpec_To_v1beta1_AWSLoadBalancerSpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSLoadBalancerSpec_To_v1beta1_AWSLoadBalancerSpec(in *AWSLoadBalancerSpec, out *v1beta1.AWSLoadBalancerSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSLoadBalancerSpec_To_v1beta1_AWSLoadBalancerSpec(in, out, s) +} + +func autoConvert_v1beta1_AWSLoadBalancerSpec_To_v1alpha4_AWSLoadBalancerSpec(in *v1beta1.AWSLoadBalancerSpec, out *AWSLoadBalancerSpec, s conversion.Scope) error { + out.Scheme = (*ClassicELBScheme)(unsafe.Pointer(in.Scheme)) + out.CrossZoneLoadBalancing = in.CrossZoneLoadBalancing + out.Subnets = *(*[]string)(unsafe.Pointer(&in.Subnets)) + out.AdditionalSecurityGroups = *(*[]string)(unsafe.Pointer(&in.AdditionalSecurityGroups)) + return nil +} + +// Convert_v1beta1_AWSLoadBalancerSpec_To_v1alpha4_AWSLoadBalancerSpec is an autogenerated conversion function. +func Convert_v1beta1_AWSLoadBalancerSpec_To_v1alpha4_AWSLoadBalancerSpec(in *v1beta1.AWSLoadBalancerSpec, out *AWSLoadBalancerSpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSLoadBalancerSpec_To_v1alpha4_AWSLoadBalancerSpec(in, out, s) +} + +func autoConvert_v1alpha4_AWSMachine_To_v1beta1_AWSMachine(in *AWSMachine, out *v1beta1.AWSMachine, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_AWSMachineSpec_To_v1beta1_AWSMachineSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_AWSMachineStatus_To_v1beta1_AWSMachineStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSMachine_To_v1beta1_AWSMachine is an autogenerated conversion function. +func Convert_v1alpha4_AWSMachine_To_v1beta1_AWSMachine(in *AWSMachine, out *v1beta1.AWSMachine, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSMachine_To_v1beta1_AWSMachine(in, out, s) +} + +func autoConvert_v1beta1_AWSMachine_To_v1alpha4_AWSMachine(in *v1beta1.AWSMachine, out *AWSMachine, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_AWSMachineSpec_To_v1alpha4_AWSMachineSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_AWSMachineStatus_To_v1alpha4_AWSMachineStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AWSMachine_To_v1alpha4_AWSMachine is an autogenerated conversion function. +func Convert_v1beta1_AWSMachine_To_v1alpha4_AWSMachine(in *v1beta1.AWSMachine, out *AWSMachine, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachine_To_v1alpha4_AWSMachine(in, out, s) +} + +func autoConvert_v1alpha4_AWSMachineList_To_v1beta1_AWSMachineList(in *AWSMachineList, out *v1beta1.AWSMachineList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta1.AWSMachine, len(*in)) + for i := range *in { + if err := Convert_v1alpha4_AWSMachine_To_v1beta1_AWSMachine(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha4_AWSMachineList_To_v1beta1_AWSMachineList is an autogenerated conversion function. +func Convert_v1alpha4_AWSMachineList_To_v1beta1_AWSMachineList(in *AWSMachineList, out *v1beta1.AWSMachineList, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSMachineList_To_v1beta1_AWSMachineList(in, out, s) +} + +func autoConvert_v1beta1_AWSMachineList_To_v1alpha4_AWSMachineList(in *v1beta1.AWSMachineList, out *AWSMachineList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSMachine, len(*in)) + for i := range *in { + if err := Convert_v1beta1_AWSMachine_To_v1alpha4_AWSMachine(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_AWSMachineList_To_v1alpha4_AWSMachineList is an autogenerated conversion function. +func Convert_v1beta1_AWSMachineList_To_v1alpha4_AWSMachineList(in *v1beta1.AWSMachineList, out *AWSMachineList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachineList_To_v1alpha4_AWSMachineList(in, out, s) +} + +func autoConvert_v1alpha4_AWSMachineSpec_To_v1beta1_AWSMachineSpec(in *AWSMachineSpec, out *v1beta1.AWSMachineSpec, s conversion.Scope) error { + out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) + out.InstanceID = (*string)(unsafe.Pointer(in.InstanceID)) + if err := Convert_v1alpha4_AMIReference_To_v1beta1_AMIReference(&in.AMI, &out.AMI, s); err != nil { + return err + } + out.ImageLookupFormat = in.ImageLookupFormat + out.ImageLookupOrg = in.ImageLookupOrg + out.ImageLookupBaseOS = in.ImageLookupBaseOS + out.InstanceType = in.InstanceType + out.AdditionalTags = *(*v1beta1.Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.IAMInstanceProfile = in.IAMInstanceProfile + out.PublicIP = (*bool)(unsafe.Pointer(in.PublicIP)) + out.AdditionalSecurityGroups = *(*[]v1beta1.AWSResourceReference)(unsafe.Pointer(&in.AdditionalSecurityGroups)) + out.FailureDomain = (*string)(unsafe.Pointer(in.FailureDomain)) + out.Subnet = (*v1beta1.AWSResourceReference)(unsafe.Pointer(in.Subnet)) + out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) + out.RootVolume = (*v1beta1.Volume)(unsafe.Pointer(in.RootVolume)) + out.NonRootVolumes = *(*[]v1beta1.Volume)(unsafe.Pointer(&in.NonRootVolumes)) + out.NetworkInterfaces = *(*[]string)(unsafe.Pointer(&in.NetworkInterfaces)) + out.UncompressedUserData = (*bool)(unsafe.Pointer(in.UncompressedUserData)) + if err := Convert_v1alpha4_CloudInit_To_v1beta1_CloudInit(&in.CloudInit, &out.CloudInit, s); err != nil { + return err + } + out.SpotMarketOptions = (*v1beta1.SpotMarketOptions)(unsafe.Pointer(in.SpotMarketOptions)) + out.Tenancy = in.Tenancy + return nil +} + +// Convert_v1alpha4_AWSMachineSpec_To_v1beta1_AWSMachineSpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSMachineSpec_To_v1beta1_AWSMachineSpec(in *AWSMachineSpec, out *v1beta1.AWSMachineSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSMachineSpec_To_v1beta1_AWSMachineSpec(in, out, s) +} + +func autoConvert_v1beta1_AWSMachineSpec_To_v1alpha4_AWSMachineSpec(in *v1beta1.AWSMachineSpec, out *AWSMachineSpec, s conversion.Scope) error { + out.ProviderID = (*string)(unsafe.Pointer(in.ProviderID)) + out.InstanceID = (*string)(unsafe.Pointer(in.InstanceID)) + if err := Convert_v1beta1_AMIReference_To_v1alpha4_AMIReference(&in.AMI, &out.AMI, s); err != nil { + return err + } + out.ImageLookupFormat = in.ImageLookupFormat + out.ImageLookupOrg = in.ImageLookupOrg + out.ImageLookupBaseOS = in.ImageLookupBaseOS + out.InstanceType = in.InstanceType + out.AdditionalTags = *(*Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.IAMInstanceProfile = in.IAMInstanceProfile + out.PublicIP = (*bool)(unsafe.Pointer(in.PublicIP)) + out.AdditionalSecurityGroups = *(*[]AWSResourceReference)(unsafe.Pointer(&in.AdditionalSecurityGroups)) + out.FailureDomain = (*string)(unsafe.Pointer(in.FailureDomain)) + out.Subnet = (*AWSResourceReference)(unsafe.Pointer(in.Subnet)) + out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) + out.RootVolume = (*Volume)(unsafe.Pointer(in.RootVolume)) + out.NonRootVolumes = *(*[]Volume)(unsafe.Pointer(&in.NonRootVolumes)) + out.NetworkInterfaces = *(*[]string)(unsafe.Pointer(&in.NetworkInterfaces)) + out.UncompressedUserData = (*bool)(unsafe.Pointer(in.UncompressedUserData)) + if err := Convert_v1beta1_CloudInit_To_v1alpha4_CloudInit(&in.CloudInit, &out.CloudInit, s); err != nil { + return err + } + out.SpotMarketOptions = (*SpotMarketOptions)(unsafe.Pointer(in.SpotMarketOptions)) + out.Tenancy = in.Tenancy + return nil +} + +// Convert_v1beta1_AWSMachineSpec_To_v1alpha4_AWSMachineSpec is an autogenerated conversion function. +func Convert_v1beta1_AWSMachineSpec_To_v1alpha4_AWSMachineSpec(in *v1beta1.AWSMachineSpec, out *AWSMachineSpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachineSpec_To_v1alpha4_AWSMachineSpec(in, out, s) +} + +func autoConvert_v1alpha4_AWSMachineStatus_To_v1beta1_AWSMachineStatus(in *AWSMachineStatus, out *v1beta1.AWSMachineStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.Interruptible = in.Interruptible + 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.InstanceState = (*v1beta1.InstanceState)(unsafe.Pointer(in.InstanceState)) + out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + 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_AWSMachineStatus_To_v1beta1_AWSMachineStatus is an autogenerated conversion function. +func Convert_v1alpha4_AWSMachineStatus_To_v1beta1_AWSMachineStatus(in *AWSMachineStatus, out *v1beta1.AWSMachineStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSMachineStatus_To_v1beta1_AWSMachineStatus(in, out, s) +} + +func autoConvert_v1beta1_AWSMachineStatus_To_v1alpha4_AWSMachineStatus(in *v1beta1.AWSMachineStatus, out *AWSMachineStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.Interruptible = in.Interruptible + 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.InstanceState = (*InstanceState)(unsafe.Pointer(in.InstanceState)) + out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + 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_AWSMachineStatus_To_v1alpha4_AWSMachineStatus is an autogenerated conversion function. +func Convert_v1beta1_AWSMachineStatus_To_v1alpha4_AWSMachineStatus(in *v1beta1.AWSMachineStatus, out *AWSMachineStatus, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachineStatus_To_v1alpha4_AWSMachineStatus(in, out, s) +} + +func autoConvert_v1alpha4_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(in *AWSMachineTemplate, out *v1beta1.AWSMachineTemplate, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate is an autogenerated conversion function. +func Convert_v1alpha4_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(in *AWSMachineTemplate, out *v1beta1.AWSMachineTemplate, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(in, out, s) +} + +func autoConvert_v1beta1_AWSMachineTemplate_To_v1alpha4_AWSMachineTemplate(in *v1beta1.AWSMachineTemplate, out *AWSMachineTemplate, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_AWSMachineTemplateSpec_To_v1alpha4_AWSMachineTemplateSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AWSMachineTemplate_To_v1alpha4_AWSMachineTemplate is an autogenerated conversion function. +func Convert_v1beta1_AWSMachineTemplate_To_v1alpha4_AWSMachineTemplate(in *v1beta1.AWSMachineTemplate, out *AWSMachineTemplate, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachineTemplate_To_v1alpha4_AWSMachineTemplate(in, out, s) +} + +func autoConvert_v1alpha4_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList(in *AWSMachineTemplateList, out *v1beta1.AWSMachineTemplateList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta1.AWSMachineTemplate, len(*in)) + for i := range *in { + if err := Convert_v1alpha4_AWSMachineTemplate_To_v1beta1_AWSMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha4_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList is an autogenerated conversion function. +func Convert_v1alpha4_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList(in *AWSMachineTemplateList, out *v1beta1.AWSMachineTemplateList, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSMachineTemplateList_To_v1beta1_AWSMachineTemplateList(in, out, s) +} + +func autoConvert_v1beta1_AWSMachineTemplateList_To_v1alpha4_AWSMachineTemplateList(in *v1beta1.AWSMachineTemplateList, out *AWSMachineTemplateList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSMachineTemplate, len(*in)) + for i := range *in { + if err := Convert_v1beta1_AWSMachineTemplate_To_v1alpha4_AWSMachineTemplate(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_AWSMachineTemplateList_To_v1alpha4_AWSMachineTemplateList is an autogenerated conversion function. +func Convert_v1beta1_AWSMachineTemplateList_To_v1alpha4_AWSMachineTemplateList(in *v1beta1.AWSMachineTemplateList, out *AWSMachineTemplateList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachineTemplateList_To_v1alpha4_AWSMachineTemplateList(in, out, s) +} + +func autoConvert_v1alpha4_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource(in *AWSMachineTemplateResource, out *v1beta1.AWSMachineTemplateResource, s conversion.Scope) error { + if err := Convert_v1alpha4_AWSMachineSpec_To_v1beta1_AWSMachineSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource is an autogenerated conversion function. +func Convert_v1alpha4_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource(in *AWSMachineTemplateResource, out *v1beta1.AWSMachineTemplateResource, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource(in, out, s) +} + +func autoConvert_v1beta1_AWSMachineTemplateResource_To_v1alpha4_AWSMachineTemplateResource(in *v1beta1.AWSMachineTemplateResource, out *AWSMachineTemplateResource, s conversion.Scope) error { + // WARNING: in.ObjectMeta requires manual conversion: does not exist in peer-type + if err := Convert_v1beta1_AWSMachineSpec_To_v1alpha4_AWSMachineSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha4_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec(in *AWSMachineTemplateSpec, out *v1beta1.AWSMachineTemplateSpec, s conversion.Scope) error { + if err := Convert_v1alpha4_AWSMachineTemplateResource_To_v1beta1_AWSMachineTemplateResource(&in.Template, &out.Template, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec(in *AWSMachineTemplateSpec, out *v1beta1.AWSMachineTemplateSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSMachineTemplateSpec_To_v1beta1_AWSMachineTemplateSpec(in, out, s) +} + +func autoConvert_v1beta1_AWSMachineTemplateSpec_To_v1alpha4_AWSMachineTemplateSpec(in *v1beta1.AWSMachineTemplateSpec, out *AWSMachineTemplateSpec, s conversion.Scope) error { + if err := Convert_v1beta1_AWSMachineTemplateResource_To_v1alpha4_AWSMachineTemplateResource(&in.Template, &out.Template, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AWSMachineTemplateSpec_To_v1alpha4_AWSMachineTemplateSpec is an autogenerated conversion function. +func Convert_v1beta1_AWSMachineTemplateSpec_To_v1alpha4_AWSMachineTemplateSpec(in *v1beta1.AWSMachineTemplateSpec, out *AWSMachineTemplateSpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachineTemplateSpec_To_v1alpha4_AWSMachineTemplateSpec(in, out, s) +} + +func autoConvert_v1alpha4_AWSResourceReference_To_v1beta1_AWSResourceReference(in *AWSResourceReference, out *v1beta1.AWSResourceReference, s conversion.Scope) error { + out.ID = (*string)(unsafe.Pointer(in.ID)) + out.ARN = (*string)(unsafe.Pointer(in.ARN)) + out.Filters = *(*[]v1beta1.Filter)(unsafe.Pointer(&in.Filters)) + return nil +} + +// Convert_v1alpha4_AWSResourceReference_To_v1beta1_AWSResourceReference is an autogenerated conversion function. +func Convert_v1alpha4_AWSResourceReference_To_v1beta1_AWSResourceReference(in *AWSResourceReference, out *v1beta1.AWSResourceReference, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSResourceReference_To_v1beta1_AWSResourceReference(in, out, s) +} + +func autoConvert_v1beta1_AWSResourceReference_To_v1alpha4_AWSResourceReference(in *v1beta1.AWSResourceReference, out *AWSResourceReference, s conversion.Scope) error { + out.ID = (*string)(unsafe.Pointer(in.ID)) + out.ARN = (*string)(unsafe.Pointer(in.ARN)) + out.Filters = *(*[]Filter)(unsafe.Pointer(&in.Filters)) + return nil +} + +// Convert_v1beta1_AWSResourceReference_To_v1alpha4_AWSResourceReference is an autogenerated conversion function. +func Convert_v1beta1_AWSResourceReference_To_v1alpha4_AWSResourceReference(in *v1beta1.AWSResourceReference, out *AWSResourceReference, s conversion.Scope) error { + return autoConvert_v1beta1_AWSResourceReference_To_v1alpha4_AWSResourceReference(in, out, s) +} + +func autoConvert_v1alpha4_AWSRoleSpec_To_v1beta1_AWSRoleSpec(in *AWSRoleSpec, out *v1beta1.AWSRoleSpec, s conversion.Scope) error { + out.RoleArn = in.RoleArn + out.SessionName = in.SessionName + out.DurationSeconds = in.DurationSeconds + out.InlinePolicy = in.InlinePolicy + out.PolicyARNs = *(*[]string)(unsafe.Pointer(&in.PolicyARNs)) + return nil +} + +// Convert_v1alpha4_AWSRoleSpec_To_v1beta1_AWSRoleSpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSRoleSpec_To_v1beta1_AWSRoleSpec(in *AWSRoleSpec, out *v1beta1.AWSRoleSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSRoleSpec_To_v1beta1_AWSRoleSpec(in, out, s) +} + +func autoConvert_v1beta1_AWSRoleSpec_To_v1alpha4_AWSRoleSpec(in *v1beta1.AWSRoleSpec, out *AWSRoleSpec, s conversion.Scope) error { + out.RoleArn = in.RoleArn + out.SessionName = in.SessionName + out.DurationSeconds = in.DurationSeconds + out.InlinePolicy = in.InlinePolicy + out.PolicyARNs = *(*[]string)(unsafe.Pointer(&in.PolicyARNs)) + return nil +} + +// Convert_v1beta1_AWSRoleSpec_To_v1alpha4_AWSRoleSpec is an autogenerated conversion function. +func Convert_v1beta1_AWSRoleSpec_To_v1alpha4_AWSRoleSpec(in *v1beta1.AWSRoleSpec, out *AWSRoleSpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSRoleSpec_To_v1alpha4_AWSRoleSpec(in, out, s) +} + +func autoConvert_v1alpha4_AllowedNamespaces_To_v1beta1_AllowedNamespaces(in *AllowedNamespaces, out *v1beta1.AllowedNamespaces, s conversion.Scope) error { + out.NamespaceList = *(*[]string)(unsafe.Pointer(&in.NamespaceList)) + out.Selector = in.Selector + return nil +} + +// Convert_v1alpha4_AllowedNamespaces_To_v1beta1_AllowedNamespaces is an autogenerated conversion function. +func Convert_v1alpha4_AllowedNamespaces_To_v1beta1_AllowedNamespaces(in *AllowedNamespaces, out *v1beta1.AllowedNamespaces, s conversion.Scope) error { + return autoConvert_v1alpha4_AllowedNamespaces_To_v1beta1_AllowedNamespaces(in, out, s) +} + +func autoConvert_v1beta1_AllowedNamespaces_To_v1alpha4_AllowedNamespaces(in *v1beta1.AllowedNamespaces, out *AllowedNamespaces, s conversion.Scope) error { + out.NamespaceList = *(*[]string)(unsafe.Pointer(&in.NamespaceList)) + out.Selector = in.Selector + return nil +} + +// Convert_v1beta1_AllowedNamespaces_To_v1alpha4_AllowedNamespaces is an autogenerated conversion function. +func Convert_v1beta1_AllowedNamespaces_To_v1alpha4_AllowedNamespaces(in *v1beta1.AllowedNamespaces, out *AllowedNamespaces, s conversion.Scope) error { + return autoConvert_v1beta1_AllowedNamespaces_To_v1alpha4_AllowedNamespaces(in, out, s) +} + +func autoConvert_v1alpha4_Bastion_To_v1beta1_Bastion(in *Bastion, out *v1beta1.Bastion, s conversion.Scope) error { + out.Enabled = in.Enabled + out.DisableIngressRules = in.DisableIngressRules + out.AllowedCIDRBlocks = *(*[]string)(unsafe.Pointer(&in.AllowedCIDRBlocks)) + out.InstanceType = in.InstanceType + out.AMI = in.AMI + return nil +} + +// Convert_v1alpha4_Bastion_To_v1beta1_Bastion is an autogenerated conversion function. +func Convert_v1alpha4_Bastion_To_v1beta1_Bastion(in *Bastion, out *v1beta1.Bastion, s conversion.Scope) error { + return autoConvert_v1alpha4_Bastion_To_v1beta1_Bastion(in, out, s) +} + +func autoConvert_v1beta1_Bastion_To_v1alpha4_Bastion(in *v1beta1.Bastion, out *Bastion, s conversion.Scope) error { + out.Enabled = in.Enabled + out.DisableIngressRules = in.DisableIngressRules + out.AllowedCIDRBlocks = *(*[]string)(unsafe.Pointer(&in.AllowedCIDRBlocks)) + out.InstanceType = in.InstanceType + out.AMI = in.AMI + return nil +} + +// Convert_v1beta1_Bastion_To_v1alpha4_Bastion is an autogenerated conversion function. +func Convert_v1beta1_Bastion_To_v1alpha4_Bastion(in *v1beta1.Bastion, out *Bastion, s conversion.Scope) error { + return autoConvert_v1beta1_Bastion_To_v1alpha4_Bastion(in, out, s) +} + +func autoConvert_v1alpha4_BuildParams_To_v1beta1_BuildParams(in *BuildParams, out *v1beta1.BuildParams, s conversion.Scope) error { + out.Lifecycle = v1beta1.ResourceLifecycle(in.Lifecycle) + out.ClusterName = in.ClusterName + out.ResourceID = in.ResourceID + out.Name = (*string)(unsafe.Pointer(in.Name)) + out.Role = (*string)(unsafe.Pointer(in.Role)) + out.Additional = *(*v1beta1.Tags)(unsafe.Pointer(&in.Additional)) + return nil +} + +// Convert_v1alpha4_BuildParams_To_v1beta1_BuildParams is an autogenerated conversion function. +func Convert_v1alpha4_BuildParams_To_v1beta1_BuildParams(in *BuildParams, out *v1beta1.BuildParams, s conversion.Scope) error { + return autoConvert_v1alpha4_BuildParams_To_v1beta1_BuildParams(in, out, s) +} + +func autoConvert_v1beta1_BuildParams_To_v1alpha4_BuildParams(in *v1beta1.BuildParams, out *BuildParams, s conversion.Scope) error { + out.Lifecycle = ResourceLifecycle(in.Lifecycle) + out.ClusterName = in.ClusterName + out.ResourceID = in.ResourceID + out.Name = (*string)(unsafe.Pointer(in.Name)) + out.Role = (*string)(unsafe.Pointer(in.Role)) + out.Additional = *(*Tags)(unsafe.Pointer(&in.Additional)) + return nil +} + +// Convert_v1beta1_BuildParams_To_v1alpha4_BuildParams is an autogenerated conversion function. +func Convert_v1beta1_BuildParams_To_v1alpha4_BuildParams(in *v1beta1.BuildParams, out *BuildParams, s conversion.Scope) error { + return autoConvert_v1beta1_BuildParams_To_v1alpha4_BuildParams(in, out, s) +} + +func autoConvert_v1alpha4_CNIIngressRule_To_v1beta1_CNIIngressRule(in *CNIIngressRule, out *v1beta1.CNIIngressRule, s conversion.Scope) error { + out.Description = in.Description + out.Protocol = v1beta1.SecurityGroupProtocol(in.Protocol) + out.FromPort = in.FromPort + out.ToPort = in.ToPort + return nil +} + +// Convert_v1alpha4_CNIIngressRule_To_v1beta1_CNIIngressRule is an autogenerated conversion function. +func Convert_v1alpha4_CNIIngressRule_To_v1beta1_CNIIngressRule(in *CNIIngressRule, out *v1beta1.CNIIngressRule, s conversion.Scope) error { + return autoConvert_v1alpha4_CNIIngressRule_To_v1beta1_CNIIngressRule(in, out, s) +} + +func autoConvert_v1beta1_CNIIngressRule_To_v1alpha4_CNIIngressRule(in *v1beta1.CNIIngressRule, out *CNIIngressRule, s conversion.Scope) error { + out.Description = in.Description + out.Protocol = SecurityGroupProtocol(in.Protocol) + out.FromPort = in.FromPort + out.ToPort = in.ToPort + return nil +} + +// Convert_v1beta1_CNIIngressRule_To_v1alpha4_CNIIngressRule is an autogenerated conversion function. +func Convert_v1beta1_CNIIngressRule_To_v1alpha4_CNIIngressRule(in *v1beta1.CNIIngressRule, out *CNIIngressRule, s conversion.Scope) error { + return autoConvert_v1beta1_CNIIngressRule_To_v1alpha4_CNIIngressRule(in, out, s) +} + +func autoConvert_v1alpha4_CNISpec_To_v1beta1_CNISpec(in *CNISpec, out *v1beta1.CNISpec, s conversion.Scope) error { + out.CNIIngressRules = *(*v1beta1.CNIIngressRules)(unsafe.Pointer(&in.CNIIngressRules)) + return nil +} + +// Convert_v1alpha4_CNISpec_To_v1beta1_CNISpec is an autogenerated conversion function. +func Convert_v1alpha4_CNISpec_To_v1beta1_CNISpec(in *CNISpec, out *v1beta1.CNISpec, s conversion.Scope) error { + return autoConvert_v1alpha4_CNISpec_To_v1beta1_CNISpec(in, out, s) +} + +func autoConvert_v1beta1_CNISpec_To_v1alpha4_CNISpec(in *v1beta1.CNISpec, out *CNISpec, s conversion.Scope) error { + out.CNIIngressRules = *(*CNIIngressRules)(unsafe.Pointer(&in.CNIIngressRules)) + return nil +} + +// Convert_v1beta1_CNISpec_To_v1alpha4_CNISpec is an autogenerated conversion function. +func Convert_v1beta1_CNISpec_To_v1alpha4_CNISpec(in *v1beta1.CNISpec, out *CNISpec, s conversion.Scope) error { + return autoConvert_v1beta1_CNISpec_To_v1alpha4_CNISpec(in, out, s) +} + +func autoConvert_v1alpha4_ClassicELB_To_v1beta1_ClassicELB(in *ClassicELB, out *v1beta1.ClassicELB, s conversion.Scope) error { + out.Name = in.Name + out.DNSName = in.DNSName + out.Scheme = v1beta1.ClassicELBScheme(in.Scheme) + out.AvailabilityZones = *(*[]string)(unsafe.Pointer(&in.AvailabilityZones)) + out.SubnetIDs = *(*[]string)(unsafe.Pointer(&in.SubnetIDs)) + out.SecurityGroupIDs = *(*[]string)(unsafe.Pointer(&in.SecurityGroupIDs)) + out.Listeners = *(*[]v1beta1.ClassicELBListener)(unsafe.Pointer(&in.Listeners)) + out.HealthCheck = (*v1beta1.ClassicELBHealthCheck)(unsafe.Pointer(in.HealthCheck)) + if err := Convert_v1alpha4_ClassicELBAttributes_To_v1beta1_ClassicELBAttributes(&in.Attributes, &out.Attributes, s); err != nil { + return err + } + out.Tags = *(*map[string]string)(unsafe.Pointer(&in.Tags)) + return nil +} + +// Convert_v1alpha4_ClassicELB_To_v1beta1_ClassicELB is an autogenerated conversion function. +func Convert_v1alpha4_ClassicELB_To_v1beta1_ClassicELB(in *ClassicELB, out *v1beta1.ClassicELB, s conversion.Scope) error { + return autoConvert_v1alpha4_ClassicELB_To_v1beta1_ClassicELB(in, out, s) +} + +func autoConvert_v1beta1_ClassicELB_To_v1alpha4_ClassicELB(in *v1beta1.ClassicELB, out *ClassicELB, s conversion.Scope) error { + out.Name = in.Name + out.DNSName = in.DNSName + out.Scheme = ClassicELBScheme(in.Scheme) + out.AvailabilityZones = *(*[]string)(unsafe.Pointer(&in.AvailabilityZones)) + out.SubnetIDs = *(*[]string)(unsafe.Pointer(&in.SubnetIDs)) + out.SecurityGroupIDs = *(*[]string)(unsafe.Pointer(&in.SecurityGroupIDs)) + out.Listeners = *(*[]ClassicELBListener)(unsafe.Pointer(&in.Listeners)) + out.HealthCheck = (*ClassicELBHealthCheck)(unsafe.Pointer(in.HealthCheck)) + if err := Convert_v1beta1_ClassicELBAttributes_To_v1alpha4_ClassicELBAttributes(&in.Attributes, &out.Attributes, s); err != nil { + return err + } + out.Tags = *(*map[string]string)(unsafe.Pointer(&in.Tags)) + return nil +} + +// Convert_v1beta1_ClassicELB_To_v1alpha4_ClassicELB is an autogenerated conversion function. +func Convert_v1beta1_ClassicELB_To_v1alpha4_ClassicELB(in *v1beta1.ClassicELB, out *ClassicELB, s conversion.Scope) error { + return autoConvert_v1beta1_ClassicELB_To_v1alpha4_ClassicELB(in, out, s) +} + +func autoConvert_v1alpha4_ClassicELBAttributes_To_v1beta1_ClassicELBAttributes(in *ClassicELBAttributes, out *v1beta1.ClassicELBAttributes, s conversion.Scope) error { + out.IdleTimeout = time.Duration(in.IdleTimeout) + out.CrossZoneLoadBalancing = in.CrossZoneLoadBalancing + return nil +} + +// Convert_v1alpha4_ClassicELBAttributes_To_v1beta1_ClassicELBAttributes is an autogenerated conversion function. +func Convert_v1alpha4_ClassicELBAttributes_To_v1beta1_ClassicELBAttributes(in *ClassicELBAttributes, out *v1beta1.ClassicELBAttributes, s conversion.Scope) error { + return autoConvert_v1alpha4_ClassicELBAttributes_To_v1beta1_ClassicELBAttributes(in, out, s) +} + +func autoConvert_v1beta1_ClassicELBAttributes_To_v1alpha4_ClassicELBAttributes(in *v1beta1.ClassicELBAttributes, out *ClassicELBAttributes, s conversion.Scope) error { + out.IdleTimeout = time.Duration(in.IdleTimeout) + out.CrossZoneLoadBalancing = in.CrossZoneLoadBalancing + return nil +} + +// Convert_v1beta1_ClassicELBAttributes_To_v1alpha4_ClassicELBAttributes is an autogenerated conversion function. +func Convert_v1beta1_ClassicELBAttributes_To_v1alpha4_ClassicELBAttributes(in *v1beta1.ClassicELBAttributes, out *ClassicELBAttributes, s conversion.Scope) error { + return autoConvert_v1beta1_ClassicELBAttributes_To_v1alpha4_ClassicELBAttributes(in, out, s) +} + +func autoConvert_v1alpha4_ClassicELBHealthCheck_To_v1beta1_ClassicELBHealthCheck(in *ClassicELBHealthCheck, out *v1beta1.ClassicELBHealthCheck, s conversion.Scope) error { + out.Target = in.Target + out.Interval = time.Duration(in.Interval) + out.Timeout = time.Duration(in.Timeout) + out.HealthyThreshold = in.HealthyThreshold + out.UnhealthyThreshold = in.UnhealthyThreshold + return nil +} + +// Convert_v1alpha4_ClassicELBHealthCheck_To_v1beta1_ClassicELBHealthCheck is an autogenerated conversion function. +func Convert_v1alpha4_ClassicELBHealthCheck_To_v1beta1_ClassicELBHealthCheck(in *ClassicELBHealthCheck, out *v1beta1.ClassicELBHealthCheck, s conversion.Scope) error { + return autoConvert_v1alpha4_ClassicELBHealthCheck_To_v1beta1_ClassicELBHealthCheck(in, out, s) +} + +func autoConvert_v1beta1_ClassicELBHealthCheck_To_v1alpha4_ClassicELBHealthCheck(in *v1beta1.ClassicELBHealthCheck, out *ClassicELBHealthCheck, s conversion.Scope) error { + out.Target = in.Target + out.Interval = time.Duration(in.Interval) + out.Timeout = time.Duration(in.Timeout) + out.HealthyThreshold = in.HealthyThreshold + out.UnhealthyThreshold = in.UnhealthyThreshold + return nil +} + +// Convert_v1beta1_ClassicELBHealthCheck_To_v1alpha4_ClassicELBHealthCheck is an autogenerated conversion function. +func Convert_v1beta1_ClassicELBHealthCheck_To_v1alpha4_ClassicELBHealthCheck(in *v1beta1.ClassicELBHealthCheck, out *ClassicELBHealthCheck, s conversion.Scope) error { + return autoConvert_v1beta1_ClassicELBHealthCheck_To_v1alpha4_ClassicELBHealthCheck(in, out, s) +} + +func autoConvert_v1alpha4_ClassicELBListener_To_v1beta1_ClassicELBListener(in *ClassicELBListener, out *v1beta1.ClassicELBListener, s conversion.Scope) error { + out.Protocol = v1beta1.ClassicELBProtocol(in.Protocol) + out.Port = in.Port + out.InstanceProtocol = v1beta1.ClassicELBProtocol(in.InstanceProtocol) + out.InstancePort = in.InstancePort + return nil +} + +// Convert_v1alpha4_ClassicELBListener_To_v1beta1_ClassicELBListener is an autogenerated conversion function. +func Convert_v1alpha4_ClassicELBListener_To_v1beta1_ClassicELBListener(in *ClassicELBListener, out *v1beta1.ClassicELBListener, s conversion.Scope) error { + return autoConvert_v1alpha4_ClassicELBListener_To_v1beta1_ClassicELBListener(in, out, s) +} + +func autoConvert_v1beta1_ClassicELBListener_To_v1alpha4_ClassicELBListener(in *v1beta1.ClassicELBListener, out *ClassicELBListener, s conversion.Scope) error { + out.Protocol = ClassicELBProtocol(in.Protocol) + out.Port = in.Port + out.InstanceProtocol = ClassicELBProtocol(in.InstanceProtocol) + out.InstancePort = in.InstancePort + return nil +} + +// Convert_v1beta1_ClassicELBListener_To_v1alpha4_ClassicELBListener is an autogenerated conversion function. +func Convert_v1beta1_ClassicELBListener_To_v1alpha4_ClassicELBListener(in *v1beta1.ClassicELBListener, out *ClassicELBListener, s conversion.Scope) error { + return autoConvert_v1beta1_ClassicELBListener_To_v1alpha4_ClassicELBListener(in, out, s) +} + +func autoConvert_v1alpha4_CloudInit_To_v1beta1_CloudInit(in *CloudInit, out *v1beta1.CloudInit, s conversion.Scope) error { + out.InsecureSkipSecretsManager = in.InsecureSkipSecretsManager + out.SecretCount = in.SecretCount + out.SecretPrefix = in.SecretPrefix + out.SecureSecretsBackend = v1beta1.SecretBackend(in.SecureSecretsBackend) + return nil +} + +// Convert_v1alpha4_CloudInit_To_v1beta1_CloudInit is an autogenerated conversion function. +func Convert_v1alpha4_CloudInit_To_v1beta1_CloudInit(in *CloudInit, out *v1beta1.CloudInit, s conversion.Scope) error { + return autoConvert_v1alpha4_CloudInit_To_v1beta1_CloudInit(in, out, s) +} + +func autoConvert_v1beta1_CloudInit_To_v1alpha4_CloudInit(in *v1beta1.CloudInit, out *CloudInit, s conversion.Scope) error { + out.InsecureSkipSecretsManager = in.InsecureSkipSecretsManager + out.SecretCount = in.SecretCount + out.SecretPrefix = in.SecretPrefix + out.SecureSecretsBackend = SecretBackend(in.SecureSecretsBackend) + return nil +} + +// Convert_v1beta1_CloudInit_To_v1alpha4_CloudInit is an autogenerated conversion function. +func Convert_v1beta1_CloudInit_To_v1alpha4_CloudInit(in *v1beta1.CloudInit, out *CloudInit, s conversion.Scope) error { + return autoConvert_v1beta1_CloudInit_To_v1alpha4_CloudInit(in, out, s) +} + +func autoConvert_v1alpha4_Filter_To_v1beta1_Filter(in *Filter, out *v1beta1.Filter, s conversion.Scope) error { + out.Name = in.Name + out.Values = *(*[]string)(unsafe.Pointer(&in.Values)) + return nil +} + +// Convert_v1alpha4_Filter_To_v1beta1_Filter is an autogenerated conversion function. +func Convert_v1alpha4_Filter_To_v1beta1_Filter(in *Filter, out *v1beta1.Filter, s conversion.Scope) error { + return autoConvert_v1alpha4_Filter_To_v1beta1_Filter(in, out, s) +} + +func autoConvert_v1beta1_Filter_To_v1alpha4_Filter(in *v1beta1.Filter, out *Filter, s conversion.Scope) error { + out.Name = in.Name + out.Values = *(*[]string)(unsafe.Pointer(&in.Values)) + return nil +} + +// Convert_v1beta1_Filter_To_v1alpha4_Filter is an autogenerated conversion function. +func Convert_v1beta1_Filter_To_v1alpha4_Filter(in *v1beta1.Filter, out *Filter, s conversion.Scope) error { + return autoConvert_v1beta1_Filter_To_v1alpha4_Filter(in, out, s) +} + +func autoConvert_v1alpha4_IngressRule_To_v1beta1_IngressRule(in *IngressRule, out *v1beta1.IngressRule, s conversion.Scope) error { + out.Description = in.Description + out.Protocol = v1beta1.SecurityGroupProtocol(in.Protocol) + out.FromPort = in.FromPort + out.ToPort = in.ToPort + out.CidrBlocks = *(*[]string)(unsafe.Pointer(&in.CidrBlocks)) + out.SourceSecurityGroupIDs = *(*[]string)(unsafe.Pointer(&in.SourceSecurityGroupIDs)) + return nil +} + +// Convert_v1alpha4_IngressRule_To_v1beta1_IngressRule is an autogenerated conversion function. +func Convert_v1alpha4_IngressRule_To_v1beta1_IngressRule(in *IngressRule, out *v1beta1.IngressRule, s conversion.Scope) error { + return autoConvert_v1alpha4_IngressRule_To_v1beta1_IngressRule(in, out, s) +} + +func autoConvert_v1beta1_IngressRule_To_v1alpha4_IngressRule(in *v1beta1.IngressRule, out *IngressRule, s conversion.Scope) error { + out.Description = in.Description + out.Protocol = SecurityGroupProtocol(in.Protocol) + out.FromPort = in.FromPort + out.ToPort = in.ToPort + out.CidrBlocks = *(*[]string)(unsafe.Pointer(&in.CidrBlocks)) + out.SourceSecurityGroupIDs = *(*[]string)(unsafe.Pointer(&in.SourceSecurityGroupIDs)) + return nil +} + +// Convert_v1beta1_IngressRule_To_v1alpha4_IngressRule is an autogenerated conversion function. +func Convert_v1beta1_IngressRule_To_v1alpha4_IngressRule(in *v1beta1.IngressRule, out *IngressRule, s conversion.Scope) error { + return autoConvert_v1beta1_IngressRule_To_v1alpha4_IngressRule(in, out, s) +} + +func autoConvert_v1alpha4_Instance_To_v1beta1_Instance(in *Instance, out *v1beta1.Instance, s conversion.Scope) error { + out.ID = in.ID + out.State = v1beta1.InstanceState(in.State) + out.Type = in.Type + out.SubnetID = in.SubnetID + out.ImageID = in.ImageID + out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) + out.SecurityGroupIDs = *(*[]string)(unsafe.Pointer(&in.SecurityGroupIDs)) + out.UserData = (*string)(unsafe.Pointer(in.UserData)) + out.IAMProfile = in.IAMProfile + 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.PrivateIP = (*string)(unsafe.Pointer(in.PrivateIP)) + out.PublicIP = (*string)(unsafe.Pointer(in.PublicIP)) + out.ENASupport = (*bool)(unsafe.Pointer(in.ENASupport)) + out.EBSOptimized = (*bool)(unsafe.Pointer(in.EBSOptimized)) + out.RootVolume = (*v1beta1.Volume)(unsafe.Pointer(in.RootVolume)) + out.NonRootVolumes = *(*[]v1beta1.Volume)(unsafe.Pointer(&in.NonRootVolumes)) + out.NetworkInterfaces = *(*[]string)(unsafe.Pointer(&in.NetworkInterfaces)) + out.Tags = *(*map[string]string)(unsafe.Pointer(&in.Tags)) + out.AvailabilityZone = in.AvailabilityZone + out.SpotMarketOptions = (*v1beta1.SpotMarketOptions)(unsafe.Pointer(in.SpotMarketOptions)) + out.Tenancy = in.Tenancy + out.VolumeIDs = *(*[]string)(unsafe.Pointer(&in.VolumeIDs)) + return nil +} + +// Convert_v1alpha4_Instance_To_v1beta1_Instance is an autogenerated conversion function. +func Convert_v1alpha4_Instance_To_v1beta1_Instance(in *Instance, out *v1beta1.Instance, s conversion.Scope) error { + return autoConvert_v1alpha4_Instance_To_v1beta1_Instance(in, out, s) +} + +func autoConvert_v1beta1_Instance_To_v1alpha4_Instance(in *v1beta1.Instance, out *Instance, s conversion.Scope) error { + out.ID = in.ID + out.State = InstanceState(in.State) + out.Type = in.Type + out.SubnetID = in.SubnetID + out.ImageID = in.ImageID + out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) + out.SecurityGroupIDs = *(*[]string)(unsafe.Pointer(&in.SecurityGroupIDs)) + out.UserData = (*string)(unsafe.Pointer(in.UserData)) + out.IAMProfile = in.IAMProfile + 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.PrivateIP = (*string)(unsafe.Pointer(in.PrivateIP)) + out.PublicIP = (*string)(unsafe.Pointer(in.PublicIP)) + out.ENASupport = (*bool)(unsafe.Pointer(in.ENASupport)) + out.EBSOptimized = (*bool)(unsafe.Pointer(in.EBSOptimized)) + out.RootVolume = (*Volume)(unsafe.Pointer(in.RootVolume)) + out.NonRootVolumes = *(*[]Volume)(unsafe.Pointer(&in.NonRootVolumes)) + out.NetworkInterfaces = *(*[]string)(unsafe.Pointer(&in.NetworkInterfaces)) + out.Tags = *(*map[string]string)(unsafe.Pointer(&in.Tags)) + out.AvailabilityZone = in.AvailabilityZone + out.SpotMarketOptions = (*SpotMarketOptions)(unsafe.Pointer(in.SpotMarketOptions)) + out.Tenancy = in.Tenancy + out.VolumeIDs = *(*[]string)(unsafe.Pointer(&in.VolumeIDs)) + return nil +} + +// Convert_v1beta1_Instance_To_v1alpha4_Instance is an autogenerated conversion function. +func Convert_v1beta1_Instance_To_v1alpha4_Instance(in *v1beta1.Instance, out *Instance, s conversion.Scope) error { + return autoConvert_v1beta1_Instance_To_v1alpha4_Instance(in, out, s) +} + +func autoConvert_v1alpha4_NetworkSpec_To_v1beta1_NetworkSpec(in *NetworkSpec, out *v1beta1.NetworkSpec, s conversion.Scope) error { + if err := Convert_v1alpha4_VPCSpec_To_v1beta1_VPCSpec(&in.VPC, &out.VPC, s); err != nil { + return err + } + out.Subnets = *(*v1beta1.Subnets)(unsafe.Pointer(&in.Subnets)) + out.CNI = (*v1beta1.CNISpec)(unsafe.Pointer(in.CNI)) + out.SecurityGroupOverrides = *(*map[v1beta1.SecurityGroupRole]string)(unsafe.Pointer(&in.SecurityGroupOverrides)) + return nil +} + +// Convert_v1alpha4_NetworkSpec_To_v1beta1_NetworkSpec is an autogenerated conversion function. +func Convert_v1alpha4_NetworkSpec_To_v1beta1_NetworkSpec(in *NetworkSpec, out *v1beta1.NetworkSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_NetworkSpec_To_v1beta1_NetworkSpec(in, out, s) +} + +func autoConvert_v1beta1_NetworkSpec_To_v1alpha4_NetworkSpec(in *v1beta1.NetworkSpec, out *NetworkSpec, s conversion.Scope) error { + if err := Convert_v1beta1_VPCSpec_To_v1alpha4_VPCSpec(&in.VPC, &out.VPC, s); err != nil { + return err + } + out.Subnets = *(*Subnets)(unsafe.Pointer(&in.Subnets)) + out.CNI = (*CNISpec)(unsafe.Pointer(in.CNI)) + out.SecurityGroupOverrides = *(*map[SecurityGroupRole]string)(unsafe.Pointer(&in.SecurityGroupOverrides)) + return nil +} + +// Convert_v1beta1_NetworkSpec_To_v1alpha4_NetworkSpec is an autogenerated conversion function. +func Convert_v1beta1_NetworkSpec_To_v1alpha4_NetworkSpec(in *v1beta1.NetworkSpec, out *NetworkSpec, s conversion.Scope) error { + return autoConvert_v1beta1_NetworkSpec_To_v1alpha4_NetworkSpec(in, out, s) +} + +func autoConvert_v1alpha4_NetworkStatus_To_v1beta1_NetworkStatus(in *NetworkStatus, out *v1beta1.NetworkStatus, s conversion.Scope) error { + out.SecurityGroups = *(*map[v1beta1.SecurityGroupRole]v1beta1.SecurityGroup)(unsafe.Pointer(&in.SecurityGroups)) + if err := Convert_v1alpha4_ClassicELB_To_v1beta1_ClassicELB(&in.APIServerELB, &out.APIServerELB, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_NetworkStatus_To_v1beta1_NetworkStatus is an autogenerated conversion function. +func Convert_v1alpha4_NetworkStatus_To_v1beta1_NetworkStatus(in *NetworkStatus, out *v1beta1.NetworkStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_NetworkStatus_To_v1beta1_NetworkStatus(in, out, s) +} + +func autoConvert_v1beta1_NetworkStatus_To_v1alpha4_NetworkStatus(in *v1beta1.NetworkStatus, out *NetworkStatus, s conversion.Scope) error { + out.SecurityGroups = *(*map[SecurityGroupRole]SecurityGroup)(unsafe.Pointer(&in.SecurityGroups)) + if err := Convert_v1beta1_ClassicELB_To_v1alpha4_ClassicELB(&in.APIServerELB, &out.APIServerELB, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_NetworkStatus_To_v1alpha4_NetworkStatus is an autogenerated conversion function. +func Convert_v1beta1_NetworkStatus_To_v1alpha4_NetworkStatus(in *v1beta1.NetworkStatus, out *NetworkStatus, s conversion.Scope) error { + return autoConvert_v1beta1_NetworkStatus_To_v1alpha4_NetworkStatus(in, out, s) +} + +func autoConvert_v1alpha4_RouteTable_To_v1beta1_RouteTable(in *RouteTable, out *v1beta1.RouteTable, s conversion.Scope) error { + out.ID = in.ID + return nil +} + +// Convert_v1alpha4_RouteTable_To_v1beta1_RouteTable is an autogenerated conversion function. +func Convert_v1alpha4_RouteTable_To_v1beta1_RouteTable(in *RouteTable, out *v1beta1.RouteTable, s conversion.Scope) error { + return autoConvert_v1alpha4_RouteTable_To_v1beta1_RouteTable(in, out, s) +} + +func autoConvert_v1beta1_RouteTable_To_v1alpha4_RouteTable(in *v1beta1.RouteTable, out *RouteTable, s conversion.Scope) error { + out.ID = in.ID + return nil +} + +// Convert_v1beta1_RouteTable_To_v1alpha4_RouteTable is an autogenerated conversion function. +func Convert_v1beta1_RouteTable_To_v1alpha4_RouteTable(in *v1beta1.RouteTable, out *RouteTable, s conversion.Scope) error { + return autoConvert_v1beta1_RouteTable_To_v1alpha4_RouteTable(in, out, s) +} + +func autoConvert_v1alpha4_SecurityGroup_To_v1beta1_SecurityGroup(in *SecurityGroup, out *v1beta1.SecurityGroup, s conversion.Scope) error { + out.ID = in.ID + out.Name = in.Name + out.IngressRules = *(*v1beta1.IngressRules)(unsafe.Pointer(&in.IngressRules)) + out.Tags = *(*v1beta1.Tags)(unsafe.Pointer(&in.Tags)) + return nil +} + +// Convert_v1alpha4_SecurityGroup_To_v1beta1_SecurityGroup is an autogenerated conversion function. +func Convert_v1alpha4_SecurityGroup_To_v1beta1_SecurityGroup(in *SecurityGroup, out *v1beta1.SecurityGroup, s conversion.Scope) error { + return autoConvert_v1alpha4_SecurityGroup_To_v1beta1_SecurityGroup(in, out, s) +} + +func autoConvert_v1beta1_SecurityGroup_To_v1alpha4_SecurityGroup(in *v1beta1.SecurityGroup, out *SecurityGroup, s conversion.Scope) error { + out.ID = in.ID + out.Name = in.Name + out.IngressRules = *(*IngressRules)(unsafe.Pointer(&in.IngressRules)) + out.Tags = *(*Tags)(unsafe.Pointer(&in.Tags)) + return nil +} + +// Convert_v1beta1_SecurityGroup_To_v1alpha4_SecurityGroup is an autogenerated conversion function. +func Convert_v1beta1_SecurityGroup_To_v1alpha4_SecurityGroup(in *v1beta1.SecurityGroup, out *SecurityGroup, s conversion.Scope) error { + return autoConvert_v1beta1_SecurityGroup_To_v1alpha4_SecurityGroup(in, out, s) +} + +func autoConvert_v1alpha4_SpotMarketOptions_To_v1beta1_SpotMarketOptions(in *SpotMarketOptions, out *v1beta1.SpotMarketOptions, s conversion.Scope) error { + out.MaxPrice = (*string)(unsafe.Pointer(in.MaxPrice)) + return nil +} + +// Convert_v1alpha4_SpotMarketOptions_To_v1beta1_SpotMarketOptions is an autogenerated conversion function. +func Convert_v1alpha4_SpotMarketOptions_To_v1beta1_SpotMarketOptions(in *SpotMarketOptions, out *v1beta1.SpotMarketOptions, s conversion.Scope) error { + return autoConvert_v1alpha4_SpotMarketOptions_To_v1beta1_SpotMarketOptions(in, out, s) +} + +func autoConvert_v1beta1_SpotMarketOptions_To_v1alpha4_SpotMarketOptions(in *v1beta1.SpotMarketOptions, out *SpotMarketOptions, s conversion.Scope) error { + out.MaxPrice = (*string)(unsafe.Pointer(in.MaxPrice)) + return nil +} + +// Convert_v1beta1_SpotMarketOptions_To_v1alpha4_SpotMarketOptions is an autogenerated conversion function. +func Convert_v1beta1_SpotMarketOptions_To_v1alpha4_SpotMarketOptions(in *v1beta1.SpotMarketOptions, out *SpotMarketOptions, s conversion.Scope) error { + return autoConvert_v1beta1_SpotMarketOptions_To_v1alpha4_SpotMarketOptions(in, out, s) +} + +func autoConvert_v1alpha4_SubnetSpec_To_v1beta1_SubnetSpec(in *SubnetSpec, out *v1beta1.SubnetSpec, s conversion.Scope) error { + out.ID = in.ID + out.CidrBlock = in.CidrBlock + out.AvailabilityZone = in.AvailabilityZone + out.IsPublic = in.IsPublic + out.RouteTableID = (*string)(unsafe.Pointer(in.RouteTableID)) + out.NatGatewayID = (*string)(unsafe.Pointer(in.NatGatewayID)) + out.Tags = *(*v1beta1.Tags)(unsafe.Pointer(&in.Tags)) + return nil +} + +// Convert_v1alpha4_SubnetSpec_To_v1beta1_SubnetSpec is an autogenerated conversion function. +func Convert_v1alpha4_SubnetSpec_To_v1beta1_SubnetSpec(in *SubnetSpec, out *v1beta1.SubnetSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_SubnetSpec_To_v1beta1_SubnetSpec(in, out, s) +} + +func autoConvert_v1beta1_SubnetSpec_To_v1alpha4_SubnetSpec(in *v1beta1.SubnetSpec, out *SubnetSpec, s conversion.Scope) error { + out.ID = in.ID + out.CidrBlock = in.CidrBlock + out.AvailabilityZone = in.AvailabilityZone + out.IsPublic = in.IsPublic + out.RouteTableID = (*string)(unsafe.Pointer(in.RouteTableID)) + out.NatGatewayID = (*string)(unsafe.Pointer(in.NatGatewayID)) + out.Tags = *(*Tags)(unsafe.Pointer(&in.Tags)) + return nil +} + +// Convert_v1beta1_SubnetSpec_To_v1alpha4_SubnetSpec is an autogenerated conversion function. +func Convert_v1beta1_SubnetSpec_To_v1alpha4_SubnetSpec(in *v1beta1.SubnetSpec, out *SubnetSpec, s conversion.Scope) error { + return autoConvert_v1beta1_SubnetSpec_To_v1alpha4_SubnetSpec(in, out, s) +} + +func autoConvert_v1alpha4_VPCSpec_To_v1beta1_VPCSpec(in *VPCSpec, out *v1beta1.VPCSpec, s conversion.Scope) error { + out.ID = in.ID + out.CidrBlock = in.CidrBlock + out.InternetGatewayID = (*string)(unsafe.Pointer(in.InternetGatewayID)) + out.Tags = *(*v1beta1.Tags)(unsafe.Pointer(&in.Tags)) + out.AvailabilityZoneUsageLimit = (*int)(unsafe.Pointer(in.AvailabilityZoneUsageLimit)) + out.AvailabilityZoneSelection = (*v1beta1.AZSelectionScheme)(unsafe.Pointer(in.AvailabilityZoneSelection)) + return nil +} + +// Convert_v1alpha4_VPCSpec_To_v1beta1_VPCSpec is an autogenerated conversion function. +func Convert_v1alpha4_VPCSpec_To_v1beta1_VPCSpec(in *VPCSpec, out *v1beta1.VPCSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_VPCSpec_To_v1beta1_VPCSpec(in, out, s) +} + +func autoConvert_v1beta1_VPCSpec_To_v1alpha4_VPCSpec(in *v1beta1.VPCSpec, out *VPCSpec, s conversion.Scope) error { + out.ID = in.ID + out.CidrBlock = in.CidrBlock + out.InternetGatewayID = (*string)(unsafe.Pointer(in.InternetGatewayID)) + out.Tags = *(*Tags)(unsafe.Pointer(&in.Tags)) + out.AvailabilityZoneUsageLimit = (*int)(unsafe.Pointer(in.AvailabilityZoneUsageLimit)) + out.AvailabilityZoneSelection = (*AZSelectionScheme)(unsafe.Pointer(in.AvailabilityZoneSelection)) + return nil +} + +// Convert_v1beta1_VPCSpec_To_v1alpha4_VPCSpec is an autogenerated conversion function. +func Convert_v1beta1_VPCSpec_To_v1alpha4_VPCSpec(in *v1beta1.VPCSpec, out *VPCSpec, s conversion.Scope) error { + return autoConvert_v1beta1_VPCSpec_To_v1alpha4_VPCSpec(in, out, s) +} + +func autoConvert_v1alpha4_Volume_To_v1beta1_Volume(in *Volume, out *v1beta1.Volume, s conversion.Scope) error { + out.DeviceName = in.DeviceName + out.Size = in.Size + out.Type = v1beta1.VolumeType(in.Type) + out.IOPS = in.IOPS + out.Throughput = (*int64)(unsafe.Pointer(in.Throughput)) + out.Encrypted = (*bool)(unsafe.Pointer(in.Encrypted)) + out.EncryptionKey = in.EncryptionKey + return nil +} + +// Convert_v1alpha4_Volume_To_v1beta1_Volume is an autogenerated conversion function. +func Convert_v1alpha4_Volume_To_v1beta1_Volume(in *Volume, out *v1beta1.Volume, s conversion.Scope) error { + return autoConvert_v1alpha4_Volume_To_v1beta1_Volume(in, out, s) +} + +func autoConvert_v1beta1_Volume_To_v1alpha4_Volume(in *v1beta1.Volume, out *Volume, s conversion.Scope) error { + out.DeviceName = in.DeviceName + out.Size = in.Size + out.Type = VolumeType(in.Type) + out.IOPS = in.IOPS + out.Throughput = (*int64)(unsafe.Pointer(in.Throughput)) + out.Encrypted = (*bool)(unsafe.Pointer(in.Encrypted)) + out.EncryptionKey = in.EncryptionKey + return nil +} + +// Convert_v1beta1_Volume_To_v1alpha4_Volume is an autogenerated conversion function. +func Convert_v1beta1_Volume_To_v1alpha4_Volume(in *v1beta1.Volume, out *Volume, s conversion.Scope) error { + return autoConvert_v1beta1_Volume_To_v1alpha4_Volume(in, out, s) +} diff --git a/api/v1alpha4/zz_generated.defaults.go b/api/v1alpha4/zz_generated.defaults.go new file mode 100644 index 0000000000..fa20ac0149 --- /dev/null +++ b/api/v1alpha4/zz_generated.defaults.go @@ -0,0 +1,38 @@ +// +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 defaulter-gen. DO NOT EDIT. + +package v1alpha4 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + scheme.AddTypeDefaultingFunc(&AWSCluster{}, func(obj interface{}) { SetObjectDefaults_AWSCluster(obj.(*AWSCluster)) }) + return nil +} + +func SetObjectDefaults_AWSCluster(in *AWSCluster) { + SetDefaults_NetworkSpec(&in.Spec.NetworkSpec) + SetDefaults_Bastion(&in.Spec.Bastion) +} diff --git a/api/v1beta1/awscluster_types.go b/api/v1beta1/awscluster_types.go new file mode 100644 index 0000000000..23d6e03514 --- /dev/null +++ b/api/v1beta1/awscluster_types.go @@ -0,0 +1,228 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" +) + +const ( + // ClusterFinalizer allows ReconcileAWSCluster to clean up AWS resources associated with AWSCluster before + // removing it from the apiserver. + ClusterFinalizer = "awscluster.infrastructure.cluster.x-k8s.io" + + // AWSClusterControllerIdentityName is the name of the AWSClusterControllerIdentity singleton. + AWSClusterControllerIdentityName = "default" +) + +// AWSClusterSpec defines the desired state of an EC2-based Kubernetes cluster. +type AWSClusterSpec struct { + // NetworkSpec encapsulates all things related to AWS network. + NetworkSpec NetworkSpec `json:"network,omitempty"` + + // The AWS Region the cluster lives in. + Region string `json:"region,omitempty"` + + // SSHKeyName is the name of the ssh key to attach to the bastion host. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name) + // +optional + SSHKeyName *string `json:"sshKeyName,omitempty"` + + // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. + // +optional + ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"` + + // AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the + // ones added by default. + // +optional + AdditionalTags Tags `json:"additionalTags,omitempty"` + + // ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior. + // +optional + ControlPlaneLoadBalancer *AWSLoadBalancerSpec `json:"controlPlaneLoadBalancer,omitempty"` + + // ImageLookupFormat is the AMI naming format to look up machine images when + // a machine does not specify an AMI. When set, this will be used for all + // cluster machines unless a machine specifies a different ImageLookupOrg. + // Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base + // OS and kubernetes version, respectively. The BaseOS will be the value in + // ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as + // defined by the packages produced by kubernetes/release without v as a + // prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default + // image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up + // searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a + // Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See + // also: https://golang.org/pkg/text/template/ + // +optional + ImageLookupFormat string `json:"imageLookupFormat,omitempty"` + + // ImageLookupOrg is the AWS Organization ID to look up machine images when a + // machine does not specify an AMI. When set, this will be used for all + // cluster machines unless a machine specifies a different ImageLookupOrg. + // +optional + ImageLookupOrg string `json:"imageLookupOrg,omitempty"` + + // ImageLookupBaseOS is the name of the base operating system used to look + // up machine images when a machine does not specify an AMI. When set, this + // will be used for all cluster machines unless a machine specifies a + // different ImageLookupBaseOS. + ImageLookupBaseOS string `json:"imageLookupBaseOS,omitempty"` + + // Bastion contains options to configure the bastion host. + // +optional + Bastion Bastion `json:"bastion"` + + // IdentityRef is a reference to a identity to be used when reconciling this cluster + // +optional + IdentityRef *AWSIdentityReference `json:"identityRef,omitempty"` +} + +// AWSIdentityKind defines allowed AWS identity types. +type AWSIdentityKind string + +var ( + // ControllerIdentityKind defines identity reference kind as AWSClusterControllerIdentity. + ControllerIdentityKind = AWSIdentityKind("AWSClusterControllerIdentity") + + // ClusterRoleIdentityKind defines identity reference kind as AWSClusterRoleIdentity. + ClusterRoleIdentityKind = AWSIdentityKind("AWSClusterRoleIdentity") + + // ClusterStaticIdentityKind defines identity reference kind as AWSClusterStaticIdentity. + ClusterStaticIdentityKind = AWSIdentityKind("AWSClusterStaticIdentity") +) + +// AWSIdentityReference specifies a identity. +type AWSIdentityReference struct { + // Name of the identity. + // +kubebuilder:validation:MinLength=1 + Name string `json:"name"` + + // Kind of the identity. + // +kubebuilder:validation:Enum=AWSClusterControllerIdentity;AWSClusterRoleIdentity;AWSClusterStaticIdentity + Kind AWSIdentityKind `json:"kind"` +} + +// Bastion defines a bastion host. +type Bastion struct { + // Enabled allows this provider to create a bastion host instance + // with a public ip to access the VPC private network. + // +optional + Enabled bool `json:"enabled"` + + // DisableIngressRules will ensure there are no Ingress rules in the bastion host's security group. + // Requires AllowedCIDRBlocks to be empty. + // +optional + DisableIngressRules bool `json:"disableIngressRules,omitempty"` + + // AllowedCIDRBlocks is a list of CIDR blocks allowed to access the bastion host. + // They are set as ingress rules for the Bastion host's Security Group (defaults to 0.0.0.0/0). + // +optional + AllowedCIDRBlocks []string `json:"allowedCIDRBlocks,omitempty"` + + // InstanceType will use the specified instance type for the bastion. If not specified, + // Cluster API Provider AWS will use t3.micro for all regions except us-east-1, where t2.micro + // will be the default. + InstanceType string `json:"instanceType,omitempty"` + + // AMI will use the specified AMI to boot the bastion. If not specified, + // the AMI will default to one picked out in public space. + // +optional + AMI string `json:"ami,omitempty"` +} + +// AWSLoadBalancerSpec defines the desired state of an AWS load balancer. +type AWSLoadBalancerSpec struct { + // Scheme sets the scheme of the load balancer (defaults to internet-facing) + // +kubebuilder:default=internet-facing + // +kubebuilder:validation:Enum=internet-facing;internal + // +optional + Scheme *ClassicELBScheme `json:"scheme,omitempty"` + + // CrossZoneLoadBalancing enables the classic ELB cross availability zone balancing. + // + // With cross-zone load balancing, each load balancer node for your Classic Load Balancer + // distributes requests evenly across the registered instances in all enabled Availability Zones. + // If cross-zone load balancing is disabled, each load balancer node distributes requests evenly across + // the registered instances in its Availability Zone only. + // + // Defaults to false. + // +optional + CrossZoneLoadBalancing bool `json:"crossZoneLoadBalancing"` + + // Subnets sets the subnets that should be applied to the control plane load balancer (defaults to discovered subnets for managed VPCs or an empty set for unmanaged VPCs) + // +optional + Subnets []string `json:"subnets,omitempty"` + + // AdditionalSecurityGroups sets the security groups used by the load balancer. Expected to be security group IDs + // This is optional - if not provided new security groups will be created for the load balancer + // +optional + AdditionalSecurityGroups []string `json:"additionalSecurityGroups,omitempty"` +} + +// AWSClusterStatus defines the observed state of AWSCluster. +type AWSClusterStatus struct { + // +kubebuilder:default=false + Ready bool `json:"ready"` + Network NetworkStatus `json:"networkStatus,omitempty"` + FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"` + Bastion *Instance `json:"bastion,omitempty"` + Conditions clusterv1.Conditions `json:"conditions,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsclusters,scope=Namespaced,categories=cluster-api,shortName=awsc +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AWSCluster belongs" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Cluster infrastructure is ready for EC2 instances" +// +kubebuilder:printcolumn:name="VPC",type="string",JSONPath=".spec.network.vpc.id",description="AWS VPC the cluster is using" +// +kubebuilder:printcolumn:name="Endpoint",type="string",JSONPath=".spec.controlPlaneEndpoint",description="API Endpoint",priority=1 +// +kubebuilder:printcolumn:name="Bastion IP",type="string",JSONPath=".status.bastion.publicIp",description="Bastion IP address for breakglass access" +// +k8s:defaulter-gen=true + +// AWSCluster is the schema for Amazon EC2 based Kubernetes Cluster API. +type AWSCluster struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AWSClusterSpec `json:"spec,omitempty"` + Status AWSClusterStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// AWSClusterList contains a list of AWSCluster. +// +k8s:defaulter-gen=true +type AWSClusterList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSCluster `json:"items"` +} + +// GetConditions returns the observations of the operational state of the AWSCluster resource. +func (r *AWSCluster) GetConditions() clusterv1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the AWSCluster to the predescribed clusterv1.Conditions. +func (r *AWSCluster) SetConditions(conditions clusterv1.Conditions) { + r.Status.Conditions = conditions +} + +func init() { + SchemeBuilder.Register(&AWSCluster{}, &AWSClusterList{}) +} diff --git a/api/v1alpha4/awscluster_webhook.go b/api/v1beta1/awscluster_webhook.go similarity index 84% rename from api/v1alpha4/awscluster_webhook.go rename to api/v1beta1/awscluster_webhook.go index 14bd1b860e..397562097f 100644 --- a/api/v1alpha4/awscluster_webhook.go +++ b/api/v1beta1/awscluster_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "fmt" @@ -23,7 +23,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/annotations" ctrl "sigs.k8s.io/controller-runtime" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -39,8 +39,8 @@ func (r *AWSCluster) SetupWebhookWithManager(mgr ctrl.Manager) error { Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha4-awscluster,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusters,versions=v1alpha4,name=validation.awscluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awscluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusters,versions=v1alpha4,name=default.awscluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-awscluster,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusters,versions=v1beta1,name=validation.awscluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-awscluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusters,versions=v1beta1,name=default.awscluster.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 var ( _ webhook.Validator = &AWSCluster{} @@ -144,21 +144,9 @@ func (r *AWSCluster) ValidateUpdate(old runtime.Object) error { // Default satisfies the defaulting webhook interface. func (r *AWSCluster) Default() { - SetDefaultsAWSClusterSpec(&r.Spec) + SetObjectDefaults_AWSCluster(r) } func (r *AWSCluster) validateSSHKeyName() field.ErrorList { return validateSSHKeyName(r.Spec.SSHKeyName) } - -func SetDefaultsAWSClusterSpec(s *AWSClusterSpec) { - SetDefaults_Bastion(&s.Bastion) - SetDefaults_NetworkSpec(&s.NetworkSpec) - - if s.IdentityRef == nil { - s.IdentityRef = &AWSIdentityReference{ - Kind: ControllerIdentityKind, - Name: AWSClusterControllerIdentityName, - } - } -} diff --git a/api/v1alpha4/awscluster_webhook_test.go b/api/v1beta1/awscluster_webhook_test.go similarity index 99% rename from api/v1alpha4/awscluster_webhook_test.go rename to api/v1beta1/awscluster_webhook_test.go index 22215c8689..6034af3ab1 100644 --- a/api/v1alpha4/awscluster_webhook_test.go +++ b/api/v1beta1/awscluster_webhook_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "context" @@ -23,7 +23,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" utildefaulting "sigs.k8s.io/cluster-api/util/defaulting" ) diff --git a/api/v1alpha4/awsclustercontrolleridentity_webhook.go b/api/v1beta1/awsclustercontrolleridentity_webhook.go similarity index 83% rename from api/v1alpha4/awsclustercontrolleridentity_webhook.go rename to api/v1beta1/awsclustercontrolleridentity_webhook.go index 9100adb0a0..6826afb7d8 100644 --- a/api/v1alpha4/awsclustercontrolleridentity_webhook.go +++ b/api/v1beta1/awsclustercontrolleridentity_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "fmt" @@ -39,8 +39,8 @@ func (r *AWSClusterControllerIdentity) SetupWebhookWithManager(mgr ctrl.Manager) Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsclustercontrolleridentity,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclustercontrolleridentities,versions=v1alpha4,name=validation.awsclustercontrolleridentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awsclustercontrolleridentity,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclustercontrolleridentities,versions=v1alpha4,name=default.awsclustercontrolleridentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-awsclustercontrolleridentity,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclustercontrolleridentities,versions=v1beta1,name=validation.awsclustercontrolleridentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-awsclustercontrolleridentity,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclustercontrolleridentities,versions=v1beta1,name=default.awsclustercontrolleridentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 var ( _ webhook.Validator = &AWSClusterControllerIdentity{} diff --git a/api/v1alpha4/awsclustercontrolleridentity_webhook_test.go b/api/v1beta1/awsclustercontrolleridentity_webhook_test.go similarity index 99% rename from api/v1alpha4/awsclustercontrolleridentity_webhook_test.go rename to api/v1beta1/awsclustercontrolleridentity_webhook_test.go index ecc4a04f40..e475e8ada0 100644 --- a/api/v1alpha4/awsclustercontrolleridentity_webhook_test.go +++ b/api/v1beta1/awsclustercontrolleridentity_webhook_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "context" diff --git a/api/v1alpha4/awsclustercontrolleridentitylist_webhook.go b/api/v1beta1/awsclustercontrolleridentitylist_webhook.go similarity index 98% rename from api/v1alpha4/awsclustercontrolleridentitylist_webhook.go rename to api/v1beta1/awsclustercontrolleridentitylist_webhook.go index 8df2f03823..3ade1bd426 100644 --- a/api/v1alpha4/awsclustercontrolleridentitylist_webhook.go +++ b/api/v1beta1/awsclustercontrolleridentitylist_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( ctrl "sigs.k8s.io/controller-runtime" diff --git a/api/v1alpha4/awsclusterlist_webhook.go b/api/v1beta1/awsclusterlist_webhook.go similarity index 98% rename from api/v1alpha4/awsclusterlist_webhook.go rename to api/v1beta1/awsclusterlist_webhook.go index 681593d8f0..60b1467866 100644 --- a/api/v1alpha4/awsclusterlist_webhook.go +++ b/api/v1beta1/awsclusterlist_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( ctrl "sigs.k8s.io/controller-runtime" diff --git a/api/v1alpha4/awsclusterroleidentity_webhook.go b/api/v1beta1/awsclusterroleidentity_webhook.go similarity index 83% rename from api/v1alpha4/awsclusterroleidentity_webhook.go rename to api/v1beta1/awsclusterroleidentity_webhook.go index 382ee13aeb..10fb47e967 100644 --- a/api/v1alpha4/awsclusterroleidentity_webhook.go +++ b/api/v1beta1/awsclusterroleidentity_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "fmt" @@ -37,8 +37,8 @@ func (r *AWSClusterRoleIdentity) SetupWebhookWithManager(mgr ctrl.Manager) error Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsclusterroleidentity,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusterroleidentities,versions=v1alpha4,name=validation.awsclusterroleidentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awsclusterroleidentity,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusterroleidentities,versions=v1alpha4,name=default.awsclusterroleidentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-awsclusterroleidentity,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusterroleidentities,versions=v1beta1,name=validation.awsclusterroleidentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-awsclusterroleidentity,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusterroleidentities,versions=v1beta1,name=default.awsclusterroleidentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 var ( _ webhook.Validator = &AWSClusterRoleIdentity{} diff --git a/api/v1alpha4/awsclusterroleidentity_webhook_test.go b/api/v1beta1/awsclusterroleidentity_webhook_test.go similarity index 99% rename from api/v1alpha4/awsclusterroleidentity_webhook_test.go rename to api/v1beta1/awsclusterroleidentity_webhook_test.go index b1b6b188d8..f8a969b5e1 100644 --- a/api/v1alpha4/awsclusterroleidentity_webhook_test.go +++ b/api/v1beta1/awsclusterroleidentity_webhook_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "context" diff --git a/api/v1alpha4/awsclusterroleidentitylist_webhook.go b/api/v1beta1/awsclusterroleidentitylist_webhook.go similarity index 98% rename from api/v1alpha4/awsclusterroleidentitylist_webhook.go rename to api/v1beta1/awsclusterroleidentitylist_webhook.go index 14292b070b..fcf8826dd1 100644 --- a/api/v1alpha4/awsclusterroleidentitylist_webhook.go +++ b/api/v1beta1/awsclusterroleidentitylist_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( ctrl "sigs.k8s.io/controller-runtime" diff --git a/api/v1alpha4/awsclusterstaticidentity_webhook.go b/api/v1beta1/awsclusterstaticidentity_webhook.go similarity index 81% rename from api/v1alpha4/awsclusterstaticidentity_webhook.go rename to api/v1beta1/awsclusterstaticidentity_webhook.go index 211de9f82d..48e4662524 100644 --- a/api/v1alpha4/awsclusterstaticidentity_webhook.go +++ b/api/v1beta1/awsclusterstaticidentity_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "fmt" @@ -37,8 +37,8 @@ func (r *AWSClusterStaticIdentity) SetupWebhookWithManager(mgr ctrl.Manager) err Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsclusterstaticidentity,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusterstaticidentities,versions=v1alpha4,name=validation.awsclusterstaticidentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awsclusterstaticidentity,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusterstaticidentities,versions=v1alpha4,name=default.awsclusterstaticidentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-awsclusterstaticidentity,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusterstaticidentities,versions=v1beta1,name=validation.awsclusterstaticidentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-awsclusterstaticidentity,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusterstaticidentities,versions=v1beta1,name=default.awsclusterstaticidentity.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 var ( _ webhook.Validator = &AWSClusterStaticIdentity{} diff --git a/api/v1alpha4/awsclusterstaticidentity_webhook_test.go b/api/v1beta1/awsclusterstaticidentity_webhook_test.go similarity index 99% rename from api/v1alpha4/awsclusterstaticidentity_webhook_test.go rename to api/v1beta1/awsclusterstaticidentity_webhook_test.go index 0a0c4ab046..e338cfe14c 100644 --- a/api/v1alpha4/awsclusterstaticidentity_webhook_test.go +++ b/api/v1beta1/awsclusterstaticidentity_webhook_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "context" diff --git a/api/v1beta1/awsclustertemplate_types.go b/api/v1beta1/awsclustertemplate_types.go new file mode 100644 index 0000000000..c14f2a2c0b --- /dev/null +++ b/api/v1beta1/awsclustertemplate_types.go @@ -0,0 +1,61 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" +) + +// AWSClusterTemplateSpec defines the desired state of AWSClusterTemplate. +type AWSClusterTemplateSpec struct { + Template AWSClusterTemplateResource `json:"template"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsclustertemplates,scope=Namespaced,categories=cluster-api,shortName=awsct +// +kubebuilder:storageversion +// +k8s:defaulter-gen=true + +// AWSClusterTemplate is the schema for Amazon EC2 based Kubernetes Cluster Templates. +type AWSClusterTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AWSClusterTemplateSpec `json:"spec,omitempty"` +} + +//+kubebuilder:object:root=true + +// AWSClusterTemplateList contains a list of AWSClusterTemplate. +type AWSClusterTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSClusterTemplate `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AWSClusterTemplate{}, &AWSClusterTemplateList{}) +} + +type AWSClusterTemplateResource struct { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty"` + Spec AWSClusterSpec `json:"spec"` +} diff --git a/api/v1alpha4/awsclustertemplate_webhook.go b/api/v1beta1/awsclustertemplate_webhook.go similarity index 76% rename from api/v1alpha4/awsclustertemplate_webhook.go rename to api/v1beta1/awsclustertemplate_webhook.go index 799f1b9b66..6bd9666eca 100644 --- a/api/v1alpha4/awsclustertemplate_webhook.go +++ b/api/v1beta1/awsclustertemplate_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "reflect" @@ -32,18 +32,17 @@ func (r *AWSClusterTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error { Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsclustertemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclustertemplates,versions=v1alpha4,name=validation.awsclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awsclustertemplate,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclustertemplates,versions=v1alpha4,name=default.awsclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-awsclustertemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclustertemplates,versions=v1beta1,name=validation.awsclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-awsclustertemplate,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclustertemplates,versions=v1beta1,name=default.awsclustertemplate.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 var _ webhook.Defaulter = &AWSClusterTemplate{} +var _ webhook.Validator = &AWSClusterTemplate{} // Default implements webhook.Defaulter so a webhook will be registered for the type. func (r *AWSClusterTemplate) Default() { - SetDefaultsAWSClusterSpec(&r.Spec.Template.Spec) + SetObjectDefaults_AWSClusterTemplate(r) } -var _ webhook.Validator = &AWSClusterTemplate{} - // ValidateCreate implements webhook.Validator so a webhook will be registered for the type. func (r *AWSClusterTemplate) ValidateCreate() error { var allErrs field.ErrorList diff --git a/api/v1beta1/awsidentity_types.go b/api/v1beta1/awsidentity_types.go new file mode 100644 index 0000000000..f16601bac3 --- /dev/null +++ b/api/v1beta1/awsidentity_types.go @@ -0,0 +1,193 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// AWSClusterIdentitySpec defines the Spec struct for AWSClusterIdentity types. +type AWSClusterIdentitySpec struct { + // AllowedNamespaces is used to identify which namespaces are allowed to use the identity from. + // Namespaces can be selected either using an array of namespaces or with label selector. + // An empty allowedNamespaces object indicates that AWSClusters can use this identity from any namespace. + // If this object is nil, no namespaces will be allowed (default behaviour, if this field is not provided) + // A namespace should be either in the NamespaceList or match with Selector to use the identity. + // + // +optional + // +nullable + AllowedNamespaces *AllowedNamespaces `json:"allowedNamespaces"` +} + +// AllowedNamespaces is a selector of namespaces that AWSClusters can +// use this ClusterPrincipal from. This is a standard Kubernetes LabelSelector, +// a label query over a set of resources. The result of matchLabels and +// matchExpressions are ANDed. +type AllowedNamespaces struct { + // An nil or empty list indicates that AWSClusters cannot use the identity from any namespace. + // + // +optional + // +nullable + NamespaceList []string `json:"list"` + + // An empty selector indicates that AWSClusters cannot use this + // AWSClusterIdentity from any namespace. + // +optional + Selector metav1.LabelSelector `json:"selector"` +} + +// AWSRoleSpec defines the specifications for all identities based around AWS roles. +type AWSRoleSpec struct { + // The Amazon Resource Name (ARN) of the role to assume. + RoleArn string `json:"roleARN"` + // An identifier for the assumed role session + SessionName string `json:"sessionName,omitempty"` + // The duration, in seconds, of the role session before it is renewed. + // +kubebuilder:validation:Minimum:=900 + // +kubebuilder:validation:Maximum:=43200 + DurationSeconds int32 `json:"durationSeconds,omitempty"` + // An IAM policy as a JSON-encoded string that you want to use as an inline session policy. + InlinePolicy string `json:"inlinePolicy,omitempty"` + + // The Amazon Resource Names (ARNs) of the IAM managed policies that you want + // to use as managed session policies. + // The policies must exist in the same account as the role. + PolicyARNs []string `json:"policyARNs,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsclusterstaticidentities,scope=Cluster,categories=cluster-api,shortName=awssi +// +kubebuilder:storageversion +// +k8s:defaulter-gen=true + +// AWSClusterStaticIdentity is the Schema for the awsclusterstaticidentities API +// It represents a reference to an AWS access key ID and secret access key, stored in a secret. +type AWSClusterStaticIdentity struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec for this AWSClusterStaticIdentity + Spec AWSClusterStaticIdentitySpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true +// +k8s:defaulter-gen=true + +// AWSClusterStaticIdentityList contains a list of AWSClusterStaticIdentity. +type AWSClusterStaticIdentityList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSClusterStaticIdentity `json:"items"` +} + +// AWSClusterStaticIdentitySpec defines the specifications for AWSClusterStaticIdentity. +type AWSClusterStaticIdentitySpec struct { + AWSClusterIdentitySpec `json:",inline"` + // Reference to a secret containing the credentials. The secret should + // contain the following data keys: + // AccessKeyID: AKIAIOSFODNN7EXAMPLE + // SecretAccessKey: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY + // SessionToken: Optional + SecretRef string `json:"secretRef"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsclusterroleidentities,scope=Cluster,categories=cluster-api,shortName=awsri +// +kubebuilder:storageversion +// +k8s:defaulter-gen=true + +// AWSClusterRoleIdentity is the Schema for the awsclusterroleidentities API +// It is used to assume a role using the provided sourceRef. +type AWSClusterRoleIdentity struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec for this AWSClusterRoleIdentity. + Spec AWSClusterRoleIdentitySpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true +// +k8s:defaulter-gen=true + +// AWSClusterRoleIdentityList contains a list of AWSClusterRoleIdentity. +type AWSClusterRoleIdentityList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSClusterRoleIdentity `json:"items"` +} + +// AWSClusterRoleIdentitySpec defines the specifications for AWSClusterRoleIdentity. +type AWSClusterRoleIdentitySpec struct { + AWSClusterIdentitySpec `json:",inline"` + AWSRoleSpec `json:",inline"` + // A unique identifier that might be required when you assume a role in another account. + // If the administrator of the account to which the role belongs provided you with an + // external ID, then provide that value in the ExternalId parameter. This value can be + // any string, such as a passphrase or account number. A cross-account role is usually + // set up to trust everyone in an account. Therefore, the administrator of the trusting + // account might send an external ID to the administrator of the trusted account. That + // way, only someone with the ID can assume the role, rather than everyone in the + // account. For more information about the external ID, see How to Use an External ID + // When Granting Access to Your AWS Resources to a Third Party in the IAM User Guide. + // +optional + ExternalID string `json:"externalID,omitempty"` + + // SourceIdentityRef is a reference to another identity which will be chained to do + // role assumption. All identity types are accepted. + SourceIdentityRef *AWSIdentityReference `json:"sourceIdentityRef,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsclustercontrolleridentities,scope=Cluster,categories=cluster-api,shortName=awsci +// +kubebuilder:storageversion +// +k8s:defaulter-gen=true + +// AWSClusterControllerIdentity is the Schema for the awsclustercontrolleridentities API +// It is used to grant access to use Cluster API Provider AWS Controller credentials. +type AWSClusterControllerIdentity struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + // Spec for this AWSClusterControllerIdentity. + Spec AWSClusterControllerIdentitySpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true +// +k8s:defaulter-gen=true + +// AWSClusterControllerIdentityList contains a list of AWSClusterControllerIdentity. +type AWSClusterControllerIdentityList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSClusterControllerIdentity `json:"items"` +} + +// AWSClusterControllerIdentitySpec defines the specifications for AWSClusterControllerIdentity. +type AWSClusterControllerIdentitySpec struct { + AWSClusterIdentitySpec `json:",inline"` +} + +func init() { + SchemeBuilder.Register( + &AWSClusterStaticIdentity{}, + &AWSClusterStaticIdentityList{}, + &AWSClusterRoleIdentity{}, + &AWSClusterRoleIdentityList{}, + &AWSClusterControllerIdentity{}, + &AWSClusterControllerIdentityList{}, + ) +} diff --git a/api/v1beta1/awsmachine_types.go b/api/v1beta1/awsmachine_types.go new file mode 100644 index 0000000000..b8c3a26ede --- /dev/null +++ b/api/v1beta1/awsmachine_types.go @@ -0,0 +1,283 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/errors" +) + +const ( + // MachineFinalizer allows ReconcileAWSMachine to clean up AWS resources associated with AWSMachine before + // removing it from the apiserver. + MachineFinalizer = "awsmachine.infrastructure.cluster.x-k8s.io" +) + +// SecretBackend defines variants for backend secret storage. +type SecretBackend string + +var ( + // SecretBackendSSMParameterStore defines AWS Systems Manager Parameter Store as the secret backend. + SecretBackendSSMParameterStore = SecretBackend("ssm-parameter-store") + + // SecretBackendSecretsManager defines AWS Secrets Manager as the secret backend. + SecretBackendSecretsManager = SecretBackend("secrets-manager") +) + +// AWSMachineSpec defines the desired state of an Amazon EC2 instance. +type AWSMachineSpec struct { + // ProviderID is the unique identifier as specified by the cloud provider. + ProviderID *string `json:"providerID,omitempty"` + + // InstanceID is the EC2 instance ID for this machine. + InstanceID *string `json:"instanceID,omitempty"` + + // AMI is the reference to the AMI from which to create the machine instance. + AMI AMIReference `json:"ami,omitempty"` + + // ImageLookupFormat is the AMI naming format to look up the image for this + // machine It will be ignored if an explicit AMI is set. Supports + // substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base OS and + // kubernetes version, respectively. The BaseOS will be the value in + // ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as + // defined by the packages produced by kubernetes/release without v as a + // prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default + // image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up + // searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a + // Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See + // also: https://golang.org/pkg/text/template/ + // +optional + ImageLookupFormat string `json:"imageLookupFormat,omitempty"` + + // ImageLookupOrg is the AWS Organization ID to use for image lookup if AMI is not set. + ImageLookupOrg string `json:"imageLookupOrg,omitempty"` + + // ImageLookupBaseOS is the name of the base operating system to use for + // image lookup the AMI is not set. + ImageLookupBaseOS string `json:"imageLookupBaseOS,omitempty"` + + // InstanceType is the type of instance to create. Example: m4.xlarge + // +kubebuilder:validation:Required + // +kubebuilder:validation:MinLength:=2 + InstanceType string `json:"instanceType"` + + // AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the + // AWS provider. If both the AWSCluster and the AWSMachine specify the same tag name with different values, the + // AWSMachine's value takes precedence. + // +optional + AdditionalTags Tags `json:"additionalTags,omitempty"` + + // IAMInstanceProfile is a name of an IAM instance profile to assign to the instance + // +optional + IAMInstanceProfile string `json:"iamInstanceProfile,omitempty"` + + // PublicIP specifies whether the instance should get a public IP. + // Precedence for this setting is as follows: + // 1. This field if set + // 2. Cluster/flavor setting + // 3. Subnet default + // +optional + PublicIP *bool `json:"publicIP,omitempty"` + + // AdditionalSecurityGroups is an array of references to security groups that should be applied to the + // instance. These security groups would be set in addition to any security groups defined + // at the cluster level or in the actuator. It is possible to specify either IDs of Filters. Using Filters + // will cause additional requests to AWS API and if tags change the attached security groups might change too. + // +optional + AdditionalSecurityGroups []AWSResourceReference `json:"additionalSecurityGroups,omitempty"` + + // FailureDomain is the failure domain unique identifier this Machine should be attached to, as defined in Cluster API. + // For this infrastructure provider, the ID is equivalent to an AWS Availability Zone. + // If multiple subnets are matched for the availability zone, the first one returned is picked. + FailureDomain *string `json:"failureDomain,omitempty"` + + // Subnet is a reference to the subnet to use for this instance. If not specified, + // the cluster subnet will be used. + // +optional + Subnet *AWSResourceReference `json:"subnet,omitempty"` + + // SSHKeyName is the name of the ssh key to attach to the instance. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name) + // +optional + SSHKeyName *string `json:"sshKeyName,omitempty"` + + // RootVolume encapsulates the configuration options for the root volume + // +optional + RootVolume *Volume `json:"rootVolume,omitempty"` + + // Configuration options for the non root storage volumes. + // +optional + NonRootVolumes []Volume `json:"nonRootVolumes,omitempty"` + + // NetworkInterfaces is a list of ENIs to associate with the instance. + // A maximum of 2 may be specified. + // +optional + // +kubebuilder:validation:MaxItems=2 + NetworkInterfaces []string `json:"networkInterfaces,omitempty"` + + // UncompressedUserData specify whether the user data is gzip-compressed before it is sent to ec2 instance. + // cloud-init has built-in support for gzip-compressed user data + // user data stored in aws secret manager is always gzip-compressed. + // + // +optional + UncompressedUserData *bool `json:"uncompressedUserData,omitempty"` + + // CloudInit defines options related to the bootstrapping systems where + // CloudInit is used. + // +optional + CloudInit CloudInit `json:"cloudInit,omitempty"` + + // SpotMarketOptions allows users to configure instances to be run using AWS Spot instances. + // +optional + SpotMarketOptions *SpotMarketOptions `json:"spotMarketOptions,omitempty"` + + // Tenancy indicates if instance should run on shared or single-tenant hardware. + // +optional + // +kubebuilder:validation:Enum:=default;dedicated;host + Tenancy string `json:"tenancy,omitempty"` +} + +// CloudInit defines options related to the bootstrapping systems where +// CloudInit is used. +type CloudInit struct { + // InsecureSkipSecretsManager, when set to true will not use AWS Secrets Manager + // or AWS Systems Manager Parameter Store to ensure privacy of userdata. + // By default, a cloud-init boothook shell script is prepended to download + // the userdata from Secrets Manager and additionally delete the secret. + InsecureSkipSecretsManager bool `json:"insecureSkipSecretsManager,omitempty"` + + // SecretCount is the number of secrets used to form the complete secret + // +optional + SecretCount int32 `json:"secretCount,omitempty"` + + // SecretPrefix is the prefix for the secret name. This is stored + // temporarily, and deleted when the machine registers as a node against + // the workload cluster. + // +optional + SecretPrefix string `json:"secretPrefix,omitempty"` + + // SecureSecretsBackend, when set to parameter-store will utilize the AWS Systems Manager + // Parameter Storage to distribute secrets. By default or with the value of secrets-manager, + // will use AWS Secrets Manager instead. + // +optional + // +kubebuilder:validation:Enum=secrets-manager;ssm-parameter-store + SecureSecretsBackend SecretBackend `json:"secureSecretsBackend,omitempty"` +} + +// AWSMachineStatus defines the observed state of AWSMachine. +type AWSMachineStatus struct { + // Ready is true when the provider resource is ready. + // +optional + Ready bool `json:"ready"` + + // Interruptible reports that this machine is using spot instances and can therefore be interrupted by CAPI when it receives a notice that the spot instance is to be terminated by AWS. + // This will be set to true when SpotMarketOptions is not nil (i.e. this machine is using a spot instance). + // +optional + Interruptible bool `json:"interruptible,omitempty"` + + // Addresses contains the AWS instance associated addresses. + Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"` + + // InstanceState is the state of the AWS instance for this machine. + // +optional + InstanceState *InstanceState `json:"instanceState,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 *errors.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"` + + // Conditions defines current service state of the AWSMachine. + // +optional + Conditions clusterv1.Conditions `json:"conditions,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsmachines,scope=Namespaced,categories=cluster-api,shortName=awsm +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AWSMachine belongs" +// +kubebuilder:printcolumn:name="State",type="string",JSONPath=".status.instanceState",description="EC2 instance state" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Machine ready status" +// +kubebuilder:printcolumn:name="InstanceID",type="string",JSONPath=".spec.providerID",description="EC2 instance ID" +// +kubebuilder:printcolumn:name="Machine",type="string",JSONPath=".metadata.ownerReferences[?(@.kind==\"Machine\")].name",description="Machine object which owns with this AWSMachine" +// +k8s:defaulter-gen=true + +// AWSMachine is the schema for Amazon EC2 machines. +type AWSMachine struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AWSMachineSpec `json:"spec,omitempty"` + Status AWSMachineStatus `json:"status,omitempty"` +} + +// GetConditions returns the observations of the operational state of the AWSMachine resource. +func (r *AWSMachine) GetConditions() clusterv1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the AWSMachine to the predescribed clusterv1.Conditions. +func (r *AWSMachine) SetConditions(conditions clusterv1.Conditions) { + r.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// AWSMachineList contains a list of Amazon EC2 machines. +type AWSMachineList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSMachine `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AWSMachine{}, &AWSMachineList{}) +} diff --git a/api/v1alpha4/awsmachine_webhook.go b/api/v1beta1/awsmachine_webhook.go similarity index 93% rename from api/v1alpha4/awsmachine_webhook.go rename to api/v1beta1/awsmachine_webhook.go index 37a29353df..ffaca476c0 100644 --- a/api/v1alpha4/awsmachine_webhook.go +++ b/api/v1beta1/awsmachine_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "reflect" @@ -37,8 +37,8 @@ func (r *AWSMachine) SetupWebhookWithManager(mgr ctrl.Manager) error { Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsmachine,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmachines,versions=v1alpha4,name=validation.awsmachine.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awsmachine,mutating=true,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=awsmachines,versions=v1alpha4,name=mawsmachine.kb.io,name=mutation.awsmachine.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-awsmachine,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmachines,versions=v1beta1,name=validation.awsmachine.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-awsmachine,mutating=true,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=awsmachines,versions=v1beta1,name=mawsmachine.kb.io,name=mutation.awsmachine.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 var ( _ webhook.Validator = &AWSMachine{} diff --git a/api/v1alpha4/awsmachine_webhook_test.go b/api/v1beta1/awsmachine_webhook_test.go similarity index 99% rename from api/v1alpha4/awsmachine_webhook_test.go rename to api/v1beta1/awsmachine_webhook_test.go index efcfc61bb9..28f25e7926 100644 --- a/api/v1alpha4/awsmachine_webhook_test.go +++ b/api/v1beta1/awsmachine_webhook_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "context" diff --git a/api/v1alpha4/awsmachinelist_webhook.go b/api/v1beta1/awsmachinelist_webhook.go similarity index 98% rename from api/v1alpha4/awsmachinelist_webhook.go rename to api/v1beta1/awsmachinelist_webhook.go index 91bf30c06e..213b461d35 100644 --- a/api/v1alpha4/awsmachinelist_webhook.go +++ b/api/v1beta1/awsmachinelist_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( ctrl "sigs.k8s.io/controller-runtime" diff --git a/api/v1beta1/awsmachinetemplate_types.go b/api/v1beta1/awsmachinetemplate_types.go new file mode 100644 index 0000000000..300a7e6b83 --- /dev/null +++ b/api/v1beta1/awsmachinetemplate_types.go @@ -0,0 +1,64 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" +) + +// AWSMachineTemplateSpec defines the desired state of AWSMachineTemplate. +type AWSMachineTemplateSpec struct { + Template AWSMachineTemplateResource `json:"template"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsmachinetemplates,scope=Namespaced,categories=cluster-api,shortName=awsmt +// +kubebuilder:storageversion +// +k8s:defaulter-gen=true + +// AWSMachineTemplate is the schema for the Amazon EC2 Machine Templates API. +type AWSMachineTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AWSMachineTemplateSpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true + +// AWSMachineTemplateList contains a list of AWSMachineTemplate. +type AWSMachineTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSMachineTemplate `json:"items"` +} + +// AWSMachineTemplateResource describes the data needed to create am AWSMachine from a template. +type AWSMachineTemplateResource struct { + // Standard object's metadata. + // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + // +optional + ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty"` + + // Spec is the specification of the desired behavior of the machine. + Spec AWSMachineSpec `json:"spec"` +} + +func init() { + SchemeBuilder.Register(&AWSMachineTemplate{}, &AWSMachineTemplateList{}) +} diff --git a/api/v1alpha4/awsmachinetemplate_webhook.go b/api/v1beta1/awsmachinetemplate_webhook.go similarity index 93% rename from api/v1alpha4/awsmachinetemplate_webhook.go rename to api/v1beta1/awsmachinetemplate_webhook.go index f9ef8cea50..95af5d7e6d 100644 --- a/api/v1alpha4/awsmachinetemplate_webhook.go +++ b/api/v1beta1/awsmachinetemplate_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "reflect" @@ -32,7 +32,7 @@ func (r *AWSMachineTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error { Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsmachinetemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmachinetemplates,versions=v1alpha4,name=validation.awsmachinetemplate.infrastructure.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-awsmachinetemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmachinetemplates,versions=v1beta1,name=validation.awsmachinetemplate.infrastructure.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 var ( _ webhook.Validator = &AWSMachineTemplate{} @@ -120,7 +120,7 @@ func (r *AWSMachineTemplate) ValidateCreate() error { func (r *AWSMachineTemplate) ValidateUpdate(old runtime.Object) error { oldAWSMachineTemplate := old.(*AWSMachineTemplate) - // Allow setting of cloudInit.secureSecretsBackend to "secrets-manager" only to handle v1alpha4 upgrade + // Allow setting of cloudInit.secureSecretsBackend to "secrets-manager" only to handle v1beta1 upgrade if oldAWSMachineTemplate.Spec.Template.Spec.CloudInit.SecureSecretsBackend == "" && r.Spec.Template.Spec.CloudInit.SecureSecretsBackend == SecretBackendSecretsManager { r.Spec.Template.Spec.CloudInit.SecureSecretsBackend = "" } diff --git a/api/v1alpha4/awsmachinetemplate_webhook_test.go b/api/v1beta1/awsmachinetemplate_webhook_test.go similarity index 99% rename from api/v1alpha4/awsmachinetemplate_webhook_test.go rename to api/v1beta1/awsmachinetemplate_webhook_test.go index 21b0dc5a2b..5141b1dcaf 100644 --- a/api/v1alpha4/awsmachinetemplate_webhook_test.go +++ b/api/v1beta1/awsmachinetemplate_webhook_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "context" diff --git a/api/v1alpha4/awsmachinetemplatelist_webhook.go b/api/v1beta1/awsmachinetemplatelist_webhook.go similarity index 98% rename from api/v1alpha4/awsmachinetemplatelist_webhook.go rename to api/v1beta1/awsmachinetemplatelist_webhook.go index 1b6f23335b..f29cb116b8 100644 --- a/api/v1alpha4/awsmachinetemplatelist_webhook.go +++ b/api/v1beta1/awsmachinetemplatelist_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( ctrl "sigs.k8s.io/controller-runtime" diff --git a/api/v1beta1/bastion.go b/api/v1beta1/bastion.go new file mode 100644 index 0000000000..91e0f82185 --- /dev/null +++ b/api/v1beta1/bastion.go @@ -0,0 +1,63 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "fmt" + "net" + "regexp" + + "k8s.io/apimachinery/pkg/util/validation/field" +) + +var ( + sshKeyValidNameRegex = regexp.MustCompile(`^[[:graph:]]+([[:print:]]*[[:graph:]]+)*$`) +) + +// Validate will validate the bastion fields. +func (b *Bastion) Validate() []*field.Error { + var errs field.ErrorList + + if b.DisableIngressRules && len(b.AllowedCIDRBlocks) > 0 { + errs = append(errs, + field.Forbidden(field.NewPath("spec", "bastion", "allowedCIDRBlocks"), "cannot be set if spec.bastion.disableIngressRules is true"), + ) + return errs + } + + for i, cidr := range b.AllowedCIDRBlocks { + if _, _, err := net.ParseCIDR(cidr); err != nil { + errs = append(errs, + field.Invalid(field.NewPath("spec", "bastion", fmt.Sprintf("allowedCIDRBlocks[%d]", i)), cidr, "must be a valid CIDR block"), + ) + } + } + return errs +} + +func validateSSHKeyName(sshKeyName *string) field.ErrorList { + var allErrs field.ErrorList + switch { + case sshKeyName == nil: + // nil is accepted + case sshKeyName != nil && *sshKeyName == "": + // empty string is accepted + case sshKeyName != nil && !sshKeyValidNameRegex.Match([]byte(*sshKeyName)): + allErrs = append(allErrs, field.Invalid(field.NewPath("sshKeyName"), sshKeyName, "Name is invalid. Must be specified in ASCII and must not start or end in whitespace")) + } + return allErrs +} diff --git a/api/v1beta1/conditions_consts.go b/api/v1beta1/conditions_consts.go new file mode 100644 index 0000000000..005d1d7931 --- /dev/null +++ b/api/v1beta1/conditions_consts.go @@ -0,0 +1,158 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + +const ( + // PrincipalCredentialRetrievedCondition reports on whether Principal credentials could be retrieved successfully. + // A possible scenario, where retrieval is unsuccessful, is when SourcePrincipal is not authorized for assume role. + PrincipalCredentialRetrievedCondition clusterv1.ConditionType = "PrincipalCredentialRetrieved" + // PrincipalCredentialRetrievalFailedReason used when errors occur during identity credential retrieval. + PrincipalCredentialRetrievalFailedReason = "PrincipalCredentialRetrievalFailed" + // CredentialProviderBuildFailedReason used when errors occur during building providers before trying credential retrieval. + CredentialProviderBuildFailedReason = "CredentialProviderBuildFailed" + // PrincipalUsageAllowedCondition reports on whether Principal and all the nested source identities are allowed to be used in the AWSCluster namespace. + PrincipalUsageAllowedCondition clusterv1.ConditionType = "PrincipalUsageAllowed" + // PrincipalUsageUnauthorizedReason used when AWSCluster namespace is not in the identity's allowed namespaces list. + PrincipalUsageUnauthorizedReason = "PrincipalUsageUnauthorized" + // SourcePrincipalUsageUnauthorizedReason used when AWSCluster is not in the intersection of source identity allowed namespaces + // and allowed namespaces of the identities that source identity depends to. + SourcePrincipalUsageUnauthorizedReason = "SourcePrincipalUsageUnauthorized" +) + +const ( + // VpcReadyCondition reports on the successful reconciliation of a VPC. + VpcReadyCondition clusterv1.ConditionType = "VpcReady" + // VpcCreationStartedReason used when attempting to create a VPC for a managed cluster. + // Will not be applied to unmanaged clusters. + VpcCreationStartedReason = "VpcCreationStarted" + // VpcReconciliationFailedReason used when errors occur during VPC reconciliation. + VpcReconciliationFailedReason = "VpcReconciliationFailed" +) + +const ( + // SubnetsReadyCondition reports on the successful reconciliation of subnets. + SubnetsReadyCondition clusterv1.ConditionType = "SubnetsReady" + // SubnetsReconciliationFailedReason used to report failures while reconciling subnets. + SubnetsReconciliationFailedReason = "SubnetsReconciliationFailed" +) + +const ( + // InternetGatewayReadyCondition reports on the successful reconciliation of internet gateways. + // Only applicable to managed clusters. + InternetGatewayReadyCondition clusterv1.ConditionType = "InternetGatewayReady" + // InternetGatewayFailedReason used when errors occur during internet gateway reconciliation. + InternetGatewayFailedReason = "InternetGatewayFailed" +) + +const ( + // NatGatewaysReadyCondition reports successful reconciliation of NAT gateways. + // Only applicable to managed clusters. + NatGatewaysReadyCondition clusterv1.ConditionType = "NatGatewaysReady" + // NatGatewaysCreationStartedReason set once when creating new NAT gateways. + NatGatewaysCreationStartedReason = "NatGatewaysCreationStarted" + // NatGatewaysReconciliationFailedReason used when any errors occur during reconciliation of NAT gateways. + NatGatewaysReconciliationFailedReason = "NatGatewaysReconciliationFailed" +) + +const ( + // RouteTablesReadyCondition reports successful reconciliation of route tables. + // Only applicable to managed clusters. + RouteTablesReadyCondition clusterv1.ConditionType = "RouteTablesReady" + // RouteTableReconciliationFailedReason used when any errors occur during reconciliation of route tables. + RouteTableReconciliationFailedReason = "RouteTableReconciliationFailed" +) + +const ( + // SecondaryCidrsReadyCondition reports successful reconciliation of secondary CIDR blocks. + // Only applicable to managed clusters. + SecondaryCidrsReadyCondition clusterv1.ConditionType = "SecondaryCidrsReady" + // SecondaryCidrReconciliationFailedReason used when any errors occur during reconciliation of secondary CIDR blocks. + SecondaryCidrReconciliationFailedReason = "SecondaryCidrReconciliationFailed" +) + +const ( + // ClusterSecurityGroupsReadyCondition reports successful reconciliation of security groups. + ClusterSecurityGroupsReadyCondition clusterv1.ConditionType = "ClusterSecurityGroupsReady" + // ClusterSecurityGroupReconciliationFailedReason used when any errors occur during reconciliation of security groups. + ClusterSecurityGroupReconciliationFailedReason = "SecurityGroupReconciliationFailed" +) + +const ( + // BastionHostReadyCondition reports whether a bastion host is ready. Depending on the configuration, a cluster + // may not require a bastion host and this condition will be skipped. + BastionHostReadyCondition clusterv1.ConditionType = "BastionHostReady" + // BastionCreationStartedReason used when creating a new bastion host. + BastionCreationStartedReason = "BastionCreationStarted" + // BastionHostFailedReason used when an error occurs during the creation of a bastion host. + BastionHostFailedReason = "BastionHostFailed" +) + +const ( + // LoadBalancerReadyCondition reports on whether a control plane load balancer was successfully reconciled. + LoadBalancerReadyCondition clusterv1.ConditionType = "LoadBalancerReady" + // WaitForDNSNameReason used while waiting for a DNS name for the API server to be populated. + WaitForDNSNameReason = "WaitForDNSName" + // WaitForDNSNameResolveReason used while waiting for DNS name to resolve. + WaitForDNSNameResolveReason = "WaitForDNSNameResolve" + // LoadBalancerFailedReason used when an error occurs during load balancer reconciliation. + LoadBalancerFailedReason = "LoadBalancerFailed" +) + +const ( + // InstanceReadyCondition reports on current status of the EC2 instance. Ready indicates the instance is in a Running state. + InstanceReadyCondition clusterv1.ConditionType = "InstanceReady" + + // InstanceNotFoundReason used when the instance couldn't be retrieved. + InstanceNotFoundReason = "InstanceNotFound" + // InstanceTerminatedReason instance is in a terminated state. + InstanceTerminatedReason = "InstanceTerminated" + // InstanceStoppedReason instance is in a stopped state. + InstanceStoppedReason = "InstanceStopped" + // InstanceNotReadyReason used when the instance is in a pending state. + InstanceNotReadyReason = "InstanceNotReady" + // InstanceProvisionStartedReason set when the provisioning of an instance started. + InstanceProvisionStartedReason = "InstanceProvisionStarted" + // InstanceProvisionFailedReason used for failures during instance provisioning. + InstanceProvisionFailedReason = "InstanceProvisionFailed" + // WaitingForClusterInfrastructureReason used when machine is waiting for cluster infrastructure to be ready before proceeding. + WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure" + // WaitingForBootstrapDataReason used when machine is waiting for bootstrap data to be ready before proceeding. + WaitingForBootstrapDataReason = "WaitingForBootstrapData" +) + +const ( + // SecurityGroupsReadyCondition indicates the security groups are up to date on the AWSMachine. + SecurityGroupsReadyCondition clusterv1.ConditionType = "SecurityGroupsReady" + + // SecurityGroupsFailedReason used when the security groups could not be synced. + SecurityGroupsFailedReason = "SecurityGroupsSyncFailed" +) + +const ( + // ELBAttachedCondition will report true when a control plane is successfully registered with an ELB. + // When set to false, severity can be an Error if the subnet is not found or unavailable in the instance's AZ. + // Note this is only applicable to control plane machines. + // Only applicable to control plane machines. + ELBAttachedCondition clusterv1.ConditionType = "ELBAttached" + + // ELBAttachFailedReason used when a control plane node fails to attach to the ELB. + ELBAttachFailedReason = "ELBAttachFailed" + // ELBDetachFailedReason used when a control plane node fails to detach from an ELB. + ELBDetachFailedReason = "ELBDetachFailed" +) diff --git a/api/v1beta1/conversion.go b/api/v1beta1/conversion.go new file mode 100644 index 0000000000..f50a3fc354 --- /dev/null +++ b/api/v1beta1/conversion.go @@ -0,0 +1,56 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +// Hub marks AWSCluster as a conversion hub. +func (*AWSCluster) Hub() {} + +// Hub marks AWSClusterList as a conversion hub. +func (*AWSClusterList) Hub() {} + +// Hub marks AWSMachine as a conversion hub. +func (*AWSMachine) Hub() {} + +// Hub marks AWSMachineList as a conversion hub. +func (*AWSMachineList) Hub() {} + +// Hub marks AWSMachineTemplate as a conversion hub. +func (*AWSMachineTemplate) Hub() {} + +// Hub marks AWSMachineTemplateList as a conversion hub. +func (*AWSMachineTemplateList) Hub() {} + +// Hub marks AWSClusterStaticIdentity as a conversion hub. +func (*AWSClusterStaticIdentity) Hub() {} + +// Hub marks AWSClusterStaticIdentityList as a conversion hub. +func (*AWSClusterStaticIdentityList) Hub() {} + +// Hub marks AWSClusterRoleIdentity as a conversion hub. +func (*AWSClusterRoleIdentity) Hub() {} + +// Hub marks AWSClusterRoleIdentityList as a conversion hub. +func (*AWSClusterRoleIdentityList) Hub() {} + +// Hub marks AWSClusterControllerIdentity as a conversion hub. +func (*AWSClusterControllerIdentity) Hub() {} + +// Hub marks AWSClusterControllerIdentityList as a conversion hub. +func (*AWSClusterControllerIdentityList) Hub() {} + +// Hub marks AWSClusterTemplate as a conversion hub. +func (*AWSClusterTemplate) Hub() {} diff --git a/api/v1beta1/defaults.go b/api/v1beta1/defaults.go new file mode 100644 index 0000000000..6ae73172e9 --- /dev/null +++ b/api/v1beta1/defaults.go @@ -0,0 +1,71 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/cmd/clusterctl/api/v1alpha3" +) + +// SetDefaults_Bastion is used by defaulter-gen. +func SetDefaults_Bastion(obj *Bastion) { //nolint:golint,stylecheck + // Default to allow open access to the bastion host if no CIDR Blocks have been set + if len(obj.AllowedCIDRBlocks) == 0 && !obj.DisableIngressRules { + obj.AllowedCIDRBlocks = []string{"0.0.0.0/0"} + } +} + +// SetDefaults_NetworkSpec is used by defaulter-gen. +func SetDefaults_NetworkSpec(obj *NetworkSpec) { //nolint:golint,stylecheck + // Default to Calico ingress rules if no rules have been set + if obj.CNI == nil { + obj.CNI = &CNISpec{ + CNIIngressRules: CNIIngressRules{ + { + Description: "bgp (calico)", + Protocol: SecurityGroupProtocolTCP, + FromPort: 179, + ToPort: 179, + }, + { + Description: "IP-in-IP (calico)", + Protocol: SecurityGroupProtocolIPinIP, + FromPort: -1, + ToPort: 65535, + }, + }, + } + } +} + +// SetDefaults_AWSClusterSpec is used by defaulter-gen. +func SetDefaults_AWSClusterSpec(s *AWSClusterSpec) { //nolint:golint,stylecheck + if s.IdentityRef == nil { + s.IdentityRef = &AWSIdentityReference{ + Kind: ControllerIdentityKind, + Name: AWSClusterControllerIdentityName, + } + } +} + +// SetDefaults_Labels is used to default cluster scope resources for clusterctl move. +func SetDefaults_Labels(obj *metav1.ObjectMeta) { //nolint:golint,stylecheck + // Defaults to set label if no labels have been set + if obj.Labels == nil { + obj.Labels = map[string]string{ + clusterv1.ClusterctlMoveHierarchyLabelName: ""} + } +} diff --git a/cmd/clusterawsadm/api/iam/v1alpha1/defaults.go b/api/v1beta1/doc.go similarity index 73% rename from cmd/clusterawsadm/api/iam/v1alpha1/defaults.go rename to api/v1beta1/doc.go index 53e4178cd5..eb3929810b 100644 --- a/cmd/clusterawsadm/api/iam/v1alpha1/defaults.go +++ b/api/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +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. @@ -14,10 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +// +gencrdrefdocs:force +// +groupName=infrastructure.cluster.x-k8s.io -import runtime "k8s.io/apimachinery/pkg/runtime" - -func addDefaultingFuncs(scheme *runtime.Scheme) error { - return RegisterDefaults(scheme) -} +// Package v1beta1 contains the v1beta1 API implementation. +package v1beta1 diff --git a/api/v1beta1/groupversion_info.go b/api/v1beta1/groupversion_info.go new file mode 100644 index 0000000000..3715bbfa5b --- /dev/null +++ b/api/v1beta1/groupversion_info.go @@ -0,0 +1,36 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1beta1 contains API Schema definitions for the infrastructure v1beta1 API group +// +kubebuilder:object:generate=true +// +groupName=infrastructure.cluster.x-k8s.io +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects. + GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1beta1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/api/v1beta1/network_types.go b/api/v1beta1/network_types.go new file mode 100644 index 0000000000..98af1c4aed --- /dev/null +++ b/api/v1beta1/network_types.go @@ -0,0 +1,501 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "fmt" + "sort" + "time" +) + +// NetworkStatus encapsulates AWS networking resources. +type NetworkStatus struct { + // SecurityGroups is a map from the role/kind of the security group to its unique name, if any. + SecurityGroups map[SecurityGroupRole]SecurityGroup `json:"securityGroups,omitempty"` + + // APIServerELB is the Kubernetes api server classic load balancer. + APIServerELB ClassicELB `json:"apiServerElb,omitempty"` +} + +// ClassicELBScheme defines the scheme of a classic load balancer. +type ClassicELBScheme string + +var ( + // ClassicELBSchemeInternetFacing defines an internet-facing, publicly + // accessible AWS Classic ELB scheme. + ClassicELBSchemeInternetFacing = ClassicELBScheme("internet-facing") + + // ClassicELBSchemeInternal defines an internal-only facing + // load balancer internal to an ELB. + ClassicELBSchemeInternal = ClassicELBScheme("internal") +) + +func (e ClassicELBScheme) String() string { + return string(e) +} + +// ClassicELBProtocol defines listener protocols for a classic load balancer. +type ClassicELBProtocol string + +var ( + // ClassicELBProtocolTCP defines the ELB API string representing the TCP protocol. + ClassicELBProtocolTCP = ClassicELBProtocol("TCP") + + // ClassicELBProtocolSSL defines the ELB API string representing the TLS protocol. + ClassicELBProtocolSSL = ClassicELBProtocol("SSL") + + // ClassicELBProtocolHTTP defines the ELB API string representing the HTTP protocol at L7. + ClassicELBProtocolHTTP = ClassicELBProtocol("HTTP") + + // ClassicELBProtocolHTTPS defines the ELB API string representing the HTTP protocol at L7. + ClassicELBProtocolHTTPS = ClassicELBProtocol("HTTPS") +) + +// ClassicELB defines an AWS classic load balancer. +type ClassicELB struct { + // The name of the load balancer. It must be unique within the set of load balancers + // defined in the region. It also serves as identifier. + Name string `json:"name,omitempty"` + + // DNSName is the dns name of the load balancer. + DNSName string `json:"dnsName,omitempty"` + + // Scheme is the load balancer scheme, either internet-facing or private. + Scheme ClassicELBScheme `json:"scheme,omitempty"` + + // AvailabilityZones is an array of availability zones in the VPC attached to the load balancer. + AvailabilityZones []string `json:"availabilityZones,omitempty"` + + // SubnetIDs is an array of subnets in the VPC attached to the load balancer. + SubnetIDs []string `json:"subnetIds,omitempty"` + + // SecurityGroupIDs is an array of security groups assigned to the load balancer. + SecurityGroupIDs []string `json:"securityGroupIds,omitempty"` + + // Listeners is an array of classic elb listeners associated with the load balancer. There must be at least one. + Listeners []ClassicELBListener `json:"listeners,omitempty"` + + // HealthCheck is the classic elb health check associated with the load balancer. + HealthCheck *ClassicELBHealthCheck `json:"healthChecks,omitempty"` + + // Attributes defines extra attributes associated with the load balancer. + Attributes ClassicELBAttributes `json:"attributes,omitempty"` + + // Tags is a map of tags associated with the load balancer. + Tags map[string]string `json:"tags,omitempty"` +} + +// ClassicELBAttributes defines extra attributes associated with a classic load balancer. +type ClassicELBAttributes struct { + // IdleTimeout is time that the connection is allowed to be idle (no data + // has been sent over the connection) before it is closed by the load balancer. + IdleTimeout time.Duration `json:"idleTimeout,omitempty"` + + // CrossZoneLoadBalancing enables the classic load balancer load balancing. + // +optional + CrossZoneLoadBalancing bool `json:"crossZoneLoadBalancing,omitempty"` +} + +// ClassicELBListener defines an AWS classic load balancer listener. +type ClassicELBListener struct { + Protocol ClassicELBProtocol `json:"protocol"` + Port int64 `json:"port"` + InstanceProtocol ClassicELBProtocol `json:"instanceProtocol"` + InstancePort int64 `json:"instancePort"` +} + +// ClassicELBHealthCheck defines an AWS classic load balancer health check. +type ClassicELBHealthCheck struct { + Target string `json:"target"` + Interval time.Duration `json:"interval"` + Timeout time.Duration `json:"timeout"` + HealthyThreshold int64 `json:"healthyThreshold"` + UnhealthyThreshold int64 `json:"unhealthyThreshold"` +} + +// NetworkSpec encapsulates all things related to AWS network. +type NetworkSpec struct { + // VPC configuration. + // +optional + VPC VPCSpec `json:"vpc,omitempty"` + + // Subnets configuration. + // +optional + Subnets Subnets `json:"subnets,omitempty"` + + // CNI configuration + // +optional + CNI *CNISpec `json:"cni,omitempty"` + + // SecurityGroupOverrides is an optional set of security groups to use for cluster instances + // This is optional - if not provided new security groups will be created for the cluster + // +optional + SecurityGroupOverrides map[SecurityGroupRole]string `json:"securityGroupOverrides,omitempty"` +} + +// VPCSpec configures an AWS VPC. +type VPCSpec struct { + // ID is the vpc-id of the VPC this provider should use to create resources. + ID string `json:"id,omitempty"` + + // CidrBlock is the CIDR block to be used when the provider creates a managed VPC. + // Defaults to 10.0.0.0/16. + CidrBlock string `json:"cidrBlock,omitempty"` + + // InternetGatewayID is the id of the internet gateway associated with the VPC. + // +optional + InternetGatewayID *string `json:"internetGatewayId,omitempty"` + + // Tags is a collection of tags describing the resource. + Tags Tags `json:"tags,omitempty"` + + // AvailabilityZoneUsageLimit specifies the maximum number of availability zones (AZ) that + // should be used in a region when automatically creating subnets. If a region has more + // than this number of AZs then this number of AZs will be picked randomly when creating + // default subnets. Defaults to 3 + // +kubebuilder:default=3 + // +kubebuilder:validation:Minimum=1 + AvailabilityZoneUsageLimit *int `json:"availabilityZoneUsageLimit,omitempty"` + + // AvailabilityZoneSelection specifies how AZs should be selected if there are more AZs + // in a region than specified by AvailabilityZoneUsageLimit. There are 2 selection schemes: + // Ordered - selects based on alphabetical order + // Random - selects AZs randomly in a region + // Defaults to Ordered + // +kubebuilder:default=Ordered + // +kubebuilder:validation:Enum=Ordered;Random + AvailabilityZoneSelection *AZSelectionScheme `json:"availabilityZoneSelection,omitempty"` +} + +// String returns a string representation of the VPC. +func (v *VPCSpec) String() string { + return fmt.Sprintf("id=%s", v.ID) +} + +// IsUnmanaged returns true if the VPC is unmanaged. +func (v *VPCSpec) IsUnmanaged(clusterName string) bool { + return v.ID != "" && !v.Tags.HasOwned(clusterName) +} + +// IsManaged returns true if VPC is managed. +func (v *VPCSpec) IsManaged(clusterName string) bool { + return !v.IsUnmanaged(clusterName) +} + +// SubnetSpec configures an AWS Subnet. +type SubnetSpec struct { + // ID defines a unique identifier to reference this resource. + ID string `json:"id,omitempty"` + + // CidrBlock is the CIDR block to be used when the provider creates a managed VPC. + CidrBlock string `json:"cidrBlock,omitempty"` + + // AvailabilityZone defines the availability zone to use for this subnet in the cluster's region. + AvailabilityZone string `json:"availabilityZone,omitempty"` + + // IsPublic defines the subnet as a public subnet. A subnet is public when it is associated with a route table that has a route to an internet gateway. + // +optional + IsPublic bool `json:"isPublic"` + + // RouteTableID is the routing table id associated with the subnet. + // +optional + RouteTableID *string `json:"routeTableId,omitempty"` + + // NatGatewayID is the NAT gateway id associated with the subnet. + // Ignored unless the subnet is managed by the provider, in which case this is set on the public subnet where the NAT gateway resides. It is then used to determine routes for private subnets in the same AZ as the public subnet. + // +optional + NatGatewayID *string `json:"natGatewayId,omitempty"` + + // Tags is a collection of tags describing the resource. + Tags Tags `json:"tags,omitempty"` +} + +// String returns a string representation of the subnet. +func (s *SubnetSpec) String() string { + return fmt.Sprintf("id=%s/az=%s/public=%v", s.ID, s.AvailabilityZone, s.IsPublic) +} + +// Subnets is a slice of Subnet. +type Subnets []SubnetSpec + +// ToMap returns a map from id to subnet. +func (s Subnets) ToMap() map[string]*SubnetSpec { + res := make(map[string]*SubnetSpec) + for i := range s { + x := s[i] + res[x.ID] = &x + } + return res +} + +// IDs returns a slice of the subnet ids. +func (s Subnets) IDs() []string { + res := []string{} + for _, subnet := range s { + res = append(res, subnet.ID) + } + return res +} + +// FindByID returns a single subnet matching the given id or nil. +func (s Subnets) FindByID(id string) *SubnetSpec { + for _, x := range s { + if x.ID == id { + return &x + } + } + + return nil +} + +// FindEqual returns a subnet spec that is equal to the one passed in. +// Two subnets are defined equal to each other if their id is equal +// or if they are in the same vpc and the cidr block is the same. +func (s Subnets) FindEqual(spec *SubnetSpec) *SubnetSpec { + for _, x := range s { + if (spec.ID != "" && x.ID == spec.ID) || (spec.CidrBlock == x.CidrBlock) { + return &x + } + } + return nil +} + +// FilterPrivate returns a slice containing all subnets marked as private. +func (s Subnets) FilterPrivate() (res Subnets) { + for _, x := range s { + if !x.IsPublic { + res = append(res, x) + } + } + return +} + +// FilterPublic returns a slice containing all subnets marked as public. +func (s Subnets) FilterPublic() (res Subnets) { + for _, x := range s { + if x.IsPublic { + res = append(res, x) + } + } + return +} + +// FilterByZone returns a slice containing all subnets that live in the availability zone specified. +func (s Subnets) FilterByZone(zone string) (res Subnets) { + for _, x := range s { + if x.AvailabilityZone == zone { + res = append(res, x) + } + } + return +} + +// GetUniqueZones returns a slice containing the unique zones of the subnets. +func (s Subnets) GetUniqueZones() []string { + keys := make(map[string]bool) + zones := []string{} + for _, x := range s { + if _, value := keys[x.AvailabilityZone]; !value { + keys[x.AvailabilityZone] = true + zones = append(zones, x.AvailabilityZone) + } + } + return zones +} + +// CNISpec defines configuration for CNI. +type CNISpec struct { + // CNIIngressRules specify rules to apply to control plane and worker node security groups. + // The source for the rule will be set to control plane and worker security group IDs. + CNIIngressRules CNIIngressRules `json:"cniIngressRules,omitempty"` +} + +// CNIIngressRules is a slice of CNIIngressRule. +type CNIIngressRules []CNIIngressRule + +// CNIIngressRule defines an AWS ingress rule for CNI requirements. +type CNIIngressRule struct { + Description string `json:"description"` + Protocol SecurityGroupProtocol `json:"protocol"` + FromPort int64 `json:"fromPort"` + ToPort int64 `json:"toPort"` +} + +// RouteTable defines an AWS routing table. +type RouteTable struct { + ID string `json:"id"` +} + +// SecurityGroupRole defines the unique role of a security group. +type SecurityGroupRole string + +var ( + // SecurityGroupBastion defines an SSH bastion role. + SecurityGroupBastion = SecurityGroupRole("bastion") + + // SecurityGroupNode defines a Kubernetes workload node role. + SecurityGroupNode = SecurityGroupRole("node") + + // SecurityGroupEKSNodeAdditional defines an extra node group from eks nodes. + SecurityGroupEKSNodeAdditional = SecurityGroupRole("node-eks-additional") + + // SecurityGroupControlPlane defines a Kubernetes control plane node role. + SecurityGroupControlPlane = SecurityGroupRole("controlplane") + + // SecurityGroupAPIServerLB defines a Kubernetes API Server Load Balancer role. + SecurityGroupAPIServerLB = SecurityGroupRole("apiserver-lb") + + // SecurityGroupLB defines a container for the cloud provider to inject its load balancer ingress rules. + SecurityGroupLB = SecurityGroupRole("lb") +) + +// SecurityGroup defines an AWS security group. +type SecurityGroup struct { + // ID is a unique identifier. + ID string `json:"id"` + + // Name is the security group name. + Name string `json:"name"` + + // IngressRules is the inbound rules associated with the security group. + // +optional + IngressRules IngressRules `json:"ingressRule,omitempty"` + + // Tags is a map of tags associated with the security group. + Tags Tags `json:"tags,omitempty"` +} + +// String returns a string representation of the security group. +func (s *SecurityGroup) String() string { + return fmt.Sprintf("id=%s/name=%s", s.ID, s.Name) +} + +// SecurityGroupProtocol defines the protocol type for a security group rule. +type SecurityGroupProtocol string + +var ( + // SecurityGroupProtocolAll is a wildcard for all IP protocols. + SecurityGroupProtocolAll = SecurityGroupProtocol("-1") + + // SecurityGroupProtocolIPinIP represents the IP in IP protocol in ingress rules. + SecurityGroupProtocolIPinIP = SecurityGroupProtocol("4") + + // SecurityGroupProtocolTCP represents the TCP protocol in ingress rules. + SecurityGroupProtocolTCP = SecurityGroupProtocol("tcp") + + // SecurityGroupProtocolUDP represents the UDP protocol in ingress rules. + SecurityGroupProtocolUDP = SecurityGroupProtocol("udp") + + // SecurityGroupProtocolICMP represents the ICMP protocol in ingress rules. + SecurityGroupProtocolICMP = SecurityGroupProtocol("icmp") + + // SecurityGroupProtocolICMPv6 represents the ICMPv6 protocol in ingress rules. + SecurityGroupProtocolICMPv6 = SecurityGroupProtocol("58") +) + +// IngressRule defines an AWS ingress rule for security groups. +type IngressRule struct { + Description string `json:"description"` + Protocol SecurityGroupProtocol `json:"protocol"` + FromPort int64 `json:"fromPort"` + ToPort int64 `json:"toPort"` + + // List of CIDR blocks to allow access from. Cannot be specified with SourceSecurityGroupID. + // +optional + CidrBlocks []string `json:"cidrBlocks,omitempty"` + + // The security group id to allow access from. Cannot be specified with CidrBlocks. + // +optional + SourceSecurityGroupIDs []string `json:"sourceSecurityGroupIds,omitempty"` +} + +// String returns a string representation of the ingress rule. +func (i *IngressRule) String() string { + return fmt.Sprintf("protocol=%s/range=[%d-%d]/description=%s", i.Protocol, i.FromPort, i.ToPort, i.Description) +} + +// IngressRules is a slice of AWS ingress rules for security groups. +type IngressRules []IngressRule + +// Difference returns the difference between this slice and the other slice. +func (i IngressRules) Difference(o IngressRules) (out IngressRules) { + for index := range i { + x := i[index] + found := false + for oIndex := range o { + y := o[oIndex] + if x.Equals(&y) { + found = true + break + } + } + + if !found { + out = append(out, x) + } + } + + return +} + +// Equals returns true if two IngressRule are equal. +func (i *IngressRule) Equals(o *IngressRule) bool { + if len(i.CidrBlocks) != len(o.CidrBlocks) { + return false + } + + sort.Strings(i.CidrBlocks) + sort.Strings(o.CidrBlocks) + + for i, v := range i.CidrBlocks { + if v != o.CidrBlocks[i] { + return false + } + } + + if len(i.SourceSecurityGroupIDs) != len(o.SourceSecurityGroupIDs) { + return false + } + + sort.Strings(i.SourceSecurityGroupIDs) + sort.Strings(o.SourceSecurityGroupIDs) + + for i, v := range i.SourceSecurityGroupIDs { + if v != o.SourceSecurityGroupIDs[i] { + return false + } + } + + if i.Description != o.Description || i.Protocol != o.Protocol { + return false + } + + // AWS seems to ignore the From/To port when set on protocols where it doesn't apply, but + // we avoid serializing it out for clarity's sake. + // See: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IpPermission.html + switch i.Protocol { + case SecurityGroupProtocolTCP, + SecurityGroupProtocolUDP, + SecurityGroupProtocolICMP, + SecurityGroupProtocolICMPv6: + return i.FromPort == o.FromPort && i.ToPort == o.ToPort + case SecurityGroupProtocolAll, SecurityGroupProtocolIPinIP: + // FromPort / ToPort are not applicable + } + + return true +} diff --git a/api/v1beta1/network_types_test.go b/api/v1beta1/network_types_test.go new file mode 100644 index 0000000000..293a791d31 --- /dev/null +++ b/api/v1beta1/network_types_test.go @@ -0,0 +1,107 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "testing" + + . "github.com/onsi/gomega" +) + +func TestSG_Difference(t *testing.T) { + tests := []struct { + name string + self IngressRules + input IngressRules + expected IngressRules + }{ + { + name: "self and input are nil", + self: nil, + input: nil, + expected: nil, + }, + { + name: "input is nil", + self: IngressRules{ + { + Description: "SSH", + Protocol: SecurityGroupProtocolTCP, + FromPort: 22, + ToPort: 22, + SourceSecurityGroupIDs: []string{"sg-source-1"}, + }, + }, + input: nil, + expected: IngressRules{ + { + Description: "SSH", + Protocol: SecurityGroupProtocolTCP, + FromPort: 22, + ToPort: 22, + SourceSecurityGroupIDs: []string{"sg-source-1"}, + }, + }, + }, + { + name: "self has more rules", + self: IngressRules{ + { + Description: "SSH", + Protocol: SecurityGroupProtocolTCP, + FromPort: 22, + ToPort: 22, + SourceSecurityGroupIDs: []string{"sg-source-1"}, + }, + { + Description: "MY-SSH", + Protocol: SecurityGroupProtocolTCP, + FromPort: 22, + ToPort: 22, + CidrBlocks: []string{"0.0.0.0/0"}, + }, + }, + input: IngressRules{ + { + Description: "SSH", + Protocol: SecurityGroupProtocolTCP, + FromPort: 22, + ToPort: 22, + SourceSecurityGroupIDs: []string{"sg-source-1"}, + }, + }, + expected: IngressRules{ + { + Description: "MY-SSH", + Protocol: SecurityGroupProtocolTCP, + FromPort: 22, + ToPort: 22, + CidrBlocks: []string{"0.0.0.0/0"}, + }, + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + g := NewGomegaWithT(t) + out := tc.self.Difference(tc.input) + + g.Expect(out).To(Equal(tc.expected)) + }) + } +} diff --git a/api/v1alpha4/sshkeyname_test.go b/api/v1beta1/sshkeyname_test.go similarity index 99% rename from api/v1alpha4/sshkeyname_test.go rename to api/v1beta1/sshkeyname_test.go index 30e59e61dd..1aa581ff74 100644 --- a/api/v1alpha4/sshkeyname_test.go +++ b/api/v1beta1/sshkeyname_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "context" diff --git a/api/v1alpha4/suite_test.go b/api/v1beta1/suite_test.go similarity index 99% rename from api/v1alpha4/suite_test.go rename to api/v1beta1/suite_test.go index 6c7e765ea3..9645c428b9 100644 --- a/api/v1alpha4/suite_test.go +++ b/api/v1beta1/suite_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "fmt" diff --git a/api/v1beta1/tags.go b/api/v1beta1/tags.go new file mode 100644 index 0000000000..84e64ea171 --- /dev/null +++ b/api/v1beta1/tags.go @@ -0,0 +1,203 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "fmt" + "reflect" + + "k8s.io/apimachinery/pkg/types" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" +) + +// Tags defines a map of tags. +type Tags map[string]string + +// Equals returns true if the tags are equal. +func (t Tags) Equals(other Tags) bool { + return reflect.DeepEqual(t, other) +} + +// HasOwned returns true if the tags contains a tag that marks the resource as owned by the cluster from the perspective of this management tooling. +func (t Tags) HasOwned(cluster string) bool { + value, ok := t[ClusterTagKey(cluster)] + return ok && ResourceLifecycle(value) == ResourceLifecycleOwned +} + +// HasAWSCloudProviderOwned returns true if the tags contains a tag that marks the resource as owned by the cluster from the perspective of the in-tree cloud provider. +func (t Tags) HasAWSCloudProviderOwned(cluster string) bool { + value, ok := t[ClusterAWSCloudProviderTagKey(cluster)] + return ok && ResourceLifecycle(value) == ResourceLifecycleOwned +} + +// GetRole returns the Cluster API role for the tagged resource. +func (t Tags) GetRole() string { + return t[NameAWSClusterAPIRole] +} + +// Difference returns the difference between this map of tags and the other map of tags. +// Items are considered equals if key and value are equals. +func (t Tags) Difference(other Tags) Tags { + res := make(Tags, len(t)) + + for key, value := range t { + if otherValue, ok := other[key]; ok && value == otherValue { + continue + } + res[key] = value + } + + return res +} + +// Merge merges in tags from other. If a tag already exists, it is replaced by the tag in other. +func (t Tags) Merge(other Tags) { + for k, v := range other { + t[k] = v + } +} + +// ResourceLifecycle configures the lifecycle of a resource. +type ResourceLifecycle string + +const ( + // ResourceLifecycleOwned is the value we use when tagging resources to indicate + // that the resource is considered owned and managed by the cluster, + // and in particular that the lifecycle is tied to the lifecycle of the cluster. + ResourceLifecycleOwned = ResourceLifecycle("owned") + + // ResourceLifecycleShared is the value we use when tagging resources to indicate + // that the resource is shared between multiple clusters, and should not be destroyed + // if the cluster is destroyed. + ResourceLifecycleShared = ResourceLifecycle("shared") + + // NameKubernetesAWSCloudProviderPrefix is the tag name used by the cloud provider to logically + // separate independent cluster resources. We use it to identify which resources we expect + // to be permissive about state changes. + // logically independent clusters running in the same AZ. + // The tag key = NameKubernetesAWSCloudProviderPrefix + clusterID + // The tag value is an ownership value. + NameKubernetesAWSCloudProviderPrefix = "kubernetes.io/cluster/" + + // NameAWSProviderPrefix is the tag prefix we use to differentiate + // cluster-api-provider-aws owned components from other tooling that + // uses NameKubernetesClusterPrefix. + NameAWSProviderPrefix = "sigs.k8s.io/cluster-api-provider-aws/" + + // NameAWSProviderOwned is the tag name we use to differentiate + // cluster-api-provider-aws owned components from other tooling that + // uses NameKubernetesClusterPrefix. + NameAWSProviderOwned = NameAWSProviderPrefix + "cluster/" + + // NameAWSClusterAPIRole is the tag name we use to mark roles for resources + // dedicated to this cluster api provider implementation. + NameAWSClusterAPIRole = NameAWSProviderPrefix + "role" + + // NameAWSSubnetAssociation is the tag name we use to mark association for resources + // dedicated to this cluster api provider implementation. + NameAWSSubnetAssociation = NameAWSProviderPrefix + "association" + + // SecondarySubnetTagValue is the secondary subnet tag constant value. + SecondarySubnetTagValue = "secondary" + + // APIServerRoleTagValue describes the value for the apiserver role. + APIServerRoleTagValue = "apiserver" + + // BastionRoleTagValue describes the value for the bastion role. + BastionRoleTagValue = "bastion" + + // CommonRoleTagValue describes the value for the common role. + CommonRoleTagValue = "common" + + // PublicRoleTagValue describes the value for the public role. + PublicRoleTagValue = "public" + + // PrivateRoleTagValue describes the value for the private role. + PrivateRoleTagValue = "private" + + // MachineNameTagKey is the key for machine name. + MachineNameTagKey = "MachineName" +) + +// ClusterTagKey generates the key for resources associated with a cluster. +func ClusterTagKey(name string) string { + return fmt.Sprintf("%s%s", NameAWSProviderOwned, name) +} + +// ClusterAWSCloudProviderTagKey generates the key for resources associated a cluster's AWS cloud provider. +func ClusterAWSCloudProviderTagKey(name string) string { + return fmt.Sprintf("%s%s", NameKubernetesAWSCloudProviderPrefix, name) +} + +// BuildParams is used to build tags around an aws resource. +type BuildParams struct { + // Lifecycle determines the resource lifecycle. + Lifecycle ResourceLifecycle + + // ClusterName is the cluster associated with the resource. + ClusterName string + + // ResourceID is the unique identifier of the resource to be tagged. + ResourceID string + + // Name is the name of the resource, it's applied as the tag "Name" on AWS. + // +optional + Name *string + + // Role is the role associated to the resource. + // +optional + Role *string + + // Any additional tags to be added to the resource. + // +optional + Additional Tags +} + +// WithMachineName tags the namespaced machine name +// The machine name will be tagged with key "MachineName". +func (b BuildParams) WithMachineName(m *clusterv1.Machine) BuildParams { + machineNamespacedName := types.NamespacedName{Namespace: m.Namespace, Name: m.Name} + b.Additional[MachineNameTagKey] = machineNamespacedName.String() + return b +} + +// WithCloudProvider tags the cluster ownership for a resource. +func (b BuildParams) WithCloudProvider(name string) BuildParams { + b.Additional[ClusterAWSCloudProviderTagKey(name)] = string(ResourceLifecycleOwned) + return b +} + +// Build builds tags including the cluster tag and returns them in map form. +func Build(params BuildParams) Tags { + tags := make(Tags) + for k, v := range params.Additional { + tags[k] = v + } + + if params.ClusterName != "" { + tags[ClusterTagKey(params.ClusterName)] = string(params.Lifecycle) + } + if params.Role != nil { + tags[NameAWSClusterAPIRole] = *params.Role + } + + if params.Name != nil { + tags["Name"] = *params.Name + } + + return tags +} diff --git a/api/v1beta1/tags_test.go b/api/v1beta1/tags_test.go new file mode 100644 index 0000000000..d7480b5b55 --- /dev/null +++ b/api/v1beta1/tags_test.go @@ -0,0 +1,163 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "reflect" + "testing" +) + +func TestTags_Merge(t *testing.T) { + tests := []struct { + name string + other Tags + expected Tags + }{ + { + name: "nil other", + other: nil, + expected: Tags{ + "a": "b", + "c": "d", + }, + }, + { + name: "empty other", + other: Tags{}, + expected: Tags{ + "a": "b", + "c": "d", + }, + }, + { + name: "disjoint", + other: Tags{ + "1": "2", + "3": "4", + }, + expected: Tags{ + "a": "b", + "c": "d", + "1": "2", + "3": "4", + }, + }, + { + name: "overlapping, other wins", + other: Tags{ + "1": "2", + "3": "4", + "a": "hello", + }, + expected: Tags{ + "a": "hello", + "c": "d", + "1": "2", + "3": "4", + }, + }, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + tags := Tags{ + "a": "b", + "c": "d", + } + + tags.Merge(tc.other) + if e, a := tc.expected, tags; !reflect.DeepEqual(e, a) { + t.Errorf("expected %#v, got %#v", e, a) + } + }) + } +} + +func TestTags_Difference(t *testing.T) { + tests := []struct { + name string + self Tags + input Tags + expected Tags + }{ + { + name: "self and input are nil", + self: nil, + input: nil, + expected: Tags{}, + }, + { + name: "input is nil", + self: Tags{ + "a": "b", + "c": "d", + }, + input: nil, + expected: Tags{ + "a": "b", + "c": "d", + }, + }, + { + name: "similar input", + self: Tags{ + "a": "b", + "c": "d", + }, + input: Tags{ + "a": "b", + "c": "d", + }, + expected: Tags{}, + }, + { + name: "input with extra tags", + self: Tags{ + "a": "b", + "c": "d", + }, + input: Tags{ + "a": "b", + "c": "d", + "e": "f", + }, + expected: Tags{}, + }, + { + name: "same keys, different values", + self: Tags{ + "a": "b", + "c": "d", + }, + input: Tags{ + "a": "b1", + "c": "d", + "e": "f", + }, + expected: Tags{ + "a": "b", + }, + }, + } + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + out := tc.self.Difference(tc.input) + if e, a := tc.expected, out; !reflect.DeepEqual(e, a) { + t.Errorf("expected %#v, got %#v", e, a) + } + }) + } +} diff --git a/api/v1beta1/types.go b/api/v1beta1/types.go new file mode 100644 index 0000000000..45ade1c614 --- /dev/null +++ b/api/v1beta1/types.go @@ -0,0 +1,291 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/util/sets" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" +) + +// AWSResourceReference is a reference to a specific AWS resource by ID, ARN, or filters. +// Only one of ID, ARN or Filters may be specified. Specifying more than one will result in +// a validation error. +type AWSResourceReference struct { + // ID of resource + // +optional + ID *string `json:"id,omitempty"` + + // ARN of resource + // +optional + ARN *string `json:"arn,omitempty"` + + // Filters is a set of key/value pairs used to identify a resource + // They are applied according to the rules defined by the AWS API: + // https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html + // +optional + Filters []Filter `json:"filters,omitempty"` +} + +// AMIReference is a reference to a specific AWS resource by ID, ARN, or filters. +// Only one of ID, ARN or Filters may be specified. Specifying more than one will result in +// a validation error. +type AMIReference struct { + // ID of resource + // +optional + ID *string `json:"id,omitempty"` + + // EKSOptimizedLookupType If specified, will look up an EKS Optimized image in SSM Parameter store + // +kubebuilder:validation:Enum:=AmazonLinux;AmazonLinuxGPU + // +optional + EKSOptimizedLookupType *EKSAMILookupType `json:"eksLookupType,omitempty"` +} + +// Filter is a filter used to identify an AWS resource. +type Filter struct { + // Name of the filter. Filter names are case-sensitive. + Name string `json:"name"` + + // Values includes one or more filter values. Filter values are case-sensitive. + Values []string `json:"values"` +} + +// AWSMachineProviderConditionType is a valid value for AWSMachineProviderCondition.Type. +type AWSMachineProviderConditionType string + +// Valid conditions for an AWS machine instance. +const ( + // MachineCreated indicates whether the machine has been created or not. If not, + // it should include a reason and message for the failure. + MachineCreated AWSMachineProviderConditionType = "MachineCreated" +) + +// AZSelectionScheme defines the scheme of selecting AZs. +type AZSelectionScheme string + +var ( + // AZSelectionSchemeOrdered will select AZs based on alphabetical order. + AZSelectionSchemeOrdered = AZSelectionScheme("Ordered") + + // AZSelectionSchemeRandom will select AZs randomly. + AZSelectionSchemeRandom = AZSelectionScheme("Random") +) + +// InstanceState describes the state of an AWS instance. +type InstanceState string + +var ( + // InstanceStatePending is the string representing an instance in a pending state. + InstanceStatePending = InstanceState("pending") + + // InstanceStateRunning is the string representing an instance in a running state. + InstanceStateRunning = InstanceState("running") + + // InstanceStateShuttingDown is the string representing an instance shutting down. + InstanceStateShuttingDown = InstanceState("shutting-down") + + // InstanceStateTerminated is the string representing an instance that has been terminated. + InstanceStateTerminated = InstanceState("terminated") + + // InstanceStateStopping is the string representing an instance + // that is in the process of being stopped and can be restarted. + InstanceStateStopping = InstanceState("stopping") + + // InstanceStateStopped is the string representing an instance + // that has been stopped and can be restarted. + InstanceStateStopped = InstanceState("stopped") + + // InstanceRunningStates defines the set of states in which an EC2 instance is + // running or going to be running soon. + InstanceRunningStates = sets.NewString( + string(InstanceStatePending), + string(InstanceStateRunning), + ) + + // InstanceOperationalStates defines the set of states in which an EC2 instance is + // or can return to running, and supports all EC2 operations. + InstanceOperationalStates = InstanceRunningStates.Union( + sets.NewString( + string(InstanceStateStopping), + string(InstanceStateStopped), + ), + ) + + // InstanceKnownStates represents all known EC2 instance states. + InstanceKnownStates = InstanceOperationalStates.Union( + sets.NewString( + string(InstanceStateShuttingDown), + string(InstanceStateTerminated), + ), + ) +) + +// Instance describes an AWS instance. +type Instance struct { + ID string `json:"id"` + + // The current state of the instance. + State InstanceState `json:"instanceState,omitempty"` + + // The instance type. + Type string `json:"type,omitempty"` + + // The ID of the subnet of the instance. + SubnetID string `json:"subnetId,omitempty"` + + // The ID of the AMI used to launch the instance. + ImageID string `json:"imageId,omitempty"` + + // The name of the SSH key pair. + SSHKeyName *string `json:"sshKeyName,omitempty"` + + // SecurityGroupIDs are one or more security group IDs this instance belongs to. + SecurityGroupIDs []string `json:"securityGroupIds,omitempty"` + + // UserData is the raw data script passed to the instance which is run upon bootstrap. + // This field must not be base64 encoded and should only be used when running a new instance. + UserData *string `json:"userData,omitempty"` + + // The name of the IAM instance profile associated with the instance, if applicable. + IAMProfile string `json:"iamProfile,omitempty"` + + // Addresses contains the AWS instance associated addresses. + Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"` + + // The private IPv4 address assigned to the instance. + PrivateIP *string `json:"privateIp,omitempty"` + + // The public IPv4 address assigned to the instance, if applicable. + PublicIP *string `json:"publicIp,omitempty"` + + // Specifies whether enhanced networking with ENA is enabled. + ENASupport *bool `json:"enaSupport,omitempty"` + + // Indicates whether the instance is optimized for Amazon EBS I/O. + EBSOptimized *bool `json:"ebsOptimized,omitempty"` + + // Configuration options for the root storage volume. + // +optional + RootVolume *Volume `json:"rootVolume,omitempty"` + + // Configuration options for the non root storage volumes. + // +optional + NonRootVolumes []Volume `json:"nonRootVolumes,omitempty"` + + // Specifies ENIs attached to instance + NetworkInterfaces []string `json:"networkInterfaces,omitempty"` + + // The tags associated with the instance. + Tags map[string]string `json:"tags,omitempty"` + + // Availability zone of instance + AvailabilityZone string `json:"availabilityZone,omitempty"` + + // SpotMarketOptions option for configuring instances to be run using AWS Spot instances. + SpotMarketOptions *SpotMarketOptions `json:"spotMarketOptions,omitempty"` + + // Tenancy indicates if instance should run on shared or single-tenant hardware. + // +optional + Tenancy string `json:"tenancy,omitempty"` + + // IDs of the instance's volumes + // +optional + VolumeIDs []string `json:"volumeIDs,omitempty"` +} + +// Volume encapsulates the configuration options for the storage device. +type Volume struct { + // Device name + // +optional + DeviceName string `json:"deviceName,omitempty"` + + // Size specifies size (in Gi) of the storage device. + // Must be greater than the image snapshot size or 8 (whichever is greater). + // +kubebuilder:validation:Minimum=8 + Size int64 `json:"size"` + + // Type is the type of the volume (e.g. gp2, io1, etc...). + // +optional + Type VolumeType `json:"type,omitempty"` + + // IOPS is the number of IOPS requested for the disk. Not applicable to all types. + // +optional + IOPS int64 `json:"iops,omitempty"` + + // Throughput to provision in MiB/s supported for the volume type. Not applicable to all types. + // +optional + Throughput *int64 `json:"throughput,omitempty"` + + // Encrypted is whether the volume should be encrypted or not. + // +optional + Encrypted *bool `json:"encrypted,omitempty"` + + // EncryptionKey is the KMS key to use to encrypt the volume. Can be either a KMS key ID or ARN. + // If Encrypted is set and this is omitted, the default AWS key will be used. + // The key must already exist and be accessible by the controller. + // +optional + EncryptionKey string `json:"encryptionKey,omitempty"` +} + +// VolumeType describes the EBS volume type. +// See: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html +type VolumeType string + +var ( + // VolumeTypeIO1 is the string representing a provisioned iops ssd io1 volume. + VolumeTypeIO1 = VolumeType("io1") + + // VolumeTypeIO2 is the string representing a provisioned iops ssd io2 volume. + VolumeTypeIO2 = VolumeType("io2") + + // VolumeTypeGP2 is the string representing a general purpose ssd gp2 volume. + VolumeTypeGP2 = VolumeType("gp2") + + // VolumeTypeGP3 is the string representing a general purpose ssd gp3 volume. + VolumeTypeGP3 = VolumeType("gp3") + + // VolumeTypesGP are volume types provisioned for general purpose io. + VolumeTypesGP = sets.NewString( + string(VolumeTypeIO1), + string(VolumeTypeIO2), + ) + + // VolumeTypesProvisioned are volume types provisioned for high performance io. + VolumeTypesProvisioned = sets.NewString( + string(VolumeTypeIO1), + string(VolumeTypeIO2), + ) +) + +// SpotMarketOptions defines the options available to a user when configuring +// Machines to run on Spot instances. +// Most users should provide an empty struct. +type SpotMarketOptions struct { + // MaxPrice defines the maximum price the user is willing to pay for Spot VM instances + // +optional + // +kubebuilder:validation:pattern="^[0-9]+(\.[0-9]+)?$" + MaxPrice *string `json:"maxPrice,omitempty"` +} + +// EKSAMILookupType specifies which AWS AMI to use for a AWSMachine and AWSMachinePool. +type EKSAMILookupType string + +const ( + // AmazonLinux is the default AMI type. + AmazonLinux EKSAMILookupType = "AmazonLinux" + // AmazonLinuxGPU is the AmazonLinux GPU AMI type. + AmazonLinuxGPU EKSAMILookupType = "AmazonLinuxGPU" +) diff --git a/api/v1alpha4/webhooks.go b/api/v1beta1/webhooks.go similarity index 98% rename from api/v1alpha4/webhooks.go rename to api/v1beta1/webhooks.go index ca0a158e6f..ba5c490737 100644 --- a/api/v1alpha4/webhooks.go +++ b/api/v1beta1/webhooks.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( apierrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/api/v1beta1/zz_generated.deepcopy.go b/api/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..3a409090a5 --- /dev/null +++ b/api/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,1550 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime" + apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" + "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 *AMIReference) DeepCopyInto(out *AMIReference) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.EKSOptimizedLookupType != nil { + in, out := &in.EKSOptimizedLookupType, &out.EKSOptimizedLookupType + *out = new(EKSAMILookupType) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AMIReference. +func (in *AMIReference) DeepCopy() *AMIReference { + if in == nil { + return nil + } + out := new(AMIReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSCluster) DeepCopyInto(out *AWSCluster) { + *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 AWSCluster. +func (in *AWSCluster) DeepCopy() *AWSCluster { + if in == nil { + return nil + } + out := new(AWSCluster) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSCluster) 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 *AWSClusterControllerIdentity) DeepCopyInto(out *AWSClusterControllerIdentity) { + *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 AWSClusterControllerIdentity. +func (in *AWSClusterControllerIdentity) DeepCopy() *AWSClusterControllerIdentity { + if in == nil { + return nil + } + out := new(AWSClusterControllerIdentity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterControllerIdentity) 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 *AWSClusterControllerIdentityList) DeepCopyInto(out *AWSClusterControllerIdentityList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSClusterControllerIdentity, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterControllerIdentityList. +func (in *AWSClusterControllerIdentityList) DeepCopy() *AWSClusterControllerIdentityList { + if in == nil { + return nil + } + out := new(AWSClusterControllerIdentityList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterControllerIdentityList) 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 *AWSClusterControllerIdentitySpec) DeepCopyInto(out *AWSClusterControllerIdentitySpec) { + *out = *in + in.AWSClusterIdentitySpec.DeepCopyInto(&out.AWSClusterIdentitySpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterControllerIdentitySpec. +func (in *AWSClusterControllerIdentitySpec) DeepCopy() *AWSClusterControllerIdentitySpec { + if in == nil { + return nil + } + out := new(AWSClusterControllerIdentitySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterIdentitySpec) DeepCopyInto(out *AWSClusterIdentitySpec) { + *out = *in + if in.AllowedNamespaces != nil { + in, out := &in.AllowedNamespaces, &out.AllowedNamespaces + *out = new(AllowedNamespaces) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterIdentitySpec. +func (in *AWSClusterIdentitySpec) DeepCopy() *AWSClusterIdentitySpec { + if in == nil { + return nil + } + out := new(AWSClusterIdentitySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterList) DeepCopyInto(out *AWSClusterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSCluster, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterList. +func (in *AWSClusterList) DeepCopy() *AWSClusterList { + if in == nil { + return nil + } + out := new(AWSClusterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterList) 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 *AWSClusterRoleIdentity) DeepCopyInto(out *AWSClusterRoleIdentity) { + *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 AWSClusterRoleIdentity. +func (in *AWSClusterRoleIdentity) DeepCopy() *AWSClusterRoleIdentity { + if in == nil { + return nil + } + out := new(AWSClusterRoleIdentity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterRoleIdentity) 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 *AWSClusterRoleIdentityList) DeepCopyInto(out *AWSClusterRoleIdentityList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSClusterRoleIdentity, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterRoleIdentityList. +func (in *AWSClusterRoleIdentityList) DeepCopy() *AWSClusterRoleIdentityList { + if in == nil { + return nil + } + out := new(AWSClusterRoleIdentityList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterRoleIdentityList) 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 *AWSClusterRoleIdentitySpec) DeepCopyInto(out *AWSClusterRoleIdentitySpec) { + *out = *in + in.AWSClusterIdentitySpec.DeepCopyInto(&out.AWSClusterIdentitySpec) + in.AWSRoleSpec.DeepCopyInto(&out.AWSRoleSpec) + if in.SourceIdentityRef != nil { + in, out := &in.SourceIdentityRef, &out.SourceIdentityRef + *out = new(AWSIdentityReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterRoleIdentitySpec. +func (in *AWSClusterRoleIdentitySpec) DeepCopy() *AWSClusterRoleIdentitySpec { + if in == nil { + return nil + } + out := new(AWSClusterRoleIdentitySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterSpec) DeepCopyInto(out *AWSClusterSpec) { + *out = *in + in.NetworkSpec.DeepCopyInto(&out.NetworkSpec) + if in.SSHKeyName != nil { + in, out := &in.SSHKeyName, &out.SSHKeyName + *out = new(string) + **out = **in + } + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint + if in.AdditionalTags != nil { + in, out := &in.AdditionalTags, &out.AdditionalTags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.ControlPlaneLoadBalancer != nil { + in, out := &in.ControlPlaneLoadBalancer, &out.ControlPlaneLoadBalancer + *out = new(AWSLoadBalancerSpec) + (*in).DeepCopyInto(*out) + } + in.Bastion.DeepCopyInto(&out.Bastion) + if in.IdentityRef != nil { + in, out := &in.IdentityRef, &out.IdentityRef + *out = new(AWSIdentityReference) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterSpec. +func (in *AWSClusterSpec) DeepCopy() *AWSClusterSpec { + if in == nil { + return nil + } + out := new(AWSClusterSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterStaticIdentity) DeepCopyInto(out *AWSClusterStaticIdentity) { + *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 AWSClusterStaticIdentity. +func (in *AWSClusterStaticIdentity) DeepCopy() *AWSClusterStaticIdentity { + if in == nil { + return nil + } + out := new(AWSClusterStaticIdentity) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterStaticIdentity) 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 *AWSClusterStaticIdentityList) DeepCopyInto(out *AWSClusterStaticIdentityList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSClusterStaticIdentity, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterStaticIdentityList. +func (in *AWSClusterStaticIdentityList) DeepCopy() *AWSClusterStaticIdentityList { + if in == nil { + return nil + } + out := new(AWSClusterStaticIdentityList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterStaticIdentityList) 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 *AWSClusterStaticIdentitySpec) DeepCopyInto(out *AWSClusterStaticIdentitySpec) { + *out = *in + in.AWSClusterIdentitySpec.DeepCopyInto(&out.AWSClusterIdentitySpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterStaticIdentitySpec. +func (in *AWSClusterStaticIdentitySpec) DeepCopy() *AWSClusterStaticIdentitySpec { + if in == nil { + return nil + } + out := new(AWSClusterStaticIdentitySpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterStatus) DeepCopyInto(out *AWSClusterStatus) { + *out = *in + in.Network.DeepCopyInto(&out.Network) + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make(apiv1beta1.FailureDomains, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Bastion != nil { + in, out := &in.Bastion, &out.Bastion + *out = new(Instance) + (*in).DeepCopyInto(*out) + } + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(apiv1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterStatus. +func (in *AWSClusterStatus) DeepCopy() *AWSClusterStatus { + if in == nil { + return nil + } + out := new(AWSClusterStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterTemplate) DeepCopyInto(out *AWSClusterTemplate) { + *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 AWSClusterTemplate. +func (in *AWSClusterTemplate) DeepCopy() *AWSClusterTemplate { + if in == nil { + return nil + } + out := new(AWSClusterTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterTemplate) 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 *AWSClusterTemplateList) DeepCopyInto(out *AWSClusterTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSClusterTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterTemplateList. +func (in *AWSClusterTemplateList) DeepCopy() *AWSClusterTemplateList { + if in == nil { + return nil + } + out := new(AWSClusterTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSClusterTemplateList) 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 *AWSClusterTemplateResource) DeepCopyInto(out *AWSClusterTemplateResource) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterTemplateResource. +func (in *AWSClusterTemplateResource) DeepCopy() *AWSClusterTemplateResource { + if in == nil { + return nil + } + out := new(AWSClusterTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSClusterTemplateSpec) DeepCopyInto(out *AWSClusterTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSClusterTemplateSpec. +func (in *AWSClusterTemplateSpec) DeepCopy() *AWSClusterTemplateSpec { + if in == nil { + return nil + } + out := new(AWSClusterTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSIdentityReference) DeepCopyInto(out *AWSIdentityReference) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSIdentityReference. +func (in *AWSIdentityReference) DeepCopy() *AWSIdentityReference { + if in == nil { + return nil + } + out := new(AWSIdentityReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSLoadBalancerSpec) DeepCopyInto(out *AWSLoadBalancerSpec) { + *out = *in + if in.Scheme != nil { + in, out := &in.Scheme, &out.Scheme + *out = new(ClassicELBScheme) + **out = **in + } + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AdditionalSecurityGroups != nil { + in, out := &in.AdditionalSecurityGroups, &out.AdditionalSecurityGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSLoadBalancerSpec. +func (in *AWSLoadBalancerSpec) DeepCopy() *AWSLoadBalancerSpec { + if in == nil { + return nil + } + out := new(AWSLoadBalancerSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachine) DeepCopyInto(out *AWSMachine) { + *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 AWSMachine. +func (in *AWSMachine) DeepCopy() *AWSMachine { + if in == nil { + return nil + } + out := new(AWSMachine) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSMachine) 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 *AWSMachineList) DeepCopyInto(out *AWSMachineList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSMachine, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineList. +func (in *AWSMachineList) DeepCopy() *AWSMachineList { + if in == nil { + return nil + } + out := new(AWSMachineList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSMachineList) 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 *AWSMachineSpec) DeepCopyInto(out *AWSMachineSpec) { + *out = *in + if in.ProviderID != nil { + in, out := &in.ProviderID, &out.ProviderID + *out = new(string) + **out = **in + } + if in.InstanceID != nil { + in, out := &in.InstanceID, &out.InstanceID + *out = new(string) + **out = **in + } + in.AMI.DeepCopyInto(&out.AMI) + if in.AdditionalTags != nil { + in, out := &in.AdditionalTags, &out.AdditionalTags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PublicIP != nil { + in, out := &in.PublicIP, &out.PublicIP + *out = new(bool) + **out = **in + } + if in.AdditionalSecurityGroups != nil { + in, out := &in.AdditionalSecurityGroups, &out.AdditionalSecurityGroups + *out = make([]AWSResourceReference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.FailureDomain != nil { + in, out := &in.FailureDomain, &out.FailureDomain + *out = new(string) + **out = **in + } + if in.Subnet != nil { + in, out := &in.Subnet, &out.Subnet + *out = new(AWSResourceReference) + (*in).DeepCopyInto(*out) + } + if in.SSHKeyName != nil { + in, out := &in.SSHKeyName, &out.SSHKeyName + *out = new(string) + **out = **in + } + if in.RootVolume != nil { + in, out := &in.RootVolume, &out.RootVolume + *out = new(Volume) + (*in).DeepCopyInto(*out) + } + if in.NonRootVolumes != nil { + in, out := &in.NonRootVolumes, &out.NonRootVolumes + *out = make([]Volume, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.NetworkInterfaces != nil { + in, out := &in.NetworkInterfaces, &out.NetworkInterfaces + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.UncompressedUserData != nil { + in, out := &in.UncompressedUserData, &out.UncompressedUserData + *out = new(bool) + **out = **in + } + out.CloudInit = in.CloudInit + if in.SpotMarketOptions != nil { + in, out := &in.SpotMarketOptions, &out.SpotMarketOptions + *out = new(SpotMarketOptions) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineSpec. +func (in *AWSMachineSpec) DeepCopy() *AWSMachineSpec { + if in == nil { + return nil + } + out := new(AWSMachineSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachineStatus) DeepCopyInto(out *AWSMachineStatus) { + *out = *in + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]apiv1beta1.MachineAddress, len(*in)) + copy(*out, *in) + } + if in.InstanceState != nil { + in, out := &in.InstanceState, &out.InstanceState + *out = new(InstanceState) + **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.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(apiv1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineStatus. +func (in *AWSMachineStatus) DeepCopy() *AWSMachineStatus { + if in == nil { + return nil + } + out := new(AWSMachineStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachineTemplate) DeepCopyInto(out *AWSMachineTemplate) { + *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 AWSMachineTemplate. +func (in *AWSMachineTemplate) DeepCopy() *AWSMachineTemplate { + if in == nil { + return nil + } + out := new(AWSMachineTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSMachineTemplate) 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 *AWSMachineTemplateList) DeepCopyInto(out *AWSMachineTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSMachineTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineTemplateList. +func (in *AWSMachineTemplateList) DeepCopy() *AWSMachineTemplateList { + if in == nil { + return nil + } + out := new(AWSMachineTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSMachineTemplateList) 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 *AWSMachineTemplateResource) DeepCopyInto(out *AWSMachineTemplateResource) { + *out = *in + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineTemplateResource. +func (in *AWSMachineTemplateResource) DeepCopy() *AWSMachineTemplateResource { + if in == nil { + return nil + } + out := new(AWSMachineTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachineTemplateSpec) DeepCopyInto(out *AWSMachineTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachineTemplateSpec. +func (in *AWSMachineTemplateSpec) DeepCopy() *AWSMachineTemplateSpec { + if in == nil { + return nil + } + out := new(AWSMachineTemplateSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSResourceReference) DeepCopyInto(out *AWSResourceReference) { + *out = *in + if in.ID != nil { + in, out := &in.ID, &out.ID + *out = new(string) + **out = **in + } + if in.ARN != nil { + in, out := &in.ARN, &out.ARN + *out = new(string) + **out = **in + } + if in.Filters != nil { + in, out := &in.Filters, &out.Filters + *out = make([]Filter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSResourceReference. +func (in *AWSResourceReference) DeepCopy() *AWSResourceReference { + if in == nil { + return nil + } + out := new(AWSResourceReference) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSRoleSpec) DeepCopyInto(out *AWSRoleSpec) { + *out = *in + if in.PolicyARNs != nil { + in, out := &in.PolicyARNs, &out.PolicyARNs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSRoleSpec. +func (in *AWSRoleSpec) DeepCopy() *AWSRoleSpec { + if in == nil { + return nil + } + out := new(AWSRoleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AllowedNamespaces) DeepCopyInto(out *AllowedNamespaces) { + *out = *in + if in.NamespaceList != nil { + in, out := &in.NamespaceList, &out.NamespaceList + *out = make([]string, len(*in)) + copy(*out, *in) + } + in.Selector.DeepCopyInto(&out.Selector) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AllowedNamespaces. +func (in *AllowedNamespaces) DeepCopy() *AllowedNamespaces { + if in == nil { + return nil + } + out := new(AllowedNamespaces) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Bastion) DeepCopyInto(out *Bastion) { + *out = *in + if in.AllowedCIDRBlocks != nil { + in, out := &in.AllowedCIDRBlocks, &out.AllowedCIDRBlocks + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Bastion. +func (in *Bastion) DeepCopy() *Bastion { + if in == nil { + return nil + } + out := new(Bastion) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BuildParams) DeepCopyInto(out *BuildParams) { + *out = *in + if in.Name != nil { + in, out := &in.Name, &out.Name + *out = new(string) + **out = **in + } + if in.Role != nil { + in, out := &in.Role, &out.Role + *out = new(string) + **out = **in + } + if in.Additional != nil { + in, out := &in.Additional, &out.Additional + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BuildParams. +func (in *BuildParams) DeepCopy() *BuildParams { + if in == nil { + return nil + } + out := new(BuildParams) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CNIIngressRule) DeepCopyInto(out *CNIIngressRule) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CNIIngressRule. +func (in *CNIIngressRule) DeepCopy() *CNIIngressRule { + if in == nil { + return nil + } + out := new(CNIIngressRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in CNIIngressRules) DeepCopyInto(out *CNIIngressRules) { + { + in := &in + *out = make(CNIIngressRules, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CNIIngressRules. +func (in CNIIngressRules) DeepCopy() CNIIngressRules { + if in == nil { + return nil + } + out := new(CNIIngressRules) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CNISpec) DeepCopyInto(out *CNISpec) { + *out = *in + if in.CNIIngressRules != nil { + in, out := &in.CNIIngressRules, &out.CNIIngressRules + *out = make(CNIIngressRules, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CNISpec. +func (in *CNISpec) DeepCopy() *CNISpec { + if in == nil { + return nil + } + out := new(CNISpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClassicELB) DeepCopyInto(out *ClassicELB) { + *out = *in + if in.AvailabilityZones != nil { + in, out := &in.AvailabilityZones, &out.AvailabilityZones + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SubnetIDs != nil { + in, out := &in.SubnetIDs, &out.SubnetIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SecurityGroupIDs != nil { + in, out := &in.SecurityGroupIDs, &out.SecurityGroupIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Listeners != nil { + in, out := &in.Listeners, &out.Listeners + *out = make([]ClassicELBListener, len(*in)) + copy(*out, *in) + } + if in.HealthCheck != nil { + in, out := &in.HealthCheck, &out.HealthCheck + *out = new(ClassicELBHealthCheck) + **out = **in + } + out.Attributes = in.Attributes + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClassicELB. +func (in *ClassicELB) DeepCopy() *ClassicELB { + if in == nil { + return nil + } + out := new(ClassicELB) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClassicELBAttributes) DeepCopyInto(out *ClassicELBAttributes) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClassicELBAttributes. +func (in *ClassicELBAttributes) DeepCopy() *ClassicELBAttributes { + if in == nil { + return nil + } + out := new(ClassicELBAttributes) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClassicELBHealthCheck) DeepCopyInto(out *ClassicELBHealthCheck) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClassicELBHealthCheck. +func (in *ClassicELBHealthCheck) DeepCopy() *ClassicELBHealthCheck { + if in == nil { + return nil + } + out := new(ClassicELBHealthCheck) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClassicELBListener) DeepCopyInto(out *ClassicELBListener) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClassicELBListener. +func (in *ClassicELBListener) DeepCopy() *ClassicELBListener { + if in == nil { + return nil + } + out := new(ClassicELBListener) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *CloudInit) DeepCopyInto(out *CloudInit) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudInit. +func (in *CloudInit) DeepCopy() *CloudInit { + if in == nil { + return nil + } + out := new(CloudInit) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Filter) DeepCopyInto(out *Filter) { + *out = *in + if in.Values != nil { + in, out := &in.Values, &out.Values + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filter. +func (in *Filter) DeepCopy() *Filter { + if in == nil { + return nil + } + out := new(Filter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IngressRule) DeepCopyInto(out *IngressRule) { + *out = *in + if in.CidrBlocks != nil { + in, out := &in.CidrBlocks, &out.CidrBlocks + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SourceSecurityGroupIDs != nil { + in, out := &in.SourceSecurityGroupIDs, &out.SourceSecurityGroupIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressRule. +func (in *IngressRule) DeepCopy() *IngressRule { + if in == nil { + return nil + } + out := new(IngressRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in IngressRules) DeepCopyInto(out *IngressRules) { + { + in := &in + *out = make(IngressRules, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IngressRules. +func (in IngressRules) DeepCopy() IngressRules { + if in == nil { + return nil + } + out := new(IngressRules) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Instance) DeepCopyInto(out *Instance) { + *out = *in + if in.SSHKeyName != nil { + in, out := &in.SSHKeyName, &out.SSHKeyName + *out = new(string) + **out = **in + } + if in.SecurityGroupIDs != nil { + in, out := &in.SecurityGroupIDs, &out.SecurityGroupIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.UserData != nil { + in, out := &in.UserData, &out.UserData + *out = new(string) + **out = **in + } + if in.Addresses != nil { + in, out := &in.Addresses, &out.Addresses + *out = make([]apiv1beta1.MachineAddress, len(*in)) + copy(*out, *in) + } + if in.PrivateIP != nil { + in, out := &in.PrivateIP, &out.PrivateIP + *out = new(string) + **out = **in + } + if in.PublicIP != nil { + in, out := &in.PublicIP, &out.PublicIP + *out = new(string) + **out = **in + } + if in.ENASupport != nil { + in, out := &in.ENASupport, &out.ENASupport + *out = new(bool) + **out = **in + } + if in.EBSOptimized != nil { + in, out := &in.EBSOptimized, &out.EBSOptimized + *out = new(bool) + **out = **in + } + if in.RootVolume != nil { + in, out := &in.RootVolume, &out.RootVolume + *out = new(Volume) + (*in).DeepCopyInto(*out) + } + if in.NonRootVolumes != nil { + in, out := &in.NonRootVolumes, &out.NonRootVolumes + *out = make([]Volume, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.NetworkInterfaces != nil { + in, out := &in.NetworkInterfaces, &out.NetworkInterfaces + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.SpotMarketOptions != nil { + in, out := &in.SpotMarketOptions, &out.SpotMarketOptions + *out = new(SpotMarketOptions) + (*in).DeepCopyInto(*out) + } + if in.VolumeIDs != nil { + in, out := &in.VolumeIDs, &out.VolumeIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Instance. +func (in *Instance) DeepCopy() *Instance { + if in == nil { + return nil + } + out := new(Instance) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec) { + *out = *in + in.VPC.DeepCopyInto(&out.VPC) + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make(Subnets, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.CNI != nil { + in, out := &in.CNI, &out.CNI + *out = new(CNISpec) + (*in).DeepCopyInto(*out) + } + if in.SecurityGroupOverrides != nil { + in, out := &in.SecurityGroupOverrides, &out.SecurityGroupOverrides + *out = make(map[SecurityGroupRole]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkSpec. +func (in *NetworkSpec) DeepCopy() *NetworkSpec { + if in == nil { + return nil + } + out := new(NetworkSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NetworkStatus) DeepCopyInto(out *NetworkStatus) { + *out = *in + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *out = make(map[SecurityGroupRole]SecurityGroup, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + in.APIServerELB.DeepCopyInto(&out.APIServerELB) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkStatus. +func (in *NetworkStatus) DeepCopy() *NetworkStatus { + if in == nil { + return nil + } + out := new(NetworkStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RouteTable) DeepCopyInto(out *RouteTable) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteTable. +func (in *RouteTable) DeepCopy() *RouteTable { + if in == nil { + return nil + } + out := new(RouteTable) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SecurityGroup) DeepCopyInto(out *SecurityGroup) { + *out = *in + if in.IngressRules != nil { + in, out := &in.IngressRules, &out.IngressRules + *out = make(IngressRules, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecurityGroup. +func (in *SecurityGroup) DeepCopy() *SecurityGroup { + if in == nil { + return nil + } + out := new(SecurityGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SpotMarketOptions) DeepCopyInto(out *SpotMarketOptions) { + *out = *in + if in.MaxPrice != nil { + in, out := &in.MaxPrice, &out.MaxPrice + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpotMarketOptions. +func (in *SpotMarketOptions) DeepCopy() *SpotMarketOptions { + if in == nil { + return nil + } + out := new(SpotMarketOptions) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *SubnetSpec) DeepCopyInto(out *SubnetSpec) { + *out = *in + if in.RouteTableID != nil { + in, out := &in.RouteTableID, &out.RouteTableID + *out = new(string) + **out = **in + } + if in.NatGatewayID != nil { + in, out := &in.NatGatewayID, &out.NatGatewayID + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnetSpec. +func (in *SubnetSpec) DeepCopy() *SubnetSpec { + if in == nil { + return nil + } + out := new(SubnetSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Subnets) DeepCopyInto(out *Subnets) { + { + in := &in + *out = make(Subnets, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subnets. +func (in Subnets) DeepCopy() Subnets { + if in == nil { + return nil + } + out := new(Subnets) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Tags) DeepCopyInto(out *Tags) { + { + in := &in + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Tags. +func (in Tags) DeepCopy() Tags { + if in == nil { + return nil + } + out := new(Tags) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *VPCSpec) DeepCopyInto(out *VPCSpec) { + *out = *in + if in.InternetGatewayID != nil { + in, out := &in.InternetGatewayID, &out.InternetGatewayID + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.AvailabilityZoneUsageLimit != nil { + in, out := &in.AvailabilityZoneUsageLimit, &out.AvailabilityZoneUsageLimit + *out = new(int) + **out = **in + } + if in.AvailabilityZoneSelection != nil { + in, out := &in.AvailabilityZoneSelection, &out.AvailabilityZoneSelection + *out = new(AZSelectionScheme) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VPCSpec. +func (in *VPCSpec) DeepCopy() *VPCSpec { + if in == nil { + return nil + } + out := new(VPCSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Volume) DeepCopyInto(out *Volume) { + *out = *in + if in.Throughput != nil { + in, out := &in.Throughput, &out.Throughput + *out = new(int64) + **out = **in + } + if in.Encrypted != nil { + in, out := &in.Encrypted, &out.Encrypted + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Volume. +func (in *Volume) DeepCopy() *Volume { + if in == nil { + return nil + } + out := new(Volume) + in.DeepCopyInto(out) + return out +} diff --git a/api/v1beta1/zz_generated.defaults.go b/api/v1beta1/zz_generated.defaults.go new file mode 100644 index 0000000000..722612bc55 --- /dev/null +++ b/api/v1beta1/zz_generated.defaults.go @@ -0,0 +1,46 @@ +// +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 defaulter-gen. DO NOT EDIT. + +package v1beta1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + scheme.AddTypeDefaultingFunc(&AWSCluster{}, func(obj interface{}) { SetObjectDefaults_AWSCluster(obj.(*AWSCluster)) }) + scheme.AddTypeDefaultingFunc(&AWSClusterTemplate{}, func(obj interface{}) { SetObjectDefaults_AWSClusterTemplate(obj.(*AWSClusterTemplate)) }) + return nil +} + +func SetObjectDefaults_AWSCluster(in *AWSCluster) { + SetDefaults_AWSClusterSpec(&in.Spec) + SetDefaults_NetworkSpec(&in.Spec.NetworkSpec) + SetDefaults_Bastion(&in.Spec.Bastion) +} + +func SetObjectDefaults_AWSClusterTemplate(in *AWSClusterTemplate) { + SetDefaults_AWSClusterSpec(&in.Spec.Template.Spec) + SetDefaults_NetworkSpec(&in.Spec.Template.Spec.NetworkSpec) + SetDefaults_Bastion(&in.Spec.Template.Spec.Bastion) +} diff --git a/bootstrap/eks/PROJECT b/bootstrap/eks/PROJECT index b75ff33b3f..0a013b8f69 100644 --- a/bootstrap/eks/PROJECT +++ b/bootstrap/eks/PROJECT @@ -1,16 +1,25 @@ domain: cluster.x-k8s.io repo: sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks resources: +# v1alpha3 types - group: bootstrap kind: EKSConfig version: v1alpha3 - group: bootstrap kind: EKSConfigTemplate version: v1alpha3 +# v1alpha4 types - group: bootstrap kind: EKSConfig version: v1alpha4 - group: bootstrap kind: EKSConfigTemplate version: v1alpha4 +# v1beta1 types +- group: bootstrap + kind: EKSConfig + version: v1beta1 +- group: bootstrap + kind: EKSConfigTemplate + version: v1beta1 version: "2" diff --git a/bootstrap/eks/README.md b/bootstrap/eks/README.md index d112272628..bc5dfb0837 100644 --- a/bootstrap/eks/README.md +++ b/bootstrap/eks/README.md @@ -1,6 +1,6 @@ # Cluster API bootstrap provider EKS -Cluster API bootstrap provider EKS (CABPE) is a component of [Cluster API](https://github.com/kubernetes-sigs/cluster-api/blob/master/README.md) that is responsible for generating a cloud-init script to turn a Machine into a Kubernetes Node; this implementation uses the [AWS-provided EKS bootstrap script](https://github.com/awslabs/amazon-eks-ami/blob/master/files/bootstrap.sh) for joining Kubernetes Nodes to EKS clusters. +Cluster API bootstrap provider EKS (CABPE) is a component of [Cluster API](https://github.com/kubernetes-sigs/cluster-api/blob/master/README.md) that is responsible for generating a cloud-init script to turn a Machine into a Kubernetes Node; this implementation uses the [AWS-provided EKS bootstrap script](https://github.com/awslabs/amazon-eks-ami/blob/master/files/bootstrap.sh) for joining Kubernetes Nodes to EKS clusters. CABPE is the bootstrap component of Cluster API Provider AWS' (CAPA) EKS ecosystem. This ecosystem is comprised of: - EKS controlplane provider (AWSManagedControlPlane) @@ -9,7 +9,7 @@ CABPE is the bootstrap component of Cluster API Provider AWS' (CAPA) EKS ecosyst ## How does CABPE work? -CABPE generates cloud-init configuration that CAPA will use as the [user-data](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html) for new EC2 instances. The generated configuration relies on the `bootstrap.sh` script that is present on all official AWS EKS AMIs. +CABPE generates cloud-init configuration that CAPA will use as the [user-data](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html) for new EC2 instances. The generated configuration relies on the `bootstrap.sh` script that is present on all official AWS EKS AMIs. The output script looks something like this (assuming an EKS cluster with the name `my-cluster`): @@ -24,7 +24,7 @@ Because the bootstrap script has no required fields other than the EKS cluster's ```yaml kind: EKSConfig -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 +apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 metadata: name: my-config spec: {} @@ -34,7 +34,7 @@ The only configuration option available is `kubeletExtraArgs`, which is a `map[s ```yaml kind: EKSConfig -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 +apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 metadata: name: my-config spec: diff --git a/bootstrap/eks/api/v1alpha3/condition_consts.go b/bootstrap/eks/api/v1alpha3/condition_consts.go index 8dd8740b8a..17fd44361a 100644 --- a/bootstrap/eks/api/v1alpha3/condition_consts.go +++ b/bootstrap/eks/api/v1alpha3/condition_consts.go @@ -16,7 +16,7 @@ limitations under the License. package v1alpha3 -import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" +import clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" // Conditions and condition Reasons for the EKSConfig object // FROM: https://github.com/kubernetes-sigs/cluster-api/blob/master/bootstrap/kubeadm/api/v1alpha3/condition_consts.go @@ -27,7 +27,7 @@ const ( // 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 clusterv1.ConditionType = "DataSecretAvailable" + DataSecretAvailableCondition clusterv1alpha3.ConditionType = "DataSecretAvailable" // DataSecretGenerationFailedReason (Severity=Warning) documents a EKSConfig controller detecting // an error while generating a data secret; those kind of errors are usually due to misconfigurations diff --git a/bootstrap/eks/api/v1alpha3/conversion.go b/bootstrap/eks/api/v1alpha3/conversion.go index 725bd64c08..c66add2c41 100644 --- a/bootstrap/eks/api/v1alpha3/conversion.go +++ b/bootstrap/eks/api/v1alpha3/conversion.go @@ -17,62 +17,62 @@ limitations under the License. package v1alpha3 import ( - "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha4" + "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/conversion" ) -// ConvertTo converts the v1alpha3 EKSConfig receiver to a v1alpha4 EKSConfig. +// ConvertTo converts the v1alpha3 EKSConfig receiver to a v1beta1 EKSConfig. func (r *EKSConfig) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.EKSConfig) + dst := dstRaw.(*v1beta1.EKSConfig) - return Convert_v1alpha3_EKSConfig_To_v1alpha4_EKSConfig(r, dst, nil) + return Convert_v1alpha3_EKSConfig_To_v1beta1_EKSConfig(r, dst, nil) } -// ConvertFrom converts the v1alpha4 EKSConfig receiver to a v1alpha3 EKSConfig. +// ConvertFrom converts the v1beta1 EKSConfig receiver to a v1alpha3 EKSConfig. func (r *EKSConfig) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.EKSConfig) + src := srcRaw.(*v1beta1.EKSConfig) - return Convert_v1alpha4_EKSConfig_To_v1alpha3_EKSConfig(src, r, nil) + return Convert_v1beta1_EKSConfig_To_v1alpha3_EKSConfig(src, r, nil) } -// ConvertTo converts the v1alpha3 EKSConfigList receiver to a v1alpha4 EKSConfigList. +// ConvertTo converts the v1alpha3 EKSConfigList receiver to a v1beta1 EKSConfigList. func (r *EKSConfigList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.EKSConfigList) + dst := dstRaw.(*v1beta1.EKSConfigList) - return Convert_v1alpha3_EKSConfigList_To_v1alpha4_EKSConfigList(r, dst, nil) + return Convert_v1alpha3_EKSConfigList_To_v1beta1_EKSConfigList(r, dst, nil) } -// ConvertFrom converts the v1alpha4 EKSConfigList receiver to a v1alpha3 EKSConfigList. +// ConvertFrom converts the v1beta1 EKSConfigList receiver to a v1alpha3 EKSConfigList. func (r *EKSConfigList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.EKSConfigList) + src := srcRaw.(*v1beta1.EKSConfigList) - return Convert_v1alpha4_EKSConfigList_To_v1alpha3_EKSConfigList(src, r, nil) + return Convert_v1beta1_EKSConfigList_To_v1alpha3_EKSConfigList(src, r, nil) } -// ConvertTo converts the v1alpha3 EKSConfigTemplate receiver to a v1alpha4 EKSConfigTemplate. +// ConvertTo converts the v1alpha3 EKSConfigTemplate receiver to a v1beta1 EKSConfigTemplate. func (r *EKSConfigTemplate) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.EKSConfigTemplate) + dst := dstRaw.(*v1beta1.EKSConfigTemplate) - return Convert_v1alpha3_EKSConfigTemplate_To_v1alpha4_EKSConfigTemplate(r, dst, nil) + return Convert_v1alpha3_EKSConfigTemplate_To_v1beta1_EKSConfigTemplate(r, dst, nil) } -// ConvertFrom converts the v1alpha4 EKSConfigTemplate receiver to a v1alpha3 EKSConfigTemplate. +// ConvertFrom converts the v1beta1 EKSConfigTemplate receiver to a v1alpha3 EKSConfigTemplate. func (r *EKSConfigTemplate) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.EKSConfigTemplate) + src := srcRaw.(*v1beta1.EKSConfigTemplate) - return Convert_v1alpha4_EKSConfigTemplate_To_v1alpha3_EKSConfigTemplate(src, r, nil) + return Convert_v1beta1_EKSConfigTemplate_To_v1alpha3_EKSConfigTemplate(src, r, nil) } -// ConvertTo converts the v1alpha3 EKSConfigTemplateList receiver to a v1alpha4 EKSConfigTemplateList. +// ConvertTo converts the v1alpha3 EKSConfigTemplateList receiver to a v1beta1 EKSConfigTemplateList. func (r *EKSConfigTemplateList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.EKSConfigTemplateList) + dst := dstRaw.(*v1beta1.EKSConfigTemplateList) - return Convert_v1alpha3_EKSConfigTemplateList_To_v1alpha4_EKSConfigTemplateList(r, dst, nil) + return Convert_v1alpha3_EKSConfigTemplateList_To_v1beta1_EKSConfigTemplateList(r, dst, nil) } -// ConvertFrom converts the v1alpha4 EKSConfigTemplateList receiver to a v1alpha3 EKSConfigTemplateList. +// ConvertFrom converts the v1beta1 EKSConfigTemplateList receiver to a v1alpha3 EKSConfigTemplateList. func (r *EKSConfigTemplateList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.EKSConfigTemplateList) + src := srcRaw.(*v1beta1.EKSConfigTemplateList) - return Convert_v1alpha4_EKSConfigTemplateList_To_v1alpha3_EKSConfigTemplateList(src, r, nil) + return Convert_v1beta1_EKSConfigTemplateList_To_v1alpha3_EKSConfigTemplateList(src, r, nil) } diff --git a/bootstrap/eks/api/v1alpha3/conversion_test.go b/bootstrap/eks/api/v1alpha3/conversion_test.go index 9a3025df87..ae3348e9cb 100644 --- a/bootstrap/eks/api/v1alpha3/conversion_test.go +++ b/bootstrap/eks/api/v1alpha3/conversion_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" runtime "k8s.io/apimachinery/pkg/runtime" - v1alpha4 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha4" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" ) @@ -30,17 +30,17 @@ func TestFuzzyConversion(t *testing.T) { g := NewWithT(t) scheme := runtime.NewScheme() g.Expect(AddToScheme(scheme)).To(Succeed()) - g.Expect(v1alpha4.AddToScheme(scheme)).To(Succeed()) + g.Expect(v1beta1.AddToScheme(scheme)).To(Succeed()) t.Run("for EKSConfig", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ Scheme: scheme, - Hub: &v1alpha4.EKSConfig{}, + Hub: &v1beta1.EKSConfig{}, Spoke: &EKSConfig{}, })) t.Run("for EKSConfigTemplate", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ Scheme: scheme, - Hub: &v1alpha4.EKSConfigTemplate{}, + Hub: &v1beta1.EKSConfigTemplate{}, Spoke: &EKSConfigTemplate{}, })) } diff --git a/bootstrap/eks/api/v1alpha3/doc.go b/bootstrap/eks/api/v1alpha3/doc.go index 62c04c4cb9..a7f13353ad 100644 --- a/bootstrap/eks/api/v1alpha3/doc.go +++ b/bootstrap/eks/api/v1alpha3/doc.go @@ -14,6 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha4 +// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1beta1 package v1alpha3 diff --git a/bootstrap/eks/api/v1alpha3/eksconfig_types.go b/bootstrap/eks/api/v1alpha3/eksconfig_types.go index aa3a8d0342..623a665b19 100644 --- a/bootstrap/eks/api/v1alpha3/eksconfig_types.go +++ b/bootstrap/eks/api/v1alpha3/eksconfig_types.go @@ -18,12 +18,9 @@ package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" ) -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - // EKSConfigSpec defines the desired state of EKSConfig type EKSConfigSpec struct { // Passes the kubelet args into the EKS bootstrap script @@ -54,7 +51,7 @@ type EKSConfigStatus struct { // Conditions defines current service state of the EKSConfig. // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1alpha3.Conditions `json:"conditions,omitempty"` } // +kubebuilder:object:root=true @@ -73,12 +70,12 @@ type EKSConfig struct { } // GetConditions returns the observations of the operational state of the EKSConfig resource. -func (r *EKSConfig) GetConditions() clusterv1.Conditions { +func (r *EKSConfig) GetConditions() clusterv1alpha3.Conditions { return r.Status.Conditions } -// SetConditions sets the underlying service state of the EKSConfig to the predescribed clusterv1.Conditions. -func (r *EKSConfig) SetConditions(conditions clusterv1.Conditions) { +// SetConditions sets the underlying service state of the EKSConfig to the predescribed clusterv1alpha3.Conditions. +func (r *EKSConfig) SetConditions(conditions clusterv1alpha3.Conditions) { r.Status.Conditions = conditions } diff --git a/bootstrap/eks/api/v1alpha3/webhook_suite_test.go b/bootstrap/eks/api/v1alpha3/webhook_suite_test.go index 22d6faecaa..c06a23f6c0 100644 --- a/bootstrap/eks/api/v1alpha3/webhook_suite_test.go +++ b/bootstrap/eks/api/v1alpha3/webhook_suite_test.go @@ -24,7 +24,7 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - bootstrapv1alpha4 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha4" + eksbootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/test/helpers" ctrl "sigs.k8s.io/controller-runtime" // +kubebuilder:scaffold:imports @@ -45,7 +45,7 @@ func TestMain(m *testing.M) { func setup() { utilruntime.Must(AddToScheme(scheme.Scheme)) - utilruntime.Must(bootstrapv1alpha4.AddToScheme(scheme.Scheme)) + utilruntime.Must(eksbootstrapv1.AddToScheme(scheme.Scheme)) testEnvConfig := helpers.NewTestEnvironmentConfiguration([]string{ path.Join("bootstrap", "eks", "config", "crd", "bases"), @@ -56,10 +56,10 @@ func setup() { if err != nil { panic(err) } - if err := (&bootstrapv1alpha4.EKSConfig{}).SetupWebhookWithManager(testEnv); err != nil { + if err := (&eksbootstrapv1.EKSConfig{}).SetupWebhookWithManager(testEnv); err != nil { panic(fmt.Sprintf("Unable to setup AWSCluster webhook: %v", err)) } - if err := (&bootstrapv1alpha4.EKSConfigTemplate{}).SetupWebhookWithManager(testEnv); err != nil { + if err := (&eksbootstrapv1.EKSConfigTemplate{}).SetupWebhookWithManager(testEnv); err != nil { panic(fmt.Sprintf("Unable to setup AWSCluster webhook: %v", err)) } go func() { diff --git a/bootstrap/eks/api/v1alpha3/zz_generated.conversion.go b/bootstrap/eks/api/v1alpha3/zz_generated.conversion.go index 1f60ca3f8a..9df9b4f651 100644 --- a/bootstrap/eks/api/v1alpha3/zz_generated.conversion.go +++ b/bootstrap/eks/api/v1alpha3/zz_generated.conversion.go @@ -1,4 +1,4 @@ -// +build !ignore_autogenerated +// +build !ignore_autogenerated_conversions /* Copyright The Kubernetes Authors. @@ -25,9 +25,9 @@ import ( conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - v1alpha4 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha4" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1beta1" apiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func init() { @@ -37,285 +37,325 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*EKSConfig)(nil), (*v1alpha4.EKSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_EKSConfig_To_v1alpha4_EKSConfig(a.(*EKSConfig), b.(*v1alpha4.EKSConfig), scope) + if err := s.AddGeneratedConversionFunc((*EKSConfig)(nil), (*v1beta1.EKSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_EKSConfig_To_v1beta1_EKSConfig(a.(*EKSConfig), b.(*v1beta1.EKSConfig), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.EKSConfig)(nil), (*EKSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_EKSConfig_To_v1alpha3_EKSConfig(a.(*v1alpha4.EKSConfig), b.(*EKSConfig), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.EKSConfig)(nil), (*EKSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EKSConfig_To_v1alpha3_EKSConfig(a.(*v1beta1.EKSConfig), b.(*EKSConfig), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*EKSConfigList)(nil), (*v1alpha4.EKSConfigList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_EKSConfigList_To_v1alpha4_EKSConfigList(a.(*EKSConfigList), b.(*v1alpha4.EKSConfigList), scope) + if err := s.AddGeneratedConversionFunc((*EKSConfigList)(nil), (*v1beta1.EKSConfigList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_EKSConfigList_To_v1beta1_EKSConfigList(a.(*EKSConfigList), b.(*v1beta1.EKSConfigList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.EKSConfigList)(nil), (*EKSConfigList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_EKSConfigList_To_v1alpha3_EKSConfigList(a.(*v1alpha4.EKSConfigList), b.(*EKSConfigList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.EKSConfigList)(nil), (*EKSConfigList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EKSConfigList_To_v1alpha3_EKSConfigList(a.(*v1beta1.EKSConfigList), b.(*EKSConfigList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*EKSConfigSpec)(nil), (*v1alpha4.EKSConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_EKSConfigSpec_To_v1alpha4_EKSConfigSpec(a.(*EKSConfigSpec), b.(*v1alpha4.EKSConfigSpec), scope) + if err := s.AddGeneratedConversionFunc((*EKSConfigSpec)(nil), (*v1beta1.EKSConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_EKSConfigSpec_To_v1beta1_EKSConfigSpec(a.(*EKSConfigSpec), b.(*v1beta1.EKSConfigSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.EKSConfigSpec)(nil), (*EKSConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_EKSConfigSpec_To_v1alpha3_EKSConfigSpec(a.(*v1alpha4.EKSConfigSpec), b.(*EKSConfigSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.EKSConfigSpec)(nil), (*EKSConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EKSConfigSpec_To_v1alpha3_EKSConfigSpec(a.(*v1beta1.EKSConfigSpec), b.(*EKSConfigSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*EKSConfigStatus)(nil), (*v1alpha4.EKSConfigStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_EKSConfigStatus_To_v1alpha4_EKSConfigStatus(a.(*EKSConfigStatus), b.(*v1alpha4.EKSConfigStatus), scope) + if err := s.AddGeneratedConversionFunc((*EKSConfigStatus)(nil), (*v1beta1.EKSConfigStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_EKSConfigStatus_To_v1beta1_EKSConfigStatus(a.(*EKSConfigStatus), b.(*v1beta1.EKSConfigStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.EKSConfigStatus)(nil), (*EKSConfigStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_EKSConfigStatus_To_v1alpha3_EKSConfigStatus(a.(*v1alpha4.EKSConfigStatus), b.(*EKSConfigStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.EKSConfigStatus)(nil), (*EKSConfigStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EKSConfigStatus_To_v1alpha3_EKSConfigStatus(a.(*v1beta1.EKSConfigStatus), b.(*EKSConfigStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*EKSConfigTemplate)(nil), (*v1alpha4.EKSConfigTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_EKSConfigTemplate_To_v1alpha4_EKSConfigTemplate(a.(*EKSConfigTemplate), b.(*v1alpha4.EKSConfigTemplate), scope) + if err := s.AddGeneratedConversionFunc((*EKSConfigTemplate)(nil), (*v1beta1.EKSConfigTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_EKSConfigTemplate_To_v1beta1_EKSConfigTemplate(a.(*EKSConfigTemplate), b.(*v1beta1.EKSConfigTemplate), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.EKSConfigTemplate)(nil), (*EKSConfigTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_EKSConfigTemplate_To_v1alpha3_EKSConfigTemplate(a.(*v1alpha4.EKSConfigTemplate), b.(*EKSConfigTemplate), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.EKSConfigTemplate)(nil), (*EKSConfigTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EKSConfigTemplate_To_v1alpha3_EKSConfigTemplate(a.(*v1beta1.EKSConfigTemplate), b.(*EKSConfigTemplate), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*EKSConfigTemplateList)(nil), (*v1alpha4.EKSConfigTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_EKSConfigTemplateList_To_v1alpha4_EKSConfigTemplateList(a.(*EKSConfigTemplateList), b.(*v1alpha4.EKSConfigTemplateList), scope) + if err := s.AddGeneratedConversionFunc((*EKSConfigTemplateList)(nil), (*v1beta1.EKSConfigTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_EKSConfigTemplateList_To_v1beta1_EKSConfigTemplateList(a.(*EKSConfigTemplateList), b.(*v1beta1.EKSConfigTemplateList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.EKSConfigTemplateList)(nil), (*EKSConfigTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_EKSConfigTemplateList_To_v1alpha3_EKSConfigTemplateList(a.(*v1alpha4.EKSConfigTemplateList), b.(*EKSConfigTemplateList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.EKSConfigTemplateList)(nil), (*EKSConfigTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EKSConfigTemplateList_To_v1alpha3_EKSConfigTemplateList(a.(*v1beta1.EKSConfigTemplateList), b.(*EKSConfigTemplateList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*EKSConfigTemplateResource)(nil), (*v1alpha4.EKSConfigTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_EKSConfigTemplateResource_To_v1alpha4_EKSConfigTemplateResource(a.(*EKSConfigTemplateResource), b.(*v1alpha4.EKSConfigTemplateResource), scope) + if err := s.AddGeneratedConversionFunc((*EKSConfigTemplateResource)(nil), (*v1beta1.EKSConfigTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_EKSConfigTemplateResource_To_v1beta1_EKSConfigTemplateResource(a.(*EKSConfigTemplateResource), b.(*v1beta1.EKSConfigTemplateResource), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.EKSConfigTemplateResource)(nil), (*EKSConfigTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_EKSConfigTemplateResource_To_v1alpha3_EKSConfigTemplateResource(a.(*v1alpha4.EKSConfigTemplateResource), b.(*EKSConfigTemplateResource), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.EKSConfigTemplateResource)(nil), (*EKSConfigTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EKSConfigTemplateResource_To_v1alpha3_EKSConfigTemplateResource(a.(*v1beta1.EKSConfigTemplateResource), b.(*EKSConfigTemplateResource), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*EKSConfigTemplateSpec)(nil), (*v1alpha4.EKSConfigTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_EKSConfigTemplateSpec_To_v1alpha4_EKSConfigTemplateSpec(a.(*EKSConfigTemplateSpec), b.(*v1alpha4.EKSConfigTemplateSpec), scope) + if err := s.AddGeneratedConversionFunc((*EKSConfigTemplateSpec)(nil), (*v1beta1.EKSConfigTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_EKSConfigTemplateSpec_To_v1beta1_EKSConfigTemplateSpec(a.(*EKSConfigTemplateSpec), b.(*v1beta1.EKSConfigTemplateSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.EKSConfigTemplateSpec)(nil), (*EKSConfigTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_EKSConfigTemplateSpec_To_v1alpha3_EKSConfigTemplateSpec(a.(*v1alpha4.EKSConfigTemplateSpec), b.(*EKSConfigTemplateSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.EKSConfigTemplateSpec)(nil), (*EKSConfigTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EKSConfigTemplateSpec_To_v1alpha3_EKSConfigTemplateSpec(a.(*v1beta1.EKSConfigTemplateSpec), b.(*EKSConfigTemplateSpec), scope) }); err != nil { return err } return nil } -func autoConvert_v1alpha3_EKSConfig_To_v1alpha4_EKSConfig(in *EKSConfig, out *v1alpha4.EKSConfig, s conversion.Scope) error { +func autoConvert_v1alpha3_EKSConfig_To_v1beta1_EKSConfig(in *EKSConfig, out *v1beta1.EKSConfig, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_EKSConfigSpec_To_v1alpha4_EKSConfigSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_EKSConfigSpec_To_v1beta1_EKSConfigSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha3_EKSConfigStatus_To_v1alpha4_EKSConfigStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_EKSConfigStatus_To_v1beta1_EKSConfigStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha3_EKSConfig_To_v1alpha4_EKSConfig is an autogenerated conversion function. -func Convert_v1alpha3_EKSConfig_To_v1alpha4_EKSConfig(in *EKSConfig, out *v1alpha4.EKSConfig, s conversion.Scope) error { - return autoConvert_v1alpha3_EKSConfig_To_v1alpha4_EKSConfig(in, out, s) +// Convert_v1alpha3_EKSConfig_To_v1beta1_EKSConfig is an autogenerated conversion function. +func Convert_v1alpha3_EKSConfig_To_v1beta1_EKSConfig(in *EKSConfig, out *v1beta1.EKSConfig, s conversion.Scope) error { + return autoConvert_v1alpha3_EKSConfig_To_v1beta1_EKSConfig(in, out, s) } -func autoConvert_v1alpha4_EKSConfig_To_v1alpha3_EKSConfig(in *v1alpha4.EKSConfig, out *EKSConfig, s conversion.Scope) error { +func autoConvert_v1beta1_EKSConfig_To_v1alpha3_EKSConfig(in *v1beta1.EKSConfig, out *EKSConfig, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_EKSConfigSpec_To_v1alpha3_EKSConfigSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_EKSConfigSpec_To_v1alpha3_EKSConfigSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha4_EKSConfigStatus_To_v1alpha3_EKSConfigStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_EKSConfigStatus_To_v1alpha3_EKSConfigStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha4_EKSConfig_To_v1alpha3_EKSConfig is an autogenerated conversion function. -func Convert_v1alpha4_EKSConfig_To_v1alpha3_EKSConfig(in *v1alpha4.EKSConfig, out *EKSConfig, s conversion.Scope) error { - return autoConvert_v1alpha4_EKSConfig_To_v1alpha3_EKSConfig(in, out, s) +// Convert_v1beta1_EKSConfig_To_v1alpha3_EKSConfig is an autogenerated conversion function. +func Convert_v1beta1_EKSConfig_To_v1alpha3_EKSConfig(in *v1beta1.EKSConfig, out *EKSConfig, s conversion.Scope) error { + return autoConvert_v1beta1_EKSConfig_To_v1alpha3_EKSConfig(in, out, s) } -func autoConvert_v1alpha3_EKSConfigList_To_v1alpha4_EKSConfigList(in *EKSConfigList, out *v1alpha4.EKSConfigList, s conversion.Scope) error { +func autoConvert_v1alpha3_EKSConfigList_To_v1beta1_EKSConfigList(in *EKSConfigList, out *v1beta1.EKSConfigList, s conversion.Scope) error { out.ListMeta = in.ListMeta - out.Items = *(*[]v1alpha4.EKSConfig)(unsafe.Pointer(&in.Items)) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta1.EKSConfig, len(*in)) + for i := range *in { + if err := Convert_v1alpha3_EKSConfig_To_v1beta1_EKSConfig(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } return nil } -// Convert_v1alpha3_EKSConfigList_To_v1alpha4_EKSConfigList is an autogenerated conversion function. -func Convert_v1alpha3_EKSConfigList_To_v1alpha4_EKSConfigList(in *EKSConfigList, out *v1alpha4.EKSConfigList, s conversion.Scope) error { - return autoConvert_v1alpha3_EKSConfigList_To_v1alpha4_EKSConfigList(in, out, s) +// Convert_v1alpha3_EKSConfigList_To_v1beta1_EKSConfigList is an autogenerated conversion function. +func Convert_v1alpha3_EKSConfigList_To_v1beta1_EKSConfigList(in *EKSConfigList, out *v1beta1.EKSConfigList, s conversion.Scope) error { + return autoConvert_v1alpha3_EKSConfigList_To_v1beta1_EKSConfigList(in, out, s) } -func autoConvert_v1alpha4_EKSConfigList_To_v1alpha3_EKSConfigList(in *v1alpha4.EKSConfigList, out *EKSConfigList, s conversion.Scope) error { +func autoConvert_v1beta1_EKSConfigList_To_v1alpha3_EKSConfigList(in *v1beta1.EKSConfigList, out *EKSConfigList, s conversion.Scope) error { out.ListMeta = in.ListMeta - out.Items = *(*[]EKSConfig)(unsafe.Pointer(&in.Items)) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]EKSConfig, len(*in)) + for i := range *in { + if err := Convert_v1beta1_EKSConfig_To_v1alpha3_EKSConfig(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } return nil } -// Convert_v1alpha4_EKSConfigList_To_v1alpha3_EKSConfigList is an autogenerated conversion function. -func Convert_v1alpha4_EKSConfigList_To_v1alpha3_EKSConfigList(in *v1alpha4.EKSConfigList, out *EKSConfigList, s conversion.Scope) error { - return autoConvert_v1alpha4_EKSConfigList_To_v1alpha3_EKSConfigList(in, out, s) +// Convert_v1beta1_EKSConfigList_To_v1alpha3_EKSConfigList is an autogenerated conversion function. +func Convert_v1beta1_EKSConfigList_To_v1alpha3_EKSConfigList(in *v1beta1.EKSConfigList, out *EKSConfigList, s conversion.Scope) error { + return autoConvert_v1beta1_EKSConfigList_To_v1alpha3_EKSConfigList(in, out, s) } -func autoConvert_v1alpha3_EKSConfigSpec_To_v1alpha4_EKSConfigSpec(in *EKSConfigSpec, out *v1alpha4.EKSConfigSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_EKSConfigSpec_To_v1beta1_EKSConfigSpec(in *EKSConfigSpec, out *v1beta1.EKSConfigSpec, s conversion.Scope) error { out.KubeletExtraArgs = *(*map[string]string)(unsafe.Pointer(&in.KubeletExtraArgs)) return nil } -// Convert_v1alpha3_EKSConfigSpec_To_v1alpha4_EKSConfigSpec is an autogenerated conversion function. -func Convert_v1alpha3_EKSConfigSpec_To_v1alpha4_EKSConfigSpec(in *EKSConfigSpec, out *v1alpha4.EKSConfigSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_EKSConfigSpec_To_v1alpha4_EKSConfigSpec(in, out, s) +// Convert_v1alpha3_EKSConfigSpec_To_v1beta1_EKSConfigSpec is an autogenerated conversion function. +func Convert_v1alpha3_EKSConfigSpec_To_v1beta1_EKSConfigSpec(in *EKSConfigSpec, out *v1beta1.EKSConfigSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_EKSConfigSpec_To_v1beta1_EKSConfigSpec(in, out, s) } -func autoConvert_v1alpha4_EKSConfigSpec_To_v1alpha3_EKSConfigSpec(in *v1alpha4.EKSConfigSpec, out *EKSConfigSpec, s conversion.Scope) error { +func autoConvert_v1beta1_EKSConfigSpec_To_v1alpha3_EKSConfigSpec(in *v1beta1.EKSConfigSpec, out *EKSConfigSpec, s conversion.Scope) error { out.KubeletExtraArgs = *(*map[string]string)(unsafe.Pointer(&in.KubeletExtraArgs)) return nil } -// Convert_v1alpha4_EKSConfigSpec_To_v1alpha3_EKSConfigSpec is an autogenerated conversion function. -func Convert_v1alpha4_EKSConfigSpec_To_v1alpha3_EKSConfigSpec(in *v1alpha4.EKSConfigSpec, out *EKSConfigSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_EKSConfigSpec_To_v1alpha3_EKSConfigSpec(in, out, s) +// Convert_v1beta1_EKSConfigSpec_To_v1alpha3_EKSConfigSpec is an autogenerated conversion function. +func Convert_v1beta1_EKSConfigSpec_To_v1alpha3_EKSConfigSpec(in *v1beta1.EKSConfigSpec, out *EKSConfigSpec, s conversion.Scope) error { + return autoConvert_v1beta1_EKSConfigSpec_To_v1alpha3_EKSConfigSpec(in, out, s) } -func autoConvert_v1alpha3_EKSConfigStatus_To_v1alpha4_EKSConfigStatus(in *EKSConfigStatus, out *v1alpha4.EKSConfigStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_EKSConfigStatus_To_v1beta1_EKSConfigStatus(in *EKSConfigStatus, out *v1beta1.EKSConfigStatus, 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 - out.Conditions = *(*apiv1alpha4.Conditions)(unsafe.Pointer(&in.Conditions)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(apiv1beta1.Conditions, len(*in)) + for i := range *in { + if err := apiv1alpha3.Convert_v1alpha3_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } return nil } -// Convert_v1alpha3_EKSConfigStatus_To_v1alpha4_EKSConfigStatus is an autogenerated conversion function. -func Convert_v1alpha3_EKSConfigStatus_To_v1alpha4_EKSConfigStatus(in *EKSConfigStatus, out *v1alpha4.EKSConfigStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_EKSConfigStatus_To_v1alpha4_EKSConfigStatus(in, out, s) +// Convert_v1alpha3_EKSConfigStatus_To_v1beta1_EKSConfigStatus is an autogenerated conversion function. +func Convert_v1alpha3_EKSConfigStatus_To_v1beta1_EKSConfigStatus(in *EKSConfigStatus, out *v1beta1.EKSConfigStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_EKSConfigStatus_To_v1beta1_EKSConfigStatus(in, out, s) } -func autoConvert_v1alpha4_EKSConfigStatus_To_v1alpha3_EKSConfigStatus(in *v1alpha4.EKSConfigStatus, out *EKSConfigStatus, s conversion.Scope) error { +func autoConvert_v1beta1_EKSConfigStatus_To_v1alpha3_EKSConfigStatus(in *v1beta1.EKSConfigStatus, out *EKSConfigStatus, 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 - out.Conditions = *(*apiv1alpha3.Conditions)(unsafe.Pointer(&in.Conditions)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(apiv1alpha3.Conditions, len(*in)) + for i := range *in { + if err := apiv1alpha3.Convert_v1beta1_Condition_To_v1alpha3_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } return nil } -// Convert_v1alpha4_EKSConfigStatus_To_v1alpha3_EKSConfigStatus is an autogenerated conversion function. -func Convert_v1alpha4_EKSConfigStatus_To_v1alpha3_EKSConfigStatus(in *v1alpha4.EKSConfigStatus, out *EKSConfigStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_EKSConfigStatus_To_v1alpha3_EKSConfigStatus(in, out, s) +// Convert_v1beta1_EKSConfigStatus_To_v1alpha3_EKSConfigStatus is an autogenerated conversion function. +func Convert_v1beta1_EKSConfigStatus_To_v1alpha3_EKSConfigStatus(in *v1beta1.EKSConfigStatus, out *EKSConfigStatus, s conversion.Scope) error { + return autoConvert_v1beta1_EKSConfigStatus_To_v1alpha3_EKSConfigStatus(in, out, s) } -func autoConvert_v1alpha3_EKSConfigTemplate_To_v1alpha4_EKSConfigTemplate(in *EKSConfigTemplate, out *v1alpha4.EKSConfigTemplate, s conversion.Scope) error { +func autoConvert_v1alpha3_EKSConfigTemplate_To_v1beta1_EKSConfigTemplate(in *EKSConfigTemplate, out *v1beta1.EKSConfigTemplate, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_EKSConfigTemplateSpec_To_v1alpha4_EKSConfigTemplateSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_EKSConfigTemplateSpec_To_v1beta1_EKSConfigTemplateSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha3_EKSConfigTemplate_To_v1alpha4_EKSConfigTemplate is an autogenerated conversion function. -func Convert_v1alpha3_EKSConfigTemplate_To_v1alpha4_EKSConfigTemplate(in *EKSConfigTemplate, out *v1alpha4.EKSConfigTemplate, s conversion.Scope) error { - return autoConvert_v1alpha3_EKSConfigTemplate_To_v1alpha4_EKSConfigTemplate(in, out, s) +// Convert_v1alpha3_EKSConfigTemplate_To_v1beta1_EKSConfigTemplate is an autogenerated conversion function. +func Convert_v1alpha3_EKSConfigTemplate_To_v1beta1_EKSConfigTemplate(in *EKSConfigTemplate, out *v1beta1.EKSConfigTemplate, s conversion.Scope) error { + return autoConvert_v1alpha3_EKSConfigTemplate_To_v1beta1_EKSConfigTemplate(in, out, s) } -func autoConvert_v1alpha4_EKSConfigTemplate_To_v1alpha3_EKSConfigTemplate(in *v1alpha4.EKSConfigTemplate, out *EKSConfigTemplate, s conversion.Scope) error { +func autoConvert_v1beta1_EKSConfigTemplate_To_v1alpha3_EKSConfigTemplate(in *v1beta1.EKSConfigTemplate, out *EKSConfigTemplate, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_EKSConfigTemplateSpec_To_v1alpha3_EKSConfigTemplateSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_EKSConfigTemplateSpec_To_v1alpha3_EKSConfigTemplateSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha4_EKSConfigTemplate_To_v1alpha3_EKSConfigTemplate is an autogenerated conversion function. -func Convert_v1alpha4_EKSConfigTemplate_To_v1alpha3_EKSConfigTemplate(in *v1alpha4.EKSConfigTemplate, out *EKSConfigTemplate, s conversion.Scope) error { - return autoConvert_v1alpha4_EKSConfigTemplate_To_v1alpha3_EKSConfigTemplate(in, out, s) +// Convert_v1beta1_EKSConfigTemplate_To_v1alpha3_EKSConfigTemplate is an autogenerated conversion function. +func Convert_v1beta1_EKSConfigTemplate_To_v1alpha3_EKSConfigTemplate(in *v1beta1.EKSConfigTemplate, out *EKSConfigTemplate, s conversion.Scope) error { + return autoConvert_v1beta1_EKSConfigTemplate_To_v1alpha3_EKSConfigTemplate(in, out, s) } -func autoConvert_v1alpha3_EKSConfigTemplateList_To_v1alpha4_EKSConfigTemplateList(in *EKSConfigTemplateList, out *v1alpha4.EKSConfigTemplateList, s conversion.Scope) error { +func autoConvert_v1alpha3_EKSConfigTemplateList_To_v1beta1_EKSConfigTemplateList(in *EKSConfigTemplateList, out *v1beta1.EKSConfigTemplateList, s conversion.Scope) error { out.ListMeta = in.ListMeta - out.Items = *(*[]v1alpha4.EKSConfigTemplate)(unsafe.Pointer(&in.Items)) + out.Items = *(*[]v1beta1.EKSConfigTemplate)(unsafe.Pointer(&in.Items)) return nil } -// Convert_v1alpha3_EKSConfigTemplateList_To_v1alpha4_EKSConfigTemplateList is an autogenerated conversion function. -func Convert_v1alpha3_EKSConfigTemplateList_To_v1alpha4_EKSConfigTemplateList(in *EKSConfigTemplateList, out *v1alpha4.EKSConfigTemplateList, s conversion.Scope) error { - return autoConvert_v1alpha3_EKSConfigTemplateList_To_v1alpha4_EKSConfigTemplateList(in, out, s) +// Convert_v1alpha3_EKSConfigTemplateList_To_v1beta1_EKSConfigTemplateList is an autogenerated conversion function. +func Convert_v1alpha3_EKSConfigTemplateList_To_v1beta1_EKSConfigTemplateList(in *EKSConfigTemplateList, out *v1beta1.EKSConfigTemplateList, s conversion.Scope) error { + return autoConvert_v1alpha3_EKSConfigTemplateList_To_v1beta1_EKSConfigTemplateList(in, out, s) } -func autoConvert_v1alpha4_EKSConfigTemplateList_To_v1alpha3_EKSConfigTemplateList(in *v1alpha4.EKSConfigTemplateList, out *EKSConfigTemplateList, s conversion.Scope) error { +func autoConvert_v1beta1_EKSConfigTemplateList_To_v1alpha3_EKSConfigTemplateList(in *v1beta1.EKSConfigTemplateList, out *EKSConfigTemplateList, s conversion.Scope) error { out.ListMeta = in.ListMeta out.Items = *(*[]EKSConfigTemplate)(unsafe.Pointer(&in.Items)) return nil } -// Convert_v1alpha4_EKSConfigTemplateList_To_v1alpha3_EKSConfigTemplateList is an autogenerated conversion function. -func Convert_v1alpha4_EKSConfigTemplateList_To_v1alpha3_EKSConfigTemplateList(in *v1alpha4.EKSConfigTemplateList, out *EKSConfigTemplateList, s conversion.Scope) error { - return autoConvert_v1alpha4_EKSConfigTemplateList_To_v1alpha3_EKSConfigTemplateList(in, out, s) +// Convert_v1beta1_EKSConfigTemplateList_To_v1alpha3_EKSConfigTemplateList is an autogenerated conversion function. +func Convert_v1beta1_EKSConfigTemplateList_To_v1alpha3_EKSConfigTemplateList(in *v1beta1.EKSConfigTemplateList, out *EKSConfigTemplateList, s conversion.Scope) error { + return autoConvert_v1beta1_EKSConfigTemplateList_To_v1alpha3_EKSConfigTemplateList(in, out, s) } -func autoConvert_v1alpha3_EKSConfigTemplateResource_To_v1alpha4_EKSConfigTemplateResource(in *EKSConfigTemplateResource, out *v1alpha4.EKSConfigTemplateResource, s conversion.Scope) error { - if err := Convert_v1alpha3_EKSConfigSpec_To_v1alpha4_EKSConfigSpec(&in.Spec, &out.Spec, s); err != nil { +func autoConvert_v1alpha3_EKSConfigTemplateResource_To_v1beta1_EKSConfigTemplateResource(in *EKSConfigTemplateResource, out *v1beta1.EKSConfigTemplateResource, s conversion.Scope) error { + if err := Convert_v1alpha3_EKSConfigSpec_To_v1beta1_EKSConfigSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha3_EKSConfigTemplateResource_To_v1alpha4_EKSConfigTemplateResource is an autogenerated conversion function. -func Convert_v1alpha3_EKSConfigTemplateResource_To_v1alpha4_EKSConfigTemplateResource(in *EKSConfigTemplateResource, out *v1alpha4.EKSConfigTemplateResource, s conversion.Scope) error { - return autoConvert_v1alpha3_EKSConfigTemplateResource_To_v1alpha4_EKSConfigTemplateResource(in, out, s) +// Convert_v1alpha3_EKSConfigTemplateResource_To_v1beta1_EKSConfigTemplateResource is an autogenerated conversion function. +func Convert_v1alpha3_EKSConfigTemplateResource_To_v1beta1_EKSConfigTemplateResource(in *EKSConfigTemplateResource, out *v1beta1.EKSConfigTemplateResource, s conversion.Scope) error { + return autoConvert_v1alpha3_EKSConfigTemplateResource_To_v1beta1_EKSConfigTemplateResource(in, out, s) } -func autoConvert_v1alpha4_EKSConfigTemplateResource_To_v1alpha3_EKSConfigTemplateResource(in *v1alpha4.EKSConfigTemplateResource, out *EKSConfigTemplateResource, s conversion.Scope) error { - if err := Convert_v1alpha4_EKSConfigSpec_To_v1alpha3_EKSConfigSpec(&in.Spec, &out.Spec, s); err != nil { +func autoConvert_v1beta1_EKSConfigTemplateResource_To_v1alpha3_EKSConfigTemplateResource(in *v1beta1.EKSConfigTemplateResource, out *EKSConfigTemplateResource, s conversion.Scope) error { + if err := Convert_v1beta1_EKSConfigSpec_To_v1alpha3_EKSConfigSpec(&in.Spec, &out.Spec, s); err != nil { return err } return nil } -// Convert_v1alpha4_EKSConfigTemplateResource_To_v1alpha3_EKSConfigTemplateResource is an autogenerated conversion function. -func Convert_v1alpha4_EKSConfigTemplateResource_To_v1alpha3_EKSConfigTemplateResource(in *v1alpha4.EKSConfigTemplateResource, out *EKSConfigTemplateResource, s conversion.Scope) error { - return autoConvert_v1alpha4_EKSConfigTemplateResource_To_v1alpha3_EKSConfigTemplateResource(in, out, s) +// Convert_v1beta1_EKSConfigTemplateResource_To_v1alpha3_EKSConfigTemplateResource is an autogenerated conversion function. +func Convert_v1beta1_EKSConfigTemplateResource_To_v1alpha3_EKSConfigTemplateResource(in *v1beta1.EKSConfigTemplateResource, out *EKSConfigTemplateResource, s conversion.Scope) error { + return autoConvert_v1beta1_EKSConfigTemplateResource_To_v1alpha3_EKSConfigTemplateResource(in, out, s) } -func autoConvert_v1alpha3_EKSConfigTemplateSpec_To_v1alpha4_EKSConfigTemplateSpec(in *EKSConfigTemplateSpec, out *v1alpha4.EKSConfigTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha3_EKSConfigTemplateResource_To_v1alpha4_EKSConfigTemplateResource(&in.Template, &out.Template, s); err != nil { +func autoConvert_v1alpha3_EKSConfigTemplateSpec_To_v1beta1_EKSConfigTemplateSpec(in *EKSConfigTemplateSpec, out *v1beta1.EKSConfigTemplateSpec, s conversion.Scope) error { + if err := Convert_v1alpha3_EKSConfigTemplateResource_To_v1beta1_EKSConfigTemplateResource(&in.Template, &out.Template, s); err != nil { return err } return nil } -// Convert_v1alpha3_EKSConfigTemplateSpec_To_v1alpha4_EKSConfigTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha3_EKSConfigTemplateSpec_To_v1alpha4_EKSConfigTemplateSpec(in *EKSConfigTemplateSpec, out *v1alpha4.EKSConfigTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_EKSConfigTemplateSpec_To_v1alpha4_EKSConfigTemplateSpec(in, out, s) +// Convert_v1alpha3_EKSConfigTemplateSpec_To_v1beta1_EKSConfigTemplateSpec is an autogenerated conversion function. +func Convert_v1alpha3_EKSConfigTemplateSpec_To_v1beta1_EKSConfigTemplateSpec(in *EKSConfigTemplateSpec, out *v1beta1.EKSConfigTemplateSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_EKSConfigTemplateSpec_To_v1beta1_EKSConfigTemplateSpec(in, out, s) } -func autoConvert_v1alpha4_EKSConfigTemplateSpec_To_v1alpha3_EKSConfigTemplateSpec(in *v1alpha4.EKSConfigTemplateSpec, out *EKSConfigTemplateSpec, s conversion.Scope) error { - if err := Convert_v1alpha4_EKSConfigTemplateResource_To_v1alpha3_EKSConfigTemplateResource(&in.Template, &out.Template, s); err != nil { +func autoConvert_v1beta1_EKSConfigTemplateSpec_To_v1alpha3_EKSConfigTemplateSpec(in *v1beta1.EKSConfigTemplateSpec, out *EKSConfigTemplateSpec, s conversion.Scope) error { + if err := Convert_v1beta1_EKSConfigTemplateResource_To_v1alpha3_EKSConfigTemplateResource(&in.Template, &out.Template, s); err != nil { return err } return nil } -// Convert_v1alpha4_EKSConfigTemplateSpec_To_v1alpha3_EKSConfigTemplateSpec is an autogenerated conversion function. -func Convert_v1alpha4_EKSConfigTemplateSpec_To_v1alpha3_EKSConfigTemplateSpec(in *v1alpha4.EKSConfigTemplateSpec, out *EKSConfigTemplateSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_EKSConfigTemplateSpec_To_v1alpha3_EKSConfigTemplateSpec(in, out, s) +// Convert_v1beta1_EKSConfigTemplateSpec_To_v1alpha3_EKSConfigTemplateSpec is an autogenerated conversion function. +func Convert_v1beta1_EKSConfigTemplateSpec_To_v1alpha3_EKSConfigTemplateSpec(in *v1beta1.EKSConfigTemplateSpec, out *EKSConfigTemplateSpec, s conversion.Scope) error { + return autoConvert_v1beta1_EKSConfigTemplateSpec_To_v1alpha3_EKSConfigTemplateSpec(in, out, s) } diff --git a/bootstrap/eks/api/v1alpha3/zz_generated.deepcopy.go b/bootstrap/eks/api/v1alpha3/zz_generated.deepcopy.go index ec1cb84338..6140e5b036 100644 --- a/bootstrap/eks/api/v1alpha3/zz_generated.deepcopy.go +++ b/bootstrap/eks/api/v1alpha3/zz_generated.deepcopy.go @@ -21,7 +21,7 @@ limitations under the License. package v1alpha3 import ( - runtime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime" apiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" ) diff --git a/bootstrap/eks/api/v1alpha4/condition_consts.go b/bootstrap/eks/api/v1alpha4/condition_consts.go index c778d28500..a2f027a80b 100644 --- a/bootstrap/eks/api/v1alpha4/condition_consts.go +++ b/bootstrap/eks/api/v1alpha4/condition_consts.go @@ -16,7 +16,7 @@ limitations under the License. package v1alpha4 -import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" +import clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" // Conditions and condition Reasons for the EKSConfig object // FROM: https://github.com/kubernetes-sigs/cluster-api/blob/master/bootstrap/kubeadm/api/v1alpha4/condition_consts.go @@ -27,7 +27,7 @@ const ( // 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 clusterv1.ConditionType = "DataSecretAvailable" + DataSecretAvailableCondition clusterv1alpha4.ConditionType = "DataSecretAvailable" // DataSecretGenerationFailedReason (Severity=Warning) documents a EKSConfig controller detecting // an error while generating a data secret; those kind of errors are usually due to misconfigurations diff --git a/bootstrap/eks/api/v1alpha4/conversion.go b/bootstrap/eks/api/v1alpha4/conversion.go index f8649006a9..69c1b74cfb 100644 --- a/bootstrap/eks/api/v1alpha4/conversion.go +++ b/bootstrap/eks/api/v1alpha4/conversion.go @@ -16,14 +16,63 @@ limitations under the License. package v1alpha4 -// Hub marks EKSConfig as a conversion hub. -func (*EKSConfig) Hub() {} +import ( + "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1beta1" + "sigs.k8s.io/controller-runtime/pkg/conversion" +) -// Hub marks EKSConfigList as a conversion hub. -func (*EKSConfigList) Hub() {} +// ConvertTo converts the v1alpha4 EKSConfig receiver to a v1beta1 EKSConfig. +func (r *EKSConfig) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.EKSConfig) -// Hub marks EKSConfigTemplate as a conversion hub. -func (*EKSConfigTemplate) Hub() {} + return Convert_v1alpha4_EKSConfig_To_v1beta1_EKSConfig(r, dst, nil) +} -// Hub marks EKSConfigTemplateList as a conversion hub. -func (*EKSConfigTemplateList) Hub() {} +// ConvertFrom converts the v1beta1 EKSConfig receiver to a v1alpha4 EKSConfig. +func (r *EKSConfig) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.EKSConfig) + + return Convert_v1beta1_EKSConfig_To_v1alpha4_EKSConfig(src, r, nil) +} + +// ConvertTo converts the v1alpha4 EKSConfigList receiver to a v1beta1 EKSConfigList. +func (r *EKSConfigList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.EKSConfigList) + + return Convert_v1alpha4_EKSConfigList_To_v1beta1_EKSConfigList(r, dst, nil) +} + +// ConvertFrom converts the v1beta1 EKSConfigList receiver to a v1alpha4 EKSConfigList. +func (r *EKSConfigList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.EKSConfigList) + + return Convert_v1beta1_EKSConfigList_To_v1alpha4_EKSConfigList(src, r, nil) +} + +// ConvertTo converts the v1alpha4 EKSConfigTemplate receiver to a v1beta1 EKSConfigTemplate. +func (r *EKSConfigTemplate) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.EKSConfigTemplate) + + return Convert_v1alpha4_EKSConfigTemplate_To_v1beta1_EKSConfigTemplate(r, dst, nil) +} + +// ConvertFrom converts the v1beta1 EKSConfigTemplate receiver to a v1alpha4 EKSConfigTemplate. +func (r *EKSConfigTemplate) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.EKSConfigTemplate) + + return Convert_v1beta1_EKSConfigTemplate_To_v1alpha4_EKSConfigTemplate(src, r, nil) +} + +// ConvertTo converts the v1alpha4 EKSConfigTemplateList receiver to a v1beta1 EKSConfigTemplateList. +func (r *EKSConfigTemplateList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.EKSConfigTemplateList) + + return Convert_v1alpha4_EKSConfigTemplateList_To_v1beta1_EKSConfigTemplateList(r, dst, nil) +} + +// ConvertFrom converts the v1beta1 EKSConfigTemplateList receiver to a v1alpha4 EKSConfigTemplateList. +func (r *EKSConfigTemplateList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.EKSConfigTemplateList) + + return Convert_v1beta1_EKSConfigTemplateList_To_v1alpha4_EKSConfigTemplateList(src, r, nil) +} diff --git a/bootstrap/eks/api/v1alpha4/conversion_test.go b/bootstrap/eks/api/v1alpha4/conversion_test.go new file mode 100644 index 0000000000..336f3fbdf9 --- /dev/null +++ b/bootstrap/eks/api/v1alpha4/conversion_test.go @@ -0,0 +1,46 @@ +/* +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" + + runtime "k8s.io/apimachinery/pkg/runtime" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1beta1" + utilconversion "sigs.k8s.io/cluster-api/util/conversion" +) + +func TestFuzzyConversion(t *testing.T) { + g := NewWithT(t) + scheme := runtime.NewScheme() + g.Expect(AddToScheme(scheme)).To(Succeed()) + g.Expect(v1beta1.AddToScheme(scheme)).To(Succeed()) + + t.Run("for EKSConfig", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1beta1.EKSConfig{}, + Spoke: &EKSConfig{}, + })) + + t.Run("for EKSConfigTemplate", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1beta1.EKSConfigTemplate{}, + Spoke: &EKSConfigTemplate{}, + })) +} diff --git a/bootstrap/eks/api/v1alpha4/doc.go b/bootstrap/eks/api/v1alpha4/doc.go index a9d07c4752..3e2d29878d 100644 --- a/bootstrap/eks/api/v1alpha4/doc.go +++ b/bootstrap/eks/api/v1alpha4/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +gencrdrefdocs:force // nolint: revive // +groupName=bootstrap.cluster.x-k8s.io +// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1beta1 package v1alpha4 diff --git a/bootstrap/eks/api/v1alpha4/eksconfig_types.go b/bootstrap/eks/api/v1alpha4/eksconfig_types.go index 6de0f62339..8783a3a7f8 100644 --- a/bootstrap/eks/api/v1alpha4/eksconfig_types.go +++ b/bootstrap/eks/api/v1alpha4/eksconfig_types.go @@ -18,12 +18,9 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" ) -// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! -// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. - // EKSConfigSpec defines the desired state of EKSConfig type EKSConfigSpec struct { // Passes the kubelet args into the EKS bootstrap script @@ -54,12 +51,11 @@ type EKSConfigStatus struct { // Conditions defines current service state of the EKSConfig. // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` } // +kubebuilder:object:root=true // +kubebuilder:resource:path=eksconfigs,scope=Namespaced,categories=cluster-api,shortName=eksc -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Bootstrap configuration is ready" // +kubebuilder:printcolumn:name="DataSecretName",type="string",JSONPath=".status.dataSecretName",description="Name of Secret containing bootstrap data" @@ -74,12 +70,12 @@ type EKSConfig struct { } // GetConditions returns the observations of the operational state of the EKSConfig resource. -func (r *EKSConfig) GetConditions() clusterv1.Conditions { +func (r *EKSConfig) GetConditions() clusterv1alpha4.Conditions { return r.Status.Conditions } -// SetConditions sets the underlying service state of the EKSConfig to the predescribed clusterv1.Conditions. -func (r *EKSConfig) SetConditions(conditions clusterv1.Conditions) { +// SetConditions sets the underlying service state of the EKSConfig to the predescribed clusterv1alpha4.Conditions. +func (r *EKSConfig) SetConditions(conditions clusterv1alpha4.Conditions) { r.Status.Conditions = conditions } diff --git a/bootstrap/eks/api/v1alpha4/eksconfigtemplate_types.go b/bootstrap/eks/api/v1alpha4/eksconfigtemplate_types.go index 77a9c1a2dd..fbb987f9de 100644 --- a/bootstrap/eks/api/v1alpha4/eksconfigtemplate_types.go +++ b/bootstrap/eks/api/v1alpha4/eksconfigtemplate_types.go @@ -32,7 +32,6 @@ type EKSConfigTemplateResource struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=eksconfigtemplates,scope=Namespaced,categories=cluster-api,shortName=eksct -// +kubebuilder:storageversion // EKSConfigTemplate is the Schema for the eksconfigtemplates API type EKSConfigTemplate struct { diff --git a/bootstrap/eks/api/v1alpha4/groupversion_info.go b/bootstrap/eks/api/v1alpha4/groupversion_info.go index fcc0433dc0..5f27a262d7 100644 --- a/bootstrap/eks/api/v1alpha4/groupversion_info.go +++ b/bootstrap/eks/api/v1alpha4/groupversion_info.go @@ -33,4 +33,6 @@ var ( // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme + + localSchemeBuilder = SchemeBuilder.SchemeBuilder ) diff --git a/bootstrap/eks/api/v1alpha4/webhook_suite_test.go b/bootstrap/eks/api/v1alpha4/webhook_suite_test.go new file mode 100644 index 0000000000..c921b0ab2f --- /dev/null +++ b/bootstrap/eks/api/v1alpha4/webhook_suite_test.go @@ -0,0 +1,78 @@ +/* +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" + "os" + "path" + "testing" + + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/client-go/kubernetes/scheme" + eksbootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1beta1" + "sigs.k8s.io/cluster-api-provider-aws/test/helpers" + ctrl "sigs.k8s.io/controller-runtime" + // +kubebuilder:scaffold:imports +) + +var ( + testEnv *helpers.TestEnvironment + ctx = ctrl.SetupSignalHandler() +) + +func TestMain(m *testing.M) { + code := 0 + defer func() { os.Exit(code) }() + setup() + defer teardown() + code = m.Run() +} + +func setup() { + utilruntime.Must(AddToScheme(scheme.Scheme)) + utilruntime.Must(eksbootstrapv1.AddToScheme(scheme.Scheme)) + + testEnvConfig := helpers.NewTestEnvironmentConfiguration([]string{ + path.Join("bootstrap", "eks", "config", "crd", "bases"), + }, + ).WithWebhookConfiguration("unmanaged", path.Join("bootstrap", "eks", "config", "webhook", "manifests.yaml")) + var err error + testEnv, err = testEnvConfig.Build() + if err != nil { + panic(err) + } + if err := (&eksbootstrapv1.EKSConfig{}).SetupWebhookWithManager(testEnv); err != nil { + panic(fmt.Sprintf("Unable to setup AWSCluster webhook: %v", err)) + } + if err := (&eksbootstrapv1.EKSConfigTemplate{}).SetupWebhookWithManager(testEnv); err != nil { + panic(fmt.Sprintf("Unable to setup AWSCluster webhook: %v", err)) + } + go func() { + fmt.Println("Starting the manager") + if err := testEnv.StartManager(ctx); err != nil { + panic(fmt.Sprintf("Failed to start the envtest manager: %v", err)) + } + }() + testEnv.WaitForWebhooks() +} + +func teardown() { + if err := testEnv.Stop(); err != nil { + panic(fmt.Sprintf("Failed to stop envtest: %v", err)) + } +} diff --git a/bootstrap/eks/api/v1alpha4/zz_generated.conversion.go b/bootstrap/eks/api/v1alpha4/zz_generated.conversion.go new file mode 100644 index 0000000000..7650b8234a --- /dev/null +++ b/bootstrap/eks/api/v1alpha4/zz_generated.conversion.go @@ -0,0 +1,361 @@ +// +build !ignore_autogenerated_conversions + +/* +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" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1beta1" + apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + apiv1beta1 "sigs.k8s.io/cluster-api/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((*EKSConfig)(nil), (*v1beta1.EKSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_EKSConfig_To_v1beta1_EKSConfig(a.(*EKSConfig), b.(*v1beta1.EKSConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.EKSConfig)(nil), (*EKSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EKSConfig_To_v1alpha4_EKSConfig(a.(*v1beta1.EKSConfig), b.(*EKSConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*EKSConfigList)(nil), (*v1beta1.EKSConfigList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_EKSConfigList_To_v1beta1_EKSConfigList(a.(*EKSConfigList), b.(*v1beta1.EKSConfigList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.EKSConfigList)(nil), (*EKSConfigList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EKSConfigList_To_v1alpha4_EKSConfigList(a.(*v1beta1.EKSConfigList), b.(*EKSConfigList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*EKSConfigSpec)(nil), (*v1beta1.EKSConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_EKSConfigSpec_To_v1beta1_EKSConfigSpec(a.(*EKSConfigSpec), b.(*v1beta1.EKSConfigSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.EKSConfigSpec)(nil), (*EKSConfigSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EKSConfigSpec_To_v1alpha4_EKSConfigSpec(a.(*v1beta1.EKSConfigSpec), b.(*EKSConfigSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*EKSConfigStatus)(nil), (*v1beta1.EKSConfigStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_EKSConfigStatus_To_v1beta1_EKSConfigStatus(a.(*EKSConfigStatus), b.(*v1beta1.EKSConfigStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.EKSConfigStatus)(nil), (*EKSConfigStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EKSConfigStatus_To_v1alpha4_EKSConfigStatus(a.(*v1beta1.EKSConfigStatus), b.(*EKSConfigStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*EKSConfigTemplate)(nil), (*v1beta1.EKSConfigTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_EKSConfigTemplate_To_v1beta1_EKSConfigTemplate(a.(*EKSConfigTemplate), b.(*v1beta1.EKSConfigTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.EKSConfigTemplate)(nil), (*EKSConfigTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EKSConfigTemplate_To_v1alpha4_EKSConfigTemplate(a.(*v1beta1.EKSConfigTemplate), b.(*EKSConfigTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*EKSConfigTemplateList)(nil), (*v1beta1.EKSConfigTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_EKSConfigTemplateList_To_v1beta1_EKSConfigTemplateList(a.(*EKSConfigTemplateList), b.(*v1beta1.EKSConfigTemplateList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.EKSConfigTemplateList)(nil), (*EKSConfigTemplateList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EKSConfigTemplateList_To_v1alpha4_EKSConfigTemplateList(a.(*v1beta1.EKSConfigTemplateList), b.(*EKSConfigTemplateList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*EKSConfigTemplateResource)(nil), (*v1beta1.EKSConfigTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_EKSConfigTemplateResource_To_v1beta1_EKSConfigTemplateResource(a.(*EKSConfigTemplateResource), b.(*v1beta1.EKSConfigTemplateResource), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.EKSConfigTemplateResource)(nil), (*EKSConfigTemplateResource)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EKSConfigTemplateResource_To_v1alpha4_EKSConfigTemplateResource(a.(*v1beta1.EKSConfigTemplateResource), b.(*EKSConfigTemplateResource), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*EKSConfigTemplateSpec)(nil), (*v1beta1.EKSConfigTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_EKSConfigTemplateSpec_To_v1beta1_EKSConfigTemplateSpec(a.(*EKSConfigTemplateSpec), b.(*v1beta1.EKSConfigTemplateSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.EKSConfigTemplateSpec)(nil), (*EKSConfigTemplateSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EKSConfigTemplateSpec_To_v1alpha4_EKSConfigTemplateSpec(a.(*v1beta1.EKSConfigTemplateSpec), b.(*EKSConfigTemplateSpec), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha4_EKSConfig_To_v1beta1_EKSConfig(in *EKSConfig, out *v1beta1.EKSConfig, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_EKSConfigSpec_To_v1beta1_EKSConfigSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_EKSConfigStatus_To_v1beta1_EKSConfigStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_EKSConfig_To_v1beta1_EKSConfig is an autogenerated conversion function. +func Convert_v1alpha4_EKSConfig_To_v1beta1_EKSConfig(in *EKSConfig, out *v1beta1.EKSConfig, s conversion.Scope) error { + return autoConvert_v1alpha4_EKSConfig_To_v1beta1_EKSConfig(in, out, s) +} + +func autoConvert_v1beta1_EKSConfig_To_v1alpha4_EKSConfig(in *v1beta1.EKSConfig, out *EKSConfig, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_EKSConfigSpec_To_v1alpha4_EKSConfigSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_EKSConfigStatus_To_v1alpha4_EKSConfigStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_EKSConfig_To_v1alpha4_EKSConfig is an autogenerated conversion function. +func Convert_v1beta1_EKSConfig_To_v1alpha4_EKSConfig(in *v1beta1.EKSConfig, out *EKSConfig, s conversion.Scope) error { + return autoConvert_v1beta1_EKSConfig_To_v1alpha4_EKSConfig(in, out, s) +} + +func autoConvert_v1alpha4_EKSConfigList_To_v1beta1_EKSConfigList(in *EKSConfigList, out *v1beta1.EKSConfigList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta1.EKSConfig, len(*in)) + for i := range *in { + if err := Convert_v1alpha4_EKSConfig_To_v1beta1_EKSConfig(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha4_EKSConfigList_To_v1beta1_EKSConfigList is an autogenerated conversion function. +func Convert_v1alpha4_EKSConfigList_To_v1beta1_EKSConfigList(in *EKSConfigList, out *v1beta1.EKSConfigList, s conversion.Scope) error { + return autoConvert_v1alpha4_EKSConfigList_To_v1beta1_EKSConfigList(in, out, s) +} + +func autoConvert_v1beta1_EKSConfigList_To_v1alpha4_EKSConfigList(in *v1beta1.EKSConfigList, out *EKSConfigList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]EKSConfig, len(*in)) + for i := range *in { + if err := Convert_v1beta1_EKSConfig_To_v1alpha4_EKSConfig(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_EKSConfigList_To_v1alpha4_EKSConfigList is an autogenerated conversion function. +func Convert_v1beta1_EKSConfigList_To_v1alpha4_EKSConfigList(in *v1beta1.EKSConfigList, out *EKSConfigList, s conversion.Scope) error { + return autoConvert_v1beta1_EKSConfigList_To_v1alpha4_EKSConfigList(in, out, s) +} + +func autoConvert_v1alpha4_EKSConfigSpec_To_v1beta1_EKSConfigSpec(in *EKSConfigSpec, out *v1beta1.EKSConfigSpec, s conversion.Scope) error { + out.KubeletExtraArgs = *(*map[string]string)(unsafe.Pointer(&in.KubeletExtraArgs)) + return nil +} + +// Convert_v1alpha4_EKSConfigSpec_To_v1beta1_EKSConfigSpec is an autogenerated conversion function. +func Convert_v1alpha4_EKSConfigSpec_To_v1beta1_EKSConfigSpec(in *EKSConfigSpec, out *v1beta1.EKSConfigSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_EKSConfigSpec_To_v1beta1_EKSConfigSpec(in, out, s) +} + +func autoConvert_v1beta1_EKSConfigSpec_To_v1alpha4_EKSConfigSpec(in *v1beta1.EKSConfigSpec, out *EKSConfigSpec, s conversion.Scope) error { + out.KubeletExtraArgs = *(*map[string]string)(unsafe.Pointer(&in.KubeletExtraArgs)) + return nil +} + +// Convert_v1beta1_EKSConfigSpec_To_v1alpha4_EKSConfigSpec is an autogenerated conversion function. +func Convert_v1beta1_EKSConfigSpec_To_v1alpha4_EKSConfigSpec(in *v1beta1.EKSConfigSpec, out *EKSConfigSpec, s conversion.Scope) error { + return autoConvert_v1beta1_EKSConfigSpec_To_v1alpha4_EKSConfigSpec(in, out, s) +} + +func autoConvert_v1alpha4_EKSConfigStatus_To_v1beta1_EKSConfigStatus(in *EKSConfigStatus, out *v1beta1.EKSConfigStatus, 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_EKSConfigStatus_To_v1beta1_EKSConfigStatus is an autogenerated conversion function. +func Convert_v1alpha4_EKSConfigStatus_To_v1beta1_EKSConfigStatus(in *EKSConfigStatus, out *v1beta1.EKSConfigStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_EKSConfigStatus_To_v1beta1_EKSConfigStatus(in, out, s) +} + +func autoConvert_v1beta1_EKSConfigStatus_To_v1alpha4_EKSConfigStatus(in *v1beta1.EKSConfigStatus, out *EKSConfigStatus, 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_EKSConfigStatus_To_v1alpha4_EKSConfigStatus is an autogenerated conversion function. +func Convert_v1beta1_EKSConfigStatus_To_v1alpha4_EKSConfigStatus(in *v1beta1.EKSConfigStatus, out *EKSConfigStatus, s conversion.Scope) error { + return autoConvert_v1beta1_EKSConfigStatus_To_v1alpha4_EKSConfigStatus(in, out, s) +} + +func autoConvert_v1alpha4_EKSConfigTemplate_To_v1beta1_EKSConfigTemplate(in *EKSConfigTemplate, out *v1beta1.EKSConfigTemplate, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_EKSConfigTemplateSpec_To_v1beta1_EKSConfigTemplateSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_EKSConfigTemplate_To_v1beta1_EKSConfigTemplate is an autogenerated conversion function. +func Convert_v1alpha4_EKSConfigTemplate_To_v1beta1_EKSConfigTemplate(in *EKSConfigTemplate, out *v1beta1.EKSConfigTemplate, s conversion.Scope) error { + return autoConvert_v1alpha4_EKSConfigTemplate_To_v1beta1_EKSConfigTemplate(in, out, s) +} + +func autoConvert_v1beta1_EKSConfigTemplate_To_v1alpha4_EKSConfigTemplate(in *v1beta1.EKSConfigTemplate, out *EKSConfigTemplate, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_EKSConfigTemplateSpec_To_v1alpha4_EKSConfigTemplateSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_EKSConfigTemplate_To_v1alpha4_EKSConfigTemplate is an autogenerated conversion function. +func Convert_v1beta1_EKSConfigTemplate_To_v1alpha4_EKSConfigTemplate(in *v1beta1.EKSConfigTemplate, out *EKSConfigTemplate, s conversion.Scope) error { + return autoConvert_v1beta1_EKSConfigTemplate_To_v1alpha4_EKSConfigTemplate(in, out, s) +} + +func autoConvert_v1alpha4_EKSConfigTemplateList_To_v1beta1_EKSConfigTemplateList(in *EKSConfigTemplateList, out *v1beta1.EKSConfigTemplateList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1beta1.EKSConfigTemplate)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1alpha4_EKSConfigTemplateList_To_v1beta1_EKSConfigTemplateList is an autogenerated conversion function. +func Convert_v1alpha4_EKSConfigTemplateList_To_v1beta1_EKSConfigTemplateList(in *EKSConfigTemplateList, out *v1beta1.EKSConfigTemplateList, s conversion.Scope) error { + return autoConvert_v1alpha4_EKSConfigTemplateList_To_v1beta1_EKSConfigTemplateList(in, out, s) +} + +func autoConvert_v1beta1_EKSConfigTemplateList_To_v1alpha4_EKSConfigTemplateList(in *v1beta1.EKSConfigTemplateList, out *EKSConfigTemplateList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]EKSConfigTemplate)(unsafe.Pointer(&in.Items)) + return nil +} + +// Convert_v1beta1_EKSConfigTemplateList_To_v1alpha4_EKSConfigTemplateList is an autogenerated conversion function. +func Convert_v1beta1_EKSConfigTemplateList_To_v1alpha4_EKSConfigTemplateList(in *v1beta1.EKSConfigTemplateList, out *EKSConfigTemplateList, s conversion.Scope) error { + return autoConvert_v1beta1_EKSConfigTemplateList_To_v1alpha4_EKSConfigTemplateList(in, out, s) +} + +func autoConvert_v1alpha4_EKSConfigTemplateResource_To_v1beta1_EKSConfigTemplateResource(in *EKSConfigTemplateResource, out *v1beta1.EKSConfigTemplateResource, s conversion.Scope) error { + if err := Convert_v1alpha4_EKSConfigSpec_To_v1beta1_EKSConfigSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_EKSConfigTemplateResource_To_v1beta1_EKSConfigTemplateResource is an autogenerated conversion function. +func Convert_v1alpha4_EKSConfigTemplateResource_To_v1beta1_EKSConfigTemplateResource(in *EKSConfigTemplateResource, out *v1beta1.EKSConfigTemplateResource, s conversion.Scope) error { + return autoConvert_v1alpha4_EKSConfigTemplateResource_To_v1beta1_EKSConfigTemplateResource(in, out, s) +} + +func autoConvert_v1beta1_EKSConfigTemplateResource_To_v1alpha4_EKSConfigTemplateResource(in *v1beta1.EKSConfigTemplateResource, out *EKSConfigTemplateResource, s conversion.Scope) error { + if err := Convert_v1beta1_EKSConfigSpec_To_v1alpha4_EKSConfigSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_EKSConfigTemplateResource_To_v1alpha4_EKSConfigTemplateResource is an autogenerated conversion function. +func Convert_v1beta1_EKSConfigTemplateResource_To_v1alpha4_EKSConfigTemplateResource(in *v1beta1.EKSConfigTemplateResource, out *EKSConfigTemplateResource, s conversion.Scope) error { + return autoConvert_v1beta1_EKSConfigTemplateResource_To_v1alpha4_EKSConfigTemplateResource(in, out, s) +} + +func autoConvert_v1alpha4_EKSConfigTemplateSpec_To_v1beta1_EKSConfigTemplateSpec(in *EKSConfigTemplateSpec, out *v1beta1.EKSConfigTemplateSpec, s conversion.Scope) error { + if err := Convert_v1alpha4_EKSConfigTemplateResource_To_v1beta1_EKSConfigTemplateResource(&in.Template, &out.Template, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_EKSConfigTemplateSpec_To_v1beta1_EKSConfigTemplateSpec is an autogenerated conversion function. +func Convert_v1alpha4_EKSConfigTemplateSpec_To_v1beta1_EKSConfigTemplateSpec(in *EKSConfigTemplateSpec, out *v1beta1.EKSConfigTemplateSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_EKSConfigTemplateSpec_To_v1beta1_EKSConfigTemplateSpec(in, out, s) +} + +func autoConvert_v1beta1_EKSConfigTemplateSpec_To_v1alpha4_EKSConfigTemplateSpec(in *v1beta1.EKSConfigTemplateSpec, out *EKSConfigTemplateSpec, s conversion.Scope) error { + if err := Convert_v1beta1_EKSConfigTemplateResource_To_v1alpha4_EKSConfigTemplateResource(&in.Template, &out.Template, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_EKSConfigTemplateSpec_To_v1alpha4_EKSConfigTemplateSpec is an autogenerated conversion function. +func Convert_v1beta1_EKSConfigTemplateSpec_To_v1alpha4_EKSConfigTemplateSpec(in *v1beta1.EKSConfigTemplateSpec, out *EKSConfigTemplateSpec, s conversion.Scope) error { + return autoConvert_v1beta1_EKSConfigTemplateSpec_To_v1alpha4_EKSConfigTemplateSpec(in, out, s) +} diff --git a/bootstrap/eks/api/v1beta1/condition_consts.go b/bootstrap/eks/api/v1beta1/condition_consts.go new file mode 100644 index 0000000000..9f55bb2ad5 --- /dev/null +++ b/bootstrap/eks/api/v1beta1/condition_consts.go @@ -0,0 +1,50 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + +// Conditions and condition Reasons for the EKSConfig object +// FROM: https://github.com/kubernetes-sigs/cluster-api/blob/master/bootstrap/kubeadm/api/v1beta1/condition_consts.go + +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 clusterv1.ConditionType = "DataSecretAvailable" + + // DataSecretGenerationFailedReason (Severity=Warning) documents a EKSConfig 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" + + // 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 EKSConfig controller ensure this pre-condition is satisfied. + WaitingForClusterInfrastructureReason = "WaitingForClusterInfrastructure" + + // WaitingForControlPlaneInitializationReason (Severity=Info) documents a bootstrap secret generation process + // waiting for the control plane to be initialized. + // + // NOTE: This is a pre-condition for starting to create machines; + // the EKSConfig controller ensure this pre-condition is satisfied. + WaitingForControlPlaneInitializationReason = "WaitingForControlPlaneInitialization" +) diff --git a/bootstrap/eks/api/v1beta1/conversion.go b/bootstrap/eks/api/v1beta1/conversion.go new file mode 100644 index 0000000000..7765e5daa0 --- /dev/null +++ b/bootstrap/eks/api/v1beta1/conversion.go @@ -0,0 +1,29 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +// Hub marks EKSConfig as a conversion hub. +func (*EKSConfig) Hub() {} + +// Hub marks EKSConfigList as a conversion hub. +func (*EKSConfigList) Hub() {} + +// Hub marks EKSConfigTemplate as a conversion hub. +func (*EKSConfigTemplate) Hub() {} + +// Hub marks EKSConfigTemplateList as a conversion hub. +func (*EKSConfigTemplateList) Hub() {} diff --git a/bootstrap/eks/api/v1beta1/doc.go b/bootstrap/eks/api/v1beta1/doc.go new file mode 100644 index 0000000000..84b5b68b4d --- /dev/null +++ b/bootstrap/eks/api/v1beta1/doc.go @@ -0,0 +1,20 @@ +/* +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. +*/ + +// +gencrdrefdocs:force // nolint: revive +// +groupName=bootstrap.cluster.x-k8s.io + +package v1beta1 diff --git a/bootstrap/eks/api/v1beta1/eksconfig_types.go b/bootstrap/eks/api/v1beta1/eksconfig_types.go new file mode 100644 index 0000000000..fc7a5fbfe6 --- /dev/null +++ b/bootstrap/eks/api/v1beta1/eksconfig_types.go @@ -0,0 +1,94 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" +) + +// EKSConfigSpec defines the desired state of Amazon EKS Bootstrap Configuration. +type EKSConfigSpec struct { + // KubeletExtraArgs passes the specified kubelet args into the Amazon EKS machine bootstrap script + // +optional + KubeletExtraArgs map[string]string `json:"kubeletExtraArgs,omitempty"` +} + +// EKSConfigStatus defines the observed state of the Amazon EKS Bootstrap Configuration. +type EKSConfigStatus struct { + // Ready indicates the BootstrapData secret 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 EKSConfig. + // +optional + Conditions clusterv1.Conditions `json:"conditions,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=eksconfigs,scope=Namespaced,categories=cluster-api,shortName=eksc +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Bootstrap configuration is ready" +// +kubebuilder:printcolumn:name="DataSecretName",type="string",JSONPath=".status.dataSecretName",description="Name of Secret containing bootstrap data" + +// EKSConfig is the schema for the Amazon EKS Machine Bootstrap Configuration API. +type EKSConfig struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec EKSConfigSpec `json:"spec,omitempty"` + Status EKSConfigStatus `json:"status,omitempty"` +} + +// GetConditions returns the observations of the operational state of the EKSConfig resource. +func (r *EKSConfig) GetConditions() clusterv1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the EKSConfig to the predescribed clusterv1.Conditions. +func (r *EKSConfig) SetConditions(conditions clusterv1.Conditions) { + r.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// EKSConfigList contains a list of EKSConfig. +type EKSConfigList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []EKSConfig `json:"items"` +} + +func init() { + SchemeBuilder.Register(&EKSConfig{}, &EKSConfigList{}) +} diff --git a/bootstrap/eks/api/v1alpha4/eksconfig_webhook.go b/bootstrap/eks/api/v1beta1/eksconfig_webhook.go similarity index 74% rename from bootstrap/eks/api/v1alpha4/eksconfig_webhook.go rename to bootstrap/eks/api/v1beta1/eksconfig_webhook.go index 6a90f8b3cb..209d19d4d7 100644 --- a/bootstrap/eks/api/v1alpha4/eksconfig_webhook.go +++ b/bootstrap/eks/api/v1beta1/eksconfig_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "k8s.io/apimachinery/pkg/runtime" @@ -29,8 +29,8 @@ func (r *EKSConfig) SetupWebhookWithManager(mgr ctrl.Manager) error { Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-bootstrap-cluster-x-k8s-io-v1alpha4-eksconfig,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=bootstrap.cluster.x-k8s.io,resources=eksconfig,versions=v1alpha4,name=validation.eksconfigs.bootstrap.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-bootstrap-cluster-x-k8s-io-v1alpha4-eksconfig,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=bootstrap.cluster.x-k8s.io,resources=eksconfig,versions=v1alpha4,name=default.eksconfigs.bootstrap.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-bootstrap-cluster-x-k8s-io-v1beta1-eksconfig,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=bootstrap.cluster.x-k8s.io,resources=eksconfig,versions=v1beta1,name=validation.eksconfigs.bootstrap.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-bootstrap-cluster-x-k8s-io-v1beta1-eksconfig,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=bootstrap.cluster.x-k8s.io,resources=eksconfig,versions=v1beta1,name=default.eksconfigs.bootstrap.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 var _ webhook.Defaulter = &EKSConfig{} var _ webhook.Validator = &EKSConfig{} diff --git a/bootstrap/eks/api/v1beta1/eksconfigtemplate_types.go b/bootstrap/eks/api/v1beta1/eksconfigtemplate_types.go new file mode 100644 index 0000000000..9005f35d60 --- /dev/null +++ b/bootstrap/eks/api/v1beta1/eksconfigtemplate_types.go @@ -0,0 +1,56 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// EKSConfigTemplateSpec defines the desired state of templated EKSConfig Amazon EKS Bootstrap Configuration resources. +type EKSConfigTemplateSpec struct { + Template EKSConfigTemplateResource `json:"template"` +} + +// EKSConfigTemplateResource defines the Template structure. +type EKSConfigTemplateResource struct { + Spec EKSConfigSpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=eksconfigtemplates,scope=Namespaced,categories=cluster-api,shortName=eksct +// +kubebuilder:storageversion + +// EKSConfigTemplate is the Amazon EKS Bootstrap Configuration Template API. +type EKSConfigTemplate struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec EKSConfigTemplateSpec `json:"spec,omitempty"` +} + +// +kubebuilder:object:root=true + +// EKSConfigTemplateList contains a list of Amazon EKS Bootstrap Configuration Templates. +type EKSConfigTemplateList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []EKSConfigTemplate `json:"items"` +} + +func init() { + SchemeBuilder.Register(&EKSConfigTemplate{}, &EKSConfigTemplateList{}) +} diff --git a/bootstrap/eks/api/v1alpha4/eksconfigtemplate_webhook.go b/bootstrap/eks/api/v1beta1/eksconfigtemplate_webhook.go similarity index 73% rename from bootstrap/eks/api/v1alpha4/eksconfigtemplate_webhook.go rename to bootstrap/eks/api/v1beta1/eksconfigtemplate_webhook.go index aa32109337..92e2065bf2 100644 --- a/bootstrap/eks/api/v1alpha4/eksconfigtemplate_webhook.go +++ b/bootstrap/eks/api/v1beta1/eksconfigtemplate_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "k8s.io/apimachinery/pkg/runtime" @@ -29,8 +29,8 @@ func (r *EKSConfigTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error { Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-bootstrap-cluster-x-k8s-io-v1alpha4-eksconfigtemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=bootstrap.cluster.x-k8s.io,resources=eksconfigtemplate,versions=v1alpha4,name=validation.eksconfigtemplates.bootstrap.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-bootstrap-cluster-x-k8s-io-v1alpha4-eksconfigtemplate,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=bootstrap.cluster.x-k8s.io,resources=eksconfigtemplate,versions=v1alpha4,name=default.eksconfigtemplates.bootstrap.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-bootstrap-cluster-x-k8s-io-v1beta1-eksconfigtemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=bootstrap.cluster.x-k8s.io,resources=eksconfigtemplate,versions=v1beta1,name=validation.eksconfigtemplates.bootstrap.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-bootstrap-cluster-x-k8s-io-v1beta1-eksconfigtemplate,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=bootstrap.cluster.x-k8s.io,resources=eksconfigtemplate,versions=v1beta1,name=default.eksconfigtemplates.bootstrap.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 var _ webhook.Defaulter = &EKSConfigTemplate{} var _ webhook.Validator = &EKSConfigTemplate{} diff --git a/bootstrap/eks/api/v1beta1/groupversion_info.go b/bootstrap/eks/api/v1beta1/groupversion_info.go new file mode 100644 index 0000000000..3bf5ffc19d --- /dev/null +++ b/bootstrap/eks/api/v1beta1/groupversion_info.go @@ -0,0 +1,36 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1beta1 contains API Schema definitions for the Amazon EKS Bootstrap v1beta1 API group +// +kubebuilder:object:generate=true +// +groupName=bootstrap.cluster.x-k8s.io +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects. + GroupVersion = schema.GroupVersion{Group: "bootstrap.cluster.x-k8s.io", Version: "v1beta1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/bootstrap/eks/api/v1beta1/zz_generated.deepcopy.go b/bootstrap/eks/api/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..5ffd7e16c0 --- /dev/null +++ b/bootstrap/eks/api/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,224 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime" + apiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EKSConfig) DeepCopyInto(out *EKSConfig) { + *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 EKSConfig. +func (in *EKSConfig) DeepCopy() *EKSConfig { + if in == nil { + return nil + } + out := new(EKSConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EKSConfig) 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 *EKSConfigList) DeepCopyInto(out *EKSConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]EKSConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EKSConfigList. +func (in *EKSConfigList) DeepCopy() *EKSConfigList { + if in == nil { + return nil + } + out := new(EKSConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EKSConfigList) 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 *EKSConfigSpec) DeepCopyInto(out *EKSConfigSpec) { + *out = *in + 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 + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EKSConfigSpec. +func (in *EKSConfigSpec) DeepCopy() *EKSConfigSpec { + if in == nil { + return nil + } + out := new(EKSConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EKSConfigStatus) DeepCopyInto(out *EKSConfigStatus) { + *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(apiv1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EKSConfigStatus. +func (in *EKSConfigStatus) DeepCopy() *EKSConfigStatus { + if in == nil { + return nil + } + out := new(EKSConfigStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EKSConfigTemplate) DeepCopyInto(out *EKSConfigTemplate) { + *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 EKSConfigTemplate. +func (in *EKSConfigTemplate) DeepCopy() *EKSConfigTemplate { + if in == nil { + return nil + } + out := new(EKSConfigTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EKSConfigTemplate) 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 *EKSConfigTemplateList) DeepCopyInto(out *EKSConfigTemplateList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]EKSConfigTemplate, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EKSConfigTemplateList. +func (in *EKSConfigTemplateList) DeepCopy() *EKSConfigTemplateList { + if in == nil { + return nil + } + out := new(EKSConfigTemplateList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EKSConfigTemplateList) 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 *EKSConfigTemplateResource) DeepCopyInto(out *EKSConfigTemplateResource) { + *out = *in + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EKSConfigTemplateResource. +func (in *EKSConfigTemplateResource) DeepCopy() *EKSConfigTemplateResource { + if in == nil { + return nil + } + out := new(EKSConfigTemplateResource) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EKSConfigTemplateSpec) DeepCopyInto(out *EKSConfigTemplateSpec) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EKSConfigTemplateSpec. +func (in *EKSConfigTemplateSpec) DeepCopy() *EKSConfigTemplateSpec { + if in == nil { + return nil + } + out := new(EKSConfigTemplateSpec) + in.DeepCopyInto(out) + return out +} diff --git a/bootstrap/eks/controllers/eksconfig_controller.go b/bootstrap/eks/controllers/eksconfig_controller.go index 54d267d130..45b5504ddb 100644 --- a/bootstrap/eks/controllers/eksconfig_controller.go +++ b/bootstrap/eks/controllers/eksconfig_controller.go @@ -27,12 +27,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/pointer" - bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha4" + eksbootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/internal/userdata" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" bsutil "sigs.k8s.io/cluster-api/bootstrap/util" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/feature" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" @@ -64,7 +64,7 @@ func (r *EKSConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( log := ctrl.LoggerFrom(ctx) // get EKSConfig - config := &bootstrapv1.EKSConfig{} + config := &eksbootstrapv1.EKSConfig{} if err := r.Client.Get(ctx, req.NamespacedName, config); err != nil { if apierrors.IsNotFound(err) { return ctrl.Result{}, nil @@ -119,7 +119,7 @@ func (r *EKSConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( defer func() { conditions.SetSummary(config, conditions.WithConditions( - bootstrapv1.DataSecretAvailableCondition, + eksbootstrapv1.DataSecretAvailableCondition, ), conditions.WithStepCounter(), ) @@ -139,7 +139,7 @@ func (r *EKSConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( return r.joinWorker(ctx, cluster, config) } -func (r *EKSConfigReconciler) joinWorker(ctx context.Context, cluster *clusterv1.Cluster, config *bootstrapv1.EKSConfig) (ctrl.Result, error) { +func (r *EKSConfigReconciler) joinWorker(ctx context.Context, cluster *clusterv1.Cluster, config *eksbootstrapv1.EKSConfig) (ctrl.Result, error) { log := ctrl.LoggerFrom(ctx) if config.Status.DataSecretName != nil { @@ -166,15 +166,15 @@ func (r *EKSConfigReconciler) joinWorker(ctx context.Context, cluster *clusterv1 if !cluster.Status.InfrastructureReady { log.Info("Cluster infrastructure is not ready") conditions.MarkFalse(config, - bootstrapv1.DataSecretAvailableCondition, - bootstrapv1.WaitingForClusterInfrastructureReason, + eksbootstrapv1.DataSecretAvailableCondition, + eksbootstrapv1.WaitingForClusterInfrastructureReason, clusterv1.ConditionSeverityInfo, "") return ctrl.Result{}, nil } if !conditions.IsTrue(cluster, clusterv1.ControlPlaneInitializedCondition) { log.Info("Control Plane has not yet been initialized") - conditions.MarkFalse(config, bootstrapv1.DataSecretAvailableCondition, bootstrapv1.WaitingForControlPlaneInitializationReason, clusterv1.ConditionSeverityInfo, "") + conditions.MarkFalse(config, eksbootstrapv1.DataSecretAvailableCondition, eksbootstrapv1.WaitingForControlPlaneInitializationReason, clusterv1.ConditionSeverityInfo, "") return ctrl.Result{}, nil } @@ -194,14 +194,14 @@ func (r *EKSConfigReconciler) joinWorker(ctx context.Context, cluster *clusterv1 }) if err != nil { log.Error(err, "Failed to create a worker join configuration") - conditions.MarkFalse(config, bootstrapv1.DataSecretAvailableCondition, bootstrapv1.DataSecretGenerationFailedReason, clusterv1.ConditionSeverityWarning, "") + conditions.MarkFalse(config, eksbootstrapv1.DataSecretAvailableCondition, eksbootstrapv1.DataSecretGenerationFailedReason, clusterv1.ConditionSeverityWarning, "") return ctrl.Result{}, err } // store userdata as secret if err := r.storeBootstrapData(ctx, cluster, config, userDataScript); err != nil { log.Error(err, "Failed to store bootstrap data") - conditions.MarkFalse(config, bootstrapv1.DataSecretAvailableCondition, bootstrapv1.DataSecretGenerationFailedReason, clusterv1.ConditionSeverityWarning, "") + conditions.MarkFalse(config, eksbootstrapv1.DataSecretAvailableCondition, eksbootstrapv1.DataSecretGenerationFailedReason, clusterv1.ConditionSeverityWarning, "") return ctrl.Result{}, err } @@ -210,7 +210,7 @@ func (r *EKSConfigReconciler) joinWorker(ctx context.Context, cluster *clusterv1 func (r *EKSConfigReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, option controller.Options) error { b := ctrl.NewControllerManagedBy(mgr). - For(&bootstrapv1.EKSConfig{}). + For(&eksbootstrapv1.EKSConfig{}). WithOptions(option). WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)). Watches( @@ -220,7 +220,7 @@ func (r *EKSConfigReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Man if feature.Gates.Enabled(feature.MachinePool) { b = b.Watches( - &source.Kind{Type: &expv1.MachinePool{}}, + &source.Kind{Type: &expclusterv1.MachinePool{}}, handler.EnqueueRequestsFromMapFunc(r.MachinePoolToBootstrapMapFunc), ) } @@ -244,7 +244,7 @@ func (r *EKSConfigReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Man // storeBootstrapData creates a new secret with the data passed in as input, // sets the reference in the configuration status and ready to true. -func (r *EKSConfigReconciler) storeBootstrapData(ctx context.Context, cluster *clusterv1.Cluster, config *bootstrapv1.EKSConfig, data []byte) error { +func (r *EKSConfigReconciler) storeBootstrapData(ctx context.Context, cluster *clusterv1.Cluster, config *eksbootstrapv1.EKSConfig, data []byte) error { log := ctrl.LoggerFrom(ctx) // as secret creation and scope.Config status patch are not atomic operations @@ -276,7 +276,7 @@ func (r *EKSConfigReconciler) storeBootstrapData(ctx context.Context, cluster *c config.Status.DataSecretName = pointer.StringPtr(secret.Name) config.Status.Ready = true - conditions.MarkTrue(config, bootstrapv1.DataSecretAvailableCondition) + conditions.MarkTrue(config, eksbootstrapv1.DataSecretAvailableCondition) return nil } @@ -289,7 +289,7 @@ func (r *EKSConfigReconciler) MachineToBootstrapMapFunc(o client.Object) []ctrl. if !ok { panic(fmt.Sprintf("Expected a Machine but got a %T", o)) } - if m.Spec.Bootstrap.ConfigRef != nil && m.Spec.Bootstrap.ConfigRef.GroupVersionKind() == bootstrapv1.GroupVersion.WithKind("EKSConfig") { + if m.Spec.Bootstrap.ConfigRef != nil && m.Spec.Bootstrap.ConfigRef.GroupVersionKind() == eksbootstrapv1.GroupVersion.WithKind("EKSConfig") { name := client.ObjectKey{Namespace: m.Namespace, Name: m.Spec.Bootstrap.ConfigRef.Name} result = append(result, ctrl.Request{NamespacedName: name}) } @@ -301,12 +301,12 @@ func (r *EKSConfigReconciler) MachineToBootstrapMapFunc(o client.Object) []ctrl. func (r *EKSConfigReconciler) MachinePoolToBootstrapMapFunc(o client.Object) []ctrl.Request { result := []ctrl.Request{} - m, ok := o.(*expv1.MachinePool) + m, ok := o.(*expclusterv1.MachinePool) if !ok { panic(fmt.Sprintf("Expected a MachinePool but got a %T", o)) } configRef := m.Spec.Template.Spec.Bootstrap.ConfigRef - if configRef != nil && configRef.GroupVersionKind().GroupKind() == bootstrapv1.GroupVersion.WithKind("EKSConfig").GroupKind() { + if configRef != nil && configRef.GroupVersionKind().GroupKind() == eksbootstrapv1.GroupVersion.WithKind("EKSConfig").GroupKind() { name := client.ObjectKey{Namespace: m.Namespace, Name: configRef.Name} result = append(result, ctrl.Request{NamespacedName: name}) } @@ -338,7 +338,7 @@ func (r *EKSConfigReconciler) ClusterToEKSConfigs(o client.Object) []ctrl.Reques for _, m := range machineList.Items { if m.Spec.Bootstrap.ConfigRef != nil && - m.Spec.Bootstrap.ConfigRef.GroupVersionKind().GroupKind() == bootstrapv1.GroupVersion.WithKind("EKSConfig").GroupKind() { + m.Spec.Bootstrap.ConfigRef.GroupVersionKind().GroupKind() == eksbootstrapv1.GroupVersion.WithKind("EKSConfig").GroupKind() { name := client.ObjectKey{Namespace: m.Namespace, Name: m.Spec.Bootstrap.ConfigRef.Name} result = append(result, ctrl.Request{NamespacedName: name}) } @@ -348,7 +348,7 @@ func (r *EKSConfigReconciler) ClusterToEKSConfigs(o client.Object) []ctrl.Reques } // Create the Secret containing bootstrap userdata. -func (r *EKSConfigReconciler) createBootstrapSecret(ctx context.Context, cluster *clusterv1.Cluster, config *bootstrapv1.EKSConfig, data []byte) error { +func (r *EKSConfigReconciler) createBootstrapSecret(ctx context.Context, cluster *clusterv1.Cluster, config *eksbootstrapv1.EKSConfig, data []byte) error { secret := &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Name: config.Name, @@ -358,7 +358,7 @@ func (r *EKSConfigReconciler) createBootstrapSecret(ctx context.Context, cluster }, OwnerReferences: []metav1.OwnerReference{ { - APIVersion: bootstrapv1.GroupVersion.String(), + APIVersion: eksbootstrapv1.GroupVersion.String(), Kind: "EKSConfig", Name: config.Name, UID: config.UID, diff --git a/bootstrap/eks/controllers/eksconfig_controller_reconciler_test.go b/bootstrap/eks/controllers/eksconfig_controller_reconciler_test.go index 374c0ffb95..f116488450 100644 --- a/bootstrap/eks/controllers/eksconfig_controller_reconciler_test.go +++ b/bootstrap/eks/controllers/eksconfig_controller_reconciler_test.go @@ -25,10 +25,10 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha4" + eksbootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/internal/userdata" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/controller-runtime/pkg/client" @@ -191,7 +191,7 @@ func newMachine(cluster *clusterv1.Cluster, name string) *clusterv1.Machine { Bootstrap: clusterv1.Bootstrap{ ConfigRef: &corev1.ObjectReference{ Kind: "EKSConfig", - APIVersion: bootstrapv1.GroupVersion.String(), + APIVersion: eksbootstrapv1.GroupVersion.String(), }, }, }, @@ -206,16 +206,16 @@ func newMachine(cluster *clusterv1.Cluster, name string) *clusterv1.Machine { } // newEKSConfig return an EKSConfig object; if machine is not nil, the EKSConfig is linked to the machine as well. -func newEKSConfig(machine *clusterv1.Machine) *bootstrapv1.EKSConfig { - config := &bootstrapv1.EKSConfig{ +func newEKSConfig(machine *clusterv1.Machine) *eksbootstrapv1.EKSConfig { + config := &eksbootstrapv1.EKSConfig{ TypeMeta: metav1.TypeMeta{ Kind: "EKSConfig", - APIVersion: bootstrapv1.GroupVersion.String(), + APIVersion: eksbootstrapv1.GroupVersion.String(), }, ObjectMeta: metav1.ObjectMeta{ Namespace: "default", }, - Spec: bootstrapv1.EKSConfigSpec{ + Spec: eksbootstrapv1.EKSConfigSpec{ KubeletExtraArgs: map[string]string{ "test-arg": "test-value", }, diff --git a/bootstrap/eks/controllers/eksconfig_controller_test.go b/bootstrap/eks/controllers/eksconfig_controller_test.go index 17c89fd096..37c397641d 100644 --- a/bootstrap/eks/controllers/eksconfig_controller_test.go +++ b/bootstrap/eks/controllers/eksconfig_controller_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/reconcile" ) diff --git a/bootstrap/eks/controllers/suite_test.go b/bootstrap/eks/controllers/suite_test.go index 460092c61d..10835ce21a 100644 --- a/bootstrap/eks/controllers/suite_test.go +++ b/bootstrap/eks/controllers/suite_test.go @@ -24,7 +24,7 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/test/helpers" ctrl "sigs.k8s.io/controller-runtime" // +kubebuilder:scaffold:imports diff --git a/cmd/clusterawsadm/ami/copy.go b/cmd/clusterawsadm/ami/copy.go index c71bdc6442..9a51229f46 100644 --- a/cmd/clusterawsadm/ami/copy.go +++ b/cmd/clusterawsadm/ami/copy.go @@ -27,7 +27,7 @@ import ( "github.com/go-logr/logr" "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - amiv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/ami/v1alpha1" + amiv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/ami/v1beta1" ec2service "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2" "sigs.k8s.io/cluster-api/util" ) diff --git a/cmd/clusterawsadm/ami/list.go b/cmd/clusterawsadm/ami/list.go index a57e3824ef..172ecb3a09 100644 --- a/cmd/clusterawsadm/ami/list.go +++ b/cmd/clusterawsadm/ami/list.go @@ -24,7 +24,7 @@ import ( "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ec2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - amiv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/ami/v1alpha1" + amiv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/ami/v1beta1" ) // ListInput defines the specs required to construct an AWSAMIList. diff --git a/cmd/clusterawsadm/api/ami/v1alpha1/doc.go b/cmd/clusterawsadm/api/ami/v1beta1/doc.go similarity index 87% rename from cmd/clusterawsadm/api/ami/v1alpha1/doc.go rename to cmd/clusterawsadm/api/ami/v1beta1/doc.go index e11288108b..02c8a45da8 100644 --- a/cmd/clusterawsadm/api/ami/v1alpha1/doc.go +++ b/cmd/clusterawsadm/api/ami/v1beta1/doc.go @@ -14,8 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package v1alpha1 contains API Schema definitions for the ami v1alpha1 API group +// Package v1beta1 contains API Schema definitions for the AMI v1beta1 API group // +kubebuilder:object:generate=true // +k8s:defaulter-gen=TypeMeta // +groupName=ami.aws.infrastructure.cluster.x-k8s.io -package v1alpha1 +package v1beta1 diff --git a/cmd/clusterawsadm/api/ami/v1alpha1/register.go b/cmd/clusterawsadm/api/ami/v1beta1/register.go similarity index 98% rename from cmd/clusterawsadm/api/ami/v1alpha1/register.go rename to cmd/clusterawsadm/api/ami/v1beta1/register.go index 5bd716fad5..1d242c7946 100644 --- a/cmd/clusterawsadm/api/ami/v1alpha1/register.go +++ b/cmd/clusterawsadm/api/ami/v1beta1/register.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -27,7 +27,7 @@ const GroupName = "ami.aws.infrastructure.cluster.x-k8s.io" var ( // SchemeGroupVersion is the fully qualified group and version. - SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} + SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} // SchemeBuilder is the scheme builder with scheme init functions to run for this API package. SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // localSchemeBuilder ïs a pointer to SchemeBuilder instance. Using localSchemeBuilder diff --git a/cmd/clusterawsadm/api/ami/v1alpha1/scheme/scheme.go b/cmd/clusterawsadm/api/ami/v1beta1/scheme/scheme.go similarity index 98% rename from cmd/clusterawsadm/api/ami/v1alpha1/scheme/scheme.go rename to cmd/clusterawsadm/api/ami/v1beta1/scheme/scheme.go index 5150c53613..cbebc4bb60 100644 --- a/cmd/clusterawsadm/api/ami/v1alpha1/scheme/scheme.go +++ b/cmd/clusterawsadm/api/ami/v1beta1/scheme/scheme.go @@ -19,7 +19,7 @@ package scheme import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" - amiv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/ami/v1alpha1" + amiv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/ami/v1beta1" ) // Utility functions for the bootstrap.aws.infrastructure.cluster.x-k8s.io API group. diff --git a/cmd/clusterawsadm/api/ami/v1alpha1/types.go b/cmd/clusterawsadm/api/ami/v1beta1/types.go similarity index 99% rename from cmd/clusterawsadm/api/ami/v1alpha1/types.go rename to cmd/clusterawsadm/api/ami/v1beta1/types.go index 21a27fc5c5..c90e1dad5c 100644 --- a/cmd/clusterawsadm/api/ami/v1alpha1/types.go +++ b/cmd/clusterawsadm/api/ami/v1beta1/types.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha1 +package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/cmd/clusterawsadm/api/ami/v1alpha1/zz_generated.deepcopy.go b/cmd/clusterawsadm/api/ami/v1beta1/zz_generated.deepcopy.go similarity index 99% rename from cmd/clusterawsadm/api/ami/v1alpha1/zz_generated.deepcopy.go rename to cmd/clusterawsadm/api/ami/v1beta1/zz_generated.deepcopy.go index ed94999521..89cb4cbb96 100644 --- a/cmd/clusterawsadm/api/ami/v1alpha1/zz_generated.deepcopy.go +++ b/cmd/clusterawsadm/api/ami/v1beta1/zz_generated.deepcopy.go @@ -18,7 +18,7 @@ limitations under the License. // Code generated by controller-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( "k8s.io/apimachinery/pkg/runtime" diff --git a/cmd/clusterawsadm/api/iam/v1alpha1/zz_generated.defaults.go b/cmd/clusterawsadm/api/ami/v1beta1/zz_generated.defaults.go similarity index 98% rename from cmd/clusterawsadm/api/iam/v1alpha1/zz_generated.defaults.go rename to cmd/clusterawsadm/api/ami/v1beta1/zz_generated.defaults.go index dd621a3acd..73e63fc114 100644 --- a/cmd/clusterawsadm/api/iam/v1alpha1/zz_generated.defaults.go +++ b/cmd/clusterawsadm/api/ami/v1beta1/zz_generated.defaults.go @@ -18,7 +18,7 @@ limitations under the License. // Code generated by defaulter-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( runtime "k8s.io/apimachinery/pkg/runtime" diff --git a/cmd/clusterawsadm/api/bootstrap/v1alpha1/defaults.go b/cmd/clusterawsadm/api/bootstrap/v1alpha1/defaults.go index 62dc9dd1bc..962d8ac17a 100644 --- a/cmd/clusterawsadm/api/bootstrap/v1alpha1/defaults.go +++ b/cmd/clusterawsadm/api/bootstrap/v1alpha1/defaults.go @@ -19,8 +19,9 @@ package v1alpha1 import ( runtime "k8s.io/apimachinery/pkg/runtime" utilpointer "k8s.io/utils/pointer" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ) const ( @@ -48,7 +49,7 @@ func SetDefaults_BootstrapUser(obj *BootstrapUser) { //nolint:golint,stylecheck // SetDefaults_AWSIAMConfigurationSpec is used by defaulter-gen. func SetDefaults_AWSIAMConfigurationSpec(obj *AWSIAMConfigurationSpec) { //nolint:golint,stylecheck if obj.NameSuffix == nil { - obj.NameSuffix = utilpointer.StringPtr(infrav1.DefaultNameSuffix) + obj.NameSuffix = utilpointer.StringPtr(iamv1.DefaultNameSuffix) } if obj.Partition == "" { obj.Partition = DefaultPartitionName @@ -97,7 +98,7 @@ func SetDefaults_AWSIAMConfiguration(obj *AWSIAMConfiguration) { //nolint:golint obj.APIVersion = SchemeGroupVersion.String() obj.Kind = "AWSIAMConfiguration" if obj.Spec.NameSuffix == nil { - obj.Spec.NameSuffix = utilpointer.StringPtr(infrav1.DefaultNameSuffix) + obj.Spec.NameSuffix = utilpointer.StringPtr(iamv1.DefaultNameSuffix) } if obj.Spec.StackName == "" { obj.Spec.StackName = DefaultStackName diff --git a/cmd/clusterawsadm/api/bootstrap/v1alpha1/doc.go b/cmd/clusterawsadm/api/bootstrap/v1alpha1/doc.go index 9960774faa..63429f9434 100644 --- a/cmd/clusterawsadm/api/bootstrap/v1alpha1/doc.go +++ b/cmd/clusterawsadm/api/bootstrap/v1alpha1/doc.go @@ -19,5 +19,5 @@ limitations under the License. // +k8s:deepcopy-gen=package,register // +k8s:defaulter-gen=TypeMeta // +groupName=bootstrap.aws.infrastructure.cluster.x-k8s.io -// +gencrdrefdocs:force +// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1beta1 package v1alpha1 diff --git a/cmd/clusterawsadm/api/bootstrap/v1alpha1/types.go b/cmd/clusterawsadm/api/bootstrap/v1alpha1/types.go index 8395ff0c24..305c90098b 100644 --- a/cmd/clusterawsadm/api/bootstrap/v1alpha1/types.go +++ b/cmd/clusterawsadm/api/bootstrap/v1alpha1/types.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +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. @@ -19,7 +19,8 @@ package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" ) // BootstrapUser contains a list of elements that is specific @@ -47,7 +48,7 @@ type BootstrapUser struct { ExtraGroups []string `json:"extraGroups,omitempty"` // ExtraStatements are additional AWS IAM policy document statements to be included inline for the user. - ExtraStatements []infrav1.StatementEntry `json:"extraStatements,omitempty"` + ExtraStatements []iamv1.StatementEntry `json:"extraStatements,omitempty"` // Tags is a map of tags to be applied to the AWS IAM user. Tags infrav1.Tags `json:"tags,omitempty"` @@ -79,11 +80,11 @@ type AWSIAMRoleSpec struct { ExtraPolicyAttachments []string `json:"extraPolicyAttachments,omitempty"` // ExtraStatements are additional IAM statements to be included inline for the role. - ExtraStatements []infrav1.StatementEntry `json:"extraStatements,omitempty"` + ExtraStatements []iamv1.StatementEntry `json:"extraStatements,omitempty"` // TrustStatements is an IAM PolicyDocument defining what identities are allowed to assume this role. - // See "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/iam/v1alpha1" for more documentation. - TrustStatements []infrav1.StatementEntry `json:"trustStatements,omitempty"` + // See "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/iam/v1beta1" for more documentation. + TrustStatements []iamv1.StatementEntry `json:"trustStatements,omitempty"` // Tags is a map of tags to be applied to the AWS IAM role. Tags infrav1.Tags `json:"tags,omitempty"` diff --git a/cmd/clusterawsadm/api/bootstrap/v1alpha1/zz_generated.conversion.go b/cmd/clusterawsadm/api/bootstrap/v1alpha1/zz_generated.conversion.go new file mode 100644 index 0000000000..8a707dcc33 --- /dev/null +++ b/cmd/clusterawsadm/api/bootstrap/v1alpha1/zz_generated.conversion.go @@ -0,0 +1,411 @@ +// +build !ignore_autogenerated_conversions + +/* +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 v1alpha1 + +import ( + unsafe "unsafe" + + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" + apiv1beta1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1beta1" + iamapiv1beta1 "sigs.k8s.io/cluster-api-provider-aws/iam/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((*AWSIAMConfiguration)(nil), (*v1beta1.AWSIAMConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_AWSIAMConfiguration_To_v1beta1_AWSIAMConfiguration(a.(*AWSIAMConfiguration), b.(*v1beta1.AWSIAMConfiguration), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSIAMConfiguration)(nil), (*AWSIAMConfiguration)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSIAMConfiguration_To_v1alpha1_AWSIAMConfiguration(a.(*v1beta1.AWSIAMConfiguration), b.(*AWSIAMConfiguration), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSIAMConfigurationSpec)(nil), (*v1beta1.AWSIAMConfigurationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_AWSIAMConfigurationSpec_To_v1beta1_AWSIAMConfigurationSpec(a.(*AWSIAMConfigurationSpec), b.(*v1beta1.AWSIAMConfigurationSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSIAMConfigurationSpec)(nil), (*AWSIAMConfigurationSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSIAMConfigurationSpec_To_v1alpha1_AWSIAMConfigurationSpec(a.(*v1beta1.AWSIAMConfigurationSpec), b.(*AWSIAMConfigurationSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSIAMRoleSpec)(nil), (*v1beta1.AWSIAMRoleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_AWSIAMRoleSpec_To_v1beta1_AWSIAMRoleSpec(a.(*AWSIAMRoleSpec), b.(*v1beta1.AWSIAMRoleSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSIAMRoleSpec)(nil), (*AWSIAMRoleSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSIAMRoleSpec_To_v1alpha1_AWSIAMRoleSpec(a.(*v1beta1.AWSIAMRoleSpec), b.(*AWSIAMRoleSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*BootstrapUser)(nil), (*v1beta1.BootstrapUser)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_BootstrapUser_To_v1beta1_BootstrapUser(a.(*BootstrapUser), b.(*v1beta1.BootstrapUser), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.BootstrapUser)(nil), (*BootstrapUser)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_BootstrapUser_To_v1alpha1_BootstrapUser(a.(*v1beta1.BootstrapUser), b.(*BootstrapUser), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ClusterAPIControllers)(nil), (*v1beta1.ClusterAPIControllers)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_ClusterAPIControllers_To_v1beta1_ClusterAPIControllers(a.(*ClusterAPIControllers), b.(*v1beta1.ClusterAPIControllers), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ClusterAPIControllers)(nil), (*ClusterAPIControllers)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ClusterAPIControllers_To_v1alpha1_ClusterAPIControllers(a.(*v1beta1.ClusterAPIControllers), b.(*ClusterAPIControllers), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ControlPlane)(nil), (*v1beta1.ControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_ControlPlane_To_v1beta1_ControlPlane(a.(*ControlPlane), b.(*v1beta1.ControlPlane), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ControlPlane)(nil), (*ControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ControlPlane_To_v1alpha1_ControlPlane(a.(*v1beta1.ControlPlane), b.(*ControlPlane), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*EKSConfig)(nil), (*v1beta1.EKSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_EKSConfig_To_v1beta1_EKSConfig(a.(*EKSConfig), b.(*v1beta1.EKSConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.EKSConfig)(nil), (*EKSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EKSConfig_To_v1alpha1_EKSConfig(a.(*v1beta1.EKSConfig), b.(*EKSConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*EventBridgeConfig)(nil), (*v1beta1.EventBridgeConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_EventBridgeConfig_To_v1beta1_EventBridgeConfig(a.(*EventBridgeConfig), b.(*v1beta1.EventBridgeConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.EventBridgeConfig)(nil), (*EventBridgeConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EventBridgeConfig_To_v1alpha1_EventBridgeConfig(a.(*v1beta1.EventBridgeConfig), b.(*EventBridgeConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Nodes)(nil), (*v1beta1.Nodes)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha1_Nodes_To_v1beta1_Nodes(a.(*Nodes), b.(*v1beta1.Nodes), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.Nodes)(nil), (*Nodes)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Nodes_To_v1alpha1_Nodes(a.(*v1beta1.Nodes), b.(*Nodes), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha1_AWSIAMConfiguration_To_v1beta1_AWSIAMConfiguration(in *AWSIAMConfiguration, out *v1beta1.AWSIAMConfiguration, s conversion.Scope) error { + if err := Convert_v1alpha1_AWSIAMConfigurationSpec_To_v1beta1_AWSIAMConfigurationSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha1_AWSIAMConfiguration_To_v1beta1_AWSIAMConfiguration is an autogenerated conversion function. +func Convert_v1alpha1_AWSIAMConfiguration_To_v1beta1_AWSIAMConfiguration(in *AWSIAMConfiguration, out *v1beta1.AWSIAMConfiguration, s conversion.Scope) error { + return autoConvert_v1alpha1_AWSIAMConfiguration_To_v1beta1_AWSIAMConfiguration(in, out, s) +} + +func autoConvert_v1beta1_AWSIAMConfiguration_To_v1alpha1_AWSIAMConfiguration(in *v1beta1.AWSIAMConfiguration, out *AWSIAMConfiguration, s conversion.Scope) error { + if err := Convert_v1beta1_AWSIAMConfigurationSpec_To_v1alpha1_AWSIAMConfigurationSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AWSIAMConfiguration_To_v1alpha1_AWSIAMConfiguration is an autogenerated conversion function. +func Convert_v1beta1_AWSIAMConfiguration_To_v1alpha1_AWSIAMConfiguration(in *v1beta1.AWSIAMConfiguration, out *AWSIAMConfiguration, s conversion.Scope) error { + return autoConvert_v1beta1_AWSIAMConfiguration_To_v1alpha1_AWSIAMConfiguration(in, out, s) +} + +func autoConvert_v1alpha1_AWSIAMConfigurationSpec_To_v1beta1_AWSIAMConfigurationSpec(in *AWSIAMConfigurationSpec, out *v1beta1.AWSIAMConfigurationSpec, s conversion.Scope) error { + out.NamePrefix = in.NamePrefix + out.NameSuffix = (*string)(unsafe.Pointer(in.NameSuffix)) + if err := Convert_v1alpha1_ControlPlane_To_v1beta1_ControlPlane(&in.ControlPlane, &out.ControlPlane, s); err != nil { + return err + } + if err := Convert_v1alpha1_ClusterAPIControllers_To_v1beta1_ClusterAPIControllers(&in.ClusterAPIControllers, &out.ClusterAPIControllers, s); err != nil { + return err + } + if err := Convert_v1alpha1_Nodes_To_v1beta1_Nodes(&in.Nodes, &out.Nodes, s); err != nil { + return err + } + if err := Convert_v1alpha1_BootstrapUser_To_v1beta1_BootstrapUser(&in.BootstrapUser, &out.BootstrapUser, s); err != nil { + return err + } + out.StackName = in.StackName + out.Region = in.Region + out.EKS = (*v1beta1.EKSConfig)(unsafe.Pointer(in.EKS)) + out.EventBridge = (*v1beta1.EventBridgeConfig)(unsafe.Pointer(in.EventBridge)) + out.Partition = in.Partition + out.SecureSecretsBackends = *(*[]apiv1beta1.SecretBackend)(unsafe.Pointer(&in.SecureSecretsBackends)) + return nil +} + +// Convert_v1alpha1_AWSIAMConfigurationSpec_To_v1beta1_AWSIAMConfigurationSpec is an autogenerated conversion function. +func Convert_v1alpha1_AWSIAMConfigurationSpec_To_v1beta1_AWSIAMConfigurationSpec(in *AWSIAMConfigurationSpec, out *v1beta1.AWSIAMConfigurationSpec, s conversion.Scope) error { + return autoConvert_v1alpha1_AWSIAMConfigurationSpec_To_v1beta1_AWSIAMConfigurationSpec(in, out, s) +} + +func autoConvert_v1beta1_AWSIAMConfigurationSpec_To_v1alpha1_AWSIAMConfigurationSpec(in *v1beta1.AWSIAMConfigurationSpec, out *AWSIAMConfigurationSpec, s conversion.Scope) error { + out.NamePrefix = in.NamePrefix + out.NameSuffix = (*string)(unsafe.Pointer(in.NameSuffix)) + if err := Convert_v1beta1_ControlPlane_To_v1alpha1_ControlPlane(&in.ControlPlane, &out.ControlPlane, s); err != nil { + return err + } + if err := Convert_v1beta1_ClusterAPIControllers_To_v1alpha1_ClusterAPIControllers(&in.ClusterAPIControllers, &out.ClusterAPIControllers, s); err != nil { + return err + } + if err := Convert_v1beta1_Nodes_To_v1alpha1_Nodes(&in.Nodes, &out.Nodes, s); err != nil { + return err + } + if err := Convert_v1beta1_BootstrapUser_To_v1alpha1_BootstrapUser(&in.BootstrapUser, &out.BootstrapUser, s); err != nil { + return err + } + out.StackName = in.StackName + out.Region = in.Region + out.EKS = (*EKSConfig)(unsafe.Pointer(in.EKS)) + out.EventBridge = (*EventBridgeConfig)(unsafe.Pointer(in.EventBridge)) + out.Partition = in.Partition + out.SecureSecretsBackends = *(*[]apiv1beta1.SecretBackend)(unsafe.Pointer(&in.SecureSecretsBackends)) + return nil +} + +// Convert_v1beta1_AWSIAMConfigurationSpec_To_v1alpha1_AWSIAMConfigurationSpec is an autogenerated conversion function. +func Convert_v1beta1_AWSIAMConfigurationSpec_To_v1alpha1_AWSIAMConfigurationSpec(in *v1beta1.AWSIAMConfigurationSpec, out *AWSIAMConfigurationSpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSIAMConfigurationSpec_To_v1alpha1_AWSIAMConfigurationSpec(in, out, s) +} + +func autoConvert_v1alpha1_AWSIAMRoleSpec_To_v1beta1_AWSIAMRoleSpec(in *AWSIAMRoleSpec, out *v1beta1.AWSIAMRoleSpec, s conversion.Scope) error { + out.Disable = in.Disable + out.ExtraPolicyAttachments = *(*[]string)(unsafe.Pointer(&in.ExtraPolicyAttachments)) + out.ExtraStatements = *(*[]iamapiv1beta1.StatementEntry)(unsafe.Pointer(&in.ExtraStatements)) + out.TrustStatements = *(*[]iamapiv1beta1.StatementEntry)(unsafe.Pointer(&in.TrustStatements)) + out.Tags = *(*apiv1beta1.Tags)(unsafe.Pointer(&in.Tags)) + return nil +} + +// Convert_v1alpha1_AWSIAMRoleSpec_To_v1beta1_AWSIAMRoleSpec is an autogenerated conversion function. +func Convert_v1alpha1_AWSIAMRoleSpec_To_v1beta1_AWSIAMRoleSpec(in *AWSIAMRoleSpec, out *v1beta1.AWSIAMRoleSpec, s conversion.Scope) error { + return autoConvert_v1alpha1_AWSIAMRoleSpec_To_v1beta1_AWSIAMRoleSpec(in, out, s) +} + +func autoConvert_v1beta1_AWSIAMRoleSpec_To_v1alpha1_AWSIAMRoleSpec(in *v1beta1.AWSIAMRoleSpec, out *AWSIAMRoleSpec, s conversion.Scope) error { + out.Disable = in.Disable + out.ExtraPolicyAttachments = *(*[]string)(unsafe.Pointer(&in.ExtraPolicyAttachments)) + out.ExtraStatements = *(*[]iamapiv1beta1.StatementEntry)(unsafe.Pointer(&in.ExtraStatements)) + out.TrustStatements = *(*[]iamapiv1beta1.StatementEntry)(unsafe.Pointer(&in.TrustStatements)) + out.Tags = *(*apiv1beta1.Tags)(unsafe.Pointer(&in.Tags)) + return nil +} + +// Convert_v1beta1_AWSIAMRoleSpec_To_v1alpha1_AWSIAMRoleSpec is an autogenerated conversion function. +func Convert_v1beta1_AWSIAMRoleSpec_To_v1alpha1_AWSIAMRoleSpec(in *v1beta1.AWSIAMRoleSpec, out *AWSIAMRoleSpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSIAMRoleSpec_To_v1alpha1_AWSIAMRoleSpec(in, out, s) +} + +func autoConvert_v1alpha1_BootstrapUser_To_v1beta1_BootstrapUser(in *BootstrapUser, out *v1beta1.BootstrapUser, s conversion.Scope) error { + out.Enable = in.Enable + out.UserName = in.UserName + out.GroupName = in.GroupName + out.ExtraPolicyAttachments = *(*[]string)(unsafe.Pointer(&in.ExtraPolicyAttachments)) + out.ExtraGroups = *(*[]string)(unsafe.Pointer(&in.ExtraGroups)) + out.ExtraStatements = *(*[]iamapiv1beta1.StatementEntry)(unsafe.Pointer(&in.ExtraStatements)) + out.Tags = *(*apiv1beta1.Tags)(unsafe.Pointer(&in.Tags)) + return nil +} + +// Convert_v1alpha1_BootstrapUser_To_v1beta1_BootstrapUser is an autogenerated conversion function. +func Convert_v1alpha1_BootstrapUser_To_v1beta1_BootstrapUser(in *BootstrapUser, out *v1beta1.BootstrapUser, s conversion.Scope) error { + return autoConvert_v1alpha1_BootstrapUser_To_v1beta1_BootstrapUser(in, out, s) +} + +func autoConvert_v1beta1_BootstrapUser_To_v1alpha1_BootstrapUser(in *v1beta1.BootstrapUser, out *BootstrapUser, s conversion.Scope) error { + out.Enable = in.Enable + out.UserName = in.UserName + out.GroupName = in.GroupName + out.ExtraPolicyAttachments = *(*[]string)(unsafe.Pointer(&in.ExtraPolicyAttachments)) + out.ExtraGroups = *(*[]string)(unsafe.Pointer(&in.ExtraGroups)) + out.ExtraStatements = *(*[]iamapiv1beta1.StatementEntry)(unsafe.Pointer(&in.ExtraStatements)) + out.Tags = *(*apiv1beta1.Tags)(unsafe.Pointer(&in.Tags)) + return nil +} + +// Convert_v1beta1_BootstrapUser_To_v1alpha1_BootstrapUser is an autogenerated conversion function. +func Convert_v1beta1_BootstrapUser_To_v1alpha1_BootstrapUser(in *v1beta1.BootstrapUser, out *BootstrapUser, s conversion.Scope) error { + return autoConvert_v1beta1_BootstrapUser_To_v1alpha1_BootstrapUser(in, out, s) +} + +func autoConvert_v1alpha1_ClusterAPIControllers_To_v1beta1_ClusterAPIControllers(in *ClusterAPIControllers, out *v1beta1.ClusterAPIControllers, s conversion.Scope) error { + if err := Convert_v1alpha1_AWSIAMRoleSpec_To_v1beta1_AWSIAMRoleSpec(&in.AWSIAMRoleSpec, &out.AWSIAMRoleSpec, s); err != nil { + return err + } + out.AllowedEC2InstanceProfiles = *(*[]string)(unsafe.Pointer(&in.AllowedEC2InstanceProfiles)) + return nil +} + +// Convert_v1alpha1_ClusterAPIControllers_To_v1beta1_ClusterAPIControllers is an autogenerated conversion function. +func Convert_v1alpha1_ClusterAPIControllers_To_v1beta1_ClusterAPIControllers(in *ClusterAPIControllers, out *v1beta1.ClusterAPIControllers, s conversion.Scope) error { + return autoConvert_v1alpha1_ClusterAPIControllers_To_v1beta1_ClusterAPIControllers(in, out, s) +} + +func autoConvert_v1beta1_ClusterAPIControllers_To_v1alpha1_ClusterAPIControllers(in *v1beta1.ClusterAPIControllers, out *ClusterAPIControllers, s conversion.Scope) error { + if err := Convert_v1beta1_AWSIAMRoleSpec_To_v1alpha1_AWSIAMRoleSpec(&in.AWSIAMRoleSpec, &out.AWSIAMRoleSpec, s); err != nil { + return err + } + out.AllowedEC2InstanceProfiles = *(*[]string)(unsafe.Pointer(&in.AllowedEC2InstanceProfiles)) + return nil +} + +// Convert_v1beta1_ClusterAPIControllers_To_v1alpha1_ClusterAPIControllers is an autogenerated conversion function. +func Convert_v1beta1_ClusterAPIControllers_To_v1alpha1_ClusterAPIControllers(in *v1beta1.ClusterAPIControllers, out *ClusterAPIControllers, s conversion.Scope) error { + return autoConvert_v1beta1_ClusterAPIControllers_To_v1alpha1_ClusterAPIControllers(in, out, s) +} + +func autoConvert_v1alpha1_ControlPlane_To_v1beta1_ControlPlane(in *ControlPlane, out *v1beta1.ControlPlane, s conversion.Scope) error { + if err := Convert_v1alpha1_AWSIAMRoleSpec_To_v1beta1_AWSIAMRoleSpec(&in.AWSIAMRoleSpec, &out.AWSIAMRoleSpec, s); err != nil { + return err + } + out.DisableClusterAPIControllerPolicyAttachment = in.DisableClusterAPIControllerPolicyAttachment + out.DisableCloudProviderPolicy = in.DisableCloudProviderPolicy + out.EnableCSIPolicy = in.EnableCSIPolicy + return nil +} + +// Convert_v1alpha1_ControlPlane_To_v1beta1_ControlPlane is an autogenerated conversion function. +func Convert_v1alpha1_ControlPlane_To_v1beta1_ControlPlane(in *ControlPlane, out *v1beta1.ControlPlane, s conversion.Scope) error { + return autoConvert_v1alpha1_ControlPlane_To_v1beta1_ControlPlane(in, out, s) +} + +func autoConvert_v1beta1_ControlPlane_To_v1alpha1_ControlPlane(in *v1beta1.ControlPlane, out *ControlPlane, s conversion.Scope) error { + if err := Convert_v1beta1_AWSIAMRoleSpec_To_v1alpha1_AWSIAMRoleSpec(&in.AWSIAMRoleSpec, &out.AWSIAMRoleSpec, s); err != nil { + return err + } + out.DisableClusterAPIControllerPolicyAttachment = in.DisableClusterAPIControllerPolicyAttachment + out.DisableCloudProviderPolicy = in.DisableCloudProviderPolicy + out.EnableCSIPolicy = in.EnableCSIPolicy + return nil +} + +// Convert_v1beta1_ControlPlane_To_v1alpha1_ControlPlane is an autogenerated conversion function. +func Convert_v1beta1_ControlPlane_To_v1alpha1_ControlPlane(in *v1beta1.ControlPlane, out *ControlPlane, s conversion.Scope) error { + return autoConvert_v1beta1_ControlPlane_To_v1alpha1_ControlPlane(in, out, s) +} + +func autoConvert_v1alpha1_EKSConfig_To_v1beta1_EKSConfig(in *EKSConfig, out *v1beta1.EKSConfig, s conversion.Scope) error { + out.Disable = in.Disable + out.AllowIAMRoleCreation = in.AllowIAMRoleCreation + if err := Convert_v1alpha1_AWSIAMRoleSpec_To_v1beta1_AWSIAMRoleSpec(&in.DefaultControlPlaneRole, &out.DefaultControlPlaneRole, s); err != nil { + return err + } + out.ManagedMachinePool = (*v1beta1.AWSIAMRoleSpec)(unsafe.Pointer(in.ManagedMachinePool)) + out.Fargate = (*v1beta1.AWSIAMRoleSpec)(unsafe.Pointer(in.Fargate)) + out.KMSAliasPrefix = in.KMSAliasPrefix + return nil +} + +// Convert_v1alpha1_EKSConfig_To_v1beta1_EKSConfig is an autogenerated conversion function. +func Convert_v1alpha1_EKSConfig_To_v1beta1_EKSConfig(in *EKSConfig, out *v1beta1.EKSConfig, s conversion.Scope) error { + return autoConvert_v1alpha1_EKSConfig_To_v1beta1_EKSConfig(in, out, s) +} + +func autoConvert_v1beta1_EKSConfig_To_v1alpha1_EKSConfig(in *v1beta1.EKSConfig, out *EKSConfig, s conversion.Scope) error { + out.Disable = in.Disable + out.AllowIAMRoleCreation = in.AllowIAMRoleCreation + if err := Convert_v1beta1_AWSIAMRoleSpec_To_v1alpha1_AWSIAMRoleSpec(&in.DefaultControlPlaneRole, &out.DefaultControlPlaneRole, s); err != nil { + return err + } + out.ManagedMachinePool = (*AWSIAMRoleSpec)(unsafe.Pointer(in.ManagedMachinePool)) + out.Fargate = (*AWSIAMRoleSpec)(unsafe.Pointer(in.Fargate)) + out.KMSAliasPrefix = in.KMSAliasPrefix + return nil +} + +// Convert_v1beta1_EKSConfig_To_v1alpha1_EKSConfig is an autogenerated conversion function. +func Convert_v1beta1_EKSConfig_To_v1alpha1_EKSConfig(in *v1beta1.EKSConfig, out *EKSConfig, s conversion.Scope) error { + return autoConvert_v1beta1_EKSConfig_To_v1alpha1_EKSConfig(in, out, s) +} + +func autoConvert_v1alpha1_EventBridgeConfig_To_v1beta1_EventBridgeConfig(in *EventBridgeConfig, out *v1beta1.EventBridgeConfig, s conversion.Scope) error { + out.Enable = in.Enable + return nil +} + +// Convert_v1alpha1_EventBridgeConfig_To_v1beta1_EventBridgeConfig is an autogenerated conversion function. +func Convert_v1alpha1_EventBridgeConfig_To_v1beta1_EventBridgeConfig(in *EventBridgeConfig, out *v1beta1.EventBridgeConfig, s conversion.Scope) error { + return autoConvert_v1alpha1_EventBridgeConfig_To_v1beta1_EventBridgeConfig(in, out, s) +} + +func autoConvert_v1beta1_EventBridgeConfig_To_v1alpha1_EventBridgeConfig(in *v1beta1.EventBridgeConfig, out *EventBridgeConfig, s conversion.Scope) error { + out.Enable = in.Enable + return nil +} + +// Convert_v1beta1_EventBridgeConfig_To_v1alpha1_EventBridgeConfig is an autogenerated conversion function. +func Convert_v1beta1_EventBridgeConfig_To_v1alpha1_EventBridgeConfig(in *v1beta1.EventBridgeConfig, out *EventBridgeConfig, s conversion.Scope) error { + return autoConvert_v1beta1_EventBridgeConfig_To_v1alpha1_EventBridgeConfig(in, out, s) +} + +func autoConvert_v1alpha1_Nodes_To_v1beta1_Nodes(in *Nodes, out *v1beta1.Nodes, s conversion.Scope) error { + if err := Convert_v1alpha1_AWSIAMRoleSpec_To_v1beta1_AWSIAMRoleSpec(&in.AWSIAMRoleSpec, &out.AWSIAMRoleSpec, s); err != nil { + return err + } + out.DisableCloudProviderPolicy = in.DisableCloudProviderPolicy + out.EC2ContainerRegistryReadOnly = in.EC2ContainerRegistryReadOnly + return nil +} + +// Convert_v1alpha1_Nodes_To_v1beta1_Nodes is an autogenerated conversion function. +func Convert_v1alpha1_Nodes_To_v1beta1_Nodes(in *Nodes, out *v1beta1.Nodes, s conversion.Scope) error { + return autoConvert_v1alpha1_Nodes_To_v1beta1_Nodes(in, out, s) +} + +func autoConvert_v1beta1_Nodes_To_v1alpha1_Nodes(in *v1beta1.Nodes, out *Nodes, s conversion.Scope) error { + if err := Convert_v1beta1_AWSIAMRoleSpec_To_v1alpha1_AWSIAMRoleSpec(&in.AWSIAMRoleSpec, &out.AWSIAMRoleSpec, s); err != nil { + return err + } + out.DisableCloudProviderPolicy = in.DisableCloudProviderPolicy + out.EC2ContainerRegistryReadOnly = in.EC2ContainerRegistryReadOnly + return nil +} + +// Convert_v1beta1_Nodes_To_v1alpha1_Nodes is an autogenerated conversion function. +func Convert_v1beta1_Nodes_To_v1alpha1_Nodes(in *v1beta1.Nodes, out *Nodes, s conversion.Scope) error { + return autoConvert_v1beta1_Nodes_To_v1alpha1_Nodes(in, out, s) +} diff --git a/cmd/clusterawsadm/api/bootstrap/v1alpha1/zz_generated.deepcopy.go b/cmd/clusterawsadm/api/bootstrap/v1alpha1/zz_generated.deepcopy.go index b9753f7507..4bbec63669 100644 --- a/cmd/clusterawsadm/api/bootstrap/v1alpha1/zz_generated.deepcopy.go +++ b/cmd/clusterawsadm/api/bootstrap/v1alpha1/zz_generated.deepcopy.go @@ -22,7 +22,8 @@ package v1alpha1 import ( "k8s.io/apimachinery/pkg/runtime" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + apiv1beta1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -74,7 +75,7 @@ func (in *AWSIAMConfigurationSpec) DeepCopyInto(out *AWSIAMConfigurationSpec) { } if in.SecureSecretsBackends != nil { in, out := &in.SecureSecretsBackends, &out.SecureSecretsBackends - *out = make([]v1alpha4.SecretBackend, len(*in)) + *out = make([]apiv1beta1.SecretBackend, len(*in)) copy(*out, *in) } } @@ -99,21 +100,21 @@ func (in *AWSIAMRoleSpec) DeepCopyInto(out *AWSIAMRoleSpec) { } if in.ExtraStatements != nil { in, out := &in.ExtraStatements, &out.ExtraStatements - *out = make([]v1alpha4.StatementEntry, len(*in)) + *out = make([]v1beta1.StatementEntry, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.TrustStatements != nil { in, out := &in.TrustStatements, &out.TrustStatements - *out = make([]v1alpha4.StatementEntry, len(*in)) + *out = make([]v1beta1.StatementEntry, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.Tags != nil { in, out := &in.Tags, &out.Tags - *out = make(v1alpha4.Tags, len(*in)) + *out = make(apiv1beta1.Tags, len(*in)) for key, val := range *in { (*out)[key] = val } @@ -145,14 +146,14 @@ func (in *BootstrapUser) DeepCopyInto(out *BootstrapUser) { } if in.ExtraStatements != nil { in, out := &in.ExtraStatements, &out.ExtraStatements - *out = make([]v1alpha4.StatementEntry, len(*in)) + *out = make([]v1beta1.StatementEntry, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } if in.Tags != nil { in, out := &in.Tags, &out.Tags - *out = make(v1alpha4.Tags, len(*in)) + *out = make(apiv1beta1.Tags, len(*in)) for key, val := range *in { (*out)[key] = val } diff --git a/cmd/clusterawsadm/api/bootstrap/v1beta1/defaults.go b/cmd/clusterawsadm/api/bootstrap/v1beta1/defaults.go new file mode 100644 index 0000000000..76dd68fc1a --- /dev/null +++ b/cmd/clusterawsadm/api/bootstrap/v1beta1/defaults.go @@ -0,0 +1,106 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/utils/pointer" + + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" +) + +const ( + // DefaultBootstrapUserName is the default bootstrap user name. + DefaultBootstrapUserName = "bootstrapper.cluster-api-provider-aws.sigs.k8s.io" + // DefaultStackName is the default CloudFormation stack name. + DefaultStackName = "cluster-api-provider-aws-sigs-k8s-io" + // DefaultPartitionName is the default security partition for AWS ARNs. + DefaultPartitionName = "aws" + // DefaultKMSAliasPattern is the default KMS alias. + DefaultKMSAliasPattern = "cluster-api-provider-aws-*" +) + +func addDefaultingFuncs(scheme *runtime.Scheme) error { + return RegisterDefaults(scheme) +} + +// SetDefaults_BootstrapUser is used by defaulter-gen. +func SetDefaults_BootstrapUser(obj *BootstrapUser) { //nolint:golint,stylecheck + if obj != nil && obj.UserName == "" { + obj.UserName = DefaultBootstrapUserName + } +} + +// SetDefaults_AWSIAMConfigurationSpec is used by defaulter-gen. +func SetDefaults_AWSIAMConfigurationSpec(obj *AWSIAMConfigurationSpec) { //nolint:golint,stylecheck + if obj.NameSuffix == nil { + obj.NameSuffix = pointer.StringPtr(iamv1.DefaultNameSuffix) + } + if obj.Partition == "" { + obj.Partition = DefaultPartitionName + } + if obj.StackName == "" { + obj.StackName = DefaultStackName + } + if obj.EKS == nil { + obj.EKS = &EKSConfig{ + Disable: false, + AllowIAMRoleCreation: false, + DefaultControlPlaneRole: AWSIAMRoleSpec{ + Disable: false, + }, + } + } else if !obj.EKS.Disable { + obj.Nodes.EC2ContainerRegistryReadOnly = true + } + if obj.EventBridge == nil { + obj.EventBridge = &EventBridgeConfig{ + Enable: false, + } + } + if obj.EKS.ManagedMachinePool == nil { + obj.EKS.ManagedMachinePool = &AWSIAMRoleSpec{ + Disable: true, + } + } + if obj.EKS.Fargate == nil { + obj.EKS.Fargate = &AWSIAMRoleSpec{ + Disable: true, + } + } + if len(obj.SecureSecretsBackends) == 0 { + obj.SecureSecretsBackends = []infrav1.SecretBackend{ + infrav1.SecretBackendSecretsManager, + } + } + if len(obj.EKS.KMSAliasPrefix) == 0 { + obj.EKS.KMSAliasPrefix = DefaultKMSAliasPattern + } +} + +// SetDefaults_AWSIAMConfiguration is used by defaulter-gen. +func SetDefaults_AWSIAMConfiguration(obj *AWSIAMConfiguration) { //nolint:golint,stylecheck + obj.APIVersion = SchemeGroupVersion.String() + obj.Kind = "AWSIAMConfiguration" + if obj.Spec.NameSuffix == nil { + obj.Spec.NameSuffix = pointer.StringPtr(iamv1.DefaultNameSuffix) + } + if obj.Spec.StackName == "" { + obj.Spec.StackName = DefaultStackName + } +} diff --git a/cmd/clusterawsadm/api/iam/v1alpha1/doc.go b/cmd/clusterawsadm/api/bootstrap/v1beta1/doc.go similarity index 72% rename from cmd/clusterawsadm/api/iam/v1alpha1/doc.go rename to cmd/clusterawsadm/api/bootstrap/v1beta1/doc.go index 3801700ccb..e124ec2878 100644 --- a/cmd/clusterawsadm/api/iam/v1alpha1/doc.go +++ b/cmd/clusterawsadm/api/bootstrap/v1beta1/doc.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +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. @@ -14,9 +14,10 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package v1alpha1 contains API Schema definitions for the iam v1alpha1 API group +// Package v1beta1 contains API Schema definitions for the bootstrap v1beta1 API group // +kubebuilder:object:generate=true +// +k8s:deepcopy-gen=package,register // +k8s:defaulter-gen=TypeMeta -// +groupName=iam.aws.infrastructure.cluster.x-k8s.io +// +groupName=bootstrap.aws.infrastructure.cluster.x-k8s.io // +gencrdrefdocs:force -package v1alpha1 +package v1beta1 diff --git a/cmd/clusterawsadm/api/iam/v1alpha1/register.go b/cmd/clusterawsadm/api/bootstrap/v1beta1/register.go similarity index 82% rename from cmd/clusterawsadm/api/iam/v1alpha1/register.go rename to cmd/clusterawsadm/api/bootstrap/v1beta1/register.go index 97102c3086..7bebe018a7 100644 --- a/cmd/clusterawsadm/api/iam/v1alpha1/register.go +++ b/cmd/clusterawsadm/api/bootstrap/v1beta1/register.go @@ -1,5 +1,5 @@ /* -Copyright 2020 The Kubernetes Authors. +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. @@ -14,24 +14,20 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package v1alpha1 contains API Schema definitions for the iam v1alpha1 API group -// +kubebuilder:object:generate=true -// +k8s:defaulter-gen=TypeMeta -// +groupName=iam.aws.infrastructure.cluster.x-k8s.io -package v1alpha1 +package v1beta1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" ) // GroupName is the group name used in this package. -const GroupName = "iam.aws.infrastructure.cluster.x-k8s.io" +const GroupName = "bootstrap.aws.infrastructure.cluster.x-k8s.io" var ( // SchemeGroupVersion is the fully qualified group and version. - SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"} + SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} // SchemeBuilder is the scheme builder with scheme init functions to run for this API package. SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // localSchemeBuilder ïs a pointer to SchemeBuilder instance. Using localSchemeBuilder @@ -50,6 +46,9 @@ func init() { // Adds the list of known types to the given scheme. func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &AWSIAMConfiguration{}, + ) metav1.AddToGroupVersion(scheme, SchemeGroupVersion) return nil } diff --git a/cmd/clusterawsadm/api/bootstrap/v1beta1/scheme/scheme.go b/cmd/clusterawsadm/api/bootstrap/v1beta1/scheme/scheme.go new file mode 100644 index 0000000000..a748996bde --- /dev/null +++ b/cmd/clusterawsadm/api/bootstrap/v1beta1/scheme/scheme.go @@ -0,0 +1,41 @@ +/* +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 scheme + +import ( + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/serializer" + bootstrapv1alpha1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1alpha1" + bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1beta1" +) + +// Utility functions for the bootstrap.aws.infrastructure.cluster.x-k8s.io API group. + +// NewSchemeAndCodecs is a utility function that returns a Scheme and CodecFactory +// that understand the types in the bootstrap.aws.infrastructure.cluster.x-k8s.io API group. +func NewSchemeAndCodecs() (*runtime.Scheme, *serializer.CodecFactory, error) { + scheme := runtime.NewScheme() + if err := bootstrapv1.AddToScheme(scheme); err != nil { + return nil, nil, err + } + if err := bootstrapv1alpha1.AddToScheme(scheme); err != nil { + return nil, nil, err + } + + codecs := serializer.NewCodecFactory(scheme) + return scheme, &codecs, nil +} diff --git a/cmd/clusterawsadm/api/bootstrap/v1beta1/types.go b/cmd/clusterawsadm/api/bootstrap/v1beta1/types.go new file mode 100644 index 0000000000..2c2da47826 --- /dev/null +++ b/cmd/clusterawsadm/api/bootstrap/v1beta1/types.go @@ -0,0 +1,215 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" +) + +// BootstrapUser contains a list of elements that is specific +// to the configuration and enablement of an IAM user. +type BootstrapUser struct { + + // Enable controls whether or not a bootstrap AWS IAM user will be created. + // This can be used to scope down the initial credentials used to bootstrap the + // cluster. + // Defaults to false. + Enable bool `json:"enable"` + + // UserName controls the username of the bootstrap user. Defaults to + // "bootstrapper.cluster-api-provider-aws.sigs.k8s.io" + UserName string `json:"userName,omitempty"` + + // GroupName controls the group the user will belong to. Defaults to + // "bootstrapper.cluster-api-provider-aws.sigs.k8s.io" + GroupName string `json:"groupName,omitempty"` + + // ExtraPolicyAttachments is a list of additional policies to be attached to the IAM user. + ExtraPolicyAttachments []string `json:"extraPolicyAttachments,omitempty"` + + // ExtraGroups is a list of groups to add this user to. + ExtraGroups []string `json:"extraGroups,omitempty"` + + // ExtraStatements are additional AWS IAM policy document statements to be included inline for the user. + ExtraStatements []iamv1.StatementEntry `json:"extraStatements,omitempty"` + + // Tags is a map of tags to be applied to the AWS IAM user. + Tags infrav1.Tags `json:"tags,omitempty"` +} + +// ControlPlane controls the configuration of the AWS IAM role for +// the control plane of provisioned Kubernetes clusters. +type ControlPlane struct { + AWSIAMRoleSpec `json:",inline"` + + // DisableClusterAPIControllerPolicyAttachment, if set to true, will not attach the AWS IAM policy for Cluster + // API Provider AWS to the control plane role. Defaults to false. + DisableClusterAPIControllerPolicyAttachment bool `json:"disableClusterAPIControllerPolicyAttachment,omitempty"` + + // DisableCloudProviderPolicy if set to true, will not generate and attach the AWS IAM policy for the AWS Cloud Provider. + DisableCloudProviderPolicy bool `json:"disableCloudProviderPolicy"` + + // EnableCSIPolicy if set to true, will generate and attach the AWS IAM policy for the EBS CSI Driver. + EnableCSIPolicy bool `json:"enableCSIPolicy"` +} + +// AWSIAMRoleSpec defines common configuration for AWS IAM roles created by +// Kubernetes Cluster API Provider AWS. +type AWSIAMRoleSpec struct { + // Disable if set to true will not create the AWS IAM role. Defaults to false. + Disable bool `json:"disable"` // default: false + + // ExtraPolicyAttachments is a list of additional policies to be attached to the IAM role. + ExtraPolicyAttachments []string `json:"extraPolicyAttachments,omitempty"` + + // ExtraStatements are additional IAM statements to be included inline for the role. + ExtraStatements []iamv1.StatementEntry `json:"extraStatements,omitempty"` + + // TrustStatements is an IAM PolicyDocument defining what identities are allowed to assume this role. + // See "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/iam/v1beta1" for more documentation. + TrustStatements []iamv1.StatementEntry `json:"trustStatements,omitempty"` + + // Tags is a map of tags to be applied to the AWS IAM role. + Tags infrav1.Tags `json:"tags,omitempty"` +} + +// EKSConfig represents the EKS related configuration config. +type EKSConfig struct { + // Disable controls whether EKS-related permissions are granted + Disable bool `json:"disable"` + // AllowIAMRoleCreation controls whether the EKS controllers have permissions for creating IAM + // roles per cluster + AllowIAMRoleCreation bool `json:"iamRoleCreation,omitempty"` + // DefaultControlPlaneRole controls the configuration of the AWS IAM role for + // the EKS control plane. This is the default role that will be used if + // no role is included in the spec and automatic creation of the role + // isn't enabled + DefaultControlPlaneRole AWSIAMRoleSpec `json:"defaultControlPlaneRole,omitempty"` + // ManagedMachinePool controls the configuration of the AWS IAM role for + // used by EKS managed machine pools. + ManagedMachinePool *AWSIAMRoleSpec `json:"managedMachinePool,omitempty"` + // Fargate controls the configuration of the AWS IAM role for + // used by EKS managed machine pools. + Fargate *AWSIAMRoleSpec `json:"fargate,omitempty"` + // KMSAliasPrefix is prefix to use to restrict permission to KMS keys to only those that have an alias + // name that is prefixed by this. + // Defaults to cluster-api-provider-aws-* + KMSAliasPrefix string `json:"kmsAliasPrefix,omitempty"` +} + +// EventBridgeConfig represents configuration for enabling experimental feature to consume +// EventBridge EC2 events. +type EventBridgeConfig struct { + // Enable controls whether permissions are granted to consume EC2 events + Enable bool `json:"enable,omitempty"` +} + +// ClusterAPIControllers controls the configuration of the AWS IAM role for +// the Kubernetes Cluster API Provider AWS controller. +type ClusterAPIControllers struct { + AWSIAMRoleSpec `json:",inline"` + // AllowedEC2InstanceProfiles controls which EC2 roles are allowed to be + // consumed by Cluster API when creating an ec2 instance. Defaults to + // *., where suffix is defaulted to .cluster-api-provider-aws.sigs.k8s.io + AllowedEC2InstanceProfiles []string `json:"allowedEC2InstanceProfiles,omitempty"` +} + +// Nodes controls the configuration of the AWS IAM role for worker nodes +// in a cluster created by Kubernetes Cluster API Provider AWS. +type Nodes struct { + AWSIAMRoleSpec `json:",inline"` + + // DisableCloudProviderPolicy if set to true, will not generate and attach the policy for the AWS Cloud Provider. + // Defaults to false. + DisableCloudProviderPolicy bool `json:"disableCloudProviderPolicy"` + + // EC2ContainerRegistryReadOnly controls whether the node has read-only access to the + // EC2 container registry + EC2ContainerRegistryReadOnly bool `json:"ec2ContainerRegistryReadOnly"` +} + +// +kubebuilder:object:root=true +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// AWSIAMConfiguration controls the creation of AWS Identity and Access Management (IAM) resources for use +// by Kubernetes clusters and Kubernetes Cluster API Provider AWS. +type AWSIAMConfiguration struct { + metav1.TypeMeta `json:",inline"` + + Spec AWSIAMConfigurationSpec `json:"spec,omitempty"` +} + +// AWSIAMConfigurationSpec defines the specification of the AWSIAMConfiguration. +type AWSIAMConfigurationSpec struct { + // NamePrefix will be prepended to every AWS IAM role, user and policy created by clusterawsadm. Defaults to "". + NamePrefix string `json:"namePrefix,omitempty"` + + // NameSuffix will be appended to every AWS IAM role, user and policy created by clusterawsadm. Defaults to + // ".cluster-api-provider-aws.sigs.k8s.io". + NameSuffix *string `json:"nameSuffix,omitempty"` + + // ControlPlane controls the configuration of the AWS IAM role for a Kubernetes cluster's control plane nodes. + ControlPlane ControlPlane `json:"controlPlane,omitempty"` + + // ClusterAPIControllers controls the configuration of an IAM role and policy specifically for Kubernetes Cluster API Provider AWS. + ClusterAPIControllers ClusterAPIControllers `json:"clusterAPIControllers,omitempty"` + + // Nodes controls the configuration of the AWS IAM role for all nodes in a Kubernetes cluster. + Nodes Nodes `json:"nodes,omitempty"` + + // BootstrapUser contains a list of elements that is specific + // to the configuration and enablement of an IAM user. + BootstrapUser BootstrapUser `json:"bootstrapUser,omitempty"` + + // StackName defines the name of the AWS CloudFormation stack. + StackName string `json:"stackName,omitempty"` + + // Region controls which region the control-plane is created in if not specified on the command line or + // via environment variables. + Region string `json:"region,omitempty"` + + // EKS controls the configuration related to EKS. Settings in here affect the control plane + // and nodes roles + EKS *EKSConfig `json:"eks,omitempty"` + + // EventBridge controls configuration for consuming EventBridge events + EventBridge *EventBridgeConfig `json:"eventBridge,omitempty"` + + // Partition is the AWS security partition being used. Defaults to "aws" + Partition string `json:"partition,omitempty"` + + // SecureSecretsBackend, when set to parameter-store will create AWS Systems Manager + // Parameter Storage policies. By default or with the value of secrets-manager, + // will generate AWS Secrets Manager policies instead. + // +kubebuilder:validation:Enum=secrets-manager;ssm-parameter-store + SecureSecretsBackends []infrav1.SecretBackend `json:"secureSecretBackends,omitempty"` +} + +// GetObjectKind returns the AAWSIAMConfiguration's TypeMeta. +func (obj *AWSIAMConfiguration) GetObjectKind() schema.ObjectKind { + return &obj.TypeMeta +} + +// NewAWSIAMConfiguration will generate a new default AWSIAMConfiguration. +func NewAWSIAMConfiguration() *AWSIAMConfiguration { + conf := &AWSIAMConfiguration{} + SetObjectDefaults_AWSIAMConfiguration(conf) + return conf +} diff --git a/cmd/clusterawsadm/api/bootstrap/v1beta1/zz_generated.deepcopy.go b/cmd/clusterawsadm/api/bootstrap/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..c2de96c3e9 --- /dev/null +++ b/cmd/clusterawsadm/api/bootstrap/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,265 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime" + cluster_api_provider_awsapiv1beta1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + apiv1beta1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSIAMConfiguration) DeepCopyInto(out *AWSIAMConfiguration) { + *out = *in + out.TypeMeta = in.TypeMeta + in.Spec.DeepCopyInto(&out.Spec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSIAMConfiguration. +func (in *AWSIAMConfiguration) DeepCopy() *AWSIAMConfiguration { + if in == nil { + return nil + } + out := new(AWSIAMConfiguration) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSIAMConfiguration) 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 *AWSIAMConfigurationSpec) DeepCopyInto(out *AWSIAMConfigurationSpec) { + *out = *in + if in.NameSuffix != nil { + in, out := &in.NameSuffix, &out.NameSuffix + *out = new(string) + **out = **in + } + in.ControlPlane.DeepCopyInto(&out.ControlPlane) + in.ClusterAPIControllers.DeepCopyInto(&out.ClusterAPIControllers) + in.Nodes.DeepCopyInto(&out.Nodes) + in.BootstrapUser.DeepCopyInto(&out.BootstrapUser) + if in.EKS != nil { + in, out := &in.EKS, &out.EKS + *out = new(EKSConfig) + (*in).DeepCopyInto(*out) + } + if in.EventBridge != nil { + in, out := &in.EventBridge, &out.EventBridge + *out = new(EventBridgeConfig) + **out = **in + } + if in.SecureSecretsBackends != nil { + in, out := &in.SecureSecretsBackends, &out.SecureSecretsBackends + *out = make([]cluster_api_provider_awsapiv1beta1.SecretBackend, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSIAMConfigurationSpec. +func (in *AWSIAMConfigurationSpec) DeepCopy() *AWSIAMConfigurationSpec { + if in == nil { + return nil + } + out := new(AWSIAMConfigurationSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSIAMRoleSpec) DeepCopyInto(out *AWSIAMRoleSpec) { + *out = *in + if in.ExtraPolicyAttachments != nil { + in, out := &in.ExtraPolicyAttachments, &out.ExtraPolicyAttachments + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ExtraStatements != nil { + in, out := &in.ExtraStatements, &out.ExtraStatements + *out = make([]apiv1beta1.StatementEntry, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.TrustStatements != nil { + in, out := &in.TrustStatements, &out.TrustStatements + *out = make([]apiv1beta1.StatementEntry, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(cluster_api_provider_awsapiv1beta1.Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSIAMRoleSpec. +func (in *AWSIAMRoleSpec) DeepCopy() *AWSIAMRoleSpec { + if in == nil { + return nil + } + out := new(AWSIAMRoleSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BootstrapUser) DeepCopyInto(out *BootstrapUser) { + *out = *in + if in.ExtraPolicyAttachments != nil { + in, out := &in.ExtraPolicyAttachments, &out.ExtraPolicyAttachments + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ExtraGroups != nil { + in, out := &in.ExtraGroups, &out.ExtraGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.ExtraStatements != nil { + in, out := &in.ExtraStatements, &out.ExtraStatements + *out = make([]apiv1beta1.StatementEntry, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(cluster_api_provider_awsapiv1beta1.Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootstrapUser. +func (in *BootstrapUser) DeepCopy() *BootstrapUser { + if in == nil { + return nil + } + out := new(BootstrapUser) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ClusterAPIControllers) DeepCopyInto(out *ClusterAPIControllers) { + *out = *in + in.AWSIAMRoleSpec.DeepCopyInto(&out.AWSIAMRoleSpec) + if in.AllowedEC2InstanceProfiles != nil { + in, out := &in.AllowedEC2InstanceProfiles, &out.AllowedEC2InstanceProfiles + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterAPIControllers. +func (in *ClusterAPIControllers) DeepCopy() *ClusterAPIControllers { + if in == nil { + return nil + } + out := new(ClusterAPIControllers) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlane) DeepCopyInto(out *ControlPlane) { + *out = *in + in.AWSIAMRoleSpec.DeepCopyInto(&out.AWSIAMRoleSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlane. +func (in *ControlPlane) DeepCopy() *ControlPlane { + if in == nil { + return nil + } + out := new(ControlPlane) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EKSConfig) DeepCopyInto(out *EKSConfig) { + *out = *in + in.DefaultControlPlaneRole.DeepCopyInto(&out.DefaultControlPlaneRole) + if in.ManagedMachinePool != nil { + in, out := &in.ManagedMachinePool, &out.ManagedMachinePool + *out = new(AWSIAMRoleSpec) + (*in).DeepCopyInto(*out) + } + if in.Fargate != nil { + in, out := &in.Fargate, &out.Fargate + *out = new(AWSIAMRoleSpec) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EKSConfig. +func (in *EKSConfig) DeepCopy() *EKSConfig { + if in == nil { + return nil + } + out := new(EKSConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EventBridgeConfig) DeepCopyInto(out *EventBridgeConfig) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventBridgeConfig. +func (in *EventBridgeConfig) DeepCopy() *EventBridgeConfig { + if in == nil { + return nil + } + out := new(EventBridgeConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Nodes) DeepCopyInto(out *Nodes) { + *out = *in + in.AWSIAMRoleSpec.DeepCopyInto(&out.AWSIAMRoleSpec) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Nodes. +func (in *Nodes) DeepCopy() *Nodes { + if in == nil { + return nil + } + out := new(Nodes) + in.DeepCopyInto(out) + return out +} diff --git a/cmd/clusterawsadm/api/bootstrap/v1beta1/zz_generated.defaults.go b/cmd/clusterawsadm/api/bootstrap/v1beta1/zz_generated.defaults.go new file mode 100644 index 0000000000..4a640d3319 --- /dev/null +++ b/cmd/clusterawsadm/api/bootstrap/v1beta1/zz_generated.defaults.go @@ -0,0 +1,39 @@ +// +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 defaulter-gen. DO NOT EDIT. + +package v1beta1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// RegisterDefaults adds defaulters functions to the given scheme. +// Public to allow building arbitrary schemes. +// All generated defaulters are covering - they call all nested defaulters. +func RegisterDefaults(scheme *runtime.Scheme) error { + scheme.AddTypeDefaultingFunc(&AWSIAMConfiguration{}, func(obj interface{}) { SetObjectDefaults_AWSIAMConfiguration(obj.(*AWSIAMConfiguration)) }) + return nil +} + +func SetObjectDefaults_AWSIAMConfiguration(in *AWSIAMConfiguration) { + SetDefaults_AWSIAMConfiguration(in) + SetDefaults_AWSIAMConfigurationSpec(&in.Spec) + SetDefaults_BootstrapUser(&in.Spec.BootstrapUser) +} diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/cloud_provider_integration_control_plane.go b/cmd/clusterawsadm/cloudformation/bootstrap/cloud_provider_integration_control_plane.go index d3bc914ad9..8f38cd2b86 100644 --- a/cmd/clusterawsadm/cloudformation/bootstrap/cloud_provider_integration_control_plane.go +++ b/cmd/clusterawsadm/cloudformation/bootstrap/cloud_provider_integration_control_plane.go @@ -18,7 +18,7 @@ package bootstrap import ( "github.com/awslabs/goformation/v4/cloudformation" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" ) func (t Template) cloudProviderControlPlaneAwsRoles() []string { @@ -30,14 +30,14 @@ func (t Template) cloudProviderControlPlaneAwsRoles() []string { } // From https://github.com/kubernetes/cloud-provider-aws -func (t Template) cloudProviderControlPlaneAwsPolicy() *v1alpha4.PolicyDocument { - return &v1alpha4.PolicyDocument{ - Version: v1alpha4.CurrentVersion, - Statement: []v1alpha4.StatementEntry{ +func (t Template) cloudProviderControlPlaneAwsPolicy() *iamv1.PolicyDocument { + return &iamv1.PolicyDocument{ + Version: iamv1.CurrentVersion, + Statement: []iamv1.StatementEntry{ { - Effect: v1alpha4.EffectAllow, - Resource: v1alpha4.Resources{v1alpha4.Any}, - Action: v1alpha4.Actions{ + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{iamv1.Any}, + Action: iamv1.Actions{ "autoscaling:DescribeAutoScalingGroups", "autoscaling:DescribeLaunchConfigurations", "autoscaling:DescribeTags", diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/cloud_provider_integration_node.go b/cmd/clusterawsadm/cloudformation/bootstrap/cloud_provider_integration_node.go index fc639c7452..21743bf7c0 100644 --- a/cmd/clusterawsadm/cloudformation/bootstrap/cloud_provider_integration_node.go +++ b/cmd/clusterawsadm/cloudformation/bootstrap/cloud_provider_integration_node.go @@ -18,7 +18,7 @@ package bootstrap import ( "github.com/awslabs/goformation/v4/cloudformation" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" ) func (t Template) cloudProviderNodeAwsRoles() []string { @@ -34,14 +34,14 @@ func (t Template) cloudProviderNodeAwsRoles() []string { } // From https://github.com/kubernetes/cloud-provider-aws -func (t Template) cloudProviderNodeAwsPolicy() *v1alpha4.PolicyDocument { - return &v1alpha4.PolicyDocument{ - Version: v1alpha4.CurrentVersion, - Statement: []v1alpha4.StatementEntry{ +func (t Template) cloudProviderNodeAwsPolicy() *iamv1.PolicyDocument { + return &iamv1.PolicyDocument{ + Version: iamv1.CurrentVersion, + Statement: []iamv1.StatementEntry{ { - Effect: v1alpha4.EffectAllow, - Resource: v1alpha4.Resources{v1alpha4.Any}, - Action: v1alpha4.Actions{ + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{iamv1.Any}, + Action: iamv1.Actions{ "ec2:DescribeInstances", "ec2:DescribeRegions", "ecr:GetAuthorizationToken", diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_controller.go b/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_controller.go index c4ac258aed..f3cd31de84 100644 --- a/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_controller.go +++ b/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_controller.go @@ -22,7 +22,8 @@ import ( "github.com/awslabs/goformation/v4/cloudformation" cfn_iam "github.com/awslabs/goformation/v4/cloudformation/iam" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" ) const ( @@ -50,7 +51,7 @@ func (t Template) controllersPolicyRoleAttachments() []string { return attachments } -func (t Template) controllersTrustPolicy() *infrav1.PolicyDocument { +func (t Template) controllersTrustPolicy() *iamv1.PolicyDocument { policyDocument := ec2AssumeRolePolicy() policyDocument.Statement = append(policyDocument.Statement, t.Spec.ClusterAPIControllers.TrustStatements...) return policyDocument @@ -63,9 +64,9 @@ func (t Template) controllersRolePolicy() []cfn_iam.Role_Policy { policies = append(policies, cfn_iam.Role_Policy{ PolicyName: t.Spec.StackName, - PolicyDocument: infrav1.PolicyDocument{ + PolicyDocument: iamv1.PolicyDocument{ Statement: t.Spec.ClusterAPIControllers.ExtraStatements, - Version: infrav1.CurrentVersion, + Version: iamv1.CurrentVersion, }, }, ) @@ -74,12 +75,12 @@ func (t Template) controllersRolePolicy() []cfn_iam.Role_Policy { } // ControllersPolicy will create a policy from a Template for AWS Controllers. -func (t Template) ControllersPolicy() *infrav1.PolicyDocument { - statement := []infrav1.StatementEntry{ +func (t Template) ControllersPolicy() *iamv1.PolicyDocument { + statement := []iamv1.StatementEntry{ { - Effect: infrav1.EffectAllow, - Resource: infrav1.Resources{infrav1.Any}, - Action: infrav1.Actions{ + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{iamv1.Any}, + Action: iamv1.Actions{ "ec2:AllocateAddress", "ec2:AssociateRouteTable", "ec2:AttachInternetGateway", @@ -150,11 +151,11 @@ func (t Template) ControllersPolicy() *infrav1.PolicyDocument { }, }, { - Effect: infrav1.EffectAllow, - Resource: infrav1.Resources{ + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{ "arn:*:autoscaling:*:*:autoScalingGroup:*:autoScalingGroupName/*", }, - Action: infrav1.Actions{ + Action: iamv1.Actions{ "autoscaling:CreateAutoScalingGroup", "autoscaling:UpdateAutoScalingGroup", "autoscaling:CreateOrUpdateTags", @@ -164,45 +165,45 @@ func (t Template) ControllersPolicy() *infrav1.PolicyDocument { }, }, { - Effect: infrav1.EffectAllow, - Resource: infrav1.Resources{ + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{ "arn:*:iam::*:role/aws-service-role/autoscaling.amazonaws.com/AWSServiceRoleForAutoScaling", }, - Action: infrav1.Actions{ + Action: iamv1.Actions{ "iam:CreateServiceLinkedRole", }, - Condition: infrav1.Conditions{ - infrav1.StringLike: map[string]string{"iam:AWSServiceName": "autoscaling.amazonaws.com"}, + Condition: iamv1.Conditions{ + iamv1.StringLike: map[string]string{"iam:AWSServiceName": "autoscaling.amazonaws.com"}, }, }, { - Effect: infrav1.EffectAllow, - Resource: infrav1.Resources{ + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{ "arn:*:iam::*:role/aws-service-role/elasticloadbalancing.amazonaws.com/AWSServiceRoleForElasticLoadBalancing", }, - Action: infrav1.Actions{ + Action: iamv1.Actions{ "iam:CreateServiceLinkedRole", }, - Condition: infrav1.Conditions{ - infrav1.StringLike: map[string]string{"iam:AWSServiceName": "elasticloadbalancing.amazonaws.com"}, + Condition: iamv1.Conditions{ + iamv1.StringLike: map[string]string{"iam:AWSServiceName": "elasticloadbalancing.amazonaws.com"}, }, }, { - Effect: infrav1.EffectAllow, - Action: infrav1.Actions{ + Effect: iamv1.EffectAllow, + Action: iamv1.Actions{ "iam:CreateServiceLinkedRole", }, - Resource: infrav1.Resources{ + Resource: iamv1.Resources{ "arn:*:iam::*:role/aws-service-role/spot.amazonaws.com/AWSServiceRoleForEC2Spot", }, - Condition: infrav1.Conditions{ - infrav1.StringLike: map[string]string{"iam:AWSServiceName": "spot.amazonaws.com"}, + Condition: iamv1.Conditions{ + iamv1.StringLike: map[string]string{"iam:AWSServiceName": "spot.amazonaws.com"}, }, }, { - Effect: infrav1.EffectAllow, + Effect: iamv1.EffectAllow, Resource: t.allowedEC2InstanceProfiles(), - Action: infrav1.Actions{ + Action: iamv1.Actions{ "iam:PassRole", }, }, @@ -210,24 +211,24 @@ func (t Template) ControllersPolicy() *infrav1.PolicyDocument { for _, secureSecretBackend := range t.Spec.SecureSecretsBackends { switch secureSecretBackend { case infrav1.SecretBackendSecretsManager: - statement = append(statement, infrav1.StatementEntry{ - Effect: infrav1.EffectAllow, - Resource: infrav1.Resources{ + statement = append(statement, iamv1.StatementEntry{ + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{ "arn:*:secretsmanager:*:*:secret:aws.cluster.x-k8s.io/*", }, - Action: infrav1.Actions{ + Action: iamv1.Actions{ "secretsmanager:CreateSecret", "secretsmanager:DeleteSecret", "secretsmanager:TagResource", }, }) case infrav1.SecretBackendSSMParameterStore: - statement = append(statement, infrav1.StatementEntry{ - Effect: infrav1.EffectAllow, - Resource: infrav1.Resources{ + statement = append(statement, iamv1.StatementEntry{ + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{ "arn:*:ssm:*:*:parameter/cluster.x-k8s.io/*", }, - Action: infrav1.Actions{ + Action: iamv1.Actions{ "ssm:PutParameter", "ssm:DeleteParameter", "ssm:AddTagsToResource", @@ -236,10 +237,10 @@ func (t Template) ControllersPolicy() *infrav1.PolicyDocument { } } if t.Spec.EventBridge.Enable { - statement = append(statement, infrav1.StatementEntry{ - Effect: infrav1.EffectAllow, - Resource: infrav1.Resources{infrav1.Any}, - Action: infrav1.Actions{ + statement = append(statement, iamv1.StatementEntry{ + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{iamv1.Any}, + Action: iamv1.Actions{ "events:DeleteRule", "events:DescribeRule", "events:ListTargetsByRule", @@ -257,71 +258,71 @@ func (t Template) ControllersPolicy() *infrav1.PolicyDocument { }) } - return &infrav1.PolicyDocument{ - Version: infrav1.CurrentVersion, + return &iamv1.PolicyDocument{ + Version: iamv1.CurrentVersion, Statement: statement, } } // ControllersPolicyEKS creates a policy from a template for AWS Controllers. -func (t Template) ControllersPolicyEKS() *infrav1.PolicyDocument { - statement := []infrav1.StatementEntry{} +func (t Template) ControllersPolicyEKS() *iamv1.PolicyDocument { + statement := []iamv1.StatementEntry{} - allowedIAMActions := infrav1.Actions{ + allowedIAMActions := iamv1.Actions{ "iam:GetRole", "iam:ListAttachedRolePolicies", } - statement = append(statement, infrav1.StatementEntry{ - Effect: infrav1.EffectAllow, - Resource: infrav1.Resources{ + statement = append(statement, iamv1.StatementEntry{ + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{ "arn:*:ssm:*:*:parameter/aws/service/eks/optimized-ami/*", }, - Action: infrav1.Actions{ + Action: iamv1.Actions{ "ssm:GetParameter", }, }) - statement = append(statement, infrav1.StatementEntry{ - Effect: infrav1.EffectAllow, - Action: infrav1.Actions{ + statement = append(statement, iamv1.StatementEntry{ + Effect: iamv1.EffectAllow, + Action: iamv1.Actions{ "iam:CreateServiceLinkedRole", }, - Resource: infrav1.Resources{ + Resource: iamv1.Resources{ "arn:*:iam::*:role/aws-service-role/eks.amazonaws.com/AWSServiceRoleForAmazonEKS", }, - Condition: infrav1.Conditions{ - infrav1.StringLike: map[string]string{"iam:AWSServiceName": "eks.amazonaws.com"}, + Condition: iamv1.Conditions{ + iamv1.StringLike: map[string]string{"iam:AWSServiceName": "eks.amazonaws.com"}, }, }) - statement = append(statement, infrav1.StatementEntry{ - Effect: infrav1.EffectAllow, - Action: infrav1.Actions{ + statement = append(statement, iamv1.StatementEntry{ + Effect: iamv1.EffectAllow, + Action: iamv1.Actions{ "iam:CreateServiceLinkedRole", }, - Resource: infrav1.Resources{ + Resource: iamv1.Resources{ "arn:*:iam::*:role/aws-service-role/eks-nodegroup.amazonaws.com/AWSServiceRoleForAmazonEKSNodegroup", }, - Condition: infrav1.Conditions{ - infrav1.StringLike: map[string]string{"iam:AWSServiceName": "eks-nodegroup.amazonaws.com"}, + Condition: iamv1.Conditions{ + iamv1.StringLike: map[string]string{"iam:AWSServiceName": "eks-nodegroup.amazonaws.com"}, }, }) - statement = append(statement, infrav1.StatementEntry{ - Effect: infrav1.EffectAllow, - Action: infrav1.Actions{ + statement = append(statement, iamv1.StatementEntry{ + Effect: iamv1.EffectAllow, + Action: iamv1.Actions{ "iam:CreateServiceLinkedRole", }, - Resource: infrav1.Resources{ + Resource: iamv1.Resources{ "arn:aws:iam::*:role/aws-service-role/eks-fargate-pods.amazonaws.com/AWSServiceRoleForAmazonEKSForFargate", }, - Condition: infrav1.Conditions{ - infrav1.StringLike: map[string]string{"iam:AWSServiceName": "eks-fargate.amazonaws.com"}, + Condition: iamv1.Conditions{ + iamv1.StringLike: map[string]string{"iam:AWSServiceName": "eks-fargate.amazonaws.com"}, }, }) if t.Spec.EKS.AllowIAMRoleCreation { - allowedIAMActions = append(allowedIAMActions, infrav1.Actions{ + allowedIAMActions = append(allowedIAMActions, iamv1.Actions{ "iam:DetachRolePolicy", "iam:DeleteRole", "iam:CreateRole", @@ -329,37 +330,37 @@ func (t Template) ControllersPolicyEKS() *infrav1.PolicyDocument { "iam:AttachRolePolicy", }...) - statement = append(statement, infrav1.StatementEntry{ - Action: infrav1.Actions{ + statement = append(statement, iamv1.StatementEntry{ + Action: iamv1.Actions{ "iam:ListOpenIDConnectProviders", "iam:CreateOpenIDConnectProvider", "iam:AddClientIDToOpenIDConnectProvider", "iam:UpdateOpenIDConnectProviderThumbprint", "iam:DeleteOpenIDConnectProvider", }, - Resource: infrav1.Resources{ + Resource: iamv1.Resources{ "*", }, - Effect: infrav1.EffectAllow, + Effect: iamv1.EffectAllow, }) } - statement = append(statement, []infrav1.StatementEntry{ + statement = append(statement, []iamv1.StatementEntry{ { Action: allowedIAMActions, - Resource: infrav1.Resources{ + Resource: iamv1.Resources{ "arn:*:iam::*:role/*", }, - Effect: infrav1.EffectAllow, + Effect: iamv1.EffectAllow, }, { - Action: infrav1.Actions{ + Action: iamv1.Actions{ "iam:GetPolicy", }, - Resource: infrav1.Resources{ + Resource: iamv1.Resources{ t.generateAWSManagedPolicyARN(eksClusterPolicyName), }, - Effect: infrav1.EffectAllow, + Effect: iamv1.EffectAllow, }, { - Action: infrav1.Actions{ + Action: iamv1.Actions{ "eks:DescribeCluster", "eks:ListClusters", "eks:CreateCluster", @@ -375,13 +376,13 @@ func (t Template) ControllersPolicyEKS() *infrav1.PolicyDocument { "eks:CreateNodegroup", "eks:AssociateEncryptionConfig", }, - Resource: infrav1.Resources{ + Resource: iamv1.Resources{ "arn:*:eks:*:*:cluster/*", "arn:*:eks:*:*:nodegroup/*/*/*", }, - Effect: infrav1.EffectAllow, + Effect: iamv1.EffectAllow, }, { - Action: infrav1.Actions{ + Action: iamv1.Actions{ "eks:ListAddons", "eks:CreateAddon", "eks:DescribeAddonVersions", @@ -393,34 +394,34 @@ func (t Template) ControllersPolicyEKS() *infrav1.PolicyDocument { "eks:CreateFargateProfile", "eks:DeleteFargateProfile", }, - Resource: infrav1.Resources{ + Resource: iamv1.Resources{ "*", }, - Effect: infrav1.EffectAllow, + Effect: iamv1.EffectAllow, }, { - Action: infrav1.Actions{ + Action: iamv1.Actions{ "iam:PassRole", }, - Resource: infrav1.Resources{ + Resource: iamv1.Resources{ "*", }, - Condition: infrav1.Conditions{ + Condition: iamv1.Conditions{ "StringEquals": map[string]string{ "iam:PassedToService": "eks.amazonaws.com", }, }, - Effect: infrav1.EffectAllow, + Effect: iamv1.EffectAllow, }, { - Action: infrav1.Actions{ + Action: iamv1.Actions{ "kms:CreateGrant", "kms:DescribeKey", }, - Resource: infrav1.Resources{ + Resource: iamv1.Resources{ "*", }, - Effect: infrav1.EffectAllow, - Condition: infrav1.Conditions{ + Effect: iamv1.EffectAllow, + Condition: iamv1.Conditions{ "ForAnyValue:StringLike": map[string]string{ "kms:ResourceAliases": fmt.Sprintf("alias/%s", t.Spec.EKS.KMSAliasPrefix), }, @@ -428,19 +429,19 @@ func (t Template) ControllersPolicyEKS() *infrav1.PolicyDocument { }, }...) - return &infrav1.PolicyDocument{ - Version: infrav1.CurrentVersion, + return &iamv1.PolicyDocument{ + Version: iamv1.CurrentVersion, Statement: statement, } } -func (t Template) allowedEC2InstanceProfiles() infrav1.Resources { +func (t Template) allowedEC2InstanceProfiles() iamv1.Resources { if t.Spec.ClusterAPIControllers.AllowedEC2InstanceProfiles == nil { t.Spec.ClusterAPIControllers.AllowedEC2InstanceProfiles = []string{ - t.NewManagedName(infrav1.Any), + t.NewManagedName(iamv1.Any), } } - instanceProfiles := make(infrav1.Resources, len(t.Spec.ClusterAPIControllers.AllowedEC2InstanceProfiles)) + instanceProfiles := make(iamv1.Resources, len(t.Spec.ClusterAPIControllers.AllowedEC2InstanceProfiles)) for i, p := range t.Spec.ClusterAPIControllers.AllowedEC2InstanceProfiles { instanceProfiles[i] = fmt.Sprintf("arn:*:iam::*:role/%s", p) diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_node.go b/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_node.go index 934631767b..54bc1b71cb 100644 --- a/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_node.go +++ b/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_node.go @@ -17,42 +17,43 @@ limitations under the License. package bootstrap import ( - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" ) -func (t Template) secretPolicy(secureSecretsBackend infrav1.SecretBackend) infrav1.StatementEntry { +func (t Template) secretPolicy(secureSecretsBackend infrav1.SecretBackend) iamv1.StatementEntry { switch secureSecretsBackend { case infrav1.SecretBackendSecretsManager: - return infrav1.StatementEntry{ - Effect: infrav1.EffectAllow, - Resource: infrav1.Resources{ + return iamv1.StatementEntry{ + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{ "arn:*:secretsmanager:*:*:secret:aws.cluster.x-k8s.io/*", }, - Action: infrav1.Actions{ + Action: iamv1.Actions{ "secretsmanager:DeleteSecret", "secretsmanager:GetSecretValue", }, } case infrav1.SecretBackendSSMParameterStore: - return infrav1.StatementEntry{ - Effect: infrav1.EffectAllow, - Resource: infrav1.Resources{ + return iamv1.StatementEntry{ + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{ "arn:*:ssm:*:*:parameter/cluster.x-k8s.io/*", }, - Action: infrav1.Actions{ + Action: iamv1.Actions{ "ssm:DeleteParameter", "ssm:GetParameter", }, } } - return infrav1.StatementEntry{} + return iamv1.StatementEntry{} } -func (t Template) sessionManagerPolicy() infrav1.StatementEntry { - return infrav1.StatementEntry{ - Effect: infrav1.EffectAllow, - Resource: infrav1.Resources{infrav1.Any}, - Action: infrav1.Actions{ +func (t Template) sessionManagerPolicy() iamv1.StatementEntry { + return iamv1.StatementEntry{ + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{iamv1.Any}, + Action: iamv1.Actions{ "ssm:UpdateInstanceInformation", "ssmmessages:CreateControlChannel", "ssmmessages:CreateDataChannel", @@ -80,7 +81,7 @@ func (t Template) nodeManagedPolicies() []string { return policies } -func (t Template) nodePolicy() *infrav1.PolicyDocument { +func (t Template) nodePolicy() *iamv1.PolicyDocument { policyDocument := t.cloudProviderNodeAwsPolicy() for _, secureSecretsBackend := range t.Spec.SecureSecretsBackends { policyDocument.Statement = append( diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/control_plane.go b/cmd/clusterawsadm/cloudformation/bootstrap/control_plane.go index 92ea3c3695..ba06392488 100644 --- a/cmd/clusterawsadm/cloudformation/bootstrap/control_plane.go +++ b/cmd/clusterawsadm/cloudformation/bootstrap/control_plane.go @@ -18,7 +18,7 @@ package bootstrap import ( cfn_iam "github.com/awslabs/goformation/v4/cloudformation/iam" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" ) func (t Template) controlPlanePolicies() []cfn_iam.Role_Policy { @@ -28,9 +28,9 @@ func (t Template) controlPlanePolicies() []cfn_iam.Role_Policy { policies = append(policies, cfn_iam.Role_Policy{ PolicyName: t.Spec.StackName, - PolicyDocument: v1alpha4.PolicyDocument{ + PolicyDocument: iamv1.PolicyDocument{ Statement: t.Spec.ControlPlane.ExtraStatements, - Version: v1alpha4.CurrentVersion, + Version: iamv1.CurrentVersion, }, }, ) @@ -38,7 +38,7 @@ func (t Template) controlPlanePolicies() []cfn_iam.Role_Policy { return policies } -func (t Template) controlPlaneTrustPolicy() *v1alpha4.PolicyDocument { +func (t Template) controlPlaneTrustPolicy() *iamv1.PolicyDocument { policyDocument := ec2AssumeRolePolicy() policyDocument.Statement = append(policyDocument.Statement, t.Spec.ControlPlane.TrustStatements...) return policyDocument diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/csi.go b/cmd/clusterawsadm/cloudformation/bootstrap/csi.go index 17ff89f4a0..6433727bd5 100644 --- a/cmd/clusterawsadm/cloudformation/bootstrap/csi.go +++ b/cmd/clusterawsadm/cloudformation/bootstrap/csi.go @@ -18,7 +18,7 @@ package bootstrap import ( "github.com/awslabs/goformation/v4/cloudformation" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" ) func (t Template) csiControlPlaneAwsRoles() []string { @@ -30,14 +30,14 @@ func (t Template) csiControlPlaneAwsRoles() []string { } // From https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/docs/example-iam-policy.json -func (t Template) csiControllerPolicy() *v1alpha4.PolicyDocument { - return &v1alpha4.PolicyDocument{ - Version: v1alpha4.CurrentVersion, - Statement: []v1alpha4.StatementEntry{ +func (t Template) csiControllerPolicy() *iamv1.PolicyDocument { + return &iamv1.PolicyDocument{ + Version: iamv1.CurrentVersion, + Statement: []iamv1.StatementEntry{ { - Effect: v1alpha4.EffectAllow, - Resource: v1alpha4.Resources{v1alpha4.Any}, - Action: v1alpha4.Actions{ + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{iamv1.Any}, + Action: iamv1.Actions{ "ec2:AttachVolume", "ec2:CreateSnapshot", "ec2:CreateTags", diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/fargate.go b/cmd/clusterawsadm/cloudformation/bootstrap/fargate.go index 63a568a2d9..761bdc1f38 100644 --- a/cmd/clusterawsadm/cloudformation/bootstrap/fargate.go +++ b/cmd/clusterawsadm/cloudformation/bootstrap/fargate.go @@ -17,7 +17,7 @@ limitations under the License. package bootstrap import ( - bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1alpha1" + bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/eks" ) diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/iam.go b/cmd/clusterawsadm/cloudformation/bootstrap/iam.go index 3c6665a4a3..54cd5c38c8 100644 --- a/cmd/clusterawsadm/cloudformation/bootstrap/iam.go +++ b/cmd/clusterawsadm/cloudformation/bootstrap/iam.go @@ -21,8 +21,8 @@ import ( "io/ioutil" "path" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/converters" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" ) // PolicyName defines the name of a managed IAM policy. @@ -61,8 +61,8 @@ func (t Template) GenerateManagedIAMPolicyDocuments(policyDocDir string) error { return nil } -func (t Template) policyFunctionMap() map[PolicyName]func() *v1alpha4.PolicyDocument { - return map[PolicyName]func() *v1alpha4.PolicyDocument{ +func (t Template) policyFunctionMap() map[PolicyName]func() *iamv1.PolicyDocument { + return map[PolicyName]func() *iamv1.PolicyDocument{ ControlPlanePolicy: t.cloudProviderControlPlaneAwsPolicy, ControllersPolicy: t.ControllersPolicy, ControllersPolicyEKS: t.ControllersPolicyEKS, @@ -72,6 +72,6 @@ func (t Template) policyFunctionMap() map[PolicyName]func() *v1alpha4.PolicyDocu } // GetPolicyDocFromPolicyName returns a Template's policy document. -func (t Template) GetPolicyDocFromPolicyName(policyName PolicyName) *v1alpha4.PolicyDocument { +func (t Template) GetPolicyDocFromPolicyName(policyName PolicyName) *iamv1.PolicyDocument { return t.policyFunctionMap()[policyName]() } diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/node.go b/cmd/clusterawsadm/cloudformation/bootstrap/node.go index 8c06d5b79b..80ccb94d56 100644 --- a/cmd/clusterawsadm/cloudformation/bootstrap/node.go +++ b/cmd/clusterawsadm/cloudformation/bootstrap/node.go @@ -18,7 +18,7 @@ package bootstrap import ( cfn_iam "github.com/awslabs/goformation/v4/cloudformation/iam" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" ) func (t Template) nodePolicies() []cfn_iam.Role_Policy { @@ -27,9 +27,9 @@ func (t Template) nodePolicies() []cfn_iam.Role_Policy { policies = append(policies, cfn_iam.Role_Policy{ PolicyName: t.Spec.StackName, - PolicyDocument: v1alpha4.PolicyDocument{ + PolicyDocument: iamv1.PolicyDocument{ Statement: t.Spec.Nodes.ExtraStatements, - Version: v1alpha4.CurrentVersion, + Version: iamv1.CurrentVersion, }, }, ) @@ -37,7 +37,7 @@ func (t Template) nodePolicies() []cfn_iam.Role_Policy { return policies } -func (t Template) nodeTrustPolicy() *v1alpha4.PolicyDocument { +func (t Template) nodeTrustPolicy() *iamv1.PolicyDocument { policyDocument := ec2AssumeRolePolicy() policyDocument.Statement = append(policyDocument.Statement, t.Spec.Nodes.TrustStatements...) return policyDocument diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/template.go b/cmd/clusterawsadm/cloudformation/bootstrap/template.go index 41cdf6c103..3458978e37 100644 --- a/cmd/clusterawsadm/cloudformation/bootstrap/template.go +++ b/cmd/clusterawsadm/cloudformation/bootstrap/template.go @@ -19,15 +19,15 @@ package bootstrap import ( "fmt" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" "github.com/awslabs/goformation/v4/cloudformation" cfn_iam "github.com/awslabs/goformation/v4/cloudformation/iam" - bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1alpha1" + bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/converters" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" eksiam "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/eks/iam" ) @@ -181,7 +181,7 @@ func (t Template) RenderCloudFormation() *cloudformation.Template { if !t.Spec.EKS.DefaultControlPlaneRole.Disable && !t.Spec.EKS.Disable { template.Resources[AWSIAMRoleEKSControlPlane] = &cfn_iam.Role{ RoleName: ekscontrolplanev1.DefaultEKSControlPlaneRole, - AssumeRolePolicyDocument: AssumeRolePolicy(v1alpha4.PrincipalService, []string{"eks.amazonaws.com"}), + AssumeRolePolicyDocument: AssumeRolePolicy(iamv1.PrincipalService, []string{"eks.amazonaws.com"}), ManagedPolicyArns: t.eksControlPlanePolicies(), Tags: converters.MapToCloudFormationTags(t.Spec.EKS.DefaultControlPlaneRole.Tags), } @@ -189,8 +189,8 @@ func (t Template) RenderCloudFormation() *cloudformation.Template { if !t.Spec.EKS.ManagedMachinePool.Disable && !t.Spec.EKS.Disable { template.Resources[AWSIAMRoleEKSNodegroup] = &cfn_iam.Role{ - RoleName: infrav1exp.DefaultEKSNodegroupRole, - AssumeRolePolicyDocument: AssumeRolePolicy(v1alpha4.PrincipalService, []string{"ec2.amazonaws.com", "eks.amazonaws.com"}), + RoleName: expinfrav1.DefaultEKSNodegroupRole, + AssumeRolePolicyDocument: AssumeRolePolicy(iamv1.PrincipalService, []string{"ec2.amazonaws.com", "eks.amazonaws.com"}), ManagedPolicyArns: t.eksMachinePoolPolicies(), Tags: converters.MapToCloudFormationTags(t.Spec.EKS.ManagedMachinePool.Tags), } @@ -198,8 +198,8 @@ func (t Template) RenderCloudFormation() *cloudformation.Template { if !t.Spec.EKS.Fargate.Disable && !t.Spec.EKS.Disable { template.Resources[AWSIAMRoleEKSFargate] = &cfn_iam.Role{ - RoleName: infrav1exp.DefaultEKSFargateRole, - AssumeRolePolicyDocument: AssumeRolePolicy(v1alpha4.PrincipalService, []string{eksiam.EKSFargateService}), + RoleName: expinfrav1.DefaultEKSFargateRole, + AssumeRolePolicyDocument: AssumeRolePolicy(iamv1.PrincipalService, []string{eksiam.EKSFargateService}), ManagedPolicyArns: fargateProfilePolicies(t.Spec.EKS.Fargate), Tags: converters.MapToCloudFormationTags(t.Spec.EKS.Fargate.Tags), } @@ -208,29 +208,29 @@ func (t Template) RenderCloudFormation() *cloudformation.Template { return template } -func ec2AssumeRolePolicy() *v1alpha4.PolicyDocument { - return AssumeRolePolicy(v1alpha4.PrincipalService, []string{"ec2.amazonaws.com"}) +func ec2AssumeRolePolicy() *iamv1.PolicyDocument { + return AssumeRolePolicy(iamv1.PrincipalService, []string{"ec2.amazonaws.com"}) } // AWSArnAssumeRolePolicy will assume Policies using PolicyArns. -func AWSArnAssumeRolePolicy(identityID string) *v1alpha4.PolicyDocument { - return AssumeRolePolicy(v1alpha4.PrincipalAWS, []string{identityID}) +func AWSArnAssumeRolePolicy(identityID string) *iamv1.PolicyDocument { + return AssumeRolePolicy(iamv1.PrincipalAWS, []string{identityID}) } // AWSServiceAssumeRolePolicy will assume an AWS Service policy. -func AWSServiceAssumeRolePolicy(identityID string) *v1alpha4.PolicyDocument { - return AssumeRolePolicy(v1alpha4.PrincipalService, []string{identityID}) +func AWSServiceAssumeRolePolicy(identityID string) *iamv1.PolicyDocument { + return AssumeRolePolicy(iamv1.PrincipalService, []string{identityID}) } // AssumeRolePolicy will create a role session and pass session policies programmatically. -func AssumeRolePolicy(identityType v1alpha4.PrincipalType, principalIDs []string) *v1alpha4.PolicyDocument { - return &v1alpha4.PolicyDocument{ - Version: v1alpha4.CurrentVersion, - Statement: []v1alpha4.StatementEntry{ +func AssumeRolePolicy(identityType iamv1.PrincipalType, principalIDs []string) *iamv1.PolicyDocument { + return &iamv1.PolicyDocument{ + Version: iamv1.CurrentVersion, + Statement: []iamv1.StatementEntry{ { - Effect: v1alpha4.EffectAllow, - Principal: v1alpha4.Principals{identityType: principalIDs}, - Action: v1alpha4.Actions{"sts:AssumeRole"}, + Effect: iamv1.EffectAllow, + Principal: iamv1.Principals{identityType: principalIDs}, + Action: iamv1.Actions{"sts:AssumeRole"}, }, }, } diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/template_test.go b/cmd/clusterawsadm/cloudformation/bootstrap/template_test.go index 6b92481bb6..86e7974f76 100644 --- a/cmd/clusterawsadm/cloudformation/bootstrap/template_test.go +++ b/cmd/clusterawsadm/cloudformation/bootstrap/template_test.go @@ -25,7 +25,8 @@ import ( "github.com/awslabs/goformation/v4/cloudformation" "github.com/sergi/go-diff/diffmatchpatch" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" "sigs.k8s.io/yaml" ) @@ -119,32 +120,32 @@ func Test_RenderCloudformation(t *testing.T) { template: func() Template { t := NewTemplate() t.Spec.BootstrapUser.Enable = true - t.Spec.ControlPlane.ExtraStatements = infrav1.Statements{ + t.Spec.ControlPlane.ExtraStatements = iamv1.Statements{ { - Effect: infrav1.EffectAllow, - Resource: infrav1.Resources{infrav1.Any}, - Action: infrav1.Actions{"test:action"}, + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{iamv1.Any}, + Action: iamv1.Actions{"test:action"}, }, } - t.Spec.Nodes.ExtraStatements = infrav1.Statements{ + t.Spec.Nodes.ExtraStatements = iamv1.Statements{ { - Effect: infrav1.EffectAllow, - Resource: infrav1.Resources{infrav1.Any}, - Action: infrav1.Actions{"test:node-action"}, + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{iamv1.Any}, + Action: iamv1.Actions{"test:node-action"}, }, } - t.Spec.BootstrapUser.ExtraStatements = infrav1.Statements{ + t.Spec.BootstrapUser.ExtraStatements = iamv1.Statements{ { - Effect: infrav1.EffectAllow, - Resource: infrav1.Resources{infrav1.Any}, - Action: infrav1.Actions{"test:user-action"}, + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{iamv1.Any}, + Action: iamv1.Actions{"test:user-action"}, }, } - t.Spec.ClusterAPIControllers.ExtraStatements = infrav1.Statements{ + t.Spec.ClusterAPIControllers.ExtraStatements = iamv1.Statements{ { - Effect: infrav1.EffectAllow, - Resource: infrav1.Resources{infrav1.Any}, - Action: infrav1.Actions{"test:controller-action"}, + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{iamv1.Any}, + Action: iamv1.Actions{"test:controller-action"}, }, } return t diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/user.go b/cmd/clusterawsadm/cloudformation/bootstrap/user.go index 18d3378e2a..58ec72fc8a 100644 --- a/cmd/clusterawsadm/cloudformation/bootstrap/user.go +++ b/cmd/clusterawsadm/cloudformation/bootstrap/user.go @@ -19,7 +19,7 @@ package bootstrap import ( "github.com/awslabs/goformation/v4/cloudformation" cfn_iam "github.com/awslabs/goformation/v4/cloudformation/iam" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" ) func (t Template) bootstrapUserGroups() []string { @@ -36,9 +36,9 @@ func (t Template) bootstrapUserPolicy() []cfn_iam.User_Policy { userPolicies = append(userPolicies, cfn_iam.User_Policy{ PolicyName: t.Spec.StackName, - PolicyDocument: v1alpha4.PolicyDocument{ + PolicyDocument: iamv1.PolicyDocument{ Statement: t.Spec.BootstrapUser.ExtraStatements, - Version: v1alpha4.CurrentVersion, + Version: iamv1.CurrentVersion, }, }, ) diff --git a/cmd/clusterawsadm/cmd/alpha/alpha.go b/cmd/clusterawsadm/cmd/alpha/alpha.go deleted file mode 100644 index 1e32f0d9a1..0000000000 --- a/cmd/clusterawsadm/cmd/alpha/alpha.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -Copyright 2018 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 alpha - -import ( - "github.com/spf13/cobra" - "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/cmd/alpha/bootstrap" - "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/cmd/alpha/migrate" - "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/cmd/flags" -) - -// AlphaCmd is the top-level alpha set of commands. -func AlphaCmd() *cobra.Command { - newCmd := &cobra.Command{ - Use: "alpha", - Short: "alpha commands", - Long: `Alpha commands may not be supported in future releases`, - RunE: func(cmd *cobra.Command, args []string) error { - return cmd.Help() - }, - } - newCmd.AddCommand(bootstrap.RootCmd()) - newCmd.AddCommand(migrate.MigrateCmd()) - flags.MarkAlphaDeprecated(newCmd) - return newCmd -} diff --git a/cmd/clusterawsadm/cmd/alpha/bootstrap/bootstrap.go b/cmd/clusterawsadm/cmd/alpha/bootstrap/bootstrap.go deleted file mode 100644 index 5cb2d093d9..0000000000 --- a/cmd/clusterawsadm/cmd/alpha/bootstrap/bootstrap.go +++ /dev/null @@ -1,277 +0,0 @@ -/* -Copyright 2018 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 bootstrap - -import ( - "fmt" - "os" - - "github.com/aws/aws-sdk-go/aws/session" - cfn "github.com/aws/aws-sdk-go/service/cloudformation" - "github.com/spf13/cobra" - bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1alpha1" - cfnBootstrap "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/cloudformation/bootstrap" - cloudformation "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/cloudformation/service" - "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/cmd/flags" - "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/sts" - - creds "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/credentials" -) - -const backupAWSRegion = "us-east-1" - -var ( - extraControlPlanePolicies []string - extraNodePolicies []string -) - -// RootCmd is the root of the `alpha bootstrap command`. -func RootCmd() *cobra.Command { - newCmd := &cobra.Command{ - Use: "bootstrap", - Short: "bootstrap cloudformation", - Long: `Create and apply bootstrap AWS CloudFormation template to create IAM permissions for the Cluster API`, - RunE: func(cmd *cobra.Command, args []string) error { - return cmd.Help() - }, - } - newCmd.AddCommand(generateCmd()) - newCmd.AddCommand(createStackCmd()) - newCmd.AddCommand(generateIAMPolicyDocJSON()) - newCmd.AddCommand(encodeAWSSecret()) - newCmd.AddCommand(generateAWSDefaultProfileWithChain()) - newCmd.PersistentFlags().String("partition", "aws", "AWS partition, for AWS GovCloud (US) it is aws-us-gov") - flags.MarkAlphaDeprecated(newCmd) - - return newCmd -} - -func bootstrapTemplateFromCmdLine() cfnBootstrap.Template { - conf := bootstrapv1.NewAWSIAMConfiguration() - conf.Spec.BootstrapUser.Enable = true - conf.Spec.ControlPlane.ExtraPolicyAttachments = extraControlPlanePolicies - conf.Spec.Nodes.ExtraPolicyAttachments = extraNodePolicies - return cfnBootstrap.Template{ - Spec: &conf.Spec, - } -} - -func generateCmd() *cobra.Command { - newCmd := &cobra.Command{ - Use: "generate-cloudformation [AWS Account ID]", - Short: "Generate bootstrap AWS CloudFormation template", - Long: `Generate bootstrap AWS CloudFormation template with initial IAM policies. -You must enter an AWS account ID to generate the CloudFormation template. - -Instructions for obtaining the AWS account ID can be found on https://docs.aws.amazon.com/IAM/latest/UserGuide/console_account-alias.html -`, - Args: func(cmd *cobra.Command, args []string) error { - if len(args) != 1 { - fmt.Printf("Error: requires AWS Account ID as an argument\n\n") - if err := cmd.Help(); err != nil { - return err - } - os.Exit(200) - } - if !sts.ValidateAccountID(args[0]) { - fmt.Printf("Error: provided AWS Account ID is invalid\n\n") - if err := cmd.Help(); err != nil { - return err - } - os.Exit(201) - } - return nil - }, - RunE: func(cmd *cobra.Command, args []string) error { - template := bootstrapTemplateFromCmdLine().RenderCloudFormation() - j, err := template.YAML() - if err != nil { - return err - } - - fmt.Print(string(j)) - return nil - }, - } - - newCmd.Flags().StringSliceVar(&extraControlPlanePolicies, "extra-controlplane-policies", []string{}, "Comma-separated list of extra policies (ARNs) to add to the created control plane role (must already exist)") - newCmd.Flags().StringSliceVar(&extraNodePolicies, "extra-node-policies", []string{}, "Comma-separated list of extra policies (ARNs) to add to the created nodes role (must already exist)") - flags.MarkAlphaDeprecated(newCmd) - return newCmd -} - -func createStackCmd() *cobra.Command { - newCmd := &cobra.Command{ - Use: "create-stack", - Short: "Create a new AWS CloudFormation stack using the bootstrap template", - Long: "Create a new AWS CloudFormation stack using the bootstrap template", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - t := bootstrapTemplateFromCmdLine() - fmt.Printf("Attempting to create CloudFormation stack %s\n", t.Spec.StackName) - sess, err := session.NewSessionWithOptions(session.Options{ - SharedConfigState: session.SharedConfigEnable, - }) - if err != nil { - fmt.Printf("Error: %v", err) - return err - } - - cfnSvc := cloudformation.NewService(cfn.New(sess)) - - err = cfnSvc.ReconcileBootstrapStack(t.Spec.StackName, *t.RenderCloudFormation()) - if err != nil { - fmt.Printf("Error: %v", err) - return err - } - - return cfnSvc.ShowStackResources(t.Spec.StackName) - }, - } - - newCmd.Flags().StringSliceVar(&extraControlPlanePolicies, "extra-controlplane-policies", []string{}, "Comma-separated list of extra policies (ARNs) to add to the created control plane role (must already exist)") - newCmd.Flags().StringSliceVar(&extraNodePolicies, "extra-node-policies", []string{}, "Comma-separated list of extra policies (ARNs) to add to the created nodes role (must already exist)") - flags.MarkAlphaDeprecated(newCmd) - return newCmd -} - -func generateIAMPolicyDocJSON() *cobra.Command { - newCmd := &cobra.Command{ - Use: "generate-iam-policy-docs [AWS Account ID] [Directory for JSON]", - Short: "Generate PolicyDocument JSON for all ManagedIAMPolicies", - Long: `Generate PolicyDocument JSON for all ManagedIAMPolicies`, - Args: func(cmd *cobra.Command, args []string) error { - if len(args) != 2 { - fmt.Printf("Error: requires, as arguments, an AWS Account ID and a directory for the exported JSON\n\n") - if err := cmd.Help(); err != nil { - return err - } - os.Exit(300) - } - accountID := args[0] - policyDocDir := args[1] - - var err error - if !sts.ValidateAccountID(accountID) { - fmt.Printf("Error: provided AWS Account ID is invalid\n\n") - if err := cmd.Help(); err != nil { - return err - } - os.Exit(301) - } - - if _, err = os.Stat(policyDocDir); os.IsNotExist(err) { - err = os.Mkdir(policyDocDir, 0o755) - if err != nil { - fmt.Printf("Error: failed to make directory %q, %v", policyDocDir, err) - if err := cmd.Help(); err != nil { - return err - } - os.Exit(302) - } - } - if err != nil { - fmt.Printf("Error: failed to stat directory %q, %v", policyDocDir, err) - if err := cmd.Help(); err != nil { - return err - } - os.Exit(303) - } - return nil - }, - RunE: func(cmd *cobra.Command, args []string) error { - policyDocDir := args[1] - - t := bootstrapTemplateFromCmdLine() - err := t.GenerateManagedIAMPolicyDocuments(policyDocDir) - if err != nil { - return fmt.Errorf("failed to generate PolicyDocument for all ManagedIAMPolicies: %w", err) - } - - fmt.Printf("PolicyDocument for all ManagedIAMPolicies successfully generated in JSON at %q\n", policyDocDir) - return nil - }, - } - flags.MarkAlphaDeprecated(newCmd) - return newCmd -} - -func encodeAWSSecret() *cobra.Command { - newCmd := &cobra.Command{ - Use: "encode-aws-credentials", - Short: "Encode AWS credentials as a base64 encoded Kubernetes secret", - Long: "Encode AWS credentials as a base64 encoded Kubernetes secret", - RunE: func(cmd *cobra.Command, args []string) error { - region, err := flags.GetRegion(cmd) - if err != nil { - fmt.Fprintf(os.Stderr, "Could not resolve AWS region, defaulting to %s.\n", backupAWSRegion) - region = backupAWSRegion - } - - awsCreds, err := creds.NewAWSCredentialFromDefaultChain(region) - if err != nil { - return err - } - - str, err := awsCreds.RenderBase64EncodedAWSDefaultProfile() - if err != nil { - return err - } - - fmt.Println(str) - - return nil - }, - } - flags.MarkAlphaDeprecated(newCmd) - flags.AddRegionFlag(newCmd) - return newCmd -} - -func generateAWSDefaultProfileWithChain() *cobra.Command { - newCmd := &cobra.Command{ - Use: "generate-aws-default-profile", - Short: "Generate an AWS profile from the current environment", - Long: "Generate an AWS profile from the current environment for the ephemeral bootstrap cluster", - RunE: func(cmd *cobra.Command, args []string) error { - flags.CredentialWarning(cmd) - - region, err := flags.GetRegion(cmd) - if err != nil { - fmt.Fprintf(os.Stderr, "Could not resolve AWS region, defaulting to %s.\n", backupAWSRegion) - region = backupAWSRegion - } - - awsCreds, err := creds.NewAWSCredentialFromDefaultChain(region) - if err != nil { - return err - } - - profile, err := awsCreds.RenderAWSDefaultProfile() - if err != nil { - return err - } - - fmt.Println(profile) - - return nil - }, - } - flags.MarkAlphaDeprecated(newCmd) - flags.AddRegionFlag(newCmd) - return newCmd -} diff --git a/cmd/clusterawsadm/cmd/alpha/migrate/BUILD b/cmd/clusterawsadm/cmd/alpha/migrate/BUILD deleted file mode 100644 index 55280cd420..0000000000 --- a/cmd/clusterawsadm/cmd/alpha/migrate/BUILD +++ /dev/null @@ -1,15 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "go_default_library", - srcs = ["migrate.go"], - importpath = "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/cmd/alpha/migrate", - visibility = ["//visibility:public"], - deps = [ - "//api/v1alpha2:go_default_library", - "//vendor/github.com/aws/aws-sdk-go/aws:go_default_library", - "//vendor/github.com/aws/aws-sdk-go/aws/session:go_default_library", - "//vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi:go_default_library", - "//vendor/github.com/spf13/cobra:go_default_library", - ], -) diff --git a/cmd/clusterawsadm/cmd/alpha/migrate/migrate.go b/cmd/clusterawsadm/cmd/alpha/migrate/migrate.go deleted file mode 100644 index f1b690a177..0000000000 --- a/cmd/clusterawsadm/cmd/alpha/migrate/migrate.go +++ /dev/null @@ -1,213 +0,0 @@ -/* -Copyright 2018 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 migrate - -import ( - "fmt" - "os" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" - awstags "github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi" - "github.com/pkg/errors" - "github.com/spf13/cobra" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/cmd/flags" -) - -var ( - // See: https://docs.aws.amazon.com/sdk-for-go/api/service/resourcegroupstaggingapi/#TagResourcesInput - maxARNs = 20 - supportedVersions = []string{"0.3.0"} - - clusterName string -) - -// MigrateCmd is the command for migrating AWS resources to be compatible -// with specific CAPA versions. -func MigrateCmd() *cobra.Command { - newCmd := &cobra.Command{ - Use: "migrate [target version]", - Short: "migrate between CAPA versions", - Long: fmt.Sprintf(`Migrate AWS resources between incompatible versions of Cluster API Provider AWS. -Supported versions: %v`, supportedVersions), - Args: func(cmd *cobra.Command, args []string) error { - if len(args) != 1 { - fmt.Printf("Error: requires target version as an argument. Supported versions: %v\n\n", supportedVersions) - if err := cmd.Help(); err != nil { - return err - } - os.Exit(200) - } - if !isValidVersion(args[0]) { - fmt.Printf("Error: unsupported migration target. Supported versions: %v\n\n", supportedVersions) - if err := cmd.Help(); err != nil { - return err - } - os.Exit(201) - } - return nil - }, - RunE: func(cmd *cobra.Command, args []string) error { - sess, err := session.NewSessionWithOptions(session.Options{ - SharedConfigState: session.SharedConfigEnable, - }) - if err != nil { - fmt.Printf("Error: %v", err) - return nil - } - - tagsSvc := awstags.New(sess) - - resources, err := getResourcesByCluster(tagsSvc, clusterName) - if err != nil { - return err - } - - fmt.Printf("Found %v resources owned by cluster %q.\n", len(resources), clusterName) - fmt.Printf("Applying new tags to cluster %q.\n", clusterName) - - err = applyNewTags(tagsSvc, resources, clusterName) - if err != nil { - return err - } - - fmt.Printf("Removing legacy tags from cluster %q\n", clusterName) - - return removeOldTags(tagsSvc, resources, clusterName) - }, - } - - newCmd.Flags().StringVarP(&clusterName, "clusterName", "n", "", "name of existing Cluster object") - if err := newCmd.MarkFlagRequired("clusterName"); err != nil { - panic(errors.Wrap(err, "error making required flag")) - } - flags.MarkAlphaDeprecated(newCmd) - return newCmd -} - -func getResourcesByCluster(svc *awstags.ResourceGroupsTaggingAPI, name string) ([]*string, error) { - input := &awstags.GetResourcesInput{ - TagFilters: []*awstags.TagFilter{ - { - Key: aws.String(fmt.Sprintf("kubernetes.io/cluster/%s", name)), - Values: []*string{aws.String("owned")}, - }, - { - Key: aws.String("sigs.k8s.io/cluster-api-provider-aws/managed"), - Values: []*string{aws.String("true")}, - }, - }, - } - - out, err := svc.GetResources(input) - if err != nil { - return nil, err - } - - arns := make([]*string, 0, len(out.ResourceTagMappingList)) - for _, resource := range out.ResourceTagMappingList { - arns = append(arns, resource.ResourceARN) - } - - return arns, nil -} - -func applyNewTags(svc *awstags.ResourceGroupsTaggingAPI, arns []*string, name string) error { - for i := 0; i <= (len(arns) / maxARNs); i++ { - end := (i + 1) * maxARNs - if end > len(arns) { - end = len(arns) - } - - input := &awstags.TagResourcesInput{ - ResourceARNList: arns[i*maxARNs : end], - Tags: map[string]*string{ - infrav1.ClusterTagKey(name): aws.String("owned"), - }, - } - - _, err := svc.TagResources(input) - if err != nil { - return err - } - } - - return nil -} - -func removeOldTags(svc *awstags.ResourceGroupsTaggingAPI, arns []*string, name string) error { - for i := 0; i <= (len(arns) / maxARNs); i++ { - end := (i + 1) * maxARNs - if end > len(arns) { - end = len(arns) - } - - managedInput := &awstags.UntagResourcesInput{ - ResourceARNList: arns[i*maxARNs : end], - TagKeys: []*string{ - aws.String("sigs.k8s.io/cluster-api-provider-aws/managed"), - }, - } - - _, err := svc.UntagResources(managedInput) - if err != nil { - return err - } - } - - var filteredARNs []*string - - for _, v := range arns { - // instances should have both ownership tags, so filter those out - // TODO(rudoi): is there a better way to filter? - if !strings.Contains(aws.StringValue(v), "instance") { - filteredARNs = append(filteredARNs, v) - } - } - - for i := 0; i <= (len(filteredARNs) / maxARNs); i++ { - end := (i + 1) * maxARNs - if i == (len(filteredARNs) / maxARNs) { - end = len(filteredARNs) - } - - ownedInput := &awstags.UntagResourcesInput{ - ResourceARNList: filteredARNs[i*maxARNs : end], - TagKeys: []*string{ - aws.String(fmt.Sprintf("kubernetes.io/cluster/%s", name)), - }, - } - - _, err := svc.UntagResources(ownedInput) - if err != nil { - return err - } - } - - return nil -} - -func isValidVersion(s string) bool { - for _, v := range supportedVersions { - if s == v { - return true - } - } - return false -} diff --git a/cmd/clusterawsadm/cmd/bootstrap/iam/config.go b/cmd/clusterawsadm/cmd/bootstrap/iam/config.go index af12590f29..52e415a68e 100644 --- a/cmd/clusterawsadm/cmd/bootstrap/iam/config.go +++ b/cmd/clusterawsadm/cmd/bootstrap/iam/config.go @@ -20,7 +20,7 @@ import ( "fmt" "github.com/spf13/cobra" - bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1alpha1" + bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/cloudformation/bootstrap" "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/configreader" "sigs.k8s.io/cluster-api/cmd/clusterctl/cmd" @@ -87,11 +87,11 @@ func addConfigFlag(c *cobra.Command) { absolute or relative; relative paths start at the current working directory. The configuration file is a Kubernetes YAML using the - bootstrap.aws.infrastructure.cluster.x-k8s.io/v1alpha1/AWSIAMConfiguration + bootstrap.aws.infrastructure.cluster.x-k8s.io/v1beta1/AWSIAMConfiguration kind. Documentation for this kind can be found at: - https://pkg.go.dev/sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1alpha1 + https://pkg.go.dev/sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1beta1 To see the default configuration, run 'clusterawsadm bootstrap iam print-config'. `)) diff --git a/cmd/clusterawsadm/cmd/root.go b/cmd/clusterawsadm/cmd/root.go index bebc6f9e62..03349888af 100644 --- a/cmd/clusterawsadm/cmd/root.go +++ b/cmd/clusterawsadm/cmd/root.go @@ -24,7 +24,6 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/cmd/alpha" "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/cmd/ami" "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/cmd/bootstrap" "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/cmd/controller" @@ -65,7 +64,6 @@ func RootCmd() *cobra.Command { return cmd.Help() }, } - newCmd.AddCommand(alpha.AlphaCmd()) newCmd.AddCommand(bootstrap.RootCmd()) newCmd.AddCommand(version.Cmd(os.Stdout)) newCmd.AddCommand(ami.RootCmd()) diff --git a/cmd/clusterawsadm/configreader/configreader.go b/cmd/clusterawsadm/configreader/configreader.go index 18435e98c7..602e5122a5 100644 --- a/cmd/clusterawsadm/configreader/configreader.go +++ b/cmd/clusterawsadm/configreader/configreader.go @@ -24,8 +24,9 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer" - bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1alpha1" - bootstrapschemev1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1alpha1/scheme" + yamlserializer "k8s.io/apimachinery/pkg/runtime/serializer/yaml" + bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1beta1" + bootstrapschemev1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1beta1/scheme" ) type errEmptyBootstrapConfig string @@ -71,6 +72,7 @@ func (fsLoader) ReadFile(filename string) ([]byte, error) { // NewFsLoader returns a Loader that loads a AWSIAMConfiguration from the `config file`. func newFsLoader(bootstrapFile string) (loader, error) { _, bootstrapCodecs, err := bootstrapschemev1.NewSchemeAndCodecs() + if err != nil { return nil, err } @@ -92,6 +94,16 @@ func (loader *fsLoader) Load() (*bootstrapv1.AWSIAMConfiguration, error) { return nil, errEmptyBootstrapConfig(loader.bootstrapFile) } + // Deserialize the TypeMeta information of this byte slice + gvk, err := yamlserializer.DefaultMetaFactory.Interpret(data) + if err != nil { + return nil, err + } + + if len(gvk.Group) == 0 || len(gvk.Version) == 0 || len(gvk.Kind) == 0 { + return nil, errors.Errorf("invalid configuration for GroupVersionKind %+v: kind and apiVersion is mandatory information that must be specified", gvk) + } + kc, err := DecodeBootstrapConfiguration(loader.bootstrapCodecs, data) if err != nil { return nil, err diff --git a/cmd/clusterawsadm/converters/cloudformation.go b/cmd/clusterawsadm/converters/cloudformation.go index fb79e59e5b..ec406105b9 100644 --- a/cmd/clusterawsadm/converters/cloudformation.go +++ b/cmd/clusterawsadm/converters/cloudformation.go @@ -18,7 +18,7 @@ package converters import ( "github.com/awslabs/goformation/v4/cloudformation/tags" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ) // MapToCloudFormationTags converts a infrav1.Tags to []tags.Tag. diff --git a/cmd/clusterawsadm/converters/iam.go b/cmd/clusterawsadm/converters/iam.go index 7788cdaf97..b1cd20ee28 100644 --- a/cmd/clusterawsadm/converters/iam.go +++ b/cmd/clusterawsadm/converters/iam.go @@ -19,11 +19,11 @@ package converters import ( "encoding/json" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" ) // IAMPolicyDocumentToJSON is the JSON output of the policy document. -func IAMPolicyDocumentToJSON(p v1alpha4.PolicyDocument) (string, error) { +func IAMPolicyDocumentToJSON(p iamv1.PolicyDocument) (string, error) { b, err := json.MarshalIndent(p, "", " ") if err != nil { return "", err diff --git a/cmd/clusterawsadm/printers/printers.go b/cmd/clusterawsadm/printers/printers.go index d2b6ebf78e..78ccc8ec24 100644 --- a/cmd/clusterawsadm/printers/printers.go +++ b/cmd/clusterawsadm/printers/printers.go @@ -26,7 +26,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - cli "k8s.io/cli-runtime/pkg/printers" + "k8s.io/cli-runtime/pkg/printers" ) // PrinterType is a type declaration for a printer type. @@ -79,10 +79,10 @@ func (p *tablePrinter) Print(in interface{}) error { return ErrTableRequired } - options := cli.PrintOptions{} - tablePrinter := cli.NewTablePrinter(options) + options := printers.PrintOptions{} + tablePrinter := printers.NewTablePrinter(options) scheme := runtime.NewScheme() - printer, err := cli.NewTypeSetter(scheme).WrapToPrinter(tablePrinter, nil) + printer, err := printers.NewTypeSetter(scheme).WrapToPrinter(tablePrinter, nil) if err != nil { return err } diff --git a/cmd/clusterawsadm/resource/list.go b/cmd/clusterawsadm/resource/list.go index d5d4d3c63c..457771a526 100644 --- a/cmd/clusterawsadm/resource/list.go +++ b/cmd/clusterawsadm/resource/list.go @@ -22,8 +22,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/session" - tagapi "github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + rgapi "github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ) // ListAWSResource fetches all AWS resources created by CAPA. @@ -42,9 +42,9 @@ func ListAWSResource(region, clusterName *string) (AWSResourceList, error) { return resourceList, err } - resourceClient := tagapi.New(sess) - input := &tagapi.GetResourcesInput{ - TagFilters: []*tagapi.TagFilter{}, + resourceClient := rgapi.New(sess) + input := &rgapi.GetResourcesInput{ + TagFilters: []*rgapi.TagFilter{}, } awsResourceTags := infrav1.Build(infrav1.BuildParams{ @@ -53,7 +53,7 @@ func ListAWSResource(region, clusterName *string) (AWSResourceList, error) { }) for tagKey, tagValue := range awsResourceTags { - tagFilter := &tagapi.TagFilter{} + tagFilter := &rgapi.TagFilter{} tagFilter.SetKey(tagKey) tagFilter.SetValues([]*string{aws.String(tagValue)}) input.TagFilters = append(input.TagFilters, tagFilter) diff --git a/config/crd/bases/bootstrap.cluster.x-k8s.io_eksconfigs.yaml b/config/crd/bases/bootstrap.cluster.x-k8s.io_eksconfigs.yaml index 44610586b7..a9a5dacc42 100644 --- a/config/crd/bases/bootstrap.cluster.x-k8s.io_eksconfigs.yaml +++ b/config/crd/bases/bootstrap.cluster.x-k8s.io_eksconfigs.yaml @@ -231,6 +231,118 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: Bootstrap configuration is ready + jsonPath: .status.ready + name: Ready + type: string + - description: Name of Secret containing bootstrap data + jsonPath: .status.dataSecretName + name: DataSecretName + type: string + name: v1beta1 + schema: + openAPIV3Schema: + description: EKSConfig is the schema for the Amazon EKS Machine Bootstrap + Configuration API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: EKSConfigSpec defines the desired state of Amazon EKS Bootstrap + Configuration. + properties: + kubeletExtraArgs: + additionalProperties: + type: string + description: KubeletExtraArgs passes the specified kubelet args into + the Amazon EKS machine bootstrap script + type: object + type: object + status: + description: EKSConfigStatus defines the observed state of the Amazon + EKS Bootstrap Configuration. + properties: + conditions: + description: Conditions defines current service state of the EKSConfig. + 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: + - lastTransitionTime + - 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 secret is ready to + be consumed + type: boolean + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/crd/bases/bootstrap.cluster.x-k8s.io_eksconfigtemplates.yaml b/config/crd/bases/bootstrap.cluster.x-k8s.io_eksconfigtemplates.yaml index c1532e4cb2..04f4b47d25 100644 --- a/config/crd/bases/bootstrap.cluster.x-k8s.io_eksconfigtemplates.yaml +++ b/config/crd/bases/bootstrap.cluster.x-k8s.io_eksconfigtemplates.yaml @@ -99,6 +99,49 @@ spec: type: object type: object served: true + storage: false + - name: v1beta1 + schema: + openAPIV3Schema: + description: EKSConfigTemplate is the Amazon EKS Bootstrap Configuration Template + API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: EKSConfigTemplateSpec defines the desired state of templated + EKSConfig Amazon EKS Bootstrap Configuration resources. + properties: + template: + description: EKSConfigTemplateResource defines the Template structure. + properties: + spec: + description: EKSConfigSpec defines the desired state of Amazon + EKS Bootstrap Configuration. + properties: + kubeletExtraArgs: + additionalProperties: + type: string + description: KubeletExtraArgs passes the specified kubelet + args into the Amazon EKS machine bootstrap script + type: object + type: object + type: object + required: + - template + type: object + type: object + served: true storage: true status: acceptedNames: diff --git a/config/crd/bases/controlplane.cluster.x-k8s.io_awsmanagedcontrolplanes.yaml b/config/crd/bases/controlplane.cluster.x-k8s.io_awsmanagedcontrolplanes.yaml index e0abea1e5e..0b54bb98b4 100644 --- a/config/crd/bases/controlplane.cluster.x-k8s.io_awsmanagedcontrolplanes.yaml +++ b/config/crd/bases/controlplane.cluster.x-k8s.io_awsmanagedcontrolplanes.yaml @@ -2131,6 +2131,1111 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: Cluster to which this AWSManagedControl belongs + jsonPath: .metadata.labels.cluster\.x-k8s\.io/cluster-name + name: Cluster + type: string + - description: Control plane infrastructure is ready for worker nodes + jsonPath: .status.ready + name: Ready + type: string + - description: AWS VPC the control plane is using + jsonPath: .spec.network.vpc.id + name: VPC + type: string + - description: API Endpoint + jsonPath: .spec.controlPlaneEndpoint.host + name: Endpoint + priority: 1 + type: string + - description: Bastion IP address for breakglass access + jsonPath: .status.bastion.publicIp + name: Bastion IP + type: string + name: v1beta1 + schema: + openAPIV3Schema: + description: AWSManagedControlPlane is the schema for the Amazon EKS Managed + Control Plane API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: AWSManagedControlPlaneSpec defines the desired state of an + Amazon EKS Cluster. + properties: + additionalTags: + additionalProperties: + type: string + description: AdditionalTags is an optional set of tags to add to AWS + resources managed by the AWS provider, in addition to the ones added + by default. + type: object + addons: + description: Addons defines the EKS addons to enable with the EKS + cluster. + items: + description: Addon represents a EKS addon. + properties: + conflictResolution: + default: none + description: ConflictResolution is used to declare what should + happen if there are parameter conflicts. Defaults to none + enum: + - overwrite + - none + type: string + name: + description: Name is the name of the addon + minLength: 2 + type: string + serviceAccountRoleARN: + description: ServiceAccountRoleArn is the ARN of an IAM role + to bind to the addons service account + type: string + version: + description: Version is the version of the addon to use + type: string + required: + - name + - version + type: object + type: array + associateOIDCProvider: + default: false + description: AssociateOIDCProvider can be enabled to automatically + create an identity provider for the controller for use with IAM + roles for service accounts + type: boolean + bastion: + description: Bastion contains options to configure the bastion host. + properties: + allowedCIDRBlocks: + description: AllowedCIDRBlocks is a list of CIDR blocks allowed + to access the bastion host. They are set as ingress rules for + the Bastion host's Security Group (defaults to 0.0.0.0/0). + items: + type: string + type: array + ami: + description: AMI will use the specified AMI to boot the bastion. + If not specified, the AMI will default to one picked out in + public space. + type: string + disableIngressRules: + description: DisableIngressRules will ensure there are no Ingress + rules in the bastion host's security group. Requires AllowedCIDRBlocks + to be empty. + type: boolean + enabled: + description: Enabled allows this provider to create a bastion + host instance with a public ip to access the VPC private network. + type: boolean + instanceType: + description: InstanceType will use the specified instance type + for the bastion. If not specified, Cluster API Provider AWS + will use t3.micro for all regions except us-east-1, where t2.micro + will be the default. + type: string + 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 + disableVPCCNI: + default: false + description: DisableVPCCNI indcates the the Amazon VPC CNI should + be disabled. With EKS clusters that the Amazon VPC CNI is automatically + installed into the cluster. For clusters where you want to use an + alternate CNI this option provides a way to specify that the Amazon + VPC CNI should be deleted. You cannot set this to true if you are + using the Amazon VPC CNI addon or if you have specified a secondary + CIDR block. + type: boolean + eksClusterName: + description: EKSClusterName allows you to specify the name of the + EKS cluster in AWS. If you don't specify a name then a default name + will be created based on the namespace and name of the managed control + plane. + type: string + encryptionConfig: + description: EncryptionConfig specifies the encryption configuration + for the cluster + properties: + provider: + description: Provider specifies the ARN or alias of the CMK (in + AWS KMS) + type: string + resources: + description: Resources specifies the resources to be encrypted + items: + type: string + type: array + type: object + endpointAccess: + description: Endpoints specifies access to this cluster's control + plane endpoints + properties: + private: + description: Private points VPC-internal control plane access + to the private endpoint + type: boolean + public: + description: Public controls whether control plane endpoints are + publicly accessible + type: boolean + publicCIDRs: + description: PublicCIDRs specifies which blocks can access the + public endpoint + items: + type: string + type: array + type: object + iamAuthenticatorConfig: + description: IAMAuthenticatorConfig allows the specification of any + additional user or role mappings for use when generating the aws-iam-authenticator + configuration. If this is nil the default configuration is still + generated for the cluster. + properties: + mapRoles: + description: RoleMappings is a list of role mappings + items: + description: RoleMapping represents a mapping from a IAM role + to Kubernetes users and groups. + properties: + groups: + description: Groups is a list of kubernetes RBAC groups + items: + type: string + type: array + rolearn: + description: RoleARN is the AWS ARN for the role to map + minLength: 31 + type: string + username: + description: UserName is a kubernetes RBAC user subject + type: string + required: + - groups + - rolearn + - username + type: object + type: array + mapUsers: + description: UserMappings is a list of user mappings + items: + description: UserMapping represents a mapping from an IAM user + to Kubernetes users and groups. + properties: + groups: + description: Groups is a list of kubernetes RBAC groups + items: + type: string + type: array + userarn: + description: UserARN is the AWS ARN for the user to map + minLength: 31 + type: string + username: + description: UserName is a kubernetes RBAC user subject + type: string + required: + - groups + - userarn + - username + type: object + type: array + type: object + identityRef: + description: IdentityRef is a reference to a identity to be used when + reconciling the managed control plane. + properties: + kind: + description: Kind of the identity. + enum: + - AWSClusterControllerIdentity + - AWSClusterRoleIdentity + - AWSClusterStaticIdentity + type: string + name: + description: Name of the identity. + minLength: 1 + type: string + required: + - kind + - name + type: object + imageLookupBaseOS: + description: ImageLookupBaseOS is the name of the base operating system + used to look up machine images when a machine does not specify an + AMI. When set, this will be used for all cluster machines unless + a machine specifies a different ImageLookupBaseOS. + type: string + imageLookupFormat: + description: 'ImageLookupFormat is the AMI naming format to look up + machine images when a machine does not specify an AMI. When set, + this will be used for all cluster machines unless a machine specifies + a different ImageLookupOrg. Supports substitutions for {{.BaseOS}} + and {{.K8sVersion}} with the base OS and kubernetes version, respectively. + The BaseOS will be the value in ImageLookupBaseOS or ubuntu (the + default), and the kubernetes version as defined by the packages + produced by kubernetes/release without v as a prefix: 1.13.0, 1.12.5-mybuild.1, + or 1.17.3. For example, the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* + will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* + for a Machine that is targeting kubernetes v1.18.0 and the ubuntu + base OS. See also: https://golang.org/pkg/text/template/' + type: string + imageLookupOrg: + description: ImageLookupOrg is the AWS Organization ID to look up + machine images when a machine does not specify an AMI. When set, + this will be used for all cluster machines unless a machine specifies + a different ImageLookupOrg. + type: string + logging: + description: Logging specifies which EKS Cluster logs should be enabled. + Entries for each of the enabled logs will be sent to CloudWatch + properties: + apiServer: + default: false + description: APIServer indicates if the Kubernetes API Server + log (kube-apiserver) shoulkd be enabled + type: boolean + audit: + default: false + description: Audit indicates if the Kubernetes API audit log should + be enabled + type: boolean + authenticator: + default: false + description: Authenticator indicates if the iam authenticator + log should be enabled + type: boolean + controllerManager: + default: false + description: ControllerManager indicates if the controller manager + (kube-controller-manager) log should be enabled + type: boolean + scheduler: + default: false + description: Scheduler indicates if the Kubernetes scheduler (kube-scheduler) + log should be enabled + type: boolean + required: + - apiServer + - audit + - authenticator + - controllerManager + - scheduler + type: object + network: + description: NetworkSpec encapsulates all things related to AWS network. + properties: + cni: + description: CNI configuration + properties: + cniIngressRules: + description: CNIIngressRules specify rules to apply to control + plane and worker node security groups. The source for the + rule will be set to control plane and worker security group + IDs. + items: + description: CNIIngressRule defines an AWS ingress rule + for CNI requirements. + properties: + description: + type: string + fromPort: + format: int64 + type: integer + protocol: + description: SecurityGroupProtocol defines the protocol + type for a security group rule. + type: string + toPort: + format: int64 + type: integer + required: + - description + - fromPort + - protocol + - toPort + type: object + type: array + type: object + securityGroupOverrides: + additionalProperties: + type: string + description: SecurityGroupOverrides is an optional set of security + groups to use for cluster instances This is optional - if not + provided new security groups will be created for the cluster + type: object + subnets: + description: Subnets configuration. + items: + description: SubnetSpec configures an AWS Subnet. + properties: + availabilityZone: + description: AvailabilityZone defines the availability zone + to use for this subnet in the cluster's region. + type: string + cidrBlock: + description: CidrBlock is the CIDR block to be used when + the provider creates a managed VPC. + type: string + id: + description: ID defines a unique identifier to reference + this resource. + type: string + isPublic: + description: IsPublic defines the subnet as a public subnet. + A subnet is public when it is associated with a route + table that has a route to an internet gateway. + type: boolean + natGatewayId: + description: NatGatewayID is the NAT gateway id associated + with the subnet. Ignored unless the subnet is managed + by the provider, in which case this is set on the public + subnet where the NAT gateway resides. It is then used + to determine routes for private subnets in the same AZ + as the public subnet. + type: string + routeTableId: + description: RouteTableID is the routing table id associated + with the subnet. + type: string + tags: + additionalProperties: + type: string + description: Tags is a collection of tags describing the + resource. + type: object + type: object + type: array + vpc: + description: VPC configuration. + properties: + availabilityZoneSelection: + default: Ordered + description: 'AvailabilityZoneSelection specifies how AZs + should be selected if there are more AZs in a region than + specified by AvailabilityZoneUsageLimit. There are 2 selection + schemes: Ordered - selects based on alphabetical order Random + - selects AZs randomly in a region Defaults to Ordered' + enum: + - Ordered + - Random + type: string + availabilityZoneUsageLimit: + default: 3 + description: AvailabilityZoneUsageLimit specifies the maximum + number of availability zones (AZ) that should be used in + a region when automatically creating subnets. If a region + has more than this number of AZs then this number of AZs + will be picked randomly when creating default subnets. Defaults + to 3 + minimum: 1 + type: integer + cidrBlock: + description: CidrBlock is the CIDR block to be used when the + provider creates a managed VPC. Defaults to 10.0.0.0/16. + type: string + id: + description: ID is the vpc-id of the VPC this provider should + use to create resources. + type: string + internetGatewayId: + description: InternetGatewayID is the id of the internet gateway + associated with the VPC. + type: string + tags: + additionalProperties: + type: string + description: Tags is a collection of tags describing the resource. + type: object + type: object + type: object + oidcIdentityProviderConfig: + description: IdentityProviderconfig is used to specify the oidc provider + config to be attached with this eks cluster + properties: + clientId: + description: This is also known as audience. The ID for the client + application that makes authentication requests to the OpenID + identity provider. + type: string + groupsClaim: + description: The JWT claim that the provider uses to return your + groups. + type: string + groupsPrefix: + description: 'The prefix that is prepended to group claims to + prevent clashes with existing names (such as system: groups). + For example, the valueoidc: will create group names like oidc:engineering + and oidc:infra.' + type: string + identityProviderConfigName: + description: "The name of the OIDC provider configuration. \n + IdentityProviderConfigName is a required field" + type: string + issuerUrl: + description: The URL of the OpenID identity provider that allows + the API server to discover public signing keys for verifying + tokens. The URL must begin with https:// and should correspond + to the iss claim in the provider's OIDC ID tokens. Per the OIDC + standard, path components are allowed but query parameters are + not. Typically the URL consists of only a hostname, like https://server.example.org + or https://example.com. This URL should point to the level below + .well-known/openid-configuration and must be publicly accessible + over the internet. + type: string + requiredClaims: + additionalProperties: + type: string + description: The key value pairs that describe required claims + in the identity token. If set, each claim is verified to be + present in the token with a matching value. For the maximum + number of claims that you can require, see Amazon EKS service + quotas (https://docs.aws.amazon.com/eks/latest/userguide/service-quotas.html) + in the Amazon EKS User Guide. + type: object + tags: + additionalProperties: + type: string + description: tags to apply to oidc identity provider association + type: object + usernameClaim: + description: The JSON Web Token (JWT) claim to use as the username. + The default is sub, which is expected to be a unique identifier + of the end user. You can choose other claims, such as email + or name, depending on the OpenID identity provider. Claims other + than email are prefixed with the issuer URL to prevent naming + clashes with other plug-ins. + type: string + usernamePrefix: + description: The prefix that is prepended to username claims to + prevent clashes with existing names. If you do not provide this + field, and username is a value other than email, the prefix + defaults to issuerurl#. You can use the value - to disable all + prefixing. + type: string + type: object + region: + description: The AWS Region the cluster lives in. + type: string + roleAdditionalPolicies: + description: RoleAdditionalPolicies allows you to attach additional + polices to the control plane role. You must enable the EKSAllowAddRoles + feature flag to incorporate these into the created role. + items: + type: string + type: array + roleName: + description: RoleName specifies the name of IAM role that gives EKS + permission to make API calls. If the role is pre-existing we will + treat it as unmanaged and not delete it on deletion. If the EKSEnableIAM + feature flag is true and no name is supplied then a role is created. + minLength: 2 + type: string + secondaryCidrBlock: + description: SecondaryCidrBlock is the additional CIDR range to use + for pod IPs. Must be within the 100.64.0.0/10 or 198.19.0.0/16 range. + type: string + sshKeyName: + description: SSHKeyName is the name of the ssh key to attach to the + bastion host. Valid values are empty string (do not use SSH keys), + a valid SSH key name, or omitted (use the default SSH key name) + type: string + tokenMethod: + default: iam-authenticator + description: TokenMethod is used to specify the method for obtaining + a client token for communicating with EKS iam-authenticator - obtains + a client token using iam-authentictor aws-cli - obtains a client + token using the AWS CLI Defaults to iam-authenticator + enum: + - iam-authenticator + - aws-cli + type: string + version: + description: Version defines the desired Kubernetes version. If no + version number is supplied then the latest version of Kubernetes + that EKS supports will be used. + minLength: 2 + pattern: ^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.?$ + type: string + type: object + status: + description: AWSManagedControlPlaneStatus defines the observed state of + an Amazon EKS Cluster. + properties: + addons: + description: Addons holds the current status of the EKS addons + items: + description: AddonState represents the state of an addon. + properties: + arn: + description: ARN is the AWS ARN of the addon + type: string + createdAt: + description: CreatedAt is the date and time the addon was created + at + format: date-time + type: string + issues: + description: Issues is a list of issue associated with the addon + items: + description: AddonIssue represents an issue with an addon. + properties: + code: + description: Code is the issue code + type: string + message: + description: Message is the textual description of the + issue + type: string + resourceIds: + description: ResourceIDs is a list of resource ids for + the issue + items: + type: string + type: array + type: object + type: array + modifiedAt: + description: ModifiedAt is the date and time the addon was last + modified + format: date-time + type: string + name: + description: Name is the name of the addon + type: string + serviceAccountRoleARN: + description: ServiceAccountRoleArn is the ARN of the IAM role + used for the service account + type: string + status: + description: Status is the status of the addon + type: string + version: + description: Version is the version of the addon to use + type: string + required: + - arn + - name + - version + type: object + type: array + bastion: + description: Bastion holds details of the instance that is used as + a bastion jump box + properties: + addresses: + description: Addresses contains the AWS instance associated addresses. + 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 + availabilityZone: + description: Availability zone of instance + type: string + ebsOptimized: + description: Indicates whether the instance is optimized for Amazon + EBS I/O. + type: boolean + enaSupport: + description: Specifies whether enhanced networking with ENA is + enabled. + type: boolean + iamProfile: + description: The name of the IAM instance profile associated with + the instance, if applicable. + type: string + id: + type: string + imageId: + description: The ID of the AMI used to launch the instance. + type: string + instanceState: + description: The current state of the instance. + type: string + networkInterfaces: + description: Specifies ENIs attached to instance + items: + type: string + type: array + nonRootVolumes: + description: Configuration options for the non root storage volumes. + items: + description: Volume encapsulates the configuration options for + the storage device. + properties: + deviceName: + description: Device name + type: string + encrypted: + description: Encrypted is whether the volume should be encrypted + or not. + type: boolean + encryptionKey: + description: EncryptionKey is the KMS key to use to encrypt + the volume. Can be either a KMS key ID or ARN. If Encrypted + is set and this is omitted, the default AWS key will be + used. The key must already exist and be accessible by + the controller. + type: string + iops: + description: IOPS is the number of IOPS requested for the + disk. Not applicable to all types. + format: int64 + type: integer + size: + description: Size specifies size (in Gi) of the storage + device. Must be greater than the image snapshot size or + 8 (whichever is greater). + format: int64 + minimum: 8 + type: integer + throughput: + description: Throughput to provision in MiB/s supported + for the volume type. Not applicable to all types. + format: int64 + type: integer + type: + description: Type is the type of the volume (e.g. gp2, io1, + etc...). + type: string + required: + - size + type: object + type: array + privateIp: + description: The private IPv4 address assigned to the instance. + type: string + publicIp: + description: The public IPv4 address assigned to the instance, + if applicable. + type: string + rootVolume: + description: Configuration options for the root storage volume. + properties: + deviceName: + description: Device name + type: string + encrypted: + description: Encrypted is whether the volume should be encrypted + or not. + type: boolean + encryptionKey: + description: EncryptionKey is the KMS key to use to encrypt + the volume. Can be either a KMS key ID or ARN. If Encrypted + is set and this is omitted, the default AWS key will be + used. The key must already exist and be accessible by the + controller. + type: string + iops: + description: IOPS is the number of IOPS requested for the + disk. Not applicable to all types. + format: int64 + type: integer + size: + description: Size specifies size (in Gi) of the storage device. + Must be greater than the image snapshot size or 8 (whichever + is greater). + format: int64 + minimum: 8 + type: integer + throughput: + description: Throughput to provision in MiB/s supported for + the volume type. Not applicable to all types. + format: int64 + type: integer + type: + description: Type is the type of the volume (e.g. gp2, io1, + etc...). + type: string + required: + - size + type: object + securityGroupIds: + description: SecurityGroupIDs are one or more security group IDs + this instance belongs to. + items: + type: string + type: array + spotMarketOptions: + description: SpotMarketOptions option for configuring instances + to be run using AWS Spot instances. + properties: + maxPrice: + description: MaxPrice defines the maximum price the user is + willing to pay for Spot VM instances + type: string + type: object + sshKeyName: + description: The name of the SSH key pair. + type: string + subnetId: + description: The ID of the subnet of the instance. + type: string + tags: + additionalProperties: + type: string + description: The tags associated with the instance. + type: object + tenancy: + description: Tenancy indicates if instance should run on shared + or single-tenant hardware. + type: string + type: + description: The instance type. + type: string + userData: + description: UserData is the raw data script passed to the instance + which is run upon bootstrap. This field must not be base64 encoded + and should only be used when running a new instance. + type: string + volumeIDs: + description: IDs of the instance's volumes + items: + type: string + type: array + required: + - id + type: object + conditions: + description: Conditions specifies the cpnditions for the managed control + plane + 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: + - lastTransitionTime + - status + - type + type: object + type: array + externalManagedControlPlane: + default: true + description: ExternalManagedControlPlane indicates to cluster-api + that the control plane is managed by an external service such as + AKS, EKS, GKE, etc. + 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 specifies a list fo available availability + zones that can be used + type: object + failureMessage: + description: ErrorMessage indicates that there is a terminal problem + reconciling the state, and will be set to a descriptive error message. + type: string + identityProviderStatus: + description: IdentityProviderStatus holds the status for associated + identity provider + properties: + arn: + description: ARN holds the ARN of associated identity provider + type: string + status: + description: Status holds current status of associated identity + provider + type: string + type: object + initialized: + description: Initialized denotes whether or not the control plane + has the uploaded kubernetes config-map. + type: boolean + networkStatus: + description: Networks holds details about the AWS networking resources + used by the control plane + properties: + apiServerElb: + description: APIServerELB is the Kubernetes api server classic + load balancer. + properties: + attributes: + description: Attributes defines extra attributes associated + with the load balancer. + properties: + crossZoneLoadBalancing: + description: CrossZoneLoadBalancing enables the classic + load balancer load balancing. + type: boolean + idleTimeout: + description: IdleTimeout is time that the connection is + allowed to be idle (no data has been sent over the connection) + before it is closed by the load balancer. + format: int64 + type: integer + type: object + availabilityZones: + description: AvailabilityZones is an array of availability + zones in the VPC attached to the load balancer. + items: + type: string + type: array + dnsName: + description: DNSName is the dns name of the load balancer. + type: string + healthChecks: + description: HealthCheck is the classic elb health check associated + with the load balancer. + properties: + healthyThreshold: + format: int64 + type: integer + interval: + description: A Duration represents the elapsed time between + two instants as an int64 nanosecond count. The representation + limits the largest representable duration to approximately + 290 years. + format: int64 + type: integer + target: + type: string + timeout: + description: A Duration represents the elapsed time between + two instants as an int64 nanosecond count. The representation + limits the largest representable duration to approximately + 290 years. + format: int64 + type: integer + unhealthyThreshold: + format: int64 + type: integer + required: + - healthyThreshold + - interval + - target + - timeout + - unhealthyThreshold + type: object + listeners: + description: Listeners is an array of classic elb listeners + associated with the load balancer. There must be at least + one. + items: + description: ClassicELBListener defines an AWS classic load + balancer listener. + properties: + instancePort: + format: int64 + type: integer + instanceProtocol: + description: ClassicELBProtocol defines listener protocols + for a classic load balancer. + type: string + port: + format: int64 + type: integer + protocol: + description: ClassicELBProtocol defines listener protocols + for a classic load balancer. + type: string + required: + - instancePort + - instanceProtocol + - port + - protocol + type: object + type: array + name: + description: The name of the load balancer. It must be unique + within the set of load balancers defined in the region. + It also serves as identifier. + type: string + scheme: + description: Scheme is the load balancer scheme, either internet-facing + or private. + type: string + securityGroupIds: + description: SecurityGroupIDs is an array of security groups + assigned to the load balancer. + items: + type: string + type: array + subnetIds: + description: SubnetIDs is an array of subnets in the VPC attached + to the load balancer. + items: + type: string + type: array + tags: + additionalProperties: + type: string + description: Tags is a map of tags associated with the load + balancer. + type: object + type: object + securityGroups: + additionalProperties: + description: SecurityGroup defines an AWS security group. + properties: + id: + description: ID is a unique identifier. + type: string + ingressRule: + description: IngressRules is the inbound rules associated + with the security group. + items: + description: IngressRule defines an AWS ingress rule for + security groups. + properties: + cidrBlocks: + description: List of CIDR blocks to allow access from. + Cannot be specified with SourceSecurityGroupID. + items: + type: string + type: array + description: + type: string + fromPort: + format: int64 + type: integer + protocol: + description: SecurityGroupProtocol defines the protocol + type for a security group rule. + type: string + sourceSecurityGroupIds: + description: The security group id to allow access + from. Cannot be specified with CidrBlocks. + items: + type: string + type: array + toPort: + format: int64 + type: integer + required: + - description + - fromPort + - protocol + - toPort + type: object + type: array + name: + description: Name is the security group name. + type: string + tags: + additionalProperties: + type: string + description: Tags is a map of tags associated with the security + group. + type: object + required: + - id + - name + type: object + description: SecurityGroups is a map from the role/kind of the + security group to its unique name, if any. + type: object + type: object + oidcProvider: + description: OIDCProvider holds the status of the identity provider + for this cluster + properties: + arn: + description: ARN holds the ARN of the provider + type: string + trustPolicy: + description: TrustPolicy contains the boilerplate IAM trust policy + to use for IRSA + type: string + type: object + ready: + default: false + description: Ready denotes that the AWSManagedControlPlane API Server + is ready to receive requests and that the VPC infra is ready. + type: boolean + required: + - ready + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclustercontrolleridentities.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclustercontrolleridentities.yaml index b77ef2d2c7..7bec646653 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclustercontrolleridentities.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclustercontrolleridentities.yaml @@ -111,6 +111,96 @@ spec: served: true storage: false - name: v1alpha4 + schema: + openAPIV3Schema: + description: AWSClusterControllerIdentity is the Schema for the awsclustercontrolleridentities + API It is used to grant access to use Cluster API Provider AWS Controller + credentials. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec for this AWSClusterControllerIdentity. + properties: + allowedNamespaces: + description: AllowedNamespaces is used to identify which namespaces + are allowed to use the identity from. Namespaces can be selected + either using an array of namespaces or with label selector. An empty + allowedNamespaces object indicates that AWSClusters can use this + identity from any namespace. If this object is nil, no namespaces + will be allowed (default behaviour, if this field is not provided) + A namespace should be either in the NamespaceList or match with + Selector to use the identity. + nullable: true + properties: + list: + description: An nil or empty list indicates that AWSClusters cannot + use the identity from any namespace. + items: + type: string + nullable: true + type: array + selector: + description: An empty selector indicates that AWSClusters cannot + use this AWSClusterIdentity from any namespace. + 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 + type: object + type: object + type: object + served: true + storage: false + - name: v1beta1 schema: openAPIV3Schema: description: AWSClusterControllerIdentity is the Schema for the awsclustercontrolleridentities diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusterroleidentities.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusterroleidentities.yaml index 17f626b49f..277797ebe3 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusterroleidentities.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusterroleidentities.yaml @@ -315,6 +315,154 @@ spec: type: object type: object served: true + storage: false + - name: v1beta1 + schema: + openAPIV3Schema: + description: AWSClusterRoleIdentity is the Schema for the awsclusterroleidentities + API It is used to assume a role using the provided sourceRef. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec for this AWSClusterRoleIdentity. + properties: + allowedNamespaces: + description: AllowedNamespaces is used to identify which namespaces + are allowed to use the identity from. Namespaces can be selected + either using an array of namespaces or with label selector. An empty + allowedNamespaces object indicates that AWSClusters can use this + identity from any namespace. If this object is nil, no namespaces + will be allowed (default behaviour, if this field is not provided) + A namespace should be either in the NamespaceList or match with + Selector to use the identity. + nullable: true + properties: + list: + description: An nil or empty list indicates that AWSClusters cannot + use the identity from any namespace. + items: + type: string + nullable: true + type: array + selector: + description: An empty selector indicates that AWSClusters cannot + use this AWSClusterIdentity from any namespace. + 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 + type: object + durationSeconds: + description: The duration, in seconds, of the role session before + it is renewed. + format: int32 + maximum: 43200 + minimum: 900 + type: integer + externalID: + description: A unique identifier that might be required when you assume + a role in another account. If the administrator of the account to + which the role belongs provided you with an external ID, then provide + that value in the ExternalId parameter. This value can be any string, + such as a passphrase or account number. A cross-account role is + usually set up to trust everyone in an account. Therefore, the administrator + of the trusting account might send an external ID to the administrator + of the trusted account. That way, only someone with the ID can assume + the role, rather than everyone in the account. For more information + about the external ID, see How to Use an External ID When Granting + Access to Your AWS Resources to a Third Party in the IAM User Guide. + type: string + inlinePolicy: + description: An IAM policy as a JSON-encoded string that you want + to use as an inline session policy. + type: string + policyARNs: + description: The Amazon Resource Names (ARNs) of the IAM managed policies + that you want to use as managed session policies. The policies must + exist in the same account as the role. + items: + type: string + type: array + roleARN: + description: The Amazon Resource Name (ARN) of the role to assume. + type: string + sessionName: + description: An identifier for the assumed role session + type: string + sourceIdentityRef: + description: SourceIdentityRef is a reference to another identity + which will be chained to do role assumption. All identity types + are accepted. + properties: + kind: + description: Kind of the identity. + enum: + - AWSClusterControllerIdentity + - AWSClusterRoleIdentity + - AWSClusterStaticIdentity + type: string + name: + description: Name of the identity. + minLength: 1 + type: string + required: + - kind + - name + type: object + required: + - roleARN + type: object + type: object + served: true storage: true status: acceptedNames: diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusters.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusters.yaml index 18739a69c8..2adcf1ff8f 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusters.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusters.yaml @@ -1528,6 +1528,772 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: Cluster to which this AWSCluster belongs + jsonPath: .metadata.labels.cluster\.x-k8s\.io/cluster-name + name: Cluster + type: string + - description: Cluster infrastructure is ready for EC2 instances + jsonPath: .status.ready + name: Ready + type: string + - description: AWS VPC the cluster is using + jsonPath: .spec.network.vpc.id + name: VPC + type: string + - description: API Endpoint + jsonPath: .spec.controlPlaneEndpoint + name: Endpoint + priority: 1 + type: string + - description: Bastion IP address for breakglass access + jsonPath: .status.bastion.publicIp + name: Bastion IP + type: string + name: v1beta1 + schema: + openAPIV3Schema: + description: AWSCluster is the schema for Amazon EC2 based Kubernetes Cluster + API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: AWSClusterSpec defines the desired state of an EC2-based + Kubernetes cluster. + properties: + additionalTags: + additionalProperties: + type: string + description: AdditionalTags is an optional set of tags to add to AWS + resources managed by the AWS provider, in addition to the ones added + by default. + type: object + bastion: + description: Bastion contains options to configure the bastion host. + properties: + allowedCIDRBlocks: + description: AllowedCIDRBlocks is a list of CIDR blocks allowed + to access the bastion host. They are set as ingress rules for + the Bastion host's Security Group (defaults to 0.0.0.0/0). + items: + type: string + type: array + ami: + description: AMI will use the specified AMI to boot the bastion. + If not specified, the AMI will default to one picked out in + public space. + type: string + disableIngressRules: + description: DisableIngressRules will ensure there are no Ingress + rules in the bastion host's security group. Requires AllowedCIDRBlocks + to be empty. + type: boolean + enabled: + description: Enabled allows this provider to create a bastion + host instance with a public ip to access the VPC private network. + type: boolean + instanceType: + description: InstanceType will use the specified instance type + for the bastion. If not specified, Cluster API Provider AWS + will use t3.micro for all regions except us-east-1, where t2.micro + will be the default. + type: string + 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 + controlPlaneLoadBalancer: + description: ControlPlaneLoadBalancer is optional configuration for + customizing control plane behavior. + properties: + additionalSecurityGroups: + description: AdditionalSecurityGroups sets the security groups + used by the load balancer. Expected to be security group IDs + This is optional - if not provided new security groups will + be created for the load balancer + items: + type: string + type: array + crossZoneLoadBalancing: + description: "CrossZoneLoadBalancing enables the classic ELB cross + availability zone balancing. \n With cross-zone load balancing, + each load balancer node for your Classic Load Balancer distributes + requests evenly across the registered instances in all enabled + Availability Zones. If cross-zone load balancing is disabled, + each load balancer node distributes requests evenly across the + registered instances in its Availability Zone only. \n Defaults + to false." + type: boolean + scheme: + default: internet-facing + description: Scheme sets the scheme of the load balancer (defaults + to internet-facing) + enum: + - internet-facing + - internal + type: string + subnets: + description: Subnets sets the subnets that should be applied to + the control plane load balancer (defaults to discovered subnets + for managed VPCs or an empty set for unmanaged VPCs) + items: + type: string + type: array + type: object + identityRef: + description: IdentityRef is a reference to a identity to be used when + reconciling this cluster + properties: + kind: + description: Kind of the identity. + enum: + - AWSClusterControllerIdentity + - AWSClusterRoleIdentity + - AWSClusterStaticIdentity + type: string + name: + description: Name of the identity. + minLength: 1 + type: string + required: + - kind + - name + type: object + imageLookupBaseOS: + description: ImageLookupBaseOS is the name of the base operating system + used to look up machine images when a machine does not specify an + AMI. When set, this will be used for all cluster machines unless + a machine specifies a different ImageLookupBaseOS. + type: string + imageLookupFormat: + description: 'ImageLookupFormat is the AMI naming format to look up + machine images when a machine does not specify an AMI. When set, + this will be used for all cluster machines unless a machine specifies + a different ImageLookupOrg. Supports substitutions for {{.BaseOS}} + and {{.K8sVersion}} with the base OS and kubernetes version, respectively. + The BaseOS will be the value in ImageLookupBaseOS or ubuntu (the + default), and the kubernetes version as defined by the packages + produced by kubernetes/release without v as a prefix: 1.13.0, 1.12.5-mybuild.1, + or 1.17.3. For example, the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* + will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* + for a Machine that is targeting kubernetes v1.18.0 and the ubuntu + base OS. See also: https://golang.org/pkg/text/template/' + type: string + imageLookupOrg: + description: ImageLookupOrg is the AWS Organization ID to look up + machine images when a machine does not specify an AMI. When set, + this will be used for all cluster machines unless a machine specifies + a different ImageLookupOrg. + type: string + network: + description: NetworkSpec encapsulates all things related to AWS network. + properties: + cni: + description: CNI configuration + properties: + cniIngressRules: + description: CNIIngressRules specify rules to apply to control + plane and worker node security groups. The source for the + rule will be set to control plane and worker security group + IDs. + items: + description: CNIIngressRule defines an AWS ingress rule + for CNI requirements. + properties: + description: + type: string + fromPort: + format: int64 + type: integer + protocol: + description: SecurityGroupProtocol defines the protocol + type for a security group rule. + type: string + toPort: + format: int64 + type: integer + required: + - description + - fromPort + - protocol + - toPort + type: object + type: array + type: object + securityGroupOverrides: + additionalProperties: + type: string + description: SecurityGroupOverrides is an optional set of security + groups to use for cluster instances This is optional - if not + provided new security groups will be created for the cluster + type: object + subnets: + description: Subnets configuration. + items: + description: SubnetSpec configures an AWS Subnet. + properties: + availabilityZone: + description: AvailabilityZone defines the availability zone + to use for this subnet in the cluster's region. + type: string + cidrBlock: + description: CidrBlock is the CIDR block to be used when + the provider creates a managed VPC. + type: string + id: + description: ID defines a unique identifier to reference + this resource. + type: string + isPublic: + description: IsPublic defines the subnet as a public subnet. + A subnet is public when it is associated with a route + table that has a route to an internet gateway. + type: boolean + natGatewayId: + description: NatGatewayID is the NAT gateway id associated + with the subnet. Ignored unless the subnet is managed + by the provider, in which case this is set on the public + subnet where the NAT gateway resides. It is then used + to determine routes for private subnets in the same AZ + as the public subnet. + type: string + routeTableId: + description: RouteTableID is the routing table id associated + with the subnet. + type: string + tags: + additionalProperties: + type: string + description: Tags is a collection of tags describing the + resource. + type: object + type: object + type: array + vpc: + description: VPC configuration. + properties: + availabilityZoneSelection: + default: Ordered + description: 'AvailabilityZoneSelection specifies how AZs + should be selected if there are more AZs in a region than + specified by AvailabilityZoneUsageLimit. There are 2 selection + schemes: Ordered - selects based on alphabetical order Random + - selects AZs randomly in a region Defaults to Ordered' + enum: + - Ordered + - Random + type: string + availabilityZoneUsageLimit: + default: 3 + description: AvailabilityZoneUsageLimit specifies the maximum + number of availability zones (AZ) that should be used in + a region when automatically creating subnets. If a region + has more than this number of AZs then this number of AZs + will be picked randomly when creating default subnets. Defaults + to 3 + minimum: 1 + type: integer + cidrBlock: + description: CidrBlock is the CIDR block to be used when the + provider creates a managed VPC. Defaults to 10.0.0.0/16. + type: string + id: + description: ID is the vpc-id of the VPC this provider should + use to create resources. + type: string + internetGatewayId: + description: InternetGatewayID is the id of the internet gateway + associated with the VPC. + type: string + tags: + additionalProperties: + type: string + description: Tags is a collection of tags describing the resource. + type: object + type: object + type: object + region: + description: The AWS Region the cluster lives in. + type: string + sshKeyName: + description: SSHKeyName is the name of the ssh key to attach to the + bastion host. Valid values are empty string (do not use SSH keys), + a valid SSH key name, or omitted (use the default SSH key name) + type: string + type: object + status: + description: AWSClusterStatus defines the observed state of AWSCluster. + properties: + bastion: + description: Instance describes an AWS instance. + properties: + addresses: + description: Addresses contains the AWS instance associated addresses. + 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 + availabilityZone: + description: Availability zone of instance + type: string + ebsOptimized: + description: Indicates whether the instance is optimized for Amazon + EBS I/O. + type: boolean + enaSupport: + description: Specifies whether enhanced networking with ENA is + enabled. + type: boolean + iamProfile: + description: The name of the IAM instance profile associated with + the instance, if applicable. + type: string + id: + type: string + imageId: + description: The ID of the AMI used to launch the instance. + type: string + instanceState: + description: The current state of the instance. + type: string + networkInterfaces: + description: Specifies ENIs attached to instance + items: + type: string + type: array + nonRootVolumes: + description: Configuration options for the non root storage volumes. + items: + description: Volume encapsulates the configuration options for + the storage device. + properties: + deviceName: + description: Device name + type: string + encrypted: + description: Encrypted is whether the volume should be encrypted + or not. + type: boolean + encryptionKey: + description: EncryptionKey is the KMS key to use to encrypt + the volume. Can be either a KMS key ID or ARN. If Encrypted + is set and this is omitted, the default AWS key will be + used. The key must already exist and be accessible by + the controller. + type: string + iops: + description: IOPS is the number of IOPS requested for the + disk. Not applicable to all types. + format: int64 + type: integer + size: + description: Size specifies size (in Gi) of the storage + device. Must be greater than the image snapshot size or + 8 (whichever is greater). + format: int64 + minimum: 8 + type: integer + throughput: + description: Throughput to provision in MiB/s supported + for the volume type. Not applicable to all types. + format: int64 + type: integer + type: + description: Type is the type of the volume (e.g. gp2, io1, + etc...). + type: string + required: + - size + type: object + type: array + privateIp: + description: The private IPv4 address assigned to the instance. + type: string + publicIp: + description: The public IPv4 address assigned to the instance, + if applicable. + type: string + rootVolume: + description: Configuration options for the root storage volume. + properties: + deviceName: + description: Device name + type: string + encrypted: + description: Encrypted is whether the volume should be encrypted + or not. + type: boolean + encryptionKey: + description: EncryptionKey is the KMS key to use to encrypt + the volume. Can be either a KMS key ID or ARN. If Encrypted + is set and this is omitted, the default AWS key will be + used. The key must already exist and be accessible by the + controller. + type: string + iops: + description: IOPS is the number of IOPS requested for the + disk. Not applicable to all types. + format: int64 + type: integer + size: + description: Size specifies size (in Gi) of the storage device. + Must be greater than the image snapshot size or 8 (whichever + is greater). + format: int64 + minimum: 8 + type: integer + throughput: + description: Throughput to provision in MiB/s supported for + the volume type. Not applicable to all types. + format: int64 + type: integer + type: + description: Type is the type of the volume (e.g. gp2, io1, + etc...). + type: string + required: + - size + type: object + securityGroupIds: + description: SecurityGroupIDs are one or more security group IDs + this instance belongs to. + items: + type: string + type: array + spotMarketOptions: + description: SpotMarketOptions option for configuring instances + to be run using AWS Spot instances. + properties: + maxPrice: + description: MaxPrice defines the maximum price the user is + willing to pay for Spot VM instances + type: string + type: object + sshKeyName: + description: The name of the SSH key pair. + type: string + subnetId: + description: The ID of the subnet of the instance. + type: string + tags: + additionalProperties: + type: string + description: The tags associated with the instance. + type: object + tenancy: + description: Tenancy indicates if instance should run on shared + or single-tenant hardware. + type: string + type: + description: The instance type. + type: string + userData: + description: UserData is the raw data script passed to the instance + which is run upon bootstrap. This field must not be base64 encoded + and should only be used when running a new instance. + type: string + volumeIDs: + description: IDs of the instance's volumes + items: + type: string + type: array + required: + - id + type: object + conditions: + description: Conditions provide observations of the operational state + of a Cluster API resource. + 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: + - lastTransitionTime + - status + - type + type: object + type: array + failureDomains: + additionalProperties: + description: FailureDomainSpec is the Schema for Cluster API failure + domains. It allows controllers to understand how many failure + domains a cluster can optionally span across. + properties: + attributes: + additionalProperties: + type: string + description: Attributes is a free form map of attributes an + infrastructure provider might use or require. + type: object + controlPlane: + description: ControlPlane determines if this failure domain + is suitable for use by control plane machines. + type: boolean + type: object + description: FailureDomains is a slice of FailureDomains. + type: object + networkStatus: + description: NetworkStatus encapsulates AWS networking resources. + properties: + apiServerElb: + description: APIServerELB is the Kubernetes api server classic + load balancer. + properties: + attributes: + description: Attributes defines extra attributes associated + with the load balancer. + properties: + crossZoneLoadBalancing: + description: CrossZoneLoadBalancing enables the classic + load balancer load balancing. + type: boolean + idleTimeout: + description: IdleTimeout is time that the connection is + allowed to be idle (no data has been sent over the connection) + before it is closed by the load balancer. + format: int64 + type: integer + type: object + availabilityZones: + description: AvailabilityZones is an array of availability + zones in the VPC attached to the load balancer. + items: + type: string + type: array + dnsName: + description: DNSName is the dns name of the load balancer. + type: string + healthChecks: + description: HealthCheck is the classic elb health check associated + with the load balancer. + properties: + healthyThreshold: + format: int64 + type: integer + interval: + description: A Duration represents the elapsed time between + two instants as an int64 nanosecond count. The representation + limits the largest representable duration to approximately + 290 years. + format: int64 + type: integer + target: + type: string + timeout: + description: A Duration represents the elapsed time between + two instants as an int64 nanosecond count. The representation + limits the largest representable duration to approximately + 290 years. + format: int64 + type: integer + unhealthyThreshold: + format: int64 + type: integer + required: + - healthyThreshold + - interval + - target + - timeout + - unhealthyThreshold + type: object + listeners: + description: Listeners is an array of classic elb listeners + associated with the load balancer. There must be at least + one. + items: + description: ClassicELBListener defines an AWS classic load + balancer listener. + properties: + instancePort: + format: int64 + type: integer + instanceProtocol: + description: ClassicELBProtocol defines listener protocols + for a classic load balancer. + type: string + port: + format: int64 + type: integer + protocol: + description: ClassicELBProtocol defines listener protocols + for a classic load balancer. + type: string + required: + - instancePort + - instanceProtocol + - port + - protocol + type: object + type: array + name: + description: The name of the load balancer. It must be unique + within the set of load balancers defined in the region. + It also serves as identifier. + type: string + scheme: + description: Scheme is the load balancer scheme, either internet-facing + or private. + type: string + securityGroupIds: + description: SecurityGroupIDs is an array of security groups + assigned to the load balancer. + items: + type: string + type: array + subnetIds: + description: SubnetIDs is an array of subnets in the VPC attached + to the load balancer. + items: + type: string + type: array + tags: + additionalProperties: + type: string + description: Tags is a map of tags associated with the load + balancer. + type: object + type: object + securityGroups: + additionalProperties: + description: SecurityGroup defines an AWS security group. + properties: + id: + description: ID is a unique identifier. + type: string + ingressRule: + description: IngressRules is the inbound rules associated + with the security group. + items: + description: IngressRule defines an AWS ingress rule for + security groups. + properties: + cidrBlocks: + description: List of CIDR blocks to allow access from. + Cannot be specified with SourceSecurityGroupID. + items: + type: string + type: array + description: + type: string + fromPort: + format: int64 + type: integer + protocol: + description: SecurityGroupProtocol defines the protocol + type for a security group rule. + type: string + sourceSecurityGroupIds: + description: The security group id to allow access + from. Cannot be specified with CidrBlocks. + items: + type: string + type: array + toPort: + format: int64 + type: integer + required: + - description + - fromPort + - protocol + - toPort + type: object + type: array + name: + description: Name is the security group name. + type: string + tags: + additionalProperties: + type: string + description: Tags is a map of tags associated with the security + group. + type: object + required: + - id + - name + type: object + description: SecurityGroups is a map from the role/kind of the + security group to its unique name, if any. + type: object + type: object + ready: + default: false + type: boolean + required: + - ready + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusterstaticidentities.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusterstaticidentities.yaml index a6c9849b55..08dbfb15f6 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusterstaticidentities.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclusterstaticidentities.yaml @@ -127,6 +127,103 @@ spec: served: true storage: false - name: v1alpha4 + schema: + openAPIV3Schema: + description: AWSClusterStaticIdentity is the Schema for the awsclusterstaticidentities + API It represents a reference to an AWS access key ID and secret access + key, stored in a secret. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: Spec for this AWSClusterStaticIdentity + properties: + allowedNamespaces: + description: AllowedNamespaces is used to identify which namespaces + are allowed to use the identity from. Namespaces can be selected + either using an array of namespaces or with label selector. An empty + allowedNamespaces object indicates that AWSClusters can use this + identity from any namespace. If this object is nil, no namespaces + will be allowed (default behaviour, if this field is not provided) + A namespace should be either in the NamespaceList or match with + Selector to use the identity. + nullable: true + properties: + list: + description: An nil or empty list indicates that AWSClusters cannot + use the identity from any namespace. + items: + type: string + nullable: true + type: array + selector: + description: An empty selector indicates that AWSClusters cannot + use this AWSClusterIdentity from any namespace. + 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 + type: object + secretRef: + description: 'Reference to a secret containing the credentials. The + secret should contain the following data keys: AccessKeyID: AKIAIOSFODNN7EXAMPLE SecretAccessKey: + wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY SessionToken: Optional' + type: string + required: + - secretRef + type: object + type: object + served: true + storage: false + - name: v1beta1 schema: openAPIV3Schema: description: AWSClusterStaticIdentity is the Schema for the awsclusterstaticidentities diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclustertemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclustertemplates.yaml index bf93e39d16..686166a28a 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclustertemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsclustertemplates.yaml @@ -341,6 +341,350 @@ spec: type: object type: object served: true + storage: false + - name: v1beta1 + schema: + openAPIV3Schema: + description: AWSClusterTemplate is the schema for Amazon EC2 based Kubernetes + Cluster Templates. + 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: AWSClusterTemplateSpec defines the desired state of AWSClusterTemplate. + properties: + template: + 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: AWSClusterSpec defines the desired state of an EC2-based + Kubernetes cluster. + properties: + additionalTags: + additionalProperties: + type: string + description: AdditionalTags is an optional set of tags to + add to AWS resources managed by the AWS provider, in addition + to the ones added by default. + type: object + bastion: + description: Bastion contains options to configure the bastion + host. + properties: + allowedCIDRBlocks: + description: AllowedCIDRBlocks is a list of CIDR blocks + allowed to access the bastion host. They are set as + ingress rules for the Bastion host's Security Group + (defaults to 0.0.0.0/0). + items: + type: string + type: array + ami: + description: AMI will use the specified AMI to boot the + bastion. If not specified, the AMI will default to one + picked out in public space. + type: string + disableIngressRules: + description: DisableIngressRules will ensure there are + no Ingress rules in the bastion host's security group. + Requires AllowedCIDRBlocks to be empty. + type: boolean + enabled: + description: Enabled allows this provider to create a + bastion host instance with a public ip to access the + VPC private network. + type: boolean + instanceType: + description: InstanceType will use the specified instance + type for the bastion. If not specified, Cluster API + Provider AWS will use t3.micro for all regions except + us-east-1, where t2.micro will be the default. + type: string + 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 + controlPlaneLoadBalancer: + description: ControlPlaneLoadBalancer is optional configuration + for customizing control plane behavior. + properties: + additionalSecurityGroups: + description: AdditionalSecurityGroups sets the security + groups used by the load balancer. Expected to be security + group IDs This is optional - if not provided new security + groups will be created for the load balancer + items: + type: string + type: array + crossZoneLoadBalancing: + description: "CrossZoneLoadBalancing enables the classic + ELB cross availability zone balancing. \n With cross-zone + load balancing, each load balancer node for your Classic + Load Balancer distributes requests evenly across the + registered instances in all enabled Availability Zones. + If cross-zone load balancing is disabled, each load + balancer node distributes requests evenly across the + registered instances in its Availability Zone only. + \n Defaults to false." + type: boolean + scheme: + default: internet-facing + description: Scheme sets the scheme of the load balancer + (defaults to internet-facing) + enum: + - internet-facing + - internal + type: string + subnets: + description: Subnets sets the subnets that should be applied + to the control plane load balancer (defaults to discovered + subnets for managed VPCs or an empty set for unmanaged + VPCs) + items: + type: string + type: array + type: object + identityRef: + description: IdentityRef is a reference to a identity to be + used when reconciling this cluster + properties: + kind: + description: Kind of the identity. + enum: + - AWSClusterControllerIdentity + - AWSClusterRoleIdentity + - AWSClusterStaticIdentity + type: string + name: + description: Name of the identity. + minLength: 1 + type: string + required: + - kind + - name + type: object + imageLookupBaseOS: + description: ImageLookupBaseOS is the name of the base operating + system used to look up machine images when a machine does + not specify an AMI. When set, this will be used for all + cluster machines unless a machine specifies a different + ImageLookupBaseOS. + type: string + imageLookupFormat: + description: 'ImageLookupFormat is the AMI naming format to + look up machine images when a machine does not specify an + AMI. When set, this will be used for all cluster machines + unless a machine specifies a different ImageLookupOrg. Supports + substitutions for {{.BaseOS}} and {{.K8sVersion}} with the + base OS and kubernetes version, respectively. The BaseOS + will be the value in ImageLookupBaseOS or ubuntu (the default), + and the kubernetes version as defined by the packages produced + by kubernetes/release without v as a prefix: 1.13.0, 1.12.5-mybuild.1, + or 1.17.3. For example, the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* + will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* + for a Machine that is targeting kubernetes v1.18.0 and the + ubuntu base OS. See also: https://golang.org/pkg/text/template/' + type: string + imageLookupOrg: + description: ImageLookupOrg is the AWS Organization ID to + look up machine images when a machine does not specify an + AMI. When set, this will be used for all cluster machines + unless a machine specifies a different ImageLookupOrg. + type: string + network: + description: NetworkSpec encapsulates all things related to + AWS network. + properties: + cni: + description: CNI configuration + properties: + cniIngressRules: + description: CNIIngressRules specify rules to apply + to control plane and worker node security groups. + The source for the rule will be set to control plane + and worker security group IDs. + items: + description: CNIIngressRule defines an AWS ingress + rule for CNI requirements. + properties: + description: + type: string + fromPort: + format: int64 + type: integer + protocol: + description: SecurityGroupProtocol defines the + protocol type for a security group rule. + type: string + toPort: + format: int64 + type: integer + required: + - description + - fromPort + - protocol + - toPort + type: object + type: array + type: object + securityGroupOverrides: + additionalProperties: + type: string + description: SecurityGroupOverrides is an optional set + of security groups to use for cluster instances This + is optional - if not provided new security groups will + be created for the cluster + type: object + subnets: + description: Subnets configuration. + items: + description: SubnetSpec configures an AWS Subnet. + properties: + availabilityZone: + description: AvailabilityZone defines the availability + zone to use for this subnet in the cluster's region. + type: string + cidrBlock: + description: CidrBlock is the CIDR block to be used + when the provider creates a managed VPC. + type: string + id: + description: ID defines a unique identifier to reference + this resource. + type: string + isPublic: + description: IsPublic defines the subnet as a public + subnet. A subnet is public when it is associated + with a route table that has a route to an internet + gateway. + type: boolean + natGatewayId: + description: NatGatewayID is the NAT gateway id + associated with the subnet. Ignored unless the + subnet is managed by the provider, in which case + this is set on the public subnet where the NAT + gateway resides. It is then used to determine + routes for private subnets in the same AZ as the + public subnet. + type: string + routeTableId: + description: RouteTableID is the routing table id + associated with the subnet. + type: string + tags: + additionalProperties: + type: string + description: Tags is a collection of tags describing + the resource. + type: object + type: object + type: array + vpc: + description: VPC configuration. + properties: + availabilityZoneSelection: + default: Ordered + description: 'AvailabilityZoneSelection specifies + how AZs should be selected if there are more AZs + in a region than specified by AvailabilityZoneUsageLimit. + There are 2 selection schemes: Ordered - selects + based on alphabetical order Random - selects AZs + randomly in a region Defaults to Ordered' + enum: + - Ordered + - Random + type: string + availabilityZoneUsageLimit: + default: 3 + description: AvailabilityZoneUsageLimit specifies + the maximum number of availability zones (AZ) that + should be used in a region when automatically creating + subnets. If a region has more than this number of + AZs then this number of AZs will be picked randomly + when creating default subnets. Defaults to 3 + minimum: 1 + type: integer + cidrBlock: + description: CidrBlock is the CIDR block to be used + when the provider creates a managed VPC. Defaults + to 10.0.0.0/16. + type: string + id: + description: ID is the vpc-id of the VPC this provider + should use to create resources. + type: string + internetGatewayId: + description: InternetGatewayID is the id of the internet + gateway associated with the VPC. + type: string + tags: + additionalProperties: + type: string + description: Tags is a collection of tags describing + the resource. + type: object + type: object + type: object + region: + description: The AWS Region the cluster lives in. + type: string + sshKeyName: + description: SSHKeyName is the name of the ssh key to attach + to the bastion host. Valid values are empty string (do not + use SSH keys), a valid SSH key name, or omitted (use the + default SSH key name) + type: string + type: object + required: + - spec + type: object + required: + - template + type: object + type: object + served: true storage: true status: acceptedNames: diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsfargateprofiles.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsfargateprofiles.yaml index 5d725d136c..7e8a2f6c2a 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsfargateprofiles.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsfargateprofiles.yaml @@ -361,6 +361,179 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: AWSFargateProfile ready status + jsonPath: .status.ready + name: Ready + type: string + - description: EKS Fargate profile name + jsonPath: .spec.profileName + name: ProfileName + type: string + - description: Failure reason + jsonPath: .status.failureReason + name: FailureReason + type: string + name: v1beta1 + schema: + openAPIV3Schema: + description: AWSFargateProfile is the Schema for the awsfargateprofiles API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: FargateProfileSpec defines the desired state of FargateProfile. + properties: + additionalTags: + additionalProperties: + type: string + description: AdditionalTags is an optional set of tags to add to AWS + resources managed by the AWS provider, in addition to the ones added + by default. + type: object + clusterName: + description: ClusterName is the name of the Cluster this object belongs + to. + minLength: 1 + type: string + profileName: + description: ProfileName specifies the profile name. + type: string + roleName: + description: RoleName specifies the name of IAM role for this fargate + pool If the role is pre-existing we will treat it as unmanaged and + not delete it on deletion. If the EKSEnableIAM feature flag is true + and no name is supplied then a role is created. + type: string + selectors: + description: Selectors specify fargate pod selectors. + items: + description: FargateSelector specifies a selector for pods that + should run on this fargate pool. + properties: + labels: + additionalProperties: + type: string + description: Labels specifies which pod labels this selector + should match. + type: object + namespace: + description: Namespace specifies which namespace this selector + should match. + type: string + type: object + type: array + subnetIDs: + description: SubnetIDs specifies which subnets are used for the auto + scaling group of this nodegroup. + items: + type: string + type: array + required: + - clusterName + type: object + status: + description: FargateProfileStatus defines the observed state of FargateProfile. + properties: + conditions: + description: Conditions defines current state of the Fargate profile. + 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: + - lastTransitionTime + - status + - type + type: object + type: array + failureMessage: + description: "FailureMessage will be set in the event that there is + a terminal problem reconciling the FargateProfile and will contain + a more verbose string suitable for logging and human consumption. + \n 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 FargateProfile's spec or the configuration of the + controller, and that manual intervention is required. Examples of + terminal errors would be invalid combinations of settings in the + spec, values that are unsupported by the controller, or the responsible + controller itself being critically misconfigured. \n Any transient + errors that occur during the reconciliation of FargateProfiles can + be added as events to the FargateProfile 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 FargateProfile and will contain + a succinct value suitable for machine interpretation. \n 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 FargateProfile's spec or the configuration of the controller, + and that manual intervention is required. Examples of terminal errors + would be invalid combinations of settings in the spec, values that + are unsupported by the controller, or the responsible controller + itself being critically misconfigured. \n Any transient errors that + occur during the reconciliation of FargateProfiles can be added + as events to the FargateProfile object and/or logged in the controller's + output." + type: string + ready: + default: false + description: Ready denotes that the FargateProfile is available. + type: boolean + required: + - ready + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinepools.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinepools.yaml index f086b7c31e..9ee575ae7a 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinepools.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinepools.yaml @@ -952,6 +952,468 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: Machine ready status + jsonPath: .status.ready + name: Ready + type: string + - description: Machine ready status + jsonPath: .status.replicas + name: Replicas + type: integer + - description: Minimum instanes in ASG + jsonPath: .spec.minSize + name: MinSize + type: integer + - description: Maximum instanes in ASG + jsonPath: .spec.maxSize + name: MaxSize + type: integer + - description: Launch Template ID + jsonPath: .status.launchTemplateID + name: LaunchTemplate ID + type: string + name: v1beta1 + schema: + openAPIV3Schema: + description: AWSMachinePool is the Schema for the awsmachinepools API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: AWSMachinePoolSpec defines the desired state of AWSMachinePool. + properties: + additionalTags: + additionalProperties: + type: string + description: AdditionalTags is an optional set of tags to add to an + instance, in addition to the ones added by default by the AWS provider. + type: object + availabilityZones: + description: AvailabilityZones is an array of availability zones instances + can run in + items: + type: string + type: array + awsLaunchTemplate: + description: AWSLaunchTemplate specifies the launch template and version + to use when an instance is launched. + properties: + additionalSecurityGroups: + description: AdditionalSecurityGroups is an array of references + to security groups that should be applied to the instances. + These security groups would be set in addition to any security + groups defined at the cluster level or in the actuator. + items: + description: AWSResourceReference is a reference to a specific + AWS resource by ID, ARN, or filters. Only one of ID, ARN or + Filters may be specified. Specifying more than one will result + in a validation error. + properties: + arn: + description: ARN of resource + type: string + filters: + description: 'Filters is a set of key/value pairs used to + identify a resource They are applied according to the + rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + items: + description: Filter is a filter used to identify an AWS + resource. + properties: + name: + description: Name of the filter. Filter names are + case-sensitive. + type: string + values: + description: Values includes one or more filter values. + Filter values are case-sensitive. + items: + type: string + type: array + required: + - name + - values + type: object + type: array + id: + description: ID of resource + type: string + type: object + type: array + ami: + description: AMI is the reference to the AMI from which to create + the machine instance. + properties: + eksLookupType: + description: EKSOptimizedLookupType If specified, will look + up an EKS Optimized image in SSM Parameter store + enum: + - AmazonLinux + - AmazonLinuxGPU + type: string + id: + description: ID of resource + type: string + type: object + iamInstanceProfile: + description: The name or the Amazon Resource Name (ARN) of the + instance profile associated with the IAM role for the instance. + The instance profile contains the IAM role. + type: string + imageLookupBaseOS: + description: ImageLookupBaseOS is the name of the base operating + system to use for image lookup the AMI is not set. + type: string + imageLookupFormat: + description: 'ImageLookupFormat is the AMI naming format to look + up the image for this machine It will be ignored if an explicit + AMI is set. Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} + with the base OS and kubernetes version, respectively. The BaseOS + will be the value in ImageLookupBaseOS or ubuntu (the default), + and the kubernetes version as defined by the packages produced + by kubernetes/release without v as a prefix: 1.13.0, 1.12.5-mybuild.1, + or 1.17.3. For example, the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* + will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* + for a Machine that is targeting kubernetes v1.18.0 and the ubuntu + base OS. See also: https://golang.org/pkg/text/template/' + type: string + imageLookupOrg: + description: ImageLookupOrg is the AWS Organization ID to use + for image lookup if AMI is not set. + type: string + instanceType: + description: 'InstanceType is the type of instance to create. + Example: m4.xlarge' + type: string + name: + description: The name of the launch template. + type: string + rootVolume: + description: RootVolume encapsulates the configuration options + for the root volume + properties: + deviceName: + description: Device name + type: string + encrypted: + description: Encrypted is whether the volume should be encrypted + or not. + type: boolean + encryptionKey: + description: EncryptionKey is the KMS key to use to encrypt + the volume. Can be either a KMS key ID or ARN. If Encrypted + is set and this is omitted, the default AWS key will be + used. The key must already exist and be accessible by the + controller. + type: string + iops: + description: IOPS is the number of IOPS requested for the + disk. Not applicable to all types. + format: int64 + type: integer + size: + description: Size specifies size (in Gi) of the storage device. + Must be greater than the image snapshot size or 8 (whichever + is greater). + format: int64 + minimum: 8 + type: integer + throughput: + description: Throughput to provision in MiB/s supported for + the volume type. Not applicable to all types. + format: int64 + type: integer + type: + description: Type is the type of the volume (e.g. gp2, io1, + etc...). + type: string + required: + - size + type: object + sshKeyName: + description: SSHKeyName is the name of the ssh key to attach to + the instance. Valid values are empty string (do not use SSH + keys), a valid SSH key name, or omitted (use the default SSH + key name) + type: string + versionNumber: + description: 'VersionNumber is the version of the launch template + that is applied. Typically a new version is created when at + least one of the following happens: 1) A new launch template + spec is applied. 2) One or more parameters in an existing template + is changed. 3) A new AMI is discovered.' + format: int64 + type: integer + type: object + capacityRebalance: + description: Enable or disable the capacity rebalance autoscaling + group feature + type: boolean + defaultCoolDown: + description: The amount of time, in seconds, after a scaling activity + completes before another scaling activity can start. If no value + is supplied by user a default value of 300 seconds is set + type: string + maxSize: + default: 1 + description: MaxSize defines the maximum size of the group. + format: int32 + minimum: 1 + type: integer + minSize: + default: 1 + description: MinSize defines the minimum size of the group. + format: int32 + minimum: 1 + type: integer + mixedInstancesPolicy: + description: MixedInstancesPolicy describes how multiple instance + types will be used by the ASG. + properties: + instancesDistribution: + description: InstancesDistribution to configure distribution of + On-Demand Instances and Spot Instances. + properties: + onDemandAllocationStrategy: + default: prioritized + description: OnDemandAllocationStrategy indicates how to allocate + instance types to fulfill On-Demand capacity. + enum: + - prioritized + type: string + onDemandBaseCapacity: + default: 0 + format: int64 + type: integer + onDemandPercentageAboveBaseCapacity: + default: 100 + format: int64 + type: integer + spotAllocationStrategy: + default: lowest-price + description: SpotAllocationStrategy indicates how to allocate + instances across Spot Instance pools. + enum: + - lowest-price + - capacity-optimized + type: string + type: object + overrides: + items: + description: Overrides are used to override the instance type + specified by the launch template with multiple instance types + that can be used to launch On-Demand Instances and Spot Instances. + properties: + instanceType: + type: string + required: + - instanceType + type: object + type: array + type: object + providerID: + description: ProviderID is the ARN of the associated ASG + type: string + 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 + refreshPreferences: + description: RefreshPreferences describes set of preferences associated + with the instance refresh request. + properties: + instanceWarmup: + description: The number of seconds until a newly launched instance + is configured and ready to use. During this time, the next replacement + will not be initiated. The default is to use the value for the + health check grace period defined for the group. + format: int64 + type: integer + minHealthyPercentage: + description: The amount of capacity as a percentage in ASG that + must remain healthy during an instance refresh. The default + is 90. + format: int64 + type: integer + strategy: + description: The strategy to use for the instance refresh. The + only valid value is Rolling. A rolling update is an update that + is applied to all instances in an Auto Scaling group until all + instances have been updated. + type: string + type: object + subnets: + description: Subnets is an array of subnet configurations + items: + description: AWSResourceReference is a reference to a specific AWS + resource by ID, ARN, or filters. Only one of ID, ARN or Filters + may be specified. Specifying more than one will result in a validation + error. + properties: + arn: + description: ARN of resource + type: string + filters: + description: 'Filters is a set of key/value pairs used to identify + a resource They are applied according to the rules defined + by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + items: + description: Filter is a filter used to identify an AWS resource. + properties: + name: + description: Name of the filter. Filter names are case-sensitive. + type: string + values: + description: Values includes one or more filter values. + Filter values are case-sensitive. + items: + type: string + type: array + required: + - name + - values + type: object + type: array + id: + description: ID of resource + type: string + type: object + type: array + required: + - awsLaunchTemplate + - maxSize + - minSize + type: object + status: + description: AWSMachinePoolStatus defines the observed state of AWSMachinePool. + properties: + asgStatus: + description: ASGStatus is a status string returned by the autoscaling + API. + type: string + conditions: + description: Conditions defines current service state of the AWSMachinePool. + 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: + - lastTransitionTime + - 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. \n 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. \n 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. \n 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. \n 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 + instances: + description: Instances contains the status for each instance in the + pool + items: + description: AWSMachinePoolInstanceStatus defines the status of + the AWSMachinePoolInstance. + properties: + instanceID: + description: InstanceID is the identification of the Machine + Instance within ASG + type: string + version: + description: Version defines the Kubernetes version for the + Machine Instance + type: string + type: object + type: array + launchTemplateID: + description: The ID of the launch template + type: string + ready: + description: Ready is true when the provider resource is ready. + type: boolean + replicas: + description: Replicas is the most recently observed number of replicas + format: int32 + type: integer + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachines.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachines.yaml index 52822871a5..030848702b 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachines.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachines.yaml @@ -933,6 +933,464 @@ spec: type: object type: object served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: Cluster to which this AWSMachine belongs + jsonPath: .metadata.labels.cluster\.x-k8s\.io/cluster-name + name: Cluster + type: string + - description: EC2 instance state + jsonPath: .status.instanceState + name: State + type: string + - description: Machine ready status + jsonPath: .status.ready + name: Ready + type: string + - description: EC2 instance ID + jsonPath: .spec.providerID + name: InstanceID + type: string + - description: Machine object which owns with this AWSMachine + jsonPath: .metadata.ownerReferences[?(@.kind=="Machine")].name + name: Machine + type: string + name: v1beta1 + schema: + openAPIV3Schema: + description: AWSMachine is the schema for Amazon EC2 machines. + 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: AWSMachineSpec defines the desired state of an Amazon EC2 + instance. + properties: + additionalSecurityGroups: + description: AdditionalSecurityGroups is an array of references to + security groups that should be applied to the instance. These security + groups would be set in addition to any security groups defined at + the cluster level or in the actuator. It is possible to specify + either IDs of Filters. Using Filters will cause additional requests + to AWS API and if tags change the attached security groups might + change too. + items: + description: AWSResourceReference is a reference to a specific AWS + resource by ID, ARN, or filters. Only one of ID, ARN or Filters + may be specified. Specifying more than one will result in a validation + error. + properties: + arn: + description: ARN of resource + type: string + filters: + description: 'Filters is a set of key/value pairs used to identify + a resource They are applied according to the rules defined + by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + items: + description: Filter is a filter used to identify an AWS resource. + properties: + name: + description: Name of the filter. Filter names are case-sensitive. + type: string + values: + description: Values includes one or more filter values. + Filter values are case-sensitive. + items: + type: string + type: array + required: + - name + - values + type: object + type: array + id: + description: ID of resource + type: string + type: object + type: array + additionalTags: + additionalProperties: + type: string + description: AdditionalTags is an optional set of tags to add to an + instance, in addition to the ones added by default by the AWS provider. + If both the AWSCluster and the AWSMachine specify the same tag name + with different values, the AWSMachine's value takes precedence. + type: object + ami: + description: AMI is the reference to the AMI from which to create + the machine instance. + properties: + eksLookupType: + description: EKSOptimizedLookupType If specified, will look up + an EKS Optimized image in SSM Parameter store + enum: + - AmazonLinux + - AmazonLinuxGPU + type: string + id: + description: ID of resource + type: string + type: object + cloudInit: + description: CloudInit defines options related to the bootstrapping + systems where CloudInit is used. + properties: + insecureSkipSecretsManager: + description: InsecureSkipSecretsManager, when set to true will + not use AWS Secrets Manager or AWS Systems Manager Parameter + Store to ensure privacy of userdata. By default, a cloud-init + boothook shell script is prepended to download the userdata + from Secrets Manager and additionally delete the secret. + type: boolean + secretCount: + description: SecretCount is the number of secrets used to form + the complete secret + format: int32 + type: integer + secretPrefix: + description: SecretPrefix is the prefix for the secret name. This + is stored temporarily, and deleted when the machine registers + as a node against the workload cluster. + type: string + secureSecretsBackend: + description: SecureSecretsBackend, when set to parameter-store + will utilize the AWS Systems Manager Parameter Storage to distribute + secrets. By default or with the value of secrets-manager, will + use AWS Secrets Manager instead. + enum: + - secrets-manager + - ssm-parameter-store + type: string + type: object + failureDomain: + description: FailureDomain is the failure domain unique identifier + this Machine should be attached to, as defined in Cluster API. For + this infrastructure provider, the ID is equivalent to an AWS Availability + Zone. If multiple subnets are matched for the availability zone, + the first one returned is picked. + type: string + iamInstanceProfile: + description: IAMInstanceProfile is a name of an IAM instance profile + to assign to the instance + type: string + imageLookupBaseOS: + description: ImageLookupBaseOS is the name of the base operating system + to use for image lookup the AMI is not set. + type: string + imageLookupFormat: + description: 'ImageLookupFormat is the AMI naming format to look up + the image for this machine It will be ignored if an explicit AMI + is set. Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} + with the base OS and kubernetes version, respectively. The BaseOS + will be the value in ImageLookupBaseOS or ubuntu (the default), + and the kubernetes version as defined by the packages produced by + kubernetes/release without v as a prefix: 1.13.0, 1.12.5-mybuild.1, + or 1.17.3. For example, the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* + will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* + for a Machine that is targeting kubernetes v1.18.0 and the ubuntu + base OS. See also: https://golang.org/pkg/text/template/' + type: string + imageLookupOrg: + description: ImageLookupOrg is the AWS Organization ID to use for + image lookup if AMI is not set. + type: string + instanceID: + description: InstanceID is the EC2 instance ID for this machine. + type: string + instanceType: + description: 'InstanceType is the type of instance to create. Example: + m4.xlarge' + minLength: 2 + type: string + networkInterfaces: + description: NetworkInterfaces is a list of ENIs to associate with + the instance. A maximum of 2 may be specified. + items: + type: string + maxItems: 2 + type: array + nonRootVolumes: + description: Configuration options for the non root storage volumes. + items: + description: Volume encapsulates the configuration options for the + storage device. + properties: + deviceName: + description: Device name + type: string + encrypted: + description: Encrypted is whether the volume should be encrypted + or not. + type: boolean + encryptionKey: + description: EncryptionKey is the KMS key to use to encrypt + the volume. Can be either a KMS key ID or ARN. If Encrypted + is set and this is omitted, the default AWS key will be used. + The key must already exist and be accessible by the controller. + type: string + iops: + description: IOPS is the number of IOPS requested for the disk. + Not applicable to all types. + format: int64 + type: integer + size: + description: Size specifies size (in Gi) of the storage device. + Must be greater than the image snapshot size or 8 (whichever + is greater). + format: int64 + minimum: 8 + type: integer + throughput: + description: Throughput to provision in MiB/s supported for + the volume type. Not applicable to all types. + format: int64 + type: integer + type: + description: Type is the type of the volume (e.g. gp2, io1, + etc...). + type: string + required: + - size + type: object + type: array + providerID: + description: ProviderID is the unique identifier as specified by the + cloud provider. + type: string + publicIP: + description: 'PublicIP specifies whether the instance should get a + public IP. Precedence for this setting is as follows: 1. This field + if set 2. Cluster/flavor setting 3. Subnet default' + type: boolean + rootVolume: + description: RootVolume encapsulates the configuration options for + the root volume + properties: + deviceName: + description: Device name + type: string + encrypted: + description: Encrypted is whether the volume should be encrypted + or not. + type: boolean + encryptionKey: + description: EncryptionKey is the KMS key to use to encrypt the + volume. Can be either a KMS key ID or ARN. If Encrypted is set + and this is omitted, the default AWS key will be used. The key + must already exist and be accessible by the controller. + type: string + iops: + description: IOPS is the number of IOPS requested for the disk. + Not applicable to all types. + format: int64 + type: integer + size: + description: Size specifies size (in Gi) of the storage device. + Must be greater than the image snapshot size or 8 (whichever + is greater). + format: int64 + minimum: 8 + type: integer + throughput: + description: Throughput to provision in MiB/s supported for the + volume type. Not applicable to all types. + format: int64 + type: integer + type: + description: Type is the type of the volume (e.g. gp2, io1, etc...). + type: string + required: + - size + type: object + spotMarketOptions: + description: SpotMarketOptions allows users to configure instances + to be run using AWS Spot instances. + properties: + maxPrice: + description: MaxPrice defines the maximum price the user is willing + to pay for Spot VM instances + type: string + type: object + sshKeyName: + description: SSHKeyName is the name of the ssh key to attach to the + instance. Valid values are empty string (do not use SSH keys), a + valid SSH key name, or omitted (use the default SSH key name) + type: string + subnet: + description: Subnet is a reference to the subnet to use for this instance. + If not specified, the cluster subnet will be used. + properties: + arn: + description: ARN of resource + type: string + filters: + description: 'Filters is a set of key/value pairs used to identify + a resource They are applied according to the rules defined by + the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + items: + description: Filter is a filter used to identify an AWS resource. + properties: + name: + description: Name of the filter. Filter names are case-sensitive. + type: string + values: + description: Values includes one or more filter values. + Filter values are case-sensitive. + items: + type: string + type: array + required: + - name + - values + type: object + type: array + id: + description: ID of resource + type: string + type: object + tenancy: + description: Tenancy indicates if instance should run on shared or + single-tenant hardware. + enum: + - default + - dedicated + - host + type: string + uncompressedUserData: + description: UncompressedUserData specify whether the user data is + gzip-compressed before it is sent to ec2 instance. cloud-init has + built-in support for gzip-compressed user data user data stored + in aws secret manager is always gzip-compressed. + type: boolean + required: + - instanceType + type: object + status: + description: AWSMachineStatus defines the observed state of AWSMachine. + properties: + addresses: + description: Addresses contains the AWS instance associated addresses. + 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 AWSMachine. + 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: + - lastTransitionTime + - 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. \n 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. \n 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. \n 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. \n 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 + instanceState: + description: InstanceState is the state of the AWS instance for this + machine. + type: string + interruptible: + description: Interruptible reports that this machine is using spot + instances and can therefore be interrupted by CAPI when it receives + a notice that the spot instance is to be terminated by AWS. This + will be set to true when SpotMarketOptions is not nil (i.e. this + machine is using a spot instance). + type: boolean + ready: + description: Ready is true when the provider resource is ready. + type: boolean + type: object + type: object + served: true storage: true subresources: status: {} diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinetemplates.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinetemplates.yaml index 35e93f28db..b93c40dc98 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinetemplates.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmachinetemplates.yaml @@ -729,6 +729,379 @@ spec: type: object type: object served: true + storage: false + - name: v1beta1 + schema: + openAPIV3Schema: + description: AWSMachineTemplate is the schema for the Amazon EC2 Machine Templates + API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: AWSMachineTemplateSpec defines the desired state of AWSMachineTemplate. + properties: + template: + description: AWSMachineTemplateResource describes the data needed + to create am AWSMachine from a template. + properties: + metadata: + description: 'Standard object''s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata' + properties: + annotations: + additionalProperties: + type: string + description: 'Annotations is an unstructured key value map + stored with a resource that may be set by external tools + to store and retrieve arbitrary metadata. They are not queryable + and should be preserved when modifying objects. More info: + http://kubernetes.io/docs/user-guide/annotations' + type: object + labels: + additionalProperties: + type: string + description: 'Map of string keys and values that can be used + to organize and categorize (scope and select) objects. May + match selectors of replication controllers and services. + More info: http://kubernetes.io/docs/user-guide/labels' + type: object + type: object + spec: + description: Spec is the specification of the desired behavior + of the machine. + properties: + additionalSecurityGroups: + description: AdditionalSecurityGroups is an array of references + to security groups that should be applied to the instance. + These security groups would be set in addition to any security + groups defined at the cluster level or in the actuator. + It is possible to specify either IDs of Filters. Using Filters + will cause additional requests to AWS API and if tags change + the attached security groups might change too. + items: + description: AWSResourceReference is a reference to a specific + AWS resource by ID, ARN, or filters. Only one of ID, ARN + or Filters may be specified. Specifying more than one + will result in a validation error. + properties: + arn: + description: ARN of resource + type: string + filters: + description: 'Filters is a set of key/value pairs used + to identify a resource They are applied according + to the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + items: + description: Filter is a filter used to identify an + AWS resource. + properties: + name: + description: Name of the filter. Filter names + are case-sensitive. + type: string + values: + description: Values includes one or more filter + values. Filter values are case-sensitive. + items: + type: string + type: array + required: + - name + - values + type: object + type: array + id: + description: ID of resource + type: string + type: object + type: array + additionalTags: + additionalProperties: + type: string + description: AdditionalTags is an optional set of tags to + add to an instance, in addition to the ones added by default + by the AWS provider. If both the AWSCluster and the AWSMachine + specify the same tag name with different values, the AWSMachine's + value takes precedence. + type: object + ami: + description: AMI is the reference to the AMI from which to + create the machine instance. + properties: + eksLookupType: + description: EKSOptimizedLookupType If specified, will + look up an EKS Optimized image in SSM Parameter store + enum: + - AmazonLinux + - AmazonLinuxGPU + type: string + id: + description: ID of resource + type: string + type: object + cloudInit: + description: CloudInit defines options related to the bootstrapping + systems where CloudInit is used. + properties: + insecureSkipSecretsManager: + description: InsecureSkipSecretsManager, when set to true + will not use AWS Secrets Manager or AWS Systems Manager + Parameter Store to ensure privacy of userdata. By default, + a cloud-init boothook shell script is prepended to download + the userdata from Secrets Manager and additionally delete + the secret. + type: boolean + secretCount: + description: SecretCount is the number of secrets used + to form the complete secret + format: int32 + type: integer + secretPrefix: + description: SecretPrefix is the prefix for the secret + name. This is stored temporarily, and deleted when the + machine registers as a node against the workload cluster. + type: string + secureSecretsBackend: + description: SecureSecretsBackend, when set to parameter-store + will utilize the AWS Systems Manager Parameter Storage + to distribute secrets. By default or with the value + of secrets-manager, will use AWS Secrets Manager instead. + enum: + - secrets-manager + - ssm-parameter-store + type: string + type: object + failureDomain: + description: FailureDomain is the failure domain unique identifier + this Machine should be attached to, as defined in Cluster + API. For this infrastructure provider, the ID is equivalent + to an AWS Availability Zone. If multiple subnets are matched + for the availability zone, the first one returned is picked. + type: string + iamInstanceProfile: + description: IAMInstanceProfile is a name of an IAM instance + profile to assign to the instance + type: string + imageLookupBaseOS: + description: ImageLookupBaseOS is the name of the base operating + system to use for image lookup the AMI is not set. + type: string + imageLookupFormat: + description: 'ImageLookupFormat is the AMI naming format to + look up the image for this machine It will be ignored if + an explicit AMI is set. Supports substitutions for {{.BaseOS}} + and {{.K8sVersion}} with the base OS and kubernetes version, + respectively. The BaseOS will be the value in ImageLookupBaseOS + or ubuntu (the default), and the kubernetes version as defined + by the packages produced by kubernetes/release without v + as a prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, + the default image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* + will end up searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* + for a Machine that is targeting kubernetes v1.18.0 and the + ubuntu base OS. See also: https://golang.org/pkg/text/template/' + type: string + imageLookupOrg: + description: ImageLookupOrg is the AWS Organization ID to + use for image lookup if AMI is not set. + type: string + instanceID: + description: InstanceID is the EC2 instance ID for this machine. + type: string + instanceType: + description: 'InstanceType is the type of instance to create. + Example: m4.xlarge' + minLength: 2 + type: string + networkInterfaces: + description: NetworkInterfaces is a list of ENIs to associate + with the instance. A maximum of 2 may be specified. + items: + type: string + maxItems: 2 + type: array + nonRootVolumes: + description: Configuration options for the non root storage + volumes. + items: + description: Volume encapsulates the configuration options + for the storage device. + properties: + deviceName: + description: Device name + type: string + encrypted: + description: Encrypted is whether the volume should + be encrypted or not. + type: boolean + encryptionKey: + description: EncryptionKey is the KMS key to use to + encrypt the volume. Can be either a KMS key ID or + ARN. If Encrypted is set and this is omitted, the + default AWS key will be used. The key must already + exist and be accessible by the controller. + type: string + iops: + description: IOPS is the number of IOPS requested for + the disk. Not applicable to all types. + format: int64 + type: integer + size: + description: Size specifies size (in Gi) of the storage + device. Must be greater than the image snapshot size + or 8 (whichever is greater). + format: int64 + minimum: 8 + type: integer + throughput: + description: Throughput to provision in MiB/s supported + for the volume type. Not applicable to all types. + format: int64 + type: integer + type: + description: Type is the type of the volume (e.g. gp2, + io1, etc...). + type: string + required: + - size + type: object + type: array + providerID: + description: ProviderID is the unique identifier as specified + by the cloud provider. + type: string + publicIP: + description: 'PublicIP specifies whether the instance should + get a public IP. Precedence for this setting is as follows: + 1. This field if set 2. Cluster/flavor setting 3. Subnet + default' + type: boolean + rootVolume: + description: RootVolume encapsulates the configuration options + for the root volume + properties: + deviceName: + description: Device name + type: string + encrypted: + description: Encrypted is whether the volume should be + encrypted or not. + type: boolean + encryptionKey: + description: EncryptionKey is the KMS key to use to encrypt + the volume. Can be either a KMS key ID or ARN. If Encrypted + is set and this is omitted, the default AWS key will + be used. The key must already exist and be accessible + by the controller. + type: string + iops: + description: IOPS is the number of IOPS requested for + the disk. Not applicable to all types. + format: int64 + type: integer + size: + description: Size specifies size (in Gi) of the storage + device. Must be greater than the image snapshot size + or 8 (whichever is greater). + format: int64 + minimum: 8 + type: integer + throughput: + description: Throughput to provision in MiB/s supported + for the volume type. Not applicable to all types. + format: int64 + type: integer + type: + description: Type is the type of the volume (e.g. gp2, + io1, etc...). + type: string + required: + - size + type: object + spotMarketOptions: + description: SpotMarketOptions allows users to configure instances + to be run using AWS Spot instances. + properties: + maxPrice: + description: MaxPrice defines the maximum price the user + is willing to pay for Spot VM instances + type: string + type: object + sshKeyName: + description: SSHKeyName is the name of the ssh key to attach + to the instance. Valid values are empty string (do not use + SSH keys), a valid SSH key name, or omitted (use the default + SSH key name) + type: string + subnet: + description: Subnet is a reference to the subnet to use for + this instance. If not specified, the cluster subnet will + be used. + properties: + arn: + description: ARN of resource + type: string + filters: + description: 'Filters is a set of key/value pairs used + to identify a resource They are applied according to + the rules defined by the AWS API: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html' + items: + description: Filter is a filter used to identify an + AWS resource. + properties: + name: + description: Name of the filter. Filter names are + case-sensitive. + type: string + values: + description: Values includes one or more filter + values. Filter values are case-sensitive. + items: + type: string + type: array + required: + - name + - values + type: object + type: array + id: + description: ID of resource + type: string + type: object + tenancy: + description: Tenancy indicates if instance should run on shared + or single-tenant hardware. + enum: + - default + - dedicated + - host + type: string + uncompressedUserData: + description: UncompressedUserData specify whether the user + data is gzip-compressed before it is sent to ec2 instance. + cloud-init has built-in support for gzip-compressed user + data user data stored in aws secret manager is always gzip-compressed. + type: boolean + required: + - instanceType + type: object + required: + - spec + type: object + required: + - template + type: object + type: object + served: true storage: true status: acceptedNames: diff --git a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmanagedmachinepools.yaml b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmanagedmachinepools.yaml index 4a93b2625f..df62b6f66e 100644 --- a/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmanagedmachinepools.yaml +++ b/config/crd/bases/infrastructure.cluster.x-k8s.io_awsmanagedmachinepools.yaml @@ -271,6 +271,261 @@ spec: type: object spec: description: AWSManagedMachinePoolSpec defines the desired state of AWSManagedMachinePool + properties: + additionalTags: + additionalProperties: + type: string + description: AdditionalTags is an optional set of tags to add to AWS + resources managed by the AWS provider, in addition to the ones added + by default. + type: object + amiType: + default: AL2_x86_64 + description: AMIType defines the AMI type + enum: + - AL2_x86_64 + - AL2_x86_64_GPU + - AL2_ARM_64 + type: string + amiVersion: + description: AMIVersion defines the desired AMI release version. If + no version number is supplied then the latest version for the Kubernetes + version will be used + minLength: 2 + type: string + availabilityZones: + description: AvailabilityZones is an array of availability zones instances + can run in + items: + type: string + type: array + capacityType: + default: onDemand + description: CapacityType specifies the capacity type for the ASG + behind this pool + enum: + - onDemand + - spot + type: string + diskSize: + description: DiskSize specifies the root disk size + format: int32 + type: integer + eksNodegroupName: + description: EKSNodegroupName specifies the name of the nodegroup + in AWS corresponding to this MachinePool. If you don't specify a + name then a default name will be created based on the namespace + and name of the managed machine pool. + type: string + instanceType: + description: InstanceType specifies the AWS instance type + type: string + labels: + additionalProperties: + type: string + description: Labels specifies labels for the Kubernetes node objects + type: object + providerIDList: + description: ProviderIDList are the provider IDs of instances in the + autoscaling group corresponding to the nodegroup represented by + this machine pool + items: + type: string + type: array + remoteAccess: + description: RemoteAccess specifies how machines can be accessed remotely + properties: + public: + description: Public specifies whether to open port 22 to the public + internet + type: boolean + sourceSecurityGroups: + description: SourceSecurityGroups specifies which security groups + are allowed access + items: + type: string + type: array + sshKeyName: + description: SSHKeyName specifies which EC2 SSH key can be used + to access machines. If left empty, the key from the control + plane is used. + type: string + type: object + roleName: + description: RoleName specifies the name of IAM role for the node + group. If the role is pre-existing we will treat it as unmanaged + and not delete it on deletion. If the EKSEnableIAM feature flag + is true and no name is supplied then a role is created. + type: string + scaling: + description: Scaling specifies scaling for the ASG behind this pool + properties: + maxSize: + format: int32 + type: integer + minSize: + format: int32 + type: integer + type: object + subnetIDs: + description: SubnetIDs specifies which subnets are used for the auto + scaling group of this nodegroup + items: + type: string + type: array + taints: + description: Taints specifies the taints to apply to the nodes of + the machine pool + items: + description: Taint defines the specs for a Kubernetes taint. + properties: + effect: + description: Effect specifies the effect for the taint + enum: + - no-schedule + - no-execute + - prefer-no-schedule + type: string + key: + description: Key is the key of the taint + type: string + value: + description: Value is the value of the taint + type: string + required: + - effect + - key + - value + type: object + type: array + type: object + status: + description: AWSManagedMachinePoolStatus defines the observed state of + AWSManagedMachinePool + properties: + conditions: + description: Conditions defines current service state of the managed + machine pool + 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 MachinePool and will contain + a more verbose string suitable for logging and human consumption. + \n 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 MachinePool's spec or the configuration of the controller, + and that manual intervention is required. Examples of terminal errors + would be invalid combinations of settings in the spec, values that + are unsupported by the controller, or the responsible controller + itself being critically misconfigured. \n Any transient errors that + occur during the reconciliation of MachinePools can be added as + events to the MachinePool 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 MachinePool and will contain + a succinct value suitable for machine interpretation. \n 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. \n Any transient errors that + occur during the reconciliation of MachinePools can be added as + events to the MachinePool object and/or logged in the controller's + output." + type: string + ready: + default: false + description: Ready denotes that the AWSManagedMachinePool nodegroup + has joined the cluster + type: boolean + replicas: + description: Replicas is the most recently observed number of replicas. + format: int32 + type: integer + required: + - ready + type: object + type: object + served: true + storage: false + subresources: + status: {} + - additionalPrinterColumns: + - description: MachinePool ready status + jsonPath: .status.ready + name: Ready + type: string + - description: Number of replicas + jsonPath: .status.replicas + name: Replicas + type: integer + name: v1beta1 + schema: + openAPIV3Schema: + description: AWSManagedMachinePool is the Schema for the awsmanagedmachinepools + API. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: AWSManagedMachinePoolSpec defines the desired state of AWSManagedMachinePool. properties: additionalTags: additionalProperties: @@ -408,7 +663,7 @@ spec: type: object status: description: AWSManagedMachinePoolStatus defines the observed state of - AWSManagedMachinePool + AWSManagedMachinePool. properties: conditions: description: Conditions defines current service state of the managed @@ -451,6 +706,7 @@ spec: important. type: string required: + - lastTransitionTime - status - type type: object diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 527b925026..03ee0a8ea1 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -1,6 +1,7 @@ commonLabels: cluster.x-k8s.io/v1alpha3: v1alpha3 cluster.x-k8s.io/v1alpha4: v1alpha4 + cluster.x-k8s.io/v1beta1: v1beta1 # This kustomization.yaml is not intended to be run by itself, # since it depends on service name and namespace that are out of this kustomize package. diff --git a/config/webhook/manifests.yaml b/config/webhook/manifests.yaml index 2fe853da89..13fdf7fa78 100644 --- a/config/webhook/manifests.yaml +++ b/config/webhook/manifests.yaml @@ -12,7 +12,7 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awscluster + path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-awscluster failurePolicy: Fail matchPolicy: Equivalent name: default.awscluster.infrastructure.cluster.x-k8s.io @@ -20,7 +20,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -33,7 +33,7 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awsclustercontrolleridentity + path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-awsclustercontrolleridentity failurePolicy: Fail matchPolicy: Equivalent name: default.awsclustercontrolleridentity.infrastructure.cluster.x-k8s.io @@ -41,7 +41,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -54,7 +54,7 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awsclusterroleidentity + path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-awsclusterroleidentity failurePolicy: Fail matchPolicy: Equivalent name: default.awsclusterroleidentity.infrastructure.cluster.x-k8s.io @@ -62,7 +62,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -75,7 +75,7 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awsclusterstaticidentity + path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-awsclusterstaticidentity failurePolicy: Fail matchPolicy: Equivalent name: default.awsclusterstaticidentity.infrastructure.cluster.x-k8s.io @@ -83,7 +83,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -96,7 +96,7 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awsclustertemplate + path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-awsclustertemplate failurePolicy: Fail matchPolicy: Equivalent name: default.awsclustertemplate.infrastructure.cluster.x-k8s.io @@ -104,7 +104,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -117,14 +117,14 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awsmachine + path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-awsmachine failurePolicy: Fail name: mutation.awsmachine.infrastructure.cluster.x-k8s.io rules: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -137,7 +137,7 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awsfargateprofile + path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-awsfargateprofile failurePolicy: Fail matchPolicy: Equivalent name: default.awsfargateprofile.infrastructure.cluster.x-k8s.io @@ -145,7 +145,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -158,7 +158,7 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awsmachinepool + path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-awsmachinepool failurePolicy: Fail matchPolicy: Equivalent name: default.awsmachinepool.infrastructure.cluster.x-k8s.io @@ -166,7 +166,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -179,7 +179,7 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awsmanagedmachinepool + path: /mutate-infrastructure-cluster-x-k8s-io-v1beta1-awsmanagedmachinepool failurePolicy: Fail matchPolicy: Equivalent name: default.awsmanagedmachinepool.infrastructure.cluster.x-k8s.io @@ -187,7 +187,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -200,20 +200,20 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-controlplane-cluster-x-k8s-io-v1alpha4-awsmanagedcontrolplane + path: /mutate-bootstrap-cluster-x-k8s-io-v1beta1-eksconfig failurePolicy: Fail matchPolicy: Equivalent - name: default.awsmanagedcontrolplanes.controlplane.cluster.x-k8s.io + name: default.eksconfigs.bootstrap.cluster.x-k8s.io rules: - apiGroups: - - controlplane.cluster.x-k8s.io + - bootstrap.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE resources: - - awsmanagedcontrolplanes + - eksconfig sideEffects: None - admissionReviewVersions: - v1beta1 @@ -221,20 +221,20 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-bootstrap-cluster-x-k8s-io-v1alpha4-eksconfig + path: /mutate-bootstrap-cluster-x-k8s-io-v1beta1-eksconfigtemplate failurePolicy: Fail matchPolicy: Equivalent - name: default.eksconfigs.bootstrap.cluster.x-k8s.io + name: default.eksconfigtemplates.bootstrap.cluster.x-k8s.io rules: - apiGroups: - bootstrap.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE resources: - - eksconfig + - eksconfigtemplate sideEffects: None - admissionReviewVersions: - v1beta1 @@ -242,20 +242,20 @@ webhooks: service: name: webhook-service namespace: system - path: /mutate-bootstrap-cluster-x-k8s-io-v1alpha4-eksconfigtemplate + path: /mutate-controlplane-cluster-x-k8s-io-v1beta1-awsmanagedcontrolplane failurePolicy: Fail matchPolicy: Equivalent - name: default.eksconfigtemplates.bootstrap.cluster.x-k8s.io + name: default.awsmanagedcontrolplanes.controlplane.cluster.x-k8s.io rules: - apiGroups: - - bootstrap.cluster.x-k8s.io + - controlplane.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE resources: - - eksconfigtemplate + - awsmanagedcontrolplanes sideEffects: None --- @@ -271,7 +271,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-infrastructure-cluster-x-k8s-io-v1alpha4-awscluster + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-awscluster failurePolicy: Fail matchPolicy: Equivalent name: validation.awscluster.infrastructure.cluster.x-k8s.io @@ -279,7 +279,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -292,7 +292,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsclustercontrolleridentity + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-awsclustercontrolleridentity failurePolicy: Fail matchPolicy: Equivalent name: validation.awsclustercontrolleridentity.infrastructure.cluster.x-k8s.io @@ -300,7 +300,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -313,7 +313,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsclusterroleidentity + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-awsclusterroleidentity failurePolicy: Fail matchPolicy: Equivalent name: validation.awsclusterroleidentity.infrastructure.cluster.x-k8s.io @@ -321,7 +321,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -334,7 +334,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsclusterstaticidentity + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-awsclusterstaticidentity failurePolicy: Fail matchPolicy: Equivalent name: validation.awsclusterstaticidentity.infrastructure.cluster.x-k8s.io @@ -342,7 +342,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -355,7 +355,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsclustertemplate + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-awsclustertemplate failurePolicy: Fail matchPolicy: Equivalent name: validation.awsclustertemplate.infrastructure.cluster.x-k8s.io @@ -363,7 +363,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -376,7 +376,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsmachine + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-awsmachine failurePolicy: Fail matchPolicy: Equivalent name: validation.awsmachine.infrastructure.cluster.x-k8s.io @@ -384,7 +384,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -397,7 +397,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsmachinetemplate + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-awsmachinetemplate failurePolicy: Fail matchPolicy: Equivalent name: validation.awsmachinetemplate.infrastructure.x-k8s.io @@ -405,7 +405,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -418,7 +418,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsfargateprofile + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-awsfargateprofile failurePolicy: Fail matchPolicy: Equivalent name: validation.awsfargateprofile.infrastructure.cluster.x-k8s.io @@ -426,7 +426,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -439,7 +439,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsmachinepool + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-awsmachinepool failurePolicy: Fail matchPolicy: Equivalent name: validation.awsmachinepool.infrastructure.cluster.x-k8s.io @@ -447,7 +447,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -460,7 +460,7 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsmanagedmachinepool + path: /validate-infrastructure-cluster-x-k8s-io-v1beta1-awsmanagedmachinepool failurePolicy: Fail matchPolicy: Equivalent name: validation.awsmanagedmachinepool.infrastructure.cluster.x-k8s.io @@ -468,7 +468,7 @@ webhooks: - apiGroups: - infrastructure.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE @@ -481,20 +481,20 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-controlplane-cluster-x-k8s-io-v1alpha4-awsmanagedcontrolplane + path: /validate-bootstrap-cluster-x-k8s-io-v1beta1-eksconfig failurePolicy: Fail matchPolicy: Equivalent - name: validation.awsmanagedcontrolplanes.controlplane.cluster.x-k8s.io + name: validation.eksconfigs.bootstrap.cluster.x-k8s.io rules: - apiGroups: - - controlplane.cluster.x-k8s.io + - bootstrap.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE resources: - - awsmanagedcontrolplanes + - eksconfig sideEffects: None - admissionReviewVersions: - v1beta1 @@ -502,20 +502,20 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-bootstrap-cluster-x-k8s-io-v1alpha4-eksconfig + path: /validate-bootstrap-cluster-x-k8s-io-v1beta1-eksconfigtemplate failurePolicy: Fail matchPolicy: Equivalent - name: validation.eksconfigs.bootstrap.cluster.x-k8s.io + name: validation.eksconfigtemplates.bootstrap.cluster.x-k8s.io rules: - apiGroups: - bootstrap.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE resources: - - eksconfig + - eksconfigtemplate sideEffects: None - admissionReviewVersions: - v1beta1 @@ -523,18 +523,18 @@ webhooks: service: name: webhook-service namespace: system - path: /validate-bootstrap-cluster-x-k8s-io-v1alpha4-eksconfigtemplate + path: /validate-controlplane-cluster-x-k8s-io-v1beta1-awsmanagedcontrolplane failurePolicy: Fail matchPolicy: Equivalent - name: validation.eksconfigtemplates.bootstrap.cluster.x-k8s.io + name: validation.awsmanagedcontrolplanes.controlplane.cluster.x-k8s.io rules: - apiGroups: - - bootstrap.cluster.x-k8s.io + - controlplane.cluster.x-k8s.io apiVersions: - - v1alpha4 + - v1beta1 operations: - CREATE - UPDATE resources: - - eksconfigtemplate + - awsmanagedcontrolplanes sideEffects: None diff --git a/controllers/awscluster_controller.go b/controllers/awscluster_controller.go index aefe0519fa..f84c3b1a80 100644 --- a/controllers/awscluster_controller.go +++ b/controllers/awscluster_controller.go @@ -28,7 +28,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/tools/record" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/feature" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2" @@ -36,7 +36,7 @@ import ( "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/instancestate" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/network" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/securitygroup" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/controllers/awscluster_controller_test.go b/controllers/awscluster_controller_test.go index 4bda31c202..c53850255f 100644 --- a/controllers/awscluster_controller_test.go +++ b/controllers/awscluster_controller_test.go @@ -23,7 +23,7 @@ import ( "golang.org/x/net/context" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/controllers/awsmachine_annotations.go b/controllers/awsmachine_annotations.go index c9698ea4e7..53a76b8048 100644 --- a/controllers/awsmachine_annotations.go +++ b/controllers/awsmachine_annotations.go @@ -19,7 +19,7 @@ package controllers import ( "encoding/json" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ) // updateMachineAnnotationJSON updates the `annotation` on `machine` with diff --git a/controllers/awsmachine_controller.go b/controllers/awsmachine_controller.go index 5f2e1362bb..3b2322c792 100644 --- a/controllers/awsmachine_controller.go +++ b/controllers/awsmachine_controller.go @@ -28,8 +28,8 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/client-go/tools/record" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/feature" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" @@ -40,7 +40,7 @@ import ( "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/secretsmanager" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ssm" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/userdata" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/noderefutil" capierrors "sigs.k8s.io/cluster-api/errors" "sigs.k8s.io/cluster-api/util" diff --git a/controllers/awsmachine_controller_test.go b/controllers/awsmachine_controller_test.go index 0df58b7262..feec965f70 100644 --- a/controllers/awsmachine_controller_test.go +++ b/controllers/awsmachine_controller_test.go @@ -36,12 +36,12 @@ import ( "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/mock_services" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/noderefutil" capierrors "sigs.k8s.io/cluster-api/errors" "sigs.k8s.io/cluster-api/util/conditions" diff --git a/controllers/awsmachine_controller_unit_test.go b/controllers/awsmachine_controller_unit_test.go index 1762f9fb83..836d3e9c8c 100644 --- a/controllers/awsmachine_controller_unit_test.go +++ b/controllers/awsmachine_controller_unit_test.go @@ -25,8 +25,8 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/klog/v2/klogr" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func newMachine(clusterName, machineName string) *clusterv1.Machine { diff --git a/controllers/awsmachine_security_groups.go b/controllers/awsmachine_security_groups.go index 1dc9f155a9..d27e385d90 100644 --- a/controllers/awsmachine_security_groups.go +++ b/controllers/awsmachine_security_groups.go @@ -19,7 +19,7 @@ package controllers import ( "sort" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" service "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services" ) diff --git a/controllers/awsmachine_tags.go b/controllers/awsmachine_tags.go index 5da83d1b5c..27fa726c8b 100644 --- a/controllers/awsmachine_tags.go +++ b/controllers/awsmachine_tags.go @@ -17,7 +17,7 @@ limitations under the License. package controllers import ( - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" service "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services" ) diff --git a/controllers/suite_test.go b/controllers/suite_test.go index d5f5fa4dd7..a9f36702bc 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -24,9 +24,9 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/test/helpers" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" // +kubebuilder:scaffold:imports ) diff --git a/controlplane/eks/PROJECT b/controlplane/eks/PROJECT index 3b74613f53..f26e7e8041 100644 --- a/controlplane/eks/PROJECT +++ b/controlplane/eks/PROJECT @@ -7,4 +7,7 @@ resources: - group: controlplane kind: AWSManagedControlPlane version: v1alpha4 +- group: controlplane + kind: AWSManagedControlPlane + version: v1beta1 version: "2" diff --git a/controlplane/eks/api/v1alpha3/awsmanagedcontrolplane_types.go b/controlplane/eks/api/v1alpha3/awsmanagedcontrolplane_types.go index 9a546217fd..fd0d6e5b85 100644 --- a/controlplane/eks/api/v1alpha3/awsmanagedcontrolplane_types.go +++ b/controlplane/eks/api/v1alpha3/awsmanagedcontrolplane_types.go @@ -18,8 +18,8 @@ package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + infrav1alpha3 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" ) const ( @@ -37,10 +37,10 @@ type AWSManagedControlPlaneSpec struct { //nolint: maligned // IdentityRef is a reference to a identity to be used when reconciling the managed control plane. // +optional - IdentityRef *infrav1.AWSIdentityReference `json:"identityRef,omitempty"` + IdentityRef *infrav1alpha3.AWSIdentityReference `json:"identityRef,omitempty"` // NetworkSpec encapsulates all things related to AWS network. - NetworkSpec infrav1.NetworkSpec `json:"networkSpec,omitempty"` + NetworkSpec infrav1alpha3.NetworkSpec `json:"networkSpec,omitempty"` // SecondaryCidrBlock is the additional CIDR range to use for pod IPs. // Must be within the 100.64.0.0/10 or 198.19.0.0/16 range. @@ -89,7 +89,7 @@ type AWSManagedControlPlaneSpec struct { //nolint: maligned // AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the // ones added by default. // +optional - AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` + AdditionalTags infrav1alpha3.Tags `json:"additionalTags,omitempty"` // IAMAuthenticatorConfig allows the specification of any additional user or role mappings // for use when generating the aws-iam-authenticator configuration. If this is nil the @@ -103,7 +103,7 @@ type AWSManagedControlPlaneSpec struct { //nolint: maligned // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. // +optional - ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"` + ControlPlaneEndpoint clusterv1alpha3.APIEndpoint `json:"controlPlaneEndpoint"` // ImageLookupFormat is the AMI naming format to look up machine images when // a machine does not specify an AMI. When set, this will be used for all @@ -134,7 +134,7 @@ type AWSManagedControlPlaneSpec struct { //nolint: maligned // Bastion contains options to configure the bastion host. // +optional - Bastion infrav1.Bastion `json:"bastion"` + Bastion infrav1alpha3.Bastion `json:"bastion"` // TokenMethod is used to specify the method for obtaining a client token for communicating with EKS // iam-authenticator - obtains a client token using iam-authentictor @@ -195,13 +195,13 @@ type OIDCProviderStatus struct { type AWSManagedControlPlaneStatus struct { // Networks holds details about the AWS networking resources used by the control plane // +optional - Network infrav1.Network `json:"network,omitempty"` + Network infrav1alpha3.Network `json:"network,omitempty"` // FailureDomains specifies a list fo available availability zones that can be used // +optional - FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"` + FailureDomains clusterv1alpha3.FailureDomains `json:"failureDomains,omitempty"` // Bastion holds details of the instance that is used as a bastion jump box // +optional - Bastion *infrav1.Instance `json:"bastion,omitempty"` + Bastion *infrav1alpha3.Instance `json:"bastion,omitempty"` // OIDCProvider holds the status of the identity provider for this cluster // +optional OIDCProvider OIDCProviderStatus `json:"oidcProvider,omitempty"` @@ -222,7 +222,7 @@ type AWSManagedControlPlaneStatus struct { // +optional FailureMessage *string `json:"failureMessage,omitempty"` // Conditions specifies the cpnditions for the managed control plane - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1alpha3.Conditions `json:"conditions,omitempty"` // Addons holds the current status of the EKS addons // +optional Addons []AddonState `json:"addons,omitempty"` @@ -257,12 +257,12 @@ type AWSManagedControlPlaneList struct { } // GetConditions returns the control planes conditions. -func (r *AWSManagedControlPlane) GetConditions() clusterv1.Conditions { +func (r *AWSManagedControlPlane) GetConditions() clusterv1alpha3.Conditions { return r.Status.Conditions } // SetConditions sets the status conditions for the AWSManagedControlPlane. -func (r *AWSManagedControlPlane) SetConditions(conditions clusterv1.Conditions) { +func (r *AWSManagedControlPlane) SetConditions(conditions clusterv1alpha3.Conditions) { r.Status.Conditions = conditions } diff --git a/controlplane/eks/api/v1alpha3/conditions_consts.go b/controlplane/eks/api/v1alpha3/conditions_consts.go index 06befb9eb7..efb0effd0f 100644 --- a/controlplane/eks/api/v1alpha3/conditions_consts.go +++ b/controlplane/eks/api/v1alpha3/conditions_consts.go @@ -16,38 +16,38 @@ limitations under the License. package v1alpha3 -import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" +import clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" const ( // EKSControlPlaneReadyCondition condition reports on the successful reconciliation of eks control plane. - EKSControlPlaneReadyCondition clusterv1.ConditionType = "EKSControlPlaneReady" + EKSControlPlaneReadyCondition clusterv1alpha3.ConditionType = "EKSControlPlaneReady" // EKSControlPlaneCreatingCondition condition reports on whether the eks // control plane is creating. - EKSControlPlaneCreatingCondition clusterv1.ConditionType = "EKSControlPlaneCreating" + EKSControlPlaneCreatingCondition clusterv1alpha3.ConditionType = "EKSControlPlaneCreating" // EKSControlPlaneUpdatingCondition condition reports on whether the eks // control plane is updating. - EKSControlPlaneUpdatingCondition clusterv1.ConditionType = "EKSControlPlaneUpdating" + EKSControlPlaneUpdatingCondition clusterv1alpha3.ConditionType = "EKSControlPlaneUpdating" // EKSControlPlaneReconciliationFailedReason used to report failures while reconciling EKS control plane. EKSControlPlaneReconciliationFailedReason = "EKSControlPlaneReconciliationFailed" ) const ( // IAMControlPlaneRolesReadyCondition condition reports on the successful reconciliation of eks control plane iam roles. - IAMControlPlaneRolesReadyCondition clusterv1.ConditionType = "IAMControlPlaneRolesReady" + IAMControlPlaneRolesReadyCondition clusterv1alpha3.ConditionType = "IAMControlPlaneRolesReady" // IAMControlPlaneRolesReconciliationFailedReason used to report failures while reconciling EKS control plane iam roles. IAMControlPlaneRolesReconciliationFailedReason = "IAMControlPlaneRolesReconciliationFailed" ) const ( // IAMAuthenticatorConfiguredCondition condition reports on the successful reconciliation of aws-iam-authenticator config. - IAMAuthenticatorConfiguredCondition clusterv1.ConditionType = "IAMAuthenticatorConfigured" + IAMAuthenticatorConfiguredCondition clusterv1alpha3.ConditionType = "IAMAuthenticatorConfigured" // IAMAuthenticatorConfigurationFailedReason used to report failures while reconciling the aws-iam-authenticator config. IAMAuthenticatorConfigurationFailedReason = "IAMAuthenticatorConfigurationFailed" ) const ( // EKSAddonsConfiguredCondition condition reports on the successful reconciliation of EKS addons. - EKSAddonsConfiguredCondition clusterv1.ConditionType = "EKSAddonsConfigured" + EKSAddonsConfiguredCondition clusterv1alpha3.ConditionType = "EKSAddonsConfigured" // EKSAddonsConfiguredFailedReason used to report failures while reconciling the EKS addons. EKSAddonsConfiguredFailedReason = "EKSAddonsConfiguredFailed" ) diff --git a/controlplane/eks/api/v1alpha3/conversion.go b/controlplane/eks/api/v1alpha3/conversion.go index 4c32fa56ab..1a680a3ce9 100644 --- a/controlplane/eks/api/v1alpha3/conversion.go +++ b/controlplane/eks/api/v1alpha3/conversion.go @@ -19,95 +19,95 @@ package v1alpha3 import ( apiconversion "k8s.io/apimachinery/pkg/conversion" infrav1alpha3 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" - infrav1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + infrav1beta1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" clusterapiapiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" - clusterapiapiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterapiapiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/conversion" ) -// ConvertTo converts the v1alpha3 AWSManagedControlPlane receiver to a v1alpha4 AWSManagedControlPlane. +// ConvertTo converts the v1alpha3 AWSManagedControlPlane receiver to a v1beta1 AWSManagedControlPlane. func (r *AWSManagedControlPlane) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSManagedControlPlane) + dst := dstRaw.(*v1beta1.AWSManagedControlPlane) - return Convert_v1alpha3_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane(r, dst, nil) + return Convert_v1alpha3_AWSManagedControlPlane_To_v1beta1_AWSManagedControlPlane(r, dst, nil) } -// ConvertFrom converts the v1alpha4 AWSManagedControlPlane receiver to a v1alpha3 AWSManagedControlPlane. +// ConvertFrom converts the v1beta1 AWSManagedControlPlane receiver to a v1alpha3 AWSManagedControlPlane. func (r *AWSManagedControlPlane) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSManagedControlPlane) + src := srcRaw.(*v1beta1.AWSManagedControlPlane) - return Convert_v1alpha4_AWSManagedControlPlane_To_v1alpha3_AWSManagedControlPlane(src, r, nil) + return Convert_v1beta1_AWSManagedControlPlane_To_v1alpha3_AWSManagedControlPlane(src, r, nil) } -// ConvertTo converts the v1alpha3 AWSManagedControlPlaneList receiver to a v1alpha4 AWSManagedControlPlaneList. +// ConvertTo converts the v1alpha3 AWSManagedControlPlaneList receiver to a v1beta1 AWSManagedControlPlaneList. func (r *AWSManagedControlPlaneList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSManagedControlPlaneList) + dst := dstRaw.(*v1beta1.AWSManagedControlPlaneList) - return Convert_v1alpha3_AWSManagedControlPlaneList_To_v1alpha4_AWSManagedControlPlaneList(r, dst, nil) + return Convert_v1alpha3_AWSManagedControlPlaneList_To_v1beta1_AWSManagedControlPlaneList(r, dst, nil) } -// ConvertFrom converts the v1alpha4 AWSManagedControlPlaneList receiver to a v1alpha3 AWSManagedControlPlaneList. +// ConvertFrom converts the v1beta1 AWSManagedControlPlaneList receiver to a v1alpha3 AWSManagedControlPlaneList. func (r *AWSManagedControlPlaneList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSManagedControlPlaneList) + src := srcRaw.(*v1beta1.AWSManagedControlPlaneList) - return Convert_v1alpha4_AWSManagedControlPlaneList_To_v1alpha3_AWSManagedControlPlaneList(src, r, nil) + return Convert_v1beta1_AWSManagedControlPlaneList_To_v1alpha3_AWSManagedControlPlaneList(src, r, nil) } -// Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint is an autogenerated conversion function. -func Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(in *clusterapiapiv1alpha3.APIEndpoint, out *clusterapiapiv1alpha4.APIEndpoint, s apiconversion.Scope) error { - return clusterapiapiv1alpha3.Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(in, out, s) +// Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint is a conversion function. +func Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(in *clusterapiapiv1alpha3.APIEndpoint, out *clusterapiapiv1beta1.APIEndpoint, s apiconversion.Scope) error { + return clusterapiapiv1alpha3.Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(in, out, s) } -// Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint is an autogenerated conversion function. -func Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(in *clusterapiapiv1alpha4.APIEndpoint, out *clusterapiapiv1alpha3.APIEndpoint, s apiconversion.Scope) error { - return clusterapiapiv1alpha3.Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(in, out, s) +// Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint is a conversion function. +func Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(in *clusterapiapiv1beta1.APIEndpoint, out *clusterapiapiv1alpha3.APIEndpoint, s apiconversion.Scope) error { + return clusterapiapiv1alpha3.Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(in, out, s) } -// Convert_v1alpha3_Bastion_To_v1alpha4_Bastion is an autogenerated conversion function. -func Convert_v1alpha3_Bastion_To_v1alpha4_Bastion(in *infrav1alpha3.Bastion, out *infrav1alpha4.Bastion, s apiconversion.Scope) error { - return infrav1alpha3.Convert_v1alpha3_Bastion_To_v1alpha4_Bastion(in, out, s) +// Convert_v1alpha3_Bastion_To_v1beta1_Bastion is a conversion function. +func Convert_v1alpha3_Bastion_To_v1beta1_Bastion(in *infrav1alpha3.Bastion, out *infrav1beta1.Bastion, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1alpha3_Bastion_To_v1beta1_Bastion(in, out, s) } -// Convert_v1alpha4_Bastion_To_v1alpha3_Bastion is an autogenerated conversion function. -func Convert_v1alpha4_Bastion_To_v1alpha3_Bastion(in *infrav1alpha4.Bastion, out *infrav1alpha3.Bastion, s apiconversion.Scope) error { - return infrav1alpha3.Convert_v1alpha4_Bastion_To_v1alpha3_Bastion(in, out, s) +// Convert_v1beta1_Bastion_To_v1alpha3_Bastion is a conversion function. +func Convert_v1beta1_Bastion_To_v1alpha3_Bastion(in *infrav1beta1.Bastion, out *infrav1alpha3.Bastion, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1beta1_Bastion_To_v1alpha3_Bastion(in, out, s) } -// Convert_v1alpha3_NetworkSpec_To_v1alpha4_NetworkSpec is an autogenerated conversion function. -func Convert_v1alpha3_NetworkSpec_To_v1alpha4_NetworkSpec(in *infrav1alpha3.NetworkSpec, out *infrav1alpha4.NetworkSpec, s apiconversion.Scope) error { - return infrav1alpha3.Convert_v1alpha3_NetworkSpec_To_v1alpha4_NetworkSpec(in, out, s) +// Convert_v1alpha3_NetworkSpec_To_v1beta1_NetworkSpec is a conversion function. +func Convert_v1alpha3_NetworkSpec_To_v1beta1_NetworkSpec(in *infrav1alpha3.NetworkSpec, out *infrav1beta1.NetworkSpec, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1alpha3_NetworkSpec_To_v1beta1_NetworkSpec(in, out, s) } -// Convert_v1alpha4_NetworkSpec_To_v1alpha3_NetworkSpec is an autogenerated conversion function. -func Convert_v1alpha4_NetworkSpec_To_v1alpha3_NetworkSpec(in *infrav1alpha4.NetworkSpec, out *infrav1alpha3.NetworkSpec, s apiconversion.Scope) error { - return infrav1alpha3.Convert_v1alpha4_NetworkSpec_To_v1alpha3_NetworkSpec(in, out, s) +// Convert_v1beta1_NetworkSpec_To_v1alpha3_NetworkSpec is a conversion function. +func Convert_v1beta1_NetworkSpec_To_v1alpha3_NetworkSpec(in *infrav1beta1.NetworkSpec, out *infrav1alpha3.NetworkSpec, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1beta1_NetworkSpec_To_v1alpha3_NetworkSpec(in, out, s) } -// Convert_v1alpha4_Instance_To_v1alpha3_Instance is an autogenerated conversion function. -func Convert_v1alpha4_Instance_To_v1alpha3_Instance(in *infrav1alpha4.Instance, out *infrav1alpha3.Instance, s apiconversion.Scope) error { - return infrav1alpha3.Convert_v1alpha4_Instance_To_v1alpha3_Instance(in, out, s) +// Convert_v1beta1_Instance_To_v1alpha3_Instance is a conversion function. +func Convert_v1beta1_Instance_To_v1alpha3_Instance(in *infrav1beta1.Instance, out *infrav1alpha3.Instance, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1beta1_Instance_To_v1alpha3_Instance(in, out, s) } -// Convert_v1alpha3_Instance_To_v1alpha4_Instance is an autogenerated conversion function. -func Convert_v1alpha3_Instance_To_v1alpha4_Instance(in *infrav1alpha3.Instance, out *infrav1alpha4.Instance, s apiconversion.Scope) error { - return infrav1alpha3.Convert_v1alpha3_Instance_To_v1alpha4_Instance(in, out, s) +// Convert_v1alpha3_Instance_To_v1beta1_Instance is a conversion function. +func Convert_v1alpha3_Instance_To_v1beta1_Instance(in *infrav1alpha3.Instance, out *infrav1beta1.Instance, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1alpha3_Instance_To_v1beta1_Instance(in, out, s) } -// Convert_v1alpha3_Network_To_v1alpha4_NetworkStatus is an autogenerated conversion function. -func Convert_v1alpha3_Network_To_v1alpha4_NetworkStatus(in *infrav1alpha3.Network, out *infrav1alpha4.NetworkStatus, s apiconversion.Scope) error { - return infrav1alpha3.Convert_v1alpha3_Network_To_v1alpha4_NetworkStatus(in, out, s) +// Convert_v1alpha3_Network_To_v1beta1_NetworkStatus is a conversion function. +func Convert_v1alpha3_Network_To_v1beta1_NetworkStatus(in *infrav1alpha3.Network, out *infrav1beta1.NetworkStatus, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1alpha3_Network_To_v1beta1_NetworkStatus(in, out, s) } -// Convert_v1alpha4_NetworkStatus_To_v1alpha3_Network is an autogenerated conversion function. -func Convert_v1alpha4_NetworkStatus_To_v1alpha3_Network(in *infrav1alpha4.NetworkStatus, out *infrav1alpha3.Network, s apiconversion.Scope) error { - return infrav1alpha3.Convert_v1alpha4_NetworkStatus_To_v1alpha3_Network(in, out, s) +// Convert_v1beta1_NetworkStatus_To_v1alpha3_Network is a conversion function. +func Convert_v1beta1_NetworkStatus_To_v1alpha3_Network(in *infrav1beta1.NetworkStatus, out *infrav1alpha3.Network, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1beta1_NetworkStatus_To_v1alpha3_Network(in, out, s) } -func Convert_v1alpha4_AWSManagedControlPlaneSpec_To_v1alpha3_AWSManagedControlPlaneSpec(in *v1alpha4.AWSManagedControlPlaneSpec, out *AWSManagedControlPlaneSpec, scope apiconversion.Scope) error { - return autoConvert_v1alpha4_AWSManagedControlPlaneSpec_To_v1alpha3_AWSManagedControlPlaneSpec(in, out, scope) +func Convert_v1beta1_AWSManagedControlPlaneSpec_To_v1alpha3_AWSManagedControlPlaneSpec(in *v1beta1.AWSManagedControlPlaneSpec, out *AWSManagedControlPlaneSpec, scope apiconversion.Scope) error { + return autoConvert_v1beta1_AWSManagedControlPlaneSpec_To_v1alpha3_AWSManagedControlPlaneSpec(in, out, scope) } -func Convert_v1alpha4_AWSManagedControlPlaneStatus_To_v1alpha3_AWSManagedControlPlaneStatus(in *v1alpha4.AWSManagedControlPlaneStatus, out *AWSManagedControlPlaneStatus, scope apiconversion.Scope) error { - return autoConvert_v1alpha4_AWSManagedControlPlaneStatus_To_v1alpha3_AWSManagedControlPlaneStatus(in, out, scope) +func Convert_v1beta1_AWSManagedControlPlaneStatus_To_v1alpha3_AWSManagedControlPlaneStatus(in *v1beta1.AWSManagedControlPlaneStatus, out *AWSManagedControlPlaneStatus, scope apiconversion.Scope) error { + return autoConvert_v1beta1_AWSManagedControlPlaneStatus_To_v1alpha3_AWSManagedControlPlaneStatus(in, out, scope) } diff --git a/controlplane/eks/api/v1alpha3/conversion_test.go b/controlplane/eks/api/v1alpha3/conversion_test.go index b2a07541b5..806e546eb7 100644 --- a/controlplane/eks/api/v1alpha3/conversion_test.go +++ b/controlplane/eks/api/v1alpha3/conversion_test.go @@ -22,7 +22,7 @@ import ( . "github.com/onsi/gomega" runtime "k8s.io/apimachinery/pkg/runtime" - v1alpha4 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" ) @@ -30,11 +30,11 @@ func TestFuzzyConversion(t *testing.T) { g := NewWithT(t) scheme := runtime.NewScheme() g.Expect(AddToScheme(scheme)).To(Succeed()) - g.Expect(v1alpha4.AddToScheme(scheme)).To(Succeed()) + g.Expect(v1beta1.AddToScheme(scheme)).To(Succeed()) t.Run("for AWSManagedControlPlane", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ Scheme: scheme, - Hub: &v1alpha4.AWSManagedControlPlane{}, + Hub: &v1beta1.AWSManagedControlPlane{}, Spoke: &AWSManagedControlPlane{}, })) } diff --git a/controlplane/eks/api/v1alpha3/doc.go b/controlplane/eks/api/v1alpha3/doc.go index 489614382f..a5149b6de3 100644 --- a/controlplane/eks/api/v1alpha3/doc.go +++ b/controlplane/eks/api/v1alpha3/doc.go @@ -14,6 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4 +// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1 package v1alpha3 diff --git a/controlplane/eks/api/v1alpha3/types.go b/controlplane/eks/api/v1alpha3/types.go index f5dd7dd178..929331ba36 100644 --- a/controlplane/eks/api/v1alpha3/types.go +++ b/controlplane/eks/api/v1alpha3/types.go @@ -23,7 +23,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + infrav1alpha3 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" ) // ControlPlaneLoggingSpec defines what EKS control plane logs that should be enabled. @@ -83,7 +84,7 @@ var ( // DefaultEKSControlPlaneRole is the name of the default IAM role to use for the EKS control plane // if no other role is supplied in the spec and if iam role creation is not enabled. The default // can be created using clusterawsadm or created manually. - DefaultEKSControlPlaneRole = fmt.Sprintf("eks-controlplane%s", infrav1.DefaultNameSuffix) + DefaultEKSControlPlaneRole = fmt.Sprintf("eks-controlplane%s", iamv1.DefaultNameSuffix) ) // IAMAuthenticatorConfig represents an aws-iam-authenticator configuration. @@ -212,5 +213,5 @@ type AddonIssue struct { const ( // SecurityGroupCluster is the security group for communication between EKS // control plane and managed node groups. - SecurityGroupCluster = infrav1.SecurityGroupRole("cluster") + SecurityGroupCluster = infrav1alpha3.SecurityGroupRole("cluster") ) diff --git a/controlplane/eks/api/v1alpha3/webhook_suite_test.go b/controlplane/eks/api/v1alpha3/webhook_suite_test.go index d8b2c98f34..fbb3907155 100644 --- a/controlplane/eks/api/v1alpha3/webhook_suite_test.go +++ b/controlplane/eks/api/v1alpha3/webhook_suite_test.go @@ -24,7 +24,7 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - controlplanev1alpha4 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/test/helpers" ctrl "sigs.k8s.io/controller-runtime" // +kubebuilder:scaffold:imports @@ -45,7 +45,7 @@ func TestMain(m *testing.M) { func setup() { utilruntime.Must(AddToScheme(scheme.Scheme)) - utilruntime.Must(controlplanev1alpha4.AddToScheme(scheme.Scheme)) + utilruntime.Must(ekscontrolplanev1.AddToScheme(scheme.Scheme)) testEnvConfig := helpers.NewTestEnvironmentConfiguration([]string{ path.Join("..", "config", "crd", "bases"), @@ -56,7 +56,7 @@ func setup() { if err != nil { panic(err) } - if err := (&controlplanev1alpha4.AWSManagedControlPlane{}).SetupWebhookWithManager(testEnv); err != nil { + if err := (&ekscontrolplanev1.AWSManagedControlPlane{}).SetupWebhookWithManager(testEnv); err != nil { panic(fmt.Sprintf("Unable to setup AWSCluster webhook: %v", err)) } diff --git a/controlplane/eks/api/v1alpha3/zz_generated.conversion.go b/controlplane/eks/api/v1alpha3/zz_generated.conversion.go index b89878ec8c..3d63f27896 100644 --- a/controlplane/eks/api/v1alpha3/zz_generated.conversion.go +++ b/controlplane/eks/api/v1alpha3/zz_generated.conversion.go @@ -1,4 +1,4 @@ -// +build !ignore_autogenerated +// +build !ignore_autogenerated_conversions /* Copyright The Kubernetes Authors. @@ -25,11 +25,11 @@ import ( conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - clusterapiproviderawsapiv1alpha3 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" - clusterapiproviderawsapiv1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - v1alpha4 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" - apiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + apiv1alpha3 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + apiv1beta1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + clusterapiapiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" + clusterapiapiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func init() { @@ -39,248 +39,223 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*AWSManagedControlPlane)(nil), (*v1alpha4.AWSManagedControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane(a.(*AWSManagedControlPlane), b.(*v1alpha4.AWSManagedControlPlane), scope) + if err := s.AddGeneratedConversionFunc((*AWSManagedControlPlane)(nil), (*v1beta1.AWSManagedControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSManagedControlPlane_To_v1beta1_AWSManagedControlPlane(a.(*AWSManagedControlPlane), b.(*v1beta1.AWSManagedControlPlane), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedControlPlane)(nil), (*AWSManagedControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSManagedControlPlane_To_v1alpha3_AWSManagedControlPlane(a.(*v1alpha4.AWSManagedControlPlane), b.(*AWSManagedControlPlane), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSManagedControlPlane)(nil), (*AWSManagedControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSManagedControlPlane_To_v1alpha3_AWSManagedControlPlane(a.(*v1beta1.AWSManagedControlPlane), b.(*AWSManagedControlPlane), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSManagedControlPlaneList)(nil), (*v1alpha4.AWSManagedControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSManagedControlPlaneList_To_v1alpha4_AWSManagedControlPlaneList(a.(*AWSManagedControlPlaneList), b.(*v1alpha4.AWSManagedControlPlaneList), scope) + if err := s.AddGeneratedConversionFunc((*AWSManagedControlPlaneList)(nil), (*v1beta1.AWSManagedControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSManagedControlPlaneList_To_v1beta1_AWSManagedControlPlaneList(a.(*AWSManagedControlPlaneList), b.(*v1beta1.AWSManagedControlPlaneList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedControlPlaneList)(nil), (*AWSManagedControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSManagedControlPlaneList_To_v1alpha3_AWSManagedControlPlaneList(a.(*v1alpha4.AWSManagedControlPlaneList), b.(*AWSManagedControlPlaneList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSManagedControlPlaneList)(nil), (*AWSManagedControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSManagedControlPlaneList_To_v1alpha3_AWSManagedControlPlaneList(a.(*v1beta1.AWSManagedControlPlaneList), b.(*AWSManagedControlPlaneList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSManagedControlPlaneSpec)(nil), (*v1alpha4.AWSManagedControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSManagedControlPlaneSpec_To_v1alpha4_AWSManagedControlPlaneSpec(a.(*AWSManagedControlPlaneSpec), b.(*v1alpha4.AWSManagedControlPlaneSpec), scope) + if err := s.AddGeneratedConversionFunc((*AWSManagedControlPlaneSpec)(nil), (*v1beta1.AWSManagedControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSManagedControlPlaneSpec_To_v1beta1_AWSManagedControlPlaneSpec(a.(*AWSManagedControlPlaneSpec), b.(*v1beta1.AWSManagedControlPlaneSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSManagedControlPlaneStatus)(nil), (*v1alpha4.AWSManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSManagedControlPlaneStatus_To_v1alpha4_AWSManagedControlPlaneStatus(a.(*AWSManagedControlPlaneStatus), b.(*v1alpha4.AWSManagedControlPlaneStatus), scope) + if err := s.AddGeneratedConversionFunc((*AWSManagedControlPlaneStatus)(nil), (*v1beta1.AWSManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSManagedControlPlaneStatus_To_v1beta1_AWSManagedControlPlaneStatus(a.(*AWSManagedControlPlaneStatus), b.(*v1beta1.AWSManagedControlPlaneStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Addon)(nil), (*v1alpha4.Addon)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Addon_To_v1alpha4_Addon(a.(*Addon), b.(*v1alpha4.Addon), scope) + if err := s.AddGeneratedConversionFunc((*Addon)(nil), (*v1beta1.Addon)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Addon_To_v1beta1_Addon(a.(*Addon), b.(*v1beta1.Addon), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.Addon)(nil), (*Addon)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Addon_To_v1alpha3_Addon(a.(*v1alpha4.Addon), b.(*Addon), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.Addon)(nil), (*Addon)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Addon_To_v1alpha3_Addon(a.(*v1beta1.Addon), b.(*Addon), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AddonIssue)(nil), (*v1alpha4.AddonIssue)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AddonIssue_To_v1alpha4_AddonIssue(a.(*AddonIssue), b.(*v1alpha4.AddonIssue), scope) + if err := s.AddGeneratedConversionFunc((*AddonIssue)(nil), (*v1beta1.AddonIssue)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AddonIssue_To_v1beta1_AddonIssue(a.(*AddonIssue), b.(*v1beta1.AddonIssue), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AddonIssue)(nil), (*AddonIssue)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AddonIssue_To_v1alpha3_AddonIssue(a.(*v1alpha4.AddonIssue), b.(*AddonIssue), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AddonIssue)(nil), (*AddonIssue)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AddonIssue_To_v1alpha3_AddonIssue(a.(*v1beta1.AddonIssue), b.(*AddonIssue), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AddonState)(nil), (*v1alpha4.AddonState)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AddonState_To_v1alpha4_AddonState(a.(*AddonState), b.(*v1alpha4.AddonState), scope) + if err := s.AddGeneratedConversionFunc((*AddonState)(nil), (*v1beta1.AddonState)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AddonState_To_v1beta1_AddonState(a.(*AddonState), b.(*v1beta1.AddonState), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AddonState)(nil), (*AddonState)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AddonState_To_v1alpha3_AddonState(a.(*v1alpha4.AddonState), b.(*AddonState), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AddonState)(nil), (*AddonState)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AddonState_To_v1alpha3_AddonState(a.(*v1beta1.AddonState), b.(*AddonState), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ControlPlaneLoggingSpec)(nil), (*v1alpha4.ControlPlaneLoggingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ControlPlaneLoggingSpec_To_v1alpha4_ControlPlaneLoggingSpec(a.(*ControlPlaneLoggingSpec), b.(*v1alpha4.ControlPlaneLoggingSpec), scope) + if err := s.AddGeneratedConversionFunc((*ControlPlaneLoggingSpec)(nil), (*v1beta1.ControlPlaneLoggingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ControlPlaneLoggingSpec_To_v1beta1_ControlPlaneLoggingSpec(a.(*ControlPlaneLoggingSpec), b.(*v1beta1.ControlPlaneLoggingSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ControlPlaneLoggingSpec)(nil), (*ControlPlaneLoggingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ControlPlaneLoggingSpec_To_v1alpha3_ControlPlaneLoggingSpec(a.(*v1alpha4.ControlPlaneLoggingSpec), b.(*ControlPlaneLoggingSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ControlPlaneLoggingSpec)(nil), (*ControlPlaneLoggingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ControlPlaneLoggingSpec_To_v1alpha3_ControlPlaneLoggingSpec(a.(*v1beta1.ControlPlaneLoggingSpec), b.(*ControlPlaneLoggingSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*EncryptionConfig)(nil), (*v1alpha4.EncryptionConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_EncryptionConfig_To_v1alpha4_EncryptionConfig(a.(*EncryptionConfig), b.(*v1alpha4.EncryptionConfig), scope) + if err := s.AddGeneratedConversionFunc((*EncryptionConfig)(nil), (*v1beta1.EncryptionConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_EncryptionConfig_To_v1beta1_EncryptionConfig(a.(*EncryptionConfig), b.(*v1beta1.EncryptionConfig), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.EncryptionConfig)(nil), (*EncryptionConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_EncryptionConfig_To_v1alpha3_EncryptionConfig(a.(*v1alpha4.EncryptionConfig), b.(*EncryptionConfig), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.EncryptionConfig)(nil), (*EncryptionConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EncryptionConfig_To_v1alpha3_EncryptionConfig(a.(*v1beta1.EncryptionConfig), b.(*EncryptionConfig), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*EndpointAccess)(nil), (*v1alpha4.EndpointAccess)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_EndpointAccess_To_v1alpha4_EndpointAccess(a.(*EndpointAccess), b.(*v1alpha4.EndpointAccess), scope) + if err := s.AddGeneratedConversionFunc((*EndpointAccess)(nil), (*v1beta1.EndpointAccess)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_EndpointAccess_To_v1beta1_EndpointAccess(a.(*EndpointAccess), b.(*v1beta1.EndpointAccess), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.EndpointAccess)(nil), (*EndpointAccess)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_EndpointAccess_To_v1alpha3_EndpointAccess(a.(*v1alpha4.EndpointAccess), b.(*EndpointAccess), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.EndpointAccess)(nil), (*EndpointAccess)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EndpointAccess_To_v1alpha3_EndpointAccess(a.(*v1beta1.EndpointAccess), b.(*EndpointAccess), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*IAMAuthenticatorConfig)(nil), (*v1alpha4.IAMAuthenticatorConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_IAMAuthenticatorConfig_To_v1alpha4_IAMAuthenticatorConfig(a.(*IAMAuthenticatorConfig), b.(*v1alpha4.IAMAuthenticatorConfig), scope) + if err := s.AddGeneratedConversionFunc((*IAMAuthenticatorConfig)(nil), (*v1beta1.IAMAuthenticatorConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_IAMAuthenticatorConfig_To_v1beta1_IAMAuthenticatorConfig(a.(*IAMAuthenticatorConfig), b.(*v1beta1.IAMAuthenticatorConfig), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.IAMAuthenticatorConfig)(nil), (*IAMAuthenticatorConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_IAMAuthenticatorConfig_To_v1alpha3_IAMAuthenticatorConfig(a.(*v1alpha4.IAMAuthenticatorConfig), b.(*IAMAuthenticatorConfig), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.IAMAuthenticatorConfig)(nil), (*IAMAuthenticatorConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_IAMAuthenticatorConfig_To_v1alpha3_IAMAuthenticatorConfig(a.(*v1beta1.IAMAuthenticatorConfig), b.(*IAMAuthenticatorConfig), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*KubernetesMapping)(nil), (*v1alpha4.KubernetesMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_KubernetesMapping_To_v1alpha4_KubernetesMapping(a.(*KubernetesMapping), b.(*v1alpha4.KubernetesMapping), scope) + if err := s.AddGeneratedConversionFunc((*KubernetesMapping)(nil), (*v1beta1.KubernetesMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_KubernetesMapping_To_v1beta1_KubernetesMapping(a.(*KubernetesMapping), b.(*v1beta1.KubernetesMapping), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.KubernetesMapping)(nil), (*KubernetesMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_KubernetesMapping_To_v1alpha3_KubernetesMapping(a.(*v1alpha4.KubernetesMapping), b.(*KubernetesMapping), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.KubernetesMapping)(nil), (*KubernetesMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_KubernetesMapping_To_v1alpha3_KubernetesMapping(a.(*v1beta1.KubernetesMapping), b.(*KubernetesMapping), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*OIDCProviderStatus)(nil), (*v1alpha4.OIDCProviderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_OIDCProviderStatus_To_v1alpha4_OIDCProviderStatus(a.(*OIDCProviderStatus), b.(*v1alpha4.OIDCProviderStatus), scope) + if err := s.AddGeneratedConversionFunc((*OIDCProviderStatus)(nil), (*v1beta1.OIDCProviderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_OIDCProviderStatus_To_v1beta1_OIDCProviderStatus(a.(*OIDCProviderStatus), b.(*v1beta1.OIDCProviderStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.OIDCProviderStatus)(nil), (*OIDCProviderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_OIDCProviderStatus_To_v1alpha3_OIDCProviderStatus(a.(*v1alpha4.OIDCProviderStatus), b.(*OIDCProviderStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.OIDCProviderStatus)(nil), (*OIDCProviderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_OIDCProviderStatus_To_v1alpha3_OIDCProviderStatus(a.(*v1beta1.OIDCProviderStatus), b.(*OIDCProviderStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*RoleMapping)(nil), (*v1alpha4.RoleMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_RoleMapping_To_v1alpha4_RoleMapping(a.(*RoleMapping), b.(*v1alpha4.RoleMapping), scope) + if err := s.AddGeneratedConversionFunc((*RoleMapping)(nil), (*v1beta1.RoleMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_RoleMapping_To_v1beta1_RoleMapping(a.(*RoleMapping), b.(*v1beta1.RoleMapping), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.RoleMapping)(nil), (*RoleMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_RoleMapping_To_v1alpha3_RoleMapping(a.(*v1alpha4.RoleMapping), b.(*RoleMapping), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.RoleMapping)(nil), (*RoleMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_RoleMapping_To_v1alpha3_RoleMapping(a.(*v1beta1.RoleMapping), b.(*RoleMapping), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*UserMapping)(nil), (*v1alpha4.UserMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_UserMapping_To_v1alpha4_UserMapping(a.(*UserMapping), b.(*v1alpha4.UserMapping), scope) + if err := s.AddGeneratedConversionFunc((*UserMapping)(nil), (*v1beta1.UserMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_UserMapping_To_v1beta1_UserMapping(a.(*UserMapping), b.(*v1beta1.UserMapping), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.UserMapping)(nil), (*UserMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_UserMapping_To_v1alpha3_UserMapping(a.(*v1alpha4.UserMapping), b.(*UserMapping), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.UserMapping)(nil), (*UserMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_UserMapping_To_v1alpha3_UserMapping(a.(*v1beta1.UserMapping), b.(*UserMapping), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*apiv1alpha3.APIEndpoint)(nil), (*apiv1alpha4.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(a.(*apiv1alpha3.APIEndpoint), b.(*apiv1alpha4.APIEndpoint), scope) + if err := s.AddConversionFunc((*apiv1alpha3.Bastion)(nil), (*apiv1beta1.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Bastion_To_v1beta1_Bastion(a.(*apiv1alpha3.Bastion), b.(*apiv1beta1.Bastion), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha3.Bastion)(nil), (*clusterapiproviderawsapiv1alpha4.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Bastion_To_v1alpha4_Bastion(a.(*clusterapiproviderawsapiv1alpha3.Bastion), b.(*clusterapiproviderawsapiv1alpha4.Bastion), scope) + if err := s.AddConversionFunc((*apiv1alpha3.Instance)(nil), (*apiv1beta1.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Instance_To_v1beta1_Instance(a.(*apiv1alpha3.Instance), b.(*apiv1beta1.Instance), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha3.Instance)(nil), (*clusterapiproviderawsapiv1alpha4.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Instance_To_v1alpha4_Instance(a.(*clusterapiproviderawsapiv1alpha3.Instance), b.(*clusterapiproviderawsapiv1alpha4.Instance), scope) + if err := s.AddConversionFunc((*apiv1alpha3.NetworkSpec)(nil), (*apiv1beta1.NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_NetworkSpec_To_v1beta1_NetworkSpec(a.(*apiv1alpha3.NetworkSpec), b.(*apiv1beta1.NetworkSpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha3.NetworkSpec)(nil), (*clusterapiproviderawsapiv1alpha4.NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_NetworkSpec_To_v1alpha4_NetworkSpec(a.(*clusterapiproviderawsapiv1alpha3.NetworkSpec), b.(*clusterapiproviderawsapiv1alpha4.NetworkSpec), scope) + if err := s.AddConversionFunc((*v1beta1.AWSManagedControlPlaneSpec)(nil), (*AWSManagedControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSManagedControlPlaneSpec_To_v1alpha3_AWSManagedControlPlaneSpec(a.(*v1beta1.AWSManagedControlPlaneSpec), b.(*AWSManagedControlPlaneSpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha3.Network)(nil), (*clusterapiproviderawsapiv1alpha4.NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Network_To_v1alpha4_NetworkStatus(a.(*clusterapiproviderawsapiv1alpha3.Network), b.(*clusterapiproviderawsapiv1alpha4.NetworkStatus), scope) + if err := s.AddConversionFunc((*v1beta1.AWSManagedControlPlaneStatus)(nil), (*AWSManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSManagedControlPlaneStatus_To_v1alpha3_AWSManagedControlPlaneStatus(a.(*v1beta1.AWSManagedControlPlaneStatus), b.(*AWSManagedControlPlaneStatus), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*apiv1alpha4.APIEndpoint)(nil), (*apiv1alpha3.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(a.(*apiv1alpha4.APIEndpoint), b.(*apiv1alpha3.APIEndpoint), scope) + if err := s.AddConversionFunc((*apiv1beta1.Bastion)(nil), (*apiv1alpha3.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Bastion_To_v1alpha3_Bastion(a.(*apiv1beta1.Bastion), b.(*apiv1alpha3.Bastion), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*v1alpha4.AWSManagedControlPlaneSpec)(nil), (*AWSManagedControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSManagedControlPlaneSpec_To_v1alpha3_AWSManagedControlPlaneSpec(a.(*v1alpha4.AWSManagedControlPlaneSpec), b.(*AWSManagedControlPlaneSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1alpha4.AWSManagedControlPlaneStatus)(nil), (*AWSManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSManagedControlPlaneStatus_To_v1alpha3_AWSManagedControlPlaneStatus(a.(*v1alpha4.AWSManagedControlPlaneStatus), b.(*AWSManagedControlPlaneStatus), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha4.Bastion)(nil), (*clusterapiproviderawsapiv1alpha3.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Bastion_To_v1alpha3_Bastion(a.(*clusterapiproviderawsapiv1alpha4.Bastion), b.(*clusterapiproviderawsapiv1alpha3.Bastion), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha4.Instance)(nil), (*clusterapiproviderawsapiv1alpha3.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Instance_To_v1alpha3_Instance(a.(*clusterapiproviderawsapiv1alpha4.Instance), b.(*clusterapiproviderawsapiv1alpha3.Instance), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha4.NetworkSpec)(nil), (*clusterapiproviderawsapiv1alpha3.NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NetworkSpec_To_v1alpha3_NetworkSpec(a.(*clusterapiproviderawsapiv1alpha4.NetworkSpec), b.(*clusterapiproviderawsapiv1alpha3.NetworkSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha4.NetworkStatus)(nil), (*clusterapiproviderawsapiv1alpha3.Network)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_NetworkStatus_To_v1alpha3_Network(a.(*clusterapiproviderawsapiv1alpha4.NetworkStatus), b.(*clusterapiproviderawsapiv1alpha3.Network), scope) + if err := s.AddConversionFunc((*apiv1beta1.NetworkSpec)(nil), (*apiv1alpha3.NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_NetworkSpec_To_v1alpha3_NetworkSpec(a.(*apiv1beta1.NetworkSpec), b.(*apiv1alpha3.NetworkSpec), scope) }); err != nil { return err } return nil } -func autoConvert_v1alpha3_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane(in *AWSManagedControlPlane, out *v1alpha4.AWSManagedControlPlane, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSManagedControlPlane_To_v1beta1_AWSManagedControlPlane(in *AWSManagedControlPlane, out *v1beta1.AWSManagedControlPlane, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_AWSManagedControlPlaneSpec_To_v1alpha4_AWSManagedControlPlaneSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_AWSManagedControlPlaneSpec_To_v1beta1_AWSManagedControlPlaneSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha3_AWSManagedControlPlaneStatus_To_v1alpha4_AWSManagedControlPlaneStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_AWSManagedControlPlaneStatus_To_v1beta1_AWSManagedControlPlaneStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha3_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane is an autogenerated conversion function. -func Convert_v1alpha3_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane(in *AWSManagedControlPlane, out *v1alpha4.AWSManagedControlPlane, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane(in, out, s) +// Convert_v1alpha3_AWSManagedControlPlane_To_v1beta1_AWSManagedControlPlane is an autogenerated conversion function. +func Convert_v1alpha3_AWSManagedControlPlane_To_v1beta1_AWSManagedControlPlane(in *AWSManagedControlPlane, out *v1beta1.AWSManagedControlPlane, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSManagedControlPlane_To_v1beta1_AWSManagedControlPlane(in, out, s) } -func autoConvert_v1alpha4_AWSManagedControlPlane_To_v1alpha3_AWSManagedControlPlane(in *v1alpha4.AWSManagedControlPlane, out *AWSManagedControlPlane, s conversion.Scope) error { +func autoConvert_v1beta1_AWSManagedControlPlane_To_v1alpha3_AWSManagedControlPlane(in *v1beta1.AWSManagedControlPlane, out *AWSManagedControlPlane, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_AWSManagedControlPlaneSpec_To_v1alpha3_AWSManagedControlPlaneSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_AWSManagedControlPlaneSpec_To_v1alpha3_AWSManagedControlPlaneSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha4_AWSManagedControlPlaneStatus_To_v1alpha3_AWSManagedControlPlaneStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_AWSManagedControlPlaneStatus_To_v1alpha3_AWSManagedControlPlaneStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha4_AWSManagedControlPlane_To_v1alpha3_AWSManagedControlPlane is an autogenerated conversion function. -func Convert_v1alpha4_AWSManagedControlPlane_To_v1alpha3_AWSManagedControlPlane(in *v1alpha4.AWSManagedControlPlane, out *AWSManagedControlPlane, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSManagedControlPlane_To_v1alpha3_AWSManagedControlPlane(in, out, s) +// Convert_v1beta1_AWSManagedControlPlane_To_v1alpha3_AWSManagedControlPlane is an autogenerated conversion function. +func Convert_v1beta1_AWSManagedControlPlane_To_v1alpha3_AWSManagedControlPlane(in *v1beta1.AWSManagedControlPlane, out *AWSManagedControlPlane, s conversion.Scope) error { + return autoConvert_v1beta1_AWSManagedControlPlane_To_v1alpha3_AWSManagedControlPlane(in, out, s) } -func autoConvert_v1alpha3_AWSManagedControlPlaneList_To_v1alpha4_AWSManagedControlPlaneList(in *AWSManagedControlPlaneList, out *v1alpha4.AWSManagedControlPlaneList, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSManagedControlPlaneList_To_v1beta1_AWSManagedControlPlaneList(in *AWSManagedControlPlaneList, out *v1beta1.AWSManagedControlPlaneList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha4.AWSManagedControlPlane, len(*in)) + *out = make([]v1beta1.AWSManagedControlPlane, len(*in)) for i := range *in { - if err := Convert_v1alpha3_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_AWSManagedControlPlane_To_v1beta1_AWSManagedControlPlane(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -290,18 +265,18 @@ func autoConvert_v1alpha3_AWSManagedControlPlaneList_To_v1alpha4_AWSManagedContr return nil } -// Convert_v1alpha3_AWSManagedControlPlaneList_To_v1alpha4_AWSManagedControlPlaneList is an autogenerated conversion function. -func Convert_v1alpha3_AWSManagedControlPlaneList_To_v1alpha4_AWSManagedControlPlaneList(in *AWSManagedControlPlaneList, out *v1alpha4.AWSManagedControlPlaneList, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSManagedControlPlaneList_To_v1alpha4_AWSManagedControlPlaneList(in, out, s) +// Convert_v1alpha3_AWSManagedControlPlaneList_To_v1beta1_AWSManagedControlPlaneList is an autogenerated conversion function. +func Convert_v1alpha3_AWSManagedControlPlaneList_To_v1beta1_AWSManagedControlPlaneList(in *AWSManagedControlPlaneList, out *v1beta1.AWSManagedControlPlaneList, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSManagedControlPlaneList_To_v1beta1_AWSManagedControlPlaneList(in, out, s) } -func autoConvert_v1alpha4_AWSManagedControlPlaneList_To_v1alpha3_AWSManagedControlPlaneList(in *v1alpha4.AWSManagedControlPlaneList, out *AWSManagedControlPlaneList, s conversion.Scope) error { +func autoConvert_v1beta1_AWSManagedControlPlaneList_To_v1alpha3_AWSManagedControlPlaneList(in *v1beta1.AWSManagedControlPlaneList, out *AWSManagedControlPlaneList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]AWSManagedControlPlane, len(*in)) for i := range *in { - if err := Convert_v1alpha4_AWSManagedControlPlane_To_v1alpha3_AWSManagedControlPlane(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_AWSManagedControlPlane_To_v1alpha3_AWSManagedControlPlane(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -311,15 +286,15 @@ func autoConvert_v1alpha4_AWSManagedControlPlaneList_To_v1alpha3_AWSManagedContr return nil } -// Convert_v1alpha4_AWSManagedControlPlaneList_To_v1alpha3_AWSManagedControlPlaneList is an autogenerated conversion function. -func Convert_v1alpha4_AWSManagedControlPlaneList_To_v1alpha3_AWSManagedControlPlaneList(in *v1alpha4.AWSManagedControlPlaneList, out *AWSManagedControlPlaneList, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSManagedControlPlaneList_To_v1alpha3_AWSManagedControlPlaneList(in, out, s) +// Convert_v1beta1_AWSManagedControlPlaneList_To_v1alpha3_AWSManagedControlPlaneList is an autogenerated conversion function. +func Convert_v1beta1_AWSManagedControlPlaneList_To_v1alpha3_AWSManagedControlPlaneList(in *v1beta1.AWSManagedControlPlaneList, out *AWSManagedControlPlaneList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSManagedControlPlaneList_To_v1alpha3_AWSManagedControlPlaneList(in, out, s) } -func autoConvert_v1alpha3_AWSManagedControlPlaneSpec_To_v1alpha4_AWSManagedControlPlaneSpec(in *AWSManagedControlPlaneSpec, out *v1alpha4.AWSManagedControlPlaneSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSManagedControlPlaneSpec_To_v1beta1_AWSManagedControlPlaneSpec(in *AWSManagedControlPlaneSpec, out *v1beta1.AWSManagedControlPlaneSpec, s conversion.Scope) error { out.EKSClusterName = in.EKSClusterName - out.IdentityRef = (*clusterapiproviderawsapiv1alpha4.AWSIdentityReference)(unsafe.Pointer(in.IdentityRef)) - if err := Convert_v1alpha3_NetworkSpec_To_v1alpha4_NetworkSpec(&in.NetworkSpec, &out.NetworkSpec, s); err != nil { + out.IdentityRef = (*apiv1beta1.AWSIdentityReference)(unsafe.Pointer(in.IdentityRef)) + if err := Convert_v1alpha3_NetworkSpec_To_v1beta1_NetworkSpec(&in.NetworkSpec, &out.NetworkSpec, s); err != nil { return err } out.SecondaryCidrBlock = (*string)(unsafe.Pointer(in.SecondaryCidrBlock)) @@ -328,38 +303,38 @@ func autoConvert_v1alpha3_AWSManagedControlPlaneSpec_To_v1alpha4_AWSManagedContr out.Version = (*string)(unsafe.Pointer(in.Version)) out.RoleName = (*string)(unsafe.Pointer(in.RoleName)) out.RoleAdditionalPolicies = (*[]string)(unsafe.Pointer(in.RoleAdditionalPolicies)) - out.Logging = (*v1alpha4.ControlPlaneLoggingSpec)(unsafe.Pointer(in.Logging)) - out.EncryptionConfig = (*v1alpha4.EncryptionConfig)(unsafe.Pointer(in.EncryptionConfig)) - out.AdditionalTags = *(*clusterapiproviderawsapiv1alpha4.Tags)(unsafe.Pointer(&in.AdditionalTags)) - out.IAMAuthenticatorConfig = (*v1alpha4.IAMAuthenticatorConfig)(unsafe.Pointer(in.IAMAuthenticatorConfig)) - if err := Convert_v1alpha3_EndpointAccess_To_v1alpha4_EndpointAccess(&in.EndpointAccess, &out.EndpointAccess, s); err != nil { + out.Logging = (*v1beta1.ControlPlaneLoggingSpec)(unsafe.Pointer(in.Logging)) + out.EncryptionConfig = (*v1beta1.EncryptionConfig)(unsafe.Pointer(in.EncryptionConfig)) + out.AdditionalTags = *(*apiv1beta1.Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.IAMAuthenticatorConfig = (*v1beta1.IAMAuthenticatorConfig)(unsafe.Pointer(in.IAMAuthenticatorConfig)) + if err := Convert_v1alpha3_EndpointAccess_To_v1beta1_EndpointAccess(&in.EndpointAccess, &out.EndpointAccess, s); err != nil { return err } - if err := Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + if err := clusterapiapiv1alpha3.Convert_v1alpha3_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { return err } out.ImageLookupFormat = in.ImageLookupFormat out.ImageLookupOrg = in.ImageLookupOrg out.ImageLookupBaseOS = in.ImageLookupBaseOS - if err := Convert_v1alpha3_Bastion_To_v1alpha4_Bastion(&in.Bastion, &out.Bastion, s); err != nil { + if err := Convert_v1alpha3_Bastion_To_v1beta1_Bastion(&in.Bastion, &out.Bastion, s); err != nil { return err } - out.TokenMethod = (*v1alpha4.EKSTokenMethod)(unsafe.Pointer(in.TokenMethod)) + out.TokenMethod = (*v1beta1.EKSTokenMethod)(unsafe.Pointer(in.TokenMethod)) out.AssociateOIDCProvider = in.AssociateOIDCProvider - out.Addons = (*[]v1alpha4.Addon)(unsafe.Pointer(in.Addons)) + out.Addons = (*[]v1beta1.Addon)(unsafe.Pointer(in.Addons)) out.DisableVPCCNI = in.DisableVPCCNI return nil } -// Convert_v1alpha3_AWSManagedControlPlaneSpec_To_v1alpha4_AWSManagedControlPlaneSpec is an autogenerated conversion function. -func Convert_v1alpha3_AWSManagedControlPlaneSpec_To_v1alpha4_AWSManagedControlPlaneSpec(in *AWSManagedControlPlaneSpec, out *v1alpha4.AWSManagedControlPlaneSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSManagedControlPlaneSpec_To_v1alpha4_AWSManagedControlPlaneSpec(in, out, s) +// Convert_v1alpha3_AWSManagedControlPlaneSpec_To_v1beta1_AWSManagedControlPlaneSpec is an autogenerated conversion function. +func Convert_v1alpha3_AWSManagedControlPlaneSpec_To_v1beta1_AWSManagedControlPlaneSpec(in *AWSManagedControlPlaneSpec, out *v1beta1.AWSManagedControlPlaneSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSManagedControlPlaneSpec_To_v1beta1_AWSManagedControlPlaneSpec(in, out, s) } -func autoConvert_v1alpha4_AWSManagedControlPlaneSpec_To_v1alpha3_AWSManagedControlPlaneSpec(in *v1alpha4.AWSManagedControlPlaneSpec, out *AWSManagedControlPlaneSpec, s conversion.Scope) error { +func autoConvert_v1beta1_AWSManagedControlPlaneSpec_To_v1alpha3_AWSManagedControlPlaneSpec(in *v1beta1.AWSManagedControlPlaneSpec, out *AWSManagedControlPlaneSpec, s conversion.Scope) error { out.EKSClusterName = in.EKSClusterName - out.IdentityRef = (*clusterapiproviderawsapiv1alpha3.AWSIdentityReference)(unsafe.Pointer(in.IdentityRef)) - if err := Convert_v1alpha4_NetworkSpec_To_v1alpha3_NetworkSpec(&in.NetworkSpec, &out.NetworkSpec, s); err != nil { + out.IdentityRef = (*apiv1alpha3.AWSIdentityReference)(unsafe.Pointer(in.IdentityRef)) + if err := Convert_v1beta1_NetworkSpec_To_v1alpha3_NetworkSpec(&in.NetworkSpec, &out.NetworkSpec, s); err != nil { return err } out.SecondaryCidrBlock = (*string)(unsafe.Pointer(in.SecondaryCidrBlock)) @@ -370,18 +345,18 @@ func autoConvert_v1alpha4_AWSManagedControlPlaneSpec_To_v1alpha3_AWSManagedContr out.RoleAdditionalPolicies = (*[]string)(unsafe.Pointer(in.RoleAdditionalPolicies)) out.Logging = (*ControlPlaneLoggingSpec)(unsafe.Pointer(in.Logging)) out.EncryptionConfig = (*EncryptionConfig)(unsafe.Pointer(in.EncryptionConfig)) - out.AdditionalTags = *(*clusterapiproviderawsapiv1alpha3.Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.AdditionalTags = *(*apiv1alpha3.Tags)(unsafe.Pointer(&in.AdditionalTags)) out.IAMAuthenticatorConfig = (*IAMAuthenticatorConfig)(unsafe.Pointer(in.IAMAuthenticatorConfig)) - if err := Convert_v1alpha4_EndpointAccess_To_v1alpha3_EndpointAccess(&in.EndpointAccess, &out.EndpointAccess, s); err != nil { + if err := Convert_v1beta1_EndpointAccess_To_v1alpha3_EndpointAccess(&in.EndpointAccess, &out.EndpointAccess, s); err != nil { return err } - if err := Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + if err := clusterapiapiv1alpha3.Convert_v1beta1_APIEndpoint_To_v1alpha3_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { return err } out.ImageLookupFormat = in.ImageLookupFormat out.ImageLookupOrg = in.ImageLookupOrg out.ImageLookupBaseOS = in.ImageLookupBaseOS - if err := Convert_v1alpha4_Bastion_To_v1alpha3_Bastion(&in.Bastion, &out.Bastion, s); err != nil { + if err := Convert_v1beta1_Bastion_To_v1alpha3_Bastion(&in.Bastion, &out.Bastion, s); err != nil { return err } out.TokenMethod = (*EKSTokenMethod)(unsafe.Pointer(in.TokenMethod)) @@ -392,78 +367,122 @@ func autoConvert_v1alpha4_AWSManagedControlPlaneSpec_To_v1alpha3_AWSManagedContr return nil } -func autoConvert_v1alpha3_AWSManagedControlPlaneStatus_To_v1alpha4_AWSManagedControlPlaneStatus(in *AWSManagedControlPlaneStatus, out *v1alpha4.AWSManagedControlPlaneStatus, s conversion.Scope) error { - if err := Convert_v1alpha3_Network_To_v1alpha4_NetworkStatus(&in.Network, &out.Network, s); err != nil { +func autoConvert_v1alpha3_AWSManagedControlPlaneStatus_To_v1beta1_AWSManagedControlPlaneStatus(in *AWSManagedControlPlaneStatus, out *v1beta1.AWSManagedControlPlaneStatus, s conversion.Scope) error { + if err := apiv1alpha3.Convert_v1alpha3_Network_To_v1beta1_NetworkStatus(&in.Network, &out.Network, s); err != nil { return err } - out.FailureDomains = *(*apiv1alpha4.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make(clusterapiapiv1beta1.FailureDomains, len(*in)) + for key, val := range *in { + newVal := new(clusterapiapiv1beta1.FailureDomainSpec) + if err := clusterapiapiv1alpha3.Convert_v1alpha3_FailureDomainSpec_To_v1beta1_FailureDomainSpec(&val, newVal, s); err != nil { + return err + } + (*out)[key] = *newVal + } + } else { + out.FailureDomains = nil + } if in.Bastion != nil { in, out := &in.Bastion, &out.Bastion - *out = new(clusterapiproviderawsapiv1alpha4.Instance) - if err := Convert_v1alpha3_Instance_To_v1alpha4_Instance(*in, *out, s); err != nil { + *out = new(apiv1beta1.Instance) + if err := Convert_v1alpha3_Instance_To_v1beta1_Instance(*in, *out, s); err != nil { return err } } else { out.Bastion = nil } - if err := Convert_v1alpha3_OIDCProviderStatus_To_v1alpha4_OIDCProviderStatus(&in.OIDCProvider, &out.OIDCProvider, s); err != nil { + if err := Convert_v1alpha3_OIDCProviderStatus_To_v1beta1_OIDCProviderStatus(&in.OIDCProvider, &out.OIDCProvider, s); err != nil { return err } out.ExternalManagedControlPlane = (*bool)(unsafe.Pointer(in.ExternalManagedControlPlane)) out.Initialized = in.Initialized out.Ready = in.Ready out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*apiv1alpha4.Conditions)(unsafe.Pointer(&in.Conditions)) - out.Addons = *(*[]v1alpha4.AddonState)(unsafe.Pointer(&in.Addons)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(clusterapiapiv1beta1.Conditions, len(*in)) + for i := range *in { + if err := clusterapiapiv1alpha3.Convert_v1alpha3_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + out.Addons = *(*[]v1beta1.AddonState)(unsafe.Pointer(&in.Addons)) return nil } -// Convert_v1alpha3_AWSManagedControlPlaneStatus_To_v1alpha4_AWSManagedControlPlaneStatus is an autogenerated conversion function. -func Convert_v1alpha3_AWSManagedControlPlaneStatus_To_v1alpha4_AWSManagedControlPlaneStatus(in *AWSManagedControlPlaneStatus, out *v1alpha4.AWSManagedControlPlaneStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSManagedControlPlaneStatus_To_v1alpha4_AWSManagedControlPlaneStatus(in, out, s) +// Convert_v1alpha3_AWSManagedControlPlaneStatus_To_v1beta1_AWSManagedControlPlaneStatus is an autogenerated conversion function. +func Convert_v1alpha3_AWSManagedControlPlaneStatus_To_v1beta1_AWSManagedControlPlaneStatus(in *AWSManagedControlPlaneStatus, out *v1beta1.AWSManagedControlPlaneStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSManagedControlPlaneStatus_To_v1beta1_AWSManagedControlPlaneStatus(in, out, s) } -func autoConvert_v1alpha4_AWSManagedControlPlaneStatus_To_v1alpha3_AWSManagedControlPlaneStatus(in *v1alpha4.AWSManagedControlPlaneStatus, out *AWSManagedControlPlaneStatus, s conversion.Scope) error { - if err := Convert_v1alpha4_NetworkStatus_To_v1alpha3_Network(&in.Network, &out.Network, s); err != nil { +func autoConvert_v1beta1_AWSManagedControlPlaneStatus_To_v1alpha3_AWSManagedControlPlaneStatus(in *v1beta1.AWSManagedControlPlaneStatus, out *AWSManagedControlPlaneStatus, s conversion.Scope) error { + if err := apiv1alpha3.Convert_v1beta1_NetworkStatus_To_v1alpha3_Network(&in.Network, &out.Network, s); err != nil { return err } - out.FailureDomains = *(*apiv1alpha3.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make(clusterapiapiv1alpha3.FailureDomains, len(*in)) + for key, val := range *in { + newVal := new(clusterapiapiv1alpha3.FailureDomainSpec) + if err := clusterapiapiv1alpha3.Convert_v1beta1_FailureDomainSpec_To_v1alpha3_FailureDomainSpec(&val, newVal, s); err != nil { + return err + } + (*out)[key] = *newVal + } + } else { + out.FailureDomains = nil + } if in.Bastion != nil { in, out := &in.Bastion, &out.Bastion - *out = new(clusterapiproviderawsapiv1alpha3.Instance) - if err := Convert_v1alpha4_Instance_To_v1alpha3_Instance(*in, *out, s); err != nil { + *out = new(apiv1alpha3.Instance) + if err := apiv1alpha3.Convert_v1beta1_Instance_To_v1alpha3_Instance(*in, *out, s); err != nil { return err } } else { out.Bastion = nil } - if err := Convert_v1alpha4_OIDCProviderStatus_To_v1alpha3_OIDCProviderStatus(&in.OIDCProvider, &out.OIDCProvider, s); err != nil { + if err := Convert_v1beta1_OIDCProviderStatus_To_v1alpha3_OIDCProviderStatus(&in.OIDCProvider, &out.OIDCProvider, s); err != nil { return err } out.ExternalManagedControlPlane = (*bool)(unsafe.Pointer(in.ExternalManagedControlPlane)) out.Initialized = in.Initialized out.Ready = in.Ready out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*apiv1alpha3.Conditions)(unsafe.Pointer(&in.Conditions)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(clusterapiapiv1alpha3.Conditions, len(*in)) + for i := range *in { + if err := clusterapiapiv1alpha3.Convert_v1beta1_Condition_To_v1alpha3_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } out.Addons = *(*[]AddonState)(unsafe.Pointer(&in.Addons)) // WARNING: in.IdentityProviderStatus requires manual conversion: does not exist in peer-type return nil } -func autoConvert_v1alpha3_Addon_To_v1alpha4_Addon(in *Addon, out *v1alpha4.Addon, s conversion.Scope) error { +func autoConvert_v1alpha3_Addon_To_v1beta1_Addon(in *Addon, out *v1beta1.Addon, s conversion.Scope) error { out.Name = in.Name out.Version = in.Version - out.ConflictResolution = (*v1alpha4.AddonResolution)(unsafe.Pointer(in.ConflictResolution)) + out.ConflictResolution = (*v1beta1.AddonResolution)(unsafe.Pointer(in.ConflictResolution)) out.ServiceAccountRoleArn = (*string)(unsafe.Pointer(in.ServiceAccountRoleArn)) return nil } -// Convert_v1alpha3_Addon_To_v1alpha4_Addon is an autogenerated conversion function. -func Convert_v1alpha3_Addon_To_v1alpha4_Addon(in *Addon, out *v1alpha4.Addon, s conversion.Scope) error { - return autoConvert_v1alpha3_Addon_To_v1alpha4_Addon(in, out, s) +// Convert_v1alpha3_Addon_To_v1beta1_Addon is an autogenerated conversion function. +func Convert_v1alpha3_Addon_To_v1beta1_Addon(in *Addon, out *v1beta1.Addon, s conversion.Scope) error { + return autoConvert_v1alpha3_Addon_To_v1beta1_Addon(in, out, s) } -func autoConvert_v1alpha4_Addon_To_v1alpha3_Addon(in *v1alpha4.Addon, out *Addon, s conversion.Scope) error { +func autoConvert_v1beta1_Addon_To_v1alpha3_Addon(in *v1beta1.Addon, out *Addon, s conversion.Scope) error { out.Name = in.Name out.Version = in.Version out.ConflictResolution = (*AddonResolution)(unsafe.Pointer(in.ConflictResolution)) @@ -471,36 +490,36 @@ func autoConvert_v1alpha4_Addon_To_v1alpha3_Addon(in *v1alpha4.Addon, out *Addon return nil } -// Convert_v1alpha4_Addon_To_v1alpha3_Addon is an autogenerated conversion function. -func Convert_v1alpha4_Addon_To_v1alpha3_Addon(in *v1alpha4.Addon, out *Addon, s conversion.Scope) error { - return autoConvert_v1alpha4_Addon_To_v1alpha3_Addon(in, out, s) +// Convert_v1beta1_Addon_To_v1alpha3_Addon is an autogenerated conversion function. +func Convert_v1beta1_Addon_To_v1alpha3_Addon(in *v1beta1.Addon, out *Addon, s conversion.Scope) error { + return autoConvert_v1beta1_Addon_To_v1alpha3_Addon(in, out, s) } -func autoConvert_v1alpha3_AddonIssue_To_v1alpha4_AddonIssue(in *AddonIssue, out *v1alpha4.AddonIssue, s conversion.Scope) error { +func autoConvert_v1alpha3_AddonIssue_To_v1beta1_AddonIssue(in *AddonIssue, out *v1beta1.AddonIssue, s conversion.Scope) error { out.Code = (*string)(unsafe.Pointer(in.Code)) out.Message = (*string)(unsafe.Pointer(in.Message)) out.ResourceIDs = *(*[]string)(unsafe.Pointer(&in.ResourceIDs)) return nil } -// Convert_v1alpha3_AddonIssue_To_v1alpha4_AddonIssue is an autogenerated conversion function. -func Convert_v1alpha3_AddonIssue_To_v1alpha4_AddonIssue(in *AddonIssue, out *v1alpha4.AddonIssue, s conversion.Scope) error { - return autoConvert_v1alpha3_AddonIssue_To_v1alpha4_AddonIssue(in, out, s) +// Convert_v1alpha3_AddonIssue_To_v1beta1_AddonIssue is an autogenerated conversion function. +func Convert_v1alpha3_AddonIssue_To_v1beta1_AddonIssue(in *AddonIssue, out *v1beta1.AddonIssue, s conversion.Scope) error { + return autoConvert_v1alpha3_AddonIssue_To_v1beta1_AddonIssue(in, out, s) } -func autoConvert_v1alpha4_AddonIssue_To_v1alpha3_AddonIssue(in *v1alpha4.AddonIssue, out *AddonIssue, s conversion.Scope) error { +func autoConvert_v1beta1_AddonIssue_To_v1alpha3_AddonIssue(in *v1beta1.AddonIssue, out *AddonIssue, s conversion.Scope) error { out.Code = (*string)(unsafe.Pointer(in.Code)) out.Message = (*string)(unsafe.Pointer(in.Message)) out.ResourceIDs = *(*[]string)(unsafe.Pointer(&in.ResourceIDs)) return nil } -// Convert_v1alpha4_AddonIssue_To_v1alpha3_AddonIssue is an autogenerated conversion function. -func Convert_v1alpha4_AddonIssue_To_v1alpha3_AddonIssue(in *v1alpha4.AddonIssue, out *AddonIssue, s conversion.Scope) error { - return autoConvert_v1alpha4_AddonIssue_To_v1alpha3_AddonIssue(in, out, s) +// Convert_v1beta1_AddonIssue_To_v1alpha3_AddonIssue is an autogenerated conversion function. +func Convert_v1beta1_AddonIssue_To_v1alpha3_AddonIssue(in *v1beta1.AddonIssue, out *AddonIssue, s conversion.Scope) error { + return autoConvert_v1beta1_AddonIssue_To_v1alpha3_AddonIssue(in, out, s) } -func autoConvert_v1alpha3_AddonState_To_v1alpha4_AddonState(in *AddonState, out *v1alpha4.AddonState, s conversion.Scope) error { +func autoConvert_v1alpha3_AddonState_To_v1beta1_AddonState(in *AddonState, out *v1beta1.AddonState, s conversion.Scope) error { out.Name = in.Name out.Version = in.Version out.ARN = in.ARN @@ -508,16 +527,16 @@ func autoConvert_v1alpha3_AddonState_To_v1alpha4_AddonState(in *AddonState, out out.CreatedAt = in.CreatedAt out.ModifiedAt = in.ModifiedAt out.Status = (*string)(unsafe.Pointer(in.Status)) - out.Issues = *(*[]v1alpha4.AddonIssue)(unsafe.Pointer(&in.Issues)) + out.Issues = *(*[]v1beta1.AddonIssue)(unsafe.Pointer(&in.Issues)) return nil } -// Convert_v1alpha3_AddonState_To_v1alpha4_AddonState is an autogenerated conversion function. -func Convert_v1alpha3_AddonState_To_v1alpha4_AddonState(in *AddonState, out *v1alpha4.AddonState, s conversion.Scope) error { - return autoConvert_v1alpha3_AddonState_To_v1alpha4_AddonState(in, out, s) +// Convert_v1alpha3_AddonState_To_v1beta1_AddonState is an autogenerated conversion function. +func Convert_v1alpha3_AddonState_To_v1beta1_AddonState(in *AddonState, out *v1beta1.AddonState, s conversion.Scope) error { + return autoConvert_v1alpha3_AddonState_To_v1beta1_AddonState(in, out, s) } -func autoConvert_v1alpha4_AddonState_To_v1alpha3_AddonState(in *v1alpha4.AddonState, out *AddonState, s conversion.Scope) error { +func autoConvert_v1beta1_AddonState_To_v1alpha3_AddonState(in *v1beta1.AddonState, out *AddonState, s conversion.Scope) error { out.Name = in.Name out.Version = in.Version out.ARN = in.ARN @@ -529,12 +548,12 @@ func autoConvert_v1alpha4_AddonState_To_v1alpha3_AddonState(in *v1alpha4.AddonSt return nil } -// Convert_v1alpha4_AddonState_To_v1alpha3_AddonState is an autogenerated conversion function. -func Convert_v1alpha4_AddonState_To_v1alpha3_AddonState(in *v1alpha4.AddonState, out *AddonState, s conversion.Scope) error { - return autoConvert_v1alpha4_AddonState_To_v1alpha3_AddonState(in, out, s) +// Convert_v1beta1_AddonState_To_v1alpha3_AddonState is an autogenerated conversion function. +func Convert_v1beta1_AddonState_To_v1alpha3_AddonState(in *v1beta1.AddonState, out *AddonState, s conversion.Scope) error { + return autoConvert_v1beta1_AddonState_To_v1alpha3_AddonState(in, out, s) } -func autoConvert_v1alpha3_ControlPlaneLoggingSpec_To_v1alpha4_ControlPlaneLoggingSpec(in *ControlPlaneLoggingSpec, out *v1alpha4.ControlPlaneLoggingSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_ControlPlaneLoggingSpec_To_v1beta1_ControlPlaneLoggingSpec(in *ControlPlaneLoggingSpec, out *v1beta1.ControlPlaneLoggingSpec, s conversion.Scope) error { out.APIServer = in.APIServer out.Audit = in.Audit out.Authenticator = in.Authenticator @@ -543,12 +562,12 @@ func autoConvert_v1alpha3_ControlPlaneLoggingSpec_To_v1alpha4_ControlPlaneLoggin return nil } -// Convert_v1alpha3_ControlPlaneLoggingSpec_To_v1alpha4_ControlPlaneLoggingSpec is an autogenerated conversion function. -func Convert_v1alpha3_ControlPlaneLoggingSpec_To_v1alpha4_ControlPlaneLoggingSpec(in *ControlPlaneLoggingSpec, out *v1alpha4.ControlPlaneLoggingSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_ControlPlaneLoggingSpec_To_v1alpha4_ControlPlaneLoggingSpec(in, out, s) +// Convert_v1alpha3_ControlPlaneLoggingSpec_To_v1beta1_ControlPlaneLoggingSpec is an autogenerated conversion function. +func Convert_v1alpha3_ControlPlaneLoggingSpec_To_v1beta1_ControlPlaneLoggingSpec(in *ControlPlaneLoggingSpec, out *v1beta1.ControlPlaneLoggingSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_ControlPlaneLoggingSpec_To_v1beta1_ControlPlaneLoggingSpec(in, out, s) } -func autoConvert_v1alpha4_ControlPlaneLoggingSpec_To_v1alpha3_ControlPlaneLoggingSpec(in *v1alpha4.ControlPlaneLoggingSpec, out *ControlPlaneLoggingSpec, s conversion.Scope) error { +func autoConvert_v1beta1_ControlPlaneLoggingSpec_To_v1alpha3_ControlPlaneLoggingSpec(in *v1beta1.ControlPlaneLoggingSpec, out *ControlPlaneLoggingSpec, s conversion.Scope) error { out.APIServer = in.APIServer out.Audit = in.Audit out.Authenticator = in.Authenticator @@ -557,171 +576,171 @@ func autoConvert_v1alpha4_ControlPlaneLoggingSpec_To_v1alpha3_ControlPlaneLoggin return nil } -// Convert_v1alpha4_ControlPlaneLoggingSpec_To_v1alpha3_ControlPlaneLoggingSpec is an autogenerated conversion function. -func Convert_v1alpha4_ControlPlaneLoggingSpec_To_v1alpha3_ControlPlaneLoggingSpec(in *v1alpha4.ControlPlaneLoggingSpec, out *ControlPlaneLoggingSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_ControlPlaneLoggingSpec_To_v1alpha3_ControlPlaneLoggingSpec(in, out, s) +// Convert_v1beta1_ControlPlaneLoggingSpec_To_v1alpha3_ControlPlaneLoggingSpec is an autogenerated conversion function. +func Convert_v1beta1_ControlPlaneLoggingSpec_To_v1alpha3_ControlPlaneLoggingSpec(in *v1beta1.ControlPlaneLoggingSpec, out *ControlPlaneLoggingSpec, s conversion.Scope) error { + return autoConvert_v1beta1_ControlPlaneLoggingSpec_To_v1alpha3_ControlPlaneLoggingSpec(in, out, s) } -func autoConvert_v1alpha3_EncryptionConfig_To_v1alpha4_EncryptionConfig(in *EncryptionConfig, out *v1alpha4.EncryptionConfig, s conversion.Scope) error { +func autoConvert_v1alpha3_EncryptionConfig_To_v1beta1_EncryptionConfig(in *EncryptionConfig, out *v1beta1.EncryptionConfig, s conversion.Scope) error { out.Provider = (*string)(unsafe.Pointer(in.Provider)) out.Resources = *(*[]*string)(unsafe.Pointer(&in.Resources)) return nil } -// Convert_v1alpha3_EncryptionConfig_To_v1alpha4_EncryptionConfig is an autogenerated conversion function. -func Convert_v1alpha3_EncryptionConfig_To_v1alpha4_EncryptionConfig(in *EncryptionConfig, out *v1alpha4.EncryptionConfig, s conversion.Scope) error { - return autoConvert_v1alpha3_EncryptionConfig_To_v1alpha4_EncryptionConfig(in, out, s) +// Convert_v1alpha3_EncryptionConfig_To_v1beta1_EncryptionConfig is an autogenerated conversion function. +func Convert_v1alpha3_EncryptionConfig_To_v1beta1_EncryptionConfig(in *EncryptionConfig, out *v1beta1.EncryptionConfig, s conversion.Scope) error { + return autoConvert_v1alpha3_EncryptionConfig_To_v1beta1_EncryptionConfig(in, out, s) } -func autoConvert_v1alpha4_EncryptionConfig_To_v1alpha3_EncryptionConfig(in *v1alpha4.EncryptionConfig, out *EncryptionConfig, s conversion.Scope) error { +func autoConvert_v1beta1_EncryptionConfig_To_v1alpha3_EncryptionConfig(in *v1beta1.EncryptionConfig, out *EncryptionConfig, s conversion.Scope) error { out.Provider = (*string)(unsafe.Pointer(in.Provider)) out.Resources = *(*[]*string)(unsafe.Pointer(&in.Resources)) return nil } -// Convert_v1alpha4_EncryptionConfig_To_v1alpha3_EncryptionConfig is an autogenerated conversion function. -func Convert_v1alpha4_EncryptionConfig_To_v1alpha3_EncryptionConfig(in *v1alpha4.EncryptionConfig, out *EncryptionConfig, s conversion.Scope) error { - return autoConvert_v1alpha4_EncryptionConfig_To_v1alpha3_EncryptionConfig(in, out, s) +// Convert_v1beta1_EncryptionConfig_To_v1alpha3_EncryptionConfig is an autogenerated conversion function. +func Convert_v1beta1_EncryptionConfig_To_v1alpha3_EncryptionConfig(in *v1beta1.EncryptionConfig, out *EncryptionConfig, s conversion.Scope) error { + return autoConvert_v1beta1_EncryptionConfig_To_v1alpha3_EncryptionConfig(in, out, s) } -func autoConvert_v1alpha3_EndpointAccess_To_v1alpha4_EndpointAccess(in *EndpointAccess, out *v1alpha4.EndpointAccess, s conversion.Scope) error { +func autoConvert_v1alpha3_EndpointAccess_To_v1beta1_EndpointAccess(in *EndpointAccess, out *v1beta1.EndpointAccess, s conversion.Scope) error { out.Public = (*bool)(unsafe.Pointer(in.Public)) out.PublicCIDRs = *(*[]*string)(unsafe.Pointer(&in.PublicCIDRs)) out.Private = (*bool)(unsafe.Pointer(in.Private)) return nil } -// Convert_v1alpha3_EndpointAccess_To_v1alpha4_EndpointAccess is an autogenerated conversion function. -func Convert_v1alpha3_EndpointAccess_To_v1alpha4_EndpointAccess(in *EndpointAccess, out *v1alpha4.EndpointAccess, s conversion.Scope) error { - return autoConvert_v1alpha3_EndpointAccess_To_v1alpha4_EndpointAccess(in, out, s) +// Convert_v1alpha3_EndpointAccess_To_v1beta1_EndpointAccess is an autogenerated conversion function. +func Convert_v1alpha3_EndpointAccess_To_v1beta1_EndpointAccess(in *EndpointAccess, out *v1beta1.EndpointAccess, s conversion.Scope) error { + return autoConvert_v1alpha3_EndpointAccess_To_v1beta1_EndpointAccess(in, out, s) } -func autoConvert_v1alpha4_EndpointAccess_To_v1alpha3_EndpointAccess(in *v1alpha4.EndpointAccess, out *EndpointAccess, s conversion.Scope) error { +func autoConvert_v1beta1_EndpointAccess_To_v1alpha3_EndpointAccess(in *v1beta1.EndpointAccess, out *EndpointAccess, s conversion.Scope) error { out.Public = (*bool)(unsafe.Pointer(in.Public)) out.PublicCIDRs = *(*[]*string)(unsafe.Pointer(&in.PublicCIDRs)) out.Private = (*bool)(unsafe.Pointer(in.Private)) return nil } -// Convert_v1alpha4_EndpointAccess_To_v1alpha3_EndpointAccess is an autogenerated conversion function. -func Convert_v1alpha4_EndpointAccess_To_v1alpha3_EndpointAccess(in *v1alpha4.EndpointAccess, out *EndpointAccess, s conversion.Scope) error { - return autoConvert_v1alpha4_EndpointAccess_To_v1alpha3_EndpointAccess(in, out, s) +// Convert_v1beta1_EndpointAccess_To_v1alpha3_EndpointAccess is an autogenerated conversion function. +func Convert_v1beta1_EndpointAccess_To_v1alpha3_EndpointAccess(in *v1beta1.EndpointAccess, out *EndpointAccess, s conversion.Scope) error { + return autoConvert_v1beta1_EndpointAccess_To_v1alpha3_EndpointAccess(in, out, s) } -func autoConvert_v1alpha3_IAMAuthenticatorConfig_To_v1alpha4_IAMAuthenticatorConfig(in *IAMAuthenticatorConfig, out *v1alpha4.IAMAuthenticatorConfig, s conversion.Scope) error { - out.RoleMappings = *(*[]v1alpha4.RoleMapping)(unsafe.Pointer(&in.RoleMappings)) - out.UserMappings = *(*[]v1alpha4.UserMapping)(unsafe.Pointer(&in.UserMappings)) +func autoConvert_v1alpha3_IAMAuthenticatorConfig_To_v1beta1_IAMAuthenticatorConfig(in *IAMAuthenticatorConfig, out *v1beta1.IAMAuthenticatorConfig, s conversion.Scope) error { + out.RoleMappings = *(*[]v1beta1.RoleMapping)(unsafe.Pointer(&in.RoleMappings)) + out.UserMappings = *(*[]v1beta1.UserMapping)(unsafe.Pointer(&in.UserMappings)) return nil } -// Convert_v1alpha3_IAMAuthenticatorConfig_To_v1alpha4_IAMAuthenticatorConfig is an autogenerated conversion function. -func Convert_v1alpha3_IAMAuthenticatorConfig_To_v1alpha4_IAMAuthenticatorConfig(in *IAMAuthenticatorConfig, out *v1alpha4.IAMAuthenticatorConfig, s conversion.Scope) error { - return autoConvert_v1alpha3_IAMAuthenticatorConfig_To_v1alpha4_IAMAuthenticatorConfig(in, out, s) +// Convert_v1alpha3_IAMAuthenticatorConfig_To_v1beta1_IAMAuthenticatorConfig is an autogenerated conversion function. +func Convert_v1alpha3_IAMAuthenticatorConfig_To_v1beta1_IAMAuthenticatorConfig(in *IAMAuthenticatorConfig, out *v1beta1.IAMAuthenticatorConfig, s conversion.Scope) error { + return autoConvert_v1alpha3_IAMAuthenticatorConfig_To_v1beta1_IAMAuthenticatorConfig(in, out, s) } -func autoConvert_v1alpha4_IAMAuthenticatorConfig_To_v1alpha3_IAMAuthenticatorConfig(in *v1alpha4.IAMAuthenticatorConfig, out *IAMAuthenticatorConfig, s conversion.Scope) error { +func autoConvert_v1beta1_IAMAuthenticatorConfig_To_v1alpha3_IAMAuthenticatorConfig(in *v1beta1.IAMAuthenticatorConfig, out *IAMAuthenticatorConfig, s conversion.Scope) error { out.RoleMappings = *(*[]RoleMapping)(unsafe.Pointer(&in.RoleMappings)) out.UserMappings = *(*[]UserMapping)(unsafe.Pointer(&in.UserMappings)) return nil } -// Convert_v1alpha4_IAMAuthenticatorConfig_To_v1alpha3_IAMAuthenticatorConfig is an autogenerated conversion function. -func Convert_v1alpha4_IAMAuthenticatorConfig_To_v1alpha3_IAMAuthenticatorConfig(in *v1alpha4.IAMAuthenticatorConfig, out *IAMAuthenticatorConfig, s conversion.Scope) error { - return autoConvert_v1alpha4_IAMAuthenticatorConfig_To_v1alpha3_IAMAuthenticatorConfig(in, out, s) +// Convert_v1beta1_IAMAuthenticatorConfig_To_v1alpha3_IAMAuthenticatorConfig is an autogenerated conversion function. +func Convert_v1beta1_IAMAuthenticatorConfig_To_v1alpha3_IAMAuthenticatorConfig(in *v1beta1.IAMAuthenticatorConfig, out *IAMAuthenticatorConfig, s conversion.Scope) error { + return autoConvert_v1beta1_IAMAuthenticatorConfig_To_v1alpha3_IAMAuthenticatorConfig(in, out, s) } -func autoConvert_v1alpha3_KubernetesMapping_To_v1alpha4_KubernetesMapping(in *KubernetesMapping, out *v1alpha4.KubernetesMapping, s conversion.Scope) error { +func autoConvert_v1alpha3_KubernetesMapping_To_v1beta1_KubernetesMapping(in *KubernetesMapping, out *v1beta1.KubernetesMapping, s conversion.Scope) error { out.UserName = in.UserName out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) return nil } -// Convert_v1alpha3_KubernetesMapping_To_v1alpha4_KubernetesMapping is an autogenerated conversion function. -func Convert_v1alpha3_KubernetesMapping_To_v1alpha4_KubernetesMapping(in *KubernetesMapping, out *v1alpha4.KubernetesMapping, s conversion.Scope) error { - return autoConvert_v1alpha3_KubernetesMapping_To_v1alpha4_KubernetesMapping(in, out, s) +// Convert_v1alpha3_KubernetesMapping_To_v1beta1_KubernetesMapping is an autogenerated conversion function. +func Convert_v1alpha3_KubernetesMapping_To_v1beta1_KubernetesMapping(in *KubernetesMapping, out *v1beta1.KubernetesMapping, s conversion.Scope) error { + return autoConvert_v1alpha3_KubernetesMapping_To_v1beta1_KubernetesMapping(in, out, s) } -func autoConvert_v1alpha4_KubernetesMapping_To_v1alpha3_KubernetesMapping(in *v1alpha4.KubernetesMapping, out *KubernetesMapping, s conversion.Scope) error { +func autoConvert_v1beta1_KubernetesMapping_To_v1alpha3_KubernetesMapping(in *v1beta1.KubernetesMapping, out *KubernetesMapping, s conversion.Scope) error { out.UserName = in.UserName out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) return nil } -// Convert_v1alpha4_KubernetesMapping_To_v1alpha3_KubernetesMapping is an autogenerated conversion function. -func Convert_v1alpha4_KubernetesMapping_To_v1alpha3_KubernetesMapping(in *v1alpha4.KubernetesMapping, out *KubernetesMapping, s conversion.Scope) error { - return autoConvert_v1alpha4_KubernetesMapping_To_v1alpha3_KubernetesMapping(in, out, s) +// Convert_v1beta1_KubernetesMapping_To_v1alpha3_KubernetesMapping is an autogenerated conversion function. +func Convert_v1beta1_KubernetesMapping_To_v1alpha3_KubernetesMapping(in *v1beta1.KubernetesMapping, out *KubernetesMapping, s conversion.Scope) error { + return autoConvert_v1beta1_KubernetesMapping_To_v1alpha3_KubernetesMapping(in, out, s) } -func autoConvert_v1alpha3_OIDCProviderStatus_To_v1alpha4_OIDCProviderStatus(in *OIDCProviderStatus, out *v1alpha4.OIDCProviderStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_OIDCProviderStatus_To_v1beta1_OIDCProviderStatus(in *OIDCProviderStatus, out *v1beta1.OIDCProviderStatus, s conversion.Scope) error { out.ARN = in.ARN out.TrustPolicy = in.TrustPolicy return nil } -// Convert_v1alpha3_OIDCProviderStatus_To_v1alpha4_OIDCProviderStatus is an autogenerated conversion function. -func Convert_v1alpha3_OIDCProviderStatus_To_v1alpha4_OIDCProviderStatus(in *OIDCProviderStatus, out *v1alpha4.OIDCProviderStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_OIDCProviderStatus_To_v1alpha4_OIDCProviderStatus(in, out, s) +// Convert_v1alpha3_OIDCProviderStatus_To_v1beta1_OIDCProviderStatus is an autogenerated conversion function. +func Convert_v1alpha3_OIDCProviderStatus_To_v1beta1_OIDCProviderStatus(in *OIDCProviderStatus, out *v1beta1.OIDCProviderStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_OIDCProviderStatus_To_v1beta1_OIDCProviderStatus(in, out, s) } -func autoConvert_v1alpha4_OIDCProviderStatus_To_v1alpha3_OIDCProviderStatus(in *v1alpha4.OIDCProviderStatus, out *OIDCProviderStatus, s conversion.Scope) error { +func autoConvert_v1beta1_OIDCProviderStatus_To_v1alpha3_OIDCProviderStatus(in *v1beta1.OIDCProviderStatus, out *OIDCProviderStatus, s conversion.Scope) error { out.ARN = in.ARN out.TrustPolicy = in.TrustPolicy return nil } -// Convert_v1alpha4_OIDCProviderStatus_To_v1alpha3_OIDCProviderStatus is an autogenerated conversion function. -func Convert_v1alpha4_OIDCProviderStatus_To_v1alpha3_OIDCProviderStatus(in *v1alpha4.OIDCProviderStatus, out *OIDCProviderStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_OIDCProviderStatus_To_v1alpha3_OIDCProviderStatus(in, out, s) +// Convert_v1beta1_OIDCProviderStatus_To_v1alpha3_OIDCProviderStatus is an autogenerated conversion function. +func Convert_v1beta1_OIDCProviderStatus_To_v1alpha3_OIDCProviderStatus(in *v1beta1.OIDCProviderStatus, out *OIDCProviderStatus, s conversion.Scope) error { + return autoConvert_v1beta1_OIDCProviderStatus_To_v1alpha3_OIDCProviderStatus(in, out, s) } -func autoConvert_v1alpha3_RoleMapping_To_v1alpha4_RoleMapping(in *RoleMapping, out *v1alpha4.RoleMapping, s conversion.Scope) error { +func autoConvert_v1alpha3_RoleMapping_To_v1beta1_RoleMapping(in *RoleMapping, out *v1beta1.RoleMapping, s conversion.Scope) error { out.RoleARN = in.RoleARN - if err := Convert_v1alpha3_KubernetesMapping_To_v1alpha4_KubernetesMapping(&in.KubernetesMapping, &out.KubernetesMapping, s); err != nil { + if err := Convert_v1alpha3_KubernetesMapping_To_v1beta1_KubernetesMapping(&in.KubernetesMapping, &out.KubernetesMapping, s); err != nil { return err } return nil } -// Convert_v1alpha3_RoleMapping_To_v1alpha4_RoleMapping is an autogenerated conversion function. -func Convert_v1alpha3_RoleMapping_To_v1alpha4_RoleMapping(in *RoleMapping, out *v1alpha4.RoleMapping, s conversion.Scope) error { - return autoConvert_v1alpha3_RoleMapping_To_v1alpha4_RoleMapping(in, out, s) +// Convert_v1alpha3_RoleMapping_To_v1beta1_RoleMapping is an autogenerated conversion function. +func Convert_v1alpha3_RoleMapping_To_v1beta1_RoleMapping(in *RoleMapping, out *v1beta1.RoleMapping, s conversion.Scope) error { + return autoConvert_v1alpha3_RoleMapping_To_v1beta1_RoleMapping(in, out, s) } -func autoConvert_v1alpha4_RoleMapping_To_v1alpha3_RoleMapping(in *v1alpha4.RoleMapping, out *RoleMapping, s conversion.Scope) error { +func autoConvert_v1beta1_RoleMapping_To_v1alpha3_RoleMapping(in *v1beta1.RoleMapping, out *RoleMapping, s conversion.Scope) error { out.RoleARN = in.RoleARN - if err := Convert_v1alpha4_KubernetesMapping_To_v1alpha3_KubernetesMapping(&in.KubernetesMapping, &out.KubernetesMapping, s); err != nil { + if err := Convert_v1beta1_KubernetesMapping_To_v1alpha3_KubernetesMapping(&in.KubernetesMapping, &out.KubernetesMapping, s); err != nil { return err } return nil } -// Convert_v1alpha4_RoleMapping_To_v1alpha3_RoleMapping is an autogenerated conversion function. -func Convert_v1alpha4_RoleMapping_To_v1alpha3_RoleMapping(in *v1alpha4.RoleMapping, out *RoleMapping, s conversion.Scope) error { - return autoConvert_v1alpha4_RoleMapping_To_v1alpha3_RoleMapping(in, out, s) +// Convert_v1beta1_RoleMapping_To_v1alpha3_RoleMapping is an autogenerated conversion function. +func Convert_v1beta1_RoleMapping_To_v1alpha3_RoleMapping(in *v1beta1.RoleMapping, out *RoleMapping, s conversion.Scope) error { + return autoConvert_v1beta1_RoleMapping_To_v1alpha3_RoleMapping(in, out, s) } -func autoConvert_v1alpha3_UserMapping_To_v1alpha4_UserMapping(in *UserMapping, out *v1alpha4.UserMapping, s conversion.Scope) error { +func autoConvert_v1alpha3_UserMapping_To_v1beta1_UserMapping(in *UserMapping, out *v1beta1.UserMapping, s conversion.Scope) error { out.UserARN = in.UserARN - if err := Convert_v1alpha3_KubernetesMapping_To_v1alpha4_KubernetesMapping(&in.KubernetesMapping, &out.KubernetesMapping, s); err != nil { + if err := Convert_v1alpha3_KubernetesMapping_To_v1beta1_KubernetesMapping(&in.KubernetesMapping, &out.KubernetesMapping, s); err != nil { return err } return nil } -// Convert_v1alpha3_UserMapping_To_v1alpha4_UserMapping is an autogenerated conversion function. -func Convert_v1alpha3_UserMapping_To_v1alpha4_UserMapping(in *UserMapping, out *v1alpha4.UserMapping, s conversion.Scope) error { - return autoConvert_v1alpha3_UserMapping_To_v1alpha4_UserMapping(in, out, s) +// Convert_v1alpha3_UserMapping_To_v1beta1_UserMapping is an autogenerated conversion function. +func Convert_v1alpha3_UserMapping_To_v1beta1_UserMapping(in *UserMapping, out *v1beta1.UserMapping, s conversion.Scope) error { + return autoConvert_v1alpha3_UserMapping_To_v1beta1_UserMapping(in, out, s) } -func autoConvert_v1alpha4_UserMapping_To_v1alpha3_UserMapping(in *v1alpha4.UserMapping, out *UserMapping, s conversion.Scope) error { +func autoConvert_v1beta1_UserMapping_To_v1alpha3_UserMapping(in *v1beta1.UserMapping, out *UserMapping, s conversion.Scope) error { out.UserARN = in.UserARN - if err := Convert_v1alpha4_KubernetesMapping_To_v1alpha3_KubernetesMapping(&in.KubernetesMapping, &out.KubernetesMapping, s); err != nil { + if err := Convert_v1beta1_KubernetesMapping_To_v1alpha3_KubernetesMapping(&in.KubernetesMapping, &out.KubernetesMapping, s); err != nil { return err } return nil } -// Convert_v1alpha4_UserMapping_To_v1alpha3_UserMapping is an autogenerated conversion function. -func Convert_v1alpha4_UserMapping_To_v1alpha3_UserMapping(in *v1alpha4.UserMapping, out *UserMapping, s conversion.Scope) error { - return autoConvert_v1alpha4_UserMapping_To_v1alpha3_UserMapping(in, out, s) +// Convert_v1beta1_UserMapping_To_v1alpha3_UserMapping is an autogenerated conversion function. +func Convert_v1beta1_UserMapping_To_v1alpha3_UserMapping(in *v1beta1.UserMapping, out *UserMapping, s conversion.Scope) error { + return autoConvert_v1beta1_UserMapping_To_v1alpha3_UserMapping(in, out, s) } diff --git a/controlplane/eks/api/v1alpha3/zz_generated.deepcopy.go b/controlplane/eks/api/v1alpha3/zz_generated.deepcopy.go index ddce3a3d29..4ad7bf26bf 100644 --- a/controlplane/eks/api/v1alpha3/zz_generated.deepcopy.go +++ b/controlplane/eks/api/v1alpha3/zz_generated.deepcopy.go @@ -21,7 +21,7 @@ limitations under the License. package v1alpha3 import ( - runtime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime" apiv1alpha3 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" cluster_apiapiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" ) diff --git a/controlplane/eks/api/v1alpha4/awsmanagedcontrolplane_types.go b/controlplane/eks/api/v1alpha4/awsmanagedcontrolplane_types.go index 3bbf554b7a..664aae2ebf 100644 --- a/controlplane/eks/api/v1alpha4/awsmanagedcontrolplane_types.go +++ b/controlplane/eks/api/v1alpha4/awsmanagedcontrolplane_types.go @@ -18,8 +18,8 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + infrav1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" ) const ( @@ -37,10 +37,10 @@ type AWSManagedControlPlaneSpec struct { //nolint: maligned // IdentityRef is a reference to a identity to be used when reconciling the managed control plane. // +optional - IdentityRef *infrav1.AWSIdentityReference `json:"identityRef,omitempty"` + IdentityRef *infrav1alpha4.AWSIdentityReference `json:"identityRef,omitempty"` // NetworkSpec encapsulates all things related to AWS network. - NetworkSpec infrav1.NetworkSpec `json:"network,omitempty"` + NetworkSpec infrav1alpha4.NetworkSpec `json:"network,omitempty"` // SecondaryCidrBlock is the additional CIDR range to use for pod IPs. // Must be within the 100.64.0.0/10 or 198.19.0.0/16 range. @@ -89,7 +89,7 @@ type AWSManagedControlPlaneSpec struct { //nolint: maligned // AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the // ones added by default. // +optional - AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` + AdditionalTags infrav1alpha4.Tags `json:"additionalTags,omitempty"` // IAMAuthenticatorConfig allows the specification of any additional user or role mappings // for use when generating the aws-iam-authenticator configuration. If this is nil the @@ -103,7 +103,7 @@ type AWSManagedControlPlaneSpec struct { //nolint: maligned // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. // +optional - ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"` + ControlPlaneEndpoint clusterv1alpha4.APIEndpoint `json:"controlPlaneEndpoint"` // ImageLookupFormat is the AMI naming format to look up machine images when // a machine does not specify an AMI. When set, this will be used for all @@ -134,7 +134,7 @@ type AWSManagedControlPlaneSpec struct { //nolint: maligned // Bastion contains options to configure the bastion host. // +optional - Bastion infrav1.Bastion `json:"bastion"` + Bastion infrav1alpha4.Bastion `json:"bastion"` // TokenMethod is used to specify the method for obtaining a client token for communicating with EKS // iam-authenticator - obtains a client token using iam-authentictor @@ -208,13 +208,13 @@ type IdentityProviderStatus struct { type AWSManagedControlPlaneStatus struct { // Networks holds details about the AWS networking resources used by the control plane // +optional - Network infrav1.NetworkStatus `json:"networkStatus,omitempty"` + Network infrav1alpha4.NetworkStatus `json:"networkStatus,omitempty"` // FailureDomains specifies a list fo available availability zones that can be used // +optional - FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"` + FailureDomains clusterv1alpha4.FailureDomains `json:"failureDomains,omitempty"` // Bastion holds details of the instance that is used as a bastion jump box // +optional - Bastion *infrav1.Instance `json:"bastion,omitempty"` + Bastion *infrav1alpha4.Instance `json:"bastion,omitempty"` // OIDCProvider holds the status of the identity provider for this cluster // +optional OIDCProvider OIDCProviderStatus `json:"oidcProvider,omitempty"` @@ -235,7 +235,7 @@ type AWSManagedControlPlaneStatus struct { // +optional FailureMessage *string `json:"failureMessage,omitempty"` // Conditions specifies the cpnditions for the managed control plane - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` // Addons holds the current status of the EKS addons // +optional Addons []AddonState `json:"addons,omitempty"` @@ -248,7 +248,6 @@ type AWSManagedControlPlaneStatus struct { // +kubebuilder:object:root=true // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsmanagedcontrolplanes,shortName=awsmcp,scope=Namespaced,categories=cluster-api,shortName=awsmcp -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AWSManagedControl belongs" // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Control plane infrastructure is ready for worker nodes" @@ -275,12 +274,12 @@ type AWSManagedControlPlaneList struct { } // GetConditions returns the control planes conditions. -func (r *AWSManagedControlPlane) GetConditions() clusterv1.Conditions { +func (r *AWSManagedControlPlane) GetConditions() clusterv1alpha4.Conditions { return r.Status.Conditions } // SetConditions sets the status conditions for the AWSManagedControlPlane. -func (r *AWSManagedControlPlane) SetConditions(conditions clusterv1.Conditions) { +func (r *AWSManagedControlPlane) SetConditions(conditions clusterv1alpha4.Conditions) { r.Status.Conditions = conditions } diff --git a/controlplane/eks/api/v1alpha4/conditions_consts.go b/controlplane/eks/api/v1alpha4/conditions_consts.go index cee1293691..8c161f73be 100644 --- a/controlplane/eks/api/v1alpha4/conditions_consts.go +++ b/controlplane/eks/api/v1alpha4/conditions_consts.go @@ -16,45 +16,45 @@ limitations under the License. package v1alpha4 -import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" +import clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" const ( // EKSControlPlaneReadyCondition condition reports on the successful reconciliation of eks control plane. - EKSControlPlaneReadyCondition clusterv1.ConditionType = "EKSControlPlaneReady" + EKSControlPlaneReadyCondition clusterv1alpha4.ConditionType = "EKSControlPlaneReady" // EKSControlPlaneCreatingCondition condition reports on whether the eks // control plane is creating. - EKSControlPlaneCreatingCondition clusterv1.ConditionType = "EKSControlPlaneCreating" + EKSControlPlaneCreatingCondition clusterv1alpha4.ConditionType = "EKSControlPlaneCreating" // EKSControlPlaneUpdatingCondition condition reports on whether the eks // control plane is updating. - EKSControlPlaneUpdatingCondition clusterv1.ConditionType = "EKSControlPlaneUpdating" + EKSControlPlaneUpdatingCondition clusterv1alpha4.ConditionType = "EKSControlPlaneUpdating" // EKSControlPlaneReconciliationFailedReason used to report failures while reconciling EKS control plane. EKSControlPlaneReconciliationFailedReason = "EKSControlPlaneReconciliationFailed" ) const ( // IAMControlPlaneRolesReadyCondition condition reports on the successful reconciliation of eks control plane iam roles. - IAMControlPlaneRolesReadyCondition clusterv1.ConditionType = "IAMControlPlaneRolesReady" + IAMControlPlaneRolesReadyCondition clusterv1alpha4.ConditionType = "IAMControlPlaneRolesReady" // IAMControlPlaneRolesReconciliationFailedReason used to report failures while reconciling EKS control plane iam roles. IAMControlPlaneRolesReconciliationFailedReason = "IAMControlPlaneRolesReconciliationFailed" ) const ( // IAMAuthenticatorConfiguredCondition condition reports on the successful reconciliation of aws-iam-authenticator config. - IAMAuthenticatorConfiguredCondition clusterv1.ConditionType = "IAMAuthenticatorConfigured" + IAMAuthenticatorConfiguredCondition clusterv1alpha4.ConditionType = "IAMAuthenticatorConfigured" // IAMAuthenticatorConfigurationFailedReason used to report failures while reconciling the aws-iam-authenticator config. IAMAuthenticatorConfigurationFailedReason = "IAMAuthenticatorConfigurationFailed" ) const ( // EKSAddonsConfiguredCondition condition reports on the successful reconciliation of EKS addons. - EKSAddonsConfiguredCondition clusterv1.ConditionType = "EKSAddonsConfigured" + EKSAddonsConfiguredCondition clusterv1alpha4.ConditionType = "EKSAddonsConfigured" // EKSAddonsConfiguredFailedReason used to report failures while reconciling the EKS addons. EKSAddonsConfiguredFailedReason = "EKSAddonsConfiguredFailed" ) const ( // EKSIdentityProviderConfiguredCondition condition reports on the successful association of identity provider config. - EKSIdentityProviderConfiguredCondition clusterv1.ConditionType = "EKSIdentityProviderConfigured" + EKSIdentityProviderConfiguredCondition clusterv1alpha4.ConditionType = "EKSIdentityProviderConfigured" // EKSIdentityProviderConfiguredFailedReason used to report failures while reconciling the identity provider config association. EKSIdentityProviderConfiguredFailedReason = "EKSIdentityProviderConfiguredFailed" ) diff --git a/controlplane/eks/api/v1alpha4/conversion.go b/controlplane/eks/api/v1alpha4/conversion.go index 7fab7d436c..7ef0fe6c7b 100644 --- a/controlplane/eks/api/v1alpha4/conversion.go +++ b/controlplane/eks/api/v1alpha4/conversion.go @@ -16,8 +16,90 @@ limitations under the License. package v1alpha4 -// Hub marks AWSManagedControlPlane as a conversion hub. -func (*AWSManagedControlPlane) Hub() {} +import ( + apiconversion "k8s.io/apimachinery/pkg/conversion" + infrav1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1beta1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/controller-runtime/pkg/conversion" +) -// Hub marks AWSManagedControlPlaneList as a conversion hub. -func (*AWSManagedControlPlaneList) Hub() {} +// ConvertTo converts the v1alpha4 AWSManagedControlPlane receiver to a v1beta1 AWSManagedControlPlane. +func (r *AWSManagedControlPlane) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.AWSManagedControlPlane) + + return Convert_v1alpha4_AWSManagedControlPlane_To_v1beta1_AWSManagedControlPlane(r, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSManagedControlPlane receiver to a v1alpha4 AWSManagedControlPlane. +func (r *AWSManagedControlPlane) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.AWSManagedControlPlane) + + return Convert_v1beta1_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane(src, r, nil) +} + +// ConvertTo converts the v1alpha4 AWSManagedControlPlaneList receiver to a v1beta1 AWSManagedControlPlaneList. +func (r *AWSManagedControlPlaneList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1beta1.AWSManagedControlPlaneList) + + return Convert_v1alpha4_AWSManagedControlPlaneList_To_v1beta1_AWSManagedControlPlaneList(r, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSManagedControlPlaneList receiver to a v1alpha4 AWSManagedControlPlaneList. +func (r *AWSManagedControlPlaneList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1beta1.AWSManagedControlPlaneList) + + return Convert_v1beta1_AWSManagedControlPlaneList_To_v1alpha4_AWSManagedControlPlaneList(src, r, nil) +} + +// Convert_v1alpha4_NetworkStatus_To_v1beta1_NetworkStatus is a conversion function. +func Convert_v1alpha4_NetworkStatus_To_v1beta1_NetworkStatus(in *infrav1alpha4.NetworkStatus, out *infrav1beta1.NetworkStatus, s apiconversion.Scope) error { + return infrav1alpha4.Convert_v1alpha4_NetworkStatus_To_v1beta1_NetworkStatus(in, out, s) +} + +// Convert_v1beta1_NetworkStatus_To_v1alpha4_NetworkStatus is a conversion function. +func Convert_v1beta1_NetworkStatus_To_v1alpha4_NetworkStatus(in *infrav1beta1.NetworkStatus, out *infrav1alpha4.NetworkStatus, s apiconversion.Scope) error { + return infrav1alpha4.Convert_v1beta1_NetworkStatus_To_v1alpha4_NetworkStatus(in, out, s) +} + +// Convert_v1alpha4_NetworkSpec_To_v1beta1_NetworkSpec is a conversion function. +func Convert_v1alpha4_NetworkSpec_To_v1beta1_NetworkSpec(in *infrav1alpha4.NetworkSpec, out *infrav1beta1.NetworkSpec, s apiconversion.Scope) error { + return infrav1alpha4.Convert_v1alpha4_NetworkSpec_To_v1beta1_NetworkSpec(in, out, s) +} + +// Convert_v1beta1_NetworkSpec_To_v1alpha4_NetworkSpec is a generated conversion function. +func Convert_v1beta1_NetworkSpec_To_v1alpha4_NetworkSpec(in *infrav1beta1.NetworkSpec, out *infrav1alpha4.NetworkSpec, s apiconversion.Scope) error { + return infrav1alpha4.Convert_v1beta1_NetworkSpec_To_v1alpha4_NetworkSpec(in, out, s) +} + +// Convert_v1alpha4_Bastion_To_v1beta1_Bastion is a generated conversion function. +func Convert_v1alpha4_Bastion_To_v1beta1_Bastion(in *infrav1alpha4.Bastion, out *infrav1beta1.Bastion, s apiconversion.Scope) error { + return infrav1alpha4.Convert_v1alpha4_Bastion_To_v1beta1_Bastion(in, out, s) +} + +// Convert_v1beta1_Bastion_To_v1alpha4_Bastion is a generated conversion function. +func Convert_v1beta1_Bastion_To_v1alpha4_Bastion(in *infrav1beta1.Bastion, out *infrav1alpha4.Bastion, s apiconversion.Scope) error { + return infrav1alpha4.Convert_v1beta1_Bastion_To_v1alpha4_Bastion(in, out, s) +} + +// Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint is a conversion function. +func Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in *clusterv1alpha4.APIEndpoint, out *clusterv1.APIEndpoint, s apiconversion.Scope) error { + return clusterv1alpha4.Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(in, out, s) +} + +// Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint is a conversion function. +func Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in *clusterv1.APIEndpoint, out *clusterv1alpha4.APIEndpoint, s apiconversion.Scope) error { + return clusterv1alpha4.Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(in, out, s) +} + +// Convert_v1beta1_Instance_To_v1alpha4_Instance is a conversion function. +func Convert_v1beta1_Instance_To_v1alpha4_Instance(in *infrav1beta1.Instance, out *infrav1alpha4.Instance, s apiconversion.Scope) error { + return infrav1alpha4.Convert_v1beta1_Instance_To_v1alpha4_Instance(in, out, s) +} + +// Convert_v1alpha4_Instance_To_v1beta1_Instance is a conversion function. +func Convert_v1alpha4_Instance_To_v1beta1_Instance(in *infrav1alpha4.Instance, out *infrav1beta1.Instance, s apiconversion.Scope) error { + return infrav1alpha4.Convert_v1alpha4_Instance_To_v1beta1_Instance(in, out, s) +} diff --git a/controlplane/eks/api/v1alpha4/conversion_test.go b/controlplane/eks/api/v1alpha4/conversion_test.go new file mode 100644 index 0000000000..9117c1a542 --- /dev/null +++ b/controlplane/eks/api/v1alpha4/conversion_test.go @@ -0,0 +1,40 @@ +/* +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" + + runtime "k8s.io/apimachinery/pkg/runtime" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + utilconversion "sigs.k8s.io/cluster-api/util/conversion" +) + +func TestFuzzyConversion(t *testing.T) { + g := NewWithT(t) + scheme := runtime.NewScheme() + g.Expect(AddToScheme(scheme)).To(Succeed()) + g.Expect(v1beta1.AddToScheme(scheme)).To(Succeed()) + + t.Run("for AWSManagedControlPlane", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1beta1.AWSManagedControlPlane{}, + Spoke: &AWSManagedControlPlane{}, + })) +} diff --git a/controlplane/eks/api/v1alpha4/doc.go b/controlplane/eks/api/v1alpha4/doc.go index 437ab730e0..a1e5bdc2c9 100644 --- a/controlplane/eks/api/v1alpha4/doc.go +++ b/controlplane/eks/api/v1alpha4/doc.go @@ -15,6 +15,7 @@ limitations under the License. */ // Package v1alpha4 contains API Schema definitions for the controlplane v1alpha4 API group -// +gencrdrefdocs:force // +groupName=controlplane.cluster.x-k8s.io +// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1 + package v1alpha4 diff --git a/controlplane/eks/api/v1alpha4/groupversion_info.go b/controlplane/eks/api/v1alpha4/groupversion_info.go index cc3b075d31..e56dc34ad2 100644 --- a/controlplane/eks/api/v1alpha4/groupversion_info.go +++ b/controlplane/eks/api/v1alpha4/groupversion_info.go @@ -33,4 +33,6 @@ var ( // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme + + localSchemeBuilder = SchemeBuilder.SchemeBuilder ) diff --git a/controlplane/eks/api/v1alpha4/types.go b/controlplane/eks/api/v1alpha4/types.go index 9b37264fca..d3d58709c7 100644 --- a/controlplane/eks/api/v1alpha4/types.go +++ b/controlplane/eks/api/v1alpha4/types.go @@ -23,7 +23,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" ) // ControlPlaneLoggingSpec defines what EKS control plane logs that should be enabled. @@ -83,7 +84,7 @@ var ( // DefaultEKSControlPlaneRole is the name of the default IAM role to use for the EKS control plane // if no other role is supplied in the spec and if iam role creation is not enabled. The default // can be created using clusterawsadm or created manually. - DefaultEKSControlPlaneRole = fmt.Sprintf("eks-controlplane%s", infrav1.DefaultNameSuffix) + DefaultEKSControlPlaneRole = fmt.Sprintf("eks-controlplane%s", iamv1.DefaultNameSuffix) ) // IAMAuthenticatorConfig represents an aws-iam-authenticator configuration. @@ -212,7 +213,7 @@ type AddonIssue struct { const ( // SecurityGroupCluster is the security group for communication between EKS // control plane and managed node groups. - SecurityGroupCluster = infrav1.SecurityGroupRole("cluster") + SecurityGroupCluster = infrav1alpha4.SecurityGroupRole("cluster") ) type OIDCIdentityProviderConfig struct { @@ -274,5 +275,5 @@ type OIDCIdentityProviderConfig struct { // tags to apply to oidc identity provider association // +optional - Tags infrav1.Tags `json:"tags,omitempty"` + Tags infrav1alpha4.Tags `json:"tags,omitempty"` } diff --git a/controlplane/eks/api/v1alpha4/webhook_suite_test.go b/controlplane/eks/api/v1alpha4/webhook_suite_test.go new file mode 100644 index 0000000000..fe85c2164f --- /dev/null +++ b/controlplane/eks/api/v1alpha4/webhook_suite_test.go @@ -0,0 +1,76 @@ +/* +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" + "os" + "path" + "testing" + + utilruntime "k8s.io/apimachinery/pkg/util/runtime" + "k8s.io/client-go/kubernetes/scheme" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + "sigs.k8s.io/cluster-api-provider-aws/test/helpers" + ctrl "sigs.k8s.io/controller-runtime" + // +kubebuilder:scaffold:imports +) + +var ( + testEnv *helpers.TestEnvironment + ctx = ctrl.SetupSignalHandler() +) + +func TestMain(m *testing.M) { + code := 0 + defer func() { os.Exit(code) }() + setup() + defer teardown() + code = m.Run() +} + +func setup() { + utilruntime.Must(AddToScheme(scheme.Scheme)) + utilruntime.Must(ekscontrolplanev1.AddToScheme(scheme.Scheme)) + + testEnvConfig := helpers.NewTestEnvironmentConfiguration([]string{ + path.Join("..", "config", "crd", "bases"), + }, + ).WithWebhookConfiguration("unmanaged", path.Join("config", "webhook", "manifests.yaml")) + var err error + testEnv, err = testEnvConfig.Build() + if err != nil { + panic(err) + } + if err := (&ekscontrolplanev1.AWSManagedControlPlane{}).SetupWebhookWithManager(testEnv); err != nil { + panic(fmt.Sprintf("Unable to setup AWSCluster webhook: %v", err)) + } + + go func() { + fmt.Println("Starting the manager") + if err := testEnv.StartManager(ctx); err != nil { + panic(fmt.Sprintf("Failed to start the envtest manager: %v", err)) + } + }() + testEnv.WaitForWebhooks() +} + +func teardown() { + if err := testEnv.Stop(); err != nil { + panic(fmt.Sprintf("Failed to stop envtest: %v", err)) + } +} diff --git a/controlplane/eks/api/v1alpha4/zz_generated.conversion.go b/controlplane/eks/api/v1alpha4/zz_generated.conversion.go new file mode 100644 index 0000000000..e035395ae1 --- /dev/null +++ b/controlplane/eks/api/v1alpha4/zz_generated.conversion.go @@ -0,0 +1,855 @@ +// +build !ignore_autogenerated_conversions + +/* +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-provider-aws/api/v1alpha4" + apiv1beta1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + clusterapiapiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterapiapiv1beta1 "sigs.k8s.io/cluster-api/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((*AWSManagedControlPlane)(nil), (*v1beta1.AWSManagedControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSManagedControlPlane_To_v1beta1_AWSManagedControlPlane(a.(*AWSManagedControlPlane), b.(*v1beta1.AWSManagedControlPlane), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSManagedControlPlane)(nil), (*AWSManagedControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane(a.(*v1beta1.AWSManagedControlPlane), b.(*AWSManagedControlPlane), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSManagedControlPlaneList)(nil), (*v1beta1.AWSManagedControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSManagedControlPlaneList_To_v1beta1_AWSManagedControlPlaneList(a.(*AWSManagedControlPlaneList), b.(*v1beta1.AWSManagedControlPlaneList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSManagedControlPlaneList)(nil), (*AWSManagedControlPlaneList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSManagedControlPlaneList_To_v1alpha4_AWSManagedControlPlaneList(a.(*v1beta1.AWSManagedControlPlaneList), b.(*AWSManagedControlPlaneList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSManagedControlPlaneSpec)(nil), (*v1beta1.AWSManagedControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSManagedControlPlaneSpec_To_v1beta1_AWSManagedControlPlaneSpec(a.(*AWSManagedControlPlaneSpec), b.(*v1beta1.AWSManagedControlPlaneSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSManagedControlPlaneSpec)(nil), (*AWSManagedControlPlaneSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSManagedControlPlaneSpec_To_v1alpha4_AWSManagedControlPlaneSpec(a.(*v1beta1.AWSManagedControlPlaneSpec), b.(*AWSManagedControlPlaneSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSManagedControlPlaneStatus)(nil), (*v1beta1.AWSManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSManagedControlPlaneStatus_To_v1beta1_AWSManagedControlPlaneStatus(a.(*AWSManagedControlPlaneStatus), b.(*v1beta1.AWSManagedControlPlaneStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSManagedControlPlaneStatus)(nil), (*AWSManagedControlPlaneStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSManagedControlPlaneStatus_To_v1alpha4_AWSManagedControlPlaneStatus(a.(*v1beta1.AWSManagedControlPlaneStatus), b.(*AWSManagedControlPlaneStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Addon)(nil), (*v1beta1.Addon)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Addon_To_v1beta1_Addon(a.(*Addon), b.(*v1beta1.Addon), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.Addon)(nil), (*Addon)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Addon_To_v1alpha4_Addon(a.(*v1beta1.Addon), b.(*Addon), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AddonIssue)(nil), (*v1beta1.AddonIssue)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AddonIssue_To_v1beta1_AddonIssue(a.(*AddonIssue), b.(*v1beta1.AddonIssue), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AddonIssue)(nil), (*AddonIssue)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AddonIssue_To_v1alpha4_AddonIssue(a.(*v1beta1.AddonIssue), b.(*AddonIssue), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AddonState)(nil), (*v1beta1.AddonState)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AddonState_To_v1beta1_AddonState(a.(*AddonState), b.(*v1beta1.AddonState), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AddonState)(nil), (*AddonState)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AddonState_To_v1alpha4_AddonState(a.(*v1beta1.AddonState), b.(*AddonState), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ControlPlaneLoggingSpec)(nil), (*v1beta1.ControlPlaneLoggingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ControlPlaneLoggingSpec_To_v1beta1_ControlPlaneLoggingSpec(a.(*ControlPlaneLoggingSpec), b.(*v1beta1.ControlPlaneLoggingSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ControlPlaneLoggingSpec)(nil), (*ControlPlaneLoggingSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ControlPlaneLoggingSpec_To_v1alpha4_ControlPlaneLoggingSpec(a.(*v1beta1.ControlPlaneLoggingSpec), b.(*ControlPlaneLoggingSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*EncryptionConfig)(nil), (*v1beta1.EncryptionConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_EncryptionConfig_To_v1beta1_EncryptionConfig(a.(*EncryptionConfig), b.(*v1beta1.EncryptionConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.EncryptionConfig)(nil), (*EncryptionConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EncryptionConfig_To_v1alpha4_EncryptionConfig(a.(*v1beta1.EncryptionConfig), b.(*EncryptionConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*EndpointAccess)(nil), (*v1beta1.EndpointAccess)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_EndpointAccess_To_v1beta1_EndpointAccess(a.(*EndpointAccess), b.(*v1beta1.EndpointAccess), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.EndpointAccess)(nil), (*EndpointAccess)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EndpointAccess_To_v1alpha4_EndpointAccess(a.(*v1beta1.EndpointAccess), b.(*EndpointAccess), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*IAMAuthenticatorConfig)(nil), (*v1beta1.IAMAuthenticatorConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_IAMAuthenticatorConfig_To_v1beta1_IAMAuthenticatorConfig(a.(*IAMAuthenticatorConfig), b.(*v1beta1.IAMAuthenticatorConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.IAMAuthenticatorConfig)(nil), (*IAMAuthenticatorConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_IAMAuthenticatorConfig_To_v1alpha4_IAMAuthenticatorConfig(a.(*v1beta1.IAMAuthenticatorConfig), b.(*IAMAuthenticatorConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*IdentityProviderStatus)(nil), (*v1beta1.IdentityProviderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_IdentityProviderStatus_To_v1beta1_IdentityProviderStatus(a.(*IdentityProviderStatus), b.(*v1beta1.IdentityProviderStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.IdentityProviderStatus)(nil), (*IdentityProviderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_IdentityProviderStatus_To_v1alpha4_IdentityProviderStatus(a.(*v1beta1.IdentityProviderStatus), b.(*IdentityProviderStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*KubernetesMapping)(nil), (*v1beta1.KubernetesMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_KubernetesMapping_To_v1beta1_KubernetesMapping(a.(*KubernetesMapping), b.(*v1beta1.KubernetesMapping), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.KubernetesMapping)(nil), (*KubernetesMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_KubernetesMapping_To_v1alpha4_KubernetesMapping(a.(*v1beta1.KubernetesMapping), b.(*KubernetesMapping), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*OIDCIdentityProviderConfig)(nil), (*v1beta1.OIDCIdentityProviderConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_OIDCIdentityProviderConfig_To_v1beta1_OIDCIdentityProviderConfig(a.(*OIDCIdentityProviderConfig), b.(*v1beta1.OIDCIdentityProviderConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.OIDCIdentityProviderConfig)(nil), (*OIDCIdentityProviderConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_OIDCIdentityProviderConfig_To_v1alpha4_OIDCIdentityProviderConfig(a.(*v1beta1.OIDCIdentityProviderConfig), b.(*OIDCIdentityProviderConfig), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*OIDCProviderStatus)(nil), (*v1beta1.OIDCProviderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_OIDCProviderStatus_To_v1beta1_OIDCProviderStatus(a.(*OIDCProviderStatus), b.(*v1beta1.OIDCProviderStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.OIDCProviderStatus)(nil), (*OIDCProviderStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_OIDCProviderStatus_To_v1alpha4_OIDCProviderStatus(a.(*v1beta1.OIDCProviderStatus), b.(*OIDCProviderStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*RoleMapping)(nil), (*v1beta1.RoleMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_RoleMapping_To_v1beta1_RoleMapping(a.(*RoleMapping), b.(*v1beta1.RoleMapping), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.RoleMapping)(nil), (*RoleMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_RoleMapping_To_v1alpha4_RoleMapping(a.(*v1beta1.RoleMapping), b.(*RoleMapping), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*UserMapping)(nil), (*v1beta1.UserMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_UserMapping_To_v1beta1_UserMapping(a.(*UserMapping), b.(*v1beta1.UserMapping), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.UserMapping)(nil), (*UserMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_UserMapping_To_v1alpha4_UserMapping(a.(*v1beta1.UserMapping), b.(*UserMapping), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*apiv1alpha4.Bastion)(nil), (*apiv1beta1.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Bastion_To_v1beta1_Bastion(a.(*apiv1alpha4.Bastion), b.(*apiv1beta1.Bastion), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*apiv1alpha4.Instance)(nil), (*apiv1beta1.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Instance_To_v1beta1_Instance(a.(*apiv1alpha4.Instance), b.(*apiv1beta1.Instance), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*apiv1alpha4.NetworkSpec)(nil), (*apiv1beta1.NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_NetworkSpec_To_v1beta1_NetworkSpec(a.(*apiv1alpha4.NetworkSpec), b.(*apiv1beta1.NetworkSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*apiv1alpha4.NetworkStatus)(nil), (*apiv1beta1.NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_NetworkStatus_To_v1beta1_NetworkStatus(a.(*apiv1alpha4.NetworkStatus), b.(*apiv1beta1.NetworkStatus), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*apiv1beta1.Bastion)(nil), (*apiv1alpha4.Bastion)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Bastion_To_v1alpha4_Bastion(a.(*apiv1beta1.Bastion), b.(*apiv1alpha4.Bastion), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*apiv1beta1.Instance)(nil), (*apiv1alpha4.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Instance_To_v1alpha4_Instance(a.(*apiv1beta1.Instance), b.(*apiv1alpha4.Instance), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*apiv1beta1.NetworkSpec)(nil), (*apiv1alpha4.NetworkSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_NetworkSpec_To_v1alpha4_NetworkSpec(a.(*apiv1beta1.NetworkSpec), b.(*apiv1alpha4.NetworkSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*apiv1beta1.NetworkStatus)(nil), (*apiv1alpha4.NetworkStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_NetworkStatus_To_v1alpha4_NetworkStatus(a.(*apiv1beta1.NetworkStatus), b.(*apiv1alpha4.NetworkStatus), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha4_AWSManagedControlPlane_To_v1beta1_AWSManagedControlPlane(in *AWSManagedControlPlane, out *v1beta1.AWSManagedControlPlane, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_AWSManagedControlPlaneSpec_To_v1beta1_AWSManagedControlPlaneSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_AWSManagedControlPlaneStatus_To_v1beta1_AWSManagedControlPlaneStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSManagedControlPlane_To_v1beta1_AWSManagedControlPlane is an autogenerated conversion function. +func Convert_v1alpha4_AWSManagedControlPlane_To_v1beta1_AWSManagedControlPlane(in *AWSManagedControlPlane, out *v1beta1.AWSManagedControlPlane, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSManagedControlPlane_To_v1beta1_AWSManagedControlPlane(in, out, s) +} + +func autoConvert_v1beta1_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane(in *v1beta1.AWSManagedControlPlane, out *AWSManagedControlPlane, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_AWSManagedControlPlaneSpec_To_v1alpha4_AWSManagedControlPlaneSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_AWSManagedControlPlaneStatus_To_v1alpha4_AWSManagedControlPlaneStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane is an autogenerated conversion function. +func Convert_v1beta1_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane(in *v1beta1.AWSManagedControlPlane, out *AWSManagedControlPlane, s conversion.Scope) error { + return autoConvert_v1beta1_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane(in, out, s) +} + +func autoConvert_v1alpha4_AWSManagedControlPlaneList_To_v1beta1_AWSManagedControlPlaneList(in *AWSManagedControlPlaneList, out *v1beta1.AWSManagedControlPlaneList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta1.AWSManagedControlPlane, len(*in)) + for i := range *in { + if err := Convert_v1alpha4_AWSManagedControlPlane_To_v1beta1_AWSManagedControlPlane(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha4_AWSManagedControlPlaneList_To_v1beta1_AWSManagedControlPlaneList is an autogenerated conversion function. +func Convert_v1alpha4_AWSManagedControlPlaneList_To_v1beta1_AWSManagedControlPlaneList(in *AWSManagedControlPlaneList, out *v1beta1.AWSManagedControlPlaneList, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSManagedControlPlaneList_To_v1beta1_AWSManagedControlPlaneList(in, out, s) +} + +func autoConvert_v1beta1_AWSManagedControlPlaneList_To_v1alpha4_AWSManagedControlPlaneList(in *v1beta1.AWSManagedControlPlaneList, out *AWSManagedControlPlaneList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSManagedControlPlane, len(*in)) + for i := range *in { + if err := Convert_v1beta1_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_AWSManagedControlPlaneList_To_v1alpha4_AWSManagedControlPlaneList is an autogenerated conversion function. +func Convert_v1beta1_AWSManagedControlPlaneList_To_v1alpha4_AWSManagedControlPlaneList(in *v1beta1.AWSManagedControlPlaneList, out *AWSManagedControlPlaneList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSManagedControlPlaneList_To_v1alpha4_AWSManagedControlPlaneList(in, out, s) +} + +func autoConvert_v1alpha4_AWSManagedControlPlaneSpec_To_v1beta1_AWSManagedControlPlaneSpec(in *AWSManagedControlPlaneSpec, out *v1beta1.AWSManagedControlPlaneSpec, s conversion.Scope) error { + out.EKSClusterName = in.EKSClusterName + out.IdentityRef = (*apiv1beta1.AWSIdentityReference)(unsafe.Pointer(in.IdentityRef)) + if err := Convert_v1alpha4_NetworkSpec_To_v1beta1_NetworkSpec(&in.NetworkSpec, &out.NetworkSpec, s); err != nil { + return err + } + out.SecondaryCidrBlock = (*string)(unsafe.Pointer(in.SecondaryCidrBlock)) + out.Region = in.Region + out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) + out.Version = (*string)(unsafe.Pointer(in.Version)) + out.RoleName = (*string)(unsafe.Pointer(in.RoleName)) + out.RoleAdditionalPolicies = (*[]string)(unsafe.Pointer(in.RoleAdditionalPolicies)) + out.Logging = (*v1beta1.ControlPlaneLoggingSpec)(unsafe.Pointer(in.Logging)) + out.EncryptionConfig = (*v1beta1.EncryptionConfig)(unsafe.Pointer(in.EncryptionConfig)) + out.AdditionalTags = *(*apiv1beta1.Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.IAMAuthenticatorConfig = (*v1beta1.IAMAuthenticatorConfig)(unsafe.Pointer(in.IAMAuthenticatorConfig)) + if err := Convert_v1alpha4_EndpointAccess_To_v1beta1_EndpointAccess(&in.EndpointAccess, &out.EndpointAccess, s); err != nil { + return err + } + if err := clusterapiapiv1alpha4.Convert_v1alpha4_APIEndpoint_To_v1beta1_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + out.ImageLookupFormat = in.ImageLookupFormat + out.ImageLookupOrg = in.ImageLookupOrg + out.ImageLookupBaseOS = in.ImageLookupBaseOS + if err := Convert_v1alpha4_Bastion_To_v1beta1_Bastion(&in.Bastion, &out.Bastion, s); err != nil { + return err + } + out.TokenMethod = (*v1beta1.EKSTokenMethod)(unsafe.Pointer(in.TokenMethod)) + out.AssociateOIDCProvider = in.AssociateOIDCProvider + out.Addons = (*[]v1beta1.Addon)(unsafe.Pointer(in.Addons)) + out.OIDCIdentityProviderConfig = (*v1beta1.OIDCIdentityProviderConfig)(unsafe.Pointer(in.OIDCIdentityProviderConfig)) + out.DisableVPCCNI = in.DisableVPCCNI + return nil +} + +// Convert_v1alpha4_AWSManagedControlPlaneSpec_To_v1beta1_AWSManagedControlPlaneSpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSManagedControlPlaneSpec_To_v1beta1_AWSManagedControlPlaneSpec(in *AWSManagedControlPlaneSpec, out *v1beta1.AWSManagedControlPlaneSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSManagedControlPlaneSpec_To_v1beta1_AWSManagedControlPlaneSpec(in, out, s) +} + +func autoConvert_v1beta1_AWSManagedControlPlaneSpec_To_v1alpha4_AWSManagedControlPlaneSpec(in *v1beta1.AWSManagedControlPlaneSpec, out *AWSManagedControlPlaneSpec, s conversion.Scope) error { + out.EKSClusterName = in.EKSClusterName + out.IdentityRef = (*apiv1alpha4.AWSIdentityReference)(unsafe.Pointer(in.IdentityRef)) + if err := Convert_v1beta1_NetworkSpec_To_v1alpha4_NetworkSpec(&in.NetworkSpec, &out.NetworkSpec, s); err != nil { + return err + } + out.SecondaryCidrBlock = (*string)(unsafe.Pointer(in.SecondaryCidrBlock)) + out.Region = in.Region + out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) + out.Version = (*string)(unsafe.Pointer(in.Version)) + out.RoleName = (*string)(unsafe.Pointer(in.RoleName)) + out.RoleAdditionalPolicies = (*[]string)(unsafe.Pointer(in.RoleAdditionalPolicies)) + out.Logging = (*ControlPlaneLoggingSpec)(unsafe.Pointer(in.Logging)) + out.EncryptionConfig = (*EncryptionConfig)(unsafe.Pointer(in.EncryptionConfig)) + out.AdditionalTags = *(*apiv1alpha4.Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.IAMAuthenticatorConfig = (*IAMAuthenticatorConfig)(unsafe.Pointer(in.IAMAuthenticatorConfig)) + if err := Convert_v1beta1_EndpointAccess_To_v1alpha4_EndpointAccess(&in.EndpointAccess, &out.EndpointAccess, s); err != nil { + return err + } + if err := clusterapiapiv1alpha4.Convert_v1beta1_APIEndpoint_To_v1alpha4_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + out.ImageLookupFormat = in.ImageLookupFormat + out.ImageLookupOrg = in.ImageLookupOrg + out.ImageLookupBaseOS = in.ImageLookupBaseOS + if err := Convert_v1beta1_Bastion_To_v1alpha4_Bastion(&in.Bastion, &out.Bastion, s); err != nil { + return err + } + out.TokenMethod = (*EKSTokenMethod)(unsafe.Pointer(in.TokenMethod)) + out.AssociateOIDCProvider = in.AssociateOIDCProvider + out.Addons = (*[]Addon)(unsafe.Pointer(in.Addons)) + out.OIDCIdentityProviderConfig = (*OIDCIdentityProviderConfig)(unsafe.Pointer(in.OIDCIdentityProviderConfig)) + out.DisableVPCCNI = in.DisableVPCCNI + return nil +} + +// Convert_v1beta1_AWSManagedControlPlaneSpec_To_v1alpha4_AWSManagedControlPlaneSpec is an autogenerated conversion function. +func Convert_v1beta1_AWSManagedControlPlaneSpec_To_v1alpha4_AWSManagedControlPlaneSpec(in *v1beta1.AWSManagedControlPlaneSpec, out *AWSManagedControlPlaneSpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSManagedControlPlaneSpec_To_v1alpha4_AWSManagedControlPlaneSpec(in, out, s) +} + +func autoConvert_v1alpha4_AWSManagedControlPlaneStatus_To_v1beta1_AWSManagedControlPlaneStatus(in *AWSManagedControlPlaneStatus, out *v1beta1.AWSManagedControlPlaneStatus, s conversion.Scope) error { + if err := Convert_v1alpha4_NetworkStatus_To_v1beta1_NetworkStatus(&in.Network, &out.Network, s); err != nil { + return err + } + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make(clusterapiapiv1beta1.FailureDomains, len(*in)) + for key, val := range *in { + newVal := new(clusterapiapiv1beta1.FailureDomainSpec) + if err := clusterapiapiv1alpha4.Convert_v1alpha4_FailureDomainSpec_To_v1beta1_FailureDomainSpec(&val, newVal, s); err != nil { + return err + } + (*out)[key] = *newVal + } + } else { + out.FailureDomains = nil + } + if in.Bastion != nil { + in, out := &in.Bastion, &out.Bastion + *out = new(apiv1beta1.Instance) + if err := Convert_v1alpha4_Instance_To_v1beta1_Instance(*in, *out, s); err != nil { + return err + } + } else { + out.Bastion = nil + } + if err := Convert_v1alpha4_OIDCProviderStatus_To_v1beta1_OIDCProviderStatus(&in.OIDCProvider, &out.OIDCProvider, s); err != nil { + return err + } + out.ExternalManagedControlPlane = (*bool)(unsafe.Pointer(in.ExternalManagedControlPlane)) + out.Initialized = in.Initialized + out.Ready = in.Ready + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(clusterapiapiv1beta1.Conditions, len(*in)) + for i := range *in { + if err := clusterapiapiv1alpha4.Convert_v1alpha4_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + out.Addons = *(*[]v1beta1.AddonState)(unsafe.Pointer(&in.Addons)) + if err := Convert_v1alpha4_IdentityProviderStatus_To_v1beta1_IdentityProviderStatus(&in.IdentityProviderStatus, &out.IdentityProviderStatus, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSManagedControlPlaneStatus_To_v1beta1_AWSManagedControlPlaneStatus is an autogenerated conversion function. +func Convert_v1alpha4_AWSManagedControlPlaneStatus_To_v1beta1_AWSManagedControlPlaneStatus(in *AWSManagedControlPlaneStatus, out *v1beta1.AWSManagedControlPlaneStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSManagedControlPlaneStatus_To_v1beta1_AWSManagedControlPlaneStatus(in, out, s) +} + +func autoConvert_v1beta1_AWSManagedControlPlaneStatus_To_v1alpha4_AWSManagedControlPlaneStatus(in *v1beta1.AWSManagedControlPlaneStatus, out *AWSManagedControlPlaneStatus, s conversion.Scope) error { + if err := Convert_v1beta1_NetworkStatus_To_v1alpha4_NetworkStatus(&in.Network, &out.Network, s); err != nil { + return err + } + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make(clusterapiapiv1alpha4.FailureDomains, len(*in)) + for key, val := range *in { + newVal := new(clusterapiapiv1alpha4.FailureDomainSpec) + if err := clusterapiapiv1alpha4.Convert_v1beta1_FailureDomainSpec_To_v1alpha4_FailureDomainSpec(&val, newVal, s); err != nil { + return err + } + (*out)[key] = *newVal + } + } else { + out.FailureDomains = nil + } + if in.Bastion != nil { + in, out := &in.Bastion, &out.Bastion + *out = new(apiv1alpha4.Instance) + if err := Convert_v1beta1_Instance_To_v1alpha4_Instance(*in, *out, s); err != nil { + return err + } + } else { + out.Bastion = nil + } + if err := Convert_v1beta1_OIDCProviderStatus_To_v1alpha4_OIDCProviderStatus(&in.OIDCProvider, &out.OIDCProvider, s); err != nil { + return err + } + out.ExternalManagedControlPlane = (*bool)(unsafe.Pointer(in.ExternalManagedControlPlane)) + out.Initialized = in.Initialized + out.Ready = in.Ready + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(clusterapiapiv1alpha4.Conditions, len(*in)) + for i := range *in { + if err := clusterapiapiv1alpha4.Convert_v1beta1_Condition_To_v1alpha4_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + out.Addons = *(*[]AddonState)(unsafe.Pointer(&in.Addons)) + if err := Convert_v1beta1_IdentityProviderStatus_To_v1alpha4_IdentityProviderStatus(&in.IdentityProviderStatus, &out.IdentityProviderStatus, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AWSManagedControlPlaneStatus_To_v1alpha4_AWSManagedControlPlaneStatus is an autogenerated conversion function. +func Convert_v1beta1_AWSManagedControlPlaneStatus_To_v1alpha4_AWSManagedControlPlaneStatus(in *v1beta1.AWSManagedControlPlaneStatus, out *AWSManagedControlPlaneStatus, s conversion.Scope) error { + return autoConvert_v1beta1_AWSManagedControlPlaneStatus_To_v1alpha4_AWSManagedControlPlaneStatus(in, out, s) +} + +func autoConvert_v1alpha4_Addon_To_v1beta1_Addon(in *Addon, out *v1beta1.Addon, s conversion.Scope) error { + out.Name = in.Name + out.Version = in.Version + out.ConflictResolution = (*v1beta1.AddonResolution)(unsafe.Pointer(in.ConflictResolution)) + out.ServiceAccountRoleArn = (*string)(unsafe.Pointer(in.ServiceAccountRoleArn)) + return nil +} + +// Convert_v1alpha4_Addon_To_v1beta1_Addon is an autogenerated conversion function. +func Convert_v1alpha4_Addon_To_v1beta1_Addon(in *Addon, out *v1beta1.Addon, s conversion.Scope) error { + return autoConvert_v1alpha4_Addon_To_v1beta1_Addon(in, out, s) +} + +func autoConvert_v1beta1_Addon_To_v1alpha4_Addon(in *v1beta1.Addon, out *Addon, s conversion.Scope) error { + out.Name = in.Name + out.Version = in.Version + out.ConflictResolution = (*AddonResolution)(unsafe.Pointer(in.ConflictResolution)) + out.ServiceAccountRoleArn = (*string)(unsafe.Pointer(in.ServiceAccountRoleArn)) + return nil +} + +// Convert_v1beta1_Addon_To_v1alpha4_Addon is an autogenerated conversion function. +func Convert_v1beta1_Addon_To_v1alpha4_Addon(in *v1beta1.Addon, out *Addon, s conversion.Scope) error { + return autoConvert_v1beta1_Addon_To_v1alpha4_Addon(in, out, s) +} + +func autoConvert_v1alpha4_AddonIssue_To_v1beta1_AddonIssue(in *AddonIssue, out *v1beta1.AddonIssue, s conversion.Scope) error { + out.Code = (*string)(unsafe.Pointer(in.Code)) + out.Message = (*string)(unsafe.Pointer(in.Message)) + out.ResourceIDs = *(*[]string)(unsafe.Pointer(&in.ResourceIDs)) + return nil +} + +// Convert_v1alpha4_AddonIssue_To_v1beta1_AddonIssue is an autogenerated conversion function. +func Convert_v1alpha4_AddonIssue_To_v1beta1_AddonIssue(in *AddonIssue, out *v1beta1.AddonIssue, s conversion.Scope) error { + return autoConvert_v1alpha4_AddonIssue_To_v1beta1_AddonIssue(in, out, s) +} + +func autoConvert_v1beta1_AddonIssue_To_v1alpha4_AddonIssue(in *v1beta1.AddonIssue, out *AddonIssue, s conversion.Scope) error { + out.Code = (*string)(unsafe.Pointer(in.Code)) + out.Message = (*string)(unsafe.Pointer(in.Message)) + out.ResourceIDs = *(*[]string)(unsafe.Pointer(&in.ResourceIDs)) + return nil +} + +// Convert_v1beta1_AddonIssue_To_v1alpha4_AddonIssue is an autogenerated conversion function. +func Convert_v1beta1_AddonIssue_To_v1alpha4_AddonIssue(in *v1beta1.AddonIssue, out *AddonIssue, s conversion.Scope) error { + return autoConvert_v1beta1_AddonIssue_To_v1alpha4_AddonIssue(in, out, s) +} + +func autoConvert_v1alpha4_AddonState_To_v1beta1_AddonState(in *AddonState, out *v1beta1.AddonState, s conversion.Scope) error { + out.Name = in.Name + out.Version = in.Version + out.ARN = in.ARN + out.ServiceAccountRoleArn = (*string)(unsafe.Pointer(in.ServiceAccountRoleArn)) + out.CreatedAt = in.CreatedAt + out.ModifiedAt = in.ModifiedAt + out.Status = (*string)(unsafe.Pointer(in.Status)) + out.Issues = *(*[]v1beta1.AddonIssue)(unsafe.Pointer(&in.Issues)) + return nil +} + +// Convert_v1alpha4_AddonState_To_v1beta1_AddonState is an autogenerated conversion function. +func Convert_v1alpha4_AddonState_To_v1beta1_AddonState(in *AddonState, out *v1beta1.AddonState, s conversion.Scope) error { + return autoConvert_v1alpha4_AddonState_To_v1beta1_AddonState(in, out, s) +} + +func autoConvert_v1beta1_AddonState_To_v1alpha4_AddonState(in *v1beta1.AddonState, out *AddonState, s conversion.Scope) error { + out.Name = in.Name + out.Version = in.Version + out.ARN = in.ARN + out.ServiceAccountRoleArn = (*string)(unsafe.Pointer(in.ServiceAccountRoleArn)) + out.CreatedAt = in.CreatedAt + out.ModifiedAt = in.ModifiedAt + out.Status = (*string)(unsafe.Pointer(in.Status)) + out.Issues = *(*[]AddonIssue)(unsafe.Pointer(&in.Issues)) + return nil +} + +// Convert_v1beta1_AddonState_To_v1alpha4_AddonState is an autogenerated conversion function. +func Convert_v1beta1_AddonState_To_v1alpha4_AddonState(in *v1beta1.AddonState, out *AddonState, s conversion.Scope) error { + return autoConvert_v1beta1_AddonState_To_v1alpha4_AddonState(in, out, s) +} + +func autoConvert_v1alpha4_ControlPlaneLoggingSpec_To_v1beta1_ControlPlaneLoggingSpec(in *ControlPlaneLoggingSpec, out *v1beta1.ControlPlaneLoggingSpec, s conversion.Scope) error { + out.APIServer = in.APIServer + out.Audit = in.Audit + out.Authenticator = in.Authenticator + out.ControllerManager = in.ControllerManager + out.Scheduler = in.Scheduler + return nil +} + +// Convert_v1alpha4_ControlPlaneLoggingSpec_To_v1beta1_ControlPlaneLoggingSpec is an autogenerated conversion function. +func Convert_v1alpha4_ControlPlaneLoggingSpec_To_v1beta1_ControlPlaneLoggingSpec(in *ControlPlaneLoggingSpec, out *v1beta1.ControlPlaneLoggingSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_ControlPlaneLoggingSpec_To_v1beta1_ControlPlaneLoggingSpec(in, out, s) +} + +func autoConvert_v1beta1_ControlPlaneLoggingSpec_To_v1alpha4_ControlPlaneLoggingSpec(in *v1beta1.ControlPlaneLoggingSpec, out *ControlPlaneLoggingSpec, s conversion.Scope) error { + out.APIServer = in.APIServer + out.Audit = in.Audit + out.Authenticator = in.Authenticator + out.ControllerManager = in.ControllerManager + out.Scheduler = in.Scheduler + return nil +} + +// Convert_v1beta1_ControlPlaneLoggingSpec_To_v1alpha4_ControlPlaneLoggingSpec is an autogenerated conversion function. +func Convert_v1beta1_ControlPlaneLoggingSpec_To_v1alpha4_ControlPlaneLoggingSpec(in *v1beta1.ControlPlaneLoggingSpec, out *ControlPlaneLoggingSpec, s conversion.Scope) error { + return autoConvert_v1beta1_ControlPlaneLoggingSpec_To_v1alpha4_ControlPlaneLoggingSpec(in, out, s) +} + +func autoConvert_v1alpha4_EncryptionConfig_To_v1beta1_EncryptionConfig(in *EncryptionConfig, out *v1beta1.EncryptionConfig, s conversion.Scope) error { + out.Provider = (*string)(unsafe.Pointer(in.Provider)) + out.Resources = *(*[]*string)(unsafe.Pointer(&in.Resources)) + return nil +} + +// Convert_v1alpha4_EncryptionConfig_To_v1beta1_EncryptionConfig is an autogenerated conversion function. +func Convert_v1alpha4_EncryptionConfig_To_v1beta1_EncryptionConfig(in *EncryptionConfig, out *v1beta1.EncryptionConfig, s conversion.Scope) error { + return autoConvert_v1alpha4_EncryptionConfig_To_v1beta1_EncryptionConfig(in, out, s) +} + +func autoConvert_v1beta1_EncryptionConfig_To_v1alpha4_EncryptionConfig(in *v1beta1.EncryptionConfig, out *EncryptionConfig, s conversion.Scope) error { + out.Provider = (*string)(unsafe.Pointer(in.Provider)) + out.Resources = *(*[]*string)(unsafe.Pointer(&in.Resources)) + return nil +} + +// Convert_v1beta1_EncryptionConfig_To_v1alpha4_EncryptionConfig is an autogenerated conversion function. +func Convert_v1beta1_EncryptionConfig_To_v1alpha4_EncryptionConfig(in *v1beta1.EncryptionConfig, out *EncryptionConfig, s conversion.Scope) error { + return autoConvert_v1beta1_EncryptionConfig_To_v1alpha4_EncryptionConfig(in, out, s) +} + +func autoConvert_v1alpha4_EndpointAccess_To_v1beta1_EndpointAccess(in *EndpointAccess, out *v1beta1.EndpointAccess, s conversion.Scope) error { + out.Public = (*bool)(unsafe.Pointer(in.Public)) + out.PublicCIDRs = *(*[]*string)(unsafe.Pointer(&in.PublicCIDRs)) + out.Private = (*bool)(unsafe.Pointer(in.Private)) + return nil +} + +// Convert_v1alpha4_EndpointAccess_To_v1beta1_EndpointAccess is an autogenerated conversion function. +func Convert_v1alpha4_EndpointAccess_To_v1beta1_EndpointAccess(in *EndpointAccess, out *v1beta1.EndpointAccess, s conversion.Scope) error { + return autoConvert_v1alpha4_EndpointAccess_To_v1beta1_EndpointAccess(in, out, s) +} + +func autoConvert_v1beta1_EndpointAccess_To_v1alpha4_EndpointAccess(in *v1beta1.EndpointAccess, out *EndpointAccess, s conversion.Scope) error { + out.Public = (*bool)(unsafe.Pointer(in.Public)) + out.PublicCIDRs = *(*[]*string)(unsafe.Pointer(&in.PublicCIDRs)) + out.Private = (*bool)(unsafe.Pointer(in.Private)) + return nil +} + +// Convert_v1beta1_EndpointAccess_To_v1alpha4_EndpointAccess is an autogenerated conversion function. +func Convert_v1beta1_EndpointAccess_To_v1alpha4_EndpointAccess(in *v1beta1.EndpointAccess, out *EndpointAccess, s conversion.Scope) error { + return autoConvert_v1beta1_EndpointAccess_To_v1alpha4_EndpointAccess(in, out, s) +} + +func autoConvert_v1alpha4_IAMAuthenticatorConfig_To_v1beta1_IAMAuthenticatorConfig(in *IAMAuthenticatorConfig, out *v1beta1.IAMAuthenticatorConfig, s conversion.Scope) error { + out.RoleMappings = *(*[]v1beta1.RoleMapping)(unsafe.Pointer(&in.RoleMappings)) + out.UserMappings = *(*[]v1beta1.UserMapping)(unsafe.Pointer(&in.UserMappings)) + return nil +} + +// Convert_v1alpha4_IAMAuthenticatorConfig_To_v1beta1_IAMAuthenticatorConfig is an autogenerated conversion function. +func Convert_v1alpha4_IAMAuthenticatorConfig_To_v1beta1_IAMAuthenticatorConfig(in *IAMAuthenticatorConfig, out *v1beta1.IAMAuthenticatorConfig, s conversion.Scope) error { + return autoConvert_v1alpha4_IAMAuthenticatorConfig_To_v1beta1_IAMAuthenticatorConfig(in, out, s) +} + +func autoConvert_v1beta1_IAMAuthenticatorConfig_To_v1alpha4_IAMAuthenticatorConfig(in *v1beta1.IAMAuthenticatorConfig, out *IAMAuthenticatorConfig, s conversion.Scope) error { + out.RoleMappings = *(*[]RoleMapping)(unsafe.Pointer(&in.RoleMappings)) + out.UserMappings = *(*[]UserMapping)(unsafe.Pointer(&in.UserMappings)) + return nil +} + +// Convert_v1beta1_IAMAuthenticatorConfig_To_v1alpha4_IAMAuthenticatorConfig is an autogenerated conversion function. +func Convert_v1beta1_IAMAuthenticatorConfig_To_v1alpha4_IAMAuthenticatorConfig(in *v1beta1.IAMAuthenticatorConfig, out *IAMAuthenticatorConfig, s conversion.Scope) error { + return autoConvert_v1beta1_IAMAuthenticatorConfig_To_v1alpha4_IAMAuthenticatorConfig(in, out, s) +} + +func autoConvert_v1alpha4_IdentityProviderStatus_To_v1beta1_IdentityProviderStatus(in *IdentityProviderStatus, out *v1beta1.IdentityProviderStatus, s conversion.Scope) error { + out.ARN = in.ARN + out.Status = in.Status + return nil +} + +// Convert_v1alpha4_IdentityProviderStatus_To_v1beta1_IdentityProviderStatus is an autogenerated conversion function. +func Convert_v1alpha4_IdentityProviderStatus_To_v1beta1_IdentityProviderStatus(in *IdentityProviderStatus, out *v1beta1.IdentityProviderStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_IdentityProviderStatus_To_v1beta1_IdentityProviderStatus(in, out, s) +} + +func autoConvert_v1beta1_IdentityProviderStatus_To_v1alpha4_IdentityProviderStatus(in *v1beta1.IdentityProviderStatus, out *IdentityProviderStatus, s conversion.Scope) error { + out.ARN = in.ARN + out.Status = in.Status + return nil +} + +// Convert_v1beta1_IdentityProviderStatus_To_v1alpha4_IdentityProviderStatus is an autogenerated conversion function. +func Convert_v1beta1_IdentityProviderStatus_To_v1alpha4_IdentityProviderStatus(in *v1beta1.IdentityProviderStatus, out *IdentityProviderStatus, s conversion.Scope) error { + return autoConvert_v1beta1_IdentityProviderStatus_To_v1alpha4_IdentityProviderStatus(in, out, s) +} + +func autoConvert_v1alpha4_KubernetesMapping_To_v1beta1_KubernetesMapping(in *KubernetesMapping, out *v1beta1.KubernetesMapping, s conversion.Scope) error { + out.UserName = in.UserName + out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) + return nil +} + +// Convert_v1alpha4_KubernetesMapping_To_v1beta1_KubernetesMapping is an autogenerated conversion function. +func Convert_v1alpha4_KubernetesMapping_To_v1beta1_KubernetesMapping(in *KubernetesMapping, out *v1beta1.KubernetesMapping, s conversion.Scope) error { + return autoConvert_v1alpha4_KubernetesMapping_To_v1beta1_KubernetesMapping(in, out, s) +} + +func autoConvert_v1beta1_KubernetesMapping_To_v1alpha4_KubernetesMapping(in *v1beta1.KubernetesMapping, out *KubernetesMapping, s conversion.Scope) error { + out.UserName = in.UserName + out.Groups = *(*[]string)(unsafe.Pointer(&in.Groups)) + return nil +} + +// Convert_v1beta1_KubernetesMapping_To_v1alpha4_KubernetesMapping is an autogenerated conversion function. +func Convert_v1beta1_KubernetesMapping_To_v1alpha4_KubernetesMapping(in *v1beta1.KubernetesMapping, out *KubernetesMapping, s conversion.Scope) error { + return autoConvert_v1beta1_KubernetesMapping_To_v1alpha4_KubernetesMapping(in, out, s) +} + +func autoConvert_v1alpha4_OIDCIdentityProviderConfig_To_v1beta1_OIDCIdentityProviderConfig(in *OIDCIdentityProviderConfig, out *v1beta1.OIDCIdentityProviderConfig, s conversion.Scope) error { + out.ClientID = in.ClientID + out.GroupsClaim = (*string)(unsafe.Pointer(in.GroupsClaim)) + out.GroupsPrefix = (*string)(unsafe.Pointer(in.GroupsPrefix)) + out.IdentityProviderConfigName = in.IdentityProviderConfigName + out.IssuerURL = in.IssuerURL + out.RequiredClaims = *(*map[string]string)(unsafe.Pointer(&in.RequiredClaims)) + out.UsernameClaim = (*string)(unsafe.Pointer(in.UsernameClaim)) + out.UsernamePrefix = (*string)(unsafe.Pointer(in.UsernamePrefix)) + out.Tags = *(*apiv1beta1.Tags)(unsafe.Pointer(&in.Tags)) + return nil +} + +// Convert_v1alpha4_OIDCIdentityProviderConfig_To_v1beta1_OIDCIdentityProviderConfig is an autogenerated conversion function. +func Convert_v1alpha4_OIDCIdentityProviderConfig_To_v1beta1_OIDCIdentityProviderConfig(in *OIDCIdentityProviderConfig, out *v1beta1.OIDCIdentityProviderConfig, s conversion.Scope) error { + return autoConvert_v1alpha4_OIDCIdentityProviderConfig_To_v1beta1_OIDCIdentityProviderConfig(in, out, s) +} + +func autoConvert_v1beta1_OIDCIdentityProviderConfig_To_v1alpha4_OIDCIdentityProviderConfig(in *v1beta1.OIDCIdentityProviderConfig, out *OIDCIdentityProviderConfig, s conversion.Scope) error { + out.ClientID = in.ClientID + out.GroupsClaim = (*string)(unsafe.Pointer(in.GroupsClaim)) + out.GroupsPrefix = (*string)(unsafe.Pointer(in.GroupsPrefix)) + out.IdentityProviderConfigName = in.IdentityProviderConfigName + out.IssuerURL = in.IssuerURL + out.RequiredClaims = *(*map[string]string)(unsafe.Pointer(&in.RequiredClaims)) + out.UsernameClaim = (*string)(unsafe.Pointer(in.UsernameClaim)) + out.UsernamePrefix = (*string)(unsafe.Pointer(in.UsernamePrefix)) + out.Tags = *(*apiv1alpha4.Tags)(unsafe.Pointer(&in.Tags)) + return nil +} + +// Convert_v1beta1_OIDCIdentityProviderConfig_To_v1alpha4_OIDCIdentityProviderConfig is an autogenerated conversion function. +func Convert_v1beta1_OIDCIdentityProviderConfig_To_v1alpha4_OIDCIdentityProviderConfig(in *v1beta1.OIDCIdentityProviderConfig, out *OIDCIdentityProviderConfig, s conversion.Scope) error { + return autoConvert_v1beta1_OIDCIdentityProviderConfig_To_v1alpha4_OIDCIdentityProviderConfig(in, out, s) +} + +func autoConvert_v1alpha4_OIDCProviderStatus_To_v1beta1_OIDCProviderStatus(in *OIDCProviderStatus, out *v1beta1.OIDCProviderStatus, s conversion.Scope) error { + out.ARN = in.ARN + out.TrustPolicy = in.TrustPolicy + return nil +} + +// Convert_v1alpha4_OIDCProviderStatus_To_v1beta1_OIDCProviderStatus is an autogenerated conversion function. +func Convert_v1alpha4_OIDCProviderStatus_To_v1beta1_OIDCProviderStatus(in *OIDCProviderStatus, out *v1beta1.OIDCProviderStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_OIDCProviderStatus_To_v1beta1_OIDCProviderStatus(in, out, s) +} + +func autoConvert_v1beta1_OIDCProviderStatus_To_v1alpha4_OIDCProviderStatus(in *v1beta1.OIDCProviderStatus, out *OIDCProviderStatus, s conversion.Scope) error { + out.ARN = in.ARN + out.TrustPolicy = in.TrustPolicy + return nil +} + +// Convert_v1beta1_OIDCProviderStatus_To_v1alpha4_OIDCProviderStatus is an autogenerated conversion function. +func Convert_v1beta1_OIDCProviderStatus_To_v1alpha4_OIDCProviderStatus(in *v1beta1.OIDCProviderStatus, out *OIDCProviderStatus, s conversion.Scope) error { + return autoConvert_v1beta1_OIDCProviderStatus_To_v1alpha4_OIDCProviderStatus(in, out, s) +} + +func autoConvert_v1alpha4_RoleMapping_To_v1beta1_RoleMapping(in *RoleMapping, out *v1beta1.RoleMapping, s conversion.Scope) error { + out.RoleARN = in.RoleARN + if err := Convert_v1alpha4_KubernetesMapping_To_v1beta1_KubernetesMapping(&in.KubernetesMapping, &out.KubernetesMapping, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_RoleMapping_To_v1beta1_RoleMapping is an autogenerated conversion function. +func Convert_v1alpha4_RoleMapping_To_v1beta1_RoleMapping(in *RoleMapping, out *v1beta1.RoleMapping, s conversion.Scope) error { + return autoConvert_v1alpha4_RoleMapping_To_v1beta1_RoleMapping(in, out, s) +} + +func autoConvert_v1beta1_RoleMapping_To_v1alpha4_RoleMapping(in *v1beta1.RoleMapping, out *RoleMapping, s conversion.Scope) error { + out.RoleARN = in.RoleARN + if err := Convert_v1beta1_KubernetesMapping_To_v1alpha4_KubernetesMapping(&in.KubernetesMapping, &out.KubernetesMapping, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_RoleMapping_To_v1alpha4_RoleMapping is an autogenerated conversion function. +func Convert_v1beta1_RoleMapping_To_v1alpha4_RoleMapping(in *v1beta1.RoleMapping, out *RoleMapping, s conversion.Scope) error { + return autoConvert_v1beta1_RoleMapping_To_v1alpha4_RoleMapping(in, out, s) +} + +func autoConvert_v1alpha4_UserMapping_To_v1beta1_UserMapping(in *UserMapping, out *v1beta1.UserMapping, s conversion.Scope) error { + out.UserARN = in.UserARN + if err := Convert_v1alpha4_KubernetesMapping_To_v1beta1_KubernetesMapping(&in.KubernetesMapping, &out.KubernetesMapping, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_UserMapping_To_v1beta1_UserMapping is an autogenerated conversion function. +func Convert_v1alpha4_UserMapping_To_v1beta1_UserMapping(in *UserMapping, out *v1beta1.UserMapping, s conversion.Scope) error { + return autoConvert_v1alpha4_UserMapping_To_v1beta1_UserMapping(in, out, s) +} + +func autoConvert_v1beta1_UserMapping_To_v1alpha4_UserMapping(in *v1beta1.UserMapping, out *UserMapping, s conversion.Scope) error { + out.UserARN = in.UserARN + if err := Convert_v1beta1_KubernetesMapping_To_v1alpha4_KubernetesMapping(&in.KubernetesMapping, &out.KubernetesMapping, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_UserMapping_To_v1alpha4_UserMapping is an autogenerated conversion function. +func Convert_v1beta1_UserMapping_To_v1alpha4_UserMapping(in *v1beta1.UserMapping, out *UserMapping, s conversion.Scope) error { + return autoConvert_v1beta1_UserMapping_To_v1alpha4_UserMapping(in, out, s) +} diff --git a/controlplane/eks/api/v1beta1/awsmanagedcontrolplane_types.go b/controlplane/eks/api/v1beta1/awsmanagedcontrolplane_types.go new file mode 100644 index 0000000000..964ee448a9 --- /dev/null +++ b/controlplane/eks/api/v1beta1/awsmanagedcontrolplane_types.go @@ -0,0 +1,289 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" +) + +const ( + // ManagedControlPlaneFinalizer allows the controller to clean up resources on delete. + ManagedControlPlaneFinalizer = "awsmanagedcontrolplane.controlplane.cluster.x-k8s.io" +) + +// AWSManagedControlPlaneSpec defines the desired state of an Amazon EKS Cluster. +type AWSManagedControlPlaneSpec struct { //nolint: maligned + // EKSClusterName allows you to specify the name of the EKS cluster in + // AWS. If you don't specify a name then a default name will be created + // based on the namespace and name of the managed control plane. + // +optional + EKSClusterName string `json:"eksClusterName,omitempty"` + + // IdentityRef is a reference to a identity to be used when reconciling the managed control plane. + // +optional + IdentityRef *infrav1.AWSIdentityReference `json:"identityRef,omitempty"` + + // NetworkSpec encapsulates all things related to AWS network. + NetworkSpec infrav1.NetworkSpec `json:"network,omitempty"` + + // SecondaryCidrBlock is the additional CIDR range to use for pod IPs. + // Must be within the 100.64.0.0/10 or 198.19.0.0/16 range. + // +optional + SecondaryCidrBlock *string `json:"secondaryCidrBlock,omitempty"` + + // The AWS Region the cluster lives in. + Region string `json:"region,omitempty"` + + // SSHKeyName is the name of the ssh key to attach to the bastion host. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name) + // +optional + SSHKeyName *string `json:"sshKeyName,omitempty"` + + // Version defines the desired Kubernetes version. If no version number + // is supplied then the latest version of Kubernetes that EKS supports + // will be used. + // +kubebuilder:validation:MinLength:=2 + // +kubebuilder:validation:Pattern:=^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.?$ + // +optional + Version *string `json:"version,omitempty"` + + // RoleName specifies the name of IAM role that gives EKS + // permission to make API calls. If the role is pre-existing + // we will treat it as unmanaged and not delete it on + // deletion. If the EKSEnableIAM feature flag is true + // and no name is supplied then a role is created. + // +kubebuilder:validation:MinLength:=2 + // +optional + RoleName *string `json:"roleName,omitempty"` + + // RoleAdditionalPolicies allows you to attach additional polices to + // the control plane role. You must enable the EKSAllowAddRoles + // feature flag to incorporate these into the created role. + // +optional + RoleAdditionalPolicies *[]string `json:"roleAdditionalPolicies,omitempty"` + + // Logging specifies which EKS Cluster logs should be enabled. Entries for + // each of the enabled logs will be sent to CloudWatch + // +optional + Logging *ControlPlaneLoggingSpec `json:"logging,omitempty"` + + // EncryptionConfig specifies the encryption configuration for the cluster + // +optional + EncryptionConfig *EncryptionConfig `json:"encryptionConfig,omitempty"` + + // AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the + // ones added by default. + // +optional + AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` + + // IAMAuthenticatorConfig allows the specification of any additional user or role mappings + // for use when generating the aws-iam-authenticator configuration. If this is nil the + // default configuration is still generated for the cluster. + // +optional + IAMAuthenticatorConfig *IAMAuthenticatorConfig `json:"iamAuthenticatorConfig,omitempty"` + + // Endpoints specifies access to this cluster's control plane endpoints + // +optional + EndpointAccess EndpointAccess `json:"endpointAccess,omitempty"` + + // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. + // +optional + ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"` + + // ImageLookupFormat is the AMI naming format to look up machine images when + // a machine does not specify an AMI. When set, this will be used for all + // cluster machines unless a machine specifies a different ImageLookupOrg. + // Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base + // OS and kubernetes version, respectively. The BaseOS will be the value in + // ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as + // defined by the packages produced by kubernetes/release without v as a + // prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default + // image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up + // searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a + // Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See + // also: https://golang.org/pkg/text/template/ + // +optional + ImageLookupFormat string `json:"imageLookupFormat,omitempty"` + + // ImageLookupOrg is the AWS Organization ID to look up machine images when a + // machine does not specify an AMI. When set, this will be used for all + // cluster machines unless a machine specifies a different ImageLookupOrg. + // +optional + ImageLookupOrg string `json:"imageLookupOrg,omitempty"` + + // ImageLookupBaseOS is the name of the base operating system used to look + // up machine images when a machine does not specify an AMI. When set, this + // will be used for all cluster machines unless a machine specifies a + // different ImageLookupBaseOS. + ImageLookupBaseOS string `json:"imageLookupBaseOS,omitempty"` + + // Bastion contains options to configure the bastion host. + // +optional + Bastion infrav1.Bastion `json:"bastion"` + + // TokenMethod is used to specify the method for obtaining a client token for communicating with EKS + // iam-authenticator - obtains a client token using iam-authentictor + // aws-cli - obtains a client token using the AWS CLI + // Defaults to iam-authenticator + // +kubebuilder:default=iam-authenticator + // +kubebuilder:validation:Enum=iam-authenticator;aws-cli + TokenMethod *EKSTokenMethod `json:"tokenMethod,omitempty"` + + // AssociateOIDCProvider can be enabled to automatically create an identity + // provider for the controller for use with IAM roles for service accounts + // +kubebuilder:default=false + AssociateOIDCProvider bool `json:"associateOIDCProvider,omitempty"` + + // Addons defines the EKS addons to enable with the EKS cluster. + // +optional + Addons *[]Addon `json:"addons,omitempty"` + + // IdentityProviderconfig is used to specify the oidc provider config + // to be attached with this eks cluster + // +optional + OIDCIdentityProviderConfig *OIDCIdentityProviderConfig `json:"oidcIdentityProviderConfig,omitempty"` + + // DisableVPCCNI indcates the the Amazon VPC CNI should be disabled. With EKS clusters that + // the Amazon VPC CNI is automatically installed into the cluster. For clusters where you want + // to use an alternate CNI this option provides a way to specify that the Amazon VPC CNI + // should be deleted. You cannot set this to true if you are using the + // Amazon VPC CNI addon or if you have specified a secondary CIDR block. + // +kubebuilder:default=false + DisableVPCCNI bool `json:"disableVPCCNI,omitempty"` +} + +// EndpointAccess specifies how control plane endpoints are accessible. +type EndpointAccess struct { + // Public controls whether control plane endpoints are publicly accessible + // +optional + Public *bool `json:"public,omitempty"` + // PublicCIDRs specifies which blocks can access the public endpoint + // +optional + PublicCIDRs []*string `json:"publicCIDRs,omitempty"` + // Private points VPC-internal control plane access to the private endpoint + // +optional + Private *bool `json:"private,omitempty"` +} + +// EncryptionConfig specifies the encryption configuration for the EKS clsuter. +type EncryptionConfig struct { + // Provider specifies the ARN or alias of the CMK (in AWS KMS) + Provider *string `json:"provider,omitempty"` + // Resources specifies the resources to be encrypted + Resources []*string `json:"resources,omitempty"` +} + +// OIDCProviderStatus holds the status of the AWS OIDC identity provider. +type OIDCProviderStatus struct { + // ARN holds the ARN of the provider + ARN string `json:"arn,omitempty"` + // TrustPolicy contains the boilerplate IAM trust policy to use for IRSA + TrustPolicy string `json:"trustPolicy,omitempty"` +} + +type IdentityProviderStatus struct { + // ARN holds the ARN of associated identity provider + ARN string `json:"arn,omitempty"` + + // Status holds current status of associated identity provider + Status string `json:"status,omitempty"` +} + +// AWSManagedControlPlaneStatus defines the observed state of an Amazon EKS Cluster. +type AWSManagedControlPlaneStatus struct { + // Networks holds details about the AWS networking resources used by the control plane + // +optional + Network infrav1.NetworkStatus `json:"networkStatus,omitempty"` + // FailureDomains specifies a list fo available availability zones that can be used + // +optional + FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"` + // Bastion holds details of the instance that is used as a bastion jump box + // +optional + Bastion *infrav1.Instance `json:"bastion,omitempty"` + // OIDCProvider holds the status of the identity provider for this cluster + // +optional + OIDCProvider OIDCProviderStatus `json:"oidcProvider,omitempty"` + // ExternalManagedControlPlane indicates to cluster-api that the control plane + // is managed by an external service such as AKS, EKS, GKE, etc. + // +kubebuilder:default=true + ExternalManagedControlPlane *bool `json:"externalManagedControlPlane,omitempty"` + // Initialized denotes whether or not the control plane has the + // uploaded kubernetes config-map. + // +optional + Initialized bool `json:"initialized"` + // Ready denotes that the AWSManagedControlPlane API Server is ready to + // receive requests and that the VPC infra is ready. + // +kubebuilder:default=false + Ready bool `json:"ready"` + // 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"` + // Conditions specifies the cpnditions for the managed control plane + Conditions clusterv1.Conditions `json:"conditions,omitempty"` + // Addons holds the current status of the EKS addons + // +optional + Addons []AddonState `json:"addons,omitempty"` + // IdentityProviderStatus holds the status for + // associated identity provider + // +optional + IdentityProviderStatus IdentityProviderStatus `json:"identityProviderStatus,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsmanagedcontrolplanes,shortName=awsmcp,scope=Namespaced,categories=cluster-api,shortName=awsmcp +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Cluster",type="string",JSONPath=".metadata.labels.cluster\\.x-k8s\\.io/cluster-name",description="Cluster to which this AWSManagedControl belongs" +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Control plane infrastructure is ready for worker nodes" +// +kubebuilder:printcolumn:name="VPC",type="string",JSONPath=".spec.network.vpc.id",description="AWS VPC the control plane is using" +// +kubebuilder:printcolumn:name="Endpoint",type="string",JSONPath=".spec.controlPlaneEndpoint.host",description="API Endpoint",priority=1 +// +kubebuilder:printcolumn:name="Bastion IP",type="string",JSONPath=".status.bastion.publicIp",description="Bastion IP address for breakglass access" + +// AWSManagedControlPlane is the schema for the Amazon EKS Managed Control Plane API. +type AWSManagedControlPlane struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AWSManagedControlPlaneSpec `json:"spec,omitempty"` + Status AWSManagedControlPlaneStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// AWSManagedControlPlaneList contains a list of Amazon EKS Managed Control Planes. +type AWSManagedControlPlaneList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSManagedControlPlane `json:"items"` +} + +// GetConditions returns the control planes conditions. +func (r *AWSManagedControlPlane) GetConditions() clusterv1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the status conditions for the AWSManagedControlPlane. +func (r *AWSManagedControlPlane) SetConditions(conditions clusterv1.Conditions) { + r.Status.Conditions = conditions +} + +func init() { + SchemeBuilder.Register(&AWSManagedControlPlane{}, &AWSManagedControlPlaneList{}) +} diff --git a/controlplane/eks/api/v1alpha4/awsmanagedcontrolplane_webhook.go b/controlplane/eks/api/v1beta1/awsmanagedcontrolplane_webhook.go similarity index 94% rename from controlplane/eks/api/v1alpha4/awsmanagedcontrolplane_webhook.go rename to controlplane/eks/api/v1beta1/awsmanagedcontrolplane_webhook.go index 5be51e7d20..e8d448634d 100644 --- a/controlplane/eks/api/v1alpha4/awsmanagedcontrolplane_webhook.go +++ b/controlplane/eks/api/v1beta1/awsmanagedcontrolplane_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "fmt" @@ -26,7 +26,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apimachinery/pkg/util/version" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/eks" ctrl "sigs.k8s.io/controller-runtime" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -54,8 +54,8 @@ func (r *AWSManagedControlPlane) SetupWebhookWithManager(mgr ctrl.Manager) error Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-controlplane-cluster-x-k8s-io-v1alpha4-awsmanagedcontrolplane,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=controlplane.cluster.x-k8s.io,resources=awsmanagedcontrolplanes,versions=v1alpha4,name=validation.awsmanagedcontrolplanes.controlplane.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-controlplane-cluster-x-k8s-io-v1alpha4-awsmanagedcontrolplane,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=controlplane.cluster.x-k8s.io,resources=awsmanagedcontrolplanes,versions=v1alpha4,name=default.awsmanagedcontrolplanes.controlplane.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-controlplane-cluster-x-k8s-io-v1beta1-awsmanagedcontrolplane,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=controlplane.cluster.x-k8s.io,resources=awsmanagedcontrolplanes,versions=v1beta1,name=validation.awsmanagedcontrolplanes.controlplane.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-controlplane-cluster-x-k8s-io-v1beta1-awsmanagedcontrolplane,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=controlplane.cluster.x-k8s.io,resources=awsmanagedcontrolplanes,versions=v1beta1,name=default.awsmanagedcontrolplanes.controlplane.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 var _ webhook.Defaulter = &AWSManagedControlPlane{} var _ webhook.Validator = &AWSManagedControlPlane{} diff --git a/controlplane/eks/api/v1alpha4/awsmanagedcontrolplane_webhook_test.go b/controlplane/eks/api/v1beta1/awsmanagedcontrolplane_webhook_test.go similarity index 99% rename from controlplane/eks/api/v1alpha4/awsmanagedcontrolplane_webhook_test.go rename to controlplane/eks/api/v1beta1/awsmanagedcontrolplane_webhook_test.go index c14d68ef4b..f64492c83e 100644 --- a/controlplane/eks/api/v1alpha4/awsmanagedcontrolplane_webhook_test.go +++ b/controlplane/eks/api/v1beta1/awsmanagedcontrolplane_webhook_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "context" @@ -27,7 +27,7 @@ import ( "github.com/aws/aws-sdk-go/aws" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" utildefaulting "sigs.k8s.io/cluster-api/util/defaulting" ) diff --git a/controlplane/eks/api/v1beta1/conditions_consts.go b/controlplane/eks/api/v1beta1/conditions_consts.go new file mode 100644 index 0000000000..32a69cf2e0 --- /dev/null +++ b/controlplane/eks/api/v1beta1/conditions_consts.go @@ -0,0 +1,60 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + +const ( + // EKSControlPlaneReadyCondition condition reports on the successful reconciliation of eks control plane. + EKSControlPlaneReadyCondition clusterv1.ConditionType = "EKSControlPlaneReady" + // EKSControlPlaneCreatingCondition condition reports on whether the eks + // control plane is creating. + EKSControlPlaneCreatingCondition clusterv1.ConditionType = "EKSControlPlaneCreating" + // EKSControlPlaneUpdatingCondition condition reports on whether the eks + // control plane is updating. + EKSControlPlaneUpdatingCondition clusterv1.ConditionType = "EKSControlPlaneUpdating" + // EKSControlPlaneReconciliationFailedReason used to report failures while reconciling EKS control plane. + EKSControlPlaneReconciliationFailedReason = "EKSControlPlaneReconciliationFailed" +) + +const ( + // IAMControlPlaneRolesReadyCondition condition reports on the successful reconciliation of eks control plane iam roles. + IAMControlPlaneRolesReadyCondition clusterv1.ConditionType = "IAMControlPlaneRolesReady" + // IAMControlPlaneRolesReconciliationFailedReason used to report failures while reconciling EKS control plane iam roles. + IAMControlPlaneRolesReconciliationFailedReason = "IAMControlPlaneRolesReconciliationFailed" +) + +const ( + // IAMAuthenticatorConfiguredCondition condition reports on the successful reconciliation of aws-iam-authenticator config. + IAMAuthenticatorConfiguredCondition clusterv1.ConditionType = "IAMAuthenticatorConfigured" + // IAMAuthenticatorConfigurationFailedReason used to report failures while reconciling the aws-iam-authenticator config. + IAMAuthenticatorConfigurationFailedReason = "IAMAuthenticatorConfigurationFailed" +) + +const ( + // EKSAddonsConfiguredCondition condition reports on the successful reconciliation of EKS addons. + EKSAddonsConfiguredCondition clusterv1.ConditionType = "EKSAddonsConfigured" + // EKSAddonsConfiguredFailedReason used to report failures while reconciling the EKS addons. + EKSAddonsConfiguredFailedReason = "EKSAddonsConfiguredFailed" +) + +const ( + // EKSIdentityProviderConfiguredCondition condition reports on the successful association of identity provider config. + EKSIdentityProviderConfiguredCondition clusterv1.ConditionType = "EKSIdentityProviderConfigured" + // EKSIdentityProviderConfiguredFailedReason used to report failures while reconciling the identity provider config association. + EKSIdentityProviderConfiguredFailedReason = "EKSIdentityProviderConfiguredFailed" +) diff --git a/controlplane/eks/api/v1beta1/conversion.go b/controlplane/eks/api/v1beta1/conversion.go new file mode 100644 index 0000000000..9b9298f7ce --- /dev/null +++ b/controlplane/eks/api/v1beta1/conversion.go @@ -0,0 +1,23 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +// Hub marks AWSManagedControlPlane as a conversion hub. +func (*AWSManagedControlPlane) Hub() {} + +// Hub marks AWSManagedControlPlaneList as a conversion hub. +func (*AWSManagedControlPlaneList) Hub() {} diff --git a/controlplane/eks/api/v1beta1/doc.go b/controlplane/eks/api/v1beta1/doc.go new file mode 100644 index 0000000000..55b80e6a7a --- /dev/null +++ b/controlplane/eks/api/v1beta1/doc.go @@ -0,0 +1,21 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1beta1 contains API Schema definitions for the controlplane v1beta1 API group +// +gencrdrefdocs:force +// +groupName=controlplane.cluster.x-k8s.io +// +k8s:defaulter-gen=TypeMeta +package v1beta1 diff --git a/controlplane/eks/api/v1beta1/groupversion_info.go b/controlplane/eks/api/v1beta1/groupversion_info.go new file mode 100644 index 0000000000..ae389585f2 --- /dev/null +++ b/controlplane/eks/api/v1beta1/groupversion_info.go @@ -0,0 +1,36 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1beta1 contains API Schema definitions for the controlplane v1beta1 API group +// +kubebuilder:object:generate=true +// +groupName=controlplane.cluster.x-k8s.io +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects. + GroupVersion = schema.GroupVersion{Group: "controlplane.cluster.x-k8s.io", Version: "v1beta1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/controlplane/eks/api/v1alpha4/suite_test.go b/controlplane/eks/api/v1beta1/suite_test.go similarity index 99% rename from controlplane/eks/api/v1alpha4/suite_test.go rename to controlplane/eks/api/v1beta1/suite_test.go index 06fc483659..fe5e032183 100644 --- a/controlplane/eks/api/v1alpha4/suite_test.go +++ b/controlplane/eks/api/v1beta1/suite_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "fmt" diff --git a/controlplane/eks/api/v1beta1/types.go b/controlplane/eks/api/v1beta1/types.go new file mode 100644 index 0000000000..676122e624 --- /dev/null +++ b/controlplane/eks/api/v1beta1/types.go @@ -0,0 +1,279 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/service/eks" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" +) + +// ControlPlaneLoggingSpec defines what EKS control plane logs that should be enabled. +type ControlPlaneLoggingSpec struct { + // APIServer indicates if the Kubernetes API Server log (kube-apiserver) shoulkd be enabled + // +kubebuilder:default=false + APIServer bool `json:"apiServer"` + // Audit indicates if the Kubernetes API audit log should be enabled + // +kubebuilder:default=false + Audit bool `json:"audit"` + // Authenticator indicates if the iam authenticator log should be enabled + // +kubebuilder:default=false + Authenticator bool `json:"authenticator"` + // ControllerManager indicates if the controller manager (kube-controller-manager) log should be enabled + // +kubebuilder:default=false + ControllerManager bool `json:"controllerManager"` + // Scheduler indicates if the Kubernetes scheduler (kube-scheduler) log should be enabled + // +kubebuilder:default=false + Scheduler bool `json:"scheduler"` +} + +// IsLogEnabled returns true if the log is enabled. +func (s *ControlPlaneLoggingSpec) IsLogEnabled(logName string) bool { + if s == nil { + return false + } + + switch logName { + case eks.LogTypeApi: + return s.APIServer + case eks.LogTypeAudit: + return s.Audit + case eks.LogTypeAuthenticator: + return s.Authenticator + case eks.LogTypeControllerManager: + return s.ControllerManager + case eks.LogTypeScheduler: + return s.Scheduler + default: + return false + } +} + +// EKSTokenMethod defines the method for obtaining a client token to use when connecting to EKS. +type EKSTokenMethod string + +var ( + // EKSTokenMethodIAMAuthenticator indicates that IAM autenticator will be used to get a token. + EKSTokenMethodIAMAuthenticator = EKSTokenMethod("iam-authenticator") + + // EKSTokenMethodAWSCli indicates that the AWS CLI will be used to get a token + // Version 1.16.156 or greater is required of the AWS CLI. + EKSTokenMethodAWSCli = EKSTokenMethod("aws-cli") +) + +var ( + // DefaultEKSControlPlaneRole is the name of the default IAM role to use for the EKS control plane + // if no other role is supplied in the spec and if iam role creation is not enabled. The default + // can be created using clusterawsadm or created manually. + DefaultEKSControlPlaneRole = fmt.Sprintf("eks-controlplane%s", iamv1.DefaultNameSuffix) +) + +// IAMAuthenticatorConfig represents an aws-iam-authenticator configuration. +type IAMAuthenticatorConfig struct { + // RoleMappings is a list of role mappings + // +optional + RoleMappings []RoleMapping `json:"mapRoles,omitempty"` + // UserMappings is a list of user mappings + // +optional + UserMappings []UserMapping `json:"mapUsers,omitempty"` +} + +// KubernetesMapping represents the kubernetes RBAC mapping. +type KubernetesMapping struct { + // UserName is a kubernetes RBAC user subject + UserName string `json:"username"` + // Groups is a list of kubernetes RBAC groups + Groups []string `json:"groups"` +} + +// RoleMapping represents a mapping from a IAM role to Kubernetes users and groups. +type RoleMapping struct { + // RoleARN is the AWS ARN for the role to map + // +kubebuilder:validation:MinLength:=31 + RoleARN string `json:"rolearn"` + // KubernetesMapping holds the RBAC details for the mapping + KubernetesMapping `json:",inline"` +} + +// UserMapping represents a mapping from an IAM user to Kubernetes users and groups. +type UserMapping struct { + // UserARN is the AWS ARN for the user to map + // +kubebuilder:validation:MinLength:=31 + UserARN string `json:"userarn"` + // KubernetesMapping holds the RBAC details for the mapping + KubernetesMapping `json:",inline"` +} + +// Addon represents a EKS addon. +type Addon struct { + // Name is the name of the addon + // +kubebuilder:validation:MinLength:=2 + // +kubebuilder:validation:Required + Name string `json:"name"` + // Version is the version of the addon to use + Version string `json:"version"` + // ConflictResolution is used to declare what should happen if there + // are parameter conflicts. Defaults to none + // +kubebuilder:default=none + // +kubebuilder:validation:Enum=overwrite;none + ConflictResolution *AddonResolution `json:"conflictResolution,omitempty"` + // ServiceAccountRoleArn is the ARN of an IAM role to bind to the addons service account + // +optional + ServiceAccountRoleArn *string `json:"serviceAccountRoleARN,omitempty"` +} + +// AddonResolution defines the method for resolving parameter conflicts. +type AddonResolution string + +var ( + // AddonResolutionOverwrite indicates that if there are parameter conflicts then + // resolution will be accomplished via overwriting. + AddonResolutionOverwrite = AddonResolution("overwrite") + + // AddonResolutionNone indicates that if there are parameter conflicts then + // resolution will not be done and an error will be reported. + AddonResolutionNone = AddonResolution("none") +) + +// AddonStatus defines the status for an addon. +type AddonStatus string + +var ( + // AddonStatusCreating is a status to indicate the addon is creating. + AddonStatusCreating = "creating" + + // AddonStatusActive is a status to indicate the addon is active. + AddonStatusActive = "active" + + // AddonStatusCreateFailed is a status to indicate the addon failed creation. + AddonStatusCreateFailed = "create_failed" + + // AddonStatusUpdating is a status to indicate the addon is updating. + AddonStatusUpdating = "updating" + + // AddonStatusDeleting is a status to indicate the addon is deleting. + AddonStatusDeleting = "deleting" + + // AddonStatusDeleteFailed is a status to indicate the addon failed deletion. + AddonStatusDeleteFailed = "delete_failed" + + // AddonStatusDegraded is a status to indicate the addon is in a degraded state. + AddonStatusDegraded = "degraded" +) + +// AddonState represents the state of an addon. +type AddonState struct { + // Name is the name of the addon + Name string `json:"name"` + // Version is the version of the addon to use + Version string `json:"version"` + // ARN is the AWS ARN of the addon + ARN string `json:"arn"` + // ServiceAccountRoleArn is the ARN of the IAM role used for the service account + ServiceAccountRoleArn *string `json:"serviceAccountRoleARN,omitempty"` + // CreatedAt is the date and time the addon was created at + CreatedAt metav1.Time `json:"createdAt,omitempty"` + // ModifiedAt is the date and time the addon was last modified + ModifiedAt metav1.Time `json:"modifiedAt,omitempty"` + // Status is the status of the addon + Status *string `json:"status,omitempty"` + // Issues is a list of issue associated with the addon + Issues []AddonIssue `json:"issues,omitempty"` +} + +// AddonIssue represents an issue with an addon. +type AddonIssue struct { + // Code is the issue code + Code *string `json:"code,omitempty"` + // Message is the textual description of the issue + Message *string `json:"message,omitempty"` + // ResourceIDs is a list of resource ids for the issue + ResourceIDs []string `json:"resourceIds,omitempty"` +} + +const ( + // SecurityGroupCluster is the security group for communication between EKS + // control plane and managed node groups. + SecurityGroupCluster = infrav1.SecurityGroupRole("cluster") +) + +type OIDCIdentityProviderConfig struct { + + // This is also known as audience. The ID for the client application that makes + // authentication requests to the OpenID identity provider. + // +kubebuilder:validation:Required + ClientID string `json:"clientId,omitempty"` + + // The JWT claim that the provider uses to return your groups. + // +optional + GroupsClaim *string `json:"groupsClaim,omitempty"` + + // The prefix that is prepended to group claims to prevent clashes with existing + // names (such as system: groups). For example, the valueoidc: will create group + // names like oidc:engineering and oidc:infra. + // +optional + GroupsPrefix *string `json:"groupsPrefix,omitempty"` + + // The name of the OIDC provider configuration. + // + // IdentityProviderConfigName is a required field + // +kubebuilder:validation:Required + IdentityProviderConfigName string `json:"identityProviderConfigName,omitempty"` + + // The URL of the OpenID identity provider that allows the API server to discover + // public signing keys for verifying tokens. The URL must begin with https:// + // and should correspond to the iss claim in the provider's OIDC ID tokens. + // Per the OIDC standard, path components are allowed but query parameters are + // not. Typically the URL consists of only a hostname, like https://server.example.org + // or https://example.com. This URL should point to the level below .well-known/openid-configuration + // and must be publicly accessible over the internet. + // + // +kubebuilder:validation:Required + IssuerURL string `json:"issuerUrl,omitempty"` + + // The key value pairs that describe required claims in the identity token. + // If set, each claim is verified to be present in the token with a matching + // value. For the maximum number of claims that you can require, see Amazon + // EKS service quotas (https://docs.aws.amazon.com/eks/latest/userguide/service-quotas.html) + // in the Amazon EKS User Guide. + // +optional + RequiredClaims map[string]string `json:"requiredClaims,omitempty"` + + // The JSON Web Token (JWT) claim to use as the username. The default is sub, + // which is expected to be a unique identifier of the end user. You can choose + // other claims, such as email or name, depending on the OpenID identity provider. + // Claims other than email are prefixed with the issuer URL to prevent naming + // clashes with other plug-ins. + // +optional + UsernameClaim *string `json:"usernameClaim,omitempty"` + + // The prefix that is prepended to username claims to prevent clashes with existing + // names. If you do not provide this field, and username is a value other than + // email, the prefix defaults to issuerurl#. You can use the value - to disable + // all prefixing. + // +optional + UsernamePrefix *string `json:"usernamePrefix,omitempty"` + + // tags to apply to oidc identity provider association + // +optional + Tags infrav1.Tags `json:"tags,omitempty"` +} diff --git a/controlplane/eks/api/v1beta1/validate.go b/controlplane/eks/api/v1beta1/validate.go new file mode 100644 index 0000000000..f698985616 --- /dev/null +++ b/controlplane/eks/api/v1beta1/validate.go @@ -0,0 +1,99 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "strings" + + "github.com/aws/aws-sdk-go/aws/arn" + "github.com/pkg/errors" +) + +// Errors for validation of Amazon EKS nodes that are registered with the control plane. +var ( + ErrRoleARNRequired = errors.New("rolearn is required") + ErrUserARNRequired = errors.New("userarn is required") + ErrUserNameRequired = errors.New("username is required") + ErrGroupsRequired = errors.New("groups are required") + ErrIsNotARN = errors.New("supplied value is not a ARN") + ErrIsNotRoleARN = errors.New("supplied ARN is not a role ARN") + ErrIsNotUserARN = errors.New("supplied ARN is not a user ARN") +) + +// Validate will return nil is there are no errors with the role mapping. +func (r *RoleMapping) Validate() []error { + errs := []error{} + + if strings.TrimSpace(r.RoleARN) == "" { + errs = append(errs, ErrRoleARNRequired) + } + if strings.TrimSpace(r.UserName) == "" { + errs = append(errs, ErrUserNameRequired) + } + if len(r.Groups) == 0 { + errs = append(errs, ErrGroupsRequired) + } + + if !arn.IsARN(r.RoleARN) { + errs = append(errs, ErrIsNotARN) + } else { + parsedARN, err := arn.Parse(r.RoleARN) + if err != nil { + errs = append(errs, err) + } else if !strings.Contains(parsedARN.Resource, "role/") { + errs = append(errs, ErrIsNotRoleARN) + } + } + + if len(errs) == 0 { + return nil + } + + return errs +} + +// Validate will return nil is there are no errors with the user mapping. +func (u *UserMapping) Validate() []error { + errs := []error{} + + if strings.TrimSpace(u.UserARN) == "" { + errs = append(errs, ErrUserARNRequired) + } + if strings.TrimSpace(u.UserName) == "" { + errs = append(errs, ErrUserNameRequired) + } + if len(u.Groups) == 0 { + errs = append(errs, ErrGroupsRequired) + } + + if !arn.IsARN(u.UserARN) { + errs = append(errs, ErrIsNotARN) + } else { + parsedARN, err := arn.Parse(u.UserARN) + if err != nil { + errs = append(errs, err) + } else if !strings.Contains(parsedARN.Resource, "user/") { + errs = append(errs, ErrIsNotUserARN) + } + } + + if len(errs) == 0 { + return nil + } + + return errs +} diff --git a/controlplane/eks/api/v1beta1/zz_generated.deepcopy.go b/controlplane/eks/api/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..5f82402472 --- /dev/null +++ b/controlplane/eks/api/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,567 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime" + apiv1beta1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + cluster_apiapiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSManagedControlPlane) DeepCopyInto(out *AWSManagedControlPlane) { + *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 AWSManagedControlPlane. +func (in *AWSManagedControlPlane) DeepCopy() *AWSManagedControlPlane { + if in == nil { + return nil + } + out := new(AWSManagedControlPlane) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSManagedControlPlane) 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 *AWSManagedControlPlaneList) DeepCopyInto(out *AWSManagedControlPlaneList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSManagedControlPlane, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedControlPlaneList. +func (in *AWSManagedControlPlaneList) DeepCopy() *AWSManagedControlPlaneList { + if in == nil { + return nil + } + out := new(AWSManagedControlPlaneList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSManagedControlPlaneList) 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 *AWSManagedControlPlaneSpec) DeepCopyInto(out *AWSManagedControlPlaneSpec) { + *out = *in + if in.IdentityRef != nil { + in, out := &in.IdentityRef, &out.IdentityRef + *out = new(apiv1beta1.AWSIdentityReference) + **out = **in + } + in.NetworkSpec.DeepCopyInto(&out.NetworkSpec) + if in.SecondaryCidrBlock != nil { + in, out := &in.SecondaryCidrBlock, &out.SecondaryCidrBlock + *out = new(string) + **out = **in + } + if in.SSHKeyName != nil { + in, out := &in.SSHKeyName, &out.SSHKeyName + *out = new(string) + **out = **in + } + if in.Version != nil { + in, out := &in.Version, &out.Version + *out = new(string) + **out = **in + } + if in.RoleName != nil { + in, out := &in.RoleName, &out.RoleName + *out = new(string) + **out = **in + } + if in.RoleAdditionalPolicies != nil { + in, out := &in.RoleAdditionalPolicies, &out.RoleAdditionalPolicies + *out = new([]string) + if **in != nil { + in, out := *in, *out + *out = make([]string, len(*in)) + copy(*out, *in) + } + } + if in.Logging != nil { + in, out := &in.Logging, &out.Logging + *out = new(ControlPlaneLoggingSpec) + **out = **in + } + if in.EncryptionConfig != nil { + in, out := &in.EncryptionConfig, &out.EncryptionConfig + *out = new(EncryptionConfig) + (*in).DeepCopyInto(*out) + } + if in.AdditionalTags != nil { + in, out := &in.AdditionalTags, &out.AdditionalTags + *out = make(apiv1beta1.Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.IAMAuthenticatorConfig != nil { + in, out := &in.IAMAuthenticatorConfig, &out.IAMAuthenticatorConfig + *out = new(IAMAuthenticatorConfig) + (*in).DeepCopyInto(*out) + } + in.EndpointAccess.DeepCopyInto(&out.EndpointAccess) + out.ControlPlaneEndpoint = in.ControlPlaneEndpoint + in.Bastion.DeepCopyInto(&out.Bastion) + if in.TokenMethod != nil { + in, out := &in.TokenMethod, &out.TokenMethod + *out = new(EKSTokenMethod) + **out = **in + } + if in.Addons != nil { + in, out := &in.Addons, &out.Addons + *out = new([]Addon) + if **in != nil { + in, out := *in, *out + *out = make([]Addon, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + } + if in.OIDCIdentityProviderConfig != nil { + in, out := &in.OIDCIdentityProviderConfig, &out.OIDCIdentityProviderConfig + *out = new(OIDCIdentityProviderConfig) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedControlPlaneSpec. +func (in *AWSManagedControlPlaneSpec) DeepCopy() *AWSManagedControlPlaneSpec { + if in == nil { + return nil + } + out := new(AWSManagedControlPlaneSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSManagedControlPlaneStatus) DeepCopyInto(out *AWSManagedControlPlaneStatus) { + *out = *in + in.Network.DeepCopyInto(&out.Network) + if in.FailureDomains != nil { + in, out := &in.FailureDomains, &out.FailureDomains + *out = make(cluster_apiapiv1beta1.FailureDomains, len(*in)) + for key, val := range *in { + (*out)[key] = *val.DeepCopy() + } + } + if in.Bastion != nil { + in, out := &in.Bastion, &out.Bastion + *out = new(apiv1beta1.Instance) + (*in).DeepCopyInto(*out) + } + out.OIDCProvider = in.OIDCProvider + if in.ExternalManagedControlPlane != nil { + in, out := &in.ExternalManagedControlPlane, &out.ExternalManagedControlPlane + *out = new(bool) + **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(cluster_apiapiv1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Addons != nil { + in, out := &in.Addons, &out.Addons + *out = make([]AddonState, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + out.IdentityProviderStatus = in.IdentityProviderStatus +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedControlPlaneStatus. +func (in *AWSManagedControlPlaneStatus) DeepCopy() *AWSManagedControlPlaneStatus { + if in == nil { + return nil + } + out := new(AWSManagedControlPlaneStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Addon) DeepCopyInto(out *Addon) { + *out = *in + if in.ConflictResolution != nil { + in, out := &in.ConflictResolution, &out.ConflictResolution + *out = new(AddonResolution) + **out = **in + } + if in.ServiceAccountRoleArn != nil { + in, out := &in.ServiceAccountRoleArn, &out.ServiceAccountRoleArn + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Addon. +func (in *Addon) DeepCopy() *Addon { + if in == nil { + return nil + } + out := new(Addon) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AddonIssue) DeepCopyInto(out *AddonIssue) { + *out = *in + if in.Code != nil { + in, out := &in.Code, &out.Code + *out = new(string) + **out = **in + } + if in.Message != nil { + in, out := &in.Message, &out.Message + *out = new(string) + **out = **in + } + if in.ResourceIDs != nil { + in, out := &in.ResourceIDs, &out.ResourceIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddonIssue. +func (in *AddonIssue) DeepCopy() *AddonIssue { + if in == nil { + return nil + } + out := new(AddonIssue) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AddonState) DeepCopyInto(out *AddonState) { + *out = *in + if in.ServiceAccountRoleArn != nil { + in, out := &in.ServiceAccountRoleArn, &out.ServiceAccountRoleArn + *out = new(string) + **out = **in + } + in.CreatedAt.DeepCopyInto(&out.CreatedAt) + in.ModifiedAt.DeepCopyInto(&out.ModifiedAt) + if in.Status != nil { + in, out := &in.Status, &out.Status + *out = new(string) + **out = **in + } + if in.Issues != nil { + in, out := &in.Issues, &out.Issues + *out = make([]AddonIssue, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AddonState. +func (in *AddonState) DeepCopy() *AddonState { + if in == nil { + return nil + } + out := new(AddonState) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ControlPlaneLoggingSpec) DeepCopyInto(out *ControlPlaneLoggingSpec) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneLoggingSpec. +func (in *ControlPlaneLoggingSpec) DeepCopy() *ControlPlaneLoggingSpec { + if in == nil { + return nil + } + out := new(ControlPlaneLoggingSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EncryptionConfig) DeepCopyInto(out *EncryptionConfig) { + *out = *in + if in.Provider != nil { + in, out := &in.Provider, &out.Provider + *out = new(string) + **out = **in + } + if in.Resources != nil { + in, out := &in.Resources, &out.Resources + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EncryptionConfig. +func (in *EncryptionConfig) DeepCopy() *EncryptionConfig { + if in == nil { + return nil + } + out := new(EncryptionConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EndpointAccess) DeepCopyInto(out *EndpointAccess) { + *out = *in + if in.Public != nil { + in, out := &in.Public, &out.Public + *out = new(bool) + **out = **in + } + if in.PublicCIDRs != nil { + in, out := &in.PublicCIDRs, &out.PublicCIDRs + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.Private != nil { + in, out := &in.Private, &out.Private + *out = new(bool) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointAccess. +func (in *EndpointAccess) DeepCopy() *EndpointAccess { + if in == nil { + return nil + } + out := new(EndpointAccess) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IAMAuthenticatorConfig) DeepCopyInto(out *IAMAuthenticatorConfig) { + *out = *in + if in.RoleMappings != nil { + in, out := &in.RoleMappings, &out.RoleMappings + *out = make([]RoleMapping, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.UserMappings != nil { + in, out := &in.UserMappings, &out.UserMappings + *out = make([]UserMapping, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IAMAuthenticatorConfig. +func (in *IAMAuthenticatorConfig) DeepCopy() *IAMAuthenticatorConfig { + if in == nil { + return nil + } + out := new(IAMAuthenticatorConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *IdentityProviderStatus) DeepCopyInto(out *IdentityProviderStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IdentityProviderStatus. +func (in *IdentityProviderStatus) DeepCopy() *IdentityProviderStatus { + if in == nil { + return nil + } + out := new(IdentityProviderStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *KubernetesMapping) DeepCopyInto(out *KubernetesMapping) { + *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 KubernetesMapping. +func (in *KubernetesMapping) DeepCopy() *KubernetesMapping { + if in == nil { + return nil + } + out := new(KubernetesMapping) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OIDCIdentityProviderConfig) DeepCopyInto(out *OIDCIdentityProviderConfig) { + *out = *in + if in.GroupsClaim != nil { + in, out := &in.GroupsClaim, &out.GroupsClaim + *out = new(string) + **out = **in + } + if in.GroupsPrefix != nil { + in, out := &in.GroupsPrefix, &out.GroupsPrefix + *out = new(string) + **out = **in + } + if in.RequiredClaims != nil { + in, out := &in.RequiredClaims, &out.RequiredClaims + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.UsernameClaim != nil { + in, out := &in.UsernameClaim, &out.UsernameClaim + *out = new(string) + **out = **in + } + if in.UsernamePrefix != nil { + in, out := &in.UsernamePrefix, &out.UsernamePrefix + *out = new(string) + **out = **in + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(apiv1beta1.Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OIDCIdentityProviderConfig. +func (in *OIDCIdentityProviderConfig) DeepCopy() *OIDCIdentityProviderConfig { + if in == nil { + return nil + } + out := new(OIDCIdentityProviderConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OIDCProviderStatus) DeepCopyInto(out *OIDCProviderStatus) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OIDCProviderStatus. +func (in *OIDCProviderStatus) DeepCopy() *OIDCProviderStatus { + if in == nil { + return nil + } + out := new(OIDCProviderStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RoleMapping) DeepCopyInto(out *RoleMapping) { + *out = *in + in.KubernetesMapping.DeepCopyInto(&out.KubernetesMapping) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RoleMapping. +func (in *RoleMapping) DeepCopy() *RoleMapping { + if in == nil { + return nil + } + out := new(RoleMapping) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *UserMapping) DeepCopyInto(out *UserMapping) { + *out = *in + in.KubernetesMapping.DeepCopyInto(&out.KubernetesMapping) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UserMapping. +func (in *UserMapping) DeepCopy() *UserMapping { + if in == nil { + return nil + } + out := new(UserMapping) + in.DeepCopyInto(out) + return out +} diff --git a/controlplane/eks/controllers/awsmanagedcontrolplane_controller.go b/controlplane/eks/controllers/awsmanagedcontrolplane_controller.go index db4032119f..a6073c990d 100644 --- a/controlplane/eks/controllers/awsmanagedcontrolplane_controller.go +++ b/controlplane/eks/controllers/awsmanagedcontrolplane_controller.go @@ -25,7 +25,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/conditions" @@ -38,9 +38,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/feature" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/awsnode" @@ -72,7 +72,7 @@ type AWSManagedControlPlaneReconciler struct { func (r *AWSManagedControlPlaneReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error { log := ctrl.LoggerFrom(ctx) - awsManagedControlPlane := &controlplanev1.AWSManagedControlPlane{} + awsManagedControlPlane := &ekscontrolplanev1.AWSManagedControlPlane{} c, err := ctrl.NewControllerManagedBy(mgr). For(awsManagedControlPlane). WithOptions(options). @@ -110,7 +110,7 @@ func (r *AWSManagedControlPlaneReconciler) Reconcile(ctx context.Context, req ct log := ctrl.LoggerFrom(ctx) // Get the control plane instance - awsControlPlane := &controlplanev1.AWSManagedControlPlane{} + awsControlPlane := &ekscontrolplanev1.AWSManagedControlPlane{} if err := r.Client.Get(ctx, req.NamespacedName, awsControlPlane); err != nil { if apierrors.IsNotFound(err) { return ctrl.Result{}, nil @@ -150,10 +150,10 @@ func (r *AWSManagedControlPlaneReconciler) Reconcile(ctx context.Context, req ct // Always close the scope defer func() { applicableConditions := []clusterv1.ConditionType{ - controlplanev1.EKSControlPlaneReadyCondition, - controlplanev1.IAMControlPlaneRolesReadyCondition, - controlplanev1.IAMAuthenticatorConfiguredCondition, - controlplanev1.EKSAddonsConfiguredCondition, + ekscontrolplanev1.EKSControlPlaneReadyCondition, + ekscontrolplanev1.IAMControlPlaneRolesReadyCondition, + ekscontrolplanev1.IAMAuthenticatorConfiguredCondition, + ekscontrolplanev1.EKSAddonsConfiguredCondition, infrav1.VpcReadyCondition, infrav1.SubnetsReadyCondition, infrav1.ClusterSecurityGroupsReadyCondition, @@ -191,7 +191,7 @@ func (r *AWSManagedControlPlaneReconciler) reconcileNormal(ctx context.Context, awsManagedControlPlane := managedScope.ControlPlane - controllerutil.AddFinalizer(managedScope.ControlPlane, controlplanev1.ManagedControlPlaneFinalizer) + controllerutil.AddFinalizer(managedScope.ControlPlane, ekscontrolplanev1.ManagedControlPlaneFinalizer) if err := managedScope.PatchObject(); err != nil { return ctrl.Result{}, err } @@ -232,10 +232,10 @@ func (r *AWSManagedControlPlaneReconciler) reconcileNormal(ctx context.Context, } if err := authService.ReconcileIAMAuthenticator(ctx); err != nil { - conditions.MarkFalse(awsManagedControlPlane, controlplanev1.IAMAuthenticatorConfiguredCondition, controlplanev1.IAMAuthenticatorConfigurationFailedReason, clusterv1.ConditionSeverityError, err.Error()) + conditions.MarkFalse(awsManagedControlPlane, ekscontrolplanev1.IAMAuthenticatorConfiguredCondition, ekscontrolplanev1.IAMAuthenticatorConfigurationFailedReason, clusterv1.ConditionSeverityError, err.Error()) return reconcile.Result{}, errors.Wrapf(err, "failed to reconcile aws-iam-authenticator config for AWSManagedControlPlane %s/%s", awsManagedControlPlane.Namespace, awsManagedControlPlane.Name) } - conditions.MarkTrue(awsManagedControlPlane, controlplanev1.IAMAuthenticatorConfiguredCondition) + conditions.MarkTrue(awsManagedControlPlane, ekscontrolplanev1.IAMAuthenticatorConfiguredCondition) for _, subnet := range managedScope.Subnets().FilterPrivate() { managedScope.SetFailureDomain(subnet.AvailabilityZone, clusterv1.FailureDomainSpec{ @@ -289,7 +289,7 @@ func (r *AWSManagedControlPlaneReconciler) reconcileDelete(ctx context.Context, return reconcile.Result{}, err } - controllerutil.RemoveFinalizer(controlPlane, controlplanev1.ManagedControlPlaneFinalizer) + controllerutil.RemoveFinalizer(controlPlane, ekscontrolplanev1.ManagedControlPlaneFinalizer) return reconcile.Result{}, nil } @@ -336,14 +336,14 @@ func (r *AWSManagedControlPlaneReconciler) dependencyCount(ctx context.Context, dependencies += len(machines.Items) if feature.Gates.Enabled(feature.MachinePool) { - managedMachinePools := &infrav1exp.AWSManagedMachinePoolList{} + managedMachinePools := &expinfrav1.AWSManagedMachinePoolList{} if err := r.Client.List(ctx, managedMachinePools, listOptions...); err != nil { return dependencies, fmt.Errorf("failed to list managed machine pools for cluster %s/%s: %w", namespace, clusterName, err) } log.V(2).Info("tested for AWSManagedMachinePool dependencies", "count", len(managedMachinePools.Items)) dependencies += len(managedMachinePools.Items) - machinePools := &infrav1exp.AWSMachinePoolList{} + machinePools := &expinfrav1.AWSMachinePoolList{} if err := r.Client.List(ctx, machinePools, listOptions...); err != nil { return dependencies, fmt.Errorf("failed to list machine pools for cluster %s/%s: %w", namespace, clusterName, err) } diff --git a/docs/book/Makefile b/docs/book/Makefile index b6f8bc378f..47d0ee2d7e 100644 --- a/docs/book/Makefile +++ b/docs/book/Makefile @@ -24,7 +24,11 @@ GENCRDAPIREFERENCEDOCS := $(TOOLS_BIN_DIR)/gen-crd-api-reference-docs GENCRDAPIREFERENCEDOCS_SRCS := $(call rwildcard,.,gen-crd-api-reference-docs/*.*) CRD_DOCS := src/crd/cluster-api-aws.md src/crd/experimental.md src/crd/eks-control-plane.md BOOK_SRCS := $(filter-out $(CRD_DOCS), $(call rwildcard,.,*.*)) -API_SRCS := $(call rwildcard,.,../../cmd/clusterawsadm/api) $(call rwildcard,.,../../api) $(call rwildcard,.,../../exp/api) $(call rwildcard,.,../../controlplane/eks/api) + +API_DIRS := cmd/clusterawsadm/api/bootstrap/v1beta1 api/v1beta1 exp/api/v1beta1 controlplane/eks/api/v1beta1 bootstrap/eks/api/v1beta1 iam/api/v1beta1 +API_SRCS := $(foreach dir, $(API_DIRS), $(call rwildcard,../../$(dir),*.go)) +GENERATED_SRCS := $(foreach dir, $(API_DIRS),../../$(dir)/zz_generated.deepcopy.go ../../$(dir)/zz_generated.conversion.go ../../$(dir)/zz_generated.defaults.go) +API_FILTERED_SRCS := $(filter-out $(GENERATED_SRCS), $(API_SRCS)) OS := $(shell go env GOOS) ARCH := $(shell go env GOARCH) @@ -34,23 +38,11 @@ export PATH src/crd: mkdir -p src/crd -src/crd/cluster-api-aws.md: - $(MAKE) gen_crd_docs API_DIR="../../api" OUT_FILE=$@ - -src/crd/experimental.md: - $(MAKE) gen_crd_docs API_DIR="../../exp/api" OUT_FILE=$@ - -src/crd/eks-control-plane.md: - $(MAKE) gen_crd_docs API_DIR="../../controlplane/eks/api/" OUT_FILE=$@ - -src/crd/clusterawsadm.md: - $(MAKE) gen_crd_docs API_DIR="../../cmd/clusterawsadm/api" OUT_FILE=$@ - -src/crd/index.md: +src/crd/index.md: $(API_FILTERED_SRCS) src/crd $(MAKE) gen_crd_docs API_DIR="../.." OUT_FILE=$@ .PHONY: gen_crd_docs -gen_crd_docs: $(GENCRDAPIREFERENCEDOCS) src/crd $(API_SRCS) $(GENCRDAPIREFERENCEDOCS_SRCS) +gen_crd_docs: $(GENCRDAPIREFERENCEDOCS) src/crd $(GENCRDAPIREFERENCEDOCS_SRCS) $(GENCRDAPIREFERENCEDOCS) -template-dir gen-crd-api-reference-docs/template -config "gen-crd-api-reference-docs/config.json" \ -api-dir $(API_DIR) \ -out-file $(OUT_FILE) @@ -61,7 +53,6 @@ src/clusterawsadm: terraform/out: mkdir -p terraform/out - terraform/out/amilist: terraform/out CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o $@ ./cmd/amilist && chmod 755 $@ diff --git a/docs/book/gen-crd-api-reference-docs/template/pkg.tpl b/docs/book/gen-crd-api-reference-docs/template/pkg.tpl index 8b2fd6f9e3..dece418ddf 100644 --- a/docs/book/gen-crd-api-reference-docs/template/pkg.tpl +++ b/docs/book/gen-crd-api-reference-docs/template/pkg.tpl @@ -41,10 +41,4 @@ {{ end }}
{{ end }} - -

- Generated with gen-crd-api-reference-docs - {{ with .gitCommit }} on git commit {{ . }}{{end}}. -

- {{ end }} diff --git a/docs/book/src/crd/index.md b/docs/book/src/crd/index.md index f4995af862..bd2374677c 100644 --- a/docs/book/src/crd/index.md +++ b/docs/book/src/crd/index.md @@ -1,28 +1,40 @@

Packages:

-

ami.aws.infrastructure.cluster.x-k8s.io/v1alpha1

+

ami.aws.infrastructure.cluster.x-k8s.io/v1beta1

-

Package v1alpha1 contains API Schema definitions for the ami v1alpha1 API group

+

Package v1beta1 contains API Schema definitions for the AMI v1beta1 API group

Resource Types:
    -

    AWSAMI +

    AWSAMI

    AWSAMI defines an AMI.

    @@ -53,7 +65,7 @@ Refer to the Kubernetes API documentation for the fields of the spec
    - + AWSAMISpec @@ -107,10 +119,10 @@ string -

    AWSAMISpec +

    AWSAMISpec

    -(Appears on:AWSAMI) +(Appears on:AWSAMI)

    AWSAMISpec defines an AMI.

    @@ -340,9 +352,7 @@ string secureSecretBackends
    - -[]Cluster API AWS api/v1alpha4.SecretBackend - +[]Cluster API AWS api/v1beta1.SecretBackend @@ -513,9 +523,7 @@ string secureSecretBackends
    - -[]Cluster API AWS api/v1alpha4.SecretBackend - +[]Cluster API AWS api/v1beta1.SecretBackend @@ -569,9 +577,7 @@ bool extraStatements
    - -[]Cluster API AWS api/v1alpha4.StatementEntry - +[]Cluster API AWS iam/api/v1beta1.StatementEntry @@ -582,23 +588,19 @@ bool trustStatements
    - -[]Cluster API AWS api/v1alpha4.StatementEntry - +[]Cluster API AWS iam/api/v1beta1.StatementEntry

    TrustStatements is an IAM PolicyDocument defining what identities are allowed to assume this role. -See “sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/iam/v1alpha1” for more documentation.

    +See “sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/iam/v1beta1” for more documentation.

    tags
    - -Cluster API AWS api/v1alpha4.Tags - +Cluster API AWS api/v1beta1.Tags @@ -688,9 +690,7 @@ string extraStatements
    - -[]Cluster API AWS api/v1alpha4.StatementEntry - +[]Cluster API AWS iam/api/v1beta1.StatementEntry @@ -701,9 +701,7 @@ string tags
    - -Cluster API AWS api/v1alpha4.Tags - +Cluster API AWS api/v1beta1.Tags @@ -1014,13 +1012,17 @@ EC2 container registry


    -

    bootstrap.cluster.x-k8s.io/v1alpha4

    +

    bootstrap.aws.infrastructure.cluster.x-k8s.io/v1beta1

    +

    +

    Package v1beta1 contains API Schema definitions for the bootstrap v1beta1 API group

    +

    Resource Types:
      -

      EKSConfig +

      AWSIAMConfiguration

      -

      EKSConfig is the Schema for the eksconfigs API

      +

      AWSIAMConfiguration controls the creation of AWS Identity and Access Management (IAM) resources for use +by Kubernetes clusters and Kubernetes Cluster API Provider AWS.

      @@ -1032,24 +1034,10 @@ Resource Types: - - - - @@ -1059,204 +1047,152 @@ EKSConfigSpec
      -metadata
      - - -Kubernetes meta/v1.ObjectMeta - - -
      -Refer to the Kubernetes API documentation for the fields of the -metadata field. -
      spec
      - -EKSConfigSpec + +AWSIAMConfigurationSpec
      - -
      -kubeletExtraArgs
      +namePrefix
      -map[string]string +string
      -(Optional) -

      Passes the kubelet args into the EKS bootstrap script

      -
      +

      NamePrefix will be prepended to every AWS IAM role, user and policy created by clusterawsadm. Defaults to “”.

      -status
      +nameSuffix
      - -EKSConfigStatus - +string +

      NameSuffix will be appended to every AWS IAM role, user and policy created by clusterawsadm. Defaults to +“.cluster-api-provider-aws.sigs.k8s.io”.

      - - -

      EKSConfigSpec -

      -

      -(Appears on:EKSConfig, EKSConfigTemplateResource) -

      -

      -

      EKSConfigSpec defines the desired state of EKSConfig

      -

      - - - - - - - - - -
      FieldDescription
      -kubeletExtraArgs
      +controlPlane
      -map[string]string + +ControlPlane +
      -(Optional) -

      Passes the kubelet args into the EKS bootstrap script

      +

      ControlPlane controls the configuration of the AWS IAM role for a Kubernetes cluster’s control plane nodes.

      -

      EKSConfigStatus -

      -

      -(Appears on:EKSConfig) -

      -

      -

      EKSConfigStatus defines the observed state of EKSConfig

      -

      - - - - - - - - - -
      FieldDescription
      -ready
      +clusterAPIControllers
      -bool + +ClusterAPIControllers +
      -

      Ready indicates the BootstrapData secret is ready to be consumed

      +

      ClusterAPIControllers controls the configuration of an IAM role and policy specifically for Kubernetes Cluster API Provider AWS.

      -dataSecretName
      +nodes
      -string + +Nodes +
      -(Optional) -

      DataSecretName is the name of the secret that stores the bootstrap data script.

      +

      Nodes controls the configuration of the AWS IAM role for all nodes in a Kubernetes cluster.

      -failureReason
      +bootstrapUser
      -string + +BootstrapUser +
      -(Optional) -

      FailureReason will be set on non-retryable errors

      +

      BootstrapUser contains a list of elements that is specific +to the configuration and enablement of an IAM user.

      -failureMessage
      +stackName
      string
      -(Optional) -

      FailureMessage will be set on non-retryable errors

      +

      StackName defines the name of the AWS CloudFormation stack.

      -observedGeneration
      +region
      -int64 +string
      -(Optional) -

      ObservedGeneration is the latest generation observed by the controller.

      +

      Region controls which region the control-plane is created in if not specified on the command line or +via environment variables.

      -conditions
      +eks
      - -Cluster API api/v1alpha4.Conditions + +EKSConfig
      -(Optional) -

      Conditions defines current service state of the EKSConfig.

      +

      EKS controls the configuration related to EKS. Settings in here affect the control plane +and nodes roles

      -

      EKSConfigTemplate -

      -

      -

      EKSConfigTemplate is the Schema for the eksconfigtemplates API

      -

      - - - - - - - -
      FieldDescription
      -metadata
      +eventBridge
      - -Kubernetes meta/v1.ObjectMeta + +EventBridgeConfig
      -Refer to the Kubernetes API documentation for the fields of the -metadata field. +

      EventBridge controls configuration for consuming EventBridge events

      -spec
      +partition
      - -EKSConfigTemplateSpec - +string
      -
      -
      - +

      Partition is the AWS security partition being used. Defaults to “aws”

      + +
      -template
      +secureSecretBackends
      - -EKSConfigTemplateResource - +[]Cluster API AWS api/v1beta1.SecretBackend
      +

      SecureSecretsBackend, when set to parameter-store will create AWS Systems Manager +Parameter Storage policies. By default or with the value of secrets-manager, +will generate AWS Secrets Manager policies instead.

      @@ -1264,13 +1200,13 @@ EKSConfigTemplateResource
      -

      EKSConfigTemplateResource +

      AWSIAMConfigurationSpec

      -(Appears on:EKSConfigTemplateSpec) +(Appears on:AWSIAMConfiguration)

      -

      EKSConfigTemplateResource defines the Template structure

      +

      AWSIAMConfigurationSpec defines the specification of the AWSIAMConfiguration.

      @@ -1282,481 +1218,553 @@ EKSConfigTemplateResource - -
      -spec
      +namePrefix
      - -EKSConfigSpec - +string
      -
      -
      - +

      NamePrefix will be prepended to every AWS IAM role, user and policy created by clusterawsadm. Defaults to “”.

      + + - -
      -kubeletExtraArgs
      +nameSuffix
      -map[string]string +string
      -(Optional) -

      Passes the kubelet args into the EKS bootstrap script

      -
      +

      NameSuffix will be appended to every AWS IAM role, user and policy created by clusterawsadm. Defaults to +“.cluster-api-provider-aws.sigs.k8s.io”.

      -

      EKSConfigTemplateSpec -

      -

      -(Appears on:EKSConfigTemplate) -

      -

      -

      EKSConfigTemplateSpec defines the desired state of EKSConfigTemplate

      -

      - - - - + + - - - -
      FieldDescription +controlPlane
      + + +ControlPlane + + +
      +

      ControlPlane controls the configuration of the AWS IAM role for a Kubernetes cluster’s control plane nodes.

      +
      -template
      +clusterAPIControllers
      - -EKSConfigTemplateResource + +ClusterAPIControllers
      +

      ClusterAPIControllers controls the configuration of an IAM role and policy specifically for Kubernetes Cluster API Provider AWS.

      -
      -

      controlplane.cluster.x-k8s.io/v1alpha4

      -

      -

      Package v1alpha4 contains API Schema definitions for the controlplane v1alpha4 API group

      -

      -Resource Types: -
        -

        AWSManagedControlPlane -

        -

        -

        AWSManagedControlPlane is the Schema for the awsmanagedcontrolplanes API

        -

        - - - - - - - -
        FieldDescription
        -metadata
        +nodes
        - -Kubernetes meta/v1.ObjectMeta + +Nodes
        -Refer to the Kubernetes API documentation for the fields of the -metadata field. +

        Nodes controls the configuration of the AWS IAM role for all nodes in a Kubernetes cluster.

        -spec
        +bootstrapUser
        - -AWSManagedControlPlaneSpec + +BootstrapUser
        -
        -
        - +

        BootstrapUser contains a list of elements that is specific +to the configuration and enablement of an IAM user.

        + + + +
        -eksClusterName
        +stackName
        string
        -(Optional) -

        EKSClusterName allows you to specify the name of the EKS cluster in -AWS. If you don’t specify a name then a default name will be created -based on the namespace and name of the managed control plane.

        +

        StackName defines the name of the AWS CloudFormation stack.

        -identityRef
        +region
        - -Cluster API AWS api/v1alpha4.AWSIdentityReference - +string
        -(Optional) -

        IdentityRef is a reference to a identity to be used when reconciling the managed control plane.

        +

        Region controls which region the control-plane is created in if not specified on the command line or +via environment variables.

        -network
        +eks
        - -Cluster API AWS api/v1alpha4.NetworkSpec + +EKSConfig
        -

        NetworkSpec encapsulates all things related to AWS network.

        +

        EKS controls the configuration related to EKS. Settings in here affect the control plane +and nodes roles

        -secondaryCidrBlock
        +eventBridge
        -string + +EventBridgeConfig +
        -(Optional) -

        SecondaryCidrBlock is the additional CIDR range to use for pod IPs. -Must be within the 100.64.0.0/10 or 198.19.0.0/16 range.

        +

        EventBridge controls configuration for consuming EventBridge events

        -region
        +partition
        string
        -

        The AWS Region the cluster lives in.

        +

        Partition is the AWS security partition being used. Defaults to “aws”

        -sshKeyName
        +secureSecretBackends
        -string +[]Cluster API AWS api/v1beta1.SecretBackend
        -(Optional) -

        SSHKeyName is the name of the ssh key to attach to the bastion host. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name)

        +

        SecureSecretsBackend, when set to parameter-store will create AWS Systems Manager +Parameter Storage policies. By default or with the value of secrets-manager, +will generate AWS Secrets Manager policies instead.

        +

        AWSIAMRoleSpec +

        +

        +(Appears on:ClusterAPIControllers, ControlPlane, EKSConfig, Nodes) +

        +

        +

        AWSIAMRoleSpec defines common configuration for AWS IAM roles created by +Kubernetes Cluster API Provider AWS.

        +

        + + - - + + + + + +
        -version
        - -string - -
        -(Optional) -

        Version defines the desired Kubernetes version. If no version number -is supplied then the latest version of Kubernetes that EKS supports -will be used.

        -
        FieldDescription
        -roleName
        +disable
        -string +bool
        -(Optional) -

        RoleName specifies the name of IAM role that gives EKS -permission to make API calls. If the role is pre-existing -we will treat it as unmanaged and not delete it on -deletion. If the EKSEnableIAM feature flag is true -and no name is supplied then a role is created.

        +

        Disable if set to true will not create the AWS IAM role. Defaults to false.

        -roleAdditionalPolicies
        +extraPolicyAttachments
        []string
        -(Optional) -

        RoleAdditionalPolicies allows you to attach additional polices to -the control plane role. You must enable the EKSAllowAddRoles -feature flag to incorporate these into the created role.

        +

        ExtraPolicyAttachments is a list of additional policies to be attached to the IAM role.

        -logging
        +extraStatements
        - -ControlPlaneLoggingSpec - +[]Cluster API AWS iam/api/v1beta1.StatementEntry
        -(Optional) -

        Logging specifies which EKS Cluster logs should be enabled. Entries for -each of the enabled logs will be sent to CloudWatch

        +

        ExtraStatements are additional IAM statements to be included inline for the role.

        -encryptionConfig
        +trustStatements
        - -EncryptionConfig - +[]Cluster API AWS iam/api/v1beta1.StatementEntry
        -(Optional) -

        EncryptionConfig specifies the encryption configuration for the cluster

        +

        TrustStatements is an IAM PolicyDocument defining what identities are allowed to assume this role. +See “sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/iam/v1beta1” for more documentation.

        -additionalTags
        +tags
        - -Cluster API AWS api/v1alpha4.Tags - +Cluster API AWS api/v1beta1.Tags
        -(Optional) -

        AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the -ones added by default.

        +

        Tags is a map of tags to be applied to the AWS IAM role.

        +

        BootstrapUser +

        +

        +(Appears on:AWSIAMConfigurationSpec) +

        +

        +

        BootstrapUser contains a list of elements that is specific +to the configuration and enablement of an IAM user.

        +

        + + - - + + + + + +
        -iamAuthenticatorConfig
        - - -IAMAuthenticatorConfig - - -
        -(Optional) -

        IAMAuthenticatorConfig allows the specification of any additional user or role mappings -for use when generating the aws-iam-authenticator configuration. If this is nil the -default configuration is still generated for the cluster.

        -
        FieldDescription
        -endpointAccess
        +enable
        - -EndpointAccess - +bool
        -(Optional) -

        Endpoints specifies access to this cluster’s control plane endpoints

        +

        Enable controls whether or not a bootstrap AWS IAM user will be created. +This can be used to scope down the initial credentials used to bootstrap the +cluster. +Defaults to false.

        -controlPlaneEndpoint
        +userName
        - -Cluster API api/v1alpha4.APIEndpoint - +string
        -(Optional) -

        ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.

        +

        UserName controls the username of the bootstrap user. Defaults to +“bootstrapper.cluster-api-provider-aws.sigs.k8s.io”

        -imageLookupFormat
        +groupName
        string
        -(Optional) -

        ImageLookupFormat is the AMI naming format to look up machine images when -a machine does not specify an AMI. When set, this will be used for all -cluster machines unless a machine specifies a different ImageLookupOrg. -Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base -OS and kubernetes version, respectively. The BaseOS will be the value in -ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as -defined by the packages produced by kubernetes/release without v as a -prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default -image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up -searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a -Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See -also: https://golang.org/pkg/text/template/

        +

        GroupName controls the group the user will belong to. Defaults to +“bootstrapper.cluster-api-provider-aws.sigs.k8s.io”

        -imageLookupOrg
        +extraPolicyAttachments
        -string +[]string
        -(Optional) -

        ImageLookupOrg is the AWS Organization ID to look up machine images when a -machine does not specify an AMI. When set, this will be used for all -cluster machines unless a machine specifies a different ImageLookupOrg.

        +

        ExtraPolicyAttachments is a list of additional policies to be attached to the IAM user.

        -imageLookupBaseOS
        +extraGroups
        -string +[]string
        -

        ImageLookupBaseOS is the name of the base operating system used to look -up machine images when a machine does not specify an AMI. When set, this -will be used for all cluster machines unless a machine specifies a -different ImageLookupBaseOS.

        +

        ExtraGroups is a list of groups to add this user to.

        -bastion
        +extraStatements
        - -Cluster API AWS api/v1alpha4.Bastion - +[]Cluster API AWS iam/api/v1beta1.StatementEntry
        -(Optional) -

        Bastion contains options to configure the bastion host.

        +

        ExtraStatements are additional AWS IAM policy document statements to be included inline for the user.

        -tokenMethod
        +tags
        - -EKSTokenMethod - +Cluster API AWS api/v1beta1.Tags
        -

        TokenMethod is used to specify the method for obtaining a client token for communicating with EKS -iam-authenticator - obtains a client token using iam-authentictor -aws-cli - obtains a client token using the AWS CLI -Defaults to iam-authenticator

        +

        Tags is a map of tags to be applied to the AWS IAM user.

        +

        ClusterAPIControllers +

        +

        +(Appears on:AWSIAMConfigurationSpec) +

        +

        +

        ClusterAPIControllers controls the configuration of the AWS IAM role for +the Kubernetes Cluster API Provider AWS controller.

        +

        + + + + + + + + + +
        FieldDescription
        -associateOIDCProvider
        +AWSIAMRoleSpec
        -bool + +AWSIAMRoleSpec +
        -

        AssociateOIDCProvider can be enabled to automatically create an identity -provider for the controller for use with IAM roles for service accounts

        +

        +(Members of AWSIAMRoleSpec are embedded into this type.) +

        -addons
        +allowedEC2InstanceProfiles
        - -[]../../controlplane/eks/api/v1alpha4.Addon - +[]string
        -(Optional) -

        Addons defines the EKS addons to enable with the EKS cluster.

        +

        AllowedEC2InstanceProfiles controls which EC2 roles are allowed to be +consumed by Cluster API when creating an ec2 instance. Defaults to +*., where suffix is defaulted to .cluster-api-provider-aws.sigs.k8s.io

        +

        ControlPlane +

        +

        +(Appears on:AWSIAMConfigurationSpec) +

        +

        +

        ControlPlane controls the configuration of the AWS IAM role for +the control plane of provisioned Kubernetes clusters.

        +

        + + + + + + + + + + + + + + + + +
        FieldDescription
        -oidcIdentityProviderConfig
        +AWSIAMRoleSpec
        - -OIDCIdentityProviderConfig + +AWSIAMRoleSpec
        -(Optional) -

        IdentityProviderconfig is used to specify the oidc provider config -to be attached with this eks cluster

        +

        +(Members of AWSIAMRoleSpec are embedded into this type.) +

        -disableVPCCNI
        +disableClusterAPIControllerPolicyAttachment
        bool
        -

        DisableVPCCNI indcates the the Amazon VPC CNI should be disabled. With EKS clusters that -the Amazon VPC CNI is automatically installed into the cluster. For clusters where you want -to use an alternate CNI this option provides a way to specify that the Amazon VPC CNI -should be deleted. You cannot set this to true if you are using the -Amazon VPC CNI addon or if you have specified a secondary CIDR block.

        +

        DisableClusterAPIControllerPolicyAttachment, if set to true, will not attach the AWS IAM policy for Cluster +API Provider AWS to the control plane role. Defaults to false.

        +
        +disableCloudProviderPolicy
        + +bool + +
        +

        DisableCloudProviderPolicy if set to true, will not generate and attach the AWS IAM policy for the AWS Cloud Provider.

        +
        +enableCSIPolicy
        + +bool + +
        +

        EnableCSIPolicy if set to true, will generate and attach the AWS IAM policy for the EBS CSI Driver.

        +

        EKSConfig +

        +

        +(Appears on:AWSIAMConfigurationSpec) +

        +

        +

        EKSConfig represents the EKS related configuration config.

        +

        + + + + + + + + + + + + + + + + + + + + + + + + + + +
        FieldDescription
        +disable
        + +bool + +
        +

        Disable controls whether EKS-related permissions are granted

        -status
        +iamRoleCreation
        - -AWSManagedControlPlaneStatus +bool + +
        +

        AllowIAMRoleCreation controls whether the EKS controllers have permissions for creating IAM +roles per cluster

        +
        +defaultControlPlaneRole
        + + +AWSIAMRoleSpec + + +
        +

        DefaultControlPlaneRole controls the configuration of the AWS IAM role for +the EKS control plane. This is the default role that will be used if +no role is included in the spec and automatic creation of the role +isn’t enabled

        +
        +managedMachinePool
        + + +AWSIAMRoleSpec + + +
        +

        ManagedMachinePool controls the configuration of the AWS IAM role for +used by EKS managed machine pools.

        +
        +fargate
        + + +AWSIAMRoleSpec
        +

        Fargate controls the configuration of the AWS IAM role for +used by EKS managed machine pools.

        +
        +kmsAliasPrefix
        + +string + +
        +

        KMSAliasPrefix is prefix to use to restrict permission to KMS keys to only those that have an alias +name that is prefixed by this. +Defaults to cluster-api-provider-aws-*

        -

        AWSManagedControlPlaneSpec +

        EventBridgeConfig

        -(Appears on:AWSManagedControlPlane) +(Appears on:AWSIAMConfigurationSpec)

        -

        AWSManagedControlPlaneSpec defines the desired state of AWSManagedControlPlane

        +

        EventBridgeConfig represents configuration for enabling experimental feature to consume +EventBridge EC2 events.

        @@ -1768,93 +1776,10074 @@ AWSManagedControlPlaneStatus + + +
        -eksClusterName
        +enable
        -string +bool
        -(Optional) -

        EKSClusterName allows you to specify the name of the EKS cluster in -AWS. If you don’t specify a name then a default name will be created -based on the namespace and name of the managed control plane.

        +

        Enable controls whether permissions are granted to consume EC2 events

        +
        +

        Nodes +

        +

        +(Appears on:AWSIAMConfigurationSpec) +

        +

        +

        Nodes controls the configuration of the AWS IAM role for worker nodes +in a cluster created by Kubernetes Cluster API Provider AWS.

        +

        + + + + + + + + + + + + + + + + + + + + + +
        FieldDescription
        +AWSIAMRoleSpec
        + + +AWSIAMRoleSpec + + +
        +

        +(Members of AWSIAMRoleSpec are embedded into this type.) +

        +
        +disableCloudProviderPolicy
        + +bool + +
        +

        DisableCloudProviderPolicy if set to true, will not generate and attach the policy for the AWS Cloud Provider. +Defaults to false.

        +
        +ec2ContainerRegistryReadOnly
        + +bool + +
        +

        EC2ContainerRegistryReadOnly controls whether the node has read-only access to the +EC2 container registry

        +
        +
        +

        bootstrap.cluster.x-k8s.io/v1alpha4

        +Resource Types: +
          +

          EKSConfig +

          +

          +

          EKSConfig is the Schema for the eksconfigs API

          +

          + + + + + + + + + + + + + + + + + + + + + +
          FieldDescription
          +metadata
          + + +Kubernetes meta/v1.ObjectMeta + + +
          +Refer to the Kubernetes API documentation for the fields of the +metadata field. +
          +spec
          + + +EKSConfigSpec + + +
          +
          +
          + + + + + +
          +kubeletExtraArgs
          + +map[string]string + +
          +(Optional) +

          Passes the kubelet args into the EKS bootstrap script

          +
          +
          +status
          + + +EKSConfigStatus + + +
          +
          +

          EKSConfigSpec +

          +

          +(Appears on:EKSConfig, EKSConfigTemplateResource) +

          +

          +

          EKSConfigSpec defines the desired state of EKSConfig

          +

          + + + + + + + + + + + + + +
          FieldDescription
          +kubeletExtraArgs
          + +map[string]string + +
          +(Optional) +

          Passes the kubelet args into the EKS bootstrap script

          +
          +

          EKSConfigStatus +

          +

          +(Appears on:EKSConfig) +

          +

          +

          EKSConfigStatus defines the observed state of EKSConfig

          +

          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          FieldDescription
          +ready
          + +bool + +
          +

          Ready indicates the BootstrapData secret is ready to be consumed

          +
          +dataSecretName
          + +string + +
          +(Optional) +

          DataSecretName is the name of the secret that stores the bootstrap data script.

          +
          +failureReason
          + +string + +
          +(Optional) +

          FailureReason will be set on non-retryable errors

          +
          +failureMessage
          + +string + +
          +(Optional) +

          FailureMessage will be set on non-retryable errors

          +
          +observedGeneration
          + +int64 + +
          +(Optional) +

          ObservedGeneration is the latest generation observed by the controller.

          +
          +conditions
          + + +Cluster API api/v1alpha4.Conditions + + +
          +(Optional) +

          Conditions defines current service state of the EKSConfig.

          +
          +

          EKSConfigTemplate +

          +

          +

          EKSConfigTemplate is the Schema for the eksconfigtemplates API

          +

          + + + + + + + + + + + + + + + + + +
          FieldDescription
          +metadata
          + + +Kubernetes meta/v1.ObjectMeta + + +
          +Refer to the Kubernetes API documentation for the fields of the +metadata field. +
          +spec
          + + +EKSConfigTemplateSpec + + +
          +
          +
          + + + + + +
          +template
          + + +EKSConfigTemplateResource + + +
          +
          +
          +

          EKSConfigTemplateResource +

          +

          +(Appears on:EKSConfigTemplateSpec) +

          +

          +

          EKSConfigTemplateResource defines the Template structure

          +

          + + + + + + + + + + + + + +
          FieldDescription
          +spec
          + + +EKSConfigSpec + + +
          +
          +
          + + + + + +
          +kubeletExtraArgs
          + +map[string]string + +
          +(Optional) +

          Passes the kubelet args into the EKS bootstrap script

          +
          +
          +

          EKSConfigTemplateSpec +

          +

          +(Appears on:EKSConfigTemplate) +

          +

          +

          EKSConfigTemplateSpec defines the desired state of EKSConfigTemplate

          +

          + + + + + + + + + + + + + +
          FieldDescription
          +template
          + + +EKSConfigTemplateResource + + +
          +
          +
          +

          bootstrap.cluster.x-k8s.io/v1beta1

          +Resource Types: +
            +

            EKSConfig +

            +

            +

            EKSConfig is the schema for the Amazon EKS Machine Bootstrap Configuration API.

            +

            + + + + + + + + + + + + + + + + + + + + + +
            FieldDescription
            +metadata
            + + +Kubernetes meta/v1.ObjectMeta + + +
            +Refer to the Kubernetes API documentation for the fields of the +metadata field. +
            +spec
            + + +EKSConfigSpec + + +
            +
            +
            + + + + + +
            +kubeletExtraArgs
            + +map[string]string + +
            +(Optional) +

            KubeletExtraArgs passes the specified kubelet args into the Amazon EKS machine bootstrap script

            +
            +
            +status
            + + +EKSConfigStatus + + +
            +
            +

            EKSConfigSpec +

            +

            +(Appears on:EKSConfig, EKSConfigTemplateResource) +

            +

            +

            EKSConfigSpec defines the desired state of Amazon EKS Bootstrap Configuration.

            +

            + + + + + + + + + + + + + +
            FieldDescription
            +kubeletExtraArgs
            + +map[string]string + +
            +(Optional) +

            KubeletExtraArgs passes the specified kubelet args into the Amazon EKS machine bootstrap script

            +
            +

            EKSConfigStatus +

            +

            +(Appears on:EKSConfig) +

            +

            +

            EKSConfigStatus defines the observed state of the Amazon EKS Bootstrap Configuration.

            +

            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            FieldDescription
            +ready
            + +bool + +
            +

            Ready indicates the BootstrapData secret is ready to be consumed

            +
            +dataSecretName
            + +string + +
            +(Optional) +

            DataSecretName is the name of the secret that stores the bootstrap data script.

            +
            +failureReason
            + +string + +
            +(Optional) +

            FailureReason will be set on non-retryable errors

            +
            +failureMessage
            + +string + +
            +(Optional) +

            FailureMessage will be set on non-retryable errors

            +
            +observedGeneration
            + +int64 + +
            +(Optional) +

            ObservedGeneration is the latest generation observed by the controller.

            +
            +conditions
            + +Cluster API api/v1beta1.Conditions + +
            +(Optional) +

            Conditions defines current service state of the EKSConfig.

            +
            +

            EKSConfigTemplate +

            +

            +

            EKSConfigTemplate is the Amazon EKS Bootstrap Configuration Template API.

            +

            + + + + + + + + + + + + + + + + + +
            FieldDescription
            +metadata
            + + +Kubernetes meta/v1.ObjectMeta + + +
            +Refer to the Kubernetes API documentation for the fields of the +metadata field. +
            +spec
            + + +EKSConfigTemplateSpec + + +
            +
            +
            + + + + + +
            +template
            + + +EKSConfigTemplateResource + + +
            +
            +
            +

            EKSConfigTemplateResource +

            +

            +(Appears on:EKSConfigTemplateSpec) +

            +

            +

            EKSConfigTemplateResource defines the Template structure.

            +

            + + + + + + + + + + + + + +
            FieldDescription
            +spec
            + + +EKSConfigSpec + + +
            +
            +
            + + + + + +
            +kubeletExtraArgs
            + +map[string]string + +
            +(Optional) +

            KubeletExtraArgs passes the specified kubelet args into the Amazon EKS machine bootstrap script

            +
            +
            +

            EKSConfigTemplateSpec +

            +

            +(Appears on:EKSConfigTemplate) +

            +

            +

            EKSConfigTemplateSpec defines the desired state of templated EKSConfig Amazon EKS Bootstrap Configuration resources.

            +

            + + + + + + + + + + + + + +
            FieldDescription
            +template
            + + +EKSConfigTemplateResource + + +
            +
            +
            +

            controlplane.cluster.x-k8s.io/v1alpha4

            +Resource Types: +
              +

              AWSManagedControlPlane +

              +

              +

              AWSManagedControlPlane is the Schema for the awsmanagedcontrolplanes API

              +

              + + + + + + + + + + + + + + + + + + + + + +
              FieldDescription
              +metadata
              + + +Kubernetes meta/v1.ObjectMeta + + +
              +Refer to the Kubernetes API documentation for the fields of the +metadata field. +
              +spec
              + + +AWSManagedControlPlaneSpec + + +
              +
              +
              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              +eksClusterName
              + +string + +
              +(Optional) +

              EKSClusterName allows you to specify the name of the EKS cluster in +AWS. If you don’t specify a name then a default name will be created +based on the namespace and name of the managed control plane.

              +
              +identityRef
              + + +Cluster API AWS api/v1alpha4.AWSIdentityReference + + +
              +(Optional) +

              IdentityRef is a reference to a identity to be used when reconciling the managed control plane.

              +
              +network
              + + +Cluster API AWS api/v1alpha4.NetworkSpec + + +
              +

              NetworkSpec encapsulates all things related to AWS network.

              +
              +secondaryCidrBlock
              + +string + +
              +(Optional) +

              SecondaryCidrBlock is the additional CIDR range to use for pod IPs. +Must be within the 100.64.0.0/10 or 198.19.0.0/16 range.

              +
              +region
              + +string + +
              +

              The AWS Region the cluster lives in.

              +
              +sshKeyName
              + +string + +
              +(Optional) +

              SSHKeyName is the name of the ssh key to attach to the bastion host. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name)

              +
              +version
              + +string + +
              +(Optional) +

              Version defines the desired Kubernetes version. If no version number +is supplied then the latest version of Kubernetes that EKS supports +will be used.

              +
              +roleName
              + +string + +
              +(Optional) +

              RoleName specifies the name of IAM role that gives EKS +permission to make API calls. If the role is pre-existing +we will treat it as unmanaged and not delete it on +deletion. If the EKSEnableIAM feature flag is true +and no name is supplied then a role is created.

              +
              +roleAdditionalPolicies
              + +[]string + +
              +(Optional) +

              RoleAdditionalPolicies allows you to attach additional polices to +the control plane role. You must enable the EKSAllowAddRoles +feature flag to incorporate these into the created role.

              +
              +logging
              + + +ControlPlaneLoggingSpec + + +
              +(Optional) +

              Logging specifies which EKS Cluster logs should be enabled. Entries for +each of the enabled logs will be sent to CloudWatch

              +
              +encryptionConfig
              + + +EncryptionConfig + + +
              +(Optional) +

              EncryptionConfig specifies the encryption configuration for the cluster

              +
              +additionalTags
              + + +Cluster API AWS api/v1alpha4.Tags + + +
              +(Optional) +

              AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the +ones added by default.

              +
              +iamAuthenticatorConfig
              + + +IAMAuthenticatorConfig + + +
              +(Optional) +

              IAMAuthenticatorConfig allows the specification of any additional user or role mappings +for use when generating the aws-iam-authenticator configuration. If this is nil the +default configuration is still generated for the cluster.

              +
              +endpointAccess
              + + +EndpointAccess + + +
              +(Optional) +

              Endpoints specifies access to this cluster’s control plane endpoints

              +
              +controlPlaneEndpoint
              + + +Cluster API api/v1alpha4.APIEndpoint + + +
              +(Optional) +

              ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.

              +
              +imageLookupFormat
              + +string + +
              +(Optional) +

              ImageLookupFormat is the AMI naming format to look up machine images when +a machine does not specify an AMI. When set, this will be used for all +cluster machines unless a machine specifies a different ImageLookupOrg. +Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base +OS and kubernetes version, respectively. The BaseOS will be the value in +ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as +defined by the packages produced by kubernetes/release without v as a +prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default +image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up +searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a +Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See +also: https://golang.org/pkg/text/template/

              +
              +imageLookupOrg
              + +string + +
              +(Optional) +

              ImageLookupOrg is the AWS Organization ID to look up machine images when a +machine does not specify an AMI. When set, this will be used for all +cluster machines unless a machine specifies a different ImageLookupOrg.

              +
              +imageLookupBaseOS
              + +string + +
              +

              ImageLookupBaseOS is the name of the base operating system used to look +up machine images when a machine does not specify an AMI. When set, this +will be used for all cluster machines unless a machine specifies a +different ImageLookupBaseOS.

              +
              +bastion
              + + +Cluster API AWS api/v1alpha4.Bastion + + +
              +(Optional) +

              Bastion contains options to configure the bastion host.

              +
              +tokenMethod
              + + +EKSTokenMethod + + +
              +

              TokenMethod is used to specify the method for obtaining a client token for communicating with EKS +iam-authenticator - obtains a client token using iam-authentictor +aws-cli - obtains a client token using the AWS CLI +Defaults to iam-authenticator

              +
              +associateOIDCProvider
              + +bool + +
              +

              AssociateOIDCProvider can be enabled to automatically create an identity +provider for the controller for use with IAM roles for service accounts

              +
              +addons
              + + +[]../../controlplane/eks/api/v1alpha4.Addon + + +
              +(Optional) +

              Addons defines the EKS addons to enable with the EKS cluster.

              +
              +oidcIdentityProviderConfig
              + + +OIDCIdentityProviderConfig + + +
              +(Optional) +

              IdentityProviderconfig is used to specify the oidc provider config +to be attached with this eks cluster

              +
              +disableVPCCNI
              + +bool + +
              +

              DisableVPCCNI indcates the the Amazon VPC CNI should be disabled. With EKS clusters that +the Amazon VPC CNI is automatically installed into the cluster. For clusters where you want +to use an alternate CNI this option provides a way to specify that the Amazon VPC CNI +should be deleted. You cannot set this to true if you are using the +Amazon VPC CNI addon or if you have specified a secondary CIDR block.

              +
              +
              +status
              + + +AWSManagedControlPlaneStatus + + +
              +
              +

              AWSManagedControlPlaneSpec +

              +

              +(Appears on:AWSManagedControlPlane) +

              +

              +

              AWSManagedControlPlaneSpec defines the desired state of AWSManagedControlPlane

              +

              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              FieldDescription
              +eksClusterName
              + +string + +
              +(Optional) +

              EKSClusterName allows you to specify the name of the EKS cluster in +AWS. If you don’t specify a name then a default name will be created +based on the namespace and name of the managed control plane.

              +
              +identityRef
              + + +Cluster API AWS api/v1alpha4.AWSIdentityReference + + +
              +(Optional) +

              IdentityRef is a reference to a identity to be used when reconciling the managed control plane.

              +
              +network
              + + +Cluster API AWS api/v1alpha4.NetworkSpec + + +
              +

              NetworkSpec encapsulates all things related to AWS network.

              +
              +secondaryCidrBlock
              + +string + +
              +(Optional) +

              SecondaryCidrBlock is the additional CIDR range to use for pod IPs. +Must be within the 100.64.0.0/10 or 198.19.0.0/16 range.

              +
              +region
              + +string + +
              +

              The AWS Region the cluster lives in.

              +
              +sshKeyName
              + +string + +
              +(Optional) +

              SSHKeyName is the name of the ssh key to attach to the bastion host. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name)

              +
              +version
              + +string + +
              +(Optional) +

              Version defines the desired Kubernetes version. If no version number +is supplied then the latest version of Kubernetes that EKS supports +will be used.

              +
              +roleName
              + +string + +
              +(Optional) +

              RoleName specifies the name of IAM role that gives EKS +permission to make API calls. If the role is pre-existing +we will treat it as unmanaged and not delete it on +deletion. If the EKSEnableIAM feature flag is true +and no name is supplied then a role is created.

              +
              +roleAdditionalPolicies
              + +[]string + +
              +(Optional) +

              RoleAdditionalPolicies allows you to attach additional polices to +the control plane role. You must enable the EKSAllowAddRoles +feature flag to incorporate these into the created role.

              +
              +logging
              + + +ControlPlaneLoggingSpec + + +
              +(Optional) +

              Logging specifies which EKS Cluster logs should be enabled. Entries for +each of the enabled logs will be sent to CloudWatch

              +
              +encryptionConfig
              + + +EncryptionConfig + + +
              +(Optional) +

              EncryptionConfig specifies the encryption configuration for the cluster

              +
              +additionalTags
              + + +Cluster API AWS api/v1alpha4.Tags + + +
              +(Optional) +

              AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the +ones added by default.

              +
              +iamAuthenticatorConfig
              + + +IAMAuthenticatorConfig + + +
              +(Optional) +

              IAMAuthenticatorConfig allows the specification of any additional user or role mappings +for use when generating the aws-iam-authenticator configuration. If this is nil the +default configuration is still generated for the cluster.

              +
              +endpointAccess
              + + +EndpointAccess + + +
              +(Optional) +

              Endpoints specifies access to this cluster’s control plane endpoints

              +
              +controlPlaneEndpoint
              + + +Cluster API api/v1alpha4.APIEndpoint + + +
              +(Optional) +

              ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.

              +
              +imageLookupFormat
              + +string + +
              +(Optional) +

              ImageLookupFormat is the AMI naming format to look up machine images when +a machine does not specify an AMI. When set, this will be used for all +cluster machines unless a machine specifies a different ImageLookupOrg. +Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base +OS and kubernetes version, respectively. The BaseOS will be the value in +ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as +defined by the packages produced by kubernetes/release without v as a +prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default +image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up +searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a +Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See +also: https://golang.org/pkg/text/template/

              +
              +imageLookupOrg
              + +string + +
              +(Optional) +

              ImageLookupOrg is the AWS Organization ID to look up machine images when a +machine does not specify an AMI. When set, this will be used for all +cluster machines unless a machine specifies a different ImageLookupOrg.

              +
              +imageLookupBaseOS
              + +string + +
              +

              ImageLookupBaseOS is the name of the base operating system used to look +up machine images when a machine does not specify an AMI. When set, this +will be used for all cluster machines unless a machine specifies a +different ImageLookupBaseOS.

              +
              +bastion
              + + +Cluster API AWS api/v1alpha4.Bastion + + +
              +(Optional) +

              Bastion contains options to configure the bastion host.

              +
              +tokenMethod
              + + +EKSTokenMethod + + +
              +

              TokenMethod is used to specify the method for obtaining a client token for communicating with EKS +iam-authenticator - obtains a client token using iam-authentictor +aws-cli - obtains a client token using the AWS CLI +Defaults to iam-authenticator

              +
              +associateOIDCProvider
              + +bool + +
              +

              AssociateOIDCProvider can be enabled to automatically create an identity +provider for the controller for use with IAM roles for service accounts

              +
              +addons
              + + +[]../../controlplane/eks/api/v1alpha4.Addon + + +
              +(Optional) +

              Addons defines the EKS addons to enable with the EKS cluster.

              +
              +oidcIdentityProviderConfig
              + + +OIDCIdentityProviderConfig + + +
              +(Optional) +

              IdentityProviderconfig is used to specify the oidc provider config +to be attached with this eks cluster

              +
              +disableVPCCNI
              + +bool + +
              +

              DisableVPCCNI indcates the the Amazon VPC CNI should be disabled. With EKS clusters that +the Amazon VPC CNI is automatically installed into the cluster. For clusters where you want +to use an alternate CNI this option provides a way to specify that the Amazon VPC CNI +should be deleted. You cannot set this to true if you are using the +Amazon VPC CNI addon or if you have specified a secondary CIDR block.

              +
              +

              AWSManagedControlPlaneStatus +

              +

              +(Appears on:AWSManagedControlPlane) +

              +

              +

              AWSManagedControlPlaneStatus defines the observed state of AWSManagedControlPlane

              +

              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              FieldDescription
              +networkStatus
              + + +Cluster API AWS api/v1alpha4.NetworkStatus + + +
              +(Optional) +

              Networks holds details about the AWS networking resources used by the control plane

              +
              +failureDomains
              + + +Cluster API api/v1alpha4.FailureDomains + + +
              +(Optional) +

              FailureDomains specifies a list fo available availability zones that can be used

              +
              +bastion
              + + +Cluster API AWS api/v1alpha4.Instance + + +
              +(Optional) +

              Bastion holds details of the instance that is used as a bastion jump box

              +
              +oidcProvider
              + + +OIDCProviderStatus + + +
              +(Optional) +

              OIDCProvider holds the status of the identity provider for this cluster

              +
              +externalManagedControlPlane
              + +bool + +
              +

              ExternalManagedControlPlane indicates to cluster-api that the control plane +is managed by an external service such as AKS, EKS, GKE, etc.

              +
              +initialized
              + +bool + +
              +(Optional) +

              Initialized denotes whether or not the control plane has the +uploaded kubernetes config-map.

              +
              +ready
              + +bool + +
              +

              Ready denotes that the AWSManagedControlPlane API Server is ready to +receive requests and that the VPC infra is ready.

              +
              +failureMessage
              + +string + +
              +(Optional) +

              ErrorMessage indicates that there is a terminal problem reconciling the +state, and will be set to a descriptive error message.

              +
              +conditions
              + + +Cluster API api/v1alpha4.Conditions + + +
              +

              Conditions specifies the cpnditions for the managed control plane

              +
              +addons
              + + +[]AddonState + + +
              +(Optional) +

              Addons holds the current status of the EKS addons

              +
              +identityProviderStatus
              + + +IdentityProviderStatus + + +
              +(Optional) +

              IdentityProviderStatus holds the status for +associated identity provider

              +
              +

              Addon +

              +

              +

              Addon represents a EKS addon

              +

              + + + + + + + + + + + + + + + + + + + + + + + + + +
              FieldDescription
              +name
              + +string + +
              +

              Name is the name of the addon

              +
              +version
              + +string + +
              +

              Version is the version of the addon to use

              +
              +conflictResolution
              + + +AddonResolution + + +
              +

              ConflictResolution is used to declare what should happen if there +are parameter conflicts. Defaults to none

              +
              +serviceAccountRoleARN
              + +string + +
              +(Optional) +

              ServiceAccountRoleArn is the ARN of an IAM role to bind to the addons service account

              +
              +

              AddonIssue +

              +

              +(Appears on:AddonState) +

              +

              +

              AddonIssue represents an issue with an addon

              +

              + + + + + + + + + + + + + + + + + + + + + +
              FieldDescription
              +code
              + +string + +
              +

              Code is the issue code

              +
              +message
              + +string + +
              +

              Message is the textual description of the issue

              +
              +resourceIds
              + +[]string + +
              +

              ResourceIDs is a list of resource ids for the issue

              +
              +

              AddonResolution +(string alias)

              +

              +(Appears on:Addon) +

              +

              +

              AddonResolution defines the method for resolving parameter conflicts.

              +

              +

              AddonState +

              +

              +(Appears on:AWSManagedControlPlaneStatus) +

              +

              +

              AddonState represents the state of an addon

              +

              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              FieldDescription
              +name
              + +string + +
              +

              Name is the name of the addon

              +
              +version
              + +string + +
              +

              Version is the version of the addon to use

              +
              +arn
              + +string + +
              +

              ARN is the AWS ARN of the addon

              +
              +serviceAccountRoleARN
              + +string + +
              +

              ServiceAccountRoleArn is the ARN of the IAM role used for the service account

              +
              +createdAt
              + + +Kubernetes meta/v1.Time + + +
              +

              CreatedAt is the date and time the addon was created at

              +
              +modifiedAt
              + + +Kubernetes meta/v1.Time + + +
              +

              ModifiedAt is the date and time the addon was last modified

              +
              +status
              + +string + +
              +

              Status is the status of the addon

              +
              +issues
              + + +[]AddonIssue + + +
              +

              Issues is a list of issue associated with the addon

              +
              +

              AddonStatus +(string alias)

              +

              +

              AddonStatus defines the status for an addon.

              +

              +

              ControlPlaneLoggingSpec +

              +

              +(Appears on:AWSManagedControlPlaneSpec) +

              +

              +

              ControlPlaneLoggingSpec defines what EKS control plane logs that should be enabled.

              +

              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              FieldDescription
              +apiServer
              + +bool + +
              +

              APIServer indicates if the Kubernetes API Server log (kube-apiserver) shoulkd be enabled

              +
              +audit
              + +bool + +
              +

              Audit indicates if the Kubernetes API audit log should be enabled

              +
              +authenticator
              + +bool + +
              +

              Authenticator indicates if the iam authenticator log should be enabled

              +
              +controllerManager
              + +bool + +
              +

              ControllerManager indicates if the controller manager (kube-controller-manager) log should be enabled

              +
              +scheduler
              + +bool + +
              +

              Scheduler indicates if the Kubernetes scheduler (kube-scheduler) log should be enabled

              +
              +

              EKSTokenMethod +(string alias)

              +

              +(Appears on:AWSManagedControlPlaneSpec) +

              +

              +

              EKSTokenMethod defines the method for obtaining a client token to use when connecting to EKS.

              +

              +

              EncryptionConfig +

              +

              +(Appears on:AWSManagedControlPlaneSpec) +

              +

              +

              EncryptionConfig specifies the encryption configuration for the EKS clsuter.

              +

              + + + + + + + + + + + + + + + + + +
              FieldDescription
              +provider
              + +string + +
              +

              Provider specifies the ARN or alias of the CMK (in AWS KMS)

              +
              +resources
              + +[]*string + +
              +

              Resources specifies the resources to be encrypted

              +
              +

              EndpointAccess +

              +

              +(Appears on:AWSManagedControlPlaneSpec) +

              +

              +

              EndpointAccess specifies how control plane endpoints are accessible.

              +

              + + + + + + + + + + + + + + + + + + + + + +
              FieldDescription
              +public
              + +bool + +
              +(Optional) +

              Public controls whether control plane endpoints are publicly accessible

              +
              +publicCIDRs
              + +[]*string + +
              +(Optional) +

              PublicCIDRs specifies which blocks can access the public endpoint

              +
              +private
              + +bool + +
              +(Optional) +

              Private points VPC-internal control plane access to the private endpoint

              +
              +

              IAMAuthenticatorConfig +

              +

              +(Appears on:AWSManagedControlPlaneSpec) +

              +

              +

              IAMAuthenticatorConfig represents an aws-iam-authenticator configuration.

              +

              + + + + + + + + + + + + + + + + + +
              FieldDescription
              +mapRoles
              + + +[]RoleMapping + + +
              +(Optional) +

              RoleMappings is a list of role mappings

              +
              +mapUsers
              + + +[]UserMapping + + +
              +(Optional) +

              UserMappings is a list of user mappings

              +
              +

              IdentityProviderStatus +

              +

              +(Appears on:AWSManagedControlPlaneStatus) +

              +

              +

              + + + + + + + + + + + + + + + + + +
              FieldDescription
              +arn
              + +string + +
              +

              ARN holds the ARN of associated identity provider

              +
              +status
              + +string + +
              +

              Status holds current status of associated identity provider

              +
              +

              KubernetesMapping +

              +

              +(Appears on:RoleMapping, UserMapping) +

              +

              +

              KubernetesMapping represents the kubernetes RBAC mapping.

              +

              + + + + + + + + + + + + + + + + + +
              FieldDescription
              +username
              + +string + +
              +

              UserName is a kubernetes RBAC user subject

              +
              +groups
              + +[]string + +
              +

              Groups is a list of kubernetes RBAC groups

              +
              +

              OIDCIdentityProviderConfig +

              +

              +(Appears on:AWSManagedControlPlaneSpec) +

              +

              +

              + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
              FieldDescription
              +clientId
              + +string + +
              +

              This is also known as audience. The ID for the client application that makes +authentication requests to the OpenID identity provider.

              +
              +groupsClaim
              + +string + +
              +(Optional) +

              The JWT claim that the provider uses to return your groups.

              +
              +groupsPrefix
              + +string + +
              +(Optional) +

              The prefix that is prepended to group claims to prevent clashes with existing +names (such as system: groups). For example, the valueoidc: will create group +names like oidc:engineering and oidc:infra.

              +
              +identityProviderConfigName
              + +string + +
              +

              The name of the OIDC provider configuration.

              +

              IdentityProviderConfigName is a required field

              +
              +issuerUrl
              + +string + +
              +

              The URL of the OpenID identity provider that allows the API server to discover +public signing keys for verifying tokens. The URL must begin with https:// +and should correspond to the iss claim in the provider’s OIDC ID tokens. +Per the OIDC standard, path components are allowed but query parameters are +not. Typically the URL consists of only a hostname, like https://server.example.org +or https://example.com. This URL should point to the level below .well-known/openid-configuration +and must be publicly accessible over the internet.

              +
              +requiredClaims
              + +map[string]string + +
              +(Optional) +

              The key value pairs that describe required claims in the identity token. +If set, each claim is verified to be present in the token with a matching +value. For the maximum number of claims that you can require, see Amazon +EKS service quotas (https://docs.aws.amazon.com/eks/latest/userguide/service-quotas.html) +in the Amazon EKS User Guide.

              +
              +usernameClaim
              + +string + +
              +(Optional) +

              The JSON Web Token (JWT) claim to use as the username. The default is sub, +which is expected to be a unique identifier of the end user. You can choose +other claims, such as email or name, depending on the OpenID identity provider. +Claims other than email are prefixed with the issuer URL to prevent naming +clashes with other plug-ins.

              +
              +usernamePrefix
              + +string + +
              +(Optional) +

              The prefix that is prepended to username claims to prevent clashes with existing +names. If you do not provide this field, and username is a value other than +email, the prefix defaults to issuerurl#. You can use the value - to disable +all prefixing.

              +
              +tags
              + + +Cluster API AWS api/v1alpha4.Tags + + +
              +(Optional) +

              tags to apply to oidc identity provider association

              +
              +

              OIDCProviderStatus +

              +

              +(Appears on:AWSManagedControlPlaneStatus) +

              +

              +

              OIDCProviderStatus holds the status of the AWS OIDC identity provider.

              +

              + + + + + + + + + + + + + + + + + +
              FieldDescription
              +arn
              + +string + +
              +

              ARN holds the ARN of the provider

              +
              +trustPolicy
              + +string + +
              +

              TrustPolicy contains the boilerplate IAM trust policy to use for IRSA

              +
              +

              RoleMapping +

              +

              +(Appears on:IAMAuthenticatorConfig) +

              +

              +

              RoleMapping represents a mapping from a IAM role to Kubernetes users and groups

              +

              + + + + + + + + + + + + + + + + + +
              FieldDescription
              +rolearn
              + +string + +
              +

              RoleARN is the AWS ARN for the role to map

              +
              +KubernetesMapping
              + + +KubernetesMapping + + +
              +

              +(Members of KubernetesMapping are embedded into this type.) +

              +

              KubernetesMapping holds the RBAC details for the mapping

              +
              +

              UserMapping +

              +

              +(Appears on:IAMAuthenticatorConfig) +

              +

              +

              UserMapping represents a mapping from an IAM user to Kubernetes users and groups

              +

              + + + + + + + + + + + + + + + + + +
              FieldDescription
              +userarn
              + +string + +
              +

              UserARN is the AWS ARN for the user to map

              +
              +KubernetesMapping
              + + +KubernetesMapping + + +
              +

              +(Members of KubernetesMapping are embedded into this type.) +

              +

              KubernetesMapping holds the RBAC details for the mapping

              +
              +
              +

              controlplane.cluster.x-k8s.io/v1beta1

              +

              +

              Package v1beta1 contains API Schema definitions for the controlplane v1beta1 API group

              +

              +Resource Types: +
                +

                AWSManagedControlPlane +

                +

                +

                AWSManagedControlPlane is the schema for the Amazon EKS Managed Control Plane API.

                +

                + + + + + + + + + + + + + + + + + + + + + +
                FieldDescription
                +metadata
                + + +Kubernetes meta/v1.ObjectMeta + + +
                +Refer to the Kubernetes API documentation for the fields of the +metadata field. +
                +spec
                + + +AWSManagedControlPlaneSpec + + +
                +
                +
                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                +eksClusterName
                + +string + +
                +(Optional) +

                EKSClusterName allows you to specify the name of the EKS cluster in +AWS. If you don’t specify a name then a default name will be created +based on the namespace and name of the managed control plane.

                +
                +identityRef
                + +Cluster API AWS api/v1beta1.AWSIdentityReference + +
                +(Optional) +

                IdentityRef is a reference to a identity to be used when reconciling the managed control plane.

                +
                +network
                + +Cluster API AWS api/v1beta1.NetworkSpec + +
                +

                NetworkSpec encapsulates all things related to AWS network.

                +
                +secondaryCidrBlock
                + +string + +
                +(Optional) +

                SecondaryCidrBlock is the additional CIDR range to use for pod IPs. +Must be within the 100.64.0.0/10 or 198.19.0.0/16 range.

                +
                +region
                + +string + +
                +

                The AWS Region the cluster lives in.

                +
                +sshKeyName
                + +string + +
                +(Optional) +

                SSHKeyName is the name of the ssh key to attach to the bastion host. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name)

                +
                +version
                + +string + +
                +(Optional) +

                Version defines the desired Kubernetes version. If no version number +is supplied then the latest version of Kubernetes that EKS supports +will be used.

                +
                +roleName
                + +string + +
                +(Optional) +

                RoleName specifies the name of IAM role that gives EKS +permission to make API calls. If the role is pre-existing +we will treat it as unmanaged and not delete it on +deletion. If the EKSEnableIAM feature flag is true +and no name is supplied then a role is created.

                +
                +roleAdditionalPolicies
                + +[]string + +
                +(Optional) +

                RoleAdditionalPolicies allows you to attach additional polices to +the control plane role. You must enable the EKSAllowAddRoles +feature flag to incorporate these into the created role.

                +
                +logging
                + + +ControlPlaneLoggingSpec + + +
                +(Optional) +

                Logging specifies which EKS Cluster logs should be enabled. Entries for +each of the enabled logs will be sent to CloudWatch

                +
                +encryptionConfig
                + + +EncryptionConfig + + +
                +(Optional) +

                EncryptionConfig specifies the encryption configuration for the cluster

                +
                +additionalTags
                + +Cluster API AWS api/v1beta1.Tags + +
                +(Optional) +

                AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the +ones added by default.

                +
                +iamAuthenticatorConfig
                + + +IAMAuthenticatorConfig + + +
                +(Optional) +

                IAMAuthenticatorConfig allows the specification of any additional user or role mappings +for use when generating the aws-iam-authenticator configuration. If this is nil the +default configuration is still generated for the cluster.

                +
                +endpointAccess
                + + +EndpointAccess + + +
                +(Optional) +

                Endpoints specifies access to this cluster’s control plane endpoints

                +
                +controlPlaneEndpoint
                + +Cluster API api/v1beta1.APIEndpoint + +
                +(Optional) +

                ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.

                +
                +imageLookupFormat
                + +string + +
                +(Optional) +

                ImageLookupFormat is the AMI naming format to look up machine images when +a machine does not specify an AMI. When set, this will be used for all +cluster machines unless a machine specifies a different ImageLookupOrg. +Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base +OS and kubernetes version, respectively. The BaseOS will be the value in +ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as +defined by the packages produced by kubernetes/release without v as a +prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default +image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up +searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a +Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See +also: https://golang.org/pkg/text/template/

                +
                +imageLookupOrg
                + +string + +
                +(Optional) +

                ImageLookupOrg is the AWS Organization ID to look up machine images when a +machine does not specify an AMI. When set, this will be used for all +cluster machines unless a machine specifies a different ImageLookupOrg.

                +
                +imageLookupBaseOS
                + +string + +
                +

                ImageLookupBaseOS is the name of the base operating system used to look +up machine images when a machine does not specify an AMI. When set, this +will be used for all cluster machines unless a machine specifies a +different ImageLookupBaseOS.

                +
                +bastion
                + +Cluster API AWS api/v1beta1.Bastion + +
                +(Optional) +

                Bastion contains options to configure the bastion host.

                +
                +tokenMethod
                + + +EKSTokenMethod + + +
                +

                TokenMethod is used to specify the method for obtaining a client token for communicating with EKS +iam-authenticator - obtains a client token using iam-authentictor +aws-cli - obtains a client token using the AWS CLI +Defaults to iam-authenticator

                +
                +associateOIDCProvider
                + +bool + +
                +

                AssociateOIDCProvider can be enabled to automatically create an identity +provider for the controller for use with IAM roles for service accounts

                +
                +addons
                + + +[]../../controlplane/eks/api/v1beta1.Addon + + +
                +(Optional) +

                Addons defines the EKS addons to enable with the EKS cluster.

                +
                +oidcIdentityProviderConfig
                + + +OIDCIdentityProviderConfig + + +
                +(Optional) +

                IdentityProviderconfig is used to specify the oidc provider config +to be attached with this eks cluster

                +
                +disableVPCCNI
                + +bool + +
                +

                DisableVPCCNI indcates the the Amazon VPC CNI should be disabled. With EKS clusters that +the Amazon VPC CNI is automatically installed into the cluster. For clusters where you want +to use an alternate CNI this option provides a way to specify that the Amazon VPC CNI +should be deleted. You cannot set this to true if you are using the +Amazon VPC CNI addon or if you have specified a secondary CIDR block.

                +
                +
                +status
                + + +AWSManagedControlPlaneStatus + + +
                +
                +

                AWSManagedControlPlaneSpec +

                +

                +(Appears on:AWSManagedControlPlane) +

                +

                +

                AWSManagedControlPlaneSpec defines the desired state of an Amazon EKS Cluster.

                +

                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                FieldDescription
                +eksClusterName
                + +string + +
                +(Optional) +

                EKSClusterName allows you to specify the name of the EKS cluster in +AWS. If you don’t specify a name then a default name will be created +based on the namespace and name of the managed control plane.

                +
                +identityRef
                + +Cluster API AWS api/v1beta1.AWSIdentityReference + +
                +(Optional) +

                IdentityRef is a reference to a identity to be used when reconciling the managed control plane.

                +
                +network
                + +Cluster API AWS api/v1beta1.NetworkSpec + +
                +

                NetworkSpec encapsulates all things related to AWS network.

                +
                +secondaryCidrBlock
                + +string + +
                +(Optional) +

                SecondaryCidrBlock is the additional CIDR range to use for pod IPs. +Must be within the 100.64.0.0/10 or 198.19.0.0/16 range.

                +
                +region
                + +string + +
                +

                The AWS Region the cluster lives in.

                +
                +sshKeyName
                + +string + +
                +(Optional) +

                SSHKeyName is the name of the ssh key to attach to the bastion host. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name)

                +
                +version
                + +string + +
                +(Optional) +

                Version defines the desired Kubernetes version. If no version number +is supplied then the latest version of Kubernetes that EKS supports +will be used.

                +
                +roleName
                + +string + +
                +(Optional) +

                RoleName specifies the name of IAM role that gives EKS +permission to make API calls. If the role is pre-existing +we will treat it as unmanaged and not delete it on +deletion. If the EKSEnableIAM feature flag is true +and no name is supplied then a role is created.

                +
                +roleAdditionalPolicies
                + +[]string + +
                +(Optional) +

                RoleAdditionalPolicies allows you to attach additional polices to +the control plane role. You must enable the EKSAllowAddRoles +feature flag to incorporate these into the created role.

                +
                +logging
                + + +ControlPlaneLoggingSpec + + +
                +(Optional) +

                Logging specifies which EKS Cluster logs should be enabled. Entries for +each of the enabled logs will be sent to CloudWatch

                +
                +encryptionConfig
                + + +EncryptionConfig + + +
                +(Optional) +

                EncryptionConfig specifies the encryption configuration for the cluster

                +
                +additionalTags
                + +Cluster API AWS api/v1beta1.Tags + +
                +(Optional) +

                AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the +ones added by default.

                +
                +iamAuthenticatorConfig
                + + +IAMAuthenticatorConfig + + +
                +(Optional) +

                IAMAuthenticatorConfig allows the specification of any additional user or role mappings +for use when generating the aws-iam-authenticator configuration. If this is nil the +default configuration is still generated for the cluster.

                +
                +endpointAccess
                + + +EndpointAccess + + +
                +(Optional) +

                Endpoints specifies access to this cluster’s control plane endpoints

                +
                +controlPlaneEndpoint
                + +Cluster API api/v1beta1.APIEndpoint + +
                +(Optional) +

                ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.

                +
                +imageLookupFormat
                + +string + +
                +(Optional) +

                ImageLookupFormat is the AMI naming format to look up machine images when +a machine does not specify an AMI. When set, this will be used for all +cluster machines unless a machine specifies a different ImageLookupOrg. +Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base +OS and kubernetes version, respectively. The BaseOS will be the value in +ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as +defined by the packages produced by kubernetes/release without v as a +prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default +image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up +searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a +Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See +also: https://golang.org/pkg/text/template/

                +
                +imageLookupOrg
                + +string + +
                +(Optional) +

                ImageLookupOrg is the AWS Organization ID to look up machine images when a +machine does not specify an AMI. When set, this will be used for all +cluster machines unless a machine specifies a different ImageLookupOrg.

                +
                +imageLookupBaseOS
                + +string + +
                +

                ImageLookupBaseOS is the name of the base operating system used to look +up machine images when a machine does not specify an AMI. When set, this +will be used for all cluster machines unless a machine specifies a +different ImageLookupBaseOS.

                +
                +bastion
                + +Cluster API AWS api/v1beta1.Bastion + +
                +(Optional) +

                Bastion contains options to configure the bastion host.

                +
                +tokenMethod
                + + +EKSTokenMethod + + +
                +

                TokenMethod is used to specify the method for obtaining a client token for communicating with EKS +iam-authenticator - obtains a client token using iam-authentictor +aws-cli - obtains a client token using the AWS CLI +Defaults to iam-authenticator

                +
                +associateOIDCProvider
                + +bool + +
                +

                AssociateOIDCProvider can be enabled to automatically create an identity +provider for the controller for use with IAM roles for service accounts

                +
                +addons
                + + +[]../../controlplane/eks/api/v1beta1.Addon + + +
                +(Optional) +

                Addons defines the EKS addons to enable with the EKS cluster.

                +
                +oidcIdentityProviderConfig
                + + +OIDCIdentityProviderConfig + + +
                +(Optional) +

                IdentityProviderconfig is used to specify the oidc provider config +to be attached with this eks cluster

                +
                +disableVPCCNI
                + +bool + +
                +

                DisableVPCCNI indcates the the Amazon VPC CNI should be disabled. With EKS clusters that +the Amazon VPC CNI is automatically installed into the cluster. For clusters where you want +to use an alternate CNI this option provides a way to specify that the Amazon VPC CNI +should be deleted. You cannot set this to true if you are using the +Amazon VPC CNI addon or if you have specified a secondary CIDR block.

                +
                +

                AWSManagedControlPlaneStatus +

                +

                +(Appears on:AWSManagedControlPlane) +

                +

                +

                AWSManagedControlPlaneStatus defines the observed state of an Amazon EKS Cluster.

                +

                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                FieldDescription
                +networkStatus
                + +Cluster API AWS api/v1beta1.NetworkStatus + +
                +(Optional) +

                Networks holds details about the AWS networking resources used by the control plane

                +
                +failureDomains
                + +Cluster API api/v1beta1.FailureDomains + +
                +(Optional) +

                FailureDomains specifies a list fo available availability zones that can be used

                +
                +bastion
                + +Cluster API AWS api/v1beta1.Instance + +
                +(Optional) +

                Bastion holds details of the instance that is used as a bastion jump box

                +
                +oidcProvider
                + + +OIDCProviderStatus + + +
                +(Optional) +

                OIDCProvider holds the status of the identity provider for this cluster

                +
                +externalManagedControlPlane
                + +bool + +
                +

                ExternalManagedControlPlane indicates to cluster-api that the control plane +is managed by an external service such as AKS, EKS, GKE, etc.

                +
                +initialized
                + +bool + +
                +(Optional) +

                Initialized denotes whether or not the control plane has the +uploaded kubernetes config-map.

                +
                +ready
                + +bool + +
                +

                Ready denotes that the AWSManagedControlPlane API Server is ready to +receive requests and that the VPC infra is ready.

                +
                +failureMessage
                + +string + +
                +(Optional) +

                ErrorMessage indicates that there is a terminal problem reconciling the +state, and will be set to a descriptive error message.

                +
                +conditions
                + +Cluster API api/v1beta1.Conditions + +
                +

                Conditions specifies the cpnditions for the managed control plane

                +
                +addons
                + + +[]AddonState + + +
                +(Optional) +

                Addons holds the current status of the EKS addons

                +
                +identityProviderStatus
                + + +IdentityProviderStatus + + +
                +(Optional) +

                IdentityProviderStatus holds the status for +associated identity provider

                +
                +

                Addon +

                +

                +

                Addon represents a EKS addon.

                +

                + + + + + + + + + + + + + + + + + + + + + + + + + +
                FieldDescription
                +name
                + +string + +
                +

                Name is the name of the addon

                +
                +version
                + +string + +
                +

                Version is the version of the addon to use

                +
                +conflictResolution
                + + +AddonResolution + + +
                +

                ConflictResolution is used to declare what should happen if there +are parameter conflicts. Defaults to none

                +
                +serviceAccountRoleARN
                + +string + +
                +(Optional) +

                ServiceAccountRoleArn is the ARN of an IAM role to bind to the addons service account

                +
                +

                AddonIssue +

                +

                +(Appears on:AddonState) +

                +

                +

                AddonIssue represents an issue with an addon.

                +

                + + + + + + + + + + + + + + + + + + + + + +
                FieldDescription
                +code
                + +string + +
                +

                Code is the issue code

                +
                +message
                + +string + +
                +

                Message is the textual description of the issue

                +
                +resourceIds
                + +[]string + +
                +

                ResourceIDs is a list of resource ids for the issue

                +
                +

                AddonResolution +(string alias)

                +

                +(Appears on:Addon) +

                +

                +

                AddonResolution defines the method for resolving parameter conflicts.

                +

                +

                AddonState +

                +

                +(Appears on:AWSManagedControlPlaneStatus) +

                +

                +

                AddonState represents the state of an addon.

                +

                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                FieldDescription
                +name
                + +string + +
                +

                Name is the name of the addon

                +
                +version
                + +string + +
                +

                Version is the version of the addon to use

                +
                +arn
                + +string + +
                +

                ARN is the AWS ARN of the addon

                +
                +serviceAccountRoleARN
                + +string + +
                +

                ServiceAccountRoleArn is the ARN of the IAM role used for the service account

                +
                +createdAt
                + + +Kubernetes meta/v1.Time + + +
                +

                CreatedAt is the date and time the addon was created at

                +
                +modifiedAt
                + + +Kubernetes meta/v1.Time + + +
                +

                ModifiedAt is the date and time the addon was last modified

                +
                +status
                + +string + +
                +

                Status is the status of the addon

                +
                +issues
                + + +[]AddonIssue + + +
                +

                Issues is a list of issue associated with the addon

                +
                +

                AddonStatus +(string alias)

                +

                +

                AddonStatus defines the status for an addon.

                +

                +

                ControlPlaneLoggingSpec +

                +

                +(Appears on:AWSManagedControlPlaneSpec) +

                +

                +

                ControlPlaneLoggingSpec defines what EKS control plane logs that should be enabled.

                +

                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                FieldDescription
                +apiServer
                + +bool + +
                +

                APIServer indicates if the Kubernetes API Server log (kube-apiserver) shoulkd be enabled

                +
                +audit
                + +bool + +
                +

                Audit indicates if the Kubernetes API audit log should be enabled

                +
                +authenticator
                + +bool + +
                +

                Authenticator indicates if the iam authenticator log should be enabled

                +
                +controllerManager
                + +bool + +
                +

                ControllerManager indicates if the controller manager (kube-controller-manager) log should be enabled

                +
                +scheduler
                + +bool + +
                +

                Scheduler indicates if the Kubernetes scheduler (kube-scheduler) log should be enabled

                +
                +

                EKSTokenMethod +(string alias)

                +

                +(Appears on:AWSManagedControlPlaneSpec) +

                +

                +

                EKSTokenMethod defines the method for obtaining a client token to use when connecting to EKS.

                +

                +

                EncryptionConfig +

                +

                +(Appears on:AWSManagedControlPlaneSpec) +

                +

                +

                EncryptionConfig specifies the encryption configuration for the EKS clsuter.

                +

                + + + + + + + + + + + + + + + + + +
                FieldDescription
                +provider
                + +string + +
                +

                Provider specifies the ARN or alias of the CMK (in AWS KMS)

                +
                +resources
                + +[]*string + +
                +

                Resources specifies the resources to be encrypted

                +
                +

                EndpointAccess +

                +

                +(Appears on:AWSManagedControlPlaneSpec) +

                +

                +

                EndpointAccess specifies how control plane endpoints are accessible.

                +

                + + + + + + + + + + + + + + + + + + + + + +
                FieldDescription
                +public
                + +bool + +
                +(Optional) +

                Public controls whether control plane endpoints are publicly accessible

                +
                +publicCIDRs
                + +[]*string + +
                +(Optional) +

                PublicCIDRs specifies which blocks can access the public endpoint

                +
                +private
                + +bool + +
                +(Optional) +

                Private points VPC-internal control plane access to the private endpoint

                +
                +

                IAMAuthenticatorConfig +

                +

                +(Appears on:AWSManagedControlPlaneSpec) +

                +

                +

                IAMAuthenticatorConfig represents an aws-iam-authenticator configuration.

                +

                + + + + + + + + + + + + + + + + + +
                FieldDescription
                +mapRoles
                + + +[]RoleMapping + + +
                +(Optional) +

                RoleMappings is a list of role mappings

                +
                +mapUsers
                + + +[]UserMapping + + +
                +(Optional) +

                UserMappings is a list of user mappings

                +
                +

                IdentityProviderStatus +

                +

                +(Appears on:AWSManagedControlPlaneStatus) +

                +

                +

                + + + + + + + + + + + + + + + + + +
                FieldDescription
                +arn
                + +string + +
                +

                ARN holds the ARN of associated identity provider

                +
                +status
                + +string + +
                +

                Status holds current status of associated identity provider

                +
                +

                KubernetesMapping +

                +

                +(Appears on:RoleMapping, UserMapping) +

                +

                +

                KubernetesMapping represents the kubernetes RBAC mapping.

                +

                + + + + + + + + + + + + + + + + + +
                FieldDescription
                +username
                + +string + +
                +

                UserName is a kubernetes RBAC user subject

                +
                +groups
                + +[]string + +
                +

                Groups is a list of kubernetes RBAC groups

                +
                +

                OIDCIdentityProviderConfig +

                +

                +(Appears on:AWSManagedControlPlaneSpec) +

                +

                +

                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                FieldDescription
                +clientId
                + +string + +
                +

                This is also known as audience. The ID for the client application that makes +authentication requests to the OpenID identity provider.

                +
                +groupsClaim
                + +string + +
                +(Optional) +

                The JWT claim that the provider uses to return your groups.

                +
                +groupsPrefix
                + +string + +
                +(Optional) +

                The prefix that is prepended to group claims to prevent clashes with existing +names (such as system: groups). For example, the valueoidc: will create group +names like oidc:engineering and oidc:infra.

                +
                +identityProviderConfigName
                + +string + +
                +

                The name of the OIDC provider configuration.

                +

                IdentityProviderConfigName is a required field

                +
                +issuerUrl
                + +string + +
                +

                The URL of the OpenID identity provider that allows the API server to discover +public signing keys for verifying tokens. The URL must begin with https:// +and should correspond to the iss claim in the provider’s OIDC ID tokens. +Per the OIDC standard, path components are allowed but query parameters are +not. Typically the URL consists of only a hostname, like https://server.example.org +or https://example.com. This URL should point to the level below .well-known/openid-configuration +and must be publicly accessible over the internet.

                +
                +requiredClaims
                + +map[string]string + +
                +(Optional) +

                The key value pairs that describe required claims in the identity token. +If set, each claim is verified to be present in the token with a matching +value. For the maximum number of claims that you can require, see Amazon +EKS service quotas (https://docs.aws.amazon.com/eks/latest/userguide/service-quotas.html) +in the Amazon EKS User Guide.

                +
                +usernameClaim
                + +string + +
                +(Optional) +

                The JSON Web Token (JWT) claim to use as the username. The default is sub, +which is expected to be a unique identifier of the end user. You can choose +other claims, such as email or name, depending on the OpenID identity provider. +Claims other than email are prefixed with the issuer URL to prevent naming +clashes with other plug-ins.

                +
                +usernamePrefix
                + +string + +
                +(Optional) +

                The prefix that is prepended to username claims to prevent clashes with existing +names. If you do not provide this field, and username is a value other than +email, the prefix defaults to issuerurl#. You can use the value - to disable +all prefixing.

                +
                +tags
                + +Cluster API AWS api/v1beta1.Tags + +
                +(Optional) +

                tags to apply to oidc identity provider association

                +
                +

                OIDCProviderStatus +

                +

                +(Appears on:AWSManagedControlPlaneStatus) +

                +

                +

                OIDCProviderStatus holds the status of the AWS OIDC identity provider.

                +

                + + + + + + + + + + + + + + + + + +
                FieldDescription
                +arn
                + +string + +
                +

                ARN holds the ARN of the provider

                +
                +trustPolicy
                + +string + +
                +

                TrustPolicy contains the boilerplate IAM trust policy to use for IRSA

                +
                +

                RoleMapping +

                +

                +(Appears on:IAMAuthenticatorConfig) +

                +

                +

                RoleMapping represents a mapping from a IAM role to Kubernetes users and groups.

                +

                + + + + + + + + + + + + + + + + + +
                FieldDescription
                +rolearn
                + +string + +
                +

                RoleARN is the AWS ARN for the role to map

                +
                +KubernetesMapping
                + + +KubernetesMapping + + +
                +

                +(Members of KubernetesMapping are embedded into this type.) +

                +

                KubernetesMapping holds the RBAC details for the mapping

                +
                +

                UserMapping +

                +

                +(Appears on:IAMAuthenticatorConfig) +

                +

                +

                UserMapping represents a mapping from an IAM user to Kubernetes users and groups.

                +

                + + + + + + + + + + + + + + + + + +
                FieldDescription
                +userarn
                + +string + +
                +

                UserARN is the AWS ARN for the user to map

                +
                +KubernetesMapping
                + + +KubernetesMapping + + +
                +

                +(Members of KubernetesMapping are embedded into this type.) +

                +

                KubernetesMapping holds the RBAC details for the mapping

                +
                +
                +

                infrastructure.cluster.x-k8s.io/v1alpha4

                +

                +

                Package v1alpha4 contains the v1alpha4 API implementation.

                +

                +Resource Types: +
                  +

                  AMIReference +

                  +

                  +(Appears on:AWSMachineSpec) +

                  +

                  +

                  AMIReference is a reference to a specific AWS resource by ID, ARN, or filters. +Only one of ID, ARN or Filters may be specified. Specifying more than one will result in +a validation error.

                  +

                  + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +id
                  + +string + +
                  +(Optional) +

                  ID of resource

                  +
                  +eksLookupType
                  + + +EKSAMILookupType + + +
                  +(Optional) +

                  EKSOptimizedLookupType If specified, will look up an EKS Optimized image in SSM Parameter store

                  +
                  +

                  AWSCluster +

                  +

                  +

                  AWSCluster is the Schema for the awsclusters API.

                  +

                  + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +metadata
                  + + +Kubernetes meta/v1.ObjectMeta + + +
                  +Refer to the Kubernetes API documentation for the fields of the +metadata field. +
                  +spec
                  + + +AWSClusterSpec + + +
                  +
                  +
                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  +network
                  + + +NetworkSpec + + +
                  +

                  NetworkSpec encapsulates all things related to AWS network.

                  +
                  +region
                  + +string + +
                  +

                  The AWS Region the cluster lives in.

                  +
                  +sshKeyName
                  + +string + +
                  +(Optional) +

                  SSHKeyName is the name of the ssh key to attach to the bastion host. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name)

                  +
                  +controlPlaneEndpoint
                  + + +Cluster API api/v1alpha4.APIEndpoint + + +
                  +(Optional) +

                  ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.

                  +
                  +additionalTags
                  + + +Tags + + +
                  +(Optional) +

                  AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the +ones added by default.

                  +
                  +controlPlaneLoadBalancer
                  + + +AWSLoadBalancerSpec + + +
                  +(Optional) +

                  ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior.

                  +
                  +imageLookupFormat
                  + +string + +
                  +(Optional) +

                  ImageLookupFormat is the AMI naming format to look up machine images when +a machine does not specify an AMI. When set, this will be used for all +cluster machines unless a machine specifies a different ImageLookupOrg. +Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base +OS and kubernetes version, respectively. The BaseOS will be the value in +ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as +defined by the packages produced by kubernetes/release without v as a +prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default +image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up +searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a +Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See +also: https://golang.org/pkg/text/template/

                  +
                  +imageLookupOrg
                  + +string + +
                  +(Optional) +

                  ImageLookupOrg is the AWS Organization ID to look up machine images when a +machine does not specify an AMI. When set, this will be used for all +cluster machines unless a machine specifies a different ImageLookupOrg.

                  +
                  +imageLookupBaseOS
                  + +string + +
                  +

                  ImageLookupBaseOS is the name of the base operating system used to look +up machine images when a machine does not specify an AMI. When set, this +will be used for all cluster machines unless a machine specifies a +different ImageLookupBaseOS.

                  +
                  +bastion
                  + + +Bastion + + +
                  +(Optional) +

                  Bastion contains options to configure the bastion host.

                  +
                  +identityRef
                  + + +AWSIdentityReference + + +
                  +(Optional) +

                  IdentityRef is a reference to a identity to be used when reconciling this cluster

                  +
                  +
                  +status
                  + + +AWSClusterStatus + + +
                  +
                  +

                  AWSClusterControllerIdentity +

                  +

                  +

                  AWSClusterControllerIdentity is the Schema for the awsclustercontrolleridentities API +It is used to grant access to use Cluster API Provider AWS Controller credentials.

                  +

                  + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +metadata
                  + + +Kubernetes meta/v1.ObjectMeta + + +
                  +Refer to the Kubernetes API documentation for the fields of the +metadata field. +
                  +spec
                  + + +AWSClusterControllerIdentitySpec + + +
                  +

                  Spec for this AWSClusterControllerIdentity.

                  +
                  +
                  + + + + + +
                  +AWSClusterIdentitySpec
                  + + +AWSClusterIdentitySpec + + +
                  +

                  +(Members of AWSClusterIdentitySpec are embedded into this type.) +

                  +
                  +
                  +

                  AWSClusterControllerIdentitySpec +

                  +

                  +(Appears on:AWSClusterControllerIdentity) +

                  +

                  +

                  AWSClusterControllerIdentitySpec defines the specifications for AWSClusterControllerIdentity.

                  +

                  + + + + + + + + + + + + + +
                  FieldDescription
                  +AWSClusterIdentitySpec
                  + + +AWSClusterIdentitySpec + + +
                  +

                  +(Members of AWSClusterIdentitySpec are embedded into this type.) +

                  +
                  +

                  AWSClusterIdentitySpec +

                  +

                  +(Appears on:AWSClusterControllerIdentitySpec, AWSClusterRoleIdentitySpec, AWSClusterStaticIdentitySpec) +

                  +

                  +

                  AWSClusterIdentitySpec defines the Spec struct for AWSClusterIdentity types.

                  +

                  + + + + + + + + + + + + + +
                  FieldDescription
                  +allowedNamespaces
                  + + +AllowedNamespaces + + +
                  +(Optional) +

                  AllowedNamespaces is used to identify which namespaces are allowed to use the identity from. +Namespaces can be selected either using an array of namespaces or with label selector. +An empty allowedNamespaces object indicates that AWSClusters can use this identity from any namespace. +If this object is nil, no namespaces will be allowed (default behaviour, if this field is not provided) +A namespace should be either in the NamespaceList or match with Selector to use the identity.

                  +
                  +

                  AWSClusterRoleIdentity +

                  +

                  +

                  AWSClusterRoleIdentity is the Schema for the awsclusterroleidentities API +It is used to assume a role using the provided sourceRef.

                  +

                  + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +metadata
                  + + +Kubernetes meta/v1.ObjectMeta + + +
                  +Refer to the Kubernetes API documentation for the fields of the +metadata field. +
                  +spec
                  + + +AWSClusterRoleIdentitySpec + + +
                  +

                  Spec for this AWSClusterRoleIdentity.

                  +
                  +
                  + + + + + + + + + + + + + + + + + +
                  +AWSClusterIdentitySpec
                  + + +AWSClusterIdentitySpec + + +
                  +

                  +(Members of AWSClusterIdentitySpec are embedded into this type.) +

                  +
                  +AWSRoleSpec
                  + + +AWSRoleSpec + + +
                  +

                  +(Members of AWSRoleSpec are embedded into this type.) +

                  +
                  +externalID
                  + +string + +
                  +(Optional) +

                  A unique identifier that might be required when you assume a role in another account. +If the administrator of the account to which the role belongs provided you with an +external ID, then provide that value in the ExternalId parameter. This value can be +any string, such as a passphrase or account number. A cross-account role is usually +set up to trust everyone in an account. Therefore, the administrator of the trusting +account might send an external ID to the administrator of the trusted account. That +way, only someone with the ID can assume the role, rather than everyone in the +account. For more information about the external ID, see How to Use an External ID +When Granting Access to Your AWS Resources to a Third Party in the IAM User Guide.

                  +
                  +sourceIdentityRef
                  + + +AWSIdentityReference + + +
                  +

                  SourceIdentityRef is a reference to another identity which will be chained to do +role assumption. All identity types are accepted.

                  +
                  +
                  +

                  AWSClusterRoleIdentitySpec +

                  +

                  +(Appears on:AWSClusterRoleIdentity) +

                  +

                  +

                  AWSClusterRoleIdentitySpec defines the specifications for AWSClusterRoleIdentity.

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +AWSClusterIdentitySpec
                  + + +AWSClusterIdentitySpec + + +
                  +

                  +(Members of AWSClusterIdentitySpec are embedded into this type.) +

                  +
                  +AWSRoleSpec
                  + + +AWSRoleSpec + + +
                  +

                  +(Members of AWSRoleSpec are embedded into this type.) +

                  +
                  +externalID
                  + +string + +
                  +(Optional) +

                  A unique identifier that might be required when you assume a role in another account. +If the administrator of the account to which the role belongs provided you with an +external ID, then provide that value in the ExternalId parameter. This value can be +any string, such as a passphrase or account number. A cross-account role is usually +set up to trust everyone in an account. Therefore, the administrator of the trusting +account might send an external ID to the administrator of the trusted account. That +way, only someone with the ID can assume the role, rather than everyone in the +account. For more information about the external ID, see How to Use an External ID +When Granting Access to Your AWS Resources to a Third Party in the IAM User Guide.

                  +
                  +sourceIdentityRef
                  + + +AWSIdentityReference + + +
                  +

                  SourceIdentityRef is a reference to another identity which will be chained to do +role assumption. All identity types are accepted.

                  +
                  +

                  AWSClusterSpec +

                  +

                  +(Appears on:AWSCluster, AWSClusterTemplateResource) +

                  +

                  +

                  AWSClusterSpec defines the desired state of AWSCluster

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +network
                  + + +NetworkSpec + + +
                  +

                  NetworkSpec encapsulates all things related to AWS network.

                  +
                  +region
                  + +string + +
                  +

                  The AWS Region the cluster lives in.

                  +
                  +sshKeyName
                  + +string + +
                  +(Optional) +

                  SSHKeyName is the name of the ssh key to attach to the bastion host. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name)

                  +
                  +controlPlaneEndpoint
                  + + +Cluster API api/v1alpha4.APIEndpoint + + +
                  +(Optional) +

                  ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.

                  +
                  +additionalTags
                  + + +Tags + + +
                  +(Optional) +

                  AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the +ones added by default.

                  +
                  +controlPlaneLoadBalancer
                  + + +AWSLoadBalancerSpec + + +
                  +(Optional) +

                  ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior.

                  +
                  +imageLookupFormat
                  + +string + +
                  +(Optional) +

                  ImageLookupFormat is the AMI naming format to look up machine images when +a machine does not specify an AMI. When set, this will be used for all +cluster machines unless a machine specifies a different ImageLookupOrg. +Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base +OS and kubernetes version, respectively. The BaseOS will be the value in +ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as +defined by the packages produced by kubernetes/release without v as a +prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default +image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up +searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a +Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See +also: https://golang.org/pkg/text/template/

                  +
                  +imageLookupOrg
                  + +string + +
                  +(Optional) +

                  ImageLookupOrg is the AWS Organization ID to look up machine images when a +machine does not specify an AMI. When set, this will be used for all +cluster machines unless a machine specifies a different ImageLookupOrg.

                  +
                  +imageLookupBaseOS
                  + +string + +
                  +

                  ImageLookupBaseOS is the name of the base operating system used to look +up machine images when a machine does not specify an AMI. When set, this +will be used for all cluster machines unless a machine specifies a +different ImageLookupBaseOS.

                  +
                  +bastion
                  + + +Bastion + + +
                  +(Optional) +

                  Bastion contains options to configure the bastion host.

                  +
                  +identityRef
                  + + +AWSIdentityReference + + +
                  +(Optional) +

                  IdentityRef is a reference to a identity to be used when reconciling this cluster

                  +
                  +

                  AWSClusterStaticIdentity +

                  +

                  +

                  AWSClusterStaticIdentity is the Schema for the awsclusterstaticidentities API +It represents a reference to an AWS access key ID and secret access key, stored in a secret.

                  +

                  + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +metadata
                  + + +Kubernetes meta/v1.ObjectMeta + + +
                  +Refer to the Kubernetes API documentation for the fields of the +metadata field. +
                  +spec
                  + + +AWSClusterStaticIdentitySpec + + +
                  +

                  Spec for this AWSClusterStaticIdentity

                  +
                  +
                  + + + + + + + + + +
                  +AWSClusterIdentitySpec
                  + + +AWSClusterIdentitySpec + + +
                  +

                  +(Members of AWSClusterIdentitySpec are embedded into this type.) +

                  +
                  +secretRef
                  + +string + +
                  +

                  Reference to a secret containing the credentials. The secret should +contain the following data keys: +AccessKeyID: AKIAIOSFODNN7EXAMPLE +SecretAccessKey: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY +SessionToken: Optional

                  +
                  +
                  +

                  AWSClusterStaticIdentitySpec +

                  +

                  +(Appears on:AWSClusterStaticIdentity) +

                  +

                  +

                  AWSClusterStaticIdentitySpec defines the specifications for AWSClusterStaticIdentity.

                  +

                  + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +AWSClusterIdentitySpec
                  + + +AWSClusterIdentitySpec + + +
                  +

                  +(Members of AWSClusterIdentitySpec are embedded into this type.) +

                  +
                  +secretRef
                  + +string + +
                  +

                  Reference to a secret containing the credentials. The secret should +contain the following data keys: +AccessKeyID: AKIAIOSFODNN7EXAMPLE +SecretAccessKey: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY +SessionToken: Optional

                  +
                  +

                  AWSClusterStatus +

                  +

                  +(Appears on:AWSCluster) +

                  +

                  +

                  AWSClusterStatus defines the observed state of AWSCluster

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +ready
                  + +bool + +
                  +
                  +networkStatus
                  + + +NetworkStatus + + +
                  +
                  +failureDomains
                  + + +Cluster API api/v1alpha4.FailureDomains + + +
                  +
                  +bastion
                  + + +Instance + + +
                  +
                  +conditions
                  + + +Cluster API api/v1alpha4.Conditions + + +
                  +
                  +

                  AWSClusterTemplate +

                  +

                  +

                  AWSClusterTemplate is the Schema for the awsclustertemplates API.

                  +

                  + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +metadata
                  + + +Kubernetes meta/v1.ObjectMeta + + +
                  +Refer to the Kubernetes API documentation for the fields of the +metadata field. +
                  +spec
                  + + +AWSClusterTemplateSpec + + +
                  +
                  +
                  + + + + + +
                  +template
                  + + +AWSClusterTemplateResource + + +
                  +
                  +
                  +

                  AWSClusterTemplateResource +

                  +

                  +(Appears on:AWSClusterTemplateSpec) +

                  +

                  +

                  + + + + + + + + + + + + + +
                  FieldDescription
                  +spec
                  + + +AWSClusterSpec + + +
                  +
                  +
                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  +network
                  + + +NetworkSpec + + +
                  +

                  NetworkSpec encapsulates all things related to AWS network.

                  +
                  +region
                  + +string + +
                  +

                  The AWS Region the cluster lives in.

                  +
                  +sshKeyName
                  + +string + +
                  +(Optional) +

                  SSHKeyName is the name of the ssh key to attach to the bastion host. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name)

                  +
                  +controlPlaneEndpoint
                  + + +Cluster API api/v1alpha4.APIEndpoint + + +
                  +(Optional) +

                  ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.

                  +
                  +additionalTags
                  + + +Tags + + +
                  +(Optional) +

                  AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the +ones added by default.

                  +
                  +controlPlaneLoadBalancer
                  + + +AWSLoadBalancerSpec + + +
                  +(Optional) +

                  ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior.

                  +
                  +imageLookupFormat
                  + +string + +
                  +(Optional) +

                  ImageLookupFormat is the AMI naming format to look up machine images when +a machine does not specify an AMI. When set, this will be used for all +cluster machines unless a machine specifies a different ImageLookupOrg. +Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base +OS and kubernetes version, respectively. The BaseOS will be the value in +ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as +defined by the packages produced by kubernetes/release without v as a +prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default +image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up +searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a +Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See +also: https://golang.org/pkg/text/template/

                  +
                  +imageLookupOrg
                  + +string + +
                  +(Optional) +

                  ImageLookupOrg is the AWS Organization ID to look up machine images when a +machine does not specify an AMI. When set, this will be used for all +cluster machines unless a machine specifies a different ImageLookupOrg.

                  +
                  +imageLookupBaseOS
                  + +string + +
                  +

                  ImageLookupBaseOS is the name of the base operating system used to look +up machine images when a machine does not specify an AMI. When set, this +will be used for all cluster machines unless a machine specifies a +different ImageLookupBaseOS.

                  +
                  +bastion
                  + + +Bastion + + +
                  +(Optional) +

                  Bastion contains options to configure the bastion host.

                  +
                  +identityRef
                  + + +AWSIdentityReference + + +
                  +(Optional) +

                  IdentityRef is a reference to a identity to be used when reconciling this cluster

                  +
                  +
                  +

                  AWSClusterTemplateSpec +

                  +

                  +(Appears on:AWSClusterTemplate) +

                  +

                  +

                  AWSClusterTemplateSpec defines the desired state of AWSClusterTemplate.

                  +

                  + + + + + + + + + + + + + +
                  FieldDescription
                  +template
                  + + +AWSClusterTemplateResource + + +
                  +
                  +

                  AWSIdentityKind +(string alias)

                  +

                  +(Appears on:AWSIdentityReference) +

                  +

                  +

                  AWSIdentityKind defines allowed AWS identity types.

                  +

                  +

                  AWSIdentityReference +

                  +

                  +(Appears on:AWSClusterRoleIdentitySpec, AWSClusterSpec) +

                  +

                  +

                  AWSIdentityReference specifies a identity.

                  +

                  + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +name
                  + +string + +
                  +

                  Name of the identity.

                  +
                  +kind
                  + + +AWSIdentityKind + + +
                  +

                  Kind of the identity.

                  +
                  +

                  AWSLoadBalancerSpec +

                  +

                  +(Appears on:AWSClusterSpec) +

                  +

                  +

                  AWSLoadBalancerSpec defines the desired state of an AWS load balancer.

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +scheme
                  + + +ClassicELBScheme + + +
                  +(Optional) +

                  Scheme sets the scheme of the load balancer (defaults to internet-facing)

                  +
                  +crossZoneLoadBalancing
                  + +bool + +
                  +(Optional) +

                  CrossZoneLoadBalancing enables the classic ELB cross availability zone balancing.

                  +

                  With cross-zone load balancing, each load balancer node for your Classic Load Balancer +distributes requests evenly across the registered instances in all enabled Availability Zones. +If cross-zone load balancing is disabled, each load balancer node distributes requests evenly across +the registered instances in its Availability Zone only.

                  +

                  Defaults to false.

                  +
                  +subnets
                  + +[]string + +
                  +(Optional) +

                  Subnets sets the subnets that should be applied to the control plane load balancer (defaults to discovered subnets for managed VPCs or an empty set for unmanaged VPCs)

                  +
                  +additionalSecurityGroups
                  + +[]string + +
                  +(Optional) +

                  AdditionalSecurityGroups sets the security groups used by the load balancer. Expected to be security group IDs +This is optional - if not provided new security groups will be created for the load balancer

                  +
                  +

                  AWSMachine +

                  +

                  +

                  AWSMachine is the Schema for the awsmachines API

                  +

                  + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +metadata
                  + + +Kubernetes meta/v1.ObjectMeta + + +
                  +Refer to the Kubernetes API documentation for the fields of the +metadata field. +
                  +spec
                  + + +AWSMachineSpec + + +
                  +
                  +
                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  +providerID
                  + +string + +
                  +

                  ProviderID is the unique identifier as specified by the cloud provider.

                  +
                  +instanceID
                  + +string + +
                  +

                  InstanceID is the EC2 instance ID for this machine.

                  +
                  +ami
                  + + +AMIReference + + +
                  +

                  AMI is the reference to the AMI from which to create the machine instance.

                  +
                  +imageLookupFormat
                  + +string + +
                  +(Optional) +

                  ImageLookupFormat is the AMI naming format to look up the image for this +machine It will be ignored if an explicit AMI is set. Supports +substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base OS and +kubernetes version, respectively. The BaseOS will be the value in +ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as +defined by the packages produced by kubernetes/release without v as a +prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default +image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up +searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a +Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See +also: https://golang.org/pkg/text/template/

                  +
                  +imageLookupOrg
                  + +string + +
                  +

                  ImageLookupOrg is the AWS Organization ID to use for image lookup if AMI is not set.

                  +
                  +imageLookupBaseOS
                  + +string + +
                  +

                  ImageLookupBaseOS is the name of the base operating system to use for +image lookup the AMI is not set.

                  +
                  +instanceType
                  + +string + +
                  +

                  InstanceType is the type of instance to create. Example: m4.xlarge

                  +
                  +additionalTags
                  + + +Tags + + +
                  +(Optional) +

                  AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the +AWS provider. If both the AWSCluster and the AWSMachine specify the same tag name with different values, the +AWSMachine’s value takes precedence.

                  +
                  +iamInstanceProfile
                  + +string + +
                  +(Optional) +

                  IAMInstanceProfile is a name of an IAM instance profile to assign to the instance

                  +
                  +publicIP
                  + +bool + +
                  +(Optional) +

                  PublicIP specifies whether the instance should get a public IP. +Precedence for this setting is as follows: +1. This field if set +2. Cluster/flavor setting +3. Subnet default

                  +
                  +additionalSecurityGroups
                  + + +[]AWSResourceReference + + +
                  +(Optional) +

                  AdditionalSecurityGroups is an array of references to security groups that should be applied to the +instance. These security groups would be set in addition to any security groups defined +at the cluster level or in the actuator. It is possible to specify either IDs of Filters. Using Filters +will cause additional requests to AWS API and if tags change the attached security groups might change too.

                  +
                  +failureDomain
                  + +string + +
                  +

                  FailureDomain is the failure domain unique identifier this Machine should be attached to, as defined in Cluster API. +For this infrastructure provider, the ID is equivalent to an AWS Availability Zone. +If multiple subnets are matched for the availability zone, the first one returned is picked.

                  +
                  +subnet
                  + + +AWSResourceReference + + +
                  +(Optional) +

                  Subnet is a reference to the subnet to use for this instance. If not specified, +the cluster subnet will be used.

                  +
                  +sshKeyName
                  + +string + +
                  +(Optional) +

                  SSHKeyName is the name of the ssh key to attach to the instance. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name)

                  +
                  +rootVolume
                  + + +Volume + + +
                  +(Optional) +

                  RootVolume encapsulates the configuration options for the root volume

                  +
                  +nonRootVolumes
                  + + +[]Volume + + +
                  +(Optional) +

                  Configuration options for the non root storage volumes.

                  +
                  +networkInterfaces
                  + +[]string + +
                  +(Optional) +

                  NetworkInterfaces is a list of ENIs to associate with the instance. +A maximum of 2 may be specified.

                  +
                  +uncompressedUserData
                  + +bool + +
                  +(Optional) +

                  UncompressedUserData specify whether the user data is gzip-compressed before it is sent to ec2 instance. +cloud-init has built-in support for gzip-compressed user data +user data stored in aws secret manager is always gzip-compressed.

                  +
                  +cloudInit
                  + + +CloudInit + + +
                  +(Optional) +

                  CloudInit defines options related to the bootstrapping systems where +CloudInit is used.

                  +
                  +spotMarketOptions
                  + + +SpotMarketOptions + + +
                  +(Optional) +

                  SpotMarketOptions allows users to configure instances to be run using AWS Spot instances.

                  +
                  +tenancy
                  + +string + +
                  +(Optional) +

                  Tenancy indicates if instance should run on shared or single-tenant hardware.

                  +
                  +
                  +status
                  + + +AWSMachineStatus + + +
                  +
                  +

                  AWSMachineProviderConditionType +(string alias)

                  +

                  +

                  AWSMachineProviderConditionType is a valid value for AWSMachineProviderCondition.Type.

                  +

                  +

                  AWSMachineSpec +

                  +

                  +(Appears on:AWSMachine, AWSMachineTemplateResource) +

                  +

                  +

                  AWSMachineSpec defines the desired state of AWSMachine

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +providerID
                  + +string + +
                  +

                  ProviderID is the unique identifier as specified by the cloud provider.

                  +
                  +instanceID
                  + +string + +
                  +

                  InstanceID is the EC2 instance ID for this machine.

                  +
                  +ami
                  + + +AMIReference + + +
                  +

                  AMI is the reference to the AMI from which to create the machine instance.

                  +
                  +imageLookupFormat
                  + +string + +
                  +(Optional) +

                  ImageLookupFormat is the AMI naming format to look up the image for this +machine It will be ignored if an explicit AMI is set. Supports +substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base OS and +kubernetes version, respectively. The BaseOS will be the value in +ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as +defined by the packages produced by kubernetes/release without v as a +prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default +image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up +searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a +Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See +also: https://golang.org/pkg/text/template/

                  +
                  +imageLookupOrg
                  + +string + +
                  +

                  ImageLookupOrg is the AWS Organization ID to use for image lookup if AMI is not set.

                  +
                  +imageLookupBaseOS
                  + +string + +
                  +

                  ImageLookupBaseOS is the name of the base operating system to use for +image lookup the AMI is not set.

                  +
                  +instanceType
                  + +string + +
                  +

                  InstanceType is the type of instance to create. Example: m4.xlarge

                  +
                  +additionalTags
                  + + +Tags + + +
                  +(Optional) +

                  AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the +AWS provider. If both the AWSCluster and the AWSMachine specify the same tag name with different values, the +AWSMachine’s value takes precedence.

                  +
                  +iamInstanceProfile
                  + +string + +
                  +(Optional) +

                  IAMInstanceProfile is a name of an IAM instance profile to assign to the instance

                  +
                  +publicIP
                  + +bool + +
                  +(Optional) +

                  PublicIP specifies whether the instance should get a public IP. +Precedence for this setting is as follows: +1. This field if set +2. Cluster/flavor setting +3. Subnet default

                  +
                  +additionalSecurityGroups
                  + + +[]AWSResourceReference + + +
                  +(Optional) +

                  AdditionalSecurityGroups is an array of references to security groups that should be applied to the +instance. These security groups would be set in addition to any security groups defined +at the cluster level or in the actuator. It is possible to specify either IDs of Filters. Using Filters +will cause additional requests to AWS API and if tags change the attached security groups might change too.

                  +
                  +failureDomain
                  + +string + +
                  +

                  FailureDomain is the failure domain unique identifier this Machine should be attached to, as defined in Cluster API. +For this infrastructure provider, the ID is equivalent to an AWS Availability Zone. +If multiple subnets are matched for the availability zone, the first one returned is picked.

                  +
                  +subnet
                  + + +AWSResourceReference + + +
                  +(Optional) +

                  Subnet is a reference to the subnet to use for this instance. If not specified, +the cluster subnet will be used.

                  +
                  +sshKeyName
                  + +string + +
                  +(Optional) +

                  SSHKeyName is the name of the ssh key to attach to the instance. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name)

                  +
                  +rootVolume
                  + + +Volume + + +
                  +(Optional) +

                  RootVolume encapsulates the configuration options for the root volume

                  +
                  +nonRootVolumes
                  + + +[]Volume + + +
                  +(Optional) +

                  Configuration options for the non root storage volumes.

                  +
                  +networkInterfaces
                  + +[]string + +
                  +(Optional) +

                  NetworkInterfaces is a list of ENIs to associate with the instance. +A maximum of 2 may be specified.

                  +
                  +uncompressedUserData
                  + +bool + +
                  +(Optional) +

                  UncompressedUserData specify whether the user data is gzip-compressed before it is sent to ec2 instance. +cloud-init has built-in support for gzip-compressed user data +user data stored in aws secret manager is always gzip-compressed.

                  +
                  +cloudInit
                  + + +CloudInit + + +
                  +(Optional) +

                  CloudInit defines options related to the bootstrapping systems where +CloudInit is used.

                  +
                  +spotMarketOptions
                  + + +SpotMarketOptions + + +
                  +(Optional) +

                  SpotMarketOptions allows users to configure instances to be run using AWS Spot instances.

                  +
                  +tenancy
                  + +string + +
                  +(Optional) +

                  Tenancy indicates if instance should run on shared or single-tenant hardware.

                  +
                  +

                  AWSMachineStatus +

                  +

                  +(Appears on:AWSMachine) +

                  +

                  +

                  AWSMachineStatus defines the observed state of AWSMachine

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +ready
                  + +bool + +
                  +(Optional) +

                  Ready is true when the provider resource is ready.

                  +
                  +interruptible
                  + +bool + +
                  +(Optional) +

                  Interruptible reports that this machine is using spot instances and can therefore be interrupted by CAPI when it receives a notice that the spot instance is to be terminated by AWS. +This will be set to true when SpotMarketOptions is not nil (i.e. this machine is using a spot instance).

                  +
                  +addresses
                  + + +[]Cluster API api/v1alpha4.MachineAddress + + +
                  +

                  Addresses contains the AWS instance associated addresses.

                  +
                  +instanceState
                  + + +InstanceState + + +
                  +(Optional) +

                  InstanceState is the state of the AWS instance for this machine.

                  +
                  +failureReason
                  + + +Cluster API errors.MachineStatusError + + +
                  +(Optional) +

                  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.

                  +
                  +failureMessage
                  + +string + +
                  +(Optional) +

                  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.

                  +
                  +conditions
                  + + +Cluster API api/v1alpha4.Conditions + + +
                  +(Optional) +

                  Conditions defines current service state of the AWSMachine.

                  +
                  +

                  AWSMachineTemplate +

                  +

                  +

                  AWSMachineTemplate is the Schema for the awsmachinetemplates API

                  +

                  + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +metadata
                  + + +Kubernetes meta/v1.ObjectMeta + + +
                  +Refer to the Kubernetes API documentation for the fields of the +metadata field. +
                  +spec
                  + + +AWSMachineTemplateSpec + + +
                  +
                  +
                  + + + + + +
                  +template
                  + + +AWSMachineTemplateResource + + +
                  +
                  +
                  +

                  AWSMachineTemplateResource +

                  +

                  +(Appears on:AWSMachineTemplateSpec) +

                  +

                  +

                  AWSMachineTemplateResource describes the data needed to create am AWSMachine from a template

                  +

                  + + + + + + + + + + + + + +
                  FieldDescription
                  +spec
                  + + +AWSMachineSpec + + +
                  +

                  Spec is the specification of the desired behavior of the machine.

                  +
                  +
                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  +providerID
                  + +string + +
                  +

                  ProviderID is the unique identifier as specified by the cloud provider.

                  +
                  +instanceID
                  + +string + +
                  +

                  InstanceID is the EC2 instance ID for this machine.

                  +
                  +ami
                  + + +AMIReference + + +
                  +

                  AMI is the reference to the AMI from which to create the machine instance.

                  +
                  +imageLookupFormat
                  + +string + +
                  +(Optional) +

                  ImageLookupFormat is the AMI naming format to look up the image for this +machine It will be ignored if an explicit AMI is set. Supports +substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base OS and +kubernetes version, respectively. The BaseOS will be the value in +ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as +defined by the packages produced by kubernetes/release without v as a +prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default +image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up +searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a +Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See +also: https://golang.org/pkg/text/template/

                  +
                  +imageLookupOrg
                  + +string + +
                  +

                  ImageLookupOrg is the AWS Organization ID to use for image lookup if AMI is not set.

                  +
                  +imageLookupBaseOS
                  + +string + +
                  +

                  ImageLookupBaseOS is the name of the base operating system to use for +image lookup the AMI is not set.

                  +
                  +instanceType
                  + +string + +
                  +

                  InstanceType is the type of instance to create. Example: m4.xlarge

                  +
                  +additionalTags
                  + + +Tags + + +
                  +(Optional) +

                  AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the +AWS provider. If both the AWSCluster and the AWSMachine specify the same tag name with different values, the +AWSMachine’s value takes precedence.

                  +
                  +iamInstanceProfile
                  + +string + +
                  +(Optional) +

                  IAMInstanceProfile is a name of an IAM instance profile to assign to the instance

                  +
                  +publicIP
                  + +bool + +
                  +(Optional) +

                  PublicIP specifies whether the instance should get a public IP. +Precedence for this setting is as follows: +1. This field if set +2. Cluster/flavor setting +3. Subnet default

                  +
                  +additionalSecurityGroups
                  + + +[]AWSResourceReference + + +
                  +(Optional) +

                  AdditionalSecurityGroups is an array of references to security groups that should be applied to the +instance. These security groups would be set in addition to any security groups defined +at the cluster level or in the actuator. It is possible to specify either IDs of Filters. Using Filters +will cause additional requests to AWS API and if tags change the attached security groups might change too.

                  +
                  +failureDomain
                  + +string + +
                  +

                  FailureDomain is the failure domain unique identifier this Machine should be attached to, as defined in Cluster API. +For this infrastructure provider, the ID is equivalent to an AWS Availability Zone. +If multiple subnets are matched for the availability zone, the first one returned is picked.

                  +
                  +subnet
                  + + +AWSResourceReference + + +
                  +(Optional) +

                  Subnet is a reference to the subnet to use for this instance. If not specified, +the cluster subnet will be used.

                  +
                  +sshKeyName
                  + +string + +
                  +(Optional) +

                  SSHKeyName is the name of the ssh key to attach to the instance. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name)

                  +
                  +rootVolume
                  + + +Volume + + +
                  +(Optional) +

                  RootVolume encapsulates the configuration options for the root volume

                  +
                  +nonRootVolumes
                  + + +[]Volume + + +
                  +(Optional) +

                  Configuration options for the non root storage volumes.

                  +
                  +networkInterfaces
                  + +[]string + +
                  +(Optional) +

                  NetworkInterfaces is a list of ENIs to associate with the instance. +A maximum of 2 may be specified.

                  +
                  +uncompressedUserData
                  + +bool + +
                  +(Optional) +

                  UncompressedUserData specify whether the user data is gzip-compressed before it is sent to ec2 instance. +cloud-init has built-in support for gzip-compressed user data +user data stored in aws secret manager is always gzip-compressed.

                  +
                  +cloudInit
                  + + +CloudInit + + +
                  +(Optional) +

                  CloudInit defines options related to the bootstrapping systems where +CloudInit is used.

                  +
                  +spotMarketOptions
                  + + +SpotMarketOptions + + +
                  +(Optional) +

                  SpotMarketOptions allows users to configure instances to be run using AWS Spot instances.

                  +
                  +tenancy
                  + +string + +
                  +(Optional) +

                  Tenancy indicates if instance should run on shared or single-tenant hardware.

                  +
                  +
                  +

                  AWSMachineTemplateSpec +

                  +

                  +(Appears on:AWSMachineTemplate) +

                  +

                  +

                  AWSMachineTemplateSpec defines the desired state of AWSMachineTemplate

                  +

                  + + + + + + + + + + + + + +
                  FieldDescription
                  +template
                  + + +AWSMachineTemplateResource + + +
                  +
                  +

                  AWSResourceReference +

                  +

                  +(Appears on:AWSMachineSpec) +

                  +

                  +

                  AWSResourceReference is a reference to a specific AWS resource by ID, ARN, or filters. +Only one of ID, ARN or Filters may be specified. Specifying more than one will result in +a validation error.

                  +

                  + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +id
                  + +string + +
                  +(Optional) +

                  ID of resource

                  +
                  +arn
                  + +string + +
                  +(Optional) +

                  ARN of resource

                  +
                  +filters
                  + + +[]Filter + + +
                  +(Optional) +

                  Filters is a set of key/value pairs used to identify a resource +They are applied according to the rules defined by the AWS API: +https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html

                  +
                  +

                  AWSRoleSpec +

                  +

                  +(Appears on:AWSClusterRoleIdentitySpec) +

                  +

                  +

                  AWSRoleSpec defines the specifications for all identities based around AWS roles.

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +roleARN
                  + +string + +
                  +

                  The Amazon Resource Name (ARN) of the role to assume.

                  +
                  +sessionName
                  + +string + +
                  +

                  An identifier for the assumed role session

                  +
                  +durationSeconds
                  + +int32 + +
                  +

                  The duration, in seconds, of the role session before it is renewed.

                  +
                  +inlinePolicy
                  + +string + +
                  +

                  An IAM policy as a JSON-encoded string that you want to use as an inline session policy.

                  +
                  +policyARNs
                  + +[]string + +
                  +

                  The Amazon Resource Names (ARNs) of the IAM managed policies that you want +to use as managed session policies. +The policies must exist in the same account as the role.

                  +
                  +

                  AZSelectionScheme +(string alias)

                  +

                  +(Appears on:VPCSpec) +

                  +

                  +

                  AZSelectionScheme defines the scheme of selecting AZs.

                  +

                  +

                  Actions +([]string alias)

                  +

                  +(Appears on:StatementEntry) +

                  +

                  +

                  Actions is the list of actions.

                  +

                  +

                  AllowedNamespaces +

                  +

                  +(Appears on:AWSClusterIdentitySpec) +

                  +

                  +

                  AllowedNamespaces is a selector of namespaces that AWSClusters can +use this ClusterPrincipal from. This is a standard Kubernetes LabelSelector, +a label query over a set of resources. The result of matchLabels and +matchExpressions are ANDed.

                  +

                  + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +list
                  + +[]string + +
                  +(Optional) +

                  An nil or empty list indicates that AWSClusters cannot use the identity from any namespace.

                  +
                  +selector
                  + + +Kubernetes meta/v1.LabelSelector + + +
                  +(Optional) +

                  An empty selector indicates that AWSClusters cannot use this +AWSClusterIdentity from any namespace.

                  +
                  +

                  Bastion +

                  +

                  +(Appears on:AWSClusterSpec) +

                  +

                  +

                  Bastion defines a bastion host.

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +enabled
                  + +bool + +
                  +(Optional) +

                  Enabled allows this provider to create a bastion host instance +with a public ip to access the VPC private network.

                  +
                  +disableIngressRules
                  + +bool + +
                  +(Optional) +

                  DisableIngressRules will ensure there are no Ingress rules in the bastion host’s security group. +Requires AllowedCIDRBlocks to be empty.

                  +
                  +allowedCIDRBlocks
                  + +[]string + +
                  +(Optional) +

                  AllowedCIDRBlocks is a list of CIDR blocks allowed to access the bastion host. +They are set as ingress rules for the Bastion host’s Security Group (defaults to 0.0.0.0/0).

                  +
                  +instanceType
                  + +string + +
                  +

                  InstanceType will use the specified instance type for the bastion. If not specified, +Cluster API Provider AWS will use t3.micro for all regions except us-east-1, where t2.micro +will be the default.

                  +
                  +ami
                  + +string + +
                  +(Optional) +

                  AMI will use the specified AMI to boot the bastion. If not specified, +the AMI will default to one picked out in public space.

                  +
                  +

                  BuildParams +

                  +

                  +

                  BuildParams is used to build tags around an aws resource.

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +Lifecycle
                  + + +ResourceLifecycle + + +
                  +

                  Lifecycle determines the resource lifecycle.

                  +
                  +ClusterName
                  + +string + +
                  +

                  ClusterName is the cluster associated with the resource.

                  +
                  +ResourceID
                  + +string + +
                  +

                  ResourceID is the unique identifier of the resource to be tagged.

                  +
                  +Name
                  + +string + +
                  +(Optional) +

                  Name is the name of the resource, it’s applied as the tag “Name” on AWS.

                  +
                  +Role
                  + +string + +
                  +(Optional) +

                  Role is the role associated to the resource.

                  +
                  +Additional
                  + + +Tags + + +
                  +(Optional) +

                  Any additional tags to be added to the resource.

                  +
                  +

                  CNIIngressRule +

                  +

                  +

                  CNIIngressRule defines an AWS ingress rule for CNI requirements.

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +description
                  + +string + +
                  +
                  +protocol
                  + + +SecurityGroupProtocol + + +
                  +
                  +fromPort
                  + +int64 + +
                  +
                  +toPort
                  + +int64 + +
                  +
                  +

                  CNIIngressRules +([]../../api/v1alpha4.CNIIngressRule alias)

                  +

                  +(Appears on:CNISpec) +

                  +

                  +

                  CNIIngressRules is a slice of CNIIngressRule

                  +

                  +

                  CNISpec +

                  +

                  +(Appears on:NetworkSpec) +

                  +

                  +

                  CNISpec defines configuration for CNI.

                  +

                  + + + + + + + + + + + + + +
                  FieldDescription
                  +cniIngressRules
                  + + +CNIIngressRules + + +
                  +

                  CNIIngressRules specify rules to apply to control plane and worker node security groups. +The source for the rule will be set to control plane and worker security group IDs.

                  +
                  +

                  ClassicELB +

                  +

                  +(Appears on:NetworkStatus) +

                  +

                  +

                  ClassicELB defines an AWS classic load balancer.

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +name
                  + +string + +
                  +

                  The name of the load balancer. It must be unique within the set of load balancers +defined in the region. It also serves as identifier.

                  +
                  +dnsName
                  + +string + +
                  +

                  DNSName is the dns name of the load balancer.

                  +
                  +scheme
                  + + +ClassicELBScheme + + +
                  +

                  Scheme is the load balancer scheme, either internet-facing or private.

                  +
                  +availabilityZones
                  + +[]string + +
                  +

                  AvailabilityZones is an array of availability zones in the VPC attached to the load balancer.

                  +
                  +subnetIds
                  + +[]string + +
                  +

                  SubnetIDs is an array of subnets in the VPC attached to the load balancer.

                  +
                  +securityGroupIds
                  + +[]string + +
                  +

                  SecurityGroupIDs is an array of security groups assigned to the load balancer.

                  +
                  +listeners
                  + + +[]ClassicELBListener + + +
                  +

                  Listeners is an array of classic elb listeners associated with the load balancer. There must be at least one.

                  +
                  +healthChecks
                  + + +ClassicELBHealthCheck + + +
                  +

                  HealthCheck is the classic elb health check associated with the load balancer.

                  +
                  +attributes
                  + + +ClassicELBAttributes + + +
                  +

                  Attributes defines extra attributes associated with the load balancer.

                  +
                  +tags
                  + +map[string]string + +
                  +

                  Tags is a map of tags associated with the load balancer.

                  +
                  +

                  ClassicELBAttributes +

                  +

                  +(Appears on:ClassicELB) +

                  +

                  +

                  ClassicELBAttributes defines extra attributes associated with a classic load balancer.

                  +

                  + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +idleTimeout
                  + + +time.Duration + + +
                  +

                  IdleTimeout is time that the connection is allowed to be idle (no data +has been sent over the connection) before it is closed by the load balancer.

                  +
                  +crossZoneLoadBalancing
                  + +bool + +
                  +(Optional) +

                  CrossZoneLoadBalancing enables the classic load balancer load balancing.

                  +
                  +

                  ClassicELBHealthCheck +

                  +

                  +(Appears on:ClassicELB) +

                  +

                  +

                  ClassicELBHealthCheck defines an AWS classic load balancer health check.

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +target
                  + +string + +
                  +
                  +interval
                  + + +time.Duration + + +
                  +
                  +timeout
                  + + +time.Duration + + +
                  +
                  +healthyThreshold
                  + +int64 + +
                  +
                  +unhealthyThreshold
                  + +int64 + +
                  +
                  +

                  ClassicELBListener +

                  +

                  +(Appears on:ClassicELB) +

                  +

                  +

                  ClassicELBListener defines an AWS classic load balancer listener.

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +protocol
                  + + +ClassicELBProtocol + + +
                  +
                  +port
                  + +int64 + +
                  +
                  +instanceProtocol
                  + + +ClassicELBProtocol + + +
                  +
                  +instancePort
                  + +int64 + +
                  +
                  +

                  ClassicELBProtocol +(string alias)

                  +

                  +(Appears on:ClassicELBListener) +

                  +

                  +

                  ClassicELBProtocol defines listener protocols for a classic load balancer.

                  +

                  +

                  ClassicELBScheme +(string alias)

                  +

                  +(Appears on:AWSLoadBalancerSpec, ClassicELB) +

                  +

                  +

                  ClassicELBScheme defines the scheme of a classic load balancer.

                  +

                  +

                  CloudInit +

                  +

                  +(Appears on:AWSMachineSpec) +

                  +

                  +

                  CloudInit defines options related to the bootstrapping systems where +CloudInit is used.

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +insecureSkipSecretsManager
                  + +bool + +
                  +

                  InsecureSkipSecretsManager, when set to true will not use AWS Secrets Manager +or AWS Systems Manager Parameter Store to ensure privacy of userdata. +By default, a cloud-init boothook shell script is prepended to download +the userdata from Secrets Manager and additionally delete the secret.

                  +
                  +secretCount
                  + +int32 + +
                  +(Optional) +

                  SecretCount is the number of secrets used to form the complete secret

                  +
                  +secretPrefix
                  + +string + +
                  +(Optional) +

                  SecretPrefix is the prefix for the secret name. This is stored +temporarily, and deleted when the machine registers as a node against +the workload cluster.

                  +
                  +secureSecretsBackend
                  + + +SecretBackend + + +
                  +(Optional) +

                  SecureSecretsBackend, when set to parameter-store will utilize the AWS Systems Manager +Parameter Storage to distribute secrets. By default or with the value of secrets-manager, +will use AWS Secrets Manager instead.

                  +
                  +

                  ConditionOperator +(string alias)

                  +

                  +

                  ConditionOperator defines an AWS condition operator.

                  +

                  +

                  Conditions +(map[../../api/v1alpha4.ConditionOperator]interface{} alias)

                  +

                  +(Appears on:StatementEntry) +

                  +

                  +

                  Conditions is the map of all conditions in the statement entry.

                  +

                  +

                  EKSAMILookupType +(string alias)

                  +

                  +(Appears on:AMIReference) +

                  +

                  +

                  EKSAMILookupType specifies which AWS AMI to use for a AWSMachine and AWSMachinePool.

                  +

                  +

                  Effect +(string alias)

                  +

                  +(Appears on:StatementEntry) +

                  +

                  +

                  Effect defines an AWS IAM effect.

                  +

                  +

                  Filter +

                  +

                  +(Appears on:AWSResourceReference) +

                  +

                  +

                  Filter is a filter used to identify an AWS resource

                  +

                  + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +name
                  + +string + +
                  +

                  Name of the filter. Filter names are case-sensitive.

                  +
                  +values
                  + +[]string + +
                  +

                  Values includes one or more filter values. Filter values are case-sensitive.

                  +
                  +

                  IngressRule +

                  +

                  +

                  IngressRule defines an AWS ingress rule for security groups.

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +description
                  + +string + +
                  +
                  +protocol
                  + + +SecurityGroupProtocol + + +
                  +
                  +fromPort
                  + +int64 + +
                  +
                  +toPort
                  + +int64 + +
                  +
                  +cidrBlocks
                  + +[]string + +
                  +(Optional) +

                  List of CIDR blocks to allow access from. Cannot be specified with SourceSecurityGroupID.

                  +
                  +sourceSecurityGroupIds
                  + +[]string + +
                  +(Optional) +

                  The security group id to allow access from. Cannot be specified with CidrBlocks.

                  +
                  +

                  IngressRules +([]../../api/v1alpha4.IngressRule alias)

                  +

                  +(Appears on:SecurityGroup) +

                  +

                  +

                  IngressRules is a slice of AWS ingress rules for security groups.

                  +

                  +

                  Instance +

                  +

                  +(Appears on:AWSClusterStatus) +

                  +

                  +

                  Instance describes an AWS instance.

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +id
                  + +string + +
                  +
                  +instanceState
                  + + +InstanceState + + +
                  +

                  The current state of the instance.

                  +
                  +type
                  + +string + +
                  +

                  The instance type.

                  +
                  +subnetId
                  + +string + +
                  +

                  The ID of the subnet of the instance.

                  +
                  +imageId
                  + +string + +
                  +

                  The ID of the AMI used to launch the instance.

                  +
                  +sshKeyName
                  + +string + +
                  +

                  The name of the SSH key pair.

                  +
                  +securityGroupIds
                  + +[]string + +
                  +

                  SecurityGroupIDs are one or more security group IDs this instance belongs to.

                  +
                  +userData
                  + +string + +
                  +

                  UserData is the raw data script passed to the instance which is run upon bootstrap. +This field must not be base64 encoded and should only be used when running a new instance.

                  +
                  +iamProfile
                  + +string + +
                  +

                  The name of the IAM instance profile associated with the instance, if applicable.

                  +
                  +addresses
                  + + +[]Cluster API api/v1alpha4.MachineAddress + + +
                  +

                  Addresses contains the AWS instance associated addresses.

                  +
                  +privateIp
                  + +string + +
                  +

                  The private IPv4 address assigned to the instance.

                  +
                  +publicIp
                  + +string + +
                  +

                  The public IPv4 address assigned to the instance, if applicable.

                  +
                  +enaSupport
                  + +bool + +
                  +

                  Specifies whether enhanced networking with ENA is enabled.

                  +
                  +ebsOptimized
                  + +bool + +
                  +

                  Indicates whether the instance is optimized for Amazon EBS I/O.

                  +
                  +rootVolume
                  + + +Volume + + +
                  +(Optional) +

                  Configuration options for the root storage volume.

                  +
                  +nonRootVolumes
                  + + +[]Volume + + +
                  +(Optional) +

                  Configuration options for the non root storage volumes.

                  +
                  +networkInterfaces
                  + +[]string + +
                  +

                  Specifies ENIs attached to instance

                  +
                  +tags
                  + +map[string]string + +
                  +

                  The tags associated with the instance.

                  +
                  +availabilityZone
                  + +string + +
                  +

                  Availability zone of instance

                  +
                  +spotMarketOptions
                  + + +SpotMarketOptions + + +
                  +

                  SpotMarketOptions option for configuring instances to be run using AWS Spot instances.

                  +
                  +tenancy
                  + +string + +
                  +(Optional) +

                  Tenancy indicates if instance should run on shared or single-tenant hardware.

                  +
                  +volumeIDs
                  + +[]string + +
                  +(Optional) +

                  IDs of the instance’s volumes

                  +
                  +

                  InstanceState +(string alias)

                  +

                  +(Appears on:AWSMachineStatus, Instance) +

                  +

                  +

                  InstanceState describes the state of an AWS instance.

                  +

                  +

                  NetworkSpec +

                  +

                  +(Appears on:AWSClusterSpec) +

                  +

                  +

                  NetworkSpec encapsulates all things related to AWS network.

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +vpc
                  + + +VPCSpec + + +
                  +(Optional) +

                  VPC configuration.

                  +
                  +subnets
                  + + +Subnets + + +
                  +(Optional) +

                  Subnets configuration.

                  +
                  +cni
                  + + +CNISpec + + +
                  +(Optional) +

                  CNI configuration

                  +
                  +securityGroupOverrides
                  + +map[../../api/v1alpha4.SecurityGroupRole]string + +
                  +(Optional) +

                  SecurityGroupOverrides is an optional set of security groups to use for cluster instances +This is optional - if not provided new security groups will be created for the cluster

                  +
                  +

                  NetworkStatus +

                  +

                  +(Appears on:AWSClusterStatus) +

                  +

                  +

                  NetworkStatus encapsulates AWS networking resources.

                  +

                  + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +securityGroups
                  + + +map[../../api/v1alpha4.SecurityGroupRole]../../api/v1alpha4.SecurityGroup + + +
                  +

                  SecurityGroups is a map from the role/kind of the security group to its unique name, if any.

                  +
                  +apiServerElb
                  + + +ClassicELB + + +
                  +

                  APIServerELB is the Kubernetes api server classic load balancer.

                  +
                  +

                  PolicyDocument +

                  +

                  +

                  PolicyDocument represents an AWS IAM policy document, and can be +converted into JSON using “sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/converters”.

                  +

                  + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +Version
                  + +string + +
                  +
                  +Statement
                  + + +Statements + + +
                  +
                  +Id
                  + +string + +
                  +
                  +

                  PrincipalID +([]string alias)

                  +

                  +

                  PrincipalID represents the list of all identities, such as ARNs.

                  +

                  +

                  PrincipalType +(string alias)

                  +

                  +

                  PrincipalType defines an AWS principle type.

                  +

                  +

                  Principals +(map[../../api/v1alpha4.PrincipalType]../../api/v1alpha4.PrincipalID alias)

                  +

                  +(Appears on:StatementEntry) +

                  +

                  +

                  Principals is the map of all identities a statement entry refers to.

                  +

                  +

                  ResourceLifecycle +(string alias)

                  +

                  +(Appears on:BuildParams) +

                  +

                  +

                  ResourceLifecycle configures the lifecycle of a resource.

                  +

                  +

                  Resources +([]string alias)

                  +

                  +(Appears on:StatementEntry) +

                  +

                  +

                  Resources is the list of resources.

                  +

                  +

                  RouteTable +

                  +

                  +

                  RouteTable defines an AWS routing table.

                  +

                  + + + + + + + + + + + + + +
                  FieldDescription
                  +id
                  + +string + +
                  +
                  +

                  SecretBackend +(string alias)

                  +

                  +(Appears on:CloudInit) +

                  +

                  +

                  SecretBackend defines variants for backend secret storage.

                  +

                  +

                  SecurityGroup +

                  +

                  +(Appears on:NetworkStatus) +

                  +

                  +

                  SecurityGroup defines an AWS security group.

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +id
                  + +string + +
                  +

                  ID is a unique identifier.

                  +
                  +name
                  + +string + +
                  +

                  Name is the security group name.

                  +
                  +ingressRule
                  + + +IngressRules + + +
                  +(Optional) +

                  IngressRules is the inbound rules associated with the security group.

                  +
                  +tags
                  + + +Tags + + +
                  +

                  Tags is a map of tags associated with the security group.

                  +
                  +

                  SecurityGroupProtocol +(string alias)

                  +

                  +(Appears on:CNIIngressRule, IngressRule) +

                  +

                  +

                  SecurityGroupProtocol defines the protocol type for a security group rule.

                  +

                  +

                  SecurityGroupRole +(string alias)

                  +

                  +

                  SecurityGroupRole defines the unique role of a security group.

                  +

                  +

                  SpotMarketOptions +

                  +

                  +(Appears on:AWSMachineSpec, Instance) +

                  +

                  +

                  SpotMarketOptions defines the options available to a user when configuring +Machines to run on Spot instances. +Most users should provide an empty struct.

                  +

                  + + + + + + + + + + + + + +
                  FieldDescription
                  +maxPrice
                  + +string + +
                  +(Optional) +

                  MaxPrice defines the maximum price the user is willing to pay for Spot VM instances

                  +
                  +

                  StatementEntry +

                  +

                  +

                  StatementEntry represents each “statement” block in an AWS IAM policy document.

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +Sid
                  + +string + +
                  +
                  +Principal
                  + + +Principals + + +
                  +
                  +NotPrincipal
                  + + +Principals + + +
                  +
                  +Effect
                  + + +Effect + + +
                  +
                  +Action
                  + + +Actions + + +
                  +
                  +Resource
                  + + +Resources + + +
                  +
                  +Condition
                  + + +Conditions + + +
                  +
                  +

                  Statements +([]../../api/v1alpha4.StatementEntry alias)

                  +

                  +(Appears on:PolicyDocument) +

                  +

                  +

                  Statements is the list of StatementEntries.

                  +

                  +

                  SubnetSpec +

                  +

                  +

                  SubnetSpec configures an AWS Subnet.

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +id
                  + +string + +
                  +

                  ID defines a unique identifier to reference this resource.

                  +
                  +cidrBlock
                  + +string + +
                  +

                  CidrBlock is the CIDR block to be used when the provider creates a managed VPC.

                  +
                  +availabilityZone
                  + +string + +
                  +

                  AvailabilityZone defines the availability zone to use for this subnet in the cluster’s region.

                  +
                  +isPublic
                  + +bool + +
                  +(Optional) +

                  IsPublic defines the subnet as a public subnet. A subnet is public when it is associated with a route table that has a route to an internet gateway.

                  +
                  +routeTableId
                  + +string + +
                  +(Optional) +

                  RouteTableID is the routing table id associated with the subnet.

                  +
                  +natGatewayId
                  + +string + +
                  +(Optional) +

                  NatGatewayID is the NAT gateway id associated with the subnet. +Ignored unless the subnet is managed by the provider, in which case this is set on the public subnet where the NAT gateway resides. It is then used to determine routes for private subnets in the same AZ as the public subnet.

                  +
                  +tags
                  + + +Tags + + +
                  +

                  Tags is a collection of tags describing the resource.

                  +
                  +

                  Subnets +([]../../api/v1alpha4.SubnetSpec alias)

                  +

                  +(Appears on:NetworkSpec) +

                  +

                  +

                  Subnets is a slice of Subnet.

                  +

                  +

                  Tags +(map[string]string alias)

                  +

                  +(Appears on:AWSClusterSpec, AWSMachineSpec, BuildParams, SecurityGroup, SubnetSpec, VPCSpec) +

                  +

                  +

                  Tags defines a map of tags.

                  +

                  +

                  VPCSpec +

                  +

                  +(Appears on:NetworkSpec) +

                  +

                  +

                  VPCSpec configures an AWS VPC.

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +id
                  + +string + +
                  +

                  ID is the vpc-id of the VPC this provider should use to create resources.

                  +
                  +cidrBlock
                  + +string + +
                  +

                  CidrBlock is the CIDR block to be used when the provider creates a managed VPC. +Defaults to 10.0.0.0/16.

                  +
                  +internetGatewayId
                  + +string + +
                  +(Optional) +

                  InternetGatewayID is the id of the internet gateway associated with the VPC.

                  +
                  +tags
                  + + +Tags + + +
                  +

                  Tags is a collection of tags describing the resource.

                  +
                  +availabilityZoneUsageLimit
                  + +int + +
                  +

                  AvailabilityZoneUsageLimit specifies the maximum number of availability zones (AZ) that +should be used in a region when automatically creating subnets. If a region has more +than this number of AZs then this number of AZs will be picked randomly when creating +default subnets. Defaults to 3

                  +
                  +availabilityZoneSelection
                  + + +AZSelectionScheme + + +
                  +

                  AvailabilityZoneSelection specifies how AZs should be selected if there are more AZs +in a region than specified by AvailabilityZoneUsageLimit. There are 2 selection schemes: +Ordered - selects based on alphabetical order +Random - selects AZs randomly in a region +Defaults to Ordered

                  +
                  +

                  Volume +

                  +

                  +(Appears on:AWSMachineSpec, Instance) +

                  +

                  +

                  Volume encapsulates the configuration options for the storage device

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +deviceName
                  + +string + +
                  +(Optional) +

                  Device name

                  +
                  +size
                  + +int64 + +
                  +

                  Size specifies size (in Gi) of the storage device. +Must be greater than the image snapshot size or 8 (whichever is greater).

                  +
                  +type
                  + + +VolumeType + + +
                  +(Optional) +

                  Type is the type of the volume (e.g. gp2, io1, etc…).

                  +
                  +iops
                  + +int64 + +
                  +(Optional) +

                  IOPS is the number of IOPS requested for the disk. Not applicable to all types.

                  +
                  +throughput
                  + +int64 + +
                  +(Optional) +

                  Throughput to provision in MiB/s supported for the volume type. Not applicable to all types.

                  +
                  +encrypted
                  + +bool + +
                  +(Optional) +

                  Encrypted is whether the volume should be encrypted or not.

                  +
                  +encryptionKey
                  + +string + +
                  +(Optional) +

                  EncryptionKey is the KMS key to use to encrypt the volume. Can be either a KMS key ID or ARN. +If Encrypted is set and this is omitted, the default AWS key will be used. +The key must already exist and be accessible by the controller.

                  +
                  +

                  VolumeType +(string alias)

                  +

                  +(Appears on:Volume) +

                  +

                  +

                  VolumeType describes the EBS volume type. +See: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html

                  +

                  +

                  ASGStatus +(string alias)

                  +

                  +(Appears on:AWSMachinePoolStatus, AutoScalingGroup) +

                  +

                  +

                  ASGStatus is a status string returned by the autoscaling API

                  +

                  +

                  AWSFargateProfile +

                  +

                  +

                  AWSFargateProfile is the Schema for the awsfargateprofiles API

                  +

                  + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +metadata
                  + + +Kubernetes meta/v1.ObjectMeta + + +
                  +Refer to the Kubernetes API documentation for the fields of the +metadata field. +
                  +spec
                  + + +FargateProfileSpec + + +
                  +
                  +
                  + + + + + + + + + + + + + + + + + + + + + + + + + +
                  +clusterName
                  + +string + +
                  +

                  ClusterName is the name of the Cluster this object belongs to.

                  +
                  +profileName
                  + +string + +
                  +

                  ProfileName specifies the profile name.

                  +
                  +subnetIDs
                  + +[]string + +
                  +(Optional) +

                  SubnetIDs specifies which subnets are used for the +auto scaling group of this nodegroup.

                  +
                  +additionalTags
                  + + +Cluster API AWS api/v1alpha4.Tags + + +
                  +(Optional) +

                  AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the +ones added by default.

                  +
                  +roleName
                  + +string + +
                  +(Optional) +

                  RoleName specifies the name of IAM role for this fargate pool +If the role is pre-existing we will treat it as unmanaged +and not delete it on deletion. If the EKSEnableIAM feature +flag is true and no name is supplied then a role is created.

                  +
                  +selectors
                  + + +[]FargateSelector + + +
                  +

                  Selectors specify fargate pod selectors.

                  +
                  +
                  +status
                  + + +FargateProfileStatus + + +
                  +
                  +

                  AWSLaunchTemplate +

                  +

                  +(Appears on:AWSMachinePoolSpec) +

                  +

                  +

                  AWSLaunchTemplate defines the desired state of AWSLaunchTemplate

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +name
                  + +string + +
                  +

                  The name of the launch template.

                  +
                  +iamInstanceProfile
                  + +string + +
                  +

                  The name or the Amazon Resource Name (ARN) of the instance profile associated +with the IAM role for the instance. The instance profile contains the IAM +role.

                  +
                  +ami
                  + + +Cluster API AWS api/v1alpha4.AMIReference + + +
                  +(Optional) +

                  AMI is the reference to the AMI from which to create the machine instance.

                  +
                  +imageLookupFormat
                  + +string + +
                  +(Optional) +

                  ImageLookupFormat is the AMI naming format to look up the image for this +machine It will be ignored if an explicit AMI is set. Supports +substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base OS and +kubernetes version, respectively. The BaseOS will be the value in +ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as +defined by the packages produced by kubernetes/release without v as a +prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default +image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up +searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a +Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See +also: https://golang.org/pkg/text/template/

                  +
                  +imageLookupOrg
                  + +string + +
                  +

                  ImageLookupOrg is the AWS Organization ID to use for image lookup if AMI is not set.

                  +
                  +imageLookupBaseOS
                  + +string + +
                  +

                  ImageLookupBaseOS is the name of the base operating system to use for +image lookup the AMI is not set.

                  +
                  +instanceType
                  + +string + +
                  +

                  InstanceType is the type of instance to create. Example: m4.xlarge

                  +
                  +rootVolume
                  + + +Cluster API AWS api/v1alpha4.Volume + + +
                  +(Optional) +

                  RootVolume encapsulates the configuration options for the root volume

                  +
                  +sshKeyName
                  + +string + +
                  +(Optional) +

                  SSHKeyName is the name of the ssh key to attach to the instance. Valid values are empty string +(do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name)

                  +
                  +versionNumber
                  + +int64 + +
                  +

                  VersionNumber is the version of the launch template that is applied. +Typically a new version is created when at least one of the following happens: +1) A new launch template spec is applied. +2) One or more parameters in an existing template is changed. +3) A new AMI is discovered.

                  +
                  +additionalSecurityGroups
                  + + +[]Cluster API AWS api/v1alpha4.AWSResourceReference + + +
                  +(Optional) +

                  AdditionalSecurityGroups is an array of references to security groups that should be applied to the +instances. These security groups would be set in addition to any security groups defined +at the cluster level or in the actuator.

                  +
                  +

                  AWSMachinePool +

                  +

                  +

                  AWSMachinePool is the Schema for the awsmachinepools API

                  +

                  + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +metadata
                  + + +Kubernetes meta/v1.ObjectMeta + + +
                  +Refer to the Kubernetes API documentation for the fields of the +metadata field. +
                  +spec
                  + + +AWSMachinePoolSpec + + +
                  +
                  +
                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  +providerID
                  + +string + +
                  +(Optional) +

                  ProviderID is the ARN of the associated ASG

                  +
                  +minSize
                  + +int32 + +
                  +

                  MinSize defines the minimum size of the group.

                  +
                  +maxSize
                  + +int32 + +
                  +

                  MaxSize defines the maximum size of the group.

                  +
                  +availabilityZones
                  + +[]string + +
                  +

                  AvailabilityZones is an array of availability zones instances can run in

                  +
                  +subnets
                  + + +[]Cluster API AWS api/v1alpha4.AWSResourceReference + + +
                  +(Optional) +

                  Subnets is an array of subnet configurations

                  +
                  +additionalTags
                  + + +Cluster API AWS api/v1alpha4.Tags + + +
                  +(Optional) +

                  AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the +AWS provider.

                  +
                  +awsLaunchTemplate
                  + + +AWSLaunchTemplate + + +
                  +

                  AWSLaunchTemplate specifies the launch template and version to use when an instance is launched.

                  +
                  +mixedInstancesPolicy
                  + + +MixedInstancesPolicy + + +
                  +

                  MixedInstancesPolicy describes how multiple instance types will be used by the ASG.

                  +
                  +providerIDList
                  + +[]string + +
                  +(Optional) +

                  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.

                  +
                  +defaultCoolDown
                  + + +Kubernetes meta/v1.Duration + + +
                  +(Optional) +

                  The amount of time, in seconds, after a scaling activity completes before another scaling activity can start. +If no value is supplied by user a default value of 300 seconds is set

                  +
                  +refreshPreferences
                  + + +RefreshPreferences + + +
                  +(Optional) +

                  RefreshPreferences describes set of preferences associated with the instance refresh request.

                  +
                  +capacityRebalance
                  + +bool + +
                  +(Optional) +

                  Enable or disable the capacity rebalance autoscaling group feature

                  +
                  +
                  +status
                  + + +AWSMachinePoolStatus + + +
                  +
                  +

                  AWSMachinePoolInstanceStatus +

                  +

                  +(Appears on:AWSMachinePoolStatus) +

                  +

                  +

                  AWSMachinePoolInstanceStatus defines the status of the AWSMachinePoolInstance.

                  +

                  + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +instanceID
                  + +string + +
                  +(Optional) +

                  InstanceID is the identification of the Machine Instance within ASG

                  +
                  +version
                  + +string + +
                  +(Optional) +

                  Version defines the Kubernetes version for the Machine Instance

                  +
                  +

                  AWSMachinePoolSpec +

                  +

                  +(Appears on:AWSMachinePool) +

                  +

                  +

                  AWSMachinePoolSpec defines the desired state of AWSMachinePool

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +providerID
                  + +string + +
                  +(Optional) +

                  ProviderID is the ARN of the associated ASG

                  +
                  +minSize
                  + +int32 + +
                  +

                  MinSize defines the minimum size of the group.

                  +
                  +maxSize
                  + +int32 + +
                  +

                  MaxSize defines the maximum size of the group.

                  +
                  +availabilityZones
                  + +[]string + +
                  +

                  AvailabilityZones is an array of availability zones instances can run in

                  +
                  +subnets
                  + + +[]Cluster API AWS api/v1alpha4.AWSResourceReference + + +
                  +(Optional) +

                  Subnets is an array of subnet configurations

                  +
                  +additionalTags
                  + + +Cluster API AWS api/v1alpha4.Tags + + +
                  +(Optional) +

                  AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the +AWS provider.

                  +
                  +awsLaunchTemplate
                  + + +AWSLaunchTemplate + + +
                  +

                  AWSLaunchTemplate specifies the launch template and version to use when an instance is launched.

                  +
                  +mixedInstancesPolicy
                  + + +MixedInstancesPolicy + + +
                  +

                  MixedInstancesPolicy describes how multiple instance types will be used by the ASG.

                  +
                  +providerIDList
                  + +[]string + +
                  +(Optional) +

                  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.

                  +
                  +defaultCoolDown
                  + + +Kubernetes meta/v1.Duration + + +
                  +(Optional) +

                  The amount of time, in seconds, after a scaling activity completes before another scaling activity can start. +If no value is supplied by user a default value of 300 seconds is set

                  +
                  +refreshPreferences
                  + + +RefreshPreferences + + +
                  +(Optional) +

                  RefreshPreferences describes set of preferences associated with the instance refresh request.

                  +
                  +capacityRebalance
                  + +bool + +
                  +(Optional) +

                  Enable or disable the capacity rebalance autoscaling group feature

                  +
                  +

                  AWSMachinePoolStatus +

                  +

                  +(Appears on:AWSMachinePool) +

                  +

                  +

                  AWSMachinePoolStatus defines the observed state of AWSMachinePool

                  +

                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +ready
                  + +bool + +
                  +(Optional) +

                  Ready is true when the provider resource is ready.

                  +
                  +replicas
                  + +int32 + +
                  +(Optional) +

                  Replicas is the most recently observed number of replicas

                  +
                  +conditions
                  + + +Cluster API api/v1alpha4.Conditions + + +
                  +(Optional) +

                  Conditions defines current service state of the AWSMachinePool.

                  +
                  +instances
                  + + +[]AWSMachinePoolInstanceStatus + + +
                  +(Optional) +

                  Instances contains the status for each instance in the pool

                  +
                  +launchTemplateID
                  + +string + +
                  +

                  The ID of the launch template

                  +
                  +failureReason
                  + + +Cluster API errors.MachineStatusError + + +
                  +(Optional) +

                  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.

                  +
                  +failureMessage
                  + +string + +
                  +(Optional) +

                  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.

                  +
                  +asgStatus
                  + + +ASGStatus + + +
                  +
                  +

                  AWSManagedMachinePool +

                  +

                  +

                  AWSManagedMachinePool is the Schema for the awsmanagedmachinepools API

                  +

                  + + + + + + + + + + + + + + + + +
                  FieldDescription
                  +metadata
                  + + +Kubernetes meta/v1.ObjectMeta + + +
                  +Refer to the Kubernetes API documentation for the fields of the +metadata field. +
                  +spec
                  + + +AWSManagedMachinePoolSpec + + +
                  +
                  +
                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                  +eksNodegroupName
                  + +string + +
                  +(Optional) +

                  EKSNodegroupName specifies the name of the nodegroup in AWS +corresponding to this MachinePool. If you don’t specify a name +then a default name will be created based on the namespace and +name of the managed machine pool.

                  +
                  +availabilityZones
                  + +[]string + +
                  +

                  AvailabilityZones is an array of availability zones instances can run in

                  +
                  +subnetIDs
                  + +[]string + +
                  +(Optional) +

                  SubnetIDs specifies which subnets are used for the +auto scaling group of this nodegroup

                  +
                  +additionalTags
                  + + +Cluster API AWS api/v1alpha4.Tags + + +
                  +(Optional) +

                  AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the +ones added by default.

                  +
                  +roleName
                  + +string + +
                  +(Optional) +

                  RoleName specifies the name of IAM role for the node group. +If the role is pre-existing we will treat it as unmanaged +and not delete it on deletion. If the EKSEnableIAM feature +flag is true and no name is supplied then a role is created.

                  +
                  +amiVersion
                  + +string + +
                  +(Optional) +

                  AMIVersion defines the desired AMI release version. If no version number +is supplied then the latest version for the Kubernetes version +will be used

                  +
                  +amiType
                  + + +ManagedMachineAMIType + + +
                  +(Optional) +

                  AMIType defines the AMI type

                  +
                  +labels
                  + +map[string]string + +
                  +(Optional) +

                  Labels specifies labels for the Kubernetes node objects

                  +
                  +taints
                  + + +Taints + + +
                  +(Optional) +

                  Taints specifies the taints to apply to the nodes of the machine pool

                  +
                  +diskSize
                  + +int32 + +
                  +(Optional) +

                  DiskSize specifies the root disk size

                  +
                  +instanceType
                  + +string + +
                  +(Optional) +

                  InstanceType specifies the AWS instance type

                  +
                  +scaling
                  + + +ManagedMachinePoolScaling + + +
                  +(Optional) +

                  Scaling specifies scaling for the ASG behind this pool

                  +
                  +remoteAccess
                  + + +ManagedRemoteAccess + + +
                  +(Optional) +

                  RemoteAccess specifies how machines can be accessed remotely

                  +
                  +providerIDList
                  + +[]string + +
                  +(Optional) +

                  ProviderIDList are the provider IDs of instances in the +autoscaling group corresponding to the nodegroup represented by this +machine pool

                  -identityRef
                  +capacityType
                  - -Cluster API AWS api/v1alpha4.AWSIdentityReference + +ManagedMachinePoolCapacityType
                  (Optional) -

                  IdentityRef is a reference to a identity to be used when reconciling the managed control plane.

                  +

                  CapacityType specifies the capacity type for the ASG behind this pool

                  +
                  -network
                  +status
                  - -Cluster API AWS api/v1alpha4.NetworkSpec + +AWSManagedMachinePoolStatus
                  -

                  NetworkSpec encapsulates all things related to AWS network.

                  +

                  AWSManagedMachinePoolSpec +

                  +

                  +(Appears on:AWSManagedMachinePool) +

                  +

                  +

                  AWSManagedMachinePoolSpec defines the desired state of AWSManagedMachinePool

                  +

                  + + + + + + + + @@ -1866,261 +11855,260 @@ string - - - - + +
                  FieldDescription
                  -secondaryCidrBlock
                  +eksNodegroupName
                  string
                  (Optional) -

                  SecondaryCidrBlock is the additional CIDR range to use for pod IPs. -Must be within the 100.64.0.0/10 or 198.19.0.0/16 range.

                  +

                  EKSNodegroupName specifies the name of the nodegroup in AWS +corresponding to this MachinePool. If you don’t specify a name +then a default name will be created based on the namespace and +name of the managed machine pool.

                  -region
                  +availabilityZones
                  -string +[]string
                  -

                  The AWS Region the cluster lives in.

                  +

                  AvailabilityZones is an array of availability zones instances can run in

                  -sshKeyName
                  +subnetIDs
                  -string +[]string
                  (Optional) -

                  SSHKeyName is the name of the ssh key to attach to the bastion host. Valid values are empty string (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name)

                  +

                  SubnetIDs specifies which subnets are used for the +auto scaling group of this nodegroup

                  -version
                  +additionalTags
                  -string + +Cluster API AWS api/v1alpha4.Tags +
                  (Optional) -

                  Version defines the desired Kubernetes version. If no version number -is supplied then the latest version of Kubernetes that EKS supports -will be used.

                  +

                  AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the +ones added by default.

                  (Optional) -

                  RoleName specifies the name of IAM role that gives EKS -permission to make API calls. If the role is pre-existing -we will treat it as unmanaged and not delete it on -deletion. If the EKSEnableIAM feature flag is true -and no name is supplied then a role is created.

                  +

                  RoleName specifies the name of IAM role for the node group. +If the role is pre-existing we will treat it as unmanaged +and not delete it on deletion. If the EKSEnableIAM feature +flag is true and no name is supplied then a role is created.

                  -roleAdditionalPolicies
                  +amiVersion
                  -[]string +string
                  (Optional) -

                  RoleAdditionalPolicies allows you to attach additional polices to -the control plane role. You must enable the EKSAllowAddRoles -feature flag to incorporate these into the created role.

                  +

                  AMIVersion defines the desired AMI release version. If no version number +is supplied then the latest version for the Kubernetes version +will be used

                  -logging
                  +amiType
                  - -ControlPlaneLoggingSpec + +ManagedMachineAMIType
                  (Optional) -

                  Logging specifies which EKS Cluster logs should be enabled. Entries for -each of the enabled logs will be sent to CloudWatch

                  +

                  AMIType defines the AMI type

                  -encryptionConfig
                  +labels
                  - -EncryptionConfig - +map[string]string
                  (Optional) -

                  EncryptionConfig specifies the encryption configuration for the cluster

                  +

                  Labels specifies labels for the Kubernetes node objects

                  -additionalTags
                  +taints
                  - -Cluster API AWS api/v1alpha4.Tags + +Taints
                  (Optional) -

                  AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the -ones added by default.

                  +

                  Taints specifies the taints to apply to the nodes of the machine pool

                  -iamAuthenticatorConfig
                  +diskSize
                  - -IAMAuthenticatorConfig - +int32
                  (Optional) -

                  IAMAuthenticatorConfig allows the specification of any additional user or role mappings -for use when generating the aws-iam-authenticator configuration. If this is nil the -default configuration is still generated for the cluster.

                  +

                  DiskSize specifies the root disk size

                  -endpointAccess
                  +instanceType
                  - -EndpointAccess - +string
                  (Optional) -

                  Endpoints specifies access to this cluster’s control plane endpoints

                  +

                  InstanceType specifies the AWS instance type

                  -controlPlaneEndpoint
                  +scaling
                  - -Cluster API api/v1alpha4.APIEndpoint + +ManagedMachinePoolScaling
                  (Optional) -

                  ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.

                  +

                  Scaling specifies scaling for the ASG behind this pool

                  -imageLookupFormat
                  +remoteAccess
                  -string + +ManagedRemoteAccess +
                  (Optional) -

                  ImageLookupFormat is the AMI naming format to look up machine images when -a machine does not specify an AMI. When set, this will be used for all -cluster machines unless a machine specifies a different ImageLookupOrg. -Supports substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base -OS and kubernetes version, respectively. The BaseOS will be the value in -ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as -defined by the packages produced by kubernetes/release without v as a -prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default -image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up -searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a -Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See -also: https://golang.org/pkg/text/template/

                  +

                  RemoteAccess specifies how machines can be accessed remotely

                  -imageLookupOrg
                  +providerIDList
                  -string +[]string
                  (Optional) -

                  ImageLookupOrg is the AWS Organization ID to look up machine images when a -machine does not specify an AMI. When set, this will be used for all -cluster machines unless a machine specifies a different ImageLookupOrg.

                  -
                  -imageLookupBaseOS
                  - -string - -
                  -

                  ImageLookupBaseOS is the name of the base operating system used to look -up machine images when a machine does not specify an AMI. When set, this -will be used for all cluster machines unless a machine specifies a -different ImageLookupBaseOS.

                  +

                  ProviderIDList are the provider IDs of instances in the +autoscaling group corresponding to the nodegroup represented by this +machine pool

                  -bastion
                  +capacityType
                  - -Cluster API AWS api/v1alpha4.Bastion + +ManagedMachinePoolCapacityType
                  (Optional) -

                  Bastion contains options to configure the bastion host.

                  +

                  CapacityType specifies the capacity type for the ASG behind this pool

                  +

                  AWSManagedMachinePoolStatus +

                  +

                  +(Appears on:AWSManagedMachinePool) +

                  +

                  +

                  AWSManagedMachinePoolStatus defines the observed state of AWSManagedMachinePool

                  +

                  + + + + + + + +
                  FieldDescription
                  -tokenMethod
                  +ready
                  - -EKSTokenMethod - +bool
                  -

                  TokenMethod is used to specify the method for obtaining a client token for communicating with EKS -iam-authenticator - obtains a client token using iam-authentictor -aws-cli - obtains a client token using the AWS CLI -Defaults to iam-authenticator

                  +

                  Ready denotes that the AWSManagedMachinePool nodegroup has joined +the cluster

                  -associateOIDCProvider
                  +replicas
                  -bool +int32
                  -

                  AssociateOIDCProvider can be enabled to automatically create an identity -provider for the controller for use with IAM roles for service accounts

                  +(Optional) +

                  Replicas is the most recently observed number of replicas.

                  -addons
                  +failureReason
                  - -[]../../controlplane/eks/api/v1alpha4.Addon + +Cluster API errors.MachineStatusError
                  (Optional) -

                  Addons defines the EKS addons to enable with the EKS cluster.

                  +

                  FailureReason will be set in the event that there is a terminal problem +reconciling the MachinePool 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 MachinePools +can be added as events to the MachinePool object and/or logged in the +controller’s output.

                  -oidcIdentityProviderConfig
                  - - -OIDCIdentityProviderConfig - +failureMessage
                  + +string
                  (Optional) -

                  IdentityProviderconfig is used to specify the oidc provider config -to be attached with this eks cluster

                  +

                  FailureMessage will be set in the event that there is a terminal problem +reconciling the MachinePool 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 MachinePool’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 MachinePools +can be added as events to the MachinePool object and/or logged in the +controller’s output.

                  -disableVPCCNI
                  +conditions
                  -bool + +Cluster API api/v1alpha4.Conditions +
                  -

                  DisableVPCCNI indcates the the Amazon VPC CNI should be disabled. With EKS clusters that -the Amazon VPC CNI is automatically installed into the cluster. For clusters where you want -to use an alternate CNI this option provides a way to specify that the Amazon VPC CNI -should be deleted. You cannot set this to true if you are using the -Amazon VPC CNI addon or if you have specified a secondary CIDR block.

                  +(Optional) +

                  Conditions defines current service state of the managed machine pool

                  -

                  AWSManagedControlPlaneStatus +

                  AutoScalingGroup

                  -(Appears on:AWSManagedControlPlane) -

                  -

                  -

                  AWSManagedControlPlaneStatus defines the observed state of AWSManagedControlPlane

                  +

                  AutoScalingGroup describes an AWS autoscaling group.

                  @@ -2132,224 +12120,195 @@ Amazon VPC CNI addon or if you have specified a secondary CIDR block.

                  - -
                  -networkStatus
                  +id
                  - -Cluster API AWS api/v1alpha4.NetworkStatus - +string
                  -(Optional) -

                  Networks holds details about the AWS networking resources used by the control plane

                  +

                  The tags associated with the instance.

                  -failureDomains
                  +tags
                  - -Cluster API api/v1alpha4.FailureDomains + +Cluster API AWS api/v1alpha4.Tags
                  -(Optional) -

                  FailureDomains specifies a list fo available availability zones that can be used

                  -bastion
                  +name
                  - -Cluster API AWS api/v1alpha4.Instance - +string
                  -(Optional) -

                  Bastion holds details of the instance that is used as a bastion jump box

                  -oidcProvider
                  +desiredCapacity
                  - -OIDCProviderStatus - +int32
                  -(Optional) -

                  OIDCProvider holds the status of the identity provider for this cluster

                  -externalManagedControlPlane
                  +maxSize
                  -bool +int32
                  -

                  ExternalManagedControlPlane indicates to cluster-api that the control plane -is managed by an external service such as AKS, EKS, GKE, etc.

                  -initialized
                  +minSize
                  -bool +int32
                  -(Optional) -

                  Initialized denotes whether or not the control plane has the -uploaded kubernetes config-map.

                  -ready
                  +placementGroup
                  -bool +string
                  -

                  Ready denotes that the AWSManagedControlPlane API Server is ready to -receive requests and that the VPC infra is ready.

                  -failureMessage
                  +subnets
                  -string +[]string
                  -(Optional) -

                  ErrorMessage indicates that there is a terminal problem reconciling the -state, and will be set to a descriptive error message.

                  -conditions
                  +defaultCoolDown
                  - -Cluster API api/v1alpha4.Conditions + +Kubernetes meta/v1.Duration
                  -

                  Conditions specifies the cpnditions for the managed control plane

                  -addons
                  +capacityRebalance
                  - -[]AddonState - +bool
                  -(Optional) -

                  Addons holds the current status of the EKS addons

                  -identityProviderStatus
                  +mixedInstancesPolicy
                  - -IdentityProviderStatus + +MixedInstancesPolicy
                  -(Optional) -

                  IdentityProviderStatus holds the status for -associated identity provider

                  -

                  Addon -

                  -

                  -

                  Addon represents a EKS addon

                  -

                  - - - - - - - - + +
                  FieldDescription
                  -name
                  +Status
                  -string + +ASGStatus +
                  -

                  Name is the name of the addon

                  -version
                  +instances
                  -string + +[]Cluster API AWS api/v1alpha4.Instance +
                  -

                  Version is the version of the addon to use

                  +

                  BlockDeviceMapping +

                  +

                  +

                  BlockDeviceMapping specifies the block devices for the instance. +You can specify virtual devices and EBS volumes.

                  +

                  + + + + + + + +
                  FieldDescription
                  -conflictResolution
                  +deviceName
                  - -AddonResolution - +string
                  -

                  ConflictResolution is used to declare what should happen if there -are parameter conflicts. Defaults to none

                  +

                  The device name exposed to the EC2 instance (for example, /dev/sdh or xvdh).

                  -serviceAccountRoleARN
                  +ebs
                  -string + +EBS +
                  (Optional) -

                  ServiceAccountRoleArn is the ARN of an IAM role to bind to the addons service account

                  +

                  You can specify either VirtualName or Ebs, but not both.

                  -

                  AddonIssue +

                  EBS

                  -(Appears on:AddonState) +(Appears on:BlockDeviceMapping)

                  -

                  AddonIssue represents an issue with an addon

                  +

                  EBS can be used to automatically set up EBS volumes when an instance is launched.

                  @@ -2361,54 +12320,53 @@ string
                  -code
                  +encrypted
                  -string +bool
                  -

                  Code is the issue code

                  +(Optional) +

                  Encrypted is whether the volume should be encrypted or not.

                  -message
                  +volumeSize
                  -string +int64
                  -

                  Message is the textual description of the issue

                  +(Optional) +

                  The size of the volume, in GiB. +This can be a number from 1-1,024 for standard, 4-16,384 for io1, 1-16,384 +for gp2, and 500-16,384 for st1 and sc1. If you specify a snapshot, the volume +size must be equal to or larger than the snapshot size.

                  -resourceIds
                  +volumeType
                  -[]string +string
                  -

                  ResourceIDs is a list of resource ids for the issue

                  +(Optional) +

                  The volume type +For more information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html)

                  -

                  AddonResolution -(string alias)

                  -

                  -(Appears on:Addon) -

                  -

                  -

                  AddonResolution defines the method for resolving parameter conflicts.

                  -

                  -

                  AddonState +

                  FargateProfileSpec

                  -(Appears on:AWSManagedControlPlaneStatus) +(Appears on:AWSFargateProfile)

                  -

                  AddonState represents the state of an addon

                  +

                  FargateProfileSpec defines the desired state of FargateProfile

                  @@ -2420,112 +12378,91 @@ string - - - - - - - -
                  -name
                  - -string - -
                  -

                  Name is the name of the addon

                  -
                  -version
                  - -string - -
                  -

                  Version is the version of the addon to use

                  -
                  -arn
                  +clusterName
                  string
                  -

                  ARN is the AWS ARN of the addon

                  +

                  ClusterName is the name of the Cluster this object belongs to.

                  -serviceAccountRoleARN
                  +profileName
                  string
                  -

                  ServiceAccountRoleArn is the ARN of the IAM role used for the service account

                  +

                  ProfileName specifies the profile name.

                  -createdAt
                  +subnetIDs
                  - -Kubernetes meta/v1.Time - +[]string
                  -

                  CreatedAt is the date and time the addon was created at

                  +(Optional) +

                  SubnetIDs specifies which subnets are used for the +auto scaling group of this nodegroup.

                  -modifiedAt
                  +additionalTags
                  - -Kubernetes meta/v1.Time + +Cluster API AWS api/v1alpha4.Tags
                  -

                  ModifiedAt is the date and time the addon was last modified

                  +(Optional) +

                  AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the +ones added by default.

                  -status
                  +roleName
                  string
                  -

                  Status is the status of the addon

                  +(Optional) +

                  RoleName specifies the name of IAM role for this fargate pool +If the role is pre-existing we will treat it as unmanaged +and not delete it on deletion. If the EKSEnableIAM feature +flag is true and no name is supplied then a role is created.

                  -issues
                  +selectors
                  - -[]AddonIssue + +[]FargateSelector
                  -

                  Issues is a list of issue associated with the addon

                  +

                  Selectors specify fargate pod selectors.

                  -

                  AddonStatus -(string alias)

                  -

                  -

                  AddonStatus defines the status for an addon.

                  -

                  -

                  ControlPlaneLoggingSpec +

                  FargateProfileStatus

                  -(Appears on:AWSManagedControlPlaneSpec) +(Appears on:AWSFargateProfile)

                  -

                  ControlPlaneLoggingSpec defines what EKS control plane logs that should be enabled.

                  +

                  FargateProfileStatus defines the observed state of FargateProfile

                  @@ -2537,76 +12474,91 @@ string - - - -
                  -apiServer
                  - -bool - -
                  -

                  APIServer indicates if the Kubernetes API Server log (kube-apiserver) shoulkd be enabled

                  -
                  -audit
                  +ready
                  bool
                  -

                  Audit indicates if the Kubernetes API audit log should be enabled

                  +

                  Ready denotes that the FargateProfile is available.

                  -authenticator
                  +failureReason
                  -bool + +Cluster API errors.MachineStatusError +
                  -

                  Authenticator indicates if the iam authenticator log should be enabled

                  +(Optional) +

                  FailureReason will be set in the event that there is a terminal problem +reconciling the FargateProfile 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 FargateProfile’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 +FargateProfiles can be added as events to the FargateProfile object +and/or logged in the controller’s output.

                  -controllerManager
                  +failureMessage
                  -bool +string
                  -

                  ControllerManager indicates if the controller manager (kube-controller-manager) log should be enabled

                  +(Optional) +

                  FailureMessage will be set in the event that there is a terminal problem +reconciling the FargateProfile 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 FargateProfile’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 +FargateProfiles can be added as events to the FargateProfile +object and/or logged in the controller’s output.

                  -scheduler
                  +conditions
                  -bool + +Cluster API api/v1alpha4.Conditions +
                  -

                  Scheduler indicates if the Kubernetes scheduler (kube-scheduler) log should be enabled

                  +(Optional) +

                  Conditions defines current state of the Fargate profile.

                  -

                  EKSTokenMethod -(string alias)

                  -

                  -(Appears on:AWSManagedControlPlaneSpec) -

                  -

                  -

                  EKSTokenMethod defines the method for obtaining a client token to use when connecting to EKS.

                  -

                  -

                  EncryptionConfig +

                  FargateSelector

                  -(Appears on:AWSManagedControlPlaneSpec) +(Appears on:FargateProfileSpec)

                  -

                  EncryptionConfig specifies the encryption configuration for the EKS clsuter.

                  +

                  FargateSelector specifies a selector for pods that should run on this fargate +pool

                  @@ -2618,35 +12570,35 @@ bool
                  -provider
                  +labels
                  -string +map[string]string
                  -

                  Provider specifies the ARN or alias of the CMK (in AWS KMS)

                  +

                  Labels specifies which pod labels this selector should match.

                  -resources
                  +namespace
                  -[]*string +string
                  -

                  Resources specifies the resources to be encrypted

                  +

                  Namespace specifies which namespace this selector should match.

                  -

                  EndpointAccess +

                  InstancesDistribution

                  -(Appears on:AWSManagedControlPlaneSpec) +(Appears on:MixedInstancesPolicy)

                  -

                  EndpointAccess specifies how control plane endpoints are accessible.

                  +

                  InstancesDistribution to configure distribution of On-Demand Instances and Spot Instances.

                  @@ -2658,134 +12610,106 @@ string + + + +
                  -public
                  +onDemandAllocationStrategy
                  -bool + +OnDemandAllocationStrategy +
                  -(Optional) -

                  Public controls whether control plane endpoints are publicly accessible

                  -publicCIDRs
                  +spotAllocationStrategy
                  -[]*string + +SpotAllocationStrategy +
                  -(Optional) -

                  PublicCIDRs specifies which blocks can access the public endpoint

                  -private
                  +onDemandBaseCapacity
                  -bool +int64 + +
                  +
                  +onDemandPercentageAboveBaseCapacity
                  + +int64
                  -(Optional) -

                  Private points VPC-internal control plane access to the private endpoint

                  -

                  IAMAuthenticatorConfig -

                  +

                  ManagedMachineAMIType +(string alias)

                  -(Appears on:AWSManagedControlPlaneSpec) +(Appears on:AWSManagedMachinePoolSpec)

                  -

                  IAMAuthenticatorConfig represents an aws-iam-authenticator configuration.

                  +

                  ManagedMachineAMIType specifies which AWS AMI to use for a managed MachinePool.

                  - + - - - - + - - - + - + - - +
                  FieldValue Description
                  -mapRoles
                  - - -[]RoleMapping - - -
                  -(Optional) -

                  RoleMappings is a list of role mappings

                  +

                  "AL2_ARM_64"

                  Al2Arm64 is the Arm AMI type.

                  -mapUsers
                  - - -[]UserMapping - - +

                  "AL2_x86_64"

                  Al2x86_64 is the default AMI type.

                  -(Optional) -

                  UserMappings is a list of user mappings

                  +

                  "AL2_x86_64_GPU"

                  Al2x86_64GPU is the x86-64 GPU AMI type.

                  -

                  IdentityProviderStatus -

                  +

                  ManagedMachinePoolCapacityType +(string alias)

                  -(Appears on:AWSManagedControlPlaneStatus) +(Appears on:AWSManagedMachinePoolSpec)

                  +

                  ManagedMachinePoolCapacityType specifies the capacity type to be used for the managed MachinePool.

                  - + - - - - - - - + - + - - +
                  FieldValue Description
                  -arn
                  - -string - -
                  -

                  ARN holds the ARN of associated identity provider

                  -
                  -status
                  - -string - +

                  "onDemand"

                  ManagedMachinePoolCapacityTypeOnDemand is the default capacity type, to launch on-demand instances.

                  -

                  Status holds current status of associated identity provider

                  +

                  "spot"

                  ManagedMachinePoolCapacityTypeSpot is the spot instance capacity type to launch spot instances.

                  -

                  KubernetesMapping +

                  ManagedMachinePoolScaling

                  -(Appears on:RoleMapping, UserMapping) +(Appears on:AWSManagedMachinePoolSpec)

                  -

                  KubernetesMapping represents the kubernetes RBAC mapping.

                  +

                  ManagedMachinePoolScaling specifies scaling options.

                  @@ -2797,34 +12721,33 @@ string
                  -username
                  +minSize
                  -string +int32
                  -

                  UserName is a kubernetes RBAC user subject

                  -groups
                  +maxSize
                  -[]string +int32
                  -

                  Groups is a list of kubernetes RBAC groups

                  -

                  OIDCIdentityProviderConfig +

                  ManagedRemoteAccess

                  -(Appears on:AWSManagedControlPlaneSpec) +(Appears on:AWSManagedMachinePoolSpec)

                  +

                  ManagedRemoteAccess specifies remote access settings for EC2 instances.

                  @@ -2836,141 +12759,98 @@ string - - - - - - - - - - - - + +
                  -clientId
                  - -string - -
                  -

                  This is also known as audience. The ID for the client application that makes -authentication requests to the OpenID identity provider.

                  -
                  -groupsClaim
                  - -string - -
                  -(Optional) -

                  The JWT claim that the provider uses to return your groups.

                  -
                  -groupsPrefix
                  - -string - -
                  -(Optional) -

                  The prefix that is prepended to group claims to prevent clashes with existing -names (such as system: groups). For example, the valueoidc: will create group -names like oidc:engineering and oidc:infra.

                  -
                  -identityProviderConfigName
                  +sshKeyName
                  string
                  -

                  The name of the OIDC provider configuration.

                  -

                  IdentityProviderConfigName is a required field

                  +

                  SSHKeyName specifies which EC2 SSH key can be used to access machines. +If left empty, the key from the control plane is used.

                  -issuerUrl
                  +sourceSecurityGroups
                  -string +[]string
                  -

                  The URL of the OpenID identity provider that allows the API server to discover -public signing keys for verifying tokens. The URL must begin with https:// -and should correspond to the iss claim in the provider’s OIDC ID tokens. -Per the OIDC standard, path components are allowed but query parameters are -not. Typically the URL consists of only a hostname, like https://server.example.org -or https://example.com. This URL should point to the level below .well-known/openid-configuration -and must be publicly accessible over the internet.

                  +

                  SourceSecurityGroups specifies which security groups are allowed access

                  -requiredClaims
                  +public
                  -map[string]string +bool
                  -(Optional) -

                  The key value pairs that describe required claims in the identity token. -If set, each claim is verified to be present in the token with a matching -value. For the maximum number of claims that you can require, see Amazon -EKS service quotas (https://docs.aws.amazon.com/eks/latest/userguide/service-quotas.html) -in the Amazon EKS User Guide.

                  +

                  Public specifies whether to open port 22 to the public internet

                  +

                  MixedInstancesPolicy +

                  +

                  +(Appears on:AWSMachinePoolSpec, AutoScalingGroup) +

                  +

                  +

                  MixedInstancesPolicy for an Auto Scaling group.

                  +

                  + + - - + + + +
                  -usernameClaim
                  - -string - -
                  -(Optional) -

                  The JSON Web Token (JWT) claim to use as the username. The default is sub, -which is expected to be a unique identifier of the end user. You can choose -other claims, such as email or name, depending on the OpenID identity provider. -Claims other than email are prefixed with the issuer URL to prevent naming -clashes with other plug-ins.

                  -
                  FieldDescription
                  -usernamePrefix
                  +instancesDistribution
                  -string + +InstancesDistribution +
                  -(Optional) -

                  The prefix that is prepended to username claims to prevent clashes with existing -names. If you do not provide this field, and username is a value other than -email, the prefix defaults to issuerurl#. You can use the value - to disable -all prefixing.

                  -tags
                  +overrides
                  - -Cluster API AWS api/v1alpha4.Tags + +[]Overrides
                  -(Optional) -

                  tags to apply to oidc identity provider association

                  -

                  OIDCProviderStatus +

                  OnDemandAllocationStrategy +(string alias)

                  +

                  +(Appears on:InstancesDistribution) +

                  +

                  +

                  OnDemandAllocationStrategy indicates how to allocate instance types to fulfill On-Demand capacity.

                  +

                  +

                  Overrides

                  -(Appears on:AWSManagedControlPlaneStatus) +(Appears on:MixedInstancesPolicy)

                  -

                  OIDCProviderStatus holds the status of the AWS OIDC identity provider.

                  +

                  Overrides are used to override the instance type specified by the launch template with multiple +instance types that can be used to launch On-Demand Instances and Spot Instances.

                  @@ -2982,35 +12862,23 @@ Cluster API AWS api/v1alpha4.Tags - - - -
                  -arn
                  - -string - -
                  -

                  ARN holds the ARN of the provider

                  -
                  -trustPolicy
                  +instanceType
                  string
                  -

                  TrustPolicy contains the boilerplate IAM trust policy to use for IRSA

                  -

                  RoleMapping +

                  RefreshPreferences

                  -(Appears on:IAMAuthenticatorConfig) +(Appears on:AWSMachinePoolSpec)

                  -

                  RoleMapping represents a mapping from a IAM role to Kubernetes users and groups

                  +

                  RefreshPreferences defines the specs for instance refreshing.

                  @@ -3022,40 +12890,64 @@ string + + + +
                  -rolearn
                  +strategy
                  string
                  -

                  RoleARN is the AWS ARN for the role to map

                  +(Optional) +

                  The strategy to use for the instance refresh. The only valid value is Rolling. +A rolling update is an update that is applied to all instances in an Auto +Scaling group until all instances have been updated.

                  -KubernetesMapping
                  +instanceWarmup
                  - -KubernetesMapping - +int64
                  -

                  -(Members of KubernetesMapping are embedded into this type.) -

                  -

                  KubernetesMapping holds the RBAC details for the mapping

                  +(Optional) +

                  The number of seconds until a newly launched instance is configured and ready +to use. During this time, the next replacement will not be initiated. +The default is to use the value for the health check grace period defined for the group.

                  +
                  +minHealthyPercentage
                  + +int64 + +
                  +(Optional) +

                  The amount of capacity as a percentage in ASG that must remain healthy +during an instance refresh. The default is 90.

                  -

                  UserMapping -

                  +

                  SpotAllocationStrategy +(string alias)

                  -(Appears on:IAMAuthenticatorConfig) +(Appears on:InstancesDistribution)

                  -

                  UserMapping represents a mapping from an IAM user to Kubernetes users and groups

                  +

                  SpotAllocationStrategy indicates how to allocate instances across Spot Instance pools.

                  +

                  +

                  Tags +(map[string]string alias)

                  +

                  +

                  Tags is a mapping for tags.

                  +

                  +

                  Taint +

                  +

                  +

                  Taint defines the specs for a Kubernetes taint.

                  @@ -3067,41 +12959,68 @@ KubernetesMapping + + + +
                  -userarn
                  +effect
                  + + +TaintEffect + + +
                  +

                  Effect specifies the effect for the taint

                  +
                  +key
                  string
                  -

                  UserARN is the AWS ARN for the user to map

                  +

                  Key is the key of the taint

                  -KubernetesMapping
                  +value
                  - -KubernetesMapping - +string
                  -

                  -(Members of KubernetesMapping are embedded into this type.) -

                  -

                  KubernetesMapping holds the RBAC details for the mapping

                  +

                  Value is the value of the taint

                  +

                  TaintEffect +(string alias)

                  +

                  +(Appears on:Taint) +

                  +

                  +

                  TaintEffect is the effect for a Kubernetes taint.

                  +

                  +

                  Taints +([]../../exp/api/v1alpha4.Taint alias)

                  +

                  +(Appears on:AWSManagedMachinePoolSpec) +

                  +

                  +

                  Taints is an array of Taints.

                  +


                  -

                  infrastructure.cluster.x-k8s.io/v1alpha4

                  +

                  infrastructure.cluster.x-k8s.io/v1beta1

                  +

                  +

                  Package v1beta1 contains the v1beta1 API implementation.

                  +

                  Resource Types:
                    -

                    AMIReference +

                    AMIReference

                    -(Appears on:AWSMachineSpec) +(Appears on:AWSMachineSpec)

                    AMIReference is a reference to a specific AWS resource by ID, ARN, or filters. @@ -3132,7 +13051,7 @@ string

                    eksLookupType
                    - + EKSAMILookupType @@ -3144,10 +13063,10 @@ EKSAMILookupType
                    -

                    AWSCluster +

                    AWSCluster

                    -

                    AWSCluster is the Schema for the awsclusters API.

                    +

                    AWSCluster is the schema for Amazon EC2 based Kubernetes Cluster API.

                    @@ -3175,7 +13094,7 @@ Refer to the Kubernetes API documentation for the fields of the
                    spec
                    - + AWSClusterSpec @@ -3188,7 +13107,7 @@ AWSClusterSpec
                    network
                    - + NetworkSpec @@ -3224,9 +13143,7 @@ string
                    controlPlaneEndpoint
                    - -Cluster API api/v1alpha4.APIEndpoint - +Cluster API api/v1beta1.APIEndpoint
                    @@ -3238,7 +13155,7 @@ Cluster API api/v1alpha4.APIEndpoint additionalTags
                    - + Tags @@ -3253,7 +13170,7 @@ ones added by default.

                    controlPlaneLoadBalancer
                    - + AWSLoadBalancerSpec @@ -3318,7 +13235,7 @@ different ImageLookupBaseOS.

                    bastion
                    - + Bastion @@ -3332,7 +13249,7 @@ Bastion
                    identityRef
                    - + AWSIdentityReference @@ -3349,7 +13266,7 @@ AWSIdentityReference
                    status
                    - + AWSClusterStatus @@ -3359,7 +13276,7 @@ AWSClusterStatus
                    -

                    AWSClusterControllerIdentity +

                    AWSClusterControllerIdentity

                    AWSClusterControllerIdentity is the Schema for the awsclustercontrolleridentities API @@ -3391,7 +13308,7 @@ Refer to the Kubernetes API documentation for the fields of the spec
                    - + AWSClusterControllerIdentitySpec @@ -3405,7 +13322,7 @@ AWSClusterControllerIdentitySpec AWSClusterIdentitySpec
                    - + AWSClusterIdentitySpec @@ -3421,10 +13338,10 @@ AWSClusterIdentitySpec -

                    AWSClusterControllerIdentitySpec +

                    AWSClusterControllerIdentitySpec

                    -(Appears on:AWSClusterControllerIdentity) +(Appears on:AWSClusterControllerIdentity)

                    AWSClusterControllerIdentitySpec defines the specifications for AWSClusterControllerIdentity.

                    @@ -3441,7 +13358,7 @@ AWSClusterIdentitySpec AWSClusterIdentitySpec
                    - + AWSClusterIdentitySpec @@ -3454,10 +13371,10 @@ AWSClusterIdentitySpec -

                    AWSClusterIdentitySpec +

                    AWSClusterIdentitySpec

                    -(Appears on:AWSClusterControllerIdentitySpec, AWSClusterRoleIdentitySpec, AWSClusterStaticIdentitySpec) +(Appears on:AWSClusterControllerIdentitySpec, AWSClusterRoleIdentitySpec, AWSClusterStaticIdentitySpec)

                    AWSClusterIdentitySpec defines the Spec struct for AWSClusterIdentity types.

                    @@ -3474,7 +13391,7 @@ AWSClusterIdentitySpec allowedNamespaces
                    - + AllowedNamespaces @@ -3490,7 +13407,7 @@ A namespace should be either in the NamespaceList or match with Selector to use -

                    AWSClusterRoleIdentity +

                    AWSClusterRoleIdentity

                    AWSClusterRoleIdentity is the Schema for the awsclusterroleidentities API @@ -3522,7 +13439,7 @@ Refer to the Kubernetes API documentation for the fields of the spec
                    - + AWSClusterRoleIdentitySpec @@ -3536,7 +13453,7 @@ AWSClusterRoleIdentitySpec AWSClusterIdentitySpec
                    - + AWSClusterIdentitySpec @@ -3551,7 +13468,7 @@ AWSClusterIdentitySpec AWSRoleSpec
                    - + AWSRoleSpec @@ -3586,7 +13503,7 @@ When Granting Access to Your AWS Resources to a Third Party in the IAM User Guid sourceIdentityRef
                    - + AWSIdentityReference @@ -3601,10 +13518,10 @@ role assumption. All identity types are accepted.

                    -

                    AWSClusterRoleIdentitySpec +

                    AWSClusterRoleIdentitySpec

                    -(Appears on:AWSClusterRoleIdentity) +(Appears on:AWSClusterRoleIdentity)

                    AWSClusterRoleIdentitySpec defines the specifications for AWSClusterRoleIdentity.

                    @@ -3621,7 +13538,7 @@ role assumption. All identity types are accepted.

                    AWSClusterIdentitySpec
                    - + AWSClusterIdentitySpec @@ -3636,7 +13553,7 @@ AWSClusterIdentitySpec AWSRoleSpec
                    - + AWSRoleSpec @@ -3671,7 +13588,7 @@ When Granting Access to Your AWS Resources to a Third Party in the IAM User Guid sourceIdentityRef
                    - + AWSIdentityReference @@ -3683,13 +13600,13 @@ role assumption. All identity types are accepted.

                    -

                    AWSClusterSpec +

                    AWSClusterSpec

                    -(Appears on:AWSCluster, AWSClusterTemplateResource) +(Appears on:AWSCluster, AWSClusterTemplateResource)

                    -

                    AWSClusterSpec defines the desired state of AWSCluster

                    +

                    AWSClusterSpec defines the desired state of an EC2-based Kubernetes cluster.

                    @@ -3703,7 +13620,7 @@ role assumption. All identity types are accepted.

                    network
                    - + NetworkSpec @@ -3739,9 +13656,7 @@ string
                    controlPlaneEndpoint
                    - -Cluster API api/v1alpha4.APIEndpoint - +Cluster API api/v1beta1.APIEndpoint
                    @@ -3753,7 +13668,7 @@ Cluster API api/v1alpha4.APIEndpoint additionalTags
                    - + Tags @@ -3768,7 +13683,7 @@ ones added by default.

                    controlPlaneLoadBalancer
                    - + AWSLoadBalancerSpec @@ -3833,7 +13748,7 @@ different ImageLookupBaseOS.

                    bastion
                    - + Bastion @@ -3847,7 +13762,7 @@ Bastion
                    identityRef
                    - + AWSIdentityReference @@ -3859,7 +13774,7 @@ AWSIdentityReference
                    -

                    AWSClusterStaticIdentity +

                    AWSClusterStaticIdentity

                    AWSClusterStaticIdentity is the Schema for the awsclusterstaticidentities API @@ -3891,7 +13806,7 @@ Refer to the Kubernetes API documentation for the fields of the spec
                    - + AWSClusterStaticIdentitySpec @@ -3905,7 +13820,7 @@ AWSClusterStaticIdentitySpec AWSClusterIdentitySpec
                    - + AWSClusterIdentitySpec @@ -3936,10 +13851,10 @@ SessionToken: Optional

                    -

                    AWSClusterStaticIdentitySpec +

                    AWSClusterStaticIdentitySpec

                    -(Appears on:AWSClusterStaticIdentity) +(Appears on:AWSClusterStaticIdentity)

                    AWSClusterStaticIdentitySpec defines the specifications for AWSClusterStaticIdentity.

                    @@ -3956,7 +13871,7 @@ SessionToken: Optional

                    AWSClusterIdentitySpec
                    - + AWSClusterIdentitySpec @@ -3984,13 +13899,13 @@ SessionToken: Optional

                    -

                    AWSClusterStatus +

                    AWSClusterStatus

                    -(Appears on:AWSCluster) +(Appears on:AWSCluster)

                    -

                    AWSClusterStatus defines the observed state of AWSCluster

                    +

                    AWSClusterStatus defines the observed state of AWSCluster.

                    @@ -4014,7 +13929,7 @@ bool
                    networkStatus
                    - + NetworkStatus @@ -4026,9 +13941,7 @@ NetworkStatus
                    failureDomains
                    - -Cluster API api/v1alpha4.FailureDomains - +Cluster API api/v1beta1.FailureDomains
                    @@ -4038,7 +13951,7 @@ Cluster API api/v1alpha4.FailureDomains bastion
                    - + Instance @@ -4050,9 +13963,7 @@ Instance
                    conditions
                    - -Cluster API api/v1alpha4.Conditions - +Cluster API api/v1beta1.Conditions
                    @@ -4060,10 +13971,10 @@ Cluster API api/v1alpha4.Conditions
                    -

                    AWSClusterTemplate +

                    AWSClusterTemplate

                    -

                    AWSClusterTemplate is the Schema for the awsclustertemplates API.

                    +

                    AWSClusterTemplate is the schema for Amazon EC2 based Kubernetes Cluster Templates.

                    @@ -4091,7 +14002,7 @@ Refer to the Kubernetes API documentation for the fields of the
                    spec
                    - + AWSClusterTemplateSpec @@ -4104,7 +14015,7 @@ AWSClusterTemplateSpec
                    template
                    - + AWSClusterTemplateResource @@ -4117,10 +14028,10 @@ AWSClusterTemplateResource
                    -

                    AWSClusterTemplateResource +

                    AWSClusterTemplateResource

                    -(Appears on:AWSClusterTemplateSpec) +(Appears on:AWSClusterTemplateSpec)

                    @@ -4134,9 +14045,24 @@ AWSClusterTemplateResource +metadata
                    + +Cluster API api/v1beta1.ObjectMeta + + + +(Optional) +

                    Standard object’s metadata. +More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

                    +Refer to the Kubernetes API documentation for the fields of the +metadata field. + + + + spec
                    - + AWSClusterSpec @@ -4149,7 +14075,7 @@ AWSClusterSpec network
                    - + NetworkSpec @@ -4185,9 +14111,7 @@ string controlPlaneEndpoint
                    - -Cluster API api/v1alpha4.APIEndpoint - +Cluster API api/v1beta1.APIEndpoint @@ -4199,7 +14123,7 @@ Cluster API api/v1alpha4.APIEndpoint additionalTags
                    - + Tags @@ -4214,7 +14138,7 @@ ones added by default.

                    controlPlaneLoadBalancer
                    - + AWSLoadBalancerSpec @@ -4279,7 +14203,7 @@ different ImageLookupBaseOS.

                    bastion
                    - + Bastion @@ -4293,7 +14217,7 @@ Bastion identityRef
                    - + AWSIdentityReference @@ -4308,10 +14232,10 @@ AWSIdentityReference -

                    AWSClusterTemplateSpec +

                    AWSClusterTemplateSpec

                    -(Appears on:AWSClusterTemplate) +(Appears on:AWSClusterTemplate)

                    AWSClusterTemplateSpec defines the desired state of AWSClusterTemplate.

                    @@ -4328,7 +14252,7 @@ AWSIdentityReference template
                    - + AWSClusterTemplateResource @@ -4338,18 +14262,18 @@ AWSClusterTemplateResource -

                    AWSIdentityKind +

                    AWSIdentityKind (string alias)

                    -(Appears on:AWSIdentityReference) +(Appears on:AWSIdentityReference)

                    AWSIdentityKind defines allowed AWS identity types.

                    -

                    AWSIdentityReference +

                    AWSIdentityReference

                    -(Appears on:AWSClusterRoleIdentitySpec, AWSClusterSpec) +(Appears on:AWSClusterRoleIdentitySpec, AWSClusterSpec)

                    AWSIdentityReference specifies a identity.

                    @@ -4377,7 +14301,7 @@ string kind
                    - + AWSIdentityKind @@ -4388,10 +14312,10 @@ AWSIdentityKind -

                    AWSLoadBalancerSpec +

                    AWSLoadBalancerSpec

                    -(Appears on:AWSClusterSpec) +(Appears on:AWSClusterSpec)

                    AWSLoadBalancerSpec defines the desired state of an AWS load balancer.

                    @@ -4408,7 +14332,7 @@ AWSIdentityKind scheme
                    - + ClassicELBScheme @@ -4462,10 +14386,10 @@ This is optional - if not provided new security groups will be created for the l -

                    AWSMachine +

                    AWSMachine

                    -

                    AWSMachine is the Schema for the awsmachines API

                    +

                    AWSMachine is the schema for Amazon EC2 machines.

                    @@ -4493,7 +14417,7 @@ Refer to the Kubernetes API documentation for the fields of the
                    spec
                    - + AWSMachineSpec @@ -4528,7 +14452,7 @@ string
                    ami
                    - + AMIReference @@ -4597,7 +14521,7 @@ string
                    additionalTags
                    - + Tags @@ -4641,7 +14565,7 @@ Precedence for this setting is as follows:
                    additionalSecurityGroups
                    - + []AWSResourceReference @@ -4671,7 +14595,7 @@ If multiple subnets are matched for the availability zone, the first one returne
                    subnet
                    - + AWSResourceReference @@ -4698,7 +14622,7 @@ string
                    rootVolume
                    - + Volume @@ -4712,7 +14636,7 @@ Volume
                    nonRootVolumes
                    - + []Volume @@ -4753,7 +14677,7 @@ user data stored in aws secret manager is always gzip-compressed.

                    cloudInit
                    - + CloudInit @@ -4768,7 +14692,7 @@ CloudInit is used.

                    spotMarketOptions
                    - + SpotMarketOptions @@ -4797,7 +14721,7 @@ string
                    status
                    - + AWSMachineStatus @@ -4807,18 +14731,18 @@ AWSMachineStatus
                    -

                    AWSMachineProviderConditionType +

                    AWSMachineProviderConditionType (string alias)

                    AWSMachineProviderConditionType is a valid value for AWSMachineProviderCondition.Type.

                    -

                    AWSMachineSpec +

                    AWSMachineSpec

                    -(Appears on:AWSMachine, AWSMachineTemplateResource) +(Appears on:AWSMachine, AWSMachineTemplateResource)

                    -

                    AWSMachineSpec defines the desired state of AWSMachine

                    +

                    AWSMachineSpec defines the desired state of an Amazon EC2 instance.

                    @@ -4854,7 +14778,7 @@ string
                    ami
                    - + AMIReference @@ -4923,7 +14847,7 @@ string
                    additionalTags
                    - + Tags @@ -4967,7 +14891,7 @@ Precedence for this setting is as follows:
                    additionalSecurityGroups
                    - + []AWSResourceReference @@ -4997,7 +14921,7 @@ If multiple subnets are matched for the availability zone, the first one returne
                    subnet
                    - + AWSResourceReference @@ -5024,7 +14948,7 @@ string
                    rootVolume
                    - + Volume @@ -5038,7 +14962,7 @@ Volume
                    nonRootVolumes
                    - + []Volume @@ -5079,7 +15003,7 @@ user data stored in aws secret manager is always gzip-compressed.

                    cloudInit
                    - + CloudInit @@ -5094,7 +15018,7 @@ CloudInit is used.

                    spotMarketOptions
                    - + SpotMarketOptions @@ -5118,13 +15042,13 @@ string
                    -

                    AWSMachineStatus +

                    AWSMachineStatus

                    -(Appears on:AWSMachine) +(Appears on:AWSMachine)

                    -

                    AWSMachineStatus defines the observed state of AWSMachine

                    +

                    AWSMachineStatus defines the observed state of AWSMachine.

                    @@ -5163,9 +15087,7 @@ This will be set to true when SpotMarketOptions is not nil (i.e. this machine is
                    addresses
                    - -[]Cluster API api/v1alpha4.MachineAddress - +[]Cluster API api/v1beta1.MachineAddress
                    @@ -5176,7 +15098,7 @@ This will be set to true when SpotMarketOptions is not nil (i.e. this machine is instanceState
                    - + InstanceState @@ -5242,9 +15164,7 @@ controller’s output.

                    conditions
                    - -Cluster API api/v1alpha4.Conditions - +Cluster API api/v1beta1.Conditions
                    @@ -5254,10 +15174,10 @@ Cluster API api/v1alpha4.Conditions
                    -

                    AWSMachineTemplate +

                    AWSMachineTemplate

                    -

                    AWSMachineTemplate is the Schema for the awsmachinetemplates API

                    +

                    AWSMachineTemplate is the schema for the Amazon EC2 Machine Templates API.

                    @@ -5285,7 +15205,7 @@ Refer to the Kubernetes API documentation for the fields of the
                    spec
                    - + AWSMachineTemplateSpec @@ -5298,7 +15218,7 @@ AWSMachineTemplateSpec
                    template
                    - + AWSMachineTemplateResource @@ -5311,13 +15231,13 @@ AWSMachineTemplateResource
                    -

                    AWSMachineTemplateResource +

                    AWSMachineTemplateResource

                    -(Appears on:AWSMachineTemplateSpec) +(Appears on:AWSMachineTemplateSpec)

                    -

                    AWSMachineTemplateResource describes the data needed to create am AWSMachine from a template

                    +

                    AWSMachineTemplateResource describes the data needed to create am AWSMachine from a template.

                    @@ -5329,9 +15249,24 @@ AWSMachineTemplateResource + + + +
                    +metadata
                    + +Cluster API api/v1beta1.ObjectMeta + +
                    +(Optional) +

                    Standard object’s metadata. +More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata

                    +Refer to the Kubernetes API documentation for the fields of the +metadata field. +
                    spec
                    - + AWSMachineSpec @@ -5367,7 +15302,7 @@ string
                    ami
                    - + AMIReference @@ -5436,7 +15371,7 @@ string
                    additionalTags
                    - + Tags @@ -5480,7 +15415,7 @@ Precedence for this setting is as follows:
                    additionalSecurityGroups
                    - + []AWSResourceReference @@ -5510,7 +15445,7 @@ If multiple subnets are matched for the availability zone, the first one returne
                    subnet
                    - + AWSResourceReference @@ -5537,7 +15472,7 @@ string
                    rootVolume
                    - + Volume @@ -5551,7 +15486,7 @@ Volume
                    nonRootVolumes
                    - + []Volume @@ -5592,7 +15527,7 @@ user data stored in aws secret manager is always gzip-compressed.

                    cloudInit
                    - + CloudInit @@ -5607,7 +15542,7 @@ CloudInit is used.

                    spotMarketOptions
                    - + SpotMarketOptions @@ -5634,13 +15569,13 @@ string
                    -

                    AWSMachineTemplateSpec +

                    AWSMachineTemplateSpec

                    -(Appears on:AWSMachineTemplate) +(Appears on:AWSMachineTemplate)

                    -

                    AWSMachineTemplateSpec defines the desired state of AWSMachineTemplate

                    +

                    AWSMachineTemplateSpec defines the desired state of AWSMachineTemplate.

                    @@ -5654,7 +15589,7 @@ string
                    template
                    - + AWSMachineTemplateResource @@ -5664,10 +15599,10 @@ AWSMachineTemplateResource
                    -

                    AWSResourceReference +

                    AWSResourceReference

                    -(Appears on:AWSMachineSpec) +(Appears on:AWSMachineSpec)

                    AWSResourceReference is a reference to a specific AWS resource by ID, ARN, or filters. @@ -5710,7 +15645,7 @@ string filters
                    - + []Filter @@ -5724,10 +15659,10 @@ They are applied according to the rules defined by the AWS API: -

                    AWSRoleSpec +

                    AWSRoleSpec

                    -(Appears on:AWSClusterRoleIdentitySpec) +(Appears on:AWSClusterRoleIdentitySpec)

                    AWSRoleSpec defines the specifications for all identities based around AWS roles.

                    @@ -5799,26 +15734,18 @@ The policies must exist in the same account as the role.

                    -

                    AZSelectionScheme +

                    AZSelectionScheme (string alias)

                    -(Appears on:VPCSpec) +(Appears on:VPCSpec)

                    AZSelectionScheme defines the scheme of selecting AZs.

                    -

                    Actions -([]string alias)

                    -

                    -(Appears on:StatementEntry) -

                    -

                    -

                    Actions is the list of actions.

                    -

                    -

                    AllowedNamespaces +

                    AllowedNamespaces

                    -(Appears on:AWSClusterIdentitySpec) +(Appears on:AWSClusterIdentitySpec)

                    AllowedNamespaces is a selector of namespaces that AWSClusters can @@ -5863,10 +15790,10 @@ AWSClusterIdentity from any namespace.

                    -

                    Bastion +

                    Bastion

                    -(Appears on:AWSClusterSpec) +(Appears on:AWSClusterSpec)

                    Bastion defines a bastion host.

                    @@ -5946,7 +15873,7 @@ the AMI will default to one picked out in public space.

                    -

                    BuildParams +

                    BuildParams

                    BuildParams is used to build tags around an aws resource.

                    @@ -5963,7 +15890,7 @@ the AMI will default to one picked out in public space.

                    Lifecycle
                    - + ResourceLifecycle @@ -6022,7 +15949,7 @@ string Additional
                    - + Tags @@ -6034,7 +15961,7 @@ Tags -

                    CNIIngressRule +

                    CNIIngressRule

                    CNIIngressRule defines an AWS ingress rule for CNI requirements.

                    @@ -6061,7 +15988,7 @@ string protocol
                    - + SecurityGroupProtocol @@ -6091,18 +16018,18 @@ int64 -

                    CNIIngressRules -([]../../api/v1alpha4.CNIIngressRule alias)

                    +

                    CNIIngressRules +([]../../api/v1beta1.CNIIngressRule alias)

                    -(Appears on:CNISpec) +(Appears on:CNISpec)

                    -

                    CNIIngressRules is a slice of CNIIngressRule

                    +

                    CNIIngressRules is a slice of CNIIngressRule.

                    -

                    CNISpec +

                    CNISpec

                    -(Appears on:NetworkSpec) +(Appears on:NetworkSpec)

                    CNISpec defines configuration for CNI.

                    @@ -6119,7 +16046,7 @@ int64 cniIngressRules
                    - + CNIIngressRules @@ -6131,10 +16058,10 @@ The source for the rule will be set to control plane and worker security group I -

                    ClassicELB +

                    ClassicELB

                    -(Appears on:NetworkStatus) +(Appears on:NetworkStatus)

                    ClassicELB defines an AWS classic load balancer.

                    @@ -6174,7 +16101,7 @@ string scheme
                    - + ClassicELBScheme @@ -6220,7 +16147,7 @@ ClassicELBScheme listeners
                    - + []ClassicELBListener @@ -6233,7 +16160,7 @@ ClassicELBScheme healthChecks
                    - + ClassicELBHealthCheck @@ -6246,7 +16173,7 @@ ClassicELBHealthCheck attributes
                    - + ClassicELBAttributes @@ -6268,10 +16195,10 @@ map[string]string -

                    ClassicELBAttributes +

                    ClassicELBAttributes

                    -(Appears on:ClassicELB) +(Appears on:ClassicELB)

                    ClassicELBAttributes defines extra attributes associated with a classic load balancer.

                    @@ -6312,10 +16239,10 @@ bool -

                    ClassicELBHealthCheck +

                    ClassicELBHealthCheck

                    -(Appears on:ClassicELB) +(Appears on:ClassicELB)

                    ClassicELBHealthCheck defines an AWS classic load balancer health check.

                    @@ -6384,10 +16311,10 @@ int64 -

                    ClassicELBListener +

                    ClassicELBListener

                    -(Appears on:ClassicELB) +(Appears on:ClassicELB)

                    ClassicELBListener defines an AWS classic load balancer listener.

                    @@ -6404,7 +16331,7 @@ int64 protocol
                    - + ClassicELBProtocol @@ -6426,7 +16353,7 @@ int64 instanceProtocol
                    - + ClassicELBProtocol @@ -6446,26 +16373,26 @@ int64 -

                    ClassicELBProtocol +

                    ClassicELBProtocol (string alias)

                    -(Appears on:ClassicELBListener) +(Appears on:ClassicELBListener)

                    ClassicELBProtocol defines listener protocols for a classic load balancer.

                    -

                    ClassicELBScheme +

                    ClassicELBScheme (string alias)

                    -(Appears on:AWSLoadBalancerSpec, ClassicELB) +(Appears on:AWSLoadBalancerSpec, ClassicELB)

                    ClassicELBScheme defines the scheme of a classic load balancer.

                    -

                    CloudInit +

                    CloudInit

                    -(Appears on:AWSMachineSpec) +(Appears on:AWSMachineSpec)

                    CloudInit defines options related to the bootstrapping systems where @@ -6523,7 +16450,7 @@ the workload cluster.

                    secureSecretsBackend
                    - + SecretBackend @@ -6533,46 +16460,25 @@ SecretBackend

                    SecureSecretsBackend, when set to parameter-store will utilize the AWS Systems Manager Parameter Storage to distribute secrets. By default or with the value of secrets-manager, will use AWS Secrets Manager instead.

                    - - - - -

                    ConditionOperator -(string alias)

                    -

                    -

                    ConditionOperator defines an AWS condition operator.

                    -

                    -

                    Conditions -(map[../../api/v1alpha4.ConditionOperator]interface{} alias)

                    -

                    -(Appears on:StatementEntry) -

                    -

                    -

                    Conditions is the map of all conditions in the statement entry.

                    -

                    -

                    EKSAMILookupType + + + + +

                    EKSAMILookupType (string alias)

                    -(Appears on:AMIReference) +(Appears on:AMIReference)

                    EKSAMILookupType specifies which AWS AMI to use for a AWSMachine and AWSMachinePool.

                    -

                    Effect -(string alias)

                    -

                    -(Appears on:StatementEntry) -

                    -

                    -

                    Effect defines an AWS IAM effect.

                    -

                    -

                    Filter +

                    Filter

                    -(Appears on:AWSResourceReference) +(Appears on:AWSResourceReference)

                    -

                    Filter is a filter used to identify an AWS resource

                    +

                    Filter is a filter used to identify an AWS resource.

                    @@ -6606,7 +16512,7 @@ string
                    -

                    IngressRule +

                    IngressRule

                    IngressRule defines an AWS ingress rule for security groups.

                    @@ -6633,7 +16539,7 @@ string protocol
                    - + SecurityGroupProtocol @@ -6687,18 +16593,18 @@ int64 -

                    IngressRules -([]../../api/v1alpha4.IngressRule alias)

                    +

                    IngressRules +([]../../api/v1beta1.IngressRule alias)

                    -(Appears on:SecurityGroup) +(Appears on:SecurityGroup)

                    IngressRules is a slice of AWS ingress rules for security groups.

                    -

                    Instance +

                    Instance

                    -(Appears on:AWSClusterStatus) +(Appears on:AWSClusterStatus)

                    Instance describes an AWS instance.

                    @@ -6725,7 +16631,7 @@ string instanceState
                    - + InstanceState @@ -6816,9 +16722,7 @@ string addresses
                    - -[]Cluster API api/v1alpha4.MachineAddress - +[]Cluster API api/v1beta1.MachineAddress @@ -6873,7 +16777,7 @@ bool rootVolume
                    - + Volume @@ -6887,7 +16791,7 @@ Volume nonRootVolumes
                    - + []Volume @@ -6934,7 +16838,7 @@ string spotMarketOptions
                    - + SpotMarketOptions @@ -6969,18 +16873,18 @@ string -

                    InstanceState +

                    InstanceState (string alias)

                    -(Appears on:AWSMachineStatus, Instance) +(Appears on:AWSMachineStatus, Instance)

                    InstanceState describes the state of an AWS instance.

                    -

                    NetworkSpec +

                    NetworkSpec

                    -(Appears on:AWSClusterSpec) +(Appears on:AWSClusterSpec)

                    NetworkSpec encapsulates all things related to AWS network.

                    @@ -6997,7 +16901,7 @@ string vpc
                    - + VPCSpec @@ -7011,7 +16915,7 @@ VPCSpec subnets
                    - + Subnets @@ -7025,7 +16929,7 @@ Subnets cni
                    - + CNISpec @@ -7039,7 +16943,7 @@ CNISpec securityGroupOverrides
                    -map[../../api/v1alpha4.SecurityGroupRole]string +map[../../api/v1beta1.SecurityGroupRole]string @@ -7050,10 +16954,10 @@ This is optional - if not provided new security groups will be created for the c -

                    NetworkStatus +

                    NetworkStatus

                    -(Appears on:AWSClusterStatus) +(Appears on:AWSClusterStatus)

                    NetworkStatus encapsulates AWS networking resources.

                    @@ -7070,8 +16974,8 @@ This is optional - if not provided new security groups will be created for the c securityGroups
                    - -map[../../api/v1alpha4.SecurityGroupRole]../../api/v1alpha4.SecurityGroup + +map[../../api/v1beta1.SecurityGroupRole]../../api/v1beta1.SecurityGroup @@ -7083,7 +16987,7 @@ map[../../api/v1alpha4.SecurityGroupRole]../../api/v1alpha4.SecurityGroup apiServerElb
                    - + ClassicELB @@ -7094,89 +16998,15 @@ ClassicELB -

                    PolicyDocument -

                    -

                    -

                    PolicyDocument represents an AWS IAM policy document, and can be -converted into JSON using “sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/converters”.

                    -

                    - - - - - - - - - - - - - - - - - - - - - -
                    FieldDescription
                    -Version
                    - -string - -
                    -
                    -Statement
                    - - -Statements - - -
                    -
                    -Id
                    - -string - -
                    -
                    -

                    PrincipalID -([]string alias)

                    -

                    -

                    PrincipalID represents the list of all identities, such as ARNs.

                    -

                    -

                    PrincipalType -(string alias)

                    -

                    -

                    PrincipalType defines an AWS principle type.

                    -

                    -

                    Principals -(map[../../api/v1alpha4.PrincipalType]../../api/v1alpha4.PrincipalID alias)

                    -

                    -(Appears on:StatementEntry) -

                    -

                    -

                    Principals is the map of all identities a statement entry refers to.

                    -

                    -

                    ResourceLifecycle +

                    ResourceLifecycle (string alias)

                    -(Appears on:BuildParams) +(Appears on:BuildParams)

                    ResourceLifecycle configures the lifecycle of a resource.

                    -

                    Resources -([]string alias)

                    -

                    -(Appears on:StatementEntry) -

                    -

                    -

                    Resources is the list of resources.

                    -

                    -

                    RouteTable +

                    RouteTable

                    RouteTable defines an AWS routing table.

                    @@ -7201,18 +17031,18 @@ string -

                    SecretBackend +

                    SecretBackend (string alias)

                    -(Appears on:CloudInit) +(Appears on:CloudInit)

                    SecretBackend defines variants for backend secret storage.

                    -

                    SecurityGroup +

                    SecurityGroup

                    -(Appears on:NetworkStatus) +(Appears on:NetworkStatus)

                    SecurityGroup defines an AWS security group.

                    @@ -7238,195 +17068,90 @@ string -name
                    - -string - - - -

                    Name is the security group name.

                    - - - - -ingressRule
                    - - -IngressRules - - - - -(Optional) -

                    IngressRules is the inbound rules associated with the security group.

                    - - - - -tags
                    - - -Tags - - - - -

                    Tags is a map of tags associated with the security group.

                    - - - - -

                    SecurityGroupProtocol -(string alias)

                    -

                    -(Appears on:CNIIngressRule, IngressRule) -

                    -

                    -

                    SecurityGroupProtocol defines the protocol type for a security group rule.

                    -

                    -

                    SecurityGroupRole -(string alias)

                    -

                    -

                    SecurityGroupRole defines the unique role of a security group.

                    -

                    -

                    SpotMarketOptions -

                    -

                    -(Appears on:AWSMachineSpec, Instance) -

                    -

                    -

                    SpotMarketOptions defines the options available to a user when configuring -Machines to run on Spot instances. -Most users should provide an empty struct.

                    -

                    - - - - - - - - - - - - - -
                    FieldDescription
                    -maxPrice
                    - -string - -
                    -(Optional) -

                    MaxPrice defines the maximum price the user is willing to pay for Spot VM instances

                    -
                    -

                    StatementEntry -

                    -

                    -

                    StatementEntry represents each “statement” block in an AWS IAM policy document.

                    -

                    - - - - - - - - - - - - - - - - - - - - - - + +
                    FieldDescription
                    -Sid
                    - -string - -
                    -
                    -Principal
                    - - -Principals - - -
                    -
                    -NotPrincipal
                    - - -Principals - - -
                    -
                    -Effect
                    +name
                    - -Effect - +string
                    +

                    Name is the security group name.

                    -Action
                    +ingressRule
                    - -Actions + +IngressRules
                    +(Optional) +

                    IngressRules is the inbound rules associated with the security group.

                    -Resource
                    +tags
                    - -Resources + +Tags
                    +

                    Tags is a map of tags associated with the security group.

                    +

                    SecurityGroupProtocol +(string alias)

                    +

                    +(Appears on:CNIIngressRule, IngressRule) +

                    +

                    +

                    SecurityGroupProtocol defines the protocol type for a security group rule.

                    +

                    +

                    SecurityGroupRole +(string alias)

                    +

                    +

                    SecurityGroupRole defines the unique role of a security group.

                    +

                    +

                    SpotMarketOptions +

                    +

                    +(Appears on:AWSMachineSpec, Instance) +

                    +

                    +

                    SpotMarketOptions defines the options available to a user when configuring +Machines to run on Spot instances. +Most users should provide an empty struct.

                    +

                    + + + + + + + +
                    FieldDescription
                    -Condition
                    +maxPrice
                    - -Conditions - +string
                    +(Optional) +

                    MaxPrice defines the maximum price the user is willing to pay for Spot VM instances

                    -

                    Statements -([]../../api/v1alpha4.StatementEntry alias)

                    -

                    -(Appears on:PolicyDocument) -

                    -

                    -

                    Statements is the list of StatementEntries.

                    -

                    -

                    SubnetSpec +

                    SubnetSpec

                    SubnetSpec configures an AWS Subnet.

                    @@ -7513,7 +17238,7 @@ Ignored unless the subnet is managed by the provider, in which case this is set tags
                    - + Tags @@ -7524,26 +17249,26 @@ Tags -

                    Subnets -([]../../api/v1alpha4.SubnetSpec alias)

                    +

                    Subnets +([]../../api/v1beta1.SubnetSpec alias)

                    -(Appears on:NetworkSpec) +(Appears on:NetworkSpec)

                    Subnets is a slice of Subnet.

                    -

                    Tags +

                    Tags (map[string]string alias)

                    -(Appears on:AWSClusterSpec, AWSMachineSpec, BuildParams, SecurityGroup, SubnetSpec, VPCSpec) +(Appears on:AWSClusterSpec, AWSMachineSpec, BuildParams, SecurityGroup, SubnetSpec, VPCSpec)

                    Tags defines a map of tags.

                    -

                    VPCSpec +

                    VPCSpec

                    -(Appears on:NetworkSpec) +(Appears on:NetworkSpec)

                    VPCSpec configures an AWS VPC.

                    @@ -7595,7 +17320,7 @@ string tags
                    - + Tags @@ -7622,7 +17347,7 @@ default subnets. Defaults to 3

                    availabilityZoneSelection
                    - + AZSelectionScheme @@ -7637,13 +17362,13 @@ Defaults to Ordered

                    -

                    Volume +

                    Volume

                    -(Appears on:AWSMachineSpec, Instance) +(Appears on:AWSMachineSpec, Instance)

                    -

                    Volume encapsulates the configuration options for the storage device

                    +

                    Volume encapsulates the configuration options for the storage device.

                    @@ -7681,7 +17406,7 @@ Must be greater than the image snapshot size or 8 (whichever is greater).

                    type
                    - + VolumeType @@ -7743,27 +17468,27 @@ The key must already exist and be accessible by the controller.

                    -

                    VolumeType +

                    VolumeType (string alias)

                    -(Appears on:Volume) +(Appears on:Volume)

                    VolumeType describes the EBS volume type. See: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volume-types.html

                    -

                    ASGStatus +

                    ASGStatus (string alias)

                    -(Appears on:AWSMachinePoolStatus, AutoScalingGroup) +(Appears on:AWSMachinePoolStatus, AutoScalingGroup)

                    -

                    ASGStatus is a status string returned by the autoscaling API

                    +

                    ASGStatus is a status string returned by the autoscaling API.

                    -

                    AWSFargateProfile +

                    AWSFargateProfile

                    -

                    AWSFargateProfile is the Schema for the awsfargateprofiles API

                    +

                    AWSFargateProfile is the Schema for the awsfargateprofiles API.

                    @@ -7791,7 +17516,7 @@ Refer to the Kubernetes API documentation for the fields of the
                    spec
                    - + FargateProfileSpec @@ -7839,9 +17564,7 @@ auto scaling group of this nodegroup.

                    additionalTags
                    - -Cluster API AWS api/v1alpha4.Tags - +Cluster API AWS api/v1beta1.Tags
                    @@ -7869,7 +17592,7 @@ flag is true and no name is supplied then a role is created.

                    selectors
                    - + []FargateSelector @@ -7885,7 +17608,7 @@ flag is true and no name is supplied then a role is created.

                    status
                    - + FargateProfileStatus @@ -7895,13 +17618,13 @@ FargateProfileStatus
                    -

                    AWSLaunchTemplate +

                    AWSLaunchTemplate

                    -(Appears on:AWSMachinePoolSpec) +(Appears on:AWSMachinePoolSpec)

                    -

                    AWSLaunchTemplate defines the desired state of AWSLaunchTemplate

                    +

                    AWSLaunchTemplate defines the desired state of AWSLaunchTemplate.

                    @@ -7939,9 +17662,7 @@ role.

                    ami
                    - -Cluster API AWS api/v1alpha4.AMIReference - +Cluster API AWS api/v1beta1.AMIReference
                    @@ -8009,9 +17730,7 @@ string rootVolume
                    - -Cluster API AWS api/v1alpha4.Volume - +Cluster API AWS api/v1beta1.Volume
                    @@ -8051,9 +17770,7 @@ Typically a new version is created when at least one of the following happens: additionalSecurityGroups
                    - -[]Cluster API AWS api/v1alpha4.AWSResourceReference - +[]Cluster API AWS api/v1beta1.AWSResourceReference
                    @@ -8065,10 +17782,10 @@ at the cluster level or in the actuator.

                    -

                    AWSMachinePool +

                    AWSMachinePool

                    -

                    AWSMachinePool is the Schema for the awsmachinepools API

                    +

                    AWSMachinePool is the Schema for the awsmachinepools API.

                    @@ -8096,7 +17813,7 @@ Refer to the Kubernetes API documentation for the fields of the
                    spec
                    - + AWSMachinePoolSpec @@ -8154,9 +17871,7 @@ int32
                    subnets
                    - -[]Cluster API AWS api/v1alpha4.AWSResourceReference - +[]Cluster API AWS api/v1beta1.AWSResourceReference
                    @@ -8168,9 +17883,7 @@ int32 additionalTags
                    - -Cluster API AWS api/v1alpha4.Tags - +Cluster API AWS api/v1beta1.Tags
                    @@ -8183,7 +17896,7 @@ AWS provider.

                    awsLaunchTemplate
                    - + AWSLaunchTemplate @@ -8196,7 +17909,7 @@ AWSLaunchTemplate
                    mixedInstancesPolicy
                    - + MixedInstancesPolicy @@ -8237,7 +17950,7 @@ If no value is supplied by user a default value of 300 seconds is set

                    refreshPreferences
                    - + RefreshPreferences @@ -8266,7 +17979,7 @@ bool
                    status
                    - + AWSMachinePoolStatus @@ -8276,10 +17989,10 @@ AWSMachinePoolStatus
                    -

                    AWSMachinePoolInstanceStatus +

                    AWSMachinePoolInstanceStatus

                    -(Appears on:AWSMachinePoolStatus) +(Appears on:AWSMachinePoolStatus)

                    AWSMachinePoolInstanceStatus defines the status of the AWSMachinePoolInstance.

                    @@ -8318,13 +18031,13 @@ string -

                    AWSMachinePoolSpec +

                    AWSMachinePoolSpec

                    -(Appears on:AWSMachinePool) +(Appears on:AWSMachinePool)

                    -

                    AWSMachinePoolSpec defines the desired state of AWSMachinePool

                    +

                    AWSMachinePoolSpec defines the desired state of AWSMachinePool.

                    @@ -8383,9 +18096,7 @@ int32
                    subnets
                    - -[]Cluster API AWS api/v1alpha4.AWSResourceReference - +[]Cluster API AWS api/v1beta1.AWSResourceReference
                    @@ -8397,9 +18108,7 @@ int32 additionalTags
                    - -Cluster API AWS api/v1alpha4.Tags - +Cluster API AWS api/v1beta1.Tags
                    @@ -8412,7 +18121,7 @@ AWS provider.

                    awsLaunchTemplate
                    - + AWSLaunchTemplate @@ -8425,7 +18134,7 @@ AWSLaunchTemplate
                    mixedInstancesPolicy
                    - + MixedInstancesPolicy @@ -8466,7 +18175,7 @@ If no value is supplied by user a default value of 300 seconds is set

                    refreshPreferences
                    - + RefreshPreferences @@ -8490,13 +18199,13 @@ bool
                    -

                    AWSMachinePoolStatus +

                    AWSMachinePoolStatus

                    -(Appears on:AWSMachinePool) +(Appears on:AWSMachinePool)

                    -

                    AWSMachinePoolStatus defines the observed state of AWSMachinePool

                    +

                    AWSMachinePoolStatus defines the observed state of AWSMachinePool.

                    @@ -8534,9 +18243,7 @@ int32
                    conditions
                    - -Cluster API api/v1alpha4.Conditions - +Cluster API api/v1beta1.Conditions
                    @@ -8548,7 +18255,7 @@ Cluster API api/v1alpha4.Conditions instances
                    - + []AWSMachinePoolInstanceStatus @@ -8625,7 +18332,7 @@ controller’s output.

                    asgStatus
                    - + ASGStatus @@ -8635,10 +18342,10 @@ ASGStatus
                    -

                    AWSManagedMachinePool +

                    AWSManagedMachinePool

                    -

                    AWSManagedMachinePool is the Schema for the awsmanagedmachinepools API

                    +

                    AWSManagedMachinePool is the Schema for the awsmanagedmachinepools API.

                    @@ -8666,7 +18373,7 @@ Refer to the Kubernetes API documentation for the fields of the + + + +
                    spec
                    - + AWSManagedMachinePoolSpec @@ -8718,9 +18425,7 @@ auto scaling group of this nodegroup

                    additionalTags
                    - -Cluster API AWS api/v1alpha4.Tags - +Cluster API AWS api/v1beta1.Tags
                    @@ -8731,6 +18436,20 @@ ones added by default.

                    +roleAdditionalPolicies
                    + +[]string + +
                    +(Optional) +

                    RoleAdditionalPolicies allows you to attach additional polices to +the node group role. You must enable the EKSAllowAddRoles +feature flag to incorporate these into the created role.

                    +
                    roleName
                    string @@ -8762,7 +18481,7 @@ will be used

                    amiType
                    - + ManagedMachineAMIType @@ -8788,7 +18507,7 @@ map[string]string
                    taints
                    - + Taints @@ -8826,7 +18545,7 @@ string
                    scaling
                    - + ManagedMachinePoolScaling @@ -8840,7 +18559,7 @@ ManagedMachinePoolScaling
                    remoteAccess
                    - + ManagedRemoteAccess @@ -8868,7 +18587,7 @@ machine pool

                    capacityType
                    - + ManagedMachinePoolCapacityType @@ -8885,7 +18604,7 @@ ManagedMachinePoolCapacityType
                    status
                    - + AWSManagedMachinePoolStatus @@ -8895,13 +18614,13 @@ AWSManagedMachinePoolStatus
                    -

                    AWSManagedMachinePoolSpec +

                    AWSManagedMachinePoolSpec

                    -(Appears on:AWSManagedMachinePool) +(Appears on:AWSManagedMachinePool)

                    -

                    AWSManagedMachinePoolSpec defines the desired state of AWSManagedMachinePool

                    +

                    AWSManagedMachinePoolSpec defines the desired state of AWSManagedMachinePool.

                    @@ -8954,9 +18673,7 @@ auto scaling group of this nodegroup

                    + + + +
                    additionalTags
                    - -Cluster API AWS api/v1alpha4.Tags - +Cluster API AWS api/v1beta1.Tags
                    @@ -8967,6 +18684,20 @@ ones added by default.

                    +roleAdditionalPolicies
                    + +[]string + +
                    +(Optional) +

                    RoleAdditionalPolicies allows you to attach additional polices to +the node group role. You must enable the EKSAllowAddRoles +feature flag to incorporate these into the created role.

                    +
                    roleName
                    string @@ -8998,7 +18729,7 @@ will be used

                    amiType
                    - + ManagedMachineAMIType @@ -9024,7 +18755,7 @@ map[string]string
                    taints
                    - + Taints @@ -9062,7 +18793,7 @@ string
                    scaling
                    - + ManagedMachinePoolScaling @@ -9076,7 +18807,7 @@ ManagedMachinePoolScaling
                    remoteAccess
                    - + ManagedRemoteAccess @@ -9104,7 +18835,7 @@ machine pool

                    capacityType
                    - + ManagedMachinePoolCapacityType @@ -9116,13 +18847,13 @@ ManagedMachinePoolCapacityType
                    -

                    AWSManagedMachinePoolStatus +

                    AWSManagedMachinePoolStatus

                    -(Appears on:AWSManagedMachinePool) +(Appears on:AWSManagedMachinePool)

                    -

                    AWSManagedMachinePoolStatus defines the observed state of AWSManagedMachinePool

                    +

                    AWSManagedMachinePoolStatus defines the observed state of AWSManagedMachinePool.

                    @@ -9212,9 +18943,7 @@ controller’s output.

                    conditions
                    - -Cluster API api/v1alpha4.Conditions - +Cluster API api/v1beta1.Conditions
                    @@ -9224,7 +18953,7 @@ Cluster API api/v1alpha4.Conditions
                    -

                    AutoScalingGroup +

                    AutoScalingGroup

                    AutoScalingGroup describes an AWS autoscaling group.

                    @@ -9252,9 +18981,7 @@ string tags
                    - -Cluster API AWS api/v1alpha4.Tags - +Cluster API AWS api/v1beta1.Tags @@ -9346,7 +19073,7 @@ bool mixedInstancesPolicy
                    - + MixedInstancesPolicy @@ -9358,7 +19085,7 @@ MixedInstancesPolicy Status
                    - + ASGStatus @@ -9370,9 +19097,7 @@ ASGStatus instances
                    - -[]Cluster API AWS api/v1alpha4.Instance - +[]Cluster API AWS api/v1beta1.Instance @@ -9380,7 +19105,7 @@ ASGStatus -

                    BlockDeviceMapping +

                    BlockDeviceMapping

                    BlockDeviceMapping specifies the block devices for the instance. @@ -9409,7 +19134,7 @@ string ebs
                    - + EBS @@ -9421,10 +19146,10 @@ EBS -

                    EBS +

                    EBS

                    -(Appears on:BlockDeviceMapping) +(Appears on:BlockDeviceMapping)

                    EBS can be used to automatically set up EBS volumes when an instance is launched.

                    @@ -9479,13 +19204,13 @@ For more information, see Amazon EBS Volume Types (FargateProfileSpec +

                    FargateProfileSpec

                    -(Appears on:AWSFargateProfile) +(Appears on:AWSFargateProfile)

                    -

                    FargateProfileSpec defines the desired state of FargateProfile

                    +

                    FargateProfileSpec defines the desired state of FargateProfile.

                    @@ -9534,9 +19259,7 @@ auto scaling group of this nodegroup.

                    additionalTags
                    - -Cluster API AWS api/v1alpha4.Tags - +Cluster API AWS api/v1beta1.Tags
                    @@ -9564,7 +19287,7 @@ flag is true and no name is supplied then a role is created.

                    selectors
                    - + []FargateSelector @@ -9575,13 +19298,13 @@ flag is true and no name is supplied then a role is created.

                    -

                    FargateProfileStatus +

                    FargateProfileStatus

                    -(Appears on:AWSFargateProfile) +(Appears on:AWSFargateProfile)

                    -

                    FargateProfileStatus defines the observed state of FargateProfile

                    +

                    FargateProfileStatus defines the observed state of FargateProfile.

                    @@ -9658,9 +19381,7 @@ object and/or logged in the controller’s output.

                    conditions
                    - -Cluster API api/v1alpha4.Conditions - +Cluster API api/v1beta1.Conditions
                    @@ -9670,14 +19391,13 @@ Cluster API api/v1alpha4.Conditions
                    -

                    FargateSelector +

                    FargateSelector

                    -(Appears on:FargateProfileSpec) +(Appears on:FargateProfileSpec)

                    -

                    FargateSelector specifies a selector for pods that should run on this fargate -pool

                    +

                    FargateSelector specifies a selector for pods that should run on this fargate pool.

                    @@ -9711,10 +19431,10 @@ string
                    -

                    InstancesDistribution +

                    InstancesDistribution

                    -(Appears on:MixedInstancesPolicy) +(Appears on:MixedInstancesPolicy)

                    InstancesDistribution to configure distribution of On-Demand Instances and Spot Instances.

                    @@ -9731,7 +19451,7 @@ string onDemandAllocationStrategy
                    - + OnDemandAllocationStrategy @@ -9743,7 +19463,7 @@ OnDemandAllocationStrategy spotAllocationStrategy
                    - + SpotAllocationStrategy @@ -9773,10 +19493,10 @@ int64 -

                    ManagedMachineAMIType +

                    ManagedMachineAMIType (string alias)

                    -(Appears on:AWSManagedMachinePoolSpec) +(Appears on:AWSManagedMachinePoolSpec)

                    ManagedMachineAMIType specifies which AWS AMI to use for a managed MachinePool.

                    @@ -9799,10 +19519,10 @@ int64 -

                    ManagedMachinePoolCapacityType +

                    ManagedMachinePoolCapacityType (string alias)

                    -(Appears on:AWSManagedMachinePoolSpec) +(Appears on:AWSManagedMachinePoolSpec)

                    ManagedMachinePoolCapacityType specifies the capacity type to be used for the managed MachinePool.

                    @@ -9822,10 +19542,10 @@ int64 -

                    ManagedMachinePoolScaling +

                    ManagedMachinePoolScaling

                    -(Appears on:AWSManagedMachinePoolSpec) +(Appears on:AWSManagedMachinePoolSpec)

                    ManagedMachinePoolScaling specifies scaling options.

                    @@ -9860,10 +19580,10 @@ int32 -

                    ManagedRemoteAccess +

                    ManagedRemoteAccess

                    -(Appears on:AWSManagedMachinePoolSpec) +(Appears on:AWSManagedMachinePoolSpec)

                    ManagedRemoteAccess specifies remote access settings for EC2 instances.

                    @@ -9912,10 +19632,10 @@ bool -

                    MixedInstancesPolicy +

                    MixedInstancesPolicy

                    -(Appears on:AWSMachinePoolSpec, AutoScalingGroup) +(Appears on:AWSMachinePoolSpec, AutoScalingGroup)

                    MixedInstancesPolicy for an Auto Scaling group.

                    @@ -9932,7 +19652,7 @@ bool instancesDistribution
                    - + InstancesDistribution @@ -9944,7 +19664,7 @@ InstancesDistribution overrides
                    - + []Overrides @@ -9954,18 +19674,18 @@ InstancesDistribution -

                    OnDemandAllocationStrategy +

                    OnDemandAllocationStrategy (string alias)

                    -(Appears on:InstancesDistribution) +(Appears on:InstancesDistribution)

                    OnDemandAllocationStrategy indicates how to allocate instance types to fulfill On-Demand capacity.

                    -

                    Overrides +

                    Overrides

                    -(Appears on:MixedInstancesPolicy) +(Appears on:MixedInstancesPolicy)

                    Overrides are used to override the instance type specified by the launch template with multiple @@ -9991,10 +19711,10 @@ string -

                    RefreshPreferences +

                    RefreshPreferences

                    -(Appears on:AWSMachinePoolSpec) +(Appears on:AWSMachinePoolSpec)

                    RefreshPreferences defines the specs for instance refreshing.

                    @@ -10050,20 +19770,20 @@ during an instance refresh. The default is 90.

                    -

                    SpotAllocationStrategy +

                    SpotAllocationStrategy (string alias)

                    -(Appears on:InstancesDistribution) +(Appears on:InstancesDistribution)

                    SpotAllocationStrategy indicates how to allocate instances across Spot Instance pools.

                    -

                    Tags +

                    Tags (map[string]string alias)

                    Tags is a mapping for tags.

                    -

                    Taint +

                    Taint

                    Taint defines the specs for a Kubernetes taint.

                    @@ -10080,7 +19800,7 @@ during an instance refresh. The default is 90.

                    effect
                    - + TaintEffect @@ -10113,24 +19833,20 @@ string -

                    TaintEffect +

                    TaintEffect (string alias)

                    -(Appears on:Taint) +(Appears on:Taint)

                    TaintEffect is the effect for a Kubernetes taint.

                    -

                    Taints -([]../../exp/api/v1alpha4.Taint alias)

                    +

                    Taints +([]../../exp/api/v1beta1.Taint alias)

                    -(Appears on:AWSManagedMachinePoolSpec) +(Appears on:AWSManagedMachinePoolSpec)

                    Taints is an array of Taints.


                    -

                    -Generated with gen-crd-api-reference-docs -on git commit f6298212. -

                    diff --git a/exp/PROJECT b/exp/PROJECT index 8dd67fe307..1e1563155d 100644 --- a/exp/PROJECT +++ b/exp/PROJECT @@ -1,6 +1,7 @@ domain: cluster.x-k8s.io repo: sigs.k8s.io/cluster-api-provider-aws/exp resources: +# v1alpha3 types - group: infrastructure kind: AWSMachinePool version: v1alpha3 @@ -13,6 +14,7 @@ resources: - group: bootstrap kind: AWSFargateProfile version: v1alpha3 +# v1alpha4 types - group: infrastructure kind: AWSMachinePool version: v1alpha4 @@ -25,4 +27,17 @@ resources: - group: bootstrap kind: AWSFargateProfile version: v1alpha4 +# v1beta1 types +- group: infrastructure + kind: AWSMachinePool + version: v1beta1 +- group: bootstrap + kind: AWSManagedMachinePool + version: v1beta1 +- group: bootstrap + kind: AWSManagedCluster + version: v1beta1 +- group: bootstrap + kind: AWSFargateProfile + version: v1beta1 version: "2" diff --git a/exp/api/v1alpha3/awsfargateprofile_types.go b/exp/api/v1alpha3/awsfargateprofile_types.go index 5068e3a5fb..5b540f8158 100644 --- a/exp/api/v1alpha3/awsfargateprofile_types.go +++ b/exp/api/v1alpha3/awsfargateprofile_types.go @@ -21,8 +21,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + infrav1alpha3 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" + clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" "sigs.k8s.io/cluster-api/errors" ) @@ -35,7 +36,7 @@ var ( // DefaultEKSFargateRole is the name of the default IAM role to use for fargate // profiles if no other role is supplied in the spec and if iam role creation // is not enabled. The default can be created using clusterawsadm or created manually. - DefaultEKSFargateRole = fmt.Sprintf("eks-fargate%s", infrav1.DefaultNameSuffix) + DefaultEKSFargateRole = fmt.Sprintf("eks-fargate%s", iamv1.DefaultNameSuffix) ) // FargateProfileSpec defines the desired state of FargateProfile @@ -55,7 +56,7 @@ type FargateProfileSpec struct { // AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the // ones added by default. // +optional - AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` + AdditionalTags infrav1alpha3.Tags `json:"additionalTags,omitempty"` // RoleName specifies the name of IAM role for this fargate pool // If the role is pre-existing we will treat it as unmanaged @@ -124,7 +125,7 @@ type FargateProfileStatus struct { // Conditions defines current state of the Fargate profile. // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1alpha3.Conditions `json:"conditions,omitempty"` } // +kubebuilder:object:root=true @@ -144,12 +145,12 @@ type AWSFargateProfile struct { } // GetConditions returns the observations of the operational state of the AWSFargateProfile resource. -func (r *AWSFargateProfile) GetConditions() clusterv1.Conditions { +func (r *AWSFargateProfile) GetConditions() clusterv1alpha3.Conditions { return r.Status.Conditions } -// SetConditions sets the underlying service state of the AWSFargateProfile to the predescribed clusterv1.Conditions. -func (r *AWSFargateProfile) SetConditions(conditions clusterv1.Conditions) { +// SetConditions sets the underlying service state of the AWSFargateProfile to the predescribed clusterv1alpha3.Conditions. +func (r *AWSFargateProfile) SetConditions(conditions clusterv1alpha3.Conditions) { r.Status.Conditions = conditions } diff --git a/exp/api/v1alpha3/awsmachinepool_types.go b/exp/api/v1alpha3/awsmachinepool_types.go index 76bcb9c79d..4e9083fead 100644 --- a/exp/api/v1alpha3/awsmachinepool_types.go +++ b/exp/api/v1alpha3/awsmachinepool_types.go @@ -19,8 +19,8 @@ package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + infrav1alpha3 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" "sigs.k8s.io/cluster-api/errors" ) @@ -54,12 +54,12 @@ type AWSMachinePoolSpec struct { // Subnets is an array of subnet configurations // +optional - Subnets []infrav1.AWSResourceReference `json:"subnets,omitempty"` + Subnets []infrav1alpha3.AWSResourceReference `json:"subnets,omitempty"` // AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the // AWS provider. // +optional - AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` + AdditionalTags infrav1alpha3.Tags `json:"additionalTags,omitempty"` // AWSLaunchTemplate specifies the launch template and version to use when an instance is launched. // +kubebuilder:validation:Required @@ -119,7 +119,7 @@ type AWSMachinePoolStatus struct { // Conditions defines current service state of the AWSMachinePool. // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1alpha3.Conditions `json:"conditions,omitempty"` // Instances contains the status for each instance in the pool // +optional @@ -212,12 +212,12 @@ func init() { } // GetConditions returns the observations of the operational state of the AWSMachinePool resource. -func (r *AWSMachinePool) GetConditions() clusterv1.Conditions { +func (r *AWSMachinePool) GetConditions() clusterv1alpha3.Conditions { return r.Status.Conditions } -// SetConditions sets the underlying service state of the AWSMachinePool to the predescribed clusterv1.Conditions. -func (r *AWSMachinePool) SetConditions(conditions clusterv1.Conditions) { +// SetConditions sets the underlying service state of the AWSMachinePool to the predescribed clusterv1alpha3.Conditions. +func (r *AWSMachinePool) SetConditions(conditions clusterv1alpha3.Conditions) { r.Status.Conditions = conditions } diff --git a/exp/api/v1alpha3/awsmanagedcluster_types.go b/exp/api/v1alpha3/awsmanagedcluster_types.go index d569457a94..0bd0ef67f6 100644 --- a/exp/api/v1alpha3/awsmanagedcluster_types.go +++ b/exp/api/v1alpha3/awsmanagedcluster_types.go @@ -18,14 +18,14 @@ package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" ) // AWSManagedClusterSpec defines the desired state of AWSManagedCluster type AWSManagedClusterSpec struct { // ControlPlaneEndpoint represents the endpoint used to communicate with the control plane. // +optional - ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"` + ControlPlaneEndpoint clusterv1alpha3.APIEndpoint `json:"controlPlaneEndpoint"` } // AWSManagedClusterStatus defines the observed state of AWSManagedCluster @@ -36,7 +36,7 @@ type AWSManagedClusterStatus struct { // FailureDomains specifies a list fo available availability zones that can be used // +optional - FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"` + FailureDomains clusterv1alpha3.FailureDomains `json:"failureDomains,omitempty"` } // +kubebuilder:object:root=true diff --git a/exp/api/v1alpha3/awsmanagedmachinepool_types.go b/exp/api/v1alpha3/awsmanagedmachinepool_types.go index ef884ac76d..0d0dbcc4ea 100644 --- a/exp/api/v1alpha3/awsmanagedmachinepool_types.go +++ b/exp/api/v1alpha3/awsmanagedmachinepool_types.go @@ -21,8 +21,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + infrav1alpha3 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" + clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" "sigs.k8s.io/cluster-api/errors" ) @@ -47,7 +48,7 @@ var ( // DefaultEKSNodegroupRole is the name of the default IAM role to use for EKS nodegroups // if no other role is supplied in the spec and if iam role creation is not enabled. The default // can be created using clusterawsadm or created manually. - DefaultEKSNodegroupRole = fmt.Sprintf("eks-nodegroup%s", infrav1.DefaultNameSuffix) + DefaultEKSNodegroupRole = fmt.Sprintf("eks-nodegroup%s", iamv1.DefaultNameSuffix) ) // AWSManagedMachinePoolSpec defines the desired state of AWSManagedMachinePool @@ -70,7 +71,7 @@ type AWSManagedMachinePoolSpec struct { // AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the // ones added by default. // +optional - AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` + AdditionalTags infrav1alpha3.Tags `json:"additionalTags,omitempty"` // RoleName specifies the name of IAM role for the node group. // If the role is pre-existing we will treat it as unmanaged @@ -189,7 +190,7 @@ type AWSManagedMachinePoolStatus struct { // Conditions defines current service state of the managed machine pool // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1alpha3.Conditions `json:"conditions,omitempty"` } // +kubebuilder:object:root=true @@ -208,12 +209,12 @@ type AWSManagedMachinePool struct { } // GetConditions returns the observations of the operational state of the AWSManagedMachinePool resource. -func (r *AWSManagedMachinePool) GetConditions() clusterv1.Conditions { +func (r *AWSManagedMachinePool) GetConditions() clusterv1alpha3.Conditions { return r.Status.Conditions } -// SetConditions sets the underlying service state of the AWSManagedMachinePool to the predescribed clusterv1.Conditions. -func (r *AWSManagedMachinePool) SetConditions(conditions clusterv1.Conditions) { +// SetConditions sets the underlying service state of the AWSManagedMachinePool to the predescribed clusterv1alpha3.Conditions. +func (r *AWSManagedMachinePool) SetConditions(conditions clusterv1alpha3.Conditions) { r.Status.Conditions = conditions } diff --git a/exp/api/v1alpha3/conditions_consts.go b/exp/api/v1alpha3/conditions_consts.go index 45ff97da84..26a845eb97 100644 --- a/exp/api/v1alpha3/conditions_consts.go +++ b/exp/api/v1alpha3/conditions_consts.go @@ -16,11 +16,11 @@ limitations under the License. package v1alpha3 -import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" +import clusterv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" const ( // ASGReadyCondition reports on current status of the autoscaling group. Ready indicates the group is provisioned. - ASGReadyCondition clusterv1.ConditionType = "ASGReady" + ASGReadyCondition clusterv1alpha3.ConditionType = "ASGReady" // ASGNotFoundReason used when the autoscaling group couldn't be retrieved. ASGNotFoundReason = "ASGNotFound" // ASGProvisionFailedReason used for failures during autoscaling group provisioning. @@ -29,14 +29,14 @@ const ( ASGDeletionInProgress = "ASGDeletionInProgress" // LaunchTemplateReadyCondition represents the status of an AWSMachinePool's associated Launch Template. - LaunchTemplateReadyCondition clusterv1.ConditionType = "LaunchTemplateReady" + LaunchTemplateReadyCondition clusterv1alpha3.ConditionType = "LaunchTemplateReady" // LaunchTemplateNotFoundReason is used when an associated Launch Template can't be found. LaunchTemplateNotFoundReason = "LaunchTemplateNotFound" // LaunchTemplateCreateFailedReason used for failures during Launch Template creation. LaunchTemplateCreateFailedReason = "LaunchTemplateCreateFailed" // InstanceRefreshStartedCondition reports on successfully starting instance refresh. - InstanceRefreshStartedCondition clusterv1.ConditionType = "InstanceRefreshStarted" + InstanceRefreshStartedCondition clusterv1alpha3.ConditionType = "InstanceRefreshStarted" // InstanceRefreshNotReadyReason used to report instance refresh is not initiated. // If there are instance refreshes that are in progress, then a new instance refresh request will fail. InstanceRefreshNotReadyReason = "InstanceRefreshNotReady" @@ -46,7 +46,7 @@ const ( const ( // EKSNodegroupReadyCondition condition reports on the successful reconciliation of eks control plane. - EKSNodegroupReadyCondition clusterv1.ConditionType = "EKSNodegroupReady" + EKSNodegroupReadyCondition clusterv1alpha3.ConditionType = "EKSNodegroupReady" // EKSNodegroupReconciliationFailedReason used to report failures while reconciling EKS control plane. EKSNodegroupReconciliationFailedReason = "EKSNodegroupReconciliationFailed" // WaitingForEKSControlPlaneReason used when the machine pool is waiting for @@ -56,10 +56,10 @@ const ( const ( // EKSFargateProfileReadyCondition condition reports on the successful reconciliation of eks control plane. - EKSFargateProfileReadyCondition clusterv1.ConditionType = "EKSFargateProfileReady" + EKSFargateProfileReadyCondition clusterv1alpha3.ConditionType = "EKSFargateProfileReady" // EKSFargateCreatingCondition condition reports on whether the fargate // profile is creating. - EKSFargateCreatingCondition clusterv1.ConditionType = "EKSFargateCreating" + EKSFargateCreatingCondition clusterv1alpha3.ConditionType = "EKSFargateCreating" // EKSFargateDeletingCondition used to report that the profile is deleting. EKSFargateDeletingCondition = "EKSFargateDeleting" // EKSFargateReconciliationFailedReason used to report failures while reconciling EKS control plane. @@ -79,13 +79,13 @@ const ( const ( // IAMNodegroupRolesReadyCondition condition reports on the successful // reconciliation of EKS nodegroup iam roles. - IAMNodegroupRolesReadyCondition clusterv1.ConditionType = "IAMNodegroupRolesReady" + IAMNodegroupRolesReadyCondition clusterv1alpha3.ConditionType = "IAMNodegroupRolesReady" // IAMNodegroupRolesReconciliationFailedReason used to report failures while // reconciling EKS nodegroup iam roles. IAMNodegroupRolesReconciliationFailedReason = "IAMNodegroupRolesReconciliationFailed" // IAMFargateRolesReadyCondition condition reports on the successful // reconciliation of EKS nodegroup iam roles. - IAMFargateRolesReadyCondition clusterv1.ConditionType = "IAMFargateRolesReady" + IAMFargateRolesReadyCondition clusterv1alpha3.ConditionType = "IAMFargateRolesReady" // IAMFargateRolesReconciliationFailedReason used to report failures while // reconciling EKS nodegroup iam roles. IAMFargateRolesReconciliationFailedReason = "IAMFargateRolesReconciliationFailed" diff --git a/exp/api/v1alpha3/conversion.go b/exp/api/v1alpha3/conversion.go index 0562bbd5d8..ed77988ef4 100644 --- a/exp/api/v1alpha3/conversion.go +++ b/exp/api/v1alpha3/conversion.go @@ -18,25 +18,22 @@ package v1alpha3 import ( apiconversion "k8s.io/apimachinery/pkg/conversion" - clusterapiapiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" - clusterapiapiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/controller-runtime/pkg/conversion" infrav1alpha3 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" - infrav1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" - infrav1alpha4exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" ) -// ConvertTo converts the v1alpha3 AWSMachinePool receiver to a v1alpha4 AWSMachinePool. +// ConvertTo converts the v1alpha3 AWSMachinePool receiver to a v1beta1 AWSMachinePool. func (r *AWSMachinePool) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSMachinePool) - if err := Convert_v1alpha3_AWSMachinePool_To_v1alpha4_AWSMachinePool(r, dst, nil); err != nil { + dst := dstRaw.(*infrav1exp.AWSMachinePool) + if err := Convert_v1alpha3_AWSMachinePool_To_v1beta1_AWSMachinePool(r, dst, nil); err != nil { return err } // Manually restore data. - restored := &v1alpha4.AWSMachinePool{} + restored := &infrav1exp.AWSMachinePool{} if ok, err := utilconversion.UnmarshalData(r, restored); err != nil || !ok { return err } @@ -44,18 +41,18 @@ func (r *AWSMachinePool) ConvertTo(dstRaw conversion.Hub) error { infrav1alpha3.RestoreAMIReference(&restored.Spec.AWSLaunchTemplate.AMI, &dst.Spec.AWSLaunchTemplate.AMI) if restored.Spec.AWSLaunchTemplate.RootVolume != nil { if dst.Spec.AWSLaunchTemplate.RootVolume == nil { - dst.Spec.AWSLaunchTemplate.RootVolume = &infrav1alpha4.Volume{} + dst.Spec.AWSLaunchTemplate.RootVolume = &infrav1.Volume{} } infrav1alpha3.RestoreRootVolume(restored.Spec.AWSLaunchTemplate.RootVolume, dst.Spec.AWSLaunchTemplate.RootVolume) } return nil } -// ConvertFrom converts the v1alpha4 AWSMachinePool receiver to a v1alpha3 AWSMachinePool. +// ConvertFrom converts the v1beta1 AWSMachinePool receiver to a v1alpha3 AWSMachinePool. func (r *AWSMachinePool) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSMachinePool) + src := srcRaw.(*infrav1exp.AWSMachinePool) - if err := Convert_v1alpha4_AWSMachinePool_To_v1alpha3_AWSMachinePool(src, r, nil); err != nil { + if err := Convert_v1beta1_AWSMachinePool_To_v1alpha3_AWSMachinePool(src, r, nil); err != nil { return err } // Preserve Hub data on down-conversion. @@ -65,28 +62,28 @@ func (r *AWSMachinePool) ConvertFrom(srcRaw conversion.Hub) error { return nil } -// ConvertTo converts the v1alpha3 AWSMachinePoolList receiver to a v1alpha4 AWSMachinePoolList. +// ConvertTo converts the v1alpha3 AWSMachinePoolList receiver to a v1beta1 AWSMachinePoolList. func (r *AWSMachinePoolList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSMachinePoolList) + dst := dstRaw.(*infrav1exp.AWSMachinePoolList) - return Convert_v1alpha3_AWSMachinePoolList_To_v1alpha4_AWSMachinePoolList(r, dst, nil) + return Convert_v1alpha3_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList(r, dst, nil) } -// ConvertFrom converts the v1alpha4 AWSMachinePoolList receiver to a v1alpha3 AWSMachinePoolList. +// ConvertFrom converts the v1beta1 AWSMachinePoolList receiver to a v1alpha3 AWSMachinePoolList. func (r *AWSMachinePoolList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSMachinePoolList) + src := srcRaw.(*infrav1exp.AWSMachinePoolList) - return Convert_v1alpha4_AWSMachinePoolList_To_v1alpha3_AWSMachinePoolList(src, r, nil) + return Convert_v1beta1_AWSMachinePoolList_To_v1alpha3_AWSMachinePoolList(src, r, nil) } -// ConvertTo converts the v1alpha3 AWSManagedMachinePool receiver to a v1alpha4 AWSManagedMachinePool. +// ConvertTo converts the v1alpha3 AWSManagedMachinePool receiver to a v1beta1 AWSManagedMachinePool. func (r *AWSManagedMachinePool) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSManagedMachinePool) - if err := Convert_v1alpha3_AWSManagedMachinePool_To_v1alpha4_AWSManagedMachinePool(r, dst, nil); err != nil { + dst := dstRaw.(*infrav1exp.AWSManagedMachinePool) + if err := Convert_v1alpha3_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(r, dst, nil); err != nil { return err } - restored := &infrav1alpha4exp.AWSManagedMachinePool{} + restored := &infrav1exp.AWSManagedMachinePool{} if ok, err := utilconversion.UnmarshalData(r, restored); err != nil || !ok { return err } @@ -98,11 +95,11 @@ func (r *AWSManagedMachinePool) ConvertTo(dstRaw conversion.Hub) error { return nil } -// ConvertFrom converts the v1alpha4 AWSManagedMachinePool receiver to a v1alpha3 AWSManagedMachinePool. +// ConvertFrom converts the v1beta1 AWSManagedMachinePool receiver to a v1alpha3 AWSManagedMachinePool. func (r *AWSManagedMachinePool) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSManagedMachinePool) + src := srcRaw.(*infrav1exp.AWSManagedMachinePool) - if err := Convert_v1alpha4_AWSManagedMachinePool_To_v1alpha3_AWSManagedMachinePool(src, r, nil); err != nil { + if err := Convert_v1beta1_AWSManagedMachinePool_To_v1alpha3_AWSManagedMachinePool(src, r, nil); err != nil { return err } @@ -113,97 +110,88 @@ func (r *AWSManagedMachinePool) ConvertFrom(srcRaw conversion.Hub) error { return nil } -// ConvertTo converts the v1alpha3 AWSManagedMachinePoolList receiver to a v1alpha4 AWSManagedMachinePoolList. +// ConvertTo converts the v1alpha3 AWSManagedMachinePoolList receiver to a v1beta1 AWSManagedMachinePoolList. func (r *AWSManagedMachinePoolList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSManagedMachinePoolList) + dst := dstRaw.(*infrav1exp.AWSManagedMachinePoolList) - return Convert_v1alpha3_AWSManagedMachinePoolList_To_v1alpha4_AWSManagedMachinePoolList(r, dst, nil) + return Convert_v1alpha3_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList(r, dst, nil) } -// ConvertFrom converts the v1alpha4 AWSManagedMachinePoolList receiver to a v1alpha3 AWSManagedMachinePoolList. +// ConvertFrom converts the v1beta1 AWSManagedMachinePoolList receiver to a v1alpha3 AWSManagedMachinePoolList. func (r *AWSManagedMachinePoolList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSManagedMachinePoolList) + src := srcRaw.(*infrav1exp.AWSManagedMachinePoolList) - return Convert_v1alpha4_AWSManagedMachinePoolList_To_v1alpha3_AWSManagedMachinePoolList(src, r, nil) + return Convert_v1beta1_AWSManagedMachinePoolList_To_v1alpha3_AWSManagedMachinePoolList(src, r, nil) } -// ConvertTo converts the v1alpha3 AWSFargateProfile receiver to a v1alpha4 AWSFargateProfile. +// ConvertTo converts the v1alpha3 AWSFargateProfile receiver to a v1beta1 AWSFargateProfile. func (r *AWSFargateProfile) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSFargateProfile) + dst := dstRaw.(*infrav1exp.AWSFargateProfile) - return Convert_v1alpha3_AWSFargateProfile_To_v1alpha4_AWSFargateProfile(r, dst, nil) + return Convert_v1alpha3_AWSFargateProfile_To_v1beta1_AWSFargateProfile(r, dst, nil) } -// ConvertFrom converts the v1alpha4 AWSFargateProfile receiver to a v1alpha3 AWSFargateProfile. +// ConvertFrom converts the v1beta1 AWSFargateProfile receiver to a v1alpha3 AWSFargateProfile. func (r *AWSFargateProfile) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSFargateProfile) + src := srcRaw.(*infrav1exp.AWSFargateProfile) - return Convert_v1alpha4_AWSFargateProfile_To_v1alpha3_AWSFargateProfile(src, r, nil) + return Convert_v1beta1_AWSFargateProfile_To_v1alpha3_AWSFargateProfile(src, r, nil) } -// ConvertTo converts the v1alpha3 AWSFargateProfileList receiver to a v1alpha4 AWSFargateProfileList. +// ConvertTo converts the v1alpha3 AWSFargateProfileList receiver to a v1beta1 AWSFargateProfileList. func (r *AWSFargateProfileList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*v1alpha4.AWSFargateProfileList) + dst := dstRaw.(*infrav1exp.AWSFargateProfileList) - return Convert_v1alpha3_AWSFargateProfileList_To_v1alpha4_AWSFargateProfileList(r, dst, nil) + return Convert_v1alpha3_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList(r, dst, nil) } -// ConvertFrom converts the v1alpha4 AWSFargateProfileList receiver to a v1alpha3 AWSFargateProfileList. +// ConvertFrom converts the v1beta1 AWSFargateProfileList receiver to a v1alpha3 AWSFargateProfileList. func (r *AWSFargateProfileList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*v1alpha4.AWSFargateProfileList) + src := srcRaw.(*infrav1exp.AWSFargateProfileList) - return Convert_v1alpha4_AWSFargateProfileList_To_v1alpha3_AWSFargateProfileList(src, r, nil) + return Convert_v1beta1_AWSFargateProfileList_To_v1alpha3_AWSFargateProfileList(src, r, nil) } -// Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint is an autogenerated conversion function. -func Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(in *clusterapiapiv1alpha3.APIEndpoint, out *clusterapiapiv1alpha4.APIEndpoint, s apiconversion.Scope) error { - return clusterapiapiv1alpha3.Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(in, out, s) +// Convert_v1alpha3_AWSResourceReference_To_v1beta1_AWSResourceReference is a conversion function. +func Convert_v1alpha3_AWSResourceReference_To_v1beta1_AWSResourceReference(in *infrav1alpha3.AWSResourceReference, out *infrav1.AWSResourceReference, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1alpha3_AWSResourceReference_To_v1beta1_AWSResourceReference(in, out, s) } -// Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint is an autogenerated conversion function. -func Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(in *clusterapiapiv1alpha4.APIEndpoint, out *clusterapiapiv1alpha3.APIEndpoint, s apiconversion.Scope) error { - return clusterapiapiv1alpha3.Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(in, out, s) +// Convert_v1beta1_AWSResourceReference_To_v1alpha3_AWSResourceReference conversion function. +func Convert_v1beta1_AWSResourceReference_To_v1alpha3_AWSResourceReference(in *infrav1.AWSResourceReference, out *infrav1alpha3.AWSResourceReference, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1beta1_AWSResourceReference_To_v1alpha3_AWSResourceReference(in, out, s) } -// Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AWSResourceReference is an autogenerated conversion function. -func Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AWSResourceReference(in *infrav1alpha3.AWSResourceReference, out *infrav1alpha4.AWSResourceReference, s apiconversion.Scope) error { - return infrav1alpha3.Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AWSResourceReference(in, out, s) +// Convert_v1beta1_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachinePoolSpec is a conversion function. +func Convert_v1beta1_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachinePoolSpec(in *infrav1exp.AWSManagedMachinePoolSpec, out *AWSManagedMachinePoolSpec, s apiconversion.Scope) error { + return autoConvert_v1beta1_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachinePoolSpec(in, out, s) } -// Convert_v1alpha4_AWSResourceReference_To_v1alpha3_AWSResourceReference conversion function. -func Convert_v1alpha4_AWSResourceReference_To_v1alpha3_AWSResourceReference(in *infrav1alpha4.AWSResourceReference, out *infrav1alpha3.AWSResourceReference, s apiconversion.Scope) error { - return infrav1alpha3.Convert_v1alpha4_AWSResourceReference_To_v1alpha3_AWSResourceReference(in, out, s) +// Convert_v1beta1_Instance_To_v1alpha3_Instance is a conversion function. +func Convert_v1beta1_Instance_To_v1alpha3_Instance(in *infrav1.Instance, out *infrav1alpha3.Instance, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1beta1_Instance_To_v1alpha3_Instance(in, out, s) } -// Convert_v1alpha4_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachinePoolSpec is an autogenerated conversion function. -func Convert_v1alpha4_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachinePoolSpec(in *infrav1alpha4exp.AWSManagedMachinePoolSpec, out *AWSManagedMachinePoolSpec, s apiconversion.Scope) error { - return autoConvert_v1alpha4_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachinePoolSpec(in, out, s) +// Convert_v1alpha3_Instance_To_v1beta1_Instance is a conversion function. +func Convert_v1alpha3_Instance_To_v1beta1_Instance(in *infrav1alpha3.Instance, out *infrav1.Instance, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1alpha3_Instance_To_v1beta1_Instance(in, out, s) } -// Convert_v1alpha4_Instance_To_v1alpha3_Instance is an autogenerated conversion function. -func Convert_v1alpha4_Instance_To_v1alpha3_Instance(in *infrav1alpha4.Instance, out *infrav1alpha3.Instance, s apiconversion.Scope) error { - return infrav1alpha3.Convert_v1alpha4_Instance_To_v1alpha3_Instance(in, out, s) +// ConvertTo converts +func Convert_v1alpha3_AWSResourceReference_To_v1beta1_AMIReference(in *infrav1alpha3.AWSResourceReference, out *infrav1.AMIReference, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1alpha3_AWSResourceReference_To_v1beta1_AMIReference(in, out, s) } -// Convert_v1alpha3_Instance_To_v1alpha4_Instance is an autogenerated conversion function. -func Convert_v1alpha3_Instance_To_v1alpha4_Instance(in *infrav1alpha3.Instance, out *infrav1alpha4.Instance, s apiconversion.Scope) error { - return infrav1alpha3.Convert_v1alpha3_Instance_To_v1alpha4_Instance(in, out, s) +func Convert_v1beta1_AMIReference_To_v1alpha3_AWSResourceReference(in *infrav1.AMIReference, out *infrav1alpha3.AWSResourceReference, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1beta1_AMIReference_To_v1alpha3_AWSResourceReference(in, out, s) } -func Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AMIReference(in *infrav1alpha3.AWSResourceReference, out *infrav1alpha4.AMIReference, s apiconversion.Scope) error { - return infrav1alpha3.Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AMIReference(in, out, s) +// Convert_v1beta1_Volume_To_v1alpha3_Volume is a conversion function. +func Convert_v1beta1_Volume_To_v1alpha3_Volume(in *infrav1.Volume, out *infrav1alpha3.Volume, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1beta1_Volume_To_v1alpha3_Volume(in, out, s) } -func Convert_v1alpha4_AMIReference_To_v1alpha3_AWSResourceReference(in *infrav1alpha4.AMIReference, out *infrav1alpha3.AWSResourceReference, s apiconversion.Scope) error { - return infrav1alpha3.Convert_v1alpha4_AMIReference_To_v1alpha3_AWSResourceReference(in, out, s) -} - -// Convert_v1alpha4_Volume_To_v1alpha3_Volume is an autogenerated conversion function. -func Convert_v1alpha4_Volume_To_v1alpha3_Volume(in *infrav1alpha4.Volume, out *infrav1alpha3.Volume, s apiconversion.Scope) error { - return infrav1alpha3.Convert_v1alpha4_Volume_To_v1alpha3_Volume(in, out, s) -} - -// Convert_v1alpha3_Volume_To_v1alpha4_Volume is an autogenerated conversion function. -func Convert_v1alpha3_Volume_To_v1alpha4_Volume(in *infrav1alpha3.Volume, out *infrav1alpha4.Volume, s apiconversion.Scope) error { - return infrav1alpha3.Convert_v1alpha3_Volume_To_v1alpha4_Volume(in, out, s) +// Convert_v1alpha3_Volume_To_v1beta1_Volume is a conversion function. +func Convert_v1alpha3_Volume_To_v1beta1_Volume(in *infrav1alpha3.Volume, out *infrav1.Volume, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1alpha3_Volume_To_v1beta1_Volume(in, out, s) } diff --git a/exp/api/v1alpha3/conversion_test.go b/exp/api/v1alpha3/conversion_test.go index e1192611d0..3f2bda8c19 100644 --- a/exp/api/v1alpha3/conversion_test.go +++ b/exp/api/v1alpha3/conversion_test.go @@ -25,7 +25,7 @@ import ( "k8s.io/apimachinery/pkg/api/apitesting/fuzzer" runtime "k8s.io/apimachinery/pkg/runtime" runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer" - v1alpha4 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" ) @@ -38,7 +38,7 @@ func fuzzFuncs(_ runtimeserializer.CodecFactory) []interface{} { func AWSMachinePoolFuzzer(obj *AWSMachinePool, c fuzz.Continue) { c.FuzzNoCustom(obj) - // AWSMachinePool.Spec.AWSLaunchTemplate.AMI.ARN and AWSMachinePool.Spec.AWSLaunchTemplate.AMI.Filters has been removed in v1alpha4, so setting it to nil in order to avoid v1alpha3 --> v1alpha4 --> v1alpha3 round trip errors. + // AWSMachinePool.Spec.AWSLaunchTemplate.AMI.ARN and AWSMachinePool.Spec.AWSLaunchTemplate.AMI.Filters has been removed in v1beta1, so setting it to nil in order to avoid v1alpha3 --> v1beta1 --> v1alpha3 round trip errors. obj.Spec.AWSLaunchTemplate.AMI.ARN = nil obj.Spec.AWSLaunchTemplate.AMI.Filters = nil } @@ -47,24 +47,24 @@ func TestFuzzyConversion(t *testing.T) { g := NewWithT(t) scheme := runtime.NewScheme() g.Expect(AddToScheme(scheme)).To(Succeed()) - g.Expect(v1alpha4.AddToScheme(scheme)).To(Succeed()) + g.Expect(v1beta1.AddToScheme(scheme)).To(Succeed()) t.Run("for AWSMachinePool", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ Scheme: scheme, - Hub: &v1alpha4.AWSMachinePool{}, + Hub: &v1beta1.AWSMachinePool{}, Spoke: &AWSMachinePool{}, FuzzerFuncs: []fuzzer.FuzzerFuncs{fuzzFuncs}, })) t.Run("for AWSManagedMachinePool", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ Scheme: scheme, - Hub: &v1alpha4.AWSManagedMachinePool{}, + Hub: &v1beta1.AWSManagedMachinePool{}, Spoke: &AWSManagedMachinePool{}, })) t.Run("for AWSFargateProfile", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ Scheme: scheme, - Hub: &v1alpha4.AWSFargateProfile{}, + Hub: &v1beta1.AWSFargateProfile{}, Spoke: &AWSFargateProfile{}, })) } diff --git a/exp/api/v1alpha3/doc.go b/exp/api/v1alpha3/doc.go index 725979814c..83ee258d09 100644 --- a/exp/api/v1alpha3/doc.go +++ b/exp/api/v1alpha3/doc.go @@ -14,6 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4 +// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1 package v1alpha3 diff --git a/exp/api/v1alpha3/types.go b/exp/api/v1alpha3/types.go index b446f587d6..66b51a478b 100644 --- a/exp/api/v1alpha3/types.go +++ b/exp/api/v1alpha3/types.go @@ -18,7 +18,7 @@ package v1alpha3 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + infrav1alpha3 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" ) // EBS can be used to automatically set up EBS volumes when an instance is launched. @@ -65,7 +65,7 @@ type AWSLaunchTemplate struct { // AMI is the reference to the AMI from which to create the machine instance. // +optional - AMI infrav1.AWSResourceReference `json:"ami,omitempty"` + AMI infrav1alpha3.AWSResourceReference `json:"ami,omitempty"` // ImageLookupFormat is the AMI naming format to look up the image for this // machine It will be ignored if an explicit AMI is set. Supports @@ -93,7 +93,7 @@ type AWSLaunchTemplate struct { // RootVolume encapsulates the configuration options for the root volume // +optional - RootVolume *infrav1.Volume `json:"rootVolume,omitempty"` + RootVolume *infrav1alpha3.Volume `json:"rootVolume,omitempty"` // SSHKeyName is the name of the ssh key to attach to the instance. Valid values are empty string // (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name) @@ -111,7 +111,7 @@ type AWSLaunchTemplate struct { // instances. These security groups would be set in addition to any security groups defined // at the cluster level or in the actuator. // +optional - AdditionalSecurityGroups []infrav1.AWSResourceReference `json:"additionalSecurityGroups,omitempty"` + AdditionalSecurityGroups []infrav1alpha3.AWSResourceReference `json:"additionalSecurityGroups,omitempty"` } // Overrides are used to override the instance type specified by the launch template with multiple @@ -172,20 +172,20 @@ type Tags map[string]string // AutoScalingGroup describes an AWS autoscaling group. type AutoScalingGroup struct { // The tags associated with the instance. - ID string `json:"id,omitempty"` - Tags infrav1.Tags `json:"tags,omitempty"` - Name string `json:"name,omitempty"` - DesiredCapacity *int32 `json:"desiredCapacity,omitempty"` - MaxSize int32 `json:"maxSize,omitempty"` - MinSize int32 `json:"minSize,omitempty"` - PlacementGroup string `json:"placementGroup,omitempty"` - Subnets []string `json:"subnets,omitempty"` - DefaultCoolDown metav1.Duration `json:"defaultCoolDown,omitempty"` - CapacityRebalance bool `json:"capacityRebalance,omitempty"` + ID string `json:"id,omitempty"` + Tags infrav1alpha3.Tags `json:"tags,omitempty"` + Name string `json:"name,omitempty"` + DesiredCapacity *int32 `json:"desiredCapacity,omitempty"` + MaxSize int32 `json:"maxSize,omitempty"` + MinSize int32 `json:"minSize,omitempty"` + PlacementGroup string `json:"placementGroup,omitempty"` + Subnets []string `json:"subnets,omitempty"` + DefaultCoolDown metav1.Duration `json:"defaultCoolDown,omitempty"` + CapacityRebalance bool `json:"capacityRebalance,omitempty"` MixedInstancesPolicy *MixedInstancesPolicy `json:"mixedInstancesPolicy,omitempty"` Status ASGStatus - Instances []infrav1.Instance `json:"instances,omitempty"` + Instances []infrav1alpha3.Instance `json:"instances,omitempty"` } // ASGStatus is a status string returned by the autoscaling API diff --git a/exp/api/v1alpha3/webhook_suite_test.go b/exp/api/v1alpha3/webhook_suite_test.go index e343e768b8..77ff65e0b5 100644 --- a/exp/api/v1alpha3/webhook_suite_test.go +++ b/exp/api/v1alpha3/webhook_suite_test.go @@ -27,7 +27,7 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - expv1alpha4 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/test/helpers" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" @@ -60,7 +60,7 @@ func TestMain(m *testing.M) { func setup() { utilruntime.Must(AddToScheme(scheme.Scheme)) - utilruntime.Must(expv1alpha4.AddToScheme(scheme.Scheme)) + utilruntime.Must(expinfrav1.AddToScheme(scheme.Scheme)) testEnvConfig := helpers.NewTestEnvironmentConfiguration([]string{ path.Join("config", "crd", "bases"), @@ -71,13 +71,13 @@ func setup() { if err != nil { panic(err) } - if err := (&expv1alpha4.AWSMachinePool{}).SetupWebhookWithManager(testEnv); err != nil { + if err := (&expinfrav1.AWSMachinePool{}).SetupWebhookWithManager(testEnv); err != nil { panic(fmt.Sprintf("Unable to setup AWSMachinePool webhook: %v", err)) } - if err := (&expv1alpha4.AWSManagedMachinePool{}).SetupWebhookWithManager(testEnv); err != nil { + if err := (&expinfrav1.AWSManagedMachinePool{}).SetupWebhookWithManager(testEnv); err != nil { panic(fmt.Sprintf("Unable to setup AWSManagedMachinePool webhook: %v", err)) } - if err := (&expv1alpha4.AWSFargateProfile{}).SetupWebhookWithManager(testEnv); err != nil { + if err := (&expinfrav1.AWSFargateProfile{}).SetupWebhookWithManager(testEnv); err != nil { panic(fmt.Sprintf("Unable to setup AWSManagedMachinePool webhook: %v", err)) } go func() { diff --git a/exp/api/v1alpha3/zz_generated.conversion.go b/exp/api/v1alpha3/zz_generated.conversion.go index 630b5e472b..c0506299f6 100644 --- a/exp/api/v1alpha3/zz_generated.conversion.go +++ b/exp/api/v1alpha3/zz_generated.conversion.go @@ -1,4 +1,4 @@ -// +build !ignore_autogenerated +// +build !ignore_autogenerated_conversions /* Copyright The Kubernetes Authors. @@ -25,11 +25,11 @@ import ( conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" - clusterapiproviderawsapiv1alpha3 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" - clusterapiproviderawsapiv1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - v1alpha4 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" - apiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" - apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + apiv1alpha3 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + apiv1beta1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" + clusterapiapiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" + clusterapiapiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" errors "sigs.k8s.io/cluster-api/errors" ) @@ -40,357 +40,347 @@ func init() { // RegisterConversions adds conversion functions to the given scheme. // Public to allow building arbitrary schemes. func RegisterConversions(s *runtime.Scheme) error { - if err := s.AddGeneratedConversionFunc((*AWSFargateProfile)(nil), (*v1alpha4.AWSFargateProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSFargateProfile_To_v1alpha4_AWSFargateProfile(a.(*AWSFargateProfile), b.(*v1alpha4.AWSFargateProfile), scope) + if err := s.AddGeneratedConversionFunc((*AWSFargateProfile)(nil), (*v1beta1.AWSFargateProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSFargateProfile_To_v1beta1_AWSFargateProfile(a.(*AWSFargateProfile), b.(*v1beta1.AWSFargateProfile), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSFargateProfile)(nil), (*AWSFargateProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSFargateProfile_To_v1alpha3_AWSFargateProfile(a.(*v1alpha4.AWSFargateProfile), b.(*AWSFargateProfile), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSFargateProfile)(nil), (*AWSFargateProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSFargateProfile_To_v1alpha3_AWSFargateProfile(a.(*v1beta1.AWSFargateProfile), b.(*AWSFargateProfile), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSFargateProfileList)(nil), (*v1alpha4.AWSFargateProfileList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSFargateProfileList_To_v1alpha4_AWSFargateProfileList(a.(*AWSFargateProfileList), b.(*v1alpha4.AWSFargateProfileList), scope) + if err := s.AddGeneratedConversionFunc((*AWSFargateProfileList)(nil), (*v1beta1.AWSFargateProfileList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList(a.(*AWSFargateProfileList), b.(*v1beta1.AWSFargateProfileList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSFargateProfileList)(nil), (*AWSFargateProfileList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSFargateProfileList_To_v1alpha3_AWSFargateProfileList(a.(*v1alpha4.AWSFargateProfileList), b.(*AWSFargateProfileList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSFargateProfileList)(nil), (*AWSFargateProfileList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSFargateProfileList_To_v1alpha3_AWSFargateProfileList(a.(*v1beta1.AWSFargateProfileList), b.(*AWSFargateProfileList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSLaunchTemplate)(nil), (*v1alpha4.AWSLaunchTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSLaunchTemplate_To_v1alpha4_AWSLaunchTemplate(a.(*AWSLaunchTemplate), b.(*v1alpha4.AWSLaunchTemplate), scope) + if err := s.AddGeneratedConversionFunc((*AWSLaunchTemplate)(nil), (*v1beta1.AWSLaunchTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate(a.(*AWSLaunchTemplate), b.(*v1beta1.AWSLaunchTemplate), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSLaunchTemplate)(nil), (*AWSLaunchTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSLaunchTemplate_To_v1alpha3_AWSLaunchTemplate(a.(*v1alpha4.AWSLaunchTemplate), b.(*AWSLaunchTemplate), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSLaunchTemplate)(nil), (*AWSLaunchTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSLaunchTemplate_To_v1alpha3_AWSLaunchTemplate(a.(*v1beta1.AWSLaunchTemplate), b.(*AWSLaunchTemplate), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSMachinePool)(nil), (*v1alpha4.AWSMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSMachinePool_To_v1alpha4_AWSMachinePool(a.(*AWSMachinePool), b.(*v1alpha4.AWSMachinePool), scope) + if err := s.AddGeneratedConversionFunc((*AWSMachinePool)(nil), (*v1beta1.AWSMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSMachinePool_To_v1beta1_AWSMachinePool(a.(*AWSMachinePool), b.(*v1beta1.AWSMachinePool), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSMachinePool)(nil), (*AWSMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSMachinePool_To_v1alpha3_AWSMachinePool(a.(*v1alpha4.AWSMachinePool), b.(*AWSMachinePool), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachinePool)(nil), (*AWSMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachinePool_To_v1alpha3_AWSMachinePool(a.(*v1beta1.AWSMachinePool), b.(*AWSMachinePool), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSMachinePoolInstanceStatus)(nil), (*v1alpha4.AWSMachinePoolInstanceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSMachinePoolInstanceStatus_To_v1alpha4_AWSMachinePoolInstanceStatus(a.(*AWSMachinePoolInstanceStatus), b.(*v1alpha4.AWSMachinePoolInstanceStatus), scope) + if err := s.AddGeneratedConversionFunc((*AWSMachinePoolInstanceStatus)(nil), (*v1beta1.AWSMachinePoolInstanceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSMachinePoolInstanceStatus_To_v1beta1_AWSMachinePoolInstanceStatus(a.(*AWSMachinePoolInstanceStatus), b.(*v1beta1.AWSMachinePoolInstanceStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSMachinePoolInstanceStatus)(nil), (*AWSMachinePoolInstanceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSMachinePoolInstanceStatus_To_v1alpha3_AWSMachinePoolInstanceStatus(a.(*v1alpha4.AWSMachinePoolInstanceStatus), b.(*AWSMachinePoolInstanceStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachinePoolInstanceStatus)(nil), (*AWSMachinePoolInstanceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachinePoolInstanceStatus_To_v1alpha3_AWSMachinePoolInstanceStatus(a.(*v1beta1.AWSMachinePoolInstanceStatus), b.(*AWSMachinePoolInstanceStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSMachinePoolList)(nil), (*v1alpha4.AWSMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSMachinePoolList_To_v1alpha4_AWSMachinePoolList(a.(*AWSMachinePoolList), b.(*v1alpha4.AWSMachinePoolList), scope) + if err := s.AddGeneratedConversionFunc((*AWSMachinePoolList)(nil), (*v1beta1.AWSMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList(a.(*AWSMachinePoolList), b.(*v1beta1.AWSMachinePoolList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSMachinePoolList)(nil), (*AWSMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSMachinePoolList_To_v1alpha3_AWSMachinePoolList(a.(*v1alpha4.AWSMachinePoolList), b.(*AWSMachinePoolList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachinePoolList)(nil), (*AWSMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachinePoolList_To_v1alpha3_AWSMachinePoolList(a.(*v1beta1.AWSMachinePoolList), b.(*AWSMachinePoolList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSMachinePoolSpec)(nil), (*v1alpha4.AWSMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSMachinePoolSpec_To_v1alpha4_AWSMachinePoolSpec(a.(*AWSMachinePoolSpec), b.(*v1alpha4.AWSMachinePoolSpec), scope) + if err := s.AddGeneratedConversionFunc((*AWSMachinePoolSpec)(nil), (*v1beta1.AWSMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSMachinePoolSpec_To_v1beta1_AWSMachinePoolSpec(a.(*AWSMachinePoolSpec), b.(*v1beta1.AWSMachinePoolSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSMachinePoolSpec)(nil), (*AWSMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSMachinePoolSpec_To_v1alpha3_AWSMachinePoolSpec(a.(*v1alpha4.AWSMachinePoolSpec), b.(*AWSMachinePoolSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachinePoolSpec)(nil), (*AWSMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachinePoolSpec_To_v1alpha3_AWSMachinePoolSpec(a.(*v1beta1.AWSMachinePoolSpec), b.(*AWSMachinePoolSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSMachinePoolStatus)(nil), (*v1alpha4.AWSMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSMachinePoolStatus_To_v1alpha4_AWSMachinePoolStatus(a.(*AWSMachinePoolStatus), b.(*v1alpha4.AWSMachinePoolStatus), scope) + if err := s.AddGeneratedConversionFunc((*AWSMachinePoolStatus)(nil), (*v1beta1.AWSMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSMachinePoolStatus_To_v1beta1_AWSMachinePoolStatus(a.(*AWSMachinePoolStatus), b.(*v1beta1.AWSMachinePoolStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSMachinePoolStatus)(nil), (*AWSMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSMachinePoolStatus_To_v1alpha3_AWSMachinePoolStatus(a.(*v1alpha4.AWSMachinePoolStatus), b.(*AWSMachinePoolStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachinePoolStatus)(nil), (*AWSMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachinePoolStatus_To_v1alpha3_AWSMachinePoolStatus(a.(*v1beta1.AWSMachinePoolStatus), b.(*AWSMachinePoolStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSManagedMachinePool)(nil), (*v1alpha4.AWSManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSManagedMachinePool_To_v1alpha4_AWSManagedMachinePool(a.(*AWSManagedMachinePool), b.(*v1alpha4.AWSManagedMachinePool), scope) + if err := s.AddGeneratedConversionFunc((*AWSManagedMachinePool)(nil), (*v1beta1.AWSManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(a.(*AWSManagedMachinePool), b.(*v1beta1.AWSManagedMachinePool), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedMachinePool)(nil), (*AWSManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSManagedMachinePool_To_v1alpha3_AWSManagedMachinePool(a.(*v1alpha4.AWSManagedMachinePool), b.(*AWSManagedMachinePool), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSManagedMachinePool)(nil), (*AWSManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSManagedMachinePool_To_v1alpha3_AWSManagedMachinePool(a.(*v1beta1.AWSManagedMachinePool), b.(*AWSManagedMachinePool), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSManagedMachinePoolList)(nil), (*v1alpha4.AWSManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSManagedMachinePoolList_To_v1alpha4_AWSManagedMachinePoolList(a.(*AWSManagedMachinePoolList), b.(*v1alpha4.AWSManagedMachinePoolList), scope) + if err := s.AddGeneratedConversionFunc((*AWSManagedMachinePoolList)(nil), (*v1beta1.AWSManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList(a.(*AWSManagedMachinePoolList), b.(*v1beta1.AWSManagedMachinePoolList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedMachinePoolList)(nil), (*AWSManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSManagedMachinePoolList_To_v1alpha3_AWSManagedMachinePoolList(a.(*v1alpha4.AWSManagedMachinePoolList), b.(*AWSManagedMachinePoolList), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSManagedMachinePoolList)(nil), (*AWSManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSManagedMachinePoolList_To_v1alpha3_AWSManagedMachinePoolList(a.(*v1beta1.AWSManagedMachinePoolList), b.(*AWSManagedMachinePoolList), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSManagedMachinePoolSpec)(nil), (*v1alpha4.AWSManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSManagedMachinePoolSpec_To_v1alpha4_AWSManagedMachinePoolSpec(a.(*AWSManagedMachinePoolSpec), b.(*v1alpha4.AWSManagedMachinePoolSpec), scope) + if err := s.AddGeneratedConversionFunc((*AWSManagedMachinePoolSpec)(nil), (*v1beta1.AWSManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec(a.(*AWSManagedMachinePoolSpec), b.(*v1beta1.AWSManagedMachinePoolSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AWSManagedMachinePoolStatus)(nil), (*v1alpha4.AWSManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSManagedMachinePoolStatus_To_v1alpha4_AWSManagedMachinePoolStatus(a.(*AWSManagedMachinePoolStatus), b.(*v1alpha4.AWSManagedMachinePoolStatus), scope) + if err := s.AddGeneratedConversionFunc((*AWSManagedMachinePoolStatus)(nil), (*v1beta1.AWSManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus(a.(*AWSManagedMachinePoolStatus), b.(*v1beta1.AWSManagedMachinePoolStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedMachinePoolStatus)(nil), (*AWSManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSManagedMachinePoolStatus_To_v1alpha3_AWSManagedMachinePoolStatus(a.(*v1alpha4.AWSManagedMachinePoolStatus), b.(*AWSManagedMachinePoolStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSManagedMachinePoolStatus)(nil), (*AWSManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSManagedMachinePoolStatus_To_v1alpha3_AWSManagedMachinePoolStatus(a.(*v1beta1.AWSManagedMachinePoolStatus), b.(*AWSManagedMachinePoolStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*AutoScalingGroup)(nil), (*v1alpha4.AutoScalingGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AutoScalingGroup_To_v1alpha4_AutoScalingGroup(a.(*AutoScalingGroup), b.(*v1alpha4.AutoScalingGroup), scope) + if err := s.AddGeneratedConversionFunc((*AutoScalingGroup)(nil), (*v1beta1.AutoScalingGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AutoScalingGroup_To_v1beta1_AutoScalingGroup(a.(*AutoScalingGroup), b.(*v1beta1.AutoScalingGroup), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.AutoScalingGroup)(nil), (*AutoScalingGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AutoScalingGroup_To_v1alpha3_AutoScalingGroup(a.(*v1alpha4.AutoScalingGroup), b.(*AutoScalingGroup), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.AutoScalingGroup)(nil), (*AutoScalingGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AutoScalingGroup_To_v1alpha3_AutoScalingGroup(a.(*v1beta1.AutoScalingGroup), b.(*AutoScalingGroup), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*BlockDeviceMapping)(nil), (*v1alpha4.BlockDeviceMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_BlockDeviceMapping_To_v1alpha4_BlockDeviceMapping(a.(*BlockDeviceMapping), b.(*v1alpha4.BlockDeviceMapping), scope) + if err := s.AddGeneratedConversionFunc((*BlockDeviceMapping)(nil), (*v1beta1.BlockDeviceMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_BlockDeviceMapping_To_v1beta1_BlockDeviceMapping(a.(*BlockDeviceMapping), b.(*v1beta1.BlockDeviceMapping), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.BlockDeviceMapping)(nil), (*BlockDeviceMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_BlockDeviceMapping_To_v1alpha3_BlockDeviceMapping(a.(*v1alpha4.BlockDeviceMapping), b.(*BlockDeviceMapping), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.BlockDeviceMapping)(nil), (*BlockDeviceMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_BlockDeviceMapping_To_v1alpha3_BlockDeviceMapping(a.(*v1beta1.BlockDeviceMapping), b.(*BlockDeviceMapping), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*EBS)(nil), (*v1alpha4.EBS)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_EBS_To_v1alpha4_EBS(a.(*EBS), b.(*v1alpha4.EBS), scope) + if err := s.AddGeneratedConversionFunc((*EBS)(nil), (*v1beta1.EBS)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_EBS_To_v1beta1_EBS(a.(*EBS), b.(*v1beta1.EBS), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.EBS)(nil), (*EBS)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_EBS_To_v1alpha3_EBS(a.(*v1alpha4.EBS), b.(*EBS), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.EBS)(nil), (*EBS)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EBS_To_v1alpha3_EBS(a.(*v1beta1.EBS), b.(*EBS), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*FargateProfileSpec)(nil), (*v1alpha4.FargateProfileSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_FargateProfileSpec_To_v1alpha4_FargateProfileSpec(a.(*FargateProfileSpec), b.(*v1alpha4.FargateProfileSpec), scope) + if err := s.AddGeneratedConversionFunc((*FargateProfileSpec)(nil), (*v1beta1.FargateProfileSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_FargateProfileSpec_To_v1beta1_FargateProfileSpec(a.(*FargateProfileSpec), b.(*v1beta1.FargateProfileSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.FargateProfileSpec)(nil), (*FargateProfileSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_FargateProfileSpec_To_v1alpha3_FargateProfileSpec(a.(*v1alpha4.FargateProfileSpec), b.(*FargateProfileSpec), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.FargateProfileSpec)(nil), (*FargateProfileSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_FargateProfileSpec_To_v1alpha3_FargateProfileSpec(a.(*v1beta1.FargateProfileSpec), b.(*FargateProfileSpec), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*FargateProfileStatus)(nil), (*v1alpha4.FargateProfileStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_FargateProfileStatus_To_v1alpha4_FargateProfileStatus(a.(*FargateProfileStatus), b.(*v1alpha4.FargateProfileStatus), scope) + if err := s.AddGeneratedConversionFunc((*FargateProfileStatus)(nil), (*v1beta1.FargateProfileStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_FargateProfileStatus_To_v1beta1_FargateProfileStatus(a.(*FargateProfileStatus), b.(*v1beta1.FargateProfileStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.FargateProfileStatus)(nil), (*FargateProfileStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_FargateProfileStatus_To_v1alpha3_FargateProfileStatus(a.(*v1alpha4.FargateProfileStatus), b.(*FargateProfileStatus), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.FargateProfileStatus)(nil), (*FargateProfileStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_FargateProfileStatus_To_v1alpha3_FargateProfileStatus(a.(*v1beta1.FargateProfileStatus), b.(*FargateProfileStatus), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*FargateSelector)(nil), (*v1alpha4.FargateSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_FargateSelector_To_v1alpha4_FargateSelector(a.(*FargateSelector), b.(*v1alpha4.FargateSelector), scope) + if err := s.AddGeneratedConversionFunc((*FargateSelector)(nil), (*v1beta1.FargateSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_FargateSelector_To_v1beta1_FargateSelector(a.(*FargateSelector), b.(*v1beta1.FargateSelector), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.FargateSelector)(nil), (*FargateSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_FargateSelector_To_v1alpha3_FargateSelector(a.(*v1alpha4.FargateSelector), b.(*FargateSelector), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.FargateSelector)(nil), (*FargateSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_FargateSelector_To_v1alpha3_FargateSelector(a.(*v1beta1.FargateSelector), b.(*FargateSelector), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*InstancesDistribution)(nil), (*v1alpha4.InstancesDistribution)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_InstancesDistribution_To_v1alpha4_InstancesDistribution(a.(*InstancesDistribution), b.(*v1alpha4.InstancesDistribution), scope) + if err := s.AddGeneratedConversionFunc((*InstancesDistribution)(nil), (*v1beta1.InstancesDistribution)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_InstancesDistribution_To_v1beta1_InstancesDistribution(a.(*InstancesDistribution), b.(*v1beta1.InstancesDistribution), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.InstancesDistribution)(nil), (*InstancesDistribution)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_InstancesDistribution_To_v1alpha3_InstancesDistribution(a.(*v1alpha4.InstancesDistribution), b.(*InstancesDistribution), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.InstancesDistribution)(nil), (*InstancesDistribution)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_InstancesDistribution_To_v1alpha3_InstancesDistribution(a.(*v1beta1.InstancesDistribution), b.(*InstancesDistribution), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ManagedMachinePoolScaling)(nil), (*v1alpha4.ManagedMachinePoolScaling)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ManagedMachinePoolScaling_To_v1alpha4_ManagedMachinePoolScaling(a.(*ManagedMachinePoolScaling), b.(*v1alpha4.ManagedMachinePoolScaling), scope) + if err := s.AddGeneratedConversionFunc((*ManagedMachinePoolScaling)(nil), (*v1beta1.ManagedMachinePoolScaling)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ManagedMachinePoolScaling_To_v1beta1_ManagedMachinePoolScaling(a.(*ManagedMachinePoolScaling), b.(*v1beta1.ManagedMachinePoolScaling), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ManagedMachinePoolScaling)(nil), (*ManagedMachinePoolScaling)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ManagedMachinePoolScaling_To_v1alpha3_ManagedMachinePoolScaling(a.(*v1alpha4.ManagedMachinePoolScaling), b.(*ManagedMachinePoolScaling), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ManagedMachinePoolScaling)(nil), (*ManagedMachinePoolScaling)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ManagedMachinePoolScaling_To_v1alpha3_ManagedMachinePoolScaling(a.(*v1beta1.ManagedMachinePoolScaling), b.(*ManagedMachinePoolScaling), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*ManagedRemoteAccess)(nil), (*v1alpha4.ManagedRemoteAccess)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_ManagedRemoteAccess_To_v1alpha4_ManagedRemoteAccess(a.(*ManagedRemoteAccess), b.(*v1alpha4.ManagedRemoteAccess), scope) + if err := s.AddGeneratedConversionFunc((*ManagedRemoteAccess)(nil), (*v1beta1.ManagedRemoteAccess)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_ManagedRemoteAccess_To_v1beta1_ManagedRemoteAccess(a.(*ManagedRemoteAccess), b.(*v1beta1.ManagedRemoteAccess), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.ManagedRemoteAccess)(nil), (*ManagedRemoteAccess)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_ManagedRemoteAccess_To_v1alpha3_ManagedRemoteAccess(a.(*v1alpha4.ManagedRemoteAccess), b.(*ManagedRemoteAccess), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.ManagedRemoteAccess)(nil), (*ManagedRemoteAccess)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ManagedRemoteAccess_To_v1alpha3_ManagedRemoteAccess(a.(*v1beta1.ManagedRemoteAccess), b.(*ManagedRemoteAccess), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*MixedInstancesPolicy)(nil), (*v1alpha4.MixedInstancesPolicy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_MixedInstancesPolicy_To_v1alpha4_MixedInstancesPolicy(a.(*MixedInstancesPolicy), b.(*v1alpha4.MixedInstancesPolicy), scope) + if err := s.AddGeneratedConversionFunc((*MixedInstancesPolicy)(nil), (*v1beta1.MixedInstancesPolicy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_MixedInstancesPolicy_To_v1beta1_MixedInstancesPolicy(a.(*MixedInstancesPolicy), b.(*v1beta1.MixedInstancesPolicy), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.MixedInstancesPolicy)(nil), (*MixedInstancesPolicy)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_MixedInstancesPolicy_To_v1alpha3_MixedInstancesPolicy(a.(*v1alpha4.MixedInstancesPolicy), b.(*MixedInstancesPolicy), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.MixedInstancesPolicy)(nil), (*MixedInstancesPolicy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MixedInstancesPolicy_To_v1alpha3_MixedInstancesPolicy(a.(*v1beta1.MixedInstancesPolicy), b.(*MixedInstancesPolicy), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*Overrides)(nil), (*v1alpha4.Overrides)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Overrides_To_v1alpha4_Overrides(a.(*Overrides), b.(*v1alpha4.Overrides), scope) + if err := s.AddGeneratedConversionFunc((*Overrides)(nil), (*v1beta1.Overrides)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Overrides_To_v1beta1_Overrides(a.(*Overrides), b.(*v1beta1.Overrides), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.Overrides)(nil), (*Overrides)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Overrides_To_v1alpha3_Overrides(a.(*v1alpha4.Overrides), b.(*Overrides), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.Overrides)(nil), (*Overrides)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Overrides_To_v1alpha3_Overrides(a.(*v1beta1.Overrides), b.(*Overrides), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*RefreshPreferences)(nil), (*v1alpha4.RefreshPreferences)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_RefreshPreferences_To_v1alpha4_RefreshPreferences(a.(*RefreshPreferences), b.(*v1alpha4.RefreshPreferences), scope) + if err := s.AddGeneratedConversionFunc((*RefreshPreferences)(nil), (*v1beta1.RefreshPreferences)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_RefreshPreferences_To_v1beta1_RefreshPreferences(a.(*RefreshPreferences), b.(*v1beta1.RefreshPreferences), scope) }); err != nil { return err } - if err := s.AddGeneratedConversionFunc((*v1alpha4.RefreshPreferences)(nil), (*RefreshPreferences)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_RefreshPreferences_To_v1alpha3_RefreshPreferences(a.(*v1alpha4.RefreshPreferences), b.(*RefreshPreferences), scope) + if err := s.AddGeneratedConversionFunc((*v1beta1.RefreshPreferences)(nil), (*RefreshPreferences)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_RefreshPreferences_To_v1alpha3_RefreshPreferences(a.(*v1beta1.RefreshPreferences), b.(*RefreshPreferences), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*apiv1alpha3.APIEndpoint)(nil), (*apiv1alpha4.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(a.(*apiv1alpha3.APIEndpoint), b.(*apiv1alpha4.APIEndpoint), scope) + if err := s.AddConversionFunc((*apiv1alpha3.AWSResourceReference)(nil), (*apiv1beta1.AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSResourceReference_To_v1beta1_AWSResourceReference(a.(*apiv1alpha3.AWSResourceReference), b.(*apiv1beta1.AWSResourceReference), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha3.AWSResourceReference)(nil), (*clusterapiproviderawsapiv1alpha4.AMIReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AMIReference(a.(*clusterapiproviderawsapiv1alpha3.AWSResourceReference), b.(*clusterapiproviderawsapiv1alpha4.AMIReference), scope) + if err := s.AddConversionFunc((*apiv1alpha3.Instance)(nil), (*apiv1beta1.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Instance_To_v1beta1_Instance(a.(*apiv1alpha3.Instance), b.(*apiv1beta1.Instance), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha3.AWSResourceReference)(nil), (*clusterapiproviderawsapiv1alpha4.AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AWSResourceReference(a.(*clusterapiproviderawsapiv1alpha3.AWSResourceReference), b.(*clusterapiproviderawsapiv1alpha4.AWSResourceReference), scope) + if err := s.AddConversionFunc((*apiv1alpha3.Volume)(nil), (*apiv1beta1.Volume)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Volume_To_v1beta1_Volume(a.(*apiv1alpha3.Volume), b.(*apiv1beta1.Volume), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha3.Instance)(nil), (*clusterapiproviderawsapiv1alpha4.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Instance_To_v1alpha4_Instance(a.(*clusterapiproviderawsapiv1alpha3.Instance), b.(*clusterapiproviderawsapiv1alpha4.Instance), scope) + if err := s.AddConversionFunc((*v1beta1.AWSManagedMachinePoolSpec)(nil), (*AWSManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachinePoolSpec(a.(*v1beta1.AWSManagedMachinePoolSpec), b.(*AWSManagedMachinePoolSpec), scope) }); err != nil { return err } - if err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha3.Volume)(nil), (*clusterapiproviderawsapiv1alpha4.Volume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha3_Volume_To_v1alpha4_Volume(a.(*clusterapiproviderawsapiv1alpha3.Volume), b.(*clusterapiproviderawsapiv1alpha4.Volume), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha4.AMIReference)(nil), (*clusterapiproviderawsapiv1alpha3.AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AMIReference_To_v1alpha3_AWSResourceReference(a.(*clusterapiproviderawsapiv1alpha4.AMIReference), b.(*clusterapiproviderawsapiv1alpha3.AWSResourceReference), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*apiv1alpha4.APIEndpoint)(nil), (*apiv1alpha3.APIEndpoint)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(a.(*apiv1alpha4.APIEndpoint), b.(*apiv1alpha3.APIEndpoint), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*v1alpha4.AWSManagedMachinePoolSpec)(nil), (*AWSManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachinePoolSpec(a.(*v1alpha4.AWSManagedMachinePoolSpec), b.(*AWSManagedMachinePoolSpec), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha4.AWSResourceReference)(nil), (*clusterapiproviderawsapiv1alpha3.AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_AWSResourceReference_To_v1alpha3_AWSResourceReference(a.(*clusterapiproviderawsapiv1alpha4.AWSResourceReference), b.(*clusterapiproviderawsapiv1alpha3.AWSResourceReference), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha4.Instance)(nil), (*clusterapiproviderawsapiv1alpha3.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Instance_To_v1alpha3_Instance(a.(*clusterapiproviderawsapiv1alpha4.Instance), b.(*clusterapiproviderawsapiv1alpha3.Instance), scope) - }); err != nil { - return err - } - if err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha4.Volume)(nil), (*clusterapiproviderawsapiv1alpha3.Volume)(nil), func(a, b interface{}, scope conversion.Scope) error { - return Convert_v1alpha4_Volume_To_v1alpha3_Volume(a.(*clusterapiproviderawsapiv1alpha4.Volume), b.(*clusterapiproviderawsapiv1alpha3.Volume), scope) + if err := s.AddConversionFunc((*apiv1beta1.AWSResourceReference)(nil), (*apiv1alpha3.AWSResourceReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSResourceReference_To_v1alpha3_AWSResourceReference(a.(*apiv1beta1.AWSResourceReference), b.(*apiv1alpha3.AWSResourceReference), scope) }); err != nil { return err } return nil } -func autoConvert_v1alpha3_AWSFargateProfile_To_v1alpha4_AWSFargateProfile(in *AWSFargateProfile, out *v1alpha4.AWSFargateProfile, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSFargateProfile_To_v1beta1_AWSFargateProfile(in *AWSFargateProfile, out *v1beta1.AWSFargateProfile, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_FargateProfileSpec_To_v1alpha4_FargateProfileSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_FargateProfileSpec_To_v1beta1_FargateProfileSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha3_FargateProfileStatus_To_v1alpha4_FargateProfileStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_FargateProfileStatus_To_v1beta1_FargateProfileStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha3_AWSFargateProfile_To_v1alpha4_AWSFargateProfile is an autogenerated conversion function. -func Convert_v1alpha3_AWSFargateProfile_To_v1alpha4_AWSFargateProfile(in *AWSFargateProfile, out *v1alpha4.AWSFargateProfile, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSFargateProfile_To_v1alpha4_AWSFargateProfile(in, out, s) +// Convert_v1alpha3_AWSFargateProfile_To_v1beta1_AWSFargateProfile is an autogenerated conversion function. +func Convert_v1alpha3_AWSFargateProfile_To_v1beta1_AWSFargateProfile(in *AWSFargateProfile, out *v1beta1.AWSFargateProfile, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSFargateProfile_To_v1beta1_AWSFargateProfile(in, out, s) } -func autoConvert_v1alpha4_AWSFargateProfile_To_v1alpha3_AWSFargateProfile(in *v1alpha4.AWSFargateProfile, out *AWSFargateProfile, s conversion.Scope) error { +func autoConvert_v1beta1_AWSFargateProfile_To_v1alpha3_AWSFargateProfile(in *v1beta1.AWSFargateProfile, out *AWSFargateProfile, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_FargateProfileSpec_To_v1alpha3_FargateProfileSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_FargateProfileSpec_To_v1alpha3_FargateProfileSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha4_FargateProfileStatus_To_v1alpha3_FargateProfileStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_FargateProfileStatus_To_v1alpha3_FargateProfileStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha4_AWSFargateProfile_To_v1alpha3_AWSFargateProfile is an autogenerated conversion function. -func Convert_v1alpha4_AWSFargateProfile_To_v1alpha3_AWSFargateProfile(in *v1alpha4.AWSFargateProfile, out *AWSFargateProfile, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSFargateProfile_To_v1alpha3_AWSFargateProfile(in, out, s) +// Convert_v1beta1_AWSFargateProfile_To_v1alpha3_AWSFargateProfile is an autogenerated conversion function. +func Convert_v1beta1_AWSFargateProfile_To_v1alpha3_AWSFargateProfile(in *v1beta1.AWSFargateProfile, out *AWSFargateProfile, s conversion.Scope) error { + return autoConvert_v1beta1_AWSFargateProfile_To_v1alpha3_AWSFargateProfile(in, out, s) } -func autoConvert_v1alpha3_AWSFargateProfileList_To_v1alpha4_AWSFargateProfileList(in *AWSFargateProfileList, out *v1alpha4.AWSFargateProfileList, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList(in *AWSFargateProfileList, out *v1beta1.AWSFargateProfileList, s conversion.Scope) error { out.ListMeta = in.ListMeta - out.Items = *(*[]v1alpha4.AWSFargateProfile)(unsafe.Pointer(&in.Items)) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta1.AWSFargateProfile, len(*in)) + for i := range *in { + if err := Convert_v1alpha3_AWSFargateProfile_To_v1beta1_AWSFargateProfile(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } return nil } -// Convert_v1alpha3_AWSFargateProfileList_To_v1alpha4_AWSFargateProfileList is an autogenerated conversion function. -func Convert_v1alpha3_AWSFargateProfileList_To_v1alpha4_AWSFargateProfileList(in *AWSFargateProfileList, out *v1alpha4.AWSFargateProfileList, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSFargateProfileList_To_v1alpha4_AWSFargateProfileList(in, out, s) +// Convert_v1alpha3_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList is an autogenerated conversion function. +func Convert_v1alpha3_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList(in *AWSFargateProfileList, out *v1beta1.AWSFargateProfileList, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList(in, out, s) } -func autoConvert_v1alpha4_AWSFargateProfileList_To_v1alpha3_AWSFargateProfileList(in *v1alpha4.AWSFargateProfileList, out *AWSFargateProfileList, s conversion.Scope) error { +func autoConvert_v1beta1_AWSFargateProfileList_To_v1alpha3_AWSFargateProfileList(in *v1beta1.AWSFargateProfileList, out *AWSFargateProfileList, s conversion.Scope) error { out.ListMeta = in.ListMeta - out.Items = *(*[]AWSFargateProfile)(unsafe.Pointer(&in.Items)) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSFargateProfile, len(*in)) + for i := range *in { + if err := Convert_v1beta1_AWSFargateProfile_To_v1alpha3_AWSFargateProfile(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } return nil } -// Convert_v1alpha4_AWSFargateProfileList_To_v1alpha3_AWSFargateProfileList is an autogenerated conversion function. -func Convert_v1alpha4_AWSFargateProfileList_To_v1alpha3_AWSFargateProfileList(in *v1alpha4.AWSFargateProfileList, out *AWSFargateProfileList, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSFargateProfileList_To_v1alpha3_AWSFargateProfileList(in, out, s) +// Convert_v1beta1_AWSFargateProfileList_To_v1alpha3_AWSFargateProfileList is an autogenerated conversion function. +func Convert_v1beta1_AWSFargateProfileList_To_v1alpha3_AWSFargateProfileList(in *v1beta1.AWSFargateProfileList, out *AWSFargateProfileList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSFargateProfileList_To_v1alpha3_AWSFargateProfileList(in, out, s) } -func autoConvert_v1alpha3_AWSLaunchTemplate_To_v1alpha4_AWSLaunchTemplate(in *AWSLaunchTemplate, out *v1alpha4.AWSLaunchTemplate, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate(in *AWSLaunchTemplate, out *v1beta1.AWSLaunchTemplate, s conversion.Scope) error { out.Name = in.Name out.IamInstanceProfile = in.IamInstanceProfile - if err := Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AMIReference(&in.AMI, &out.AMI, s); err != nil { + if err := apiv1alpha3.Convert_v1alpha3_AWSResourceReference_To_v1beta1_AMIReference(&in.AMI, &out.AMI, s); err != nil { return err } out.ImageLookupFormat = in.ImageLookupFormat @@ -399,8 +389,8 @@ func autoConvert_v1alpha3_AWSLaunchTemplate_To_v1alpha4_AWSLaunchTemplate(in *AW out.InstanceType = in.InstanceType if in.RootVolume != nil { in, out := &in.RootVolume, &out.RootVolume - *out = new(clusterapiproviderawsapiv1alpha4.Volume) - if err := Convert_v1alpha3_Volume_To_v1alpha4_Volume(*in, *out, s); err != nil { + *out = new(apiv1beta1.Volume) + if err := Convert_v1alpha3_Volume_To_v1beta1_Volume(*in, *out, s); err != nil { return err } } else { @@ -410,9 +400,9 @@ func autoConvert_v1alpha3_AWSLaunchTemplate_To_v1alpha4_AWSLaunchTemplate(in *AW out.VersionNumber = (*int64)(unsafe.Pointer(in.VersionNumber)) if in.AdditionalSecurityGroups != nil { in, out := &in.AdditionalSecurityGroups, &out.AdditionalSecurityGroups - *out = make([]clusterapiproviderawsapiv1alpha4.AWSResourceReference, len(*in)) + *out = make([]apiv1beta1.AWSResourceReference, len(*in)) for i := range *in { - if err := Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AWSResourceReference(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_AWSResourceReference_To_v1beta1_AWSResourceReference(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -422,15 +412,15 @@ func autoConvert_v1alpha3_AWSLaunchTemplate_To_v1alpha4_AWSLaunchTemplate(in *AW return nil } -// Convert_v1alpha3_AWSLaunchTemplate_To_v1alpha4_AWSLaunchTemplate is an autogenerated conversion function. -func Convert_v1alpha3_AWSLaunchTemplate_To_v1alpha4_AWSLaunchTemplate(in *AWSLaunchTemplate, out *v1alpha4.AWSLaunchTemplate, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSLaunchTemplate_To_v1alpha4_AWSLaunchTemplate(in, out, s) +// Convert_v1alpha3_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate is an autogenerated conversion function. +func Convert_v1alpha3_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate(in *AWSLaunchTemplate, out *v1beta1.AWSLaunchTemplate, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate(in, out, s) } -func autoConvert_v1alpha4_AWSLaunchTemplate_To_v1alpha3_AWSLaunchTemplate(in *v1alpha4.AWSLaunchTemplate, out *AWSLaunchTemplate, s conversion.Scope) error { +func autoConvert_v1beta1_AWSLaunchTemplate_To_v1alpha3_AWSLaunchTemplate(in *v1beta1.AWSLaunchTemplate, out *AWSLaunchTemplate, s conversion.Scope) error { out.Name = in.Name out.IamInstanceProfile = in.IamInstanceProfile - if err := Convert_v1alpha4_AMIReference_To_v1alpha3_AWSResourceReference(&in.AMI, &out.AMI, s); err != nil { + if err := apiv1alpha3.Convert_v1beta1_AMIReference_To_v1alpha3_AWSResourceReference(&in.AMI, &out.AMI, s); err != nil { return err } out.ImageLookupFormat = in.ImageLookupFormat @@ -439,8 +429,8 @@ func autoConvert_v1alpha4_AWSLaunchTemplate_To_v1alpha3_AWSLaunchTemplate(in *v1 out.InstanceType = in.InstanceType if in.RootVolume != nil { in, out := &in.RootVolume, &out.RootVolume - *out = new(clusterapiproviderawsapiv1alpha3.Volume) - if err := Convert_v1alpha4_Volume_To_v1alpha3_Volume(*in, *out, s); err != nil { + *out = new(apiv1alpha3.Volume) + if err := apiv1alpha3.Convert_v1beta1_Volume_To_v1alpha3_Volume(*in, *out, s); err != nil { return err } } else { @@ -450,9 +440,9 @@ func autoConvert_v1alpha4_AWSLaunchTemplate_To_v1alpha3_AWSLaunchTemplate(in *v1 out.VersionNumber = (*int64)(unsafe.Pointer(in.VersionNumber)) if in.AdditionalSecurityGroups != nil { in, out := &in.AdditionalSecurityGroups, &out.AdditionalSecurityGroups - *out = make([]clusterapiproviderawsapiv1alpha3.AWSResourceReference, len(*in)) + *out = make([]apiv1alpha3.AWSResourceReference, len(*in)) for i := range *in { - if err := Convert_v1alpha4_AWSResourceReference_To_v1alpha3_AWSResourceReference(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_AWSResourceReference_To_v1alpha3_AWSResourceReference(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -462,72 +452,72 @@ func autoConvert_v1alpha4_AWSLaunchTemplate_To_v1alpha3_AWSLaunchTemplate(in *v1 return nil } -// Convert_v1alpha4_AWSLaunchTemplate_To_v1alpha3_AWSLaunchTemplate is an autogenerated conversion function. -func Convert_v1alpha4_AWSLaunchTemplate_To_v1alpha3_AWSLaunchTemplate(in *v1alpha4.AWSLaunchTemplate, out *AWSLaunchTemplate, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSLaunchTemplate_To_v1alpha3_AWSLaunchTemplate(in, out, s) +// Convert_v1beta1_AWSLaunchTemplate_To_v1alpha3_AWSLaunchTemplate is an autogenerated conversion function. +func Convert_v1beta1_AWSLaunchTemplate_To_v1alpha3_AWSLaunchTemplate(in *v1beta1.AWSLaunchTemplate, out *AWSLaunchTemplate, s conversion.Scope) error { + return autoConvert_v1beta1_AWSLaunchTemplate_To_v1alpha3_AWSLaunchTemplate(in, out, s) } -func autoConvert_v1alpha3_AWSMachinePool_To_v1alpha4_AWSMachinePool(in *AWSMachinePool, out *v1alpha4.AWSMachinePool, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSMachinePool_To_v1beta1_AWSMachinePool(in *AWSMachinePool, out *v1beta1.AWSMachinePool, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_AWSMachinePoolSpec_To_v1alpha4_AWSMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_AWSMachinePoolSpec_To_v1beta1_AWSMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha3_AWSMachinePoolStatus_To_v1alpha4_AWSMachinePoolStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_AWSMachinePoolStatus_To_v1beta1_AWSMachinePoolStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha3_AWSMachinePool_To_v1alpha4_AWSMachinePool is an autogenerated conversion function. -func Convert_v1alpha3_AWSMachinePool_To_v1alpha4_AWSMachinePool(in *AWSMachinePool, out *v1alpha4.AWSMachinePool, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSMachinePool_To_v1alpha4_AWSMachinePool(in, out, s) +// Convert_v1alpha3_AWSMachinePool_To_v1beta1_AWSMachinePool is an autogenerated conversion function. +func Convert_v1alpha3_AWSMachinePool_To_v1beta1_AWSMachinePool(in *AWSMachinePool, out *v1beta1.AWSMachinePool, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSMachinePool_To_v1beta1_AWSMachinePool(in, out, s) } -func autoConvert_v1alpha4_AWSMachinePool_To_v1alpha3_AWSMachinePool(in *v1alpha4.AWSMachinePool, out *AWSMachinePool, s conversion.Scope) error { +func autoConvert_v1beta1_AWSMachinePool_To_v1alpha3_AWSMachinePool(in *v1beta1.AWSMachinePool, out *AWSMachinePool, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_AWSMachinePoolSpec_To_v1alpha3_AWSMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_AWSMachinePoolSpec_To_v1alpha3_AWSMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha4_AWSMachinePoolStatus_To_v1alpha3_AWSMachinePoolStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_AWSMachinePoolStatus_To_v1alpha3_AWSMachinePoolStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha4_AWSMachinePool_To_v1alpha3_AWSMachinePool is an autogenerated conversion function. -func Convert_v1alpha4_AWSMachinePool_To_v1alpha3_AWSMachinePool(in *v1alpha4.AWSMachinePool, out *AWSMachinePool, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSMachinePool_To_v1alpha3_AWSMachinePool(in, out, s) +// Convert_v1beta1_AWSMachinePool_To_v1alpha3_AWSMachinePool is an autogenerated conversion function. +func Convert_v1beta1_AWSMachinePool_To_v1alpha3_AWSMachinePool(in *v1beta1.AWSMachinePool, out *AWSMachinePool, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachinePool_To_v1alpha3_AWSMachinePool(in, out, s) } -func autoConvert_v1alpha3_AWSMachinePoolInstanceStatus_To_v1alpha4_AWSMachinePoolInstanceStatus(in *AWSMachinePoolInstanceStatus, out *v1alpha4.AWSMachinePoolInstanceStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSMachinePoolInstanceStatus_To_v1beta1_AWSMachinePoolInstanceStatus(in *AWSMachinePoolInstanceStatus, out *v1beta1.AWSMachinePoolInstanceStatus, s conversion.Scope) error { out.InstanceID = in.InstanceID out.Version = (*string)(unsafe.Pointer(in.Version)) return nil } -// Convert_v1alpha3_AWSMachinePoolInstanceStatus_To_v1alpha4_AWSMachinePoolInstanceStatus is an autogenerated conversion function. -func Convert_v1alpha3_AWSMachinePoolInstanceStatus_To_v1alpha4_AWSMachinePoolInstanceStatus(in *AWSMachinePoolInstanceStatus, out *v1alpha4.AWSMachinePoolInstanceStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSMachinePoolInstanceStatus_To_v1alpha4_AWSMachinePoolInstanceStatus(in, out, s) +// Convert_v1alpha3_AWSMachinePoolInstanceStatus_To_v1beta1_AWSMachinePoolInstanceStatus is an autogenerated conversion function. +func Convert_v1alpha3_AWSMachinePoolInstanceStatus_To_v1beta1_AWSMachinePoolInstanceStatus(in *AWSMachinePoolInstanceStatus, out *v1beta1.AWSMachinePoolInstanceStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSMachinePoolInstanceStatus_To_v1beta1_AWSMachinePoolInstanceStatus(in, out, s) } -func autoConvert_v1alpha4_AWSMachinePoolInstanceStatus_To_v1alpha3_AWSMachinePoolInstanceStatus(in *v1alpha4.AWSMachinePoolInstanceStatus, out *AWSMachinePoolInstanceStatus, s conversion.Scope) error { +func autoConvert_v1beta1_AWSMachinePoolInstanceStatus_To_v1alpha3_AWSMachinePoolInstanceStatus(in *v1beta1.AWSMachinePoolInstanceStatus, out *AWSMachinePoolInstanceStatus, s conversion.Scope) error { out.InstanceID = in.InstanceID out.Version = (*string)(unsafe.Pointer(in.Version)) return nil } -// Convert_v1alpha4_AWSMachinePoolInstanceStatus_To_v1alpha3_AWSMachinePoolInstanceStatus is an autogenerated conversion function. -func Convert_v1alpha4_AWSMachinePoolInstanceStatus_To_v1alpha3_AWSMachinePoolInstanceStatus(in *v1alpha4.AWSMachinePoolInstanceStatus, out *AWSMachinePoolInstanceStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSMachinePoolInstanceStatus_To_v1alpha3_AWSMachinePoolInstanceStatus(in, out, s) +// Convert_v1beta1_AWSMachinePoolInstanceStatus_To_v1alpha3_AWSMachinePoolInstanceStatus is an autogenerated conversion function. +func Convert_v1beta1_AWSMachinePoolInstanceStatus_To_v1alpha3_AWSMachinePoolInstanceStatus(in *v1beta1.AWSMachinePoolInstanceStatus, out *AWSMachinePoolInstanceStatus, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachinePoolInstanceStatus_To_v1alpha3_AWSMachinePoolInstanceStatus(in, out, s) } -func autoConvert_v1alpha3_AWSMachinePoolList_To_v1alpha4_AWSMachinePoolList(in *AWSMachinePoolList, out *v1alpha4.AWSMachinePoolList, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList(in *AWSMachinePoolList, out *v1beta1.AWSMachinePoolList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha4.AWSMachinePool, len(*in)) + *out = make([]v1beta1.AWSMachinePool, len(*in)) for i := range *in { - if err := Convert_v1alpha3_AWSMachinePool_To_v1alpha4_AWSMachinePool(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_AWSMachinePool_To_v1beta1_AWSMachinePool(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -537,18 +527,18 @@ func autoConvert_v1alpha3_AWSMachinePoolList_To_v1alpha4_AWSMachinePoolList(in * return nil } -// Convert_v1alpha3_AWSMachinePoolList_To_v1alpha4_AWSMachinePoolList is an autogenerated conversion function. -func Convert_v1alpha3_AWSMachinePoolList_To_v1alpha4_AWSMachinePoolList(in *AWSMachinePoolList, out *v1alpha4.AWSMachinePoolList, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSMachinePoolList_To_v1alpha4_AWSMachinePoolList(in, out, s) +// Convert_v1alpha3_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList is an autogenerated conversion function. +func Convert_v1alpha3_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList(in *AWSMachinePoolList, out *v1beta1.AWSMachinePoolList, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList(in, out, s) } -func autoConvert_v1alpha4_AWSMachinePoolList_To_v1alpha3_AWSMachinePoolList(in *v1alpha4.AWSMachinePoolList, out *AWSMachinePoolList, s conversion.Scope) error { +func autoConvert_v1beta1_AWSMachinePoolList_To_v1alpha3_AWSMachinePoolList(in *v1beta1.AWSMachinePoolList, out *AWSMachinePoolList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]AWSMachinePool, len(*in)) for i := range *in { - if err := Convert_v1alpha4_AWSMachinePool_To_v1alpha3_AWSMachinePool(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_AWSMachinePool_To_v1alpha3_AWSMachinePool(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -558,62 +548,62 @@ func autoConvert_v1alpha4_AWSMachinePoolList_To_v1alpha3_AWSMachinePoolList(in * return nil } -// Convert_v1alpha4_AWSMachinePoolList_To_v1alpha3_AWSMachinePoolList is an autogenerated conversion function. -func Convert_v1alpha4_AWSMachinePoolList_To_v1alpha3_AWSMachinePoolList(in *v1alpha4.AWSMachinePoolList, out *AWSMachinePoolList, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSMachinePoolList_To_v1alpha3_AWSMachinePoolList(in, out, s) +// Convert_v1beta1_AWSMachinePoolList_To_v1alpha3_AWSMachinePoolList is an autogenerated conversion function. +func Convert_v1beta1_AWSMachinePoolList_To_v1alpha3_AWSMachinePoolList(in *v1beta1.AWSMachinePoolList, out *AWSMachinePoolList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachinePoolList_To_v1alpha3_AWSMachinePoolList(in, out, s) } -func autoConvert_v1alpha3_AWSMachinePoolSpec_To_v1alpha4_AWSMachinePoolSpec(in *AWSMachinePoolSpec, out *v1alpha4.AWSMachinePoolSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSMachinePoolSpec_To_v1beta1_AWSMachinePoolSpec(in *AWSMachinePoolSpec, out *v1beta1.AWSMachinePoolSpec, s conversion.Scope) error { out.ProviderID = in.ProviderID out.MinSize = in.MinSize out.MaxSize = in.MaxSize out.AvailabilityZones = *(*[]string)(unsafe.Pointer(&in.AvailabilityZones)) if in.Subnets != nil { in, out := &in.Subnets, &out.Subnets - *out = make([]clusterapiproviderawsapiv1alpha4.AWSResourceReference, len(*in)) + *out = make([]apiv1beta1.AWSResourceReference, len(*in)) for i := range *in { - if err := Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AWSResourceReference(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_AWSResourceReference_To_v1beta1_AWSResourceReference(&(*in)[i], &(*out)[i], s); err != nil { return err } } } else { out.Subnets = nil } - out.AdditionalTags = *(*clusterapiproviderawsapiv1alpha4.Tags)(unsafe.Pointer(&in.AdditionalTags)) - if err := Convert_v1alpha3_AWSLaunchTemplate_To_v1alpha4_AWSLaunchTemplate(&in.AWSLaunchTemplate, &out.AWSLaunchTemplate, s); err != nil { + out.AdditionalTags = *(*apiv1beta1.Tags)(unsafe.Pointer(&in.AdditionalTags)) + if err := Convert_v1alpha3_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate(&in.AWSLaunchTemplate, &out.AWSLaunchTemplate, s); err != nil { return err } - out.MixedInstancesPolicy = (*v1alpha4.MixedInstancesPolicy)(unsafe.Pointer(in.MixedInstancesPolicy)) + out.MixedInstancesPolicy = (*v1beta1.MixedInstancesPolicy)(unsafe.Pointer(in.MixedInstancesPolicy)) out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) out.DefaultCoolDown = in.DefaultCoolDown - out.RefreshPreferences = (*v1alpha4.RefreshPreferences)(unsafe.Pointer(in.RefreshPreferences)) + out.RefreshPreferences = (*v1beta1.RefreshPreferences)(unsafe.Pointer(in.RefreshPreferences)) out.CapacityRebalance = in.CapacityRebalance return nil } -// Convert_v1alpha3_AWSMachinePoolSpec_To_v1alpha4_AWSMachinePoolSpec is an autogenerated conversion function. -func Convert_v1alpha3_AWSMachinePoolSpec_To_v1alpha4_AWSMachinePoolSpec(in *AWSMachinePoolSpec, out *v1alpha4.AWSMachinePoolSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSMachinePoolSpec_To_v1alpha4_AWSMachinePoolSpec(in, out, s) +// Convert_v1alpha3_AWSMachinePoolSpec_To_v1beta1_AWSMachinePoolSpec is an autogenerated conversion function. +func Convert_v1alpha3_AWSMachinePoolSpec_To_v1beta1_AWSMachinePoolSpec(in *AWSMachinePoolSpec, out *v1beta1.AWSMachinePoolSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSMachinePoolSpec_To_v1beta1_AWSMachinePoolSpec(in, out, s) } -func autoConvert_v1alpha4_AWSMachinePoolSpec_To_v1alpha3_AWSMachinePoolSpec(in *v1alpha4.AWSMachinePoolSpec, out *AWSMachinePoolSpec, s conversion.Scope) error { +func autoConvert_v1beta1_AWSMachinePoolSpec_To_v1alpha3_AWSMachinePoolSpec(in *v1beta1.AWSMachinePoolSpec, out *AWSMachinePoolSpec, s conversion.Scope) error { out.ProviderID = in.ProviderID out.MinSize = in.MinSize out.MaxSize = in.MaxSize out.AvailabilityZones = *(*[]string)(unsafe.Pointer(&in.AvailabilityZones)) if in.Subnets != nil { in, out := &in.Subnets, &out.Subnets - *out = make([]clusterapiproviderawsapiv1alpha3.AWSResourceReference, len(*in)) + *out = make([]apiv1alpha3.AWSResourceReference, len(*in)) for i := range *in { - if err := Convert_v1alpha4_AWSResourceReference_To_v1alpha3_AWSResourceReference(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_AWSResourceReference_To_v1alpha3_AWSResourceReference(&(*in)[i], &(*out)[i], s); err != nil { return err } } } else { out.Subnets = nil } - out.AdditionalTags = *(*clusterapiproviderawsapiv1alpha3.Tags)(unsafe.Pointer(&in.AdditionalTags)) - if err := Convert_v1alpha4_AWSLaunchTemplate_To_v1alpha3_AWSLaunchTemplate(&in.AWSLaunchTemplate, &out.AWSLaunchTemplate, s); err != nil { + out.AdditionalTags = *(*apiv1alpha3.Tags)(unsafe.Pointer(&in.AdditionalTags)) + if err := Convert_v1beta1_AWSLaunchTemplate_To_v1alpha3_AWSLaunchTemplate(&in.AWSLaunchTemplate, &out.AWSLaunchTemplate, s); err != nil { return err } out.MixedInstancesPolicy = (*MixedInstancesPolicy)(unsafe.Pointer(in.MixedInstancesPolicy)) @@ -624,32 +614,52 @@ func autoConvert_v1alpha4_AWSMachinePoolSpec_To_v1alpha3_AWSMachinePoolSpec(in * return nil } -// Convert_v1alpha4_AWSMachinePoolSpec_To_v1alpha3_AWSMachinePoolSpec is an autogenerated conversion function. -func Convert_v1alpha4_AWSMachinePoolSpec_To_v1alpha3_AWSMachinePoolSpec(in *v1alpha4.AWSMachinePoolSpec, out *AWSMachinePoolSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSMachinePoolSpec_To_v1alpha3_AWSMachinePoolSpec(in, out, s) +// Convert_v1beta1_AWSMachinePoolSpec_To_v1alpha3_AWSMachinePoolSpec is an autogenerated conversion function. +func Convert_v1beta1_AWSMachinePoolSpec_To_v1alpha3_AWSMachinePoolSpec(in *v1beta1.AWSMachinePoolSpec, out *AWSMachinePoolSpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachinePoolSpec_To_v1alpha3_AWSMachinePoolSpec(in, out, s) } -func autoConvert_v1alpha3_AWSMachinePoolStatus_To_v1alpha4_AWSMachinePoolStatus(in *AWSMachinePoolStatus, out *v1alpha4.AWSMachinePoolStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSMachinePoolStatus_To_v1beta1_AWSMachinePoolStatus(in *AWSMachinePoolStatus, out *v1beta1.AWSMachinePoolStatus, s conversion.Scope) error { out.Ready = in.Ready out.Replicas = in.Replicas - out.Conditions = *(*apiv1alpha4.Conditions)(unsafe.Pointer(&in.Conditions)) - out.Instances = *(*[]v1alpha4.AWSMachinePoolInstanceStatus)(unsafe.Pointer(&in.Instances)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(clusterapiapiv1beta1.Conditions, len(*in)) + for i := range *in { + if err := clusterapiapiv1alpha3.Convert_v1alpha3_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + out.Instances = *(*[]v1beta1.AWSMachinePoolInstanceStatus)(unsafe.Pointer(&in.Instances)) out.LaunchTemplateID = in.LaunchTemplateID out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.ASGStatus = (*v1alpha4.ASGStatus)(unsafe.Pointer(in.ASGStatus)) + out.ASGStatus = (*v1beta1.ASGStatus)(unsafe.Pointer(in.ASGStatus)) return nil } -// Convert_v1alpha3_AWSMachinePoolStatus_To_v1alpha4_AWSMachinePoolStatus is an autogenerated conversion function. -func Convert_v1alpha3_AWSMachinePoolStatus_To_v1alpha4_AWSMachinePoolStatus(in *AWSMachinePoolStatus, out *v1alpha4.AWSMachinePoolStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSMachinePoolStatus_To_v1alpha4_AWSMachinePoolStatus(in, out, s) +// Convert_v1alpha3_AWSMachinePoolStatus_To_v1beta1_AWSMachinePoolStatus is an autogenerated conversion function. +func Convert_v1alpha3_AWSMachinePoolStatus_To_v1beta1_AWSMachinePoolStatus(in *AWSMachinePoolStatus, out *v1beta1.AWSMachinePoolStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSMachinePoolStatus_To_v1beta1_AWSMachinePoolStatus(in, out, s) } -func autoConvert_v1alpha4_AWSMachinePoolStatus_To_v1alpha3_AWSMachinePoolStatus(in *v1alpha4.AWSMachinePoolStatus, out *AWSMachinePoolStatus, s conversion.Scope) error { +func autoConvert_v1beta1_AWSMachinePoolStatus_To_v1alpha3_AWSMachinePoolStatus(in *v1beta1.AWSMachinePoolStatus, out *AWSMachinePoolStatus, s conversion.Scope) error { out.Ready = in.Ready out.Replicas = in.Replicas - out.Conditions = *(*apiv1alpha3.Conditions)(unsafe.Pointer(&in.Conditions)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(clusterapiapiv1alpha3.Conditions, len(*in)) + for i := range *in { + if err := clusterapiapiv1alpha3.Convert_v1beta1_Condition_To_v1alpha3_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } out.Instances = *(*[]AWSMachinePoolInstanceStatus)(unsafe.Pointer(&in.Instances)) out.LaunchTemplateID = in.LaunchTemplateID out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) @@ -658,50 +668,50 @@ func autoConvert_v1alpha4_AWSMachinePoolStatus_To_v1alpha3_AWSMachinePoolStatus( return nil } -// Convert_v1alpha4_AWSMachinePoolStatus_To_v1alpha3_AWSMachinePoolStatus is an autogenerated conversion function. -func Convert_v1alpha4_AWSMachinePoolStatus_To_v1alpha3_AWSMachinePoolStatus(in *v1alpha4.AWSMachinePoolStatus, out *AWSMachinePoolStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSMachinePoolStatus_To_v1alpha3_AWSMachinePoolStatus(in, out, s) +// Convert_v1beta1_AWSMachinePoolStatus_To_v1alpha3_AWSMachinePoolStatus is an autogenerated conversion function. +func Convert_v1beta1_AWSMachinePoolStatus_To_v1alpha3_AWSMachinePoolStatus(in *v1beta1.AWSMachinePoolStatus, out *AWSMachinePoolStatus, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachinePoolStatus_To_v1alpha3_AWSMachinePoolStatus(in, out, s) } -func autoConvert_v1alpha3_AWSManagedMachinePool_To_v1alpha4_AWSManagedMachinePool(in *AWSManagedMachinePool, out *v1alpha4.AWSManagedMachinePool, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(in *AWSManagedMachinePool, out *v1beta1.AWSManagedMachinePool, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha3_AWSManagedMachinePoolSpec_To_v1alpha4_AWSManagedMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1alpha3_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha3_AWSManagedMachinePoolStatus_To_v1alpha4_AWSManagedMachinePoolStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1alpha3_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha3_AWSManagedMachinePool_To_v1alpha4_AWSManagedMachinePool is an autogenerated conversion function. -func Convert_v1alpha3_AWSManagedMachinePool_To_v1alpha4_AWSManagedMachinePool(in *AWSManagedMachinePool, out *v1alpha4.AWSManagedMachinePool, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSManagedMachinePool_To_v1alpha4_AWSManagedMachinePool(in, out, s) +// Convert_v1alpha3_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool is an autogenerated conversion function. +func Convert_v1alpha3_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(in *AWSManagedMachinePool, out *v1beta1.AWSManagedMachinePool, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(in, out, s) } -func autoConvert_v1alpha4_AWSManagedMachinePool_To_v1alpha3_AWSManagedMachinePool(in *v1alpha4.AWSManagedMachinePool, out *AWSManagedMachinePool, s conversion.Scope) error { +func autoConvert_v1beta1_AWSManagedMachinePool_To_v1alpha3_AWSManagedMachinePool(in *v1beta1.AWSManagedMachinePool, out *AWSManagedMachinePool, s conversion.Scope) error { out.ObjectMeta = in.ObjectMeta - if err := Convert_v1alpha4_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + if err := Convert_v1beta1_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { return err } - if err := Convert_v1alpha4_AWSManagedMachinePoolStatus_To_v1alpha3_AWSManagedMachinePoolStatus(&in.Status, &out.Status, s); err != nil { + if err := Convert_v1beta1_AWSManagedMachinePoolStatus_To_v1alpha3_AWSManagedMachinePoolStatus(&in.Status, &out.Status, s); err != nil { return err } return nil } -// Convert_v1alpha4_AWSManagedMachinePool_To_v1alpha3_AWSManagedMachinePool is an autogenerated conversion function. -func Convert_v1alpha4_AWSManagedMachinePool_To_v1alpha3_AWSManagedMachinePool(in *v1alpha4.AWSManagedMachinePool, out *AWSManagedMachinePool, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSManagedMachinePool_To_v1alpha3_AWSManagedMachinePool(in, out, s) +// Convert_v1beta1_AWSManagedMachinePool_To_v1alpha3_AWSManagedMachinePool is an autogenerated conversion function. +func Convert_v1beta1_AWSManagedMachinePool_To_v1alpha3_AWSManagedMachinePool(in *v1beta1.AWSManagedMachinePool, out *AWSManagedMachinePool, s conversion.Scope) error { + return autoConvert_v1beta1_AWSManagedMachinePool_To_v1alpha3_AWSManagedMachinePool(in, out, s) } -func autoConvert_v1alpha3_AWSManagedMachinePoolList_To_v1alpha4_AWSManagedMachinePoolList(in *AWSManagedMachinePoolList, out *v1alpha4.AWSManagedMachinePoolList, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList(in *AWSManagedMachinePoolList, out *v1beta1.AWSManagedMachinePoolList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]v1alpha4.AWSManagedMachinePool, len(*in)) + *out = make([]v1beta1.AWSManagedMachinePool, len(*in)) for i := range *in { - if err := Convert_v1alpha3_AWSManagedMachinePool_To_v1alpha4_AWSManagedMachinePool(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -711,18 +721,18 @@ func autoConvert_v1alpha3_AWSManagedMachinePoolList_To_v1alpha4_AWSManagedMachin return nil } -// Convert_v1alpha3_AWSManagedMachinePoolList_To_v1alpha4_AWSManagedMachinePoolList is an autogenerated conversion function. -func Convert_v1alpha3_AWSManagedMachinePoolList_To_v1alpha4_AWSManagedMachinePoolList(in *AWSManagedMachinePoolList, out *v1alpha4.AWSManagedMachinePoolList, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSManagedMachinePoolList_To_v1alpha4_AWSManagedMachinePoolList(in, out, s) +// Convert_v1alpha3_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList is an autogenerated conversion function. +func Convert_v1alpha3_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList(in *AWSManagedMachinePoolList, out *v1beta1.AWSManagedMachinePoolList, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList(in, out, s) } -func autoConvert_v1alpha4_AWSManagedMachinePoolList_To_v1alpha3_AWSManagedMachinePoolList(in *v1alpha4.AWSManagedMachinePoolList, out *AWSManagedMachinePoolList, s conversion.Scope) error { +func autoConvert_v1beta1_AWSManagedMachinePoolList_To_v1alpha3_AWSManagedMachinePoolList(in *v1beta1.AWSManagedMachinePoolList, out *AWSManagedMachinePoolList, s conversion.Scope) error { out.ListMeta = in.ListMeta if in.Items != nil { in, out := &in.Items, &out.Items *out = make([]AWSManagedMachinePool, len(*in)) for i := range *in { - if err := Convert_v1alpha4_AWSManagedMachinePool_To_v1alpha3_AWSManagedMachinePool(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1beta1_AWSManagedMachinePool_To_v1alpha3_AWSManagedMachinePool(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -732,40 +742,40 @@ func autoConvert_v1alpha4_AWSManagedMachinePoolList_To_v1alpha3_AWSManagedMachin return nil } -// Convert_v1alpha4_AWSManagedMachinePoolList_To_v1alpha3_AWSManagedMachinePoolList is an autogenerated conversion function. -func Convert_v1alpha4_AWSManagedMachinePoolList_To_v1alpha3_AWSManagedMachinePoolList(in *v1alpha4.AWSManagedMachinePoolList, out *AWSManagedMachinePoolList, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSManagedMachinePoolList_To_v1alpha3_AWSManagedMachinePoolList(in, out, s) +// Convert_v1beta1_AWSManagedMachinePoolList_To_v1alpha3_AWSManagedMachinePoolList is an autogenerated conversion function. +func Convert_v1beta1_AWSManagedMachinePoolList_To_v1alpha3_AWSManagedMachinePoolList(in *v1beta1.AWSManagedMachinePoolList, out *AWSManagedMachinePoolList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSManagedMachinePoolList_To_v1alpha3_AWSManagedMachinePoolList(in, out, s) } -func autoConvert_v1alpha3_AWSManagedMachinePoolSpec_To_v1alpha4_AWSManagedMachinePoolSpec(in *AWSManagedMachinePoolSpec, out *v1alpha4.AWSManagedMachinePoolSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec(in *AWSManagedMachinePoolSpec, out *v1beta1.AWSManagedMachinePoolSpec, s conversion.Scope) error { out.EKSNodegroupName = in.EKSNodegroupName out.AvailabilityZones = *(*[]string)(unsafe.Pointer(&in.AvailabilityZones)) out.SubnetIDs = *(*[]string)(unsafe.Pointer(&in.SubnetIDs)) - out.AdditionalTags = *(*clusterapiproviderawsapiv1alpha4.Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.AdditionalTags = *(*apiv1beta1.Tags)(unsafe.Pointer(&in.AdditionalTags)) out.RoleName = in.RoleName out.AMIVersion = (*string)(unsafe.Pointer(in.AMIVersion)) - out.AMIType = (*v1alpha4.ManagedMachineAMIType)(unsafe.Pointer(in.AMIType)) + out.AMIType = (*v1beta1.ManagedMachineAMIType)(unsafe.Pointer(in.AMIType)) out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) out.DiskSize = (*int32)(unsafe.Pointer(in.DiskSize)) out.InstanceType = (*string)(unsafe.Pointer(in.InstanceType)) - out.Scaling = (*v1alpha4.ManagedMachinePoolScaling)(unsafe.Pointer(in.Scaling)) - out.RemoteAccess = (*v1alpha4.ManagedRemoteAccess)(unsafe.Pointer(in.RemoteAccess)) + out.Scaling = (*v1beta1.ManagedMachinePoolScaling)(unsafe.Pointer(in.Scaling)) + out.RemoteAccess = (*v1beta1.ManagedRemoteAccess)(unsafe.Pointer(in.RemoteAccess)) out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) return nil } -// Convert_v1alpha3_AWSManagedMachinePoolSpec_To_v1alpha4_AWSManagedMachinePoolSpec is an autogenerated conversion function. -func Convert_v1alpha3_AWSManagedMachinePoolSpec_To_v1alpha4_AWSManagedMachinePoolSpec(in *AWSManagedMachinePoolSpec, out *v1alpha4.AWSManagedMachinePoolSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSManagedMachinePoolSpec_To_v1alpha4_AWSManagedMachinePoolSpec(in, out, s) +// Convert_v1alpha3_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec is an autogenerated conversion function. +func Convert_v1alpha3_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec(in *AWSManagedMachinePoolSpec, out *v1beta1.AWSManagedMachinePoolSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec(in, out, s) } -func autoConvert_v1alpha4_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachinePoolSpec(in *v1alpha4.AWSManagedMachinePoolSpec, out *AWSManagedMachinePoolSpec, s conversion.Scope) error { +func autoConvert_v1beta1_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachinePoolSpec(in *v1beta1.AWSManagedMachinePoolSpec, out *AWSManagedMachinePoolSpec, s conversion.Scope) error { out.EKSNodegroupName = in.EKSNodegroupName out.AvailabilityZones = *(*[]string)(unsafe.Pointer(&in.AvailabilityZones)) out.SubnetIDs = *(*[]string)(unsafe.Pointer(&in.SubnetIDs)) - out.AdditionalTags = *(*clusterapiproviderawsapiv1alpha3.Tags)(unsafe.Pointer(&in.AdditionalTags)) - out.RoleName = in.RoleName + out.AdditionalTags = *(*apiv1alpha3.Tags)(unsafe.Pointer(&in.AdditionalTags)) // WARNING: in.RoleAdditionalPolicies requires manual conversion: does not exist in peer-type + out.RoleName = in.RoleName out.AMIVersion = (*string)(unsafe.Pointer(in.AMIVersion)) out.AMIType = (*ManagedMachineAMIType)(unsafe.Pointer(in.AMIType)) out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) @@ -779,37 +789,57 @@ func autoConvert_v1alpha4_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachin return nil } -func autoConvert_v1alpha3_AWSManagedMachinePoolStatus_To_v1alpha4_AWSManagedMachinePoolStatus(in *AWSManagedMachinePoolStatus, out *v1alpha4.AWSManagedMachinePoolStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus(in *AWSManagedMachinePoolStatus, out *v1beta1.AWSManagedMachinePoolStatus, s conversion.Scope) error { out.Ready = in.Ready out.Replicas = in.Replicas out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*apiv1alpha4.Conditions)(unsafe.Pointer(&in.Conditions)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(clusterapiapiv1beta1.Conditions, len(*in)) + for i := range *in { + if err := clusterapiapiv1alpha3.Convert_v1alpha3_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } return nil } -// Convert_v1alpha3_AWSManagedMachinePoolStatus_To_v1alpha4_AWSManagedMachinePoolStatus is an autogenerated conversion function. -func Convert_v1alpha3_AWSManagedMachinePoolStatus_To_v1alpha4_AWSManagedMachinePoolStatus(in *AWSManagedMachinePoolStatus, out *v1alpha4.AWSManagedMachinePoolStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_AWSManagedMachinePoolStatus_To_v1alpha4_AWSManagedMachinePoolStatus(in, out, s) +// Convert_v1alpha3_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus is an autogenerated conversion function. +func Convert_v1alpha3_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus(in *AWSManagedMachinePoolStatus, out *v1beta1.AWSManagedMachinePoolStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus(in, out, s) } -func autoConvert_v1alpha4_AWSManagedMachinePoolStatus_To_v1alpha3_AWSManagedMachinePoolStatus(in *v1alpha4.AWSManagedMachinePoolStatus, out *AWSManagedMachinePoolStatus, s conversion.Scope) error { +func autoConvert_v1beta1_AWSManagedMachinePoolStatus_To_v1alpha3_AWSManagedMachinePoolStatus(in *v1beta1.AWSManagedMachinePoolStatus, out *AWSManagedMachinePoolStatus, s conversion.Scope) error { out.Ready = in.Ready out.Replicas = in.Replicas out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*apiv1alpha3.Conditions)(unsafe.Pointer(&in.Conditions)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(clusterapiapiv1alpha3.Conditions, len(*in)) + for i := range *in { + if err := clusterapiapiv1alpha3.Convert_v1beta1_Condition_To_v1alpha3_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } return nil } -// Convert_v1alpha4_AWSManagedMachinePoolStatus_To_v1alpha3_AWSManagedMachinePoolStatus is an autogenerated conversion function. -func Convert_v1alpha4_AWSManagedMachinePoolStatus_To_v1alpha3_AWSManagedMachinePoolStatus(in *v1alpha4.AWSManagedMachinePoolStatus, out *AWSManagedMachinePoolStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_AWSManagedMachinePoolStatus_To_v1alpha3_AWSManagedMachinePoolStatus(in, out, s) +// Convert_v1beta1_AWSManagedMachinePoolStatus_To_v1alpha3_AWSManagedMachinePoolStatus is an autogenerated conversion function. +func Convert_v1beta1_AWSManagedMachinePoolStatus_To_v1alpha3_AWSManagedMachinePoolStatus(in *v1beta1.AWSManagedMachinePoolStatus, out *AWSManagedMachinePoolStatus, s conversion.Scope) error { + return autoConvert_v1beta1_AWSManagedMachinePoolStatus_To_v1alpha3_AWSManagedMachinePoolStatus(in, out, s) } -func autoConvert_v1alpha3_AutoScalingGroup_To_v1alpha4_AutoScalingGroup(in *AutoScalingGroup, out *v1alpha4.AutoScalingGroup, s conversion.Scope) error { +func autoConvert_v1alpha3_AutoScalingGroup_To_v1beta1_AutoScalingGroup(in *AutoScalingGroup, out *v1beta1.AutoScalingGroup, s conversion.Scope) error { out.ID = in.ID - out.Tags = *(*clusterapiproviderawsapiv1alpha4.Tags)(unsafe.Pointer(&in.Tags)) + out.Tags = *(*apiv1beta1.Tags)(unsafe.Pointer(&in.Tags)) out.Name = in.Name out.DesiredCapacity = (*int32)(unsafe.Pointer(in.DesiredCapacity)) out.MaxSize = in.MaxSize @@ -818,13 +848,13 @@ func autoConvert_v1alpha3_AutoScalingGroup_To_v1alpha4_AutoScalingGroup(in *Auto out.Subnets = *(*[]string)(unsafe.Pointer(&in.Subnets)) out.DefaultCoolDown = in.DefaultCoolDown out.CapacityRebalance = in.CapacityRebalance - out.MixedInstancesPolicy = (*v1alpha4.MixedInstancesPolicy)(unsafe.Pointer(in.MixedInstancesPolicy)) - out.Status = v1alpha4.ASGStatus(in.Status) + out.MixedInstancesPolicy = (*v1beta1.MixedInstancesPolicy)(unsafe.Pointer(in.MixedInstancesPolicy)) + out.Status = v1beta1.ASGStatus(in.Status) if in.Instances != nil { in, out := &in.Instances, &out.Instances - *out = make([]clusterapiproviderawsapiv1alpha4.Instance, len(*in)) + *out = make([]apiv1beta1.Instance, len(*in)) for i := range *in { - if err := Convert_v1alpha3_Instance_To_v1alpha4_Instance(&(*in)[i], &(*out)[i], s); err != nil { + if err := Convert_v1alpha3_Instance_To_v1beta1_Instance(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -834,14 +864,14 @@ func autoConvert_v1alpha3_AutoScalingGroup_To_v1alpha4_AutoScalingGroup(in *Auto return nil } -// Convert_v1alpha3_AutoScalingGroup_To_v1alpha4_AutoScalingGroup is an autogenerated conversion function. -func Convert_v1alpha3_AutoScalingGroup_To_v1alpha4_AutoScalingGroup(in *AutoScalingGroup, out *v1alpha4.AutoScalingGroup, s conversion.Scope) error { - return autoConvert_v1alpha3_AutoScalingGroup_To_v1alpha4_AutoScalingGroup(in, out, s) +// Convert_v1alpha3_AutoScalingGroup_To_v1beta1_AutoScalingGroup is an autogenerated conversion function. +func Convert_v1alpha3_AutoScalingGroup_To_v1beta1_AutoScalingGroup(in *AutoScalingGroup, out *v1beta1.AutoScalingGroup, s conversion.Scope) error { + return autoConvert_v1alpha3_AutoScalingGroup_To_v1beta1_AutoScalingGroup(in, out, s) } -func autoConvert_v1alpha4_AutoScalingGroup_To_v1alpha3_AutoScalingGroup(in *v1alpha4.AutoScalingGroup, out *AutoScalingGroup, s conversion.Scope) error { +func autoConvert_v1beta1_AutoScalingGroup_To_v1alpha3_AutoScalingGroup(in *v1beta1.AutoScalingGroup, out *AutoScalingGroup, s conversion.Scope) error { out.ID = in.ID - out.Tags = *(*clusterapiproviderawsapiv1alpha3.Tags)(unsafe.Pointer(&in.Tags)) + out.Tags = *(*apiv1alpha3.Tags)(unsafe.Pointer(&in.Tags)) out.Name = in.Name out.DesiredCapacity = (*int32)(unsafe.Pointer(in.DesiredCapacity)) out.MaxSize = in.MaxSize @@ -854,9 +884,9 @@ func autoConvert_v1alpha4_AutoScalingGroup_To_v1alpha3_AutoScalingGroup(in *v1al out.Status = ASGStatus(in.Status) if in.Instances != nil { in, out := &in.Instances, &out.Instances - *out = make([]clusterapiproviderawsapiv1alpha3.Instance, len(*in)) + *out = make([]apiv1alpha3.Instance, len(*in)) for i := range *in { - if err := Convert_v1alpha4_Instance_To_v1alpha3_Instance(&(*in)[i], &(*out)[i], s); err != nil { + if err := apiv1alpha3.Convert_v1beta1_Instance_To_v1alpha3_Instance(&(*in)[i], &(*out)[i], s); err != nil { return err } } @@ -866,153 +896,173 @@ func autoConvert_v1alpha4_AutoScalingGroup_To_v1alpha3_AutoScalingGroup(in *v1al return nil } -// Convert_v1alpha4_AutoScalingGroup_To_v1alpha3_AutoScalingGroup is an autogenerated conversion function. -func Convert_v1alpha4_AutoScalingGroup_To_v1alpha3_AutoScalingGroup(in *v1alpha4.AutoScalingGroup, out *AutoScalingGroup, s conversion.Scope) error { - return autoConvert_v1alpha4_AutoScalingGroup_To_v1alpha3_AutoScalingGroup(in, out, s) +// Convert_v1beta1_AutoScalingGroup_To_v1alpha3_AutoScalingGroup is an autogenerated conversion function. +func Convert_v1beta1_AutoScalingGroup_To_v1alpha3_AutoScalingGroup(in *v1beta1.AutoScalingGroup, out *AutoScalingGroup, s conversion.Scope) error { + return autoConvert_v1beta1_AutoScalingGroup_To_v1alpha3_AutoScalingGroup(in, out, s) } -func autoConvert_v1alpha3_BlockDeviceMapping_To_v1alpha4_BlockDeviceMapping(in *BlockDeviceMapping, out *v1alpha4.BlockDeviceMapping, s conversion.Scope) error { +func autoConvert_v1alpha3_BlockDeviceMapping_To_v1beta1_BlockDeviceMapping(in *BlockDeviceMapping, out *v1beta1.BlockDeviceMapping, s conversion.Scope) error { out.DeviceName = in.DeviceName - if err := Convert_v1alpha3_EBS_To_v1alpha4_EBS(&in.Ebs, &out.Ebs, s); err != nil { + if err := Convert_v1alpha3_EBS_To_v1beta1_EBS(&in.Ebs, &out.Ebs, s); err != nil { return err } return nil } -// Convert_v1alpha3_BlockDeviceMapping_To_v1alpha4_BlockDeviceMapping is an autogenerated conversion function. -func Convert_v1alpha3_BlockDeviceMapping_To_v1alpha4_BlockDeviceMapping(in *BlockDeviceMapping, out *v1alpha4.BlockDeviceMapping, s conversion.Scope) error { - return autoConvert_v1alpha3_BlockDeviceMapping_To_v1alpha4_BlockDeviceMapping(in, out, s) +// Convert_v1alpha3_BlockDeviceMapping_To_v1beta1_BlockDeviceMapping is an autogenerated conversion function. +func Convert_v1alpha3_BlockDeviceMapping_To_v1beta1_BlockDeviceMapping(in *BlockDeviceMapping, out *v1beta1.BlockDeviceMapping, s conversion.Scope) error { + return autoConvert_v1alpha3_BlockDeviceMapping_To_v1beta1_BlockDeviceMapping(in, out, s) } -func autoConvert_v1alpha4_BlockDeviceMapping_To_v1alpha3_BlockDeviceMapping(in *v1alpha4.BlockDeviceMapping, out *BlockDeviceMapping, s conversion.Scope) error { +func autoConvert_v1beta1_BlockDeviceMapping_To_v1alpha3_BlockDeviceMapping(in *v1beta1.BlockDeviceMapping, out *BlockDeviceMapping, s conversion.Scope) error { out.DeviceName = in.DeviceName - if err := Convert_v1alpha4_EBS_To_v1alpha3_EBS(&in.Ebs, &out.Ebs, s); err != nil { + if err := Convert_v1beta1_EBS_To_v1alpha3_EBS(&in.Ebs, &out.Ebs, s); err != nil { return err } return nil } -// Convert_v1alpha4_BlockDeviceMapping_To_v1alpha3_BlockDeviceMapping is an autogenerated conversion function. -func Convert_v1alpha4_BlockDeviceMapping_To_v1alpha3_BlockDeviceMapping(in *v1alpha4.BlockDeviceMapping, out *BlockDeviceMapping, s conversion.Scope) error { - return autoConvert_v1alpha4_BlockDeviceMapping_To_v1alpha3_BlockDeviceMapping(in, out, s) +// Convert_v1beta1_BlockDeviceMapping_To_v1alpha3_BlockDeviceMapping is an autogenerated conversion function. +func Convert_v1beta1_BlockDeviceMapping_To_v1alpha3_BlockDeviceMapping(in *v1beta1.BlockDeviceMapping, out *BlockDeviceMapping, s conversion.Scope) error { + return autoConvert_v1beta1_BlockDeviceMapping_To_v1alpha3_BlockDeviceMapping(in, out, s) } -func autoConvert_v1alpha3_EBS_To_v1alpha4_EBS(in *EBS, out *v1alpha4.EBS, s conversion.Scope) error { +func autoConvert_v1alpha3_EBS_To_v1beta1_EBS(in *EBS, out *v1beta1.EBS, s conversion.Scope) error { out.Encrypted = in.Encrypted out.VolumeSize = in.VolumeSize out.VolumeType = in.VolumeType return nil } -// Convert_v1alpha3_EBS_To_v1alpha4_EBS is an autogenerated conversion function. -func Convert_v1alpha3_EBS_To_v1alpha4_EBS(in *EBS, out *v1alpha4.EBS, s conversion.Scope) error { - return autoConvert_v1alpha3_EBS_To_v1alpha4_EBS(in, out, s) +// Convert_v1alpha3_EBS_To_v1beta1_EBS is an autogenerated conversion function. +func Convert_v1alpha3_EBS_To_v1beta1_EBS(in *EBS, out *v1beta1.EBS, s conversion.Scope) error { + return autoConvert_v1alpha3_EBS_To_v1beta1_EBS(in, out, s) } -func autoConvert_v1alpha4_EBS_To_v1alpha3_EBS(in *v1alpha4.EBS, out *EBS, s conversion.Scope) error { +func autoConvert_v1beta1_EBS_To_v1alpha3_EBS(in *v1beta1.EBS, out *EBS, s conversion.Scope) error { out.Encrypted = in.Encrypted out.VolumeSize = in.VolumeSize out.VolumeType = in.VolumeType return nil } -// Convert_v1alpha4_EBS_To_v1alpha3_EBS is an autogenerated conversion function. -func Convert_v1alpha4_EBS_To_v1alpha3_EBS(in *v1alpha4.EBS, out *EBS, s conversion.Scope) error { - return autoConvert_v1alpha4_EBS_To_v1alpha3_EBS(in, out, s) +// Convert_v1beta1_EBS_To_v1alpha3_EBS is an autogenerated conversion function. +func Convert_v1beta1_EBS_To_v1alpha3_EBS(in *v1beta1.EBS, out *EBS, s conversion.Scope) error { + return autoConvert_v1beta1_EBS_To_v1alpha3_EBS(in, out, s) } -func autoConvert_v1alpha3_FargateProfileSpec_To_v1alpha4_FargateProfileSpec(in *FargateProfileSpec, out *v1alpha4.FargateProfileSpec, s conversion.Scope) error { +func autoConvert_v1alpha3_FargateProfileSpec_To_v1beta1_FargateProfileSpec(in *FargateProfileSpec, out *v1beta1.FargateProfileSpec, s conversion.Scope) error { out.ClusterName = in.ClusterName out.ProfileName = in.ProfileName out.SubnetIDs = *(*[]string)(unsafe.Pointer(&in.SubnetIDs)) - out.AdditionalTags = *(*clusterapiproviderawsapiv1alpha4.Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.AdditionalTags = *(*apiv1beta1.Tags)(unsafe.Pointer(&in.AdditionalTags)) out.RoleName = in.RoleName - out.Selectors = *(*[]v1alpha4.FargateSelector)(unsafe.Pointer(&in.Selectors)) + out.Selectors = *(*[]v1beta1.FargateSelector)(unsafe.Pointer(&in.Selectors)) return nil } -// Convert_v1alpha3_FargateProfileSpec_To_v1alpha4_FargateProfileSpec is an autogenerated conversion function. -func Convert_v1alpha3_FargateProfileSpec_To_v1alpha4_FargateProfileSpec(in *FargateProfileSpec, out *v1alpha4.FargateProfileSpec, s conversion.Scope) error { - return autoConvert_v1alpha3_FargateProfileSpec_To_v1alpha4_FargateProfileSpec(in, out, s) +// Convert_v1alpha3_FargateProfileSpec_To_v1beta1_FargateProfileSpec is an autogenerated conversion function. +func Convert_v1alpha3_FargateProfileSpec_To_v1beta1_FargateProfileSpec(in *FargateProfileSpec, out *v1beta1.FargateProfileSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_FargateProfileSpec_To_v1beta1_FargateProfileSpec(in, out, s) } -func autoConvert_v1alpha4_FargateProfileSpec_To_v1alpha3_FargateProfileSpec(in *v1alpha4.FargateProfileSpec, out *FargateProfileSpec, s conversion.Scope) error { +func autoConvert_v1beta1_FargateProfileSpec_To_v1alpha3_FargateProfileSpec(in *v1beta1.FargateProfileSpec, out *FargateProfileSpec, s conversion.Scope) error { out.ClusterName = in.ClusterName out.ProfileName = in.ProfileName out.SubnetIDs = *(*[]string)(unsafe.Pointer(&in.SubnetIDs)) - out.AdditionalTags = *(*clusterapiproviderawsapiv1alpha3.Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.AdditionalTags = *(*apiv1alpha3.Tags)(unsafe.Pointer(&in.AdditionalTags)) out.RoleName = in.RoleName out.Selectors = *(*[]FargateSelector)(unsafe.Pointer(&in.Selectors)) return nil } -// Convert_v1alpha4_FargateProfileSpec_To_v1alpha3_FargateProfileSpec is an autogenerated conversion function. -func Convert_v1alpha4_FargateProfileSpec_To_v1alpha3_FargateProfileSpec(in *v1alpha4.FargateProfileSpec, out *FargateProfileSpec, s conversion.Scope) error { - return autoConvert_v1alpha4_FargateProfileSpec_To_v1alpha3_FargateProfileSpec(in, out, s) +// Convert_v1beta1_FargateProfileSpec_To_v1alpha3_FargateProfileSpec is an autogenerated conversion function. +func Convert_v1beta1_FargateProfileSpec_To_v1alpha3_FargateProfileSpec(in *v1beta1.FargateProfileSpec, out *FargateProfileSpec, s conversion.Scope) error { + return autoConvert_v1beta1_FargateProfileSpec_To_v1alpha3_FargateProfileSpec(in, out, s) } -func autoConvert_v1alpha3_FargateProfileStatus_To_v1alpha4_FargateProfileStatus(in *FargateProfileStatus, out *v1alpha4.FargateProfileStatus, s conversion.Scope) error { +func autoConvert_v1alpha3_FargateProfileStatus_To_v1beta1_FargateProfileStatus(in *FargateProfileStatus, out *v1beta1.FargateProfileStatus, s conversion.Scope) error { out.Ready = in.Ready out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*apiv1alpha4.Conditions)(unsafe.Pointer(&in.Conditions)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(clusterapiapiv1beta1.Conditions, len(*in)) + for i := range *in { + if err := clusterapiapiv1alpha3.Convert_v1alpha3_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } return nil } -// Convert_v1alpha3_FargateProfileStatus_To_v1alpha4_FargateProfileStatus is an autogenerated conversion function. -func Convert_v1alpha3_FargateProfileStatus_To_v1alpha4_FargateProfileStatus(in *FargateProfileStatus, out *v1alpha4.FargateProfileStatus, s conversion.Scope) error { - return autoConvert_v1alpha3_FargateProfileStatus_To_v1alpha4_FargateProfileStatus(in, out, s) +// Convert_v1alpha3_FargateProfileStatus_To_v1beta1_FargateProfileStatus is an autogenerated conversion function. +func Convert_v1alpha3_FargateProfileStatus_To_v1beta1_FargateProfileStatus(in *FargateProfileStatus, out *v1beta1.FargateProfileStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_FargateProfileStatus_To_v1beta1_FargateProfileStatus(in, out, s) } -func autoConvert_v1alpha4_FargateProfileStatus_To_v1alpha3_FargateProfileStatus(in *v1alpha4.FargateProfileStatus, out *FargateProfileStatus, s conversion.Scope) error { +func autoConvert_v1beta1_FargateProfileStatus_To_v1alpha3_FargateProfileStatus(in *v1beta1.FargateProfileStatus, out *FargateProfileStatus, s conversion.Scope) error { out.Ready = in.Ready out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) - out.Conditions = *(*apiv1alpha3.Conditions)(unsafe.Pointer(&in.Conditions)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(clusterapiapiv1alpha3.Conditions, len(*in)) + for i := range *in { + if err := clusterapiapiv1alpha3.Convert_v1beta1_Condition_To_v1alpha3_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } return nil } -// Convert_v1alpha4_FargateProfileStatus_To_v1alpha3_FargateProfileStatus is an autogenerated conversion function. -func Convert_v1alpha4_FargateProfileStatus_To_v1alpha3_FargateProfileStatus(in *v1alpha4.FargateProfileStatus, out *FargateProfileStatus, s conversion.Scope) error { - return autoConvert_v1alpha4_FargateProfileStatus_To_v1alpha3_FargateProfileStatus(in, out, s) +// Convert_v1beta1_FargateProfileStatus_To_v1alpha3_FargateProfileStatus is an autogenerated conversion function. +func Convert_v1beta1_FargateProfileStatus_To_v1alpha3_FargateProfileStatus(in *v1beta1.FargateProfileStatus, out *FargateProfileStatus, s conversion.Scope) error { + return autoConvert_v1beta1_FargateProfileStatus_To_v1alpha3_FargateProfileStatus(in, out, s) } -func autoConvert_v1alpha3_FargateSelector_To_v1alpha4_FargateSelector(in *FargateSelector, out *v1alpha4.FargateSelector, s conversion.Scope) error { +func autoConvert_v1alpha3_FargateSelector_To_v1beta1_FargateSelector(in *FargateSelector, out *v1beta1.FargateSelector, s conversion.Scope) error { out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) out.Namespace = in.Namespace return nil } -// Convert_v1alpha3_FargateSelector_To_v1alpha4_FargateSelector is an autogenerated conversion function. -func Convert_v1alpha3_FargateSelector_To_v1alpha4_FargateSelector(in *FargateSelector, out *v1alpha4.FargateSelector, s conversion.Scope) error { - return autoConvert_v1alpha3_FargateSelector_To_v1alpha4_FargateSelector(in, out, s) +// Convert_v1alpha3_FargateSelector_To_v1beta1_FargateSelector is an autogenerated conversion function. +func Convert_v1alpha3_FargateSelector_To_v1beta1_FargateSelector(in *FargateSelector, out *v1beta1.FargateSelector, s conversion.Scope) error { + return autoConvert_v1alpha3_FargateSelector_To_v1beta1_FargateSelector(in, out, s) } -func autoConvert_v1alpha4_FargateSelector_To_v1alpha3_FargateSelector(in *v1alpha4.FargateSelector, out *FargateSelector, s conversion.Scope) error { +func autoConvert_v1beta1_FargateSelector_To_v1alpha3_FargateSelector(in *v1beta1.FargateSelector, out *FargateSelector, s conversion.Scope) error { out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) out.Namespace = in.Namespace return nil } -// Convert_v1alpha4_FargateSelector_To_v1alpha3_FargateSelector is an autogenerated conversion function. -func Convert_v1alpha4_FargateSelector_To_v1alpha3_FargateSelector(in *v1alpha4.FargateSelector, out *FargateSelector, s conversion.Scope) error { - return autoConvert_v1alpha4_FargateSelector_To_v1alpha3_FargateSelector(in, out, s) +// Convert_v1beta1_FargateSelector_To_v1alpha3_FargateSelector is an autogenerated conversion function. +func Convert_v1beta1_FargateSelector_To_v1alpha3_FargateSelector(in *v1beta1.FargateSelector, out *FargateSelector, s conversion.Scope) error { + return autoConvert_v1beta1_FargateSelector_To_v1alpha3_FargateSelector(in, out, s) } -func autoConvert_v1alpha3_InstancesDistribution_To_v1alpha4_InstancesDistribution(in *InstancesDistribution, out *v1alpha4.InstancesDistribution, s conversion.Scope) error { - out.OnDemandAllocationStrategy = v1alpha4.OnDemandAllocationStrategy(in.OnDemandAllocationStrategy) - out.SpotAllocationStrategy = v1alpha4.SpotAllocationStrategy(in.SpotAllocationStrategy) +func autoConvert_v1alpha3_InstancesDistribution_To_v1beta1_InstancesDistribution(in *InstancesDistribution, out *v1beta1.InstancesDistribution, s conversion.Scope) error { + out.OnDemandAllocationStrategy = v1beta1.OnDemandAllocationStrategy(in.OnDemandAllocationStrategy) + out.SpotAllocationStrategy = v1beta1.SpotAllocationStrategy(in.SpotAllocationStrategy) out.OnDemandBaseCapacity = (*int64)(unsafe.Pointer(in.OnDemandBaseCapacity)) out.OnDemandPercentageAboveBaseCapacity = (*int64)(unsafe.Pointer(in.OnDemandPercentageAboveBaseCapacity)) return nil } -// Convert_v1alpha3_InstancesDistribution_To_v1alpha4_InstancesDistribution is an autogenerated conversion function. -func Convert_v1alpha3_InstancesDistribution_To_v1alpha4_InstancesDistribution(in *InstancesDistribution, out *v1alpha4.InstancesDistribution, s conversion.Scope) error { - return autoConvert_v1alpha3_InstancesDistribution_To_v1alpha4_InstancesDistribution(in, out, s) +// Convert_v1alpha3_InstancesDistribution_To_v1beta1_InstancesDistribution is an autogenerated conversion function. +func Convert_v1alpha3_InstancesDistribution_To_v1beta1_InstancesDistribution(in *InstancesDistribution, out *v1beta1.InstancesDistribution, s conversion.Scope) error { + return autoConvert_v1alpha3_InstancesDistribution_To_v1beta1_InstancesDistribution(in, out, s) } -func autoConvert_v1alpha4_InstancesDistribution_To_v1alpha3_InstancesDistribution(in *v1alpha4.InstancesDistribution, out *InstancesDistribution, s conversion.Scope) error { +func autoConvert_v1beta1_InstancesDistribution_To_v1alpha3_InstancesDistribution(in *v1beta1.InstancesDistribution, out *InstancesDistribution, s conversion.Scope) error { out.OnDemandAllocationStrategy = OnDemandAllocationStrategy(in.OnDemandAllocationStrategy) out.SpotAllocationStrategy = SpotAllocationStrategy(in.SpotAllocationStrategy) out.OnDemandBaseCapacity = (*int64)(unsafe.Pointer(in.OnDemandBaseCapacity)) @@ -1020,119 +1070,119 @@ func autoConvert_v1alpha4_InstancesDistribution_To_v1alpha3_InstancesDistributio return nil } -// Convert_v1alpha4_InstancesDistribution_To_v1alpha3_InstancesDistribution is an autogenerated conversion function. -func Convert_v1alpha4_InstancesDistribution_To_v1alpha3_InstancesDistribution(in *v1alpha4.InstancesDistribution, out *InstancesDistribution, s conversion.Scope) error { - return autoConvert_v1alpha4_InstancesDistribution_To_v1alpha3_InstancesDistribution(in, out, s) +// Convert_v1beta1_InstancesDistribution_To_v1alpha3_InstancesDistribution is an autogenerated conversion function. +func Convert_v1beta1_InstancesDistribution_To_v1alpha3_InstancesDistribution(in *v1beta1.InstancesDistribution, out *InstancesDistribution, s conversion.Scope) error { + return autoConvert_v1beta1_InstancesDistribution_To_v1alpha3_InstancesDistribution(in, out, s) } -func autoConvert_v1alpha3_ManagedMachinePoolScaling_To_v1alpha4_ManagedMachinePoolScaling(in *ManagedMachinePoolScaling, out *v1alpha4.ManagedMachinePoolScaling, s conversion.Scope) error { +func autoConvert_v1alpha3_ManagedMachinePoolScaling_To_v1beta1_ManagedMachinePoolScaling(in *ManagedMachinePoolScaling, out *v1beta1.ManagedMachinePoolScaling, s conversion.Scope) error { out.MinSize = (*int32)(unsafe.Pointer(in.MinSize)) out.MaxSize = (*int32)(unsafe.Pointer(in.MaxSize)) return nil } -// Convert_v1alpha3_ManagedMachinePoolScaling_To_v1alpha4_ManagedMachinePoolScaling is an autogenerated conversion function. -func Convert_v1alpha3_ManagedMachinePoolScaling_To_v1alpha4_ManagedMachinePoolScaling(in *ManagedMachinePoolScaling, out *v1alpha4.ManagedMachinePoolScaling, s conversion.Scope) error { - return autoConvert_v1alpha3_ManagedMachinePoolScaling_To_v1alpha4_ManagedMachinePoolScaling(in, out, s) +// Convert_v1alpha3_ManagedMachinePoolScaling_To_v1beta1_ManagedMachinePoolScaling is an autogenerated conversion function. +func Convert_v1alpha3_ManagedMachinePoolScaling_To_v1beta1_ManagedMachinePoolScaling(in *ManagedMachinePoolScaling, out *v1beta1.ManagedMachinePoolScaling, s conversion.Scope) error { + return autoConvert_v1alpha3_ManagedMachinePoolScaling_To_v1beta1_ManagedMachinePoolScaling(in, out, s) } -func autoConvert_v1alpha4_ManagedMachinePoolScaling_To_v1alpha3_ManagedMachinePoolScaling(in *v1alpha4.ManagedMachinePoolScaling, out *ManagedMachinePoolScaling, s conversion.Scope) error { +func autoConvert_v1beta1_ManagedMachinePoolScaling_To_v1alpha3_ManagedMachinePoolScaling(in *v1beta1.ManagedMachinePoolScaling, out *ManagedMachinePoolScaling, s conversion.Scope) error { out.MinSize = (*int32)(unsafe.Pointer(in.MinSize)) out.MaxSize = (*int32)(unsafe.Pointer(in.MaxSize)) return nil } -// Convert_v1alpha4_ManagedMachinePoolScaling_To_v1alpha3_ManagedMachinePoolScaling is an autogenerated conversion function. -func Convert_v1alpha4_ManagedMachinePoolScaling_To_v1alpha3_ManagedMachinePoolScaling(in *v1alpha4.ManagedMachinePoolScaling, out *ManagedMachinePoolScaling, s conversion.Scope) error { - return autoConvert_v1alpha4_ManagedMachinePoolScaling_To_v1alpha3_ManagedMachinePoolScaling(in, out, s) +// Convert_v1beta1_ManagedMachinePoolScaling_To_v1alpha3_ManagedMachinePoolScaling is an autogenerated conversion function. +func Convert_v1beta1_ManagedMachinePoolScaling_To_v1alpha3_ManagedMachinePoolScaling(in *v1beta1.ManagedMachinePoolScaling, out *ManagedMachinePoolScaling, s conversion.Scope) error { + return autoConvert_v1beta1_ManagedMachinePoolScaling_To_v1alpha3_ManagedMachinePoolScaling(in, out, s) } -func autoConvert_v1alpha3_ManagedRemoteAccess_To_v1alpha4_ManagedRemoteAccess(in *ManagedRemoteAccess, out *v1alpha4.ManagedRemoteAccess, s conversion.Scope) error { +func autoConvert_v1alpha3_ManagedRemoteAccess_To_v1beta1_ManagedRemoteAccess(in *ManagedRemoteAccess, out *v1beta1.ManagedRemoteAccess, s conversion.Scope) error { out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) out.SourceSecurityGroups = *(*[]string)(unsafe.Pointer(&in.SourceSecurityGroups)) out.Public = in.Public return nil } -// Convert_v1alpha3_ManagedRemoteAccess_To_v1alpha4_ManagedRemoteAccess is an autogenerated conversion function. -func Convert_v1alpha3_ManagedRemoteAccess_To_v1alpha4_ManagedRemoteAccess(in *ManagedRemoteAccess, out *v1alpha4.ManagedRemoteAccess, s conversion.Scope) error { - return autoConvert_v1alpha3_ManagedRemoteAccess_To_v1alpha4_ManagedRemoteAccess(in, out, s) +// Convert_v1alpha3_ManagedRemoteAccess_To_v1beta1_ManagedRemoteAccess is an autogenerated conversion function. +func Convert_v1alpha3_ManagedRemoteAccess_To_v1beta1_ManagedRemoteAccess(in *ManagedRemoteAccess, out *v1beta1.ManagedRemoteAccess, s conversion.Scope) error { + return autoConvert_v1alpha3_ManagedRemoteAccess_To_v1beta1_ManagedRemoteAccess(in, out, s) } -func autoConvert_v1alpha4_ManagedRemoteAccess_To_v1alpha3_ManagedRemoteAccess(in *v1alpha4.ManagedRemoteAccess, out *ManagedRemoteAccess, s conversion.Scope) error { +func autoConvert_v1beta1_ManagedRemoteAccess_To_v1alpha3_ManagedRemoteAccess(in *v1beta1.ManagedRemoteAccess, out *ManagedRemoteAccess, s conversion.Scope) error { out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) out.SourceSecurityGroups = *(*[]string)(unsafe.Pointer(&in.SourceSecurityGroups)) out.Public = in.Public return nil } -// Convert_v1alpha4_ManagedRemoteAccess_To_v1alpha3_ManagedRemoteAccess is an autogenerated conversion function. -func Convert_v1alpha4_ManagedRemoteAccess_To_v1alpha3_ManagedRemoteAccess(in *v1alpha4.ManagedRemoteAccess, out *ManagedRemoteAccess, s conversion.Scope) error { - return autoConvert_v1alpha4_ManagedRemoteAccess_To_v1alpha3_ManagedRemoteAccess(in, out, s) +// Convert_v1beta1_ManagedRemoteAccess_To_v1alpha3_ManagedRemoteAccess is an autogenerated conversion function. +func Convert_v1beta1_ManagedRemoteAccess_To_v1alpha3_ManagedRemoteAccess(in *v1beta1.ManagedRemoteAccess, out *ManagedRemoteAccess, s conversion.Scope) error { + return autoConvert_v1beta1_ManagedRemoteAccess_To_v1alpha3_ManagedRemoteAccess(in, out, s) } -func autoConvert_v1alpha3_MixedInstancesPolicy_To_v1alpha4_MixedInstancesPolicy(in *MixedInstancesPolicy, out *v1alpha4.MixedInstancesPolicy, s conversion.Scope) error { - out.InstancesDistribution = (*v1alpha4.InstancesDistribution)(unsafe.Pointer(in.InstancesDistribution)) - out.Overrides = *(*[]v1alpha4.Overrides)(unsafe.Pointer(&in.Overrides)) +func autoConvert_v1alpha3_MixedInstancesPolicy_To_v1beta1_MixedInstancesPolicy(in *MixedInstancesPolicy, out *v1beta1.MixedInstancesPolicy, s conversion.Scope) error { + out.InstancesDistribution = (*v1beta1.InstancesDistribution)(unsafe.Pointer(in.InstancesDistribution)) + out.Overrides = *(*[]v1beta1.Overrides)(unsafe.Pointer(&in.Overrides)) return nil } -// Convert_v1alpha3_MixedInstancesPolicy_To_v1alpha4_MixedInstancesPolicy is an autogenerated conversion function. -func Convert_v1alpha3_MixedInstancesPolicy_To_v1alpha4_MixedInstancesPolicy(in *MixedInstancesPolicy, out *v1alpha4.MixedInstancesPolicy, s conversion.Scope) error { - return autoConvert_v1alpha3_MixedInstancesPolicy_To_v1alpha4_MixedInstancesPolicy(in, out, s) +// Convert_v1alpha3_MixedInstancesPolicy_To_v1beta1_MixedInstancesPolicy is an autogenerated conversion function. +func Convert_v1alpha3_MixedInstancesPolicy_To_v1beta1_MixedInstancesPolicy(in *MixedInstancesPolicy, out *v1beta1.MixedInstancesPolicy, s conversion.Scope) error { + return autoConvert_v1alpha3_MixedInstancesPolicy_To_v1beta1_MixedInstancesPolicy(in, out, s) } -func autoConvert_v1alpha4_MixedInstancesPolicy_To_v1alpha3_MixedInstancesPolicy(in *v1alpha4.MixedInstancesPolicy, out *MixedInstancesPolicy, s conversion.Scope) error { +func autoConvert_v1beta1_MixedInstancesPolicy_To_v1alpha3_MixedInstancesPolicy(in *v1beta1.MixedInstancesPolicy, out *MixedInstancesPolicy, s conversion.Scope) error { out.InstancesDistribution = (*InstancesDistribution)(unsafe.Pointer(in.InstancesDistribution)) out.Overrides = *(*[]Overrides)(unsafe.Pointer(&in.Overrides)) return nil } -// Convert_v1alpha4_MixedInstancesPolicy_To_v1alpha3_MixedInstancesPolicy is an autogenerated conversion function. -func Convert_v1alpha4_MixedInstancesPolicy_To_v1alpha3_MixedInstancesPolicy(in *v1alpha4.MixedInstancesPolicy, out *MixedInstancesPolicy, s conversion.Scope) error { - return autoConvert_v1alpha4_MixedInstancesPolicy_To_v1alpha3_MixedInstancesPolicy(in, out, s) +// Convert_v1beta1_MixedInstancesPolicy_To_v1alpha3_MixedInstancesPolicy is an autogenerated conversion function. +func Convert_v1beta1_MixedInstancesPolicy_To_v1alpha3_MixedInstancesPolicy(in *v1beta1.MixedInstancesPolicy, out *MixedInstancesPolicy, s conversion.Scope) error { + return autoConvert_v1beta1_MixedInstancesPolicy_To_v1alpha3_MixedInstancesPolicy(in, out, s) } -func autoConvert_v1alpha3_Overrides_To_v1alpha4_Overrides(in *Overrides, out *v1alpha4.Overrides, s conversion.Scope) error { +func autoConvert_v1alpha3_Overrides_To_v1beta1_Overrides(in *Overrides, out *v1beta1.Overrides, s conversion.Scope) error { out.InstanceType = in.InstanceType return nil } -// Convert_v1alpha3_Overrides_To_v1alpha4_Overrides is an autogenerated conversion function. -func Convert_v1alpha3_Overrides_To_v1alpha4_Overrides(in *Overrides, out *v1alpha4.Overrides, s conversion.Scope) error { - return autoConvert_v1alpha3_Overrides_To_v1alpha4_Overrides(in, out, s) +// Convert_v1alpha3_Overrides_To_v1beta1_Overrides is an autogenerated conversion function. +func Convert_v1alpha3_Overrides_To_v1beta1_Overrides(in *Overrides, out *v1beta1.Overrides, s conversion.Scope) error { + return autoConvert_v1alpha3_Overrides_To_v1beta1_Overrides(in, out, s) } -func autoConvert_v1alpha4_Overrides_To_v1alpha3_Overrides(in *v1alpha4.Overrides, out *Overrides, s conversion.Scope) error { +func autoConvert_v1beta1_Overrides_To_v1alpha3_Overrides(in *v1beta1.Overrides, out *Overrides, s conversion.Scope) error { out.InstanceType = in.InstanceType return nil } -// Convert_v1alpha4_Overrides_To_v1alpha3_Overrides is an autogenerated conversion function. -func Convert_v1alpha4_Overrides_To_v1alpha3_Overrides(in *v1alpha4.Overrides, out *Overrides, s conversion.Scope) error { - return autoConvert_v1alpha4_Overrides_To_v1alpha3_Overrides(in, out, s) +// Convert_v1beta1_Overrides_To_v1alpha3_Overrides is an autogenerated conversion function. +func Convert_v1beta1_Overrides_To_v1alpha3_Overrides(in *v1beta1.Overrides, out *Overrides, s conversion.Scope) error { + return autoConvert_v1beta1_Overrides_To_v1alpha3_Overrides(in, out, s) } -func autoConvert_v1alpha3_RefreshPreferences_To_v1alpha4_RefreshPreferences(in *RefreshPreferences, out *v1alpha4.RefreshPreferences, s conversion.Scope) error { +func autoConvert_v1alpha3_RefreshPreferences_To_v1beta1_RefreshPreferences(in *RefreshPreferences, out *v1beta1.RefreshPreferences, s conversion.Scope) error { out.Strategy = (*string)(unsafe.Pointer(in.Strategy)) out.InstanceWarmup = (*int64)(unsafe.Pointer(in.InstanceWarmup)) out.MinHealthyPercentage = (*int64)(unsafe.Pointer(in.MinHealthyPercentage)) return nil } -// Convert_v1alpha3_RefreshPreferences_To_v1alpha4_RefreshPreferences is an autogenerated conversion function. -func Convert_v1alpha3_RefreshPreferences_To_v1alpha4_RefreshPreferences(in *RefreshPreferences, out *v1alpha4.RefreshPreferences, s conversion.Scope) error { - return autoConvert_v1alpha3_RefreshPreferences_To_v1alpha4_RefreshPreferences(in, out, s) +// Convert_v1alpha3_RefreshPreferences_To_v1beta1_RefreshPreferences is an autogenerated conversion function. +func Convert_v1alpha3_RefreshPreferences_To_v1beta1_RefreshPreferences(in *RefreshPreferences, out *v1beta1.RefreshPreferences, s conversion.Scope) error { + return autoConvert_v1alpha3_RefreshPreferences_To_v1beta1_RefreshPreferences(in, out, s) } -func autoConvert_v1alpha4_RefreshPreferences_To_v1alpha3_RefreshPreferences(in *v1alpha4.RefreshPreferences, out *RefreshPreferences, s conversion.Scope) error { +func autoConvert_v1beta1_RefreshPreferences_To_v1alpha3_RefreshPreferences(in *v1beta1.RefreshPreferences, out *RefreshPreferences, s conversion.Scope) error { out.Strategy = (*string)(unsafe.Pointer(in.Strategy)) out.InstanceWarmup = (*int64)(unsafe.Pointer(in.InstanceWarmup)) out.MinHealthyPercentage = (*int64)(unsafe.Pointer(in.MinHealthyPercentage)) return nil } -// Convert_v1alpha4_RefreshPreferences_To_v1alpha3_RefreshPreferences is an autogenerated conversion function. -func Convert_v1alpha4_RefreshPreferences_To_v1alpha3_RefreshPreferences(in *v1alpha4.RefreshPreferences, out *RefreshPreferences, s conversion.Scope) error { - return autoConvert_v1alpha4_RefreshPreferences_To_v1alpha3_RefreshPreferences(in, out, s) +// Convert_v1beta1_RefreshPreferences_To_v1alpha3_RefreshPreferences is an autogenerated conversion function. +func Convert_v1beta1_RefreshPreferences_To_v1alpha3_RefreshPreferences(in *v1beta1.RefreshPreferences, out *RefreshPreferences, s conversion.Scope) error { + return autoConvert_v1beta1_RefreshPreferences_To_v1alpha3_RefreshPreferences(in, out, s) } diff --git a/exp/api/v1alpha3/zz_generated.deepcopy.go b/exp/api/v1alpha3/zz_generated.deepcopy.go index 02b3cac3c2..62397efc78 100644 --- a/exp/api/v1alpha3/zz_generated.deepcopy.go +++ b/exp/api/v1alpha3/zz_generated.deepcopy.go @@ -21,7 +21,7 @@ limitations under the License. package v1alpha3 import ( - runtime "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime" apiv1alpha3 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" cluster_apiapiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" "sigs.k8s.io/cluster-api/errors" diff --git a/exp/api/v1alpha4/awsfargateprofile_types.go b/exp/api/v1alpha4/awsfargateprofile_types.go index d140aeb7f5..d80bde5b3e 100644 --- a/exp/api/v1alpha4/awsfargateprofile_types.go +++ b/exp/api/v1alpha4/awsfargateprofile_types.go @@ -21,8 +21,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + infrav1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" "sigs.k8s.io/cluster-api/errors" ) @@ -35,7 +36,7 @@ var ( // DefaultEKSFargateRole is the name of the default IAM role to use for fargate // profiles if no other role is supplied in the spec and if iam role creation // is not enabled. The default can be created using clusterawsadm or created manually. - DefaultEKSFargateRole = fmt.Sprintf("eks-fargate%s", infrav1.DefaultNameSuffix) + DefaultEKSFargateRole = fmt.Sprintf("eks-fargate%s", iamv1.DefaultNameSuffix) ) // FargateProfileSpec defines the desired state of FargateProfile @@ -55,7 +56,7 @@ type FargateProfileSpec struct { // AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the // ones added by default. // +optional - AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` + AdditionalTags infrav1alpha4.Tags `json:"additionalTags,omitempty"` // RoleName specifies the name of IAM role for this fargate pool // If the role is pre-existing we will treat it as unmanaged @@ -124,12 +125,11 @@ type FargateProfileStatus struct { // Conditions defines current state of the Fargate profile. // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` } // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsfargateprofiles,scope=Namespaced,categories=cluster-api,shortName=awsfp -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="AWSFargateProfile ready status" // +kubebuilder:printcolumn:name="ProfileName",type="string",JSONPath=".spec.profileName",description="EKS Fargate profile name" @@ -145,12 +145,12 @@ type AWSFargateProfile struct { } // GetConditions returns the observations of the operational state of the AWSFargateProfile resource. -func (r *AWSFargateProfile) GetConditions() clusterv1.Conditions { +func (r *AWSFargateProfile) GetConditions() clusterv1alpha4.Conditions { return r.Status.Conditions } -// SetConditions sets the underlying service state of the AWSFargateProfile to the predescribed clusterv1.Conditions. -func (r *AWSFargateProfile) SetConditions(conditions clusterv1.Conditions) { +// SetConditions sets the underlying service state of the AWSFargateProfile to the predescribed clusterv1alpha4.Conditions. +func (r *AWSFargateProfile) SetConditions(conditions clusterv1alpha4.Conditions) { r.Status.Conditions = conditions } diff --git a/exp/api/v1alpha4/awsmachinepool_types.go b/exp/api/v1alpha4/awsmachinepool_types.go index 76d3ed73bc..802c5bef29 100644 --- a/exp/api/v1alpha4/awsmachinepool_types.go +++ b/exp/api/v1alpha4/awsmachinepool_types.go @@ -19,8 +19,8 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + infrav1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" "sigs.k8s.io/cluster-api/errors" ) @@ -54,12 +54,12 @@ type AWSMachinePoolSpec struct { // Subnets is an array of subnet configurations // +optional - Subnets []infrav1.AWSResourceReference `json:"subnets,omitempty"` + Subnets []infrav1alpha4.AWSResourceReference `json:"subnets,omitempty"` // AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the // AWS provider. // +optional - AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` + AdditionalTags infrav1alpha4.Tags `json:"additionalTags,omitempty"` // AWSLaunchTemplate specifies the launch template and version to use when an instance is launched. // +kubebuilder:validation:Required @@ -119,7 +119,7 @@ type AWSMachinePoolStatus struct { // Conditions defines current service state of the AWSMachinePool. // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` // Instances contains the status for each instance in the pool // +optional @@ -182,7 +182,6 @@ type AWSMachinePoolInstanceStatus struct { // +kubebuilder:object:root=true // +kubebuilder:subresource:status -// +kubebuilder:storageversion // +kubebuilder:resource:path=awsmachinepools,scope=Namespaced,categories=cluster-api,shortName=awsmp // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Machine ready status" // +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Machine ready status" @@ -213,12 +212,12 @@ func init() { } // GetConditions returns the observations of the operational state of the AWSMachinePool resource. -func (r *AWSMachinePool) GetConditions() clusterv1.Conditions { +func (r *AWSMachinePool) GetConditions() clusterv1alpha4.Conditions { return r.Status.Conditions } -// SetConditions sets the underlying service state of the AWSMachinePool to the predescribed clusterv1.Conditions. -func (r *AWSMachinePool) SetConditions(conditions clusterv1.Conditions) { +// SetConditions sets the underlying service state of the AWSMachinePool to the predescribed clusterv1alpha4.Conditions. +func (r *AWSMachinePool) SetConditions(conditions clusterv1alpha4.Conditions) { r.Status.Conditions = conditions } diff --git a/exp/api/v1alpha4/awsmanagedmachinepool_types.go b/exp/api/v1alpha4/awsmanagedmachinepool_types.go index 4c2b0dc1ed..6d062d80ac 100644 --- a/exp/api/v1alpha4/awsmanagedmachinepool_types.go +++ b/exp/api/v1alpha4/awsmanagedmachinepool_types.go @@ -21,8 +21,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + infrav1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" "sigs.k8s.io/cluster-api/errors" ) @@ -57,7 +58,7 @@ var ( // DefaultEKSNodegroupRole is the name of the default IAM role to use for EKS nodegroups // if no other role is supplied in the spec and if iam role creation is not enabled. The default // can be created using clusterawsadm or created manually. - DefaultEKSNodegroupRole = fmt.Sprintf("eks-nodegroup%s", infrav1.DefaultNameSuffix) + DefaultEKSNodegroupRole = fmt.Sprintf("eks-nodegroup%s", iamv1.DefaultNameSuffix) ) // AWSManagedMachinePoolSpec defines the desired state of AWSManagedMachinePool @@ -80,7 +81,7 @@ type AWSManagedMachinePoolSpec struct { // AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the // ones added by default. // +optional - AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` + AdditionalTags infrav1alpha4.Tags `json:"additionalTags,omitempty"` // RoleName specifies the name of IAM role for the node group. // If the role is pre-existing we will treat it as unmanaged @@ -89,12 +90,6 @@ type AWSManagedMachinePoolSpec struct { // +optional RoleName string `json:"roleName,omitempty"` - // RoleAdditionalPolicies allows you to attach additional polices to - // the node group role. You must enable the EKSAllowAddRoles - // feature flag to incorporate these into the created role. - // +optional - RoleAdditionalPolicies []string `json:"roleAdditionalPolicies,omitempty"` - // AMIVersion defines the desired AMI release version. If no version number // is supplied then the latest version for the Kubernetes version // will be used @@ -215,12 +210,11 @@ type AWSManagedMachinePoolStatus struct { // Conditions defines current service state of the managed machine pool // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` } // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsmanagedmachinepools,scope=Namespaced,categories=cluster-api,shortName=awsmmp -// +kubebuilder:storageversion // +kubebuilder:subresource:status // +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="MachinePool ready status" // +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Number of replicas" @@ -235,12 +229,12 @@ type AWSManagedMachinePool struct { } // GetConditions returns the observations of the operational state of the AWSManagedMachinePool resource. -func (r *AWSManagedMachinePool) GetConditions() clusterv1.Conditions { +func (r *AWSManagedMachinePool) GetConditions() clusterv1alpha4.Conditions { return r.Status.Conditions } -// SetConditions sets the underlying service state of the AWSManagedMachinePool to the predescribed clusterv1.Conditions. -func (r *AWSManagedMachinePool) SetConditions(conditions clusterv1.Conditions) { +// SetConditions sets the underlying service state of the AWSManagedMachinePool to the predescribed clusterv1alpha4.Conditions. +func (r *AWSManagedMachinePool) SetConditions(conditions clusterv1alpha4.Conditions) { r.Status.Conditions = conditions } diff --git a/exp/api/v1alpha4/conditions_consts.go b/exp/api/v1alpha4/conditions_consts.go index 9efb66c048..88a13126dd 100644 --- a/exp/api/v1alpha4/conditions_consts.go +++ b/exp/api/v1alpha4/conditions_consts.go @@ -16,11 +16,11 @@ limitations under the License. package v1alpha4 -import clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" +import clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" const ( // ASGReadyCondition reports on current status of the autoscaling group. Ready indicates the group is provisioned. - ASGReadyCondition clusterv1.ConditionType = "ASGReady" + ASGReadyCondition clusterv1alpha4.ConditionType = "ASGReady" // ASGNotFoundReason used when the autoscaling group couldn't be retrieved. ASGNotFoundReason = "ASGNotFound" // ASGProvisionFailedReason used for failures during autoscaling group provisioning. @@ -29,14 +29,14 @@ const ( ASGDeletionInProgress = "ASGDeletionInProgress" // LaunchTemplateReadyCondition represents the status of an AWSMachinePool's associated Launch Template. - LaunchTemplateReadyCondition clusterv1.ConditionType = "LaunchTemplateReady" + LaunchTemplateReadyCondition clusterv1alpha4.ConditionType = "LaunchTemplateReady" // LaunchTemplateNotFoundReason is used when an associated Launch Template can't be found. LaunchTemplateNotFoundReason = "LaunchTemplateNotFound" // LaunchTemplateCreateFailedReason used for failures during Launch Template creation. LaunchTemplateCreateFailedReason = "LaunchTemplateCreateFailed" // InstanceRefreshStartedCondition reports on successfully starting instance refresh. - InstanceRefreshStartedCondition clusterv1.ConditionType = "InstanceRefreshStarted" + InstanceRefreshStartedCondition clusterv1alpha4.ConditionType = "InstanceRefreshStarted" // InstanceRefreshNotReadyReason used to report instance refresh is not initiated. // If there are instance refreshes that are in progress, then a new instance refresh request will fail. InstanceRefreshNotReadyReason = "InstanceRefreshNotReady" @@ -46,7 +46,7 @@ const ( const ( // EKSNodegroupReadyCondition condition reports on the successful reconciliation of eks control plane. - EKSNodegroupReadyCondition clusterv1.ConditionType = "EKSNodegroupReady" + EKSNodegroupReadyCondition clusterv1alpha4.ConditionType = "EKSNodegroupReady" // EKSNodegroupReconciliationFailedReason used to report failures while reconciling EKS control plane. EKSNodegroupReconciliationFailedReason = "EKSNodegroupReconciliationFailed" // WaitingForEKSControlPlaneReason used when the machine pool is waiting for @@ -56,10 +56,10 @@ const ( const ( // EKSFargateProfileReadyCondition condition reports on the successful reconciliation of eks control plane. - EKSFargateProfileReadyCondition clusterv1.ConditionType = "EKSFargateProfileReady" + EKSFargateProfileReadyCondition clusterv1alpha4.ConditionType = "EKSFargateProfileReady" // EKSFargateCreatingCondition condition reports on whether the fargate // profile is creating. - EKSFargateCreatingCondition clusterv1.ConditionType = "EKSFargateCreating" + EKSFargateCreatingCondition clusterv1alpha4.ConditionType = "EKSFargateCreating" // EKSFargateDeletingCondition used to report that the profile is deleting. EKSFargateDeletingCondition = "EKSFargateDeleting" // EKSFargateReconciliationFailedReason used to report failures while reconciling EKS control plane. @@ -79,13 +79,13 @@ const ( const ( // IAMNodegroupRolesReadyCondition condition reports on the successful // reconciliation of EKS nodegroup iam roles. - IAMNodegroupRolesReadyCondition clusterv1.ConditionType = "IAMNodegroupRolesReady" + IAMNodegroupRolesReadyCondition clusterv1alpha4.ConditionType = "IAMNodegroupRolesReady" // IAMNodegroupRolesReconciliationFailedReason used to report failures while // reconciling EKS nodegroup iam roles. IAMNodegroupRolesReconciliationFailedReason = "IAMNodegroupRolesReconciliationFailed" // IAMFargateRolesReadyCondition condition reports on the successful // reconciliation of EKS nodegroup iam roles. - IAMFargateRolesReadyCondition clusterv1.ConditionType = "IAMFargateRolesReady" + IAMFargateRolesReadyCondition clusterv1alpha4.ConditionType = "IAMFargateRolesReady" // IAMFargateRolesReconciliationFailedReason used to report failures while // reconciling EKS nodegroup iam roles. IAMFargateRolesReconciliationFailedReason = "IAMFargateRolesReconciliationFailed" diff --git a/exp/api/v1alpha4/conversion.go b/exp/api/v1alpha4/conversion.go index 3cade6334a..baa3cbe8c7 100644 --- a/exp/api/v1alpha4/conversion.go +++ b/exp/api/v1alpha4/conversion.go @@ -16,20 +16,133 @@ limitations under the License. package v1alpha4 -// Hub marks AWSMachinePool as a conversion hub. -func (*AWSMachinePool) Hub() {} +import ( + apiconversion "k8s.io/apimachinery/pkg/conversion" + infrav1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" + utilconversion "sigs.k8s.io/cluster-api/util/conversion" + "sigs.k8s.io/controller-runtime/pkg/conversion" +) -// Hub marks AWSMachinePoolList as a conversion hub. -func (*AWSMachinePoolList) Hub() {} +// ConvertTo converts the v1alpha4 AWSMachinePool receiver to a v1beta1 AWSMachinePool. +func (src *AWSMachinePool) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1exp.AWSMachinePool) + return Convert_v1alpha4_AWSMachinePool_To_v1beta1_AWSMachinePool(src, dst, nil) +} -// Hub marks AWSManagedMachinePool as a conversion hub. -func (*AWSManagedMachinePool) Hub() {} +// ConvertFrom converts the v1beta1 AWSMachinePool receiver to v1alpha4 AWSMachinePool. +func (r *AWSMachinePool) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1exp.AWSMachinePool) -// Hub marks AWSManagedMachinePoolList as a conversion hub. -func (*AWSManagedMachinePoolList) Hub() {} + return Convert_v1beta1_AWSMachinePool_To_v1alpha4_AWSMachinePool(src, r, nil) +} -// Hub marks AWSFargateProfile as a conversion hub. -func (*AWSFargateProfile) Hub() {} +// ConvertTo converts the v1alpha4 AWSMachinePoolList receiver to a v1beta1 AWSMachinePoolList. +func (src *AWSMachinePoolList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1exp.AWSMachinePoolList) + return Convert_v1alpha4_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList(src, dst, nil) +} -// Hub marks AWSFargateProfileList as a conversion hub. -func (*AWSFargateProfileList) Hub() {} +// ConvertFrom converts the v1beta1 AWSMachinePoolList receiver to v1alpha4 AWSMachinePoolList. +func (r *AWSMachinePoolList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1exp.AWSMachinePoolList) + + return Convert_v1beta1_AWSMachinePoolList_To_v1alpha4_AWSMachinePoolList(src, r, nil) +} + +// ConvertTo converts the v1alpha4 AWSManagedMachinePool receiver to a v1beta1 AWSManagedMachinePool. +func (src *AWSManagedMachinePool) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1exp.AWSManagedMachinePool) + if err := Convert_v1alpha4_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(src, dst, nil); err != nil { + return err + } + + restored := &infrav1exp.AWSManagedMachinePool{} + if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { + return err + } + + dst.Spec.RoleAdditionalPolicies = restored.Spec.RoleAdditionalPolicies + + return nil +} + +// ConvertFrom converts the v1beta1 AWSManagedMachinePool receiver to v1alpha4 AWSManagedMachinePool. +func (r *AWSManagedMachinePool) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1exp.AWSManagedMachinePool) + + if err := Convert_v1beta1_AWSManagedMachinePool_To_v1alpha4_AWSManagedMachinePool(src, r, nil); err != nil { + return err + } + + if err := utilconversion.MarshalData(src, r); err != nil { + return err + } + + return nil +} + +// Convert_v1beta1_AWSManagedMachinePoolSpec_To_v1alpha4_AWSManagedMachinePoolSpec is a conversion function. +func Convert_v1beta1_AWSManagedMachinePoolSpec_To_v1alpha4_AWSManagedMachinePoolSpec(in *infrav1exp.AWSManagedMachinePoolSpec, out *AWSManagedMachinePoolSpec, s apiconversion.Scope) error { + return autoConvert_v1beta1_AWSManagedMachinePoolSpec_To_v1alpha4_AWSManagedMachinePoolSpec(in, out, s) +} + +// ConvertTo converts the v1alpha4 AWSManagedMachinePoolList receiver to a v1beta1 AWSManagedMachinePoolList. +func (src *AWSManagedMachinePoolList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1exp.AWSManagedMachinePoolList) + return Convert_v1alpha4_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList(src, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSManagedMachinePoolList receiver to v1alpha4 AWSManagedMachinePoolList. +func (r *AWSManagedMachinePoolList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1exp.AWSManagedMachinePoolList) + + return Convert_v1beta1_AWSManagedMachinePoolList_To_v1alpha4_AWSManagedMachinePoolList(src, r, nil) +} + +// ConvertTo converts the v1alpha4 AWSFargateProfile receiver to a v1beta1 AWSFargateProfile. +func (src *AWSFargateProfile) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1exp.AWSFargateProfile) + return Convert_v1alpha4_AWSFargateProfile_To_v1beta1_AWSFargateProfile(src, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSFargateProfile receiver to v1alpha4 AWSFargateProfile. +func (r *AWSFargateProfile) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1exp.AWSFargateProfile) + + return Convert_v1beta1_AWSFargateProfile_To_v1alpha4_AWSFargateProfile(src, r, nil) +} + +// ConvertTo converts the v1alpha4 AWSFargateProfileList receiver to a v1beta1 AWSFargateProfileList. +func (src *AWSFargateProfileList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*infrav1exp.AWSFargateProfileList) + return Convert_v1alpha4_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList(src, dst, nil) +} + +// ConvertFrom converts the v1beta1 AWSFargateProfileList receiver to v1alpha4 AWSFargateProfileList. +func (r *AWSFargateProfileList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*infrav1exp.AWSFargateProfileList) + + return Convert_v1beta1_AWSFargateProfileList_To_v1alpha4_AWSFargateProfileList(src, r, nil) +} + +// Convert_v1alpha4_AMIReference_To_v1beta1_AMIReference converts the v1alpha4 AMIReference receiver to a v1beta1 AMIReference. +func Convert_v1alpha4_AMIReference_To_v1beta1_AMIReference(in *infrav1alpha4.AMIReference, out *infrav1.AMIReference, s apiconversion.Scope) error { + return infrav1alpha4.Convert_v1alpha4_AMIReference_To_v1beta1_AMIReference(in, out, s) +} + +// Convert_v1beta1_AMIReference_To_v1alpha4_AMIReference converts the v1beta1 AMIReference receiver to a v1alpha4 AMIReference. +func Convert_v1beta1_AMIReference_To_v1alpha4_AMIReference(in *infrav1.AMIReference, out *infrav1alpha4.AMIReference, s apiconversion.Scope) error { + return infrav1alpha4.Convert_v1beta1_AMIReference_To_v1alpha4_AMIReference(in, out, s) +} + +// Convert_v1beta1_Instance_To_v1alpha4_Instance is a conversion function. +func Convert_v1beta1_Instance_To_v1alpha4_Instance(in *infrav1.Instance, out *infrav1alpha4.Instance, s apiconversion.Scope) error { + return infrav1alpha4.Convert_v1beta1_Instance_To_v1alpha4_Instance(in, out, s) +} + +// Convert_v1alpha4_Instance_To_v1beta1_Instance is a conversion function. +func Convert_v1alpha4_Instance_To_v1beta1_Instance(in *infrav1alpha4.Instance, out *infrav1.Instance, s apiconversion.Scope) error { + return infrav1alpha4.Convert_v1alpha4_Instance_To_v1beta1_Instance(in, out, s) +} diff --git a/exp/api/v1alpha4/conversion_test.go b/exp/api/v1alpha4/conversion_test.go new file mode 100644 index 0000000000..88498f1ca7 --- /dev/null +++ b/exp/api/v1alpha4/conversion_test.go @@ -0,0 +1,52 @@ +/* +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" + + runtime "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" + utilconversion "sigs.k8s.io/cluster-api/util/conversion" +) + +func TestFuzzyConversion(t *testing.T) { + g := NewWithT(t) + scheme := runtime.NewScheme() + g.Expect(AddToScheme(scheme)).To(Succeed()) + g.Expect(v1beta1.AddToScheme(scheme)).To(Succeed()) + + t.Run("for AWSMachinePool", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1beta1.AWSMachinePool{}, + Spoke: &AWSMachinePool{}, + })) + + t.Run("for AWSManagedMachinePool", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1beta1.AWSManagedMachinePool{}, + Spoke: &AWSManagedMachinePool{}, + })) + + t.Run("for AWSFargateProfile", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1beta1.AWSFargateProfile{}, + Spoke: &AWSFargateProfile{}, + })) +} diff --git a/exp/api/v1alpha4/doc.go b/exp/api/v1alpha4/doc.go index 0ab416e390..478875494a 100644 --- a/exp/api/v1alpha4/doc.go +++ b/exp/api/v1alpha4/doc.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -// +gencrdrefdocs:force // +groupName=infrastructure.cluster.x-k8s.io +// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1 package v1alpha4 diff --git a/exp/api/v1alpha4/groupversion_info.go b/exp/api/v1alpha4/groupversion_info.go index ddb183e3fe..dc337fce90 100644 --- a/exp/api/v1alpha4/groupversion_info.go +++ b/exp/api/v1alpha4/groupversion_info.go @@ -33,4 +33,6 @@ var ( // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme + + localSchemeBuilder = SchemeBuilder.SchemeBuilder ) diff --git a/exp/api/v1alpha4/types.go b/exp/api/v1alpha4/types.go index 59f0f457ce..a90a86397c 100644 --- a/exp/api/v1alpha4/types.go +++ b/exp/api/v1alpha4/types.go @@ -18,7 +18,7 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" ) // EBS can be used to automatically set up EBS volumes when an instance is launched. @@ -65,7 +65,7 @@ type AWSLaunchTemplate struct { // AMI is the reference to the AMI from which to create the machine instance. // +optional - AMI infrav1.AMIReference `json:"ami,omitempty"` + AMI infrav1alpha4.AMIReference `json:"ami,omitempty"` // ImageLookupFormat is the AMI naming format to look up the image for this // machine It will be ignored if an explicit AMI is set. Supports @@ -93,7 +93,7 @@ type AWSLaunchTemplate struct { // RootVolume encapsulates the configuration options for the root volume // +optional - RootVolume *infrav1.Volume `json:"rootVolume,omitempty"` + RootVolume *infrav1alpha4.Volume `json:"rootVolume,omitempty"` // SSHKeyName is the name of the ssh key to attach to the instance. Valid values are empty string // (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name) @@ -111,7 +111,7 @@ type AWSLaunchTemplate struct { // instances. These security groups would be set in addition to any security groups defined // at the cluster level or in the actuator. // +optional - AdditionalSecurityGroups []infrav1.AWSResourceReference `json:"additionalSecurityGroups,omitempty"` + AdditionalSecurityGroups []infrav1alpha4.AWSResourceReference `json:"additionalSecurityGroups,omitempty"` } // Overrides are used to override the instance type specified by the launch template with multiple @@ -172,20 +172,20 @@ type Tags map[string]string // AutoScalingGroup describes an AWS autoscaling group. type AutoScalingGroup struct { // The tags associated with the instance. - ID string `json:"id,omitempty"` - Tags infrav1.Tags `json:"tags,omitempty"` - Name string `json:"name,omitempty"` - DesiredCapacity *int32 `json:"desiredCapacity,omitempty"` - MaxSize int32 `json:"maxSize,omitempty"` - MinSize int32 `json:"minSize,omitempty"` - PlacementGroup string `json:"placementGroup,omitempty"` - Subnets []string `json:"subnets,omitempty"` - DefaultCoolDown metav1.Duration `json:"defaultCoolDown,omitempty"` - CapacityRebalance bool `json:"capacityRebalance,omitempty"` + ID string `json:"id,omitempty"` + Tags infrav1alpha4.Tags `json:"tags,omitempty"` + Name string `json:"name,omitempty"` + DesiredCapacity *int32 `json:"desiredCapacity,omitempty"` + MaxSize int32 `json:"maxSize,omitempty"` + MinSize int32 `json:"minSize,omitempty"` + PlacementGroup string `json:"placementGroup,omitempty"` + Subnets []string `json:"subnets,omitempty"` + DefaultCoolDown metav1.Duration `json:"defaultCoolDown,omitempty"` + CapacityRebalance bool `json:"capacityRebalance,omitempty"` MixedInstancesPolicy *MixedInstancesPolicy `json:"mixedInstancesPolicy,omitempty"` Status ASGStatus - Instances []infrav1.Instance `json:"instances,omitempty"` + Instances []infrav1alpha4.Instance `json:"instances,omitempty"` } // ASGStatus is a status string returned by the autoscaling API diff --git a/exp/api/v1alpha4/zz_generated.conversion.go b/exp/api/v1alpha4/zz_generated.conversion.go new file mode 100644 index 0000000000..0c3aa31e8b --- /dev/null +++ b/exp/api/v1alpha4/zz_generated.conversion.go @@ -0,0 +1,1168 @@ +// +build !ignore_autogenerated_conversions + +/* +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-provider-aws/api/v1alpha4" + apiv1beta1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" + clusterapiapiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterapiapiv1beta1 "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((*AWSFargateProfile)(nil), (*v1beta1.AWSFargateProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSFargateProfile_To_v1beta1_AWSFargateProfile(a.(*AWSFargateProfile), b.(*v1beta1.AWSFargateProfile), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSFargateProfile)(nil), (*AWSFargateProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSFargateProfile_To_v1alpha4_AWSFargateProfile(a.(*v1beta1.AWSFargateProfile), b.(*AWSFargateProfile), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSFargateProfileList)(nil), (*v1beta1.AWSFargateProfileList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList(a.(*AWSFargateProfileList), b.(*v1beta1.AWSFargateProfileList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSFargateProfileList)(nil), (*AWSFargateProfileList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSFargateProfileList_To_v1alpha4_AWSFargateProfileList(a.(*v1beta1.AWSFargateProfileList), b.(*AWSFargateProfileList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSLaunchTemplate)(nil), (*v1beta1.AWSLaunchTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate(a.(*AWSLaunchTemplate), b.(*v1beta1.AWSLaunchTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSLaunchTemplate)(nil), (*AWSLaunchTemplate)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSLaunchTemplate_To_v1alpha4_AWSLaunchTemplate(a.(*v1beta1.AWSLaunchTemplate), b.(*AWSLaunchTemplate), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSMachinePool)(nil), (*v1beta1.AWSMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSMachinePool_To_v1beta1_AWSMachinePool(a.(*AWSMachinePool), b.(*v1beta1.AWSMachinePool), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachinePool)(nil), (*AWSMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachinePool_To_v1alpha4_AWSMachinePool(a.(*v1beta1.AWSMachinePool), b.(*AWSMachinePool), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSMachinePoolInstanceStatus)(nil), (*v1beta1.AWSMachinePoolInstanceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSMachinePoolInstanceStatus_To_v1beta1_AWSMachinePoolInstanceStatus(a.(*AWSMachinePoolInstanceStatus), b.(*v1beta1.AWSMachinePoolInstanceStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachinePoolInstanceStatus)(nil), (*AWSMachinePoolInstanceStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachinePoolInstanceStatus_To_v1alpha4_AWSMachinePoolInstanceStatus(a.(*v1beta1.AWSMachinePoolInstanceStatus), b.(*AWSMachinePoolInstanceStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSMachinePoolList)(nil), (*v1beta1.AWSMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList(a.(*AWSMachinePoolList), b.(*v1beta1.AWSMachinePoolList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachinePoolList)(nil), (*AWSMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachinePoolList_To_v1alpha4_AWSMachinePoolList(a.(*v1beta1.AWSMachinePoolList), b.(*AWSMachinePoolList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSMachinePoolSpec)(nil), (*v1beta1.AWSMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSMachinePoolSpec_To_v1beta1_AWSMachinePoolSpec(a.(*AWSMachinePoolSpec), b.(*v1beta1.AWSMachinePoolSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachinePoolSpec)(nil), (*AWSMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachinePoolSpec_To_v1alpha4_AWSMachinePoolSpec(a.(*v1beta1.AWSMachinePoolSpec), b.(*AWSMachinePoolSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSMachinePoolStatus)(nil), (*v1beta1.AWSMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSMachinePoolStatus_To_v1beta1_AWSMachinePoolStatus(a.(*AWSMachinePoolStatus), b.(*v1beta1.AWSMachinePoolStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSMachinePoolStatus)(nil), (*AWSMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSMachinePoolStatus_To_v1alpha4_AWSMachinePoolStatus(a.(*v1beta1.AWSMachinePoolStatus), b.(*AWSMachinePoolStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSManagedMachinePool)(nil), (*v1beta1.AWSManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(a.(*AWSManagedMachinePool), b.(*v1beta1.AWSManagedMachinePool), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSManagedMachinePool)(nil), (*AWSManagedMachinePool)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSManagedMachinePool_To_v1alpha4_AWSManagedMachinePool(a.(*v1beta1.AWSManagedMachinePool), b.(*AWSManagedMachinePool), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSManagedMachinePoolList)(nil), (*v1beta1.AWSManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList(a.(*AWSManagedMachinePoolList), b.(*v1beta1.AWSManagedMachinePoolList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSManagedMachinePoolList)(nil), (*AWSManagedMachinePoolList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSManagedMachinePoolList_To_v1alpha4_AWSManagedMachinePoolList(a.(*v1beta1.AWSManagedMachinePoolList), b.(*AWSManagedMachinePoolList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSManagedMachinePoolSpec)(nil), (*v1beta1.AWSManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec(a.(*AWSManagedMachinePoolSpec), b.(*v1beta1.AWSManagedMachinePoolSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSManagedMachinePoolStatus)(nil), (*v1beta1.AWSManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus(a.(*AWSManagedMachinePoolStatus), b.(*v1beta1.AWSManagedMachinePoolStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AWSManagedMachinePoolStatus)(nil), (*AWSManagedMachinePoolStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSManagedMachinePoolStatus_To_v1alpha4_AWSManagedMachinePoolStatus(a.(*v1beta1.AWSManagedMachinePoolStatus), b.(*AWSManagedMachinePoolStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AutoScalingGroup)(nil), (*v1beta1.AutoScalingGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AutoScalingGroup_To_v1beta1_AutoScalingGroup(a.(*AutoScalingGroup), b.(*v1beta1.AutoScalingGroup), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.AutoScalingGroup)(nil), (*AutoScalingGroup)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AutoScalingGroup_To_v1alpha4_AutoScalingGroup(a.(*v1beta1.AutoScalingGroup), b.(*AutoScalingGroup), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*BlockDeviceMapping)(nil), (*v1beta1.BlockDeviceMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_BlockDeviceMapping_To_v1beta1_BlockDeviceMapping(a.(*BlockDeviceMapping), b.(*v1beta1.BlockDeviceMapping), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.BlockDeviceMapping)(nil), (*BlockDeviceMapping)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_BlockDeviceMapping_To_v1alpha4_BlockDeviceMapping(a.(*v1beta1.BlockDeviceMapping), b.(*BlockDeviceMapping), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*EBS)(nil), (*v1beta1.EBS)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_EBS_To_v1beta1_EBS(a.(*EBS), b.(*v1beta1.EBS), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.EBS)(nil), (*EBS)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_EBS_To_v1alpha4_EBS(a.(*v1beta1.EBS), b.(*EBS), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*FargateProfileSpec)(nil), (*v1beta1.FargateProfileSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_FargateProfileSpec_To_v1beta1_FargateProfileSpec(a.(*FargateProfileSpec), b.(*v1beta1.FargateProfileSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.FargateProfileSpec)(nil), (*FargateProfileSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_FargateProfileSpec_To_v1alpha4_FargateProfileSpec(a.(*v1beta1.FargateProfileSpec), b.(*FargateProfileSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*FargateProfileStatus)(nil), (*v1beta1.FargateProfileStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_FargateProfileStatus_To_v1beta1_FargateProfileStatus(a.(*FargateProfileStatus), b.(*v1beta1.FargateProfileStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.FargateProfileStatus)(nil), (*FargateProfileStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_FargateProfileStatus_To_v1alpha4_FargateProfileStatus(a.(*v1beta1.FargateProfileStatus), b.(*FargateProfileStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*FargateSelector)(nil), (*v1beta1.FargateSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_FargateSelector_To_v1beta1_FargateSelector(a.(*FargateSelector), b.(*v1beta1.FargateSelector), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.FargateSelector)(nil), (*FargateSelector)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_FargateSelector_To_v1alpha4_FargateSelector(a.(*v1beta1.FargateSelector), b.(*FargateSelector), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*InstancesDistribution)(nil), (*v1beta1.InstancesDistribution)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_InstancesDistribution_To_v1beta1_InstancesDistribution(a.(*InstancesDistribution), b.(*v1beta1.InstancesDistribution), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.InstancesDistribution)(nil), (*InstancesDistribution)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_InstancesDistribution_To_v1alpha4_InstancesDistribution(a.(*v1beta1.InstancesDistribution), b.(*InstancesDistribution), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ManagedMachinePoolScaling)(nil), (*v1beta1.ManagedMachinePoolScaling)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ManagedMachinePoolScaling_To_v1beta1_ManagedMachinePoolScaling(a.(*ManagedMachinePoolScaling), b.(*v1beta1.ManagedMachinePoolScaling), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ManagedMachinePoolScaling)(nil), (*ManagedMachinePoolScaling)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ManagedMachinePoolScaling_To_v1alpha4_ManagedMachinePoolScaling(a.(*v1beta1.ManagedMachinePoolScaling), b.(*ManagedMachinePoolScaling), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*ManagedRemoteAccess)(nil), (*v1beta1.ManagedRemoteAccess)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_ManagedRemoteAccess_To_v1beta1_ManagedRemoteAccess(a.(*ManagedRemoteAccess), b.(*v1beta1.ManagedRemoteAccess), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.ManagedRemoteAccess)(nil), (*ManagedRemoteAccess)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_ManagedRemoteAccess_To_v1alpha4_ManagedRemoteAccess(a.(*v1beta1.ManagedRemoteAccess), b.(*ManagedRemoteAccess), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*MixedInstancesPolicy)(nil), (*v1beta1.MixedInstancesPolicy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_MixedInstancesPolicy_To_v1beta1_MixedInstancesPolicy(a.(*MixedInstancesPolicy), b.(*v1beta1.MixedInstancesPolicy), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.MixedInstancesPolicy)(nil), (*MixedInstancesPolicy)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_MixedInstancesPolicy_To_v1alpha4_MixedInstancesPolicy(a.(*v1beta1.MixedInstancesPolicy), b.(*MixedInstancesPolicy), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Overrides)(nil), (*v1beta1.Overrides)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Overrides_To_v1beta1_Overrides(a.(*Overrides), b.(*v1beta1.Overrides), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.Overrides)(nil), (*Overrides)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Overrides_To_v1alpha4_Overrides(a.(*v1beta1.Overrides), b.(*Overrides), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*RefreshPreferences)(nil), (*v1beta1.RefreshPreferences)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_RefreshPreferences_To_v1beta1_RefreshPreferences(a.(*RefreshPreferences), b.(*v1beta1.RefreshPreferences), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.RefreshPreferences)(nil), (*RefreshPreferences)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_RefreshPreferences_To_v1alpha4_RefreshPreferences(a.(*v1beta1.RefreshPreferences), b.(*RefreshPreferences), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*Taint)(nil), (*v1beta1.Taint)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Taint_To_v1beta1_Taint(a.(*Taint), b.(*v1beta1.Taint), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1beta1.Taint)(nil), (*Taint)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Taint_To_v1alpha4_Taint(a.(*v1beta1.Taint), b.(*Taint), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*apiv1alpha4.AMIReference)(nil), (*apiv1beta1.AMIReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AMIReference_To_v1beta1_AMIReference(a.(*apiv1alpha4.AMIReference), b.(*apiv1beta1.AMIReference), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*apiv1alpha4.Instance)(nil), (*apiv1beta1.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Instance_To_v1beta1_Instance(a.(*apiv1alpha4.Instance), b.(*apiv1beta1.Instance), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*apiv1beta1.AMIReference)(nil), (*apiv1alpha4.AMIReference)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AMIReference_To_v1alpha4_AMIReference(a.(*apiv1beta1.AMIReference), b.(*apiv1alpha4.AMIReference), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*v1beta1.AWSManagedMachinePoolSpec)(nil), (*AWSManagedMachinePoolSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_AWSManagedMachinePoolSpec_To_v1alpha4_AWSManagedMachinePoolSpec(a.(*v1beta1.AWSManagedMachinePoolSpec), b.(*AWSManagedMachinePoolSpec), scope) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*apiv1beta1.Instance)(nil), (*apiv1alpha4.Instance)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1beta1_Instance_To_v1alpha4_Instance(a.(*apiv1beta1.Instance), b.(*apiv1alpha4.Instance), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha4_AWSFargateProfile_To_v1beta1_AWSFargateProfile(in *AWSFargateProfile, out *v1beta1.AWSFargateProfile, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_FargateProfileSpec_To_v1beta1_FargateProfileSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_FargateProfileStatus_To_v1beta1_FargateProfileStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSFargateProfile_To_v1beta1_AWSFargateProfile is an autogenerated conversion function. +func Convert_v1alpha4_AWSFargateProfile_To_v1beta1_AWSFargateProfile(in *AWSFargateProfile, out *v1beta1.AWSFargateProfile, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSFargateProfile_To_v1beta1_AWSFargateProfile(in, out, s) +} + +func autoConvert_v1beta1_AWSFargateProfile_To_v1alpha4_AWSFargateProfile(in *v1beta1.AWSFargateProfile, out *AWSFargateProfile, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_FargateProfileSpec_To_v1alpha4_FargateProfileSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_FargateProfileStatus_To_v1alpha4_FargateProfileStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AWSFargateProfile_To_v1alpha4_AWSFargateProfile is an autogenerated conversion function. +func Convert_v1beta1_AWSFargateProfile_To_v1alpha4_AWSFargateProfile(in *v1beta1.AWSFargateProfile, out *AWSFargateProfile, s conversion.Scope) error { + return autoConvert_v1beta1_AWSFargateProfile_To_v1alpha4_AWSFargateProfile(in, out, s) +} + +func autoConvert_v1alpha4_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList(in *AWSFargateProfileList, out *v1beta1.AWSFargateProfileList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta1.AWSFargateProfile, len(*in)) + for i := range *in { + if err := Convert_v1alpha4_AWSFargateProfile_To_v1beta1_AWSFargateProfile(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha4_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList is an autogenerated conversion function. +func Convert_v1alpha4_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList(in *AWSFargateProfileList, out *v1beta1.AWSFargateProfileList, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSFargateProfileList_To_v1beta1_AWSFargateProfileList(in, out, s) +} + +func autoConvert_v1beta1_AWSFargateProfileList_To_v1alpha4_AWSFargateProfileList(in *v1beta1.AWSFargateProfileList, out *AWSFargateProfileList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSFargateProfile, len(*in)) + for i := range *in { + if err := Convert_v1beta1_AWSFargateProfile_To_v1alpha4_AWSFargateProfile(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_AWSFargateProfileList_To_v1alpha4_AWSFargateProfileList is an autogenerated conversion function. +func Convert_v1beta1_AWSFargateProfileList_To_v1alpha4_AWSFargateProfileList(in *v1beta1.AWSFargateProfileList, out *AWSFargateProfileList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSFargateProfileList_To_v1alpha4_AWSFargateProfileList(in, out, s) +} + +func autoConvert_v1alpha4_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate(in *AWSLaunchTemplate, out *v1beta1.AWSLaunchTemplate, s conversion.Scope) error { + out.Name = in.Name + out.IamInstanceProfile = in.IamInstanceProfile + if err := Convert_v1alpha4_AMIReference_To_v1beta1_AMIReference(&in.AMI, &out.AMI, s); err != nil { + return err + } + out.ImageLookupFormat = in.ImageLookupFormat + out.ImageLookupOrg = in.ImageLookupOrg + out.ImageLookupBaseOS = in.ImageLookupBaseOS + out.InstanceType = in.InstanceType + out.RootVolume = (*apiv1beta1.Volume)(unsafe.Pointer(in.RootVolume)) + out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) + out.VersionNumber = (*int64)(unsafe.Pointer(in.VersionNumber)) + out.AdditionalSecurityGroups = *(*[]apiv1beta1.AWSResourceReference)(unsafe.Pointer(&in.AdditionalSecurityGroups)) + return nil +} + +// Convert_v1alpha4_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate is an autogenerated conversion function. +func Convert_v1alpha4_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate(in *AWSLaunchTemplate, out *v1beta1.AWSLaunchTemplate, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate(in, out, s) +} + +func autoConvert_v1beta1_AWSLaunchTemplate_To_v1alpha4_AWSLaunchTemplate(in *v1beta1.AWSLaunchTemplate, out *AWSLaunchTemplate, s conversion.Scope) error { + out.Name = in.Name + out.IamInstanceProfile = in.IamInstanceProfile + if err := Convert_v1beta1_AMIReference_To_v1alpha4_AMIReference(&in.AMI, &out.AMI, s); err != nil { + return err + } + out.ImageLookupFormat = in.ImageLookupFormat + out.ImageLookupOrg = in.ImageLookupOrg + out.ImageLookupBaseOS = in.ImageLookupBaseOS + out.InstanceType = in.InstanceType + out.RootVolume = (*apiv1alpha4.Volume)(unsafe.Pointer(in.RootVolume)) + out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) + out.VersionNumber = (*int64)(unsafe.Pointer(in.VersionNumber)) + out.AdditionalSecurityGroups = *(*[]apiv1alpha4.AWSResourceReference)(unsafe.Pointer(&in.AdditionalSecurityGroups)) + return nil +} + +// Convert_v1beta1_AWSLaunchTemplate_To_v1alpha4_AWSLaunchTemplate is an autogenerated conversion function. +func Convert_v1beta1_AWSLaunchTemplate_To_v1alpha4_AWSLaunchTemplate(in *v1beta1.AWSLaunchTemplate, out *AWSLaunchTemplate, s conversion.Scope) error { + return autoConvert_v1beta1_AWSLaunchTemplate_To_v1alpha4_AWSLaunchTemplate(in, out, s) +} + +func autoConvert_v1alpha4_AWSMachinePool_To_v1beta1_AWSMachinePool(in *AWSMachinePool, out *v1beta1.AWSMachinePool, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_AWSMachinePoolSpec_To_v1beta1_AWSMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_AWSMachinePoolStatus_To_v1beta1_AWSMachinePoolStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSMachinePool_To_v1beta1_AWSMachinePool is an autogenerated conversion function. +func Convert_v1alpha4_AWSMachinePool_To_v1beta1_AWSMachinePool(in *AWSMachinePool, out *v1beta1.AWSMachinePool, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSMachinePool_To_v1beta1_AWSMachinePool(in, out, s) +} + +func autoConvert_v1beta1_AWSMachinePool_To_v1alpha4_AWSMachinePool(in *v1beta1.AWSMachinePool, out *AWSMachinePool, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_AWSMachinePoolSpec_To_v1alpha4_AWSMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_AWSMachinePoolStatus_To_v1alpha4_AWSMachinePoolStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AWSMachinePool_To_v1alpha4_AWSMachinePool is an autogenerated conversion function. +func Convert_v1beta1_AWSMachinePool_To_v1alpha4_AWSMachinePool(in *v1beta1.AWSMachinePool, out *AWSMachinePool, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachinePool_To_v1alpha4_AWSMachinePool(in, out, s) +} + +func autoConvert_v1alpha4_AWSMachinePoolInstanceStatus_To_v1beta1_AWSMachinePoolInstanceStatus(in *AWSMachinePoolInstanceStatus, out *v1beta1.AWSMachinePoolInstanceStatus, s conversion.Scope) error { + out.InstanceID = in.InstanceID + out.Version = (*string)(unsafe.Pointer(in.Version)) + return nil +} + +// Convert_v1alpha4_AWSMachinePoolInstanceStatus_To_v1beta1_AWSMachinePoolInstanceStatus is an autogenerated conversion function. +func Convert_v1alpha4_AWSMachinePoolInstanceStatus_To_v1beta1_AWSMachinePoolInstanceStatus(in *AWSMachinePoolInstanceStatus, out *v1beta1.AWSMachinePoolInstanceStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSMachinePoolInstanceStatus_To_v1beta1_AWSMachinePoolInstanceStatus(in, out, s) +} + +func autoConvert_v1beta1_AWSMachinePoolInstanceStatus_To_v1alpha4_AWSMachinePoolInstanceStatus(in *v1beta1.AWSMachinePoolInstanceStatus, out *AWSMachinePoolInstanceStatus, s conversion.Scope) error { + out.InstanceID = in.InstanceID + out.Version = (*string)(unsafe.Pointer(in.Version)) + return nil +} + +// Convert_v1beta1_AWSMachinePoolInstanceStatus_To_v1alpha4_AWSMachinePoolInstanceStatus is an autogenerated conversion function. +func Convert_v1beta1_AWSMachinePoolInstanceStatus_To_v1alpha4_AWSMachinePoolInstanceStatus(in *v1beta1.AWSMachinePoolInstanceStatus, out *AWSMachinePoolInstanceStatus, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachinePoolInstanceStatus_To_v1alpha4_AWSMachinePoolInstanceStatus(in, out, s) +} + +func autoConvert_v1alpha4_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList(in *AWSMachinePoolList, out *v1beta1.AWSMachinePoolList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta1.AWSMachinePool, len(*in)) + for i := range *in { + if err := Convert_v1alpha4_AWSMachinePool_To_v1beta1_AWSMachinePool(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha4_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList is an autogenerated conversion function. +func Convert_v1alpha4_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList(in *AWSMachinePoolList, out *v1beta1.AWSMachinePoolList, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSMachinePoolList_To_v1beta1_AWSMachinePoolList(in, out, s) +} + +func autoConvert_v1beta1_AWSMachinePoolList_To_v1alpha4_AWSMachinePoolList(in *v1beta1.AWSMachinePoolList, out *AWSMachinePoolList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSMachinePool, len(*in)) + for i := range *in { + if err := Convert_v1beta1_AWSMachinePool_To_v1alpha4_AWSMachinePool(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_AWSMachinePoolList_To_v1alpha4_AWSMachinePoolList is an autogenerated conversion function. +func Convert_v1beta1_AWSMachinePoolList_To_v1alpha4_AWSMachinePoolList(in *v1beta1.AWSMachinePoolList, out *AWSMachinePoolList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachinePoolList_To_v1alpha4_AWSMachinePoolList(in, out, s) +} + +func autoConvert_v1alpha4_AWSMachinePoolSpec_To_v1beta1_AWSMachinePoolSpec(in *AWSMachinePoolSpec, out *v1beta1.AWSMachinePoolSpec, s conversion.Scope) error { + out.ProviderID = in.ProviderID + out.MinSize = in.MinSize + out.MaxSize = in.MaxSize + out.AvailabilityZones = *(*[]string)(unsafe.Pointer(&in.AvailabilityZones)) + out.Subnets = *(*[]apiv1beta1.AWSResourceReference)(unsafe.Pointer(&in.Subnets)) + out.AdditionalTags = *(*apiv1beta1.Tags)(unsafe.Pointer(&in.AdditionalTags)) + if err := Convert_v1alpha4_AWSLaunchTemplate_To_v1beta1_AWSLaunchTemplate(&in.AWSLaunchTemplate, &out.AWSLaunchTemplate, s); err != nil { + return err + } + out.MixedInstancesPolicy = (*v1beta1.MixedInstancesPolicy)(unsafe.Pointer(in.MixedInstancesPolicy)) + out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) + out.DefaultCoolDown = in.DefaultCoolDown + out.RefreshPreferences = (*v1beta1.RefreshPreferences)(unsafe.Pointer(in.RefreshPreferences)) + out.CapacityRebalance = in.CapacityRebalance + return nil +} + +// Convert_v1alpha4_AWSMachinePoolSpec_To_v1beta1_AWSMachinePoolSpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSMachinePoolSpec_To_v1beta1_AWSMachinePoolSpec(in *AWSMachinePoolSpec, out *v1beta1.AWSMachinePoolSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSMachinePoolSpec_To_v1beta1_AWSMachinePoolSpec(in, out, s) +} + +func autoConvert_v1beta1_AWSMachinePoolSpec_To_v1alpha4_AWSMachinePoolSpec(in *v1beta1.AWSMachinePoolSpec, out *AWSMachinePoolSpec, s conversion.Scope) error { + out.ProviderID = in.ProviderID + out.MinSize = in.MinSize + out.MaxSize = in.MaxSize + out.AvailabilityZones = *(*[]string)(unsafe.Pointer(&in.AvailabilityZones)) + out.Subnets = *(*[]apiv1alpha4.AWSResourceReference)(unsafe.Pointer(&in.Subnets)) + out.AdditionalTags = *(*apiv1alpha4.Tags)(unsafe.Pointer(&in.AdditionalTags)) + if err := Convert_v1beta1_AWSLaunchTemplate_To_v1alpha4_AWSLaunchTemplate(&in.AWSLaunchTemplate, &out.AWSLaunchTemplate, s); err != nil { + return err + } + out.MixedInstancesPolicy = (*MixedInstancesPolicy)(unsafe.Pointer(in.MixedInstancesPolicy)) + out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) + out.DefaultCoolDown = in.DefaultCoolDown + out.RefreshPreferences = (*RefreshPreferences)(unsafe.Pointer(in.RefreshPreferences)) + out.CapacityRebalance = in.CapacityRebalance + return nil +} + +// Convert_v1beta1_AWSMachinePoolSpec_To_v1alpha4_AWSMachinePoolSpec is an autogenerated conversion function. +func Convert_v1beta1_AWSMachinePoolSpec_To_v1alpha4_AWSMachinePoolSpec(in *v1beta1.AWSMachinePoolSpec, out *AWSMachinePoolSpec, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachinePoolSpec_To_v1alpha4_AWSMachinePoolSpec(in, out, s) +} + +func autoConvert_v1alpha4_AWSMachinePoolStatus_To_v1beta1_AWSMachinePoolStatus(in *AWSMachinePoolStatus, out *v1beta1.AWSMachinePoolStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.Replicas = in.Replicas + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(clusterapiapiv1beta1.Conditions, len(*in)) + for i := range *in { + if err := clusterapiapiv1alpha4.Convert_v1alpha4_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + out.Instances = *(*[]v1beta1.AWSMachinePoolInstanceStatus)(unsafe.Pointer(&in.Instances)) + out.LaunchTemplateID = in.LaunchTemplateID + out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + out.ASGStatus = (*v1beta1.ASGStatus)(unsafe.Pointer(in.ASGStatus)) + return nil +} + +// Convert_v1alpha4_AWSMachinePoolStatus_To_v1beta1_AWSMachinePoolStatus is an autogenerated conversion function. +func Convert_v1alpha4_AWSMachinePoolStatus_To_v1beta1_AWSMachinePoolStatus(in *AWSMachinePoolStatus, out *v1beta1.AWSMachinePoolStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSMachinePoolStatus_To_v1beta1_AWSMachinePoolStatus(in, out, s) +} + +func autoConvert_v1beta1_AWSMachinePoolStatus_To_v1alpha4_AWSMachinePoolStatus(in *v1beta1.AWSMachinePoolStatus, out *AWSMachinePoolStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.Replicas = in.Replicas + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(clusterapiapiv1alpha4.Conditions, len(*in)) + for i := range *in { + if err := clusterapiapiv1alpha4.Convert_v1beta1_Condition_To_v1alpha4_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + out.Instances = *(*[]AWSMachinePoolInstanceStatus)(unsafe.Pointer(&in.Instances)) + out.LaunchTemplateID = in.LaunchTemplateID + out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + out.ASGStatus = (*ASGStatus)(unsafe.Pointer(in.ASGStatus)) + return nil +} + +// Convert_v1beta1_AWSMachinePoolStatus_To_v1alpha4_AWSMachinePoolStatus is an autogenerated conversion function. +func Convert_v1beta1_AWSMachinePoolStatus_To_v1alpha4_AWSMachinePoolStatus(in *v1beta1.AWSMachinePoolStatus, out *AWSMachinePoolStatus, s conversion.Scope) error { + return autoConvert_v1beta1_AWSMachinePoolStatus_To_v1alpha4_AWSMachinePoolStatus(in, out, s) +} + +func autoConvert_v1alpha4_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(in *AWSManagedMachinePool, out *v1beta1.AWSManagedMachinePool, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool is an autogenerated conversion function. +func Convert_v1alpha4_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(in *AWSManagedMachinePool, out *v1beta1.AWSManagedMachinePool, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(in, out, s) +} + +func autoConvert_v1beta1_AWSManagedMachinePool_To_v1alpha4_AWSManagedMachinePool(in *v1beta1.AWSManagedMachinePool, out *AWSManagedMachinePool, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1beta1_AWSManagedMachinePoolSpec_To_v1alpha4_AWSManagedMachinePoolSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1beta1_AWSManagedMachinePoolStatus_To_v1alpha4_AWSManagedMachinePoolStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_AWSManagedMachinePool_To_v1alpha4_AWSManagedMachinePool is an autogenerated conversion function. +func Convert_v1beta1_AWSManagedMachinePool_To_v1alpha4_AWSManagedMachinePool(in *v1beta1.AWSManagedMachinePool, out *AWSManagedMachinePool, s conversion.Scope) error { + return autoConvert_v1beta1_AWSManagedMachinePool_To_v1alpha4_AWSManagedMachinePool(in, out, s) +} + +func autoConvert_v1alpha4_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList(in *AWSManagedMachinePoolList, out *v1beta1.AWSManagedMachinePoolList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1beta1.AWSManagedMachinePool, len(*in)) + for i := range *in { + if err := Convert_v1alpha4_AWSManagedMachinePool_To_v1beta1_AWSManagedMachinePool(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha4_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList is an autogenerated conversion function. +func Convert_v1alpha4_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList(in *AWSManagedMachinePoolList, out *v1beta1.AWSManagedMachinePoolList, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSManagedMachinePoolList_To_v1beta1_AWSManagedMachinePoolList(in, out, s) +} + +func autoConvert_v1beta1_AWSManagedMachinePoolList_To_v1alpha4_AWSManagedMachinePoolList(in *v1beta1.AWSManagedMachinePoolList, out *AWSManagedMachinePoolList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSManagedMachinePool, len(*in)) + for i := range *in { + if err := Convert_v1beta1_AWSManagedMachinePool_To_v1alpha4_AWSManagedMachinePool(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1beta1_AWSManagedMachinePoolList_To_v1alpha4_AWSManagedMachinePoolList is an autogenerated conversion function. +func Convert_v1beta1_AWSManagedMachinePoolList_To_v1alpha4_AWSManagedMachinePoolList(in *v1beta1.AWSManagedMachinePoolList, out *AWSManagedMachinePoolList, s conversion.Scope) error { + return autoConvert_v1beta1_AWSManagedMachinePoolList_To_v1alpha4_AWSManagedMachinePoolList(in, out, s) +} + +func autoConvert_v1alpha4_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec(in *AWSManagedMachinePoolSpec, out *v1beta1.AWSManagedMachinePoolSpec, s conversion.Scope) error { + out.EKSNodegroupName = in.EKSNodegroupName + out.AvailabilityZones = *(*[]string)(unsafe.Pointer(&in.AvailabilityZones)) + out.SubnetIDs = *(*[]string)(unsafe.Pointer(&in.SubnetIDs)) + out.AdditionalTags = *(*apiv1beta1.Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.RoleName = in.RoleName + out.AMIVersion = (*string)(unsafe.Pointer(in.AMIVersion)) + out.AMIType = (*v1beta1.ManagedMachineAMIType)(unsafe.Pointer(in.AMIType)) + out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) + out.Taints = *(*v1beta1.Taints)(unsafe.Pointer(&in.Taints)) + out.DiskSize = (*int32)(unsafe.Pointer(in.DiskSize)) + out.InstanceType = (*string)(unsafe.Pointer(in.InstanceType)) + out.Scaling = (*v1beta1.ManagedMachinePoolScaling)(unsafe.Pointer(in.Scaling)) + out.RemoteAccess = (*v1beta1.ManagedRemoteAccess)(unsafe.Pointer(in.RemoteAccess)) + out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) + out.CapacityType = (*v1beta1.ManagedMachinePoolCapacityType)(unsafe.Pointer(in.CapacityType)) + return nil +} + +// Convert_v1alpha4_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec(in *AWSManagedMachinePoolSpec, out *v1beta1.AWSManagedMachinePoolSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSManagedMachinePoolSpec_To_v1beta1_AWSManagedMachinePoolSpec(in, out, s) +} + +func autoConvert_v1beta1_AWSManagedMachinePoolSpec_To_v1alpha4_AWSManagedMachinePoolSpec(in *v1beta1.AWSManagedMachinePoolSpec, out *AWSManagedMachinePoolSpec, s conversion.Scope) error { + out.EKSNodegroupName = in.EKSNodegroupName + out.AvailabilityZones = *(*[]string)(unsafe.Pointer(&in.AvailabilityZones)) + out.SubnetIDs = *(*[]string)(unsafe.Pointer(&in.SubnetIDs)) + out.AdditionalTags = *(*apiv1alpha4.Tags)(unsafe.Pointer(&in.AdditionalTags)) + // WARNING: in.RoleAdditionalPolicies requires manual conversion: does not exist in peer-type + out.RoleName = in.RoleName + out.AMIVersion = (*string)(unsafe.Pointer(in.AMIVersion)) + out.AMIType = (*ManagedMachineAMIType)(unsafe.Pointer(in.AMIType)) + out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) + out.Taints = *(*Taints)(unsafe.Pointer(&in.Taints)) + out.DiskSize = (*int32)(unsafe.Pointer(in.DiskSize)) + out.InstanceType = (*string)(unsafe.Pointer(in.InstanceType)) + out.Scaling = (*ManagedMachinePoolScaling)(unsafe.Pointer(in.Scaling)) + out.RemoteAccess = (*ManagedRemoteAccess)(unsafe.Pointer(in.RemoteAccess)) + out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) + out.CapacityType = (*ManagedMachinePoolCapacityType)(unsafe.Pointer(in.CapacityType)) + return nil +} + +func autoConvert_v1alpha4_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus(in *AWSManagedMachinePoolStatus, out *v1beta1.AWSManagedMachinePoolStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.Replicas = in.Replicas + out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(clusterapiapiv1beta1.Conditions, len(*in)) + for i := range *in { + if err := clusterapiapiv1alpha4.Convert_v1alpha4_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + return nil +} + +// Convert_v1alpha4_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus is an autogenerated conversion function. +func Convert_v1alpha4_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus(in *AWSManagedMachinePoolStatus, out *v1beta1.AWSManagedMachinePoolStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSManagedMachinePoolStatus_To_v1beta1_AWSManagedMachinePoolStatus(in, out, s) +} + +func autoConvert_v1beta1_AWSManagedMachinePoolStatus_To_v1alpha4_AWSManagedMachinePoolStatus(in *v1beta1.AWSManagedMachinePoolStatus, out *AWSManagedMachinePoolStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.Replicas = in.Replicas + out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(clusterapiapiv1alpha4.Conditions, len(*in)) + for i := range *in { + if err := clusterapiapiv1alpha4.Convert_v1beta1_Condition_To_v1alpha4_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + return nil +} + +// Convert_v1beta1_AWSManagedMachinePoolStatus_To_v1alpha4_AWSManagedMachinePoolStatus is an autogenerated conversion function. +func Convert_v1beta1_AWSManagedMachinePoolStatus_To_v1alpha4_AWSManagedMachinePoolStatus(in *v1beta1.AWSManagedMachinePoolStatus, out *AWSManagedMachinePoolStatus, s conversion.Scope) error { + return autoConvert_v1beta1_AWSManagedMachinePoolStatus_To_v1alpha4_AWSManagedMachinePoolStatus(in, out, s) +} + +func autoConvert_v1alpha4_AutoScalingGroup_To_v1beta1_AutoScalingGroup(in *AutoScalingGroup, out *v1beta1.AutoScalingGroup, s conversion.Scope) error { + out.ID = in.ID + out.Tags = *(*apiv1beta1.Tags)(unsafe.Pointer(&in.Tags)) + out.Name = in.Name + out.DesiredCapacity = (*int32)(unsafe.Pointer(in.DesiredCapacity)) + out.MaxSize = in.MaxSize + out.MinSize = in.MinSize + out.PlacementGroup = in.PlacementGroup + out.Subnets = *(*[]string)(unsafe.Pointer(&in.Subnets)) + out.DefaultCoolDown = in.DefaultCoolDown + out.CapacityRebalance = in.CapacityRebalance + out.MixedInstancesPolicy = (*v1beta1.MixedInstancesPolicy)(unsafe.Pointer(in.MixedInstancesPolicy)) + out.Status = v1beta1.ASGStatus(in.Status) + if in.Instances != nil { + in, out := &in.Instances, &out.Instances + *out = make([]apiv1beta1.Instance, len(*in)) + for i := range *in { + if err := Convert_v1alpha4_Instance_To_v1beta1_Instance(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Instances = nil + } + return nil +} + +// Convert_v1alpha4_AutoScalingGroup_To_v1beta1_AutoScalingGroup is an autogenerated conversion function. +func Convert_v1alpha4_AutoScalingGroup_To_v1beta1_AutoScalingGroup(in *AutoScalingGroup, out *v1beta1.AutoScalingGroup, s conversion.Scope) error { + return autoConvert_v1alpha4_AutoScalingGroup_To_v1beta1_AutoScalingGroup(in, out, s) +} + +func autoConvert_v1beta1_AutoScalingGroup_To_v1alpha4_AutoScalingGroup(in *v1beta1.AutoScalingGroup, out *AutoScalingGroup, s conversion.Scope) error { + out.ID = in.ID + out.Tags = *(*apiv1alpha4.Tags)(unsafe.Pointer(&in.Tags)) + out.Name = in.Name + out.DesiredCapacity = (*int32)(unsafe.Pointer(in.DesiredCapacity)) + out.MaxSize = in.MaxSize + out.MinSize = in.MinSize + out.PlacementGroup = in.PlacementGroup + out.Subnets = *(*[]string)(unsafe.Pointer(&in.Subnets)) + out.DefaultCoolDown = in.DefaultCoolDown + out.CapacityRebalance = in.CapacityRebalance + out.MixedInstancesPolicy = (*MixedInstancesPolicy)(unsafe.Pointer(in.MixedInstancesPolicy)) + out.Status = ASGStatus(in.Status) + if in.Instances != nil { + in, out := &in.Instances, &out.Instances + *out = make([]apiv1alpha4.Instance, len(*in)) + for i := range *in { + if err := Convert_v1beta1_Instance_To_v1alpha4_Instance(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Instances = nil + } + return nil +} + +// Convert_v1beta1_AutoScalingGroup_To_v1alpha4_AutoScalingGroup is an autogenerated conversion function. +func Convert_v1beta1_AutoScalingGroup_To_v1alpha4_AutoScalingGroup(in *v1beta1.AutoScalingGroup, out *AutoScalingGroup, s conversion.Scope) error { + return autoConvert_v1beta1_AutoScalingGroup_To_v1alpha4_AutoScalingGroup(in, out, s) +} + +func autoConvert_v1alpha4_BlockDeviceMapping_To_v1beta1_BlockDeviceMapping(in *BlockDeviceMapping, out *v1beta1.BlockDeviceMapping, s conversion.Scope) error { + out.DeviceName = in.DeviceName + if err := Convert_v1alpha4_EBS_To_v1beta1_EBS(&in.Ebs, &out.Ebs, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_BlockDeviceMapping_To_v1beta1_BlockDeviceMapping is an autogenerated conversion function. +func Convert_v1alpha4_BlockDeviceMapping_To_v1beta1_BlockDeviceMapping(in *BlockDeviceMapping, out *v1beta1.BlockDeviceMapping, s conversion.Scope) error { + return autoConvert_v1alpha4_BlockDeviceMapping_To_v1beta1_BlockDeviceMapping(in, out, s) +} + +func autoConvert_v1beta1_BlockDeviceMapping_To_v1alpha4_BlockDeviceMapping(in *v1beta1.BlockDeviceMapping, out *BlockDeviceMapping, s conversion.Scope) error { + out.DeviceName = in.DeviceName + if err := Convert_v1beta1_EBS_To_v1alpha4_EBS(&in.Ebs, &out.Ebs, s); err != nil { + return err + } + return nil +} + +// Convert_v1beta1_BlockDeviceMapping_To_v1alpha4_BlockDeviceMapping is an autogenerated conversion function. +func Convert_v1beta1_BlockDeviceMapping_To_v1alpha4_BlockDeviceMapping(in *v1beta1.BlockDeviceMapping, out *BlockDeviceMapping, s conversion.Scope) error { + return autoConvert_v1beta1_BlockDeviceMapping_To_v1alpha4_BlockDeviceMapping(in, out, s) +} + +func autoConvert_v1alpha4_EBS_To_v1beta1_EBS(in *EBS, out *v1beta1.EBS, s conversion.Scope) error { + out.Encrypted = in.Encrypted + out.VolumeSize = in.VolumeSize + out.VolumeType = in.VolumeType + return nil +} + +// Convert_v1alpha4_EBS_To_v1beta1_EBS is an autogenerated conversion function. +func Convert_v1alpha4_EBS_To_v1beta1_EBS(in *EBS, out *v1beta1.EBS, s conversion.Scope) error { + return autoConvert_v1alpha4_EBS_To_v1beta1_EBS(in, out, s) +} + +func autoConvert_v1beta1_EBS_To_v1alpha4_EBS(in *v1beta1.EBS, out *EBS, s conversion.Scope) error { + out.Encrypted = in.Encrypted + out.VolumeSize = in.VolumeSize + out.VolumeType = in.VolumeType + return nil +} + +// Convert_v1beta1_EBS_To_v1alpha4_EBS is an autogenerated conversion function. +func Convert_v1beta1_EBS_To_v1alpha4_EBS(in *v1beta1.EBS, out *EBS, s conversion.Scope) error { + return autoConvert_v1beta1_EBS_To_v1alpha4_EBS(in, out, s) +} + +func autoConvert_v1alpha4_FargateProfileSpec_To_v1beta1_FargateProfileSpec(in *FargateProfileSpec, out *v1beta1.FargateProfileSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.ProfileName = in.ProfileName + out.SubnetIDs = *(*[]string)(unsafe.Pointer(&in.SubnetIDs)) + out.AdditionalTags = *(*apiv1beta1.Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.RoleName = in.RoleName + out.Selectors = *(*[]v1beta1.FargateSelector)(unsafe.Pointer(&in.Selectors)) + return nil +} + +// Convert_v1alpha4_FargateProfileSpec_To_v1beta1_FargateProfileSpec is an autogenerated conversion function. +func Convert_v1alpha4_FargateProfileSpec_To_v1beta1_FargateProfileSpec(in *FargateProfileSpec, out *v1beta1.FargateProfileSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_FargateProfileSpec_To_v1beta1_FargateProfileSpec(in, out, s) +} + +func autoConvert_v1beta1_FargateProfileSpec_To_v1alpha4_FargateProfileSpec(in *v1beta1.FargateProfileSpec, out *FargateProfileSpec, s conversion.Scope) error { + out.ClusterName = in.ClusterName + out.ProfileName = in.ProfileName + out.SubnetIDs = *(*[]string)(unsafe.Pointer(&in.SubnetIDs)) + out.AdditionalTags = *(*apiv1alpha4.Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.RoleName = in.RoleName + out.Selectors = *(*[]FargateSelector)(unsafe.Pointer(&in.Selectors)) + return nil +} + +// Convert_v1beta1_FargateProfileSpec_To_v1alpha4_FargateProfileSpec is an autogenerated conversion function. +func Convert_v1beta1_FargateProfileSpec_To_v1alpha4_FargateProfileSpec(in *v1beta1.FargateProfileSpec, out *FargateProfileSpec, s conversion.Scope) error { + return autoConvert_v1beta1_FargateProfileSpec_To_v1alpha4_FargateProfileSpec(in, out, s) +} + +func autoConvert_v1alpha4_FargateProfileStatus_To_v1beta1_FargateProfileStatus(in *FargateProfileStatus, out *v1beta1.FargateProfileStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(clusterapiapiv1beta1.Conditions, len(*in)) + for i := range *in { + if err := clusterapiapiv1alpha4.Convert_v1alpha4_Condition_To_v1beta1_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + return nil +} + +// Convert_v1alpha4_FargateProfileStatus_To_v1beta1_FargateProfileStatus is an autogenerated conversion function. +func Convert_v1alpha4_FargateProfileStatus_To_v1beta1_FargateProfileStatus(in *FargateProfileStatus, out *v1beta1.FargateProfileStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_FargateProfileStatus_To_v1beta1_FargateProfileStatus(in, out, s) +} + +func autoConvert_v1beta1_FargateProfileStatus_To_v1alpha4_FargateProfileStatus(in *v1beta1.FargateProfileStatus, out *FargateProfileStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(clusterapiapiv1alpha4.Conditions, len(*in)) + for i := range *in { + if err := clusterapiapiv1alpha4.Convert_v1beta1_Condition_To_v1alpha4_Condition(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Conditions = nil + } + return nil +} + +// Convert_v1beta1_FargateProfileStatus_To_v1alpha4_FargateProfileStatus is an autogenerated conversion function. +func Convert_v1beta1_FargateProfileStatus_To_v1alpha4_FargateProfileStatus(in *v1beta1.FargateProfileStatus, out *FargateProfileStatus, s conversion.Scope) error { + return autoConvert_v1beta1_FargateProfileStatus_To_v1alpha4_FargateProfileStatus(in, out, s) +} + +func autoConvert_v1alpha4_FargateSelector_To_v1beta1_FargateSelector(in *FargateSelector, out *v1beta1.FargateSelector, s conversion.Scope) error { + out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) + out.Namespace = in.Namespace + return nil +} + +// Convert_v1alpha4_FargateSelector_To_v1beta1_FargateSelector is an autogenerated conversion function. +func Convert_v1alpha4_FargateSelector_To_v1beta1_FargateSelector(in *FargateSelector, out *v1beta1.FargateSelector, s conversion.Scope) error { + return autoConvert_v1alpha4_FargateSelector_To_v1beta1_FargateSelector(in, out, s) +} + +func autoConvert_v1beta1_FargateSelector_To_v1alpha4_FargateSelector(in *v1beta1.FargateSelector, out *FargateSelector, s conversion.Scope) error { + out.Labels = *(*map[string]string)(unsafe.Pointer(&in.Labels)) + out.Namespace = in.Namespace + return nil +} + +// Convert_v1beta1_FargateSelector_To_v1alpha4_FargateSelector is an autogenerated conversion function. +func Convert_v1beta1_FargateSelector_To_v1alpha4_FargateSelector(in *v1beta1.FargateSelector, out *FargateSelector, s conversion.Scope) error { + return autoConvert_v1beta1_FargateSelector_To_v1alpha4_FargateSelector(in, out, s) +} + +func autoConvert_v1alpha4_InstancesDistribution_To_v1beta1_InstancesDistribution(in *InstancesDistribution, out *v1beta1.InstancesDistribution, s conversion.Scope) error { + out.OnDemandAllocationStrategy = v1beta1.OnDemandAllocationStrategy(in.OnDemandAllocationStrategy) + out.SpotAllocationStrategy = v1beta1.SpotAllocationStrategy(in.SpotAllocationStrategy) + out.OnDemandBaseCapacity = (*int64)(unsafe.Pointer(in.OnDemandBaseCapacity)) + out.OnDemandPercentageAboveBaseCapacity = (*int64)(unsafe.Pointer(in.OnDemandPercentageAboveBaseCapacity)) + return nil +} + +// Convert_v1alpha4_InstancesDistribution_To_v1beta1_InstancesDistribution is an autogenerated conversion function. +func Convert_v1alpha4_InstancesDistribution_To_v1beta1_InstancesDistribution(in *InstancesDistribution, out *v1beta1.InstancesDistribution, s conversion.Scope) error { + return autoConvert_v1alpha4_InstancesDistribution_To_v1beta1_InstancesDistribution(in, out, s) +} + +func autoConvert_v1beta1_InstancesDistribution_To_v1alpha4_InstancesDistribution(in *v1beta1.InstancesDistribution, out *InstancesDistribution, s conversion.Scope) error { + out.OnDemandAllocationStrategy = OnDemandAllocationStrategy(in.OnDemandAllocationStrategy) + out.SpotAllocationStrategy = SpotAllocationStrategy(in.SpotAllocationStrategy) + out.OnDemandBaseCapacity = (*int64)(unsafe.Pointer(in.OnDemandBaseCapacity)) + out.OnDemandPercentageAboveBaseCapacity = (*int64)(unsafe.Pointer(in.OnDemandPercentageAboveBaseCapacity)) + return nil +} + +// Convert_v1beta1_InstancesDistribution_To_v1alpha4_InstancesDistribution is an autogenerated conversion function. +func Convert_v1beta1_InstancesDistribution_To_v1alpha4_InstancesDistribution(in *v1beta1.InstancesDistribution, out *InstancesDistribution, s conversion.Scope) error { + return autoConvert_v1beta1_InstancesDistribution_To_v1alpha4_InstancesDistribution(in, out, s) +} + +func autoConvert_v1alpha4_ManagedMachinePoolScaling_To_v1beta1_ManagedMachinePoolScaling(in *ManagedMachinePoolScaling, out *v1beta1.ManagedMachinePoolScaling, s conversion.Scope) error { + out.MinSize = (*int32)(unsafe.Pointer(in.MinSize)) + out.MaxSize = (*int32)(unsafe.Pointer(in.MaxSize)) + return nil +} + +// Convert_v1alpha4_ManagedMachinePoolScaling_To_v1beta1_ManagedMachinePoolScaling is an autogenerated conversion function. +func Convert_v1alpha4_ManagedMachinePoolScaling_To_v1beta1_ManagedMachinePoolScaling(in *ManagedMachinePoolScaling, out *v1beta1.ManagedMachinePoolScaling, s conversion.Scope) error { + return autoConvert_v1alpha4_ManagedMachinePoolScaling_To_v1beta1_ManagedMachinePoolScaling(in, out, s) +} + +func autoConvert_v1beta1_ManagedMachinePoolScaling_To_v1alpha4_ManagedMachinePoolScaling(in *v1beta1.ManagedMachinePoolScaling, out *ManagedMachinePoolScaling, s conversion.Scope) error { + out.MinSize = (*int32)(unsafe.Pointer(in.MinSize)) + out.MaxSize = (*int32)(unsafe.Pointer(in.MaxSize)) + return nil +} + +// Convert_v1beta1_ManagedMachinePoolScaling_To_v1alpha4_ManagedMachinePoolScaling is an autogenerated conversion function. +func Convert_v1beta1_ManagedMachinePoolScaling_To_v1alpha4_ManagedMachinePoolScaling(in *v1beta1.ManagedMachinePoolScaling, out *ManagedMachinePoolScaling, s conversion.Scope) error { + return autoConvert_v1beta1_ManagedMachinePoolScaling_To_v1alpha4_ManagedMachinePoolScaling(in, out, s) +} + +func autoConvert_v1alpha4_ManagedRemoteAccess_To_v1beta1_ManagedRemoteAccess(in *ManagedRemoteAccess, out *v1beta1.ManagedRemoteAccess, s conversion.Scope) error { + out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) + out.SourceSecurityGroups = *(*[]string)(unsafe.Pointer(&in.SourceSecurityGroups)) + out.Public = in.Public + return nil +} + +// Convert_v1alpha4_ManagedRemoteAccess_To_v1beta1_ManagedRemoteAccess is an autogenerated conversion function. +func Convert_v1alpha4_ManagedRemoteAccess_To_v1beta1_ManagedRemoteAccess(in *ManagedRemoteAccess, out *v1beta1.ManagedRemoteAccess, s conversion.Scope) error { + return autoConvert_v1alpha4_ManagedRemoteAccess_To_v1beta1_ManagedRemoteAccess(in, out, s) +} + +func autoConvert_v1beta1_ManagedRemoteAccess_To_v1alpha4_ManagedRemoteAccess(in *v1beta1.ManagedRemoteAccess, out *ManagedRemoteAccess, s conversion.Scope) error { + out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) + out.SourceSecurityGroups = *(*[]string)(unsafe.Pointer(&in.SourceSecurityGroups)) + out.Public = in.Public + return nil +} + +// Convert_v1beta1_ManagedRemoteAccess_To_v1alpha4_ManagedRemoteAccess is an autogenerated conversion function. +func Convert_v1beta1_ManagedRemoteAccess_To_v1alpha4_ManagedRemoteAccess(in *v1beta1.ManagedRemoteAccess, out *ManagedRemoteAccess, s conversion.Scope) error { + return autoConvert_v1beta1_ManagedRemoteAccess_To_v1alpha4_ManagedRemoteAccess(in, out, s) +} + +func autoConvert_v1alpha4_MixedInstancesPolicy_To_v1beta1_MixedInstancesPolicy(in *MixedInstancesPolicy, out *v1beta1.MixedInstancesPolicy, s conversion.Scope) error { + out.InstancesDistribution = (*v1beta1.InstancesDistribution)(unsafe.Pointer(in.InstancesDistribution)) + out.Overrides = *(*[]v1beta1.Overrides)(unsafe.Pointer(&in.Overrides)) + return nil +} + +// Convert_v1alpha4_MixedInstancesPolicy_To_v1beta1_MixedInstancesPolicy is an autogenerated conversion function. +func Convert_v1alpha4_MixedInstancesPolicy_To_v1beta1_MixedInstancesPolicy(in *MixedInstancesPolicy, out *v1beta1.MixedInstancesPolicy, s conversion.Scope) error { + return autoConvert_v1alpha4_MixedInstancesPolicy_To_v1beta1_MixedInstancesPolicy(in, out, s) +} + +func autoConvert_v1beta1_MixedInstancesPolicy_To_v1alpha4_MixedInstancesPolicy(in *v1beta1.MixedInstancesPolicy, out *MixedInstancesPolicy, s conversion.Scope) error { + out.InstancesDistribution = (*InstancesDistribution)(unsafe.Pointer(in.InstancesDistribution)) + out.Overrides = *(*[]Overrides)(unsafe.Pointer(&in.Overrides)) + return nil +} + +// Convert_v1beta1_MixedInstancesPolicy_To_v1alpha4_MixedInstancesPolicy is an autogenerated conversion function. +func Convert_v1beta1_MixedInstancesPolicy_To_v1alpha4_MixedInstancesPolicy(in *v1beta1.MixedInstancesPolicy, out *MixedInstancesPolicy, s conversion.Scope) error { + return autoConvert_v1beta1_MixedInstancesPolicy_To_v1alpha4_MixedInstancesPolicy(in, out, s) +} + +func autoConvert_v1alpha4_Overrides_To_v1beta1_Overrides(in *Overrides, out *v1beta1.Overrides, s conversion.Scope) error { + out.InstanceType = in.InstanceType + return nil +} + +// Convert_v1alpha4_Overrides_To_v1beta1_Overrides is an autogenerated conversion function. +func Convert_v1alpha4_Overrides_To_v1beta1_Overrides(in *Overrides, out *v1beta1.Overrides, s conversion.Scope) error { + return autoConvert_v1alpha4_Overrides_To_v1beta1_Overrides(in, out, s) +} + +func autoConvert_v1beta1_Overrides_To_v1alpha4_Overrides(in *v1beta1.Overrides, out *Overrides, s conversion.Scope) error { + out.InstanceType = in.InstanceType + return nil +} + +// Convert_v1beta1_Overrides_To_v1alpha4_Overrides is an autogenerated conversion function. +func Convert_v1beta1_Overrides_To_v1alpha4_Overrides(in *v1beta1.Overrides, out *Overrides, s conversion.Scope) error { + return autoConvert_v1beta1_Overrides_To_v1alpha4_Overrides(in, out, s) +} + +func autoConvert_v1alpha4_RefreshPreferences_To_v1beta1_RefreshPreferences(in *RefreshPreferences, out *v1beta1.RefreshPreferences, s conversion.Scope) error { + out.Strategy = (*string)(unsafe.Pointer(in.Strategy)) + out.InstanceWarmup = (*int64)(unsafe.Pointer(in.InstanceWarmup)) + out.MinHealthyPercentage = (*int64)(unsafe.Pointer(in.MinHealthyPercentage)) + return nil +} + +// Convert_v1alpha4_RefreshPreferences_To_v1beta1_RefreshPreferences is an autogenerated conversion function. +func Convert_v1alpha4_RefreshPreferences_To_v1beta1_RefreshPreferences(in *RefreshPreferences, out *v1beta1.RefreshPreferences, s conversion.Scope) error { + return autoConvert_v1alpha4_RefreshPreferences_To_v1beta1_RefreshPreferences(in, out, s) +} + +func autoConvert_v1beta1_RefreshPreferences_To_v1alpha4_RefreshPreferences(in *v1beta1.RefreshPreferences, out *RefreshPreferences, s conversion.Scope) error { + out.Strategy = (*string)(unsafe.Pointer(in.Strategy)) + out.InstanceWarmup = (*int64)(unsafe.Pointer(in.InstanceWarmup)) + out.MinHealthyPercentage = (*int64)(unsafe.Pointer(in.MinHealthyPercentage)) + return nil +} + +// Convert_v1beta1_RefreshPreferences_To_v1alpha4_RefreshPreferences is an autogenerated conversion function. +func Convert_v1beta1_RefreshPreferences_To_v1alpha4_RefreshPreferences(in *v1beta1.RefreshPreferences, out *RefreshPreferences, s conversion.Scope) error { + return autoConvert_v1beta1_RefreshPreferences_To_v1alpha4_RefreshPreferences(in, out, s) +} + +func autoConvert_v1alpha4_Taint_To_v1beta1_Taint(in *Taint, out *v1beta1.Taint, s conversion.Scope) error { + out.Effect = v1beta1.TaintEffect(in.Effect) + out.Key = in.Key + out.Value = in.Value + return nil +} + +// Convert_v1alpha4_Taint_To_v1beta1_Taint is an autogenerated conversion function. +func Convert_v1alpha4_Taint_To_v1beta1_Taint(in *Taint, out *v1beta1.Taint, s conversion.Scope) error { + return autoConvert_v1alpha4_Taint_To_v1beta1_Taint(in, out, s) +} + +func autoConvert_v1beta1_Taint_To_v1alpha4_Taint(in *v1beta1.Taint, out *Taint, s conversion.Scope) error { + out.Effect = TaintEffect(in.Effect) + out.Key = in.Key + out.Value = in.Value + return nil +} + +// Convert_v1beta1_Taint_To_v1alpha4_Taint is an autogenerated conversion function. +func Convert_v1beta1_Taint_To_v1alpha4_Taint(in *v1beta1.Taint, out *Taint, s conversion.Scope) error { + return autoConvert_v1beta1_Taint_To_v1alpha4_Taint(in, out, s) +} diff --git a/exp/api/v1alpha4/zz_generated.deepcopy.go b/exp/api/v1alpha4/zz_generated.deepcopy.go index eb78fb4830..2693cba581 100644 --- a/exp/api/v1alpha4/zz_generated.deepcopy.go +++ b/exp/api/v1alpha4/zz_generated.deepcopy.go @@ -377,11 +377,6 @@ func (in *AWSManagedMachinePoolSpec) DeepCopyInto(out *AWSManagedMachinePoolSpec (*out)[key] = val } } - if in.RoleAdditionalPolicies != nil { - in, out := &in.RoleAdditionalPolicies, &out.RoleAdditionalPolicies - *out = make([]string, len(*in)) - copy(*out, *in) - } if in.AMIVersion != nil { in, out := &in.AMIVersion, &out.AMIVersion *out = new(string) diff --git a/exp/api/v1beta1/awsfargateprofile_types.go b/exp/api/v1beta1/awsfargateprofile_types.go new file mode 100644 index 0000000000..5a0d41f76b --- /dev/null +++ b/exp/api/v1beta1/awsfargateprofile_types.go @@ -0,0 +1,168 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "fmt" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/errors" +) + +const ( + // FargateProfileFinalizer allows the controller to clean up resources on delete. + FargateProfileFinalizer = "awsfargateprofile.infrastructure.cluster.x-k8s.io" +) + +var ( + // DefaultEKSFargateRole is the name of the default IAM role to use for fargate + // profiles if no other role is supplied in the spec and if iam role creation + // is not enabled. The default can be created using clusterawsadm or created manually. + DefaultEKSFargateRole = fmt.Sprintf("eks-fargate%s", iamv1.DefaultNameSuffix) +) + +// FargateProfileSpec defines the desired state of FargateProfile. +type FargateProfileSpec struct { + // ClusterName is the name of the Cluster this object belongs to. + // +kubebuilder:validation:MinLength=1 + ClusterName string `json:"clusterName"` + + // ProfileName specifies the profile name. + ProfileName string `json:"profileName,omitempty"` + + // SubnetIDs specifies which subnets are used for the + // auto scaling group of this nodegroup. + // +optional + SubnetIDs []string `json:"subnetIDs,omitempty"` + + // AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the + // ones added by default. + // +optional + AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` + + // RoleName specifies the name of IAM role for this fargate pool + // If the role is pre-existing we will treat it as unmanaged + // and not delete it on deletion. If the EKSEnableIAM feature + // flag is true and no name is supplied then a role is created. + // +optional + RoleName string `json:"roleName,omitempty"` + + // Selectors specify fargate pod selectors. + Selectors []FargateSelector `json:"selectors,omitempty"` +} + +// FargateSelector specifies a selector for pods that should run on this fargate pool. +type FargateSelector struct { + // Labels specifies which pod labels this selector should match. + Labels map[string]string `json:"labels,omitempty"` + + // Namespace specifies which namespace this selector should match. + Namespace string `json:"namespace,omitempty"` +} + +// FargateProfileStatus defines the observed state of FargateProfile. +type FargateProfileStatus struct { + // Ready denotes that the FargateProfile is available. + // +kubebuilder:default=false + Ready bool `json:"ready"` + + // FailureReason will be set in the event that there is a terminal problem + // reconciling the FargateProfile 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 FargateProfile'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 + // FargateProfiles can be added as events to the FargateProfile object + // and/or logged in the controller's output. + // +optional + FailureReason *errors.MachineStatusError `json:"failureReason,omitempty"` + + // FailureMessage will be set in the event that there is a terminal problem + // reconciling the FargateProfile 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 FargateProfile'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 + // FargateProfiles can be added as events to the FargateProfile + // object and/or logged in the controller's output. + // +optional + FailureMessage *string `json:"failureMessage,omitempty"` + + // Conditions defines current state of the Fargate profile. + // +optional + Conditions clusterv1.Conditions `json:"conditions,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsfargateprofiles,scope=Namespaced,categories=cluster-api,shortName=awsfp +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="AWSFargateProfile ready status" +// +kubebuilder:printcolumn:name="ProfileName",type="string",JSONPath=".spec.profileName",description="EKS Fargate profile name" +// +kubebuilder:printcolumn:name="FailureReason",type="string",JSONPath=".status.failureReason",description="Failure reason" + +// AWSFargateProfile is the Schema for the awsfargateprofiles API. +type AWSFargateProfile struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec FargateProfileSpec `json:"spec,omitempty"` + Status FargateProfileStatus `json:"status,omitempty"` +} + +// GetConditions returns the observations of the operational state of the AWSFargateProfile resource. +func (r *AWSFargateProfile) GetConditions() clusterv1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the AWSFargateProfile to the predescribed clusterv1.Conditions. +func (r *AWSFargateProfile) SetConditions(conditions clusterv1.Conditions) { + r.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// AWSFargateProfileList contains a list of FargateProfiles. +type AWSFargateProfileList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSFargateProfile `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AWSFargateProfile{}, &AWSFargateProfileList{}) +} diff --git a/exp/api/v1alpha4/awsfargateprofile_webhook.go b/exp/api/v1beta1/awsfargateprofile_webhook.go similarity index 83% rename from exp/api/v1alpha4/awsfargateprofile_webhook.go rename to exp/api/v1beta1/awsfargateprofile_webhook.go index 869fc5f110..7992cabbeb 100644 --- a/exp/api/v1alpha4/awsfargateprofile_webhook.go +++ b/exp/api/v1beta1/awsfargateprofile_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "reflect" @@ -24,7 +24,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/validation/field" "sigs.k8s.io/cluster-api-provider-aws/pkg/eks" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/webhook" ) @@ -40,8 +40,8 @@ func (r *AWSFargateProfile) SetupWebhookWithManager(mgr ctrl.Manager) error { Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awsfargateprofile,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsfargateprofiles,versions=v1alpha4,name=default.awsfargateprofile.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsfargateprofile,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsfargateprofiles,versions=v1alpha4,name=validation.awsfargateprofile.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-awsfargateprofile,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsfargateprofiles,versions=v1beta1,name=default.awsfargateprofile.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-awsfargateprofile,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsfargateprofiles,versions=v1beta1,name=validation.awsfargateprofile.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 var _ webhook.Defaulter = &AWSFargateProfile{} var _ webhook.Validator = &AWSFargateProfile{} diff --git a/exp/api/v1alpha4/awsfargateprofile_webhook_test.go b/exp/api/v1beta1/awsfargateprofile_webhook_test.go similarity index 95% rename from exp/api/v1alpha4/awsfargateprofile_webhook_test.go rename to exp/api/v1beta1/awsfargateprofile_webhook_test.go index ccfdfd1f7c..0bc18bf011 100644 --- a/exp/api/v1alpha4/awsfargateprofile_webhook_test.go +++ b/exp/api/v1beta1/awsfargateprofile_webhook_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "testing" @@ -23,7 +23,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/cluster-api-provider-aws/pkg/eks" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" utildefaulting "sigs.k8s.io/cluster-api/util/defaulting" ) diff --git a/exp/api/v1beta1/awsmachinepool_types.go b/exp/api/v1beta1/awsmachinepool_types.go new file mode 100644 index 0000000000..722908879f --- /dev/null +++ b/exp/api/v1beta1/awsmachinepool_types.go @@ -0,0 +1,233 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime/schema" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/errors" +) + +// Constants block. +const ( + // MachinePoolFinalizer is the finalizer for the machine pool. + MachinePoolFinalizer = "awsmachinepool.infrastructure.cluster.x-k8s.io" + + // LaunchTemplateLatestVersion defines the launching of the latest version of the template. + LaunchTemplateLatestVersion = "$Latest" +) + +// AWSMachinePoolSpec defines the desired state of AWSMachinePool. +type AWSMachinePoolSpec struct { + // ProviderID is the ARN of the associated ASG + // +optional + ProviderID string `json:"providerID,omitempty"` + + // MinSize defines the minimum size of the group. + // +kubebuilder:default=1 + // +kubebuilder:validation:Minimum=1 + MinSize int32 `json:"minSize"` + + // MaxSize defines the maximum size of the group. + // +kubebuilder:default=1 + // +kubebuilder:validation:Minimum=1 + MaxSize int32 `json:"maxSize"` + + // AvailabilityZones is an array of availability zones instances can run in + AvailabilityZones []string `json:"availabilityZones,omitempty"` + + // Subnets is an array of subnet configurations + // +optional + Subnets []infrav1.AWSResourceReference `json:"subnets,omitempty"` + + // AdditionalTags is an optional set of tags to add to an instance, in addition to the ones added by default by the + // AWS provider. + // +optional + AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` + + // AWSLaunchTemplate specifies the launch template and version to use when an instance is launched. + // +kubebuilder:validation:Required + AWSLaunchTemplate AWSLaunchTemplate `json:"awsLaunchTemplate"` + + // MixedInstancesPolicy describes how multiple instance types will be used by the ASG. + MixedInstancesPolicy *MixedInstancesPolicy `json:"mixedInstancesPolicy,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"` + + // The amount of time, in seconds, after a scaling activity completes before another scaling activity can start. + // If no value is supplied by user a default value of 300 seconds is set + // +optional + DefaultCoolDown metav1.Duration `json:"defaultCoolDown,omitempty"` + + // RefreshPreferences describes set of preferences associated with the instance refresh request. + // +optional + RefreshPreferences *RefreshPreferences `json:"refreshPreferences,omitempty"` + + // Enable or disable the capacity rebalance autoscaling group feature + // +optional + CapacityRebalance bool `json:"capacityRebalance,omitempty"` +} + +// RefreshPreferences defines the specs for instance refreshing. +type RefreshPreferences struct { + // The strategy to use for the instance refresh. The only valid value is Rolling. + // A rolling update is an update that is applied to all instances in an Auto + // Scaling group until all instances have been updated. + // +optional + Strategy *string `json:"strategy,omitempty"` + + // The number of seconds until a newly launched instance is configured and ready + // to use. During this time, the next replacement will not be initiated. + // The default is to use the value for the health check grace period defined for the group. + // +optional + InstanceWarmup *int64 `json:"instanceWarmup,omitempty"` + + // The amount of capacity as a percentage in ASG that must remain healthy + // during an instance refresh. The default is 90. + // +optional + MinHealthyPercentage *int64 `json:"minHealthyPercentage,omitempty"` +} + +// AWSMachinePoolStatus defines the observed state of AWSMachinePool. +type AWSMachinePoolStatus struct { + // Ready is true when the provider resource is ready. + // +optional + Ready bool `json:"ready"` + + // Replicas is the most recently observed number of replicas + // +optional + Replicas int32 `json:"replicas"` + + // Conditions defines current service state of the AWSMachinePool. + // +optional + Conditions clusterv1.Conditions `json:"conditions,omitempty"` + + // Instances contains the status for each instance in the pool + // +optional + Instances []AWSMachinePoolInstanceStatus `json:"instances,omitempty"` + + // The ID of the launch template + LaunchTemplateID string `json:"launchTemplateID,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 *errors.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"` + + ASGStatus *ASGStatus `json:"asgStatus,omitempty"` +} + +// AWSMachinePoolInstanceStatus defines the status of the AWSMachinePoolInstance. +type AWSMachinePoolInstanceStatus struct { + // InstanceID is the identification of the Machine Instance within ASG + // +optional + InstanceID string `json:"instanceID,omitempty"` + + // Version defines the Kubernetes version for the Machine Instance + // +optional + Version *string `json:"version,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// +kubebuilder:storageversion +// +kubebuilder:resource:path=awsmachinepools,scope=Namespaced,categories=cluster-api,shortName=awsmp +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="Machine ready status" +// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Machine ready status" +// +kubebuilder:printcolumn:name="MinSize",type="integer",JSONPath=".spec.minSize",description="Minimum instanes in ASG" +// +kubebuilder:printcolumn:name="MaxSize",type="integer",JSONPath=".spec.maxSize",description="Maximum instanes in ASG" +// +kubebuilder:printcolumn:name="LaunchTemplate ID",type="string",JSONPath=".status.launchTemplateID",description="Launch Template ID" + +// AWSMachinePool is the Schema for the awsmachinepools API. +type AWSMachinePool struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AWSMachinePoolSpec `json:"spec,omitempty"` + Status AWSMachinePoolStatus `json:"status,omitempty"` +} + +// +kubebuilder:object:root=true + +// AWSMachinePoolList contains a list of AWSMachinePool. +type AWSMachinePoolList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSMachinePool `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AWSMachinePool{}, &AWSMachinePoolList{}) +} + +// GetConditions returns the observations of the operational state of the AWSMachinePool resource. +func (r *AWSMachinePool) GetConditions() clusterv1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the AWSMachinePool to the predescribed clusterv1.Conditions. +func (r *AWSMachinePool) SetConditions(conditions clusterv1.Conditions) { + r.Status.Conditions = conditions +} + +// GetObjectKind will return the ObjectKind of an AWSMachinePool. +func (r *AWSMachinePool) GetObjectKind() schema.ObjectKind { + return &r.TypeMeta +} + +// GetObjectKind will return the ObjectKind of an AWSMachinePoolList. +func (r *AWSMachinePoolList) GetObjectKind() schema.ObjectKind { + return &r.TypeMeta +} diff --git a/exp/api/v1alpha4/awsmachinepool_webhook.go b/exp/api/v1beta1/awsmachinepool_webhook.go similarity index 81% rename from exp/api/v1alpha4/awsmachinepool_webhook.go rename to exp/api/v1beta1/awsmachinepool_webhook.go index 62a83fa2a0..4981223bb2 100644 --- a/exp/api/v1alpha4/awsmachinepool_webhook.go +++ b/exp/api/v1beta1/awsmachinepool_webhook.go @@ -14,12 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "time" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -40,8 +40,8 @@ func (r *AWSMachinePool) SetupWebhookWithManager(mgr ctrl.Manager) error { Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsmachinepool,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmachinepools,versions=v1alpha4,name=validation.awsmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awsmachinepool,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmachinepools,versions=v1alpha4,name=default.awsmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-awsmachinepool,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmachinepools,versions=v1beta1,name=validation.awsmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-awsmachinepool,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmachinepools,versions=v1beta1,name=default.awsmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 var _ webhook.Defaulter = &AWSMachinePool{} var _ webhook.Validator = &AWSMachinePool{} @@ -63,12 +63,12 @@ func (r *AWSMachinePool) validateRootVolume() field.ErrorList { return allErrs } - if v1alpha4.VolumeTypesProvisioned.Has(string(r.Spec.AWSLaunchTemplate.RootVolume.Type)) && r.Spec.AWSLaunchTemplate.RootVolume.IOPS == 0 { + if v1beta1.VolumeTypesProvisioned.Has(string(r.Spec.AWSLaunchTemplate.RootVolume.Type)) && r.Spec.AWSLaunchTemplate.RootVolume.IOPS == 0 { allErrs = append(allErrs, field.Required(field.NewPath("spec.awsLaunchTemplate.rootVolume.iops"), "iops required if type is 'io1' or 'io2'")) } if r.Spec.AWSLaunchTemplate.RootVolume.Throughput != nil { - if r.Spec.AWSLaunchTemplate.RootVolume.Type != v1alpha4.VolumeTypeGP3 { + if r.Spec.AWSLaunchTemplate.RootVolume.Type != v1beta1.VolumeTypeGP3 { allErrs = append(allErrs, field.Required(field.NewPath("spec.awsLaunchTemplate.rootVolume.throughput"), "throughput is valid only for type 'gp3'")) } if *r.Spec.AWSLaunchTemplate.RootVolume.Throughput < 0 { diff --git a/exp/api/v1alpha4/awsmachinepool_webhook_test.go b/exp/api/v1beta1/awsmachinepool_webhook_test.go similarity index 98% rename from exp/api/v1alpha4/awsmachinepool_webhook_test.go rename to exp/api/v1beta1/awsmachinepool_webhook_test.go index 0464319cee..584c0a4857 100644 --- a/exp/api/v1alpha4/awsmachinepool_webhook_test.go +++ b/exp/api/v1beta1/awsmachinepool_webhook_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "testing" diff --git a/exp/api/v1beta1/awsmanagedmachinepool_types.go b/exp/api/v1beta1/awsmanagedmachinepool_types.go new file mode 100644 index 0000000000..c2c9de0cd5 --- /dev/null +++ b/exp/api/v1beta1/awsmanagedmachinepool_types.go @@ -0,0 +1,259 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + "fmt" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + "sigs.k8s.io/cluster-api/errors" +) + +const ( + // ManagedMachinePoolFinalizer allows the controller to clean up resources on delete. + ManagedMachinePoolFinalizer = "awsmanagedmachinepools.infrastructure.cluster.x-k8s.io" +) + +// ManagedMachineAMIType specifies which AWS AMI to use for a managed MachinePool. +type ManagedMachineAMIType string + +const ( + // Al2x86_64 is the default AMI type. + Al2x86_64 ManagedMachineAMIType = "AL2_x86_64" + // Al2x86_64GPU is the x86-64 GPU AMI type. + Al2x86_64GPU ManagedMachineAMIType = "AL2_x86_64_GPU" + // Al2Arm64 is the Arm AMI type. + Al2Arm64 ManagedMachineAMIType = "AL2_ARM_64" +) + +// ManagedMachinePoolCapacityType specifies the capacity type to be used for the managed MachinePool. +type ManagedMachinePoolCapacityType string + +const ( + // ManagedMachinePoolCapacityTypeOnDemand is the default capacity type, to launch on-demand instances. + ManagedMachinePoolCapacityTypeOnDemand ManagedMachinePoolCapacityType = "onDemand" + // ManagedMachinePoolCapacityTypeSpot is the spot instance capacity type to launch spot instances. + ManagedMachinePoolCapacityTypeSpot ManagedMachinePoolCapacityType = "spot" +) + +var ( + // DefaultEKSNodegroupRole is the name of the default IAM role to use for EKS nodegroups + // if no other role is supplied in the spec and if iam role creation is not enabled. The default + // can be created using clusterawsadm or created manually. + DefaultEKSNodegroupRole = fmt.Sprintf("eks-nodegroup%s", iamv1.DefaultNameSuffix) +) + +// AWSManagedMachinePoolSpec defines the desired state of AWSManagedMachinePool. +type AWSManagedMachinePoolSpec struct { + // EKSNodegroupName specifies the name of the nodegroup in AWS + // corresponding to this MachinePool. If you don't specify a name + // then a default name will be created based on the namespace and + // name of the managed machine pool. + // +optional + EKSNodegroupName string `json:"eksNodegroupName,omitempty"` + + // AvailabilityZones is an array of availability zones instances can run in + AvailabilityZones []string `json:"availabilityZones,omitempty"` + + // SubnetIDs specifies which subnets are used for the + // auto scaling group of this nodegroup + // +optional + SubnetIDs []string `json:"subnetIDs,omitempty"` + + // AdditionalTags is an optional set of tags to add to AWS resources managed by the AWS provider, in addition to the + // ones added by default. + // +optional + AdditionalTags infrav1.Tags `json:"additionalTags,omitempty"` + + // RoleAdditionalPolicies allows you to attach additional polices to + // the node group role. You must enable the EKSAllowAddRoles + // feature flag to incorporate these into the created role. + // +optional + RoleAdditionalPolicies []string `json:"roleAdditionalPolicies,omitempty"` + + // RoleName specifies the name of IAM role for the node group. + // If the role is pre-existing we will treat it as unmanaged + // and not delete it on deletion. If the EKSEnableIAM feature + // flag is true and no name is supplied then a role is created. + // +optional + RoleName string `json:"roleName,omitempty"` + + // AMIVersion defines the desired AMI release version. If no version number + // is supplied then the latest version for the Kubernetes version + // will be used + // +kubebuilder:validation:MinLength:=2 + // +optional + AMIVersion *string `json:"amiVersion,omitempty"` + + // AMIType defines the AMI type + // +kubebuilder:validation:Enum:=AL2_x86_64;AL2_x86_64_GPU;AL2_ARM_64 + // +kubebuilder:default:=AL2_x86_64 + // +optional + AMIType *ManagedMachineAMIType `json:"amiType,omitempty"` + + // Labels specifies labels for the Kubernetes node objects + // +optional + Labels map[string]string `json:"labels,omitempty"` + + // Taints specifies the taints to apply to the nodes of the machine pool + // +optional + Taints Taints `json:"taints,omitempty"` + + // DiskSize specifies the root disk size + // +optional + DiskSize *int32 `json:"diskSize,omitempty"` + + // InstanceType specifies the AWS instance type + // +optional + InstanceType *string `json:"instanceType,omitempty"` + + // Scaling specifies scaling for the ASG behind this pool + // +optional + Scaling *ManagedMachinePoolScaling `json:"scaling,omitempty"` + + // RemoteAccess specifies how machines can be accessed remotely + // +optional + RemoteAccess *ManagedRemoteAccess `json:"remoteAccess,omitempty"` + + // ProviderIDList are the provider IDs of instances in the + // autoscaling group corresponding to the nodegroup represented by this + // machine pool + // +optional + ProviderIDList []string `json:"providerIDList,omitempty"` + + // CapacityType specifies the capacity type for the ASG behind this pool + // +kubebuilder:validation:Enum:=onDemand;spot + // +kubebuilder:default:=onDemand + // +optional + CapacityType *ManagedMachinePoolCapacityType `json:"capacityType,omitempty"` +} + +// ManagedMachinePoolScaling specifies scaling options. +type ManagedMachinePoolScaling struct { + MinSize *int32 `json:"minSize,omitempty"` + MaxSize *int32 `json:"maxSize,omitempty"` +} + +// ManagedRemoteAccess specifies remote access settings for EC2 instances. +type ManagedRemoteAccess struct { + // SSHKeyName specifies which EC2 SSH key can be used to access machines. + // If left empty, the key from the control plane is used. + SSHKeyName *string `json:"sshKeyName,omitempty"` + + // SourceSecurityGroups specifies which security groups are allowed access + SourceSecurityGroups []string `json:"sourceSecurityGroups,omitempty"` + + // Public specifies whether to open port 22 to the public internet + Public bool `json:"public,omitempty"` +} + +// AWSManagedMachinePoolStatus defines the observed state of AWSManagedMachinePool. +type AWSManagedMachinePoolStatus struct { + // Ready denotes that the AWSManagedMachinePool nodegroup has joined + // the cluster + // +kubebuilder:default=false + Ready bool `json:"ready"` + + // Replicas is the most recently observed number of replicas. + // +optional + Replicas int32 `json:"replicas"` + + // FailureReason will be set in the event that there is a terminal problem + // reconciling the MachinePool 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 MachinePools + // can be added as events to the MachinePool object and/or logged in the + // controller's output. + // +optional + FailureReason *errors.MachineStatusError `json:"failureReason,omitempty"` + + // FailureMessage will be set in the event that there is a terminal problem + // reconciling the MachinePool 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 MachinePool'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 MachinePools + // can be added as events to the MachinePool object and/or logged in the + // controller's output. + // +optional + FailureMessage *string `json:"failureMessage,omitempty"` + + // Conditions defines current service state of the managed machine pool + // +optional + Conditions clusterv1.Conditions `json:"conditions,omitempty"` +} + +// +kubebuilder:object:root=true +// +kubebuilder:resource:path=awsmanagedmachinepools,scope=Namespaced,categories=cluster-api,shortName=awsmmp +// +kubebuilder:storageversion +// +kubebuilder:subresource:status +// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.ready",description="MachinePool ready status" +// +kubebuilder:printcolumn:name="Replicas",type="integer",JSONPath=".status.replicas",description="Number of replicas" + +// AWSManagedMachinePool is the Schema for the awsmanagedmachinepools API. +type AWSManagedMachinePool struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec AWSManagedMachinePoolSpec `json:"spec,omitempty"` + Status AWSManagedMachinePoolStatus `json:"status,omitempty"` +} + +// GetConditions returns the observations of the operational state of the AWSManagedMachinePool resource. +func (r *AWSManagedMachinePool) GetConditions() clusterv1.Conditions { + return r.Status.Conditions +} + +// SetConditions sets the underlying service state of the AWSManagedMachinePool to the predescribed clusterv1.Conditions. +func (r *AWSManagedMachinePool) SetConditions(conditions clusterv1.Conditions) { + r.Status.Conditions = conditions +} + +// +kubebuilder:object:root=true + +// AWSManagedMachinePoolList contains a list of AWSManagedMachinePools. +type AWSManagedMachinePoolList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata,omitempty"` + Items []AWSManagedMachinePool `json:"items"` +} + +func init() { + SchemeBuilder.Register(&AWSManagedMachinePool{}, &AWSManagedMachinePoolList{}) +} diff --git a/exp/api/v1alpha4/awsmanagedmachinepool_webhook.go b/exp/api/v1beta1/awsmanagedmachinepool_webhook.go similarity index 90% rename from exp/api/v1alpha4/awsmanagedmachinepool_webhook.go rename to exp/api/v1beta1/awsmanagedmachinepool_webhook.go index ef9ec40c9b..2bf8875d80 100644 --- a/exp/api/v1alpha4/awsmanagedmachinepool_webhook.go +++ b/exp/api/v1beta1/awsmanagedmachinepool_webhook.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "fmt" @@ -47,8 +47,8 @@ func (r *AWSManagedMachinePool) SetupWebhookWithManager(mgr ctrl.Manager) error Complete() } -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha4-awsmanagedmachinepool,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmanagedmachinepools,versions=v1alpha4,name=validation.awsmanagedmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha4-awsmanagedmachinepool,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmanagedmachinepools,versions=v1alpha4,name=default.awsmanagedmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1beta1-awsmanagedmachinepool,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmanagedmachinepools,versions=v1beta1,name=validation.awsmanagedmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 +// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1beta1-awsmanagedmachinepool,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmanagedmachinepools,versions=v1beta1,name=default.awsmanagedmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None,admissionReviewVersions=v1beta1 var _ webhook.Defaulter = &AWSManagedMachinePool{} var _ webhook.Validator = &AWSManagedMachinePool{} diff --git a/exp/api/v1alpha4/awsmanagedmachinepool_webhook_test.go b/exp/api/v1beta1/awsmanagedmachinepool_webhook_test.go similarity index 98% rename from exp/api/v1alpha4/awsmanagedmachinepool_webhook_test.go rename to exp/api/v1beta1/awsmanagedmachinepool_webhook_test.go index 259482c6b3..5b07e16ea4 100644 --- a/exp/api/v1alpha4/awsmanagedmachinepool_webhook_test.go +++ b/exp/api/v1beta1/awsmanagedmachinepool_webhook_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package v1alpha4 +package v1beta1 import ( "testing" diff --git a/exp/api/v1beta1/conditions_consts.go b/exp/api/v1beta1/conditions_consts.go new file mode 100644 index 0000000000..5517ecbb16 --- /dev/null +++ b/exp/api/v1beta1/conditions_consts.go @@ -0,0 +1,92 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + +const ( + // ASGReadyCondition reports on current status of the autoscaling group. Ready indicates the group is provisioned. + ASGReadyCondition clusterv1.ConditionType = "ASGReady" + // ASGNotFoundReason used when the autoscaling group couldn't be retrieved. + ASGNotFoundReason = "ASGNotFound" + // ASGProvisionFailedReason used for failures during autoscaling group provisioning. + ASGProvisionFailedReason = "ASGProvisionFailed" + // ASGDeletionInProgress ASG is in a deletion in progress state. + ASGDeletionInProgress = "ASGDeletionInProgress" + + // LaunchTemplateReadyCondition represents the status of an AWSMachinePool's associated Launch Template. + LaunchTemplateReadyCondition clusterv1.ConditionType = "LaunchTemplateReady" + // LaunchTemplateNotFoundReason is used when an associated Launch Template can't be found. + LaunchTemplateNotFoundReason = "LaunchTemplateNotFound" + // LaunchTemplateCreateFailedReason used for failures during Launch Template creation. + LaunchTemplateCreateFailedReason = "LaunchTemplateCreateFailed" + + // InstanceRefreshStartedCondition reports on successfully starting instance refresh. + InstanceRefreshStartedCondition clusterv1.ConditionType = "InstanceRefreshStarted" + // InstanceRefreshNotReadyReason used to report instance refresh is not initiated. + // If there are instance refreshes that are in progress, then a new instance refresh request will fail. + InstanceRefreshNotReadyReason = "InstanceRefreshNotReady" + // InstanceRefreshFailedReason used to report when there instance refresh is not initiated. + InstanceRefreshFailedReason = "InstanceRefreshFailed" +) + +const ( + // EKSNodegroupReadyCondition condition reports on the successful reconciliation of eks control plane. + EKSNodegroupReadyCondition clusterv1.ConditionType = "EKSNodegroupReady" + // EKSNodegroupReconciliationFailedReason used to report failures while reconciling EKS control plane. + EKSNodegroupReconciliationFailedReason = "EKSNodegroupReconciliationFailed" + // WaitingForEKSControlPlaneReason used when the machine pool is waiting for + // EKS control plane infrastructure to be ready before proceeding. + WaitingForEKSControlPlaneReason = "WaitingForEKSControlPlane" +) + +const ( + // EKSFargateProfileReadyCondition condition reports on the successful reconciliation of eks control plane. + EKSFargateProfileReadyCondition clusterv1.ConditionType = "EKSFargateProfileReady" + // EKSFargateCreatingCondition condition reports on whether the fargate + // profile is creating. + EKSFargateCreatingCondition clusterv1.ConditionType = "EKSFargateCreating" + // EKSFargateDeletingCondition used to report that the profile is deleting. + EKSFargateDeletingCondition = "EKSFargateDeleting" + // EKSFargateReconciliationFailedReason used to report failures while reconciling EKS control plane. + EKSFargateReconciliationFailedReason = "EKSFargateReconciliationFailed" + // EKSFargateDeletingReason used when the profile is deleting. + EKSFargateDeletingReason = "Deleting" + // EKSFargateCreatingReason used when the profile is creating. + EKSFargateCreatingReason = "Creating" + // EKSFargateCreatedReason used when the profile is created. + EKSFargateCreatedReason = "Created" + // EKSFargateDeletedReason used when the profile is deleted. + EKSFargateDeletedReason = "Deleted" + // EKSFargateFailedReason used when the profile failed. + EKSFargateFailedReason = "Failed" +) + +const ( + // IAMNodegroupRolesReadyCondition condition reports on the successful + // reconciliation of EKS nodegroup iam roles. + IAMNodegroupRolesReadyCondition clusterv1.ConditionType = "IAMNodegroupRolesReady" + // IAMNodegroupRolesReconciliationFailedReason used to report failures while + // reconciling EKS nodegroup iam roles. + IAMNodegroupRolesReconciliationFailedReason = "IAMNodegroupRolesReconciliationFailed" + // IAMFargateRolesReadyCondition condition reports on the successful + // reconciliation of EKS nodegroup iam roles. + IAMFargateRolesReadyCondition clusterv1.ConditionType = "IAMFargateRolesReady" + // IAMFargateRolesReconciliationFailedReason used to report failures while + // reconciling EKS nodegroup iam roles. + IAMFargateRolesReconciliationFailedReason = "IAMFargateRolesReconciliationFailed" +) diff --git a/exp/api/v1beta1/conversion.go b/exp/api/v1beta1/conversion.go new file mode 100644 index 0000000000..f085bc67b8 --- /dev/null +++ b/exp/api/v1beta1/conversion.go @@ -0,0 +1,35 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +// Hub marks AWSMachinePool as a conversion hub. +func (*AWSMachinePool) Hub() {} + +// Hub marks AWSMachinePoolList as a conversion hub. +func (*AWSMachinePoolList) Hub() {} + +// Hub marks AWSManagedMachinePool as a conversion hub. +func (*AWSManagedMachinePool) Hub() {} + +// Hub marks AWSManagedMachinePoolList as a conversion hub. +func (*AWSManagedMachinePoolList) Hub() {} + +// Hub marks AWSFargateProfile as a conversion hub. +func (*AWSFargateProfile) Hub() {} + +// Hub marks AWSFargateProfileList as a conversion hub. +func (*AWSFargateProfileList) Hub() {} diff --git a/exp/api/v1beta1/doc.go b/exp/api/v1beta1/doc.go new file mode 100644 index 0000000000..aca5dfc710 --- /dev/null +++ b/exp/api/v1beta1/doc.go @@ -0,0 +1,21 @@ +/* +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. +*/ + +// +gencrdrefdocs:force +// +groupName=infrastructure.cluster.x-k8s.io +// +k8s:defaulter-gen=TypeMeta + +package v1beta1 diff --git a/exp/api/v1beta1/groupversion_info.go b/exp/api/v1beta1/groupversion_info.go new file mode 100644 index 0000000000..f79efa8d22 --- /dev/null +++ b/exp/api/v1beta1/groupversion_info.go @@ -0,0 +1,36 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package v1beta1 contains API Schema definitions for experimental v1beta1 API group +// +kubebuilder:object:generate=true +// +groupName=infrastructure.cluster.x-k8s.io +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "sigs.k8s.io/controller-runtime/pkg/scheme" +) + +var ( + // GroupVersion is group version used to register these objects. + GroupVersion = schema.GroupVersion{Group: "infrastructure.cluster.x-k8s.io", Version: "v1beta1"} + + // SchemeBuilder is used to add go types to the GroupVersionKind scheme. + SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} + + // AddToScheme adds the types in this group-version to the given scheme. + AddToScheme = SchemeBuilder.AddToScheme +) diff --git a/exp/api/v1beta1/types.go b/exp/api/v1beta1/types.go new file mode 100644 index 0000000000..bb9cc3a314 --- /dev/null +++ b/exp/api/v1beta1/types.go @@ -0,0 +1,252 @@ +/* +Copyright 2021 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1beta1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" +) + +// EBS can be used to automatically set up EBS volumes when an instance is launched. +type EBS struct { + // Encrypted is whether the volume should be encrypted or not. + // +optional + Encrypted bool `json:"encrypted,omitempty"` + + // The size of the volume, in GiB. + // This can be a number from 1-1,024 for standard, 4-16,384 for io1, 1-16,384 + // for gp2, and 500-16,384 for st1 and sc1. If you specify a snapshot, the volume + // size must be equal to or larger than the snapshot size. + // +optional + VolumeSize int64 `json:"volumeSize,omitempty"` + + // The volume type + // For more information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) + // +kubebuilder:validation:Enum=standard;io1;gp2;st1;sc1;io2 + // +optional + VolumeType string `json:"volumeType,omitempty"` +} + +// BlockDeviceMapping specifies the block devices for the instance. +// You can specify virtual devices and EBS volumes. +type BlockDeviceMapping struct { + // The device name exposed to the EC2 instance (for example, /dev/sdh or xvdh). + // +kubebuilder:validation:Required + DeviceName string `json:"deviceName,omitempty"` + + // You can specify either VirtualName or Ebs, but not both. + // +optional + Ebs EBS `json:"ebs,omitempty"` +} + +// AWSLaunchTemplate defines the desired state of AWSLaunchTemplate. +type AWSLaunchTemplate struct { + // The name of the launch template. + Name string `json:"name,omitempty"` + + // The name or the Amazon Resource Name (ARN) of the instance profile associated + // with the IAM role for the instance. The instance profile contains the IAM + // role. + IamInstanceProfile string `json:"iamInstanceProfile,omitempty"` + + // AMI is the reference to the AMI from which to create the machine instance. + // +optional + AMI infrav1.AMIReference `json:"ami,omitempty"` + + // ImageLookupFormat is the AMI naming format to look up the image for this + // machine It will be ignored if an explicit AMI is set. Supports + // substitutions for {{.BaseOS}} and {{.K8sVersion}} with the base OS and + // kubernetes version, respectively. The BaseOS will be the value in + // ImageLookupBaseOS or ubuntu (the default), and the kubernetes version as + // defined by the packages produced by kubernetes/release without v as a + // prefix: 1.13.0, 1.12.5-mybuild.1, or 1.17.3. For example, the default + // image format of capa-ami-{{.BaseOS}}-?{{.K8sVersion}}-* will end up + // searching for AMIs that match the pattern capa-ami-ubuntu-?1.18.0-* for a + // Machine that is targeting kubernetes v1.18.0 and the ubuntu base OS. See + // also: https://golang.org/pkg/text/template/ + // +optional + ImageLookupFormat string `json:"imageLookupFormat,omitempty"` + + // ImageLookupOrg is the AWS Organization ID to use for image lookup if AMI is not set. + ImageLookupOrg string `json:"imageLookupOrg,omitempty"` + + // ImageLookupBaseOS is the name of the base operating system to use for + // image lookup the AMI is not set. + ImageLookupBaseOS string `json:"imageLookupBaseOS,omitempty"` + + // InstanceType is the type of instance to create. Example: m4.xlarge + InstanceType string `json:"instanceType,omitempty"` + + // RootVolume encapsulates the configuration options for the root volume + // +optional + RootVolume *infrav1.Volume `json:"rootVolume,omitempty"` + + // SSHKeyName is the name of the ssh key to attach to the instance. Valid values are empty string + // (do not use SSH keys), a valid SSH key name, or omitted (use the default SSH key name) + // +optional + SSHKeyName *string `json:"sshKeyName,omitempty"` + + // VersionNumber is the version of the launch template that is applied. + // Typically a new version is created when at least one of the following happens: + // 1) A new launch template spec is applied. + // 2) One or more parameters in an existing template is changed. + // 3) A new AMI is discovered. + VersionNumber *int64 `json:"versionNumber,omitempty"` + + // AdditionalSecurityGroups is an array of references to security groups that should be applied to the + // instances. These security groups would be set in addition to any security groups defined + // at the cluster level or in the actuator. + // +optional + AdditionalSecurityGroups []infrav1.AWSResourceReference `json:"additionalSecurityGroups,omitempty"` +} + +// Overrides are used to override the instance type specified by the launch template with multiple +// instance types that can be used to launch On-Demand Instances and Spot Instances. +type Overrides struct { + InstanceType string `json:"instanceType"` +} + +// OnDemandAllocationStrategy indicates how to allocate instance types to fulfill On-Demand capacity. +type OnDemandAllocationStrategy string + +var ( + // OnDemandAllocationStrategyPrioritized uses the order of instance type overrides + // for the LaunchTemplate to define the launch priority of each instance type. + OnDemandAllocationStrategyPrioritized = OnDemandAllocationStrategy("prioritized") +) + +// SpotAllocationStrategy indicates how to allocate instances across Spot Instance pools. +type SpotAllocationStrategy string + +var ( + // SpotAllocationStrategyLowestPrice will make the Auto Scaling group launch + // instances using the Spot pools with the lowest price, and evenly allocates + // your instances across the number of Spot pools that you specify. + SpotAllocationStrategyLowestPrice = SpotAllocationStrategy("lowest-price") + + // SpotAllocationStrategyCapacityOptimized will make the Auto Scaling group launch + // instances using Spot pools that are optimally chosen based on the available Spot capacity. + SpotAllocationStrategyCapacityOptimized = SpotAllocationStrategy("capacity-optimized") +) + +// InstancesDistribution to configure distribution of On-Demand Instances and Spot Instances. +type InstancesDistribution struct { + // +kubebuilder:validation:Enum=prioritized + // +kubebuilder:default=prioritized + OnDemandAllocationStrategy OnDemandAllocationStrategy `json:"onDemandAllocationStrategy,omitempty"` + + // +kubebuilder:validation:Enum=lowest-price;capacity-optimized + // +kubebuilder:default=lowest-price + SpotAllocationStrategy SpotAllocationStrategy `json:"spotAllocationStrategy,omitempty"` + + // +kubebuilder:default=0 + OnDemandBaseCapacity *int64 `json:"onDemandBaseCapacity,omitempty"` + + // +kubebuilder:default=100 + OnDemandPercentageAboveBaseCapacity *int64 `json:"onDemandPercentageAboveBaseCapacity,omitempty"` +} + +// MixedInstancesPolicy for an Auto Scaling group. +type MixedInstancesPolicy struct { + InstancesDistribution *InstancesDistribution `json:"instancesDistribution,omitempty"` + Overrides []Overrides `json:"overrides,omitempty"` +} + +// Tags is a mapping for tags. +type Tags map[string]string + +// AutoScalingGroup describes an AWS autoscaling group. +type AutoScalingGroup struct { + // The tags associated with the instance. + ID string `json:"id,omitempty"` + Tags infrav1.Tags `json:"tags,omitempty"` + Name string `json:"name,omitempty"` + DesiredCapacity *int32 `json:"desiredCapacity,omitempty"` + MaxSize int32 `json:"maxSize,omitempty"` + MinSize int32 `json:"minSize,omitempty"` + PlacementGroup string `json:"placementGroup,omitempty"` + Subnets []string `json:"subnets,omitempty"` + DefaultCoolDown metav1.Duration `json:"defaultCoolDown,omitempty"` + CapacityRebalance bool `json:"capacityRebalance,omitempty"` + + MixedInstancesPolicy *MixedInstancesPolicy `json:"mixedInstancesPolicy,omitempty"` + Status ASGStatus + Instances []infrav1.Instance `json:"instances,omitempty"` +} + +// ASGStatus is a status string returned by the autoscaling API. +type ASGStatus string + +var ( + // ASGStatusDeleteInProgress is the string representing an ASG that is currently deleting. + ASGStatusDeleteInProgress = ASGStatus("Delete in progress") +) + +// TaintEffect is the effect for a Kubernetes taint. +type TaintEffect string + +var ( + // TaintEffectNoSchedule is a taint that indicates that a pod shouldn't be scheduled on a node + // unless it can tolerate the taint. + TaintEffectNoSchedule = TaintEffect("no-schedule") + // TaintEffectNoExecute is a taint that indicates that a pod shouldn't be schedule on a node + // unless it can tolerate it. And if its already running on the node it will be evicted. + TaintEffectNoExecute = TaintEffect("no-execute") + // TaintEffectPreferNoSchedule is a taint that indicates that there is a "preference" that pods shouldn't + // be scheduled on a node unless it can tolerate the taint. the scheduler will try to avoid placing the pod + // but it may still run on the node if there is no other option. + TaintEffectPreferNoSchedule = TaintEffect("prefer-no-schedule") +) + +// Taint defines the specs for a Kubernetes taint. +type Taint struct { + // Effect specifies the effect for the taint + // +kubebuilder:validation:Required + // +kubebuilder:validation:Enum=no-schedule;no-execute;prefer-no-schedule + Effect TaintEffect `json:"effect"` + // Key is the key of the taint + // +kubebuilder:validation:Required + Key string `json:"key"` + // Value is the value of the taint + // +kubebuilder:validation:Required + Value string `json:"value"` +} + +// Equals is used to test if 2 taints are equal. +func (t *Taint) Equals(other *Taint) bool { + if t == nil || other == nil { + return t == other + } + + return t.Effect == other.Effect && + t.Key == other.Key && + t.Value == other.Value +} + +// Taints is an array of Taints. +type Taints []Taint + +// Contains checks for existence of a matching taint. +func (t *Taints) Contains(taint *Taint) bool { + for _, t := range *t { + if t.Equals(taint) { + return true + } + } + + return false +} diff --git a/exp/api/v1beta1/zz_generated.deepcopy.go b/exp/api/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..4b830e56d8 --- /dev/null +++ b/exp/api/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,843 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import ( + "k8s.io/apimachinery/pkg/runtime" + apiv1beta1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + cluster_apiapiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1" + "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 *AWSFargateProfile) DeepCopyInto(out *AWSFargateProfile) { + *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 AWSFargateProfile. +func (in *AWSFargateProfile) DeepCopy() *AWSFargateProfile { + if in == nil { + return nil + } + out := new(AWSFargateProfile) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSFargateProfile) 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 *AWSFargateProfileList) DeepCopyInto(out *AWSFargateProfileList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSFargateProfile, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSFargateProfileList. +func (in *AWSFargateProfileList) DeepCopy() *AWSFargateProfileList { + if in == nil { + return nil + } + out := new(AWSFargateProfileList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSFargateProfileList) 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 *AWSLaunchTemplate) DeepCopyInto(out *AWSLaunchTemplate) { + *out = *in + in.AMI.DeepCopyInto(&out.AMI) + if in.RootVolume != nil { + in, out := &in.RootVolume, &out.RootVolume + *out = new(apiv1beta1.Volume) + (*in).DeepCopyInto(*out) + } + if in.SSHKeyName != nil { + in, out := &in.SSHKeyName, &out.SSHKeyName + *out = new(string) + **out = **in + } + if in.VersionNumber != nil { + in, out := &in.VersionNumber, &out.VersionNumber + *out = new(int64) + **out = **in + } + if in.AdditionalSecurityGroups != nil { + in, out := &in.AdditionalSecurityGroups, &out.AdditionalSecurityGroups + *out = make([]apiv1beta1.AWSResourceReference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSLaunchTemplate. +func (in *AWSLaunchTemplate) DeepCopy() *AWSLaunchTemplate { + if in == nil { + return nil + } + out := new(AWSLaunchTemplate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachinePool) DeepCopyInto(out *AWSMachinePool) { + *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 AWSMachinePool. +func (in *AWSMachinePool) DeepCopy() *AWSMachinePool { + if in == nil { + return nil + } + out := new(AWSMachinePool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSMachinePool) 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 *AWSMachinePoolInstanceStatus) DeepCopyInto(out *AWSMachinePoolInstanceStatus) { + *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 AWSMachinePoolInstanceStatus. +func (in *AWSMachinePoolInstanceStatus) DeepCopy() *AWSMachinePoolInstanceStatus { + if in == nil { + return nil + } + out := new(AWSMachinePoolInstanceStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachinePoolList) DeepCopyInto(out *AWSMachinePoolList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSMachinePool, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachinePoolList. +func (in *AWSMachinePoolList) DeepCopy() *AWSMachinePoolList { + if in == nil { + return nil + } + out := new(AWSMachinePoolList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSMachinePoolList) 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 *AWSMachinePoolSpec) DeepCopyInto(out *AWSMachinePoolSpec) { + *out = *in + if in.AvailabilityZones != nil { + in, out := &in.AvailabilityZones, &out.AvailabilityZones + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make([]apiv1beta1.AWSResourceReference, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.AdditionalTags != nil { + in, out := &in.AdditionalTags, &out.AdditionalTags + *out = make(apiv1beta1.Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + in.AWSLaunchTemplate.DeepCopyInto(&out.AWSLaunchTemplate) + if in.MixedInstancesPolicy != nil { + in, out := &in.MixedInstancesPolicy, &out.MixedInstancesPolicy + *out = new(MixedInstancesPolicy) + (*in).DeepCopyInto(*out) + } + if in.ProviderIDList != nil { + in, out := &in.ProviderIDList, &out.ProviderIDList + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.DefaultCoolDown = in.DefaultCoolDown + if in.RefreshPreferences != nil { + in, out := &in.RefreshPreferences, &out.RefreshPreferences + *out = new(RefreshPreferences) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachinePoolSpec. +func (in *AWSMachinePoolSpec) DeepCopy() *AWSMachinePoolSpec { + if in == nil { + return nil + } + out := new(AWSMachinePoolSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSMachinePoolStatus) DeepCopyInto(out *AWSMachinePoolStatus) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(cluster_apiapiv1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.Instances != nil { + in, out := &in.Instances, &out.Instances + *out = make([]AWSMachinePoolInstanceStatus, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + if in.FailureReason != nil { + in, out := &in.FailureReason, &out.FailureReason + *out = new(errors.MachineStatusError) + **out = **in + } + if in.FailureMessage != nil { + in, out := &in.FailureMessage, &out.FailureMessage + *out = new(string) + **out = **in + } + if in.ASGStatus != nil { + in, out := &in.ASGStatus, &out.ASGStatus + *out = new(ASGStatus) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSMachinePoolStatus. +func (in *AWSMachinePoolStatus) DeepCopy() *AWSMachinePoolStatus { + if in == nil { + return nil + } + out := new(AWSMachinePoolStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSManagedMachinePool) DeepCopyInto(out *AWSManagedMachinePool) { + *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 AWSManagedMachinePool. +func (in *AWSManagedMachinePool) DeepCopy() *AWSManagedMachinePool { + if in == nil { + return nil + } + out := new(AWSManagedMachinePool) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSManagedMachinePool) 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 *AWSManagedMachinePoolList) DeepCopyInto(out *AWSManagedMachinePoolList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSManagedMachinePool, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedMachinePoolList. +func (in *AWSManagedMachinePoolList) DeepCopy() *AWSManagedMachinePoolList { + if in == nil { + return nil + } + out := new(AWSManagedMachinePoolList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *AWSManagedMachinePoolList) 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 *AWSManagedMachinePoolSpec) DeepCopyInto(out *AWSManagedMachinePoolSpec) { + *out = *in + if in.AvailabilityZones != nil { + in, out := &in.AvailabilityZones, &out.AvailabilityZones + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SubnetIDs != nil { + in, out := &in.SubnetIDs, &out.SubnetIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AdditionalTags != nil { + in, out := &in.AdditionalTags, &out.AdditionalTags + *out = make(apiv1beta1.Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.RoleAdditionalPolicies != nil { + in, out := &in.RoleAdditionalPolicies, &out.RoleAdditionalPolicies + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AMIVersion != nil { + in, out := &in.AMIVersion, &out.AMIVersion + *out = new(string) + **out = **in + } + if in.AMIType != nil { + in, out := &in.AMIType, &out.AMIType + *out = new(ManagedMachineAMIType) + **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.Taints != nil { + in, out := &in.Taints, &out.Taints + *out = make(Taints, len(*in)) + copy(*out, *in) + } + if in.DiskSize != nil { + in, out := &in.DiskSize, &out.DiskSize + *out = new(int32) + **out = **in + } + if in.InstanceType != nil { + in, out := &in.InstanceType, &out.InstanceType + *out = new(string) + **out = **in + } + if in.Scaling != nil { + in, out := &in.Scaling, &out.Scaling + *out = new(ManagedMachinePoolScaling) + (*in).DeepCopyInto(*out) + } + if in.RemoteAccess != nil { + in, out := &in.RemoteAccess, &out.RemoteAccess + *out = new(ManagedRemoteAccess) + (*in).DeepCopyInto(*out) + } + if in.ProviderIDList != nil { + in, out := &in.ProviderIDList, &out.ProviderIDList + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.CapacityType != nil { + in, out := &in.CapacityType, &out.CapacityType + *out = new(ManagedMachinePoolCapacityType) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedMachinePoolSpec. +func (in *AWSManagedMachinePoolSpec) DeepCopy() *AWSManagedMachinePoolSpec { + if in == nil { + return nil + } + out := new(AWSManagedMachinePoolSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AWSManagedMachinePoolStatus) DeepCopyInto(out *AWSManagedMachinePoolStatus) { + *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.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(cluster_apiapiv1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSManagedMachinePoolStatus. +func (in *AWSManagedMachinePoolStatus) DeepCopy() *AWSManagedMachinePoolStatus { + if in == nil { + return nil + } + out := new(AWSManagedMachinePoolStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *AutoScalingGroup) DeepCopyInto(out *AutoScalingGroup) { + *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(apiv1beta1.Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.DesiredCapacity != nil { + in, out := &in.DesiredCapacity, &out.DesiredCapacity + *out = new(int32) + **out = **in + } + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make([]string, len(*in)) + copy(*out, *in) + } + out.DefaultCoolDown = in.DefaultCoolDown + if in.MixedInstancesPolicy != nil { + in, out := &in.MixedInstancesPolicy, &out.MixedInstancesPolicy + *out = new(MixedInstancesPolicy) + (*in).DeepCopyInto(*out) + } + if in.Instances != nil { + in, out := &in.Instances, &out.Instances + *out = make([]apiv1beta1.Instance, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoScalingGroup. +func (in *AutoScalingGroup) DeepCopy() *AutoScalingGroup { + if in == nil { + return nil + } + out := new(AutoScalingGroup) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *BlockDeviceMapping) DeepCopyInto(out *BlockDeviceMapping) { + *out = *in + out.Ebs = in.Ebs +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockDeviceMapping. +func (in *BlockDeviceMapping) DeepCopy() *BlockDeviceMapping { + if in == nil { + return nil + } + out := new(BlockDeviceMapping) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EBS) DeepCopyInto(out *EBS) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EBS. +func (in *EBS) DeepCopy() *EBS { + if in == nil { + return nil + } + out := new(EBS) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FargateProfileSpec) DeepCopyInto(out *FargateProfileSpec) { + *out = *in + if in.SubnetIDs != nil { + in, out := &in.SubnetIDs, &out.SubnetIDs + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.AdditionalTags != nil { + in, out := &in.AdditionalTags, &out.AdditionalTags + *out = make(apiv1beta1.Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.Selectors != nil { + in, out := &in.Selectors, &out.Selectors + *out = make([]FargateSelector, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FargateProfileSpec. +func (in *FargateProfileSpec) DeepCopy() *FargateProfileSpec { + if in == nil { + return nil + } + out := new(FargateProfileSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FargateProfileStatus) DeepCopyInto(out *FargateProfileStatus) { + *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.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make(cluster_apiapiv1beta1.Conditions, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FargateProfileStatus. +func (in *FargateProfileStatus) DeepCopy() *FargateProfileStatus { + if in == nil { + return nil + } + out := new(FargateProfileStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *FargateSelector) DeepCopyInto(out *FargateSelector) { + *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 + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FargateSelector. +func (in *FargateSelector) DeepCopy() *FargateSelector { + if in == nil { + return nil + } + out := new(FargateSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InstancesDistribution) DeepCopyInto(out *InstancesDistribution) { + *out = *in + if in.OnDemandBaseCapacity != nil { + in, out := &in.OnDemandBaseCapacity, &out.OnDemandBaseCapacity + *out = new(int64) + **out = **in + } + if in.OnDemandPercentageAboveBaseCapacity != nil { + in, out := &in.OnDemandPercentageAboveBaseCapacity, &out.OnDemandPercentageAboveBaseCapacity + *out = new(int64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InstancesDistribution. +func (in *InstancesDistribution) DeepCopy() *InstancesDistribution { + if in == nil { + return nil + } + out := new(InstancesDistribution) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedMachinePoolScaling) DeepCopyInto(out *ManagedMachinePoolScaling) { + *out = *in + if in.MinSize != nil { + in, out := &in.MinSize, &out.MinSize + *out = new(int32) + **out = **in + } + if in.MaxSize != nil { + in, out := &in.MaxSize, &out.MaxSize + *out = new(int32) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedMachinePoolScaling. +func (in *ManagedMachinePoolScaling) DeepCopy() *ManagedMachinePoolScaling { + if in == nil { + return nil + } + out := new(ManagedMachinePoolScaling) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ManagedRemoteAccess) DeepCopyInto(out *ManagedRemoteAccess) { + *out = *in + if in.SSHKeyName != nil { + in, out := &in.SSHKeyName, &out.SSHKeyName + *out = new(string) + **out = **in + } + if in.SourceSecurityGroups != nil { + in, out := &in.SourceSecurityGroups, &out.SourceSecurityGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedRemoteAccess. +func (in *ManagedRemoteAccess) DeepCopy() *ManagedRemoteAccess { + if in == nil { + return nil + } + out := new(ManagedRemoteAccess) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MixedInstancesPolicy) DeepCopyInto(out *MixedInstancesPolicy) { + *out = *in + if in.InstancesDistribution != nil { + in, out := &in.InstancesDistribution, &out.InstancesDistribution + *out = new(InstancesDistribution) + (*in).DeepCopyInto(*out) + } + if in.Overrides != nil { + in, out := &in.Overrides, &out.Overrides + *out = make([]Overrides, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MixedInstancesPolicy. +func (in *MixedInstancesPolicy) DeepCopy() *MixedInstancesPolicy { + if in == nil { + return nil + } + out := new(MixedInstancesPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Overrides) DeepCopyInto(out *Overrides) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Overrides. +func (in *Overrides) DeepCopy() *Overrides { + if in == nil { + return nil + } + out := new(Overrides) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *RefreshPreferences) DeepCopyInto(out *RefreshPreferences) { + *out = *in + if in.Strategy != nil { + in, out := &in.Strategy, &out.Strategy + *out = new(string) + **out = **in + } + if in.InstanceWarmup != nil { + in, out := &in.InstanceWarmup, &out.InstanceWarmup + *out = new(int64) + **out = **in + } + if in.MinHealthyPercentage != nil { + in, out := &in.MinHealthyPercentage, &out.MinHealthyPercentage + *out = new(int64) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RefreshPreferences. +func (in *RefreshPreferences) DeepCopy() *RefreshPreferences { + if in == nil { + return nil + } + out := new(RefreshPreferences) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Tags) DeepCopyInto(out *Tags) { + { + in := &in + *out = make(Tags, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Tags. +func (in Tags) DeepCopy() Tags { + if in == nil { + return nil + } + out := new(Tags) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Taint) DeepCopyInto(out *Taint) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Taint. +func (in *Taint) DeepCopy() *Taint { + if in == nil { + return nil + } + out := new(Taint) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Taints) DeepCopyInto(out *Taints) { + { + in := &in + *out = make(Taints, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Taints. +func (in Taints) DeepCopy() Taints { + if in == nil { + return nil + } + out := new(Taints) + in.DeepCopyInto(out) + return *out +} diff --git a/cmd/clusterawsadm/api/ami/v1alpha1/zz_generated.defaults.go b/exp/api/v1beta1/zz_generated.defaults.go similarity index 98% rename from cmd/clusterawsadm/api/ami/v1alpha1/zz_generated.defaults.go rename to exp/api/v1beta1/zz_generated.defaults.go index dd621a3acd..73e63fc114 100644 --- a/cmd/clusterawsadm/api/ami/v1alpha1/zz_generated.defaults.go +++ b/exp/api/v1beta1/zz_generated.defaults.go @@ -18,7 +18,7 @@ limitations under the License. // Code generated by defaulter-gen. DO NOT EDIT. -package v1alpha1 +package v1beta1 import ( runtime "k8s.io/apimachinery/pkg/runtime" diff --git a/exp/controlleridentitycreator/awscontrolleridentity_controller.go b/exp/controlleridentitycreator/awscontrolleridentity_controller.go index 28bab0978e..26873d1b56 100644 --- a/exp/controlleridentitycreator/awscontrolleridentity_controller.go +++ b/exp/controlleridentitycreator/awscontrolleridentity_controller.go @@ -24,8 +24,8 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/feature" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api/util/predicates" @@ -69,7 +69,7 @@ func (r *AWSControllerIdentityReconciler) Reconcile(ctx context.Context, req ctr // If AWSCluster is not found, check if AWSManagedControlPlane is used. if !clusterFound && feature.Gates.Enabled(feature.EKS) { - awsControlPlane := &controlplanev1.AWSManagedControlPlane{} + awsControlPlane := &ekscontrolplanev1.AWSManagedControlPlane{} if err := r.Client.Get(ctx, req.NamespacedName, awsControlPlane); err != nil { if apierrors.IsNotFound(err) { log.V(4).Info("AWSManagedMachinePool not found, no identityRef so no action taken") @@ -138,7 +138,7 @@ func (r *AWSControllerIdentityReconciler) SetupWithManager(ctx context.Context, if feature.Gates.Enabled(feature.EKS) { controller.Watches( - &source.Kind{Type: &controlplanev1.AWSManagedControlPlane{}}, + &source.Kind{Type: &ekscontrolplanev1.AWSManagedControlPlane{}}, handler.EnqueueRequestsFromMapFunc(r.managedControlPlaneMap), ) } @@ -147,7 +147,7 @@ func (r *AWSControllerIdentityReconciler) SetupWithManager(ctx context.Context, } func (r *AWSControllerIdentityReconciler) managedControlPlaneMap(o client.Object) []ctrl.Request { - managedControlPlane, ok := o.(*controlplanev1.AWSManagedControlPlane) + managedControlPlane, ok := o.(*ekscontrolplanev1.AWSManagedControlPlane) if !ok { panic(fmt.Sprintf("Expected a managedControlPlane but got a %T", o)) } diff --git a/exp/controlleridentitycreator/awscontrolleridentity_controller_test.go b/exp/controlleridentitycreator/awscontrolleridentity_controller_test.go index 6bd2ab5db6..ce6acb8288 100644 --- a/exp/controlleridentitycreator/awscontrolleridentity_controller_test.go +++ b/exp/controlleridentitycreator/awscontrolleridentity_controller_test.go @@ -25,7 +25,7 @@ import ( . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/exp/controlleridentitycreator/suite_test.go b/exp/controlleridentitycreator/suite_test.go index d7682e3aa4..9fca829a75 100644 --- a/exp/controlleridentitycreator/suite_test.go +++ b/exp/controlleridentitycreator/suite_test.go @@ -24,10 +24,10 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/test/helpers" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/log" @@ -53,7 +53,7 @@ func TestMain(m *testing.M) { func setup() { utilruntime.Must(infrav1.AddToScheme(scheme.Scheme)) utilruntime.Must(clusterv1.AddToScheme(scheme.Scheme)) - utilruntime.Must(controlplanev1.AddToScheme(scheme.Scheme)) + utilruntime.Must(ekscontrolplanev1.AddToScheme(scheme.Scheme)) testEnvConfig := helpers.NewTestEnvironmentConfiguration([]string{ path.Join("config", "crd", "bases"), @@ -74,7 +74,7 @@ func setup() { if err = (&infrav1.AWSClusterRoleIdentity{}).SetupWebhookWithManager(testEnv); err != nil { panic(fmt.Sprintf("Unable to setup AWSClusterRoleIdentity webhook: %v", err)) } - if err := (&controlplanev1.AWSManagedControlPlane{}).SetupWebhookWithManager(testEnv); err != nil { + if err := (&ekscontrolplanev1.AWSManagedControlPlane{}).SetupWebhookWithManager(testEnv); err != nil { panic(fmt.Sprintf("Unable to setup AWSManagedControlPlane webhook: %v", err)) } diff --git a/exp/controllers/awsfargatepool_controller.go b/exp/controllers/awsfargatepool_controller.go index 81459bae45..e5eeeaf8b5 100644 --- a/exp/controllers/awsfargatepool_controller.go +++ b/exp/controllers/awsfargatepool_controller.go @@ -24,11 +24,11 @@ import ( "github.com/pkg/errors" apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/client-go/tools/record" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/eks" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/predicates" @@ -54,11 +54,11 @@ type AWSFargateProfileReconciler struct { func (r *AWSFargateProfileReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error { managedControlPlaneToFargateProfileMap := managedControlPlaneToFargateProfileMapFunc(r.Client, ctrl.LoggerFrom(ctx)) return ctrl.NewControllerManagedBy(mgr). - For(&infrav1exp.AWSFargateProfile{}). + For(&expinfrav1.AWSFargateProfile{}). WithOptions(options). WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)). Watches( - &source.Kind{Type: &controlplanev1.AWSManagedControlPlane{}}, + &source.Kind{Type: &ekscontrolplanev1.AWSManagedControlPlane{}}, handler.EnqueueRequestsFromMapFunc(managedControlPlaneToFargateProfileMap), ). Complete(r) @@ -74,7 +74,7 @@ func (r *AWSFargateProfileReconciler) SetupWithManager(ctx context.Context, mgr func (r *AWSFargateProfileReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error) { log := ctrl.LoggerFrom(ctx) - fargateProfile := &infrav1exp.AWSFargateProfile{} + fargateProfile := &expinfrav1.AWSFargateProfile{} if err := r.Get(ctx, req.NamespacedName, fargateProfile); err != nil { if apierrors.IsNotFound(err) { return ctrl.Result{}, nil @@ -94,7 +94,7 @@ func (r *AWSFargateProfileReconciler) Reconcile(ctx context.Context, req ctrl.Re Namespace: fargateProfile.Namespace, Name: cluster.Spec.ControlPlaneRef.Name, } - controlPlane := &controlplanev1.AWSManagedControlPlane{} + controlPlane := &ekscontrolplanev1.AWSManagedControlPlane{} if err := r.Client.Get(ctx, controlPlaneKey, controlPlane); err != nil { log.Info("Failed to retrieve ControlPlane from AWSFargateProfile") return reconcile.Result{}, nil @@ -115,8 +115,8 @@ func (r *AWSFargateProfileReconciler) Reconcile(ctx context.Context, req ctrl.Re defer func() { applicableConditions := []clusterv1.ConditionType{ - infrav1exp.IAMFargateRolesReadyCondition, - infrav1exp.EKSFargateProfileReadyCondition, + expinfrav1.IAMFargateRolesReadyCondition, + expinfrav1.EKSFargateProfileReadyCondition, } conditions.SetSummary(fargateProfileScope.FargateProfile, conditions.WithConditions(applicableConditions...), conditions.WithStepCounter()) @@ -128,7 +128,7 @@ func (r *AWSFargateProfileReconciler) Reconcile(ctx context.Context, req ctrl.Re if !controlPlane.Status.Ready { log.Info("Control plane is not ready yet") - conditions.MarkFalse(fargateProfile, clusterv1.ReadyCondition, infrav1exp.WaitingForEKSControlPlaneReason, clusterv1.ConditionSeverityInfo, "") + conditions.MarkFalse(fargateProfile, clusterv1.ReadyCondition, expinfrav1.WaitingForEKSControlPlaneReason, clusterv1.ConditionSeverityInfo, "") return ctrl.Result{}, nil } @@ -145,7 +145,7 @@ func (r *AWSFargateProfileReconciler) reconcileNormal( ) (ctrl.Result, error) { fargateProfileScope.Info("Reconciling AWSFargateProfile") - controllerutil.AddFinalizer(fargateProfileScope.FargateProfile, infrav1exp.FargateProfileFinalizer) + controllerutil.AddFinalizer(fargateProfileScope.FargateProfile, expinfrav1.FargateProfileFinalizer) if err := fargateProfileScope.PatchObject(); err != nil { return ctrl.Result{}, err } @@ -174,7 +174,7 @@ func (r *AWSFargateProfileReconciler) reconcileDelete( } if res.IsZero() { - controllerutil.RemoveFinalizer(fargateProfileScope.FargateProfile, infrav1exp.FargateProfileFinalizer) + controllerutil.RemoveFinalizer(fargateProfileScope.FargateProfile, expinfrav1.FargateProfileFinalizer) } return res, nil @@ -184,7 +184,7 @@ func managedControlPlaneToFargateProfileMapFunc(c client.Client, log logr.Logger return func(o client.Object) []ctrl.Request { ctx := context.Background() - awsControlPlane, ok := o.(*controlplanev1.AWSManagedControlPlane) + awsControlPlane, ok := o.(*ekscontrolplanev1.AWSManagedControlPlane) if !ok { panic(fmt.Sprintf("Expected a AWSManagedControlPlane but got a %T", o)) } @@ -202,7 +202,7 @@ func managedControlPlaneToFargateProfileMapFunc(c client.Client, log logr.Logger return nil } - fargateProfileForClusterList := infrav1exp.AWSFargateProfileList{} + fargateProfileForClusterList := expinfrav1.AWSFargateProfileList{} if err := c.List( ctx, &fargateProfileForClusterList, client.InNamespace(clusterKey.Namespace), client.MatchingLabels{clusterv1.ClusterLabelName: clusterKey.Name}, ); err != nil { diff --git a/exp/controllers/awsmachinepool_controller.go b/exp/controllers/awsmachinepool_controller.go index b659a5829c..5f1ee9de24 100644 --- a/exp/controllers/awsmachinepool_controller.go +++ b/exp/controllers/awsmachinepool_controller.go @@ -28,23 +28,24 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/tools/record" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/controllers" - ekscontrolplane "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services" asg "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/autoscaling" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/userdata" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - capiv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/predicates" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/reconcile" @@ -87,7 +88,7 @@ func (r *AWSMachinePoolReconciler) Reconcile(ctx context.Context, req ctrl.Reque log := ctrl.LoggerFrom(ctx) // Fetch the AWSMachinePool . - awsMachinePool := &infrav1exp.AWSMachinePool{} + awsMachinePool := &expinfrav1.AWSMachinePool{} err := r.Get(ctx, req.NamespacedName, awsMachinePool) if err != nil { if apierrors.IsNotFound(err) { @@ -143,12 +144,12 @@ func (r *AWSMachinePoolReconciler) Reconcile(ctx context.Context, req ctrl.Reque // set Ready condition before AWSMachinePool is patched conditions.SetSummary(machinePoolScope.AWSMachinePool, conditions.WithConditions( - infrav1exp.ASGReadyCondition, - infrav1exp.LaunchTemplateReadyCondition, + expinfrav1.ASGReadyCondition, + expinfrav1.LaunchTemplateReadyCondition, ), conditions.WithStepCounterIfOnly( - infrav1exp.ASGReadyCondition, - infrav1exp.LaunchTemplateReadyCondition, + expinfrav1.ASGReadyCondition, + expinfrav1.LaunchTemplateReadyCondition, ), ) @@ -175,12 +176,13 @@ func (r *AWSMachinePoolReconciler) Reconcile(ctx context.Context, req ctrl.Reque } } -func (r *AWSMachinePoolReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error { +func (r *AWSMachinePoolReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error { return ctrl.NewControllerManagedBy(mgr). - For(&infrav1exp.AWSMachinePool{}). + WithOptions(options). + For(&expinfrav1.AWSMachinePool{}). Watches( - &source.Kind{Type: &capiv1exp.MachinePool{}}, - handler.EnqueueRequestsFromMapFunc(machinePoolToInfrastructureMapFunc(infrav1exp.GroupVersion.WithKind("AWSMachinePool"))), + &source.Kind{Type: &expclusterv1.MachinePool{}}, + handler.EnqueueRequestsFromMapFunc(machinePoolToInfrastructureMapFunc(expinfrav1.GroupVersion.WithKind("AWSMachinePool"))), ). WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)). Complete(r) @@ -199,7 +201,7 @@ func (r *AWSMachinePoolReconciler) reconcileNormal(ctx context.Context, machineP } // If the AWSMachinepool doesn't have our finalizer, add it - controllerutil.AddFinalizer(machinePoolScope.AWSMachinePool, infrav1exp.MachinePoolFinalizer) + controllerutil.AddFinalizer(machinePoolScope.AWSMachinePool, expinfrav1.MachinePoolFinalizer) // Register finalizer immediately to avoid orphaning AWS resources if err := machinePoolScope.PatchObject(); err != nil { @@ -208,14 +210,14 @@ func (r *AWSMachinePoolReconciler) reconcileNormal(ctx context.Context, machineP if !machinePoolScope.Cluster.Status.InfrastructureReady { machinePoolScope.Info("Cluster infrastructure is not ready yet") - conditions.MarkFalse(machinePoolScope.AWSMachinePool, infrav1exp.ASGReadyCondition, infrav1.WaitingForClusterInfrastructureReason, clusterv1.ConditionSeverityInfo, "") + conditions.MarkFalse(machinePoolScope.AWSMachinePool, expinfrav1.ASGReadyCondition, infrav1.WaitingForClusterInfrastructureReason, clusterv1.ConditionSeverityInfo, "") return ctrl.Result{}, nil } // Make sure bootstrap data is available and populated if machinePoolScope.MachinePool.Spec.Template.Spec.Bootstrap.DataSecretName == nil { machinePoolScope.Info("Bootstrap data secret reference is not yet available") - conditions.MarkFalse(machinePoolScope.AWSMachinePool, infrav1exp.ASGReadyCondition, infrav1.WaitingForBootstrapDataReason, clusterv1.ConditionSeverityInfo, "") + conditions.MarkFalse(machinePoolScope.AWSMachinePool, expinfrav1.ASGReadyCondition, infrav1.WaitingForBootstrapDataReason, clusterv1.ConditionSeverityInfo, "") return ctrl.Result{}, nil } @@ -226,7 +228,7 @@ func (r *AWSMachinePoolReconciler) reconcileNormal(ctx context.Context, machineP } // set the LaunchTemplateReady condition - conditions.MarkTrue(machinePoolScope.AWSMachinePool, infrav1exp.LaunchTemplateReadyCondition) + conditions.MarkTrue(machinePoolScope.AWSMachinePool, expinfrav1.LaunchTemplateReadyCondition) // Initialize ASG client asgsvc := r.getASGService(clusterScope) @@ -234,14 +236,14 @@ func (r *AWSMachinePoolReconciler) reconcileNormal(ctx context.Context, machineP // Find existing ASG asg, err := r.findASG(machinePoolScope, asgsvc) if err != nil { - conditions.MarkUnknown(machinePoolScope.AWSMachinePool, infrav1exp.ASGReadyCondition, infrav1exp.ASGNotFoundReason, err.Error()) + conditions.MarkUnknown(machinePoolScope.AWSMachinePool, expinfrav1.ASGReadyCondition, expinfrav1.ASGNotFoundReason, err.Error()) return ctrl.Result{}, err } if asg == nil { // Create new ASG if _, err := r.createPool(machinePoolScope, clusterScope); err != nil { - conditions.MarkFalse(machinePoolScope.AWSMachinePool, infrav1exp.ASGReadyCondition, infrav1exp.ASGProvisionFailedReason, clusterv1.ConditionSeverityError, err.Error()) + conditions.MarkFalse(machinePoolScope.AWSMachinePool, expinfrav1.ASGReadyCondition, expinfrav1.ASGProvisionFailedReason, clusterv1.ConditionSeverityError, err.Error()) return ctrl.Result{}, err } return ctrl.Result{}, nil @@ -270,7 +272,7 @@ func (r *AWSMachinePoolReconciler) reconcileNormal(ctx context.Context, machineP machinePoolScope.AWSMachinePool.Spec.ProviderIDList = providerIDList machinePoolScope.AWSMachinePool.Status.Replicas = int32(len(providerIDList)) machinePoolScope.AWSMachinePool.Status.Ready = true - conditions.MarkTrue(machinePoolScope.AWSMachinePool, infrav1exp.ASGReadyCondition) + conditions.MarkTrue(machinePoolScope.AWSMachinePool, expinfrav1.ASGReadyCondition) err = machinePoolScope.UpdateInstanceStatuses(ctx, asg.Instances) if err != nil { @@ -297,10 +299,10 @@ func (r *AWSMachinePoolReconciler) reconcileDelete(machinePoolScope *scope.Machi } else { machinePoolScope.SetASGStatus(asg.Status) switch asg.Status { - case infrav1exp.ASGStatusDeleteInProgress: + case expinfrav1.ASGStatusDeleteInProgress: // ASG is already deleting machinePoolScope.SetNotReady() - conditions.MarkFalse(machinePoolScope.AWSMachinePool, infrav1exp.ASGReadyCondition, infrav1exp.ASGDeletionInProgress, clusterv1.ConditionSeverityWarning, "") + conditions.MarkFalse(machinePoolScope.AWSMachinePool, expinfrav1.ASGReadyCondition, expinfrav1.ASGDeletionInProgress, clusterv1.ConditionSeverityWarning, "") r.Recorder.Eventf(machinePoolScope.AWSMachinePool, corev1.EventTypeWarning, "DeletionInProgress", "ASG deletion in progress: %q", asg.Name) machinePoolScope.Info("ASG is already deleting", "name", asg.Name) default: @@ -321,7 +323,7 @@ func (r *AWSMachinePoolReconciler) reconcileDelete(machinePoolScope *scope.Machi if launchTemplate == nil { machinePoolScope.V(2).Info("Unable to locate launch template") r.Recorder.Eventf(machinePoolScope.AWSMachinePool, corev1.EventTypeNormal, "NoASGFound", "Unable to find matching ASG") - controllerutil.RemoveFinalizer(machinePoolScope.AWSMachinePool, infrav1exp.MachinePoolFinalizer) + controllerutil.RemoveFinalizer(machinePoolScope.AWSMachinePool, expinfrav1.MachinePoolFinalizer) return ctrl.Result{}, nil } @@ -334,12 +336,12 @@ func (r *AWSMachinePoolReconciler) reconcileDelete(machinePoolScope *scope.Machi machinePoolScope.Info("successfully deleted AutoScalingGroup and Launch Template") // remove finalizer - controllerutil.RemoveFinalizer(machinePoolScope.AWSMachinePool, infrav1exp.MachinePoolFinalizer) + controllerutil.RemoveFinalizer(machinePoolScope.AWSMachinePool, expinfrav1.MachinePoolFinalizer) return ctrl.Result{}, nil } -func (r *AWSMachinePoolReconciler) updatePool(machinePoolScope *scope.MachinePoolScope, clusterScope cloud.ClusterScoper, existingASG *infrav1exp.AutoScalingGroup) error { +func (r *AWSMachinePoolReconciler) updatePool(machinePoolScope *scope.MachinePoolScope, clusterScope cloud.ClusterScoper, existingASG *expinfrav1.AutoScalingGroup) error { if asgNeedsUpdates(machinePoolScope, existingASG) { machinePoolScope.Info("updating AutoScalingGroup") asgSvc := r.getASGService(clusterScope) @@ -353,7 +355,7 @@ func (r *AWSMachinePoolReconciler) updatePool(machinePoolScope *scope.MachinePoo return nil } -func (r *AWSMachinePoolReconciler) createPool(machinePoolScope *scope.MachinePoolScope, clusterScope cloud.ClusterScoper) (*infrav1exp.AutoScalingGroup, error) { +func (r *AWSMachinePoolReconciler) createPool(machinePoolScope *scope.MachinePoolScope, clusterScope cloud.ClusterScoper) (*expinfrav1.AutoScalingGroup, error) { clusterScope.Info("Initializing ASG client") asgsvc := r.getASGService(clusterScope) @@ -367,7 +369,7 @@ func (r *AWSMachinePoolReconciler) createPool(machinePoolScope *scope.MachinePoo return asg, nil } -func (r *AWSMachinePoolReconciler) findASG(machinePoolScope *scope.MachinePoolScope, asgsvc services.ASGInterface) (*infrav1exp.AutoScalingGroup, error) { +func (r *AWSMachinePoolReconciler) findASG(machinePoolScope *scope.MachinePoolScope, asgsvc services.ASGInterface) (*expinfrav1.AutoScalingGroup, error) { // Query the instance using tags. asg, err := asgsvc.GetASGByName(machinePoolScope) if err != nil { @@ -389,13 +391,13 @@ func (r *AWSMachinePoolReconciler) reconcileLaunchTemplate(machinePoolScope *sco machinePoolScope.Info("checking for existing launch template") launchTemplate, launchTemplateUserDataHash, err := ec2svc.GetLaunchTemplate(machinePoolScope.Name()) if err != nil { - conditions.MarkUnknown(machinePoolScope.AWSMachinePool, infrav1exp.LaunchTemplateReadyCondition, infrav1exp.LaunchTemplateNotFoundReason, err.Error()) + conditions.MarkUnknown(machinePoolScope.AWSMachinePool, expinfrav1.LaunchTemplateReadyCondition, expinfrav1.LaunchTemplateNotFoundReason, err.Error()) return err } imageID, err := ec2svc.DiscoverLaunchTemplateAMI(machinePoolScope) if err != nil { - conditions.MarkFalse(machinePoolScope.AWSMachinePool, infrav1exp.LaunchTemplateReadyCondition, infrav1exp.LaunchTemplateCreateFailedReason, clusterv1.ConditionSeverityError, err.Error()) + conditions.MarkFalse(machinePoolScope.AWSMachinePool, expinfrav1.LaunchTemplateReadyCondition, expinfrav1.LaunchTemplateCreateFailedReason, clusterv1.ConditionSeverityError, err.Error()) return err } @@ -403,7 +405,7 @@ func (r *AWSMachinePoolReconciler) reconcileLaunchTemplate(machinePoolScope *sco machinePoolScope.Info("no existing launch template found, creating") launchTemplateID, err := ec2svc.CreateLaunchTemplate(machinePoolScope, imageID, bootstrapData) if err != nil { - conditions.MarkFalse(machinePoolScope.AWSMachinePool, infrav1exp.LaunchTemplateReadyCondition, infrav1exp.LaunchTemplateCreateFailedReason, clusterv1.ConditionSeverityError, err.Error()) + conditions.MarkFalse(machinePoolScope.AWSMachinePool, expinfrav1.LaunchTemplateReadyCondition, expinfrav1.LaunchTemplateCreateFailedReason, clusterv1.ConditionSeverityError, err.Error()) return err } @@ -416,7 +418,7 @@ func (r *AWSMachinePoolReconciler) reconcileLaunchTemplate(machinePoolScope *sco if machinePoolScope.AWSMachinePool.Status.LaunchTemplateID == "" { launchTemplateID, err := ec2svc.GetLaunchTemplateID(machinePoolScope.Name()) if err != nil { - conditions.MarkUnknown(machinePoolScope.AWSMachinePool, infrav1exp.LaunchTemplateReadyCondition, infrav1exp.LaunchTemplateNotFoundReason, err.Error()) + conditions.MarkUnknown(machinePoolScope.AWSMachinePool, expinfrav1.LaunchTemplateReadyCondition, expinfrav1.LaunchTemplateNotFoundReason, err.Error()) return err } machinePoolScope.SetLaunchTemplateIDStatus(launchTemplateID) @@ -446,7 +448,7 @@ func (r *AWSMachinePoolReconciler) reconcileLaunchTemplate(machinePoolScope *sco return err } if !canStart { - conditions.MarkFalse(machinePoolScope.AWSMachinePool, infrav1exp.InstanceRefreshStartedCondition, infrav1exp.InstanceRefreshNotReadyReason, clusterv1.ConditionSeverityWarning, "") + conditions.MarkFalse(machinePoolScope.AWSMachinePool, expinfrav1.InstanceRefreshStartedCondition, expinfrav1.InstanceRefreshNotReadyReason, clusterv1.ConditionSeverityWarning, "") return errors.New("Cannot start a new instance refresh. Unfinished instance refresh exist") } } @@ -478,10 +480,10 @@ func (r *AWSMachinePoolReconciler) reconcileLaunchTemplate(machinePoolScope *sco machinePoolScope.Info("starting instance refresh", "number of instances", machinePoolScope.MachinePool.Spec.Replicas) asgSvc := r.getASGService(ec2Scope) if err := asgSvc.StartASGInstanceRefresh(machinePoolScope); err != nil { - conditions.MarkFalse(machinePoolScope.AWSMachinePool, infrav1exp.InstanceRefreshStartedCondition, infrav1exp.InstanceRefreshFailedReason, clusterv1.ConditionSeverityError, err.Error()) + conditions.MarkFalse(machinePoolScope.AWSMachinePool, expinfrav1.InstanceRefreshStartedCondition, expinfrav1.InstanceRefreshFailedReason, clusterv1.ConditionSeverityError, err.Error()) return err } - conditions.MarkTrue(machinePoolScope.AWSMachinePool, infrav1exp.InstanceRefreshStartedCondition) + conditions.MarkTrue(machinePoolScope.AWSMachinePool, expinfrav1.InstanceRefreshStartedCondition) } return nil @@ -506,7 +508,7 @@ func (r *AWSMachinePoolReconciler) reconcileTags(machinePoolScope *scope.Machine } // asgNeedsUpdates compares incoming AWSMachinePool and compares against existing ASG. -func asgNeedsUpdates(machinePoolScope *scope.MachinePoolScope, existingASG *infrav1exp.AutoScalingGroup) bool { +func asgNeedsUpdates(machinePoolScope *scope.MachinePoolScope, existingASG *expinfrav1.AutoScalingGroup) bool { if machinePoolScope.MachinePool.Spec.Replicas != nil && machinePoolScope.MachinePool.Spec.Replicas != existingASG.DesiredCapacity { return true } @@ -534,7 +536,7 @@ func asgNeedsUpdates(machinePoolScope *scope.MachinePoolScope, existingASG *infr } // getOwnerMachinePool returns the MachinePool object owning the current resource. -func getOwnerMachinePool(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*capiv1exp.MachinePool, error) { +func getOwnerMachinePool(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*expclusterv1.MachinePool, error) { for _, ref := range obj.OwnerReferences { if ref.Kind != "MachinePool" { continue @@ -543,7 +545,7 @@ func getOwnerMachinePool(ctx context.Context, c client.Client, obj metav1.Object if err != nil { return nil, errors.WithStack(err) } - if gv.Group == capiv1exp.GroupVersion.Group { + if gv.Group == expclusterv1.GroupVersion.Group { return getMachinePoolByName(ctx, c, obj.Namespace, ref.Name) } } @@ -551,8 +553,8 @@ func getOwnerMachinePool(ctx context.Context, c client.Client, obj metav1.Object } // getMachinePoolByName finds and return a Machine object using the specified params. -func getMachinePoolByName(ctx context.Context, c client.Client, namespace, name string) (*capiv1exp.MachinePool, error) { - m := &capiv1exp.MachinePool{} +func getMachinePoolByName(ctx context.Context, c client.Client, namespace, name string) (*expclusterv1.MachinePool, error) { + m := &expclusterv1.MachinePool{} key := client.ObjectKey{Name: name, Namespace: namespace} if err := c.Get(ctx, key, m); err != nil { return nil, err @@ -562,7 +564,7 @@ func getMachinePoolByName(ctx context.Context, c client.Client, namespace, name func machinePoolToInfrastructureMapFunc(gvk schema.GroupVersionKind) handler.MapFunc { return func(o client.Object) []reconcile.Request { - m, ok := o.(*capiv1exp.MachinePool) + m, ok := o.(*expclusterv1.MachinePool) if !ok { panic(fmt.Sprintf("Expected a MachinePool but got a %T", o)) } @@ -585,13 +587,13 @@ func machinePoolToInfrastructureMapFunc(gvk schema.GroupVersionKind) handler.Map } } -func (r *AWSMachinePoolReconciler) getInfraCluster(ctx context.Context, log logr.Logger, cluster *clusterv1.Cluster, awsMachinePool *infrav1exp.AWSMachinePool) (scope.EC2Scope, error) { +func (r *AWSMachinePoolReconciler) getInfraCluster(ctx context.Context, log logr.Logger, cluster *clusterv1.Cluster, awsMachinePool *expinfrav1.AWSMachinePool) (scope.EC2Scope, error) { var clusterScope *scope.ClusterScope var managedControlPlaneScope *scope.ManagedControlPlaneScope var err error if cluster.Spec.ControlPlaneRef != nil && cluster.Spec.ControlPlaneRef.Kind == controllers.AWSManagedControlPlaneRefKind { - controlPlane := &ekscontrolplane.AWSManagedControlPlane{} + controlPlane := &ekscontrolplanev1.AWSManagedControlPlane{} controlPlaneName := client.ObjectKey{ Namespace: awsMachinePool.Namespace, Name: cluster.Spec.ControlPlaneRef.Name, diff --git a/exp/controllers/awsmachinepool_controller_test.go b/exp/controllers/awsmachinepool_controller_test.go index bc53da7739..8f0ca1d474 100644 --- a/exp/controllers/awsmachinepool_controller_test.go +++ b/exp/controllers/awsmachinepool_controller_test.go @@ -33,19 +33,19 @@ import ( "k8s.io/client-go/tools/record" "k8s.io/klog/v2" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/mock_services" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/noderefutil" "sigs.k8s.io/controller-runtime/pkg/client/fake" // "sigs.k8s.io/cluster-api/controllers/noderefutil" //nolint:godot. capierrors "sigs.k8s.io/cluster-api/errors" - expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" ) diff --git a/exp/controllers/awsmachinepool_tags.go b/exp/controllers/awsmachinepool_tags.go index 2232d8e734..5ffa6d7c89 100644 --- a/exp/controllers/awsmachinepool_tags.go +++ b/exp/controllers/awsmachinepool_tags.go @@ -19,7 +19,7 @@ package controllers import ( "encoding/json" - expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services" ) diff --git a/exp/controllers/awsmanagedmachinepool_controller.go b/exp/controllers/awsmanagedmachinepool_controller.go index 76061efd56..05ead83989 100644 --- a/exp/controllers/awsmanagedmachinepool_controller.go +++ b/exp/controllers/awsmanagedmachinepool_controller.go @@ -26,12 +26,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/tools/record" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/eks" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - capiv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/predicates" @@ -59,21 +59,21 @@ type AWSManagedMachinePoolReconciler struct { func (r *AWSManagedMachinePoolReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error { log := ctrl.LoggerFrom(ctx) - gvk, err := apiutil.GVKForObject(new(infrav1exp.AWSManagedMachinePool), mgr.GetScheme()) + gvk, err := apiutil.GVKForObject(new(expinfrav1.AWSManagedMachinePool), mgr.GetScheme()) if err != nil { return errors.Wrapf(err, "failed to find GVK for AWSManagedMachinePool") } managedControlPlaneToManagedMachinePoolMap := managedControlPlaneToManagedMachinePoolMapFunc(r.Client, gvk, log) return ctrl.NewControllerManagedBy(mgr). - For(&infrav1exp.AWSManagedMachinePool{}). + For(&expinfrav1.AWSManagedMachinePool{}). WithOptions(options). WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(log, r.WatchFilterValue)). Watches( - &source.Kind{Type: &capiv1exp.MachinePool{}}, + &source.Kind{Type: &expclusterv1.MachinePool{}}, handler.EnqueueRequestsFromMapFunc(machinePoolToInfrastructureMapFunc(gvk)), ). Watches( - &source.Kind{Type: &controlplanev1.AWSManagedControlPlane{}}, + &source.Kind{Type: &ekscontrolplanev1.AWSManagedControlPlane{}}, handler.EnqueueRequestsFromMapFunc(managedControlPlaneToManagedMachinePoolMap), ). Complete(r) @@ -89,7 +89,7 @@ func (r *AWSManagedMachinePoolReconciler) SetupWithManager(ctx context.Context, func (r *AWSManagedMachinePoolReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error) { log := ctrl.LoggerFrom(ctx) - awsPool := &infrav1exp.AWSManagedMachinePool{} + awsPool := &expinfrav1.AWSManagedMachinePool{} if err := r.Get(ctx, req.NamespacedName, awsPool); err != nil { if apierrors.IsNotFound(err) { return ctrl.Result{}, nil @@ -121,7 +121,7 @@ func (r *AWSManagedMachinePoolReconciler) Reconcile(ctx context.Context, req ctr Namespace: awsPool.Namespace, Name: cluster.Spec.ControlPlaneRef.Name, } - controlPlane := &controlplanev1.AWSManagedControlPlane{} + controlPlane := &ekscontrolplanev1.AWSManagedControlPlane{} if err := r.Client.Get(ctx, controlPlaneKey, controlPlane); err != nil { log.Info("Failed to retrieve ControlPlane from MachinePool") return reconcile.Result{}, nil @@ -129,7 +129,7 @@ func (r *AWSManagedMachinePoolReconciler) Reconcile(ctx context.Context, req ctr if !controlPlane.Status.Ready { log.Info("Control plane is not ready yet") - conditions.MarkFalse(awsPool, infrav1exp.EKSNodegroupReadyCondition, infrav1exp.WaitingForEKSControlPlaneReason, clusterv1.ConditionSeverityInfo, "") + conditions.MarkFalse(awsPool, expinfrav1.EKSNodegroupReadyCondition, expinfrav1.WaitingForEKSControlPlaneReason, clusterv1.ConditionSeverityInfo, "") return ctrl.Result{}, nil } @@ -150,8 +150,8 @@ func (r *AWSManagedMachinePoolReconciler) Reconcile(ctx context.Context, req ctr defer func() { applicableConditions := []clusterv1.ConditionType{ - infrav1exp.EKSNodegroupReadyCondition, - infrav1exp.IAMNodegroupRolesReadyCondition, + expinfrav1.EKSNodegroupReadyCondition, + expinfrav1.IAMNodegroupRolesReadyCondition, } conditions.SetSummary(machinePoolScope.ManagedMachinePool, conditions.WithConditions(applicableConditions...), conditions.WithStepCounter()) @@ -174,7 +174,7 @@ func (r *AWSManagedMachinePoolReconciler) reconcileNormal( ) (ctrl.Result, error) { machinePoolScope.Info("Reconciling AWSManagedMachinePool") - controllerutil.AddFinalizer(machinePoolScope.ManagedMachinePool, infrav1exp.ManagedMachinePoolFinalizer) + controllerutil.AddFinalizer(machinePoolScope.ManagedMachinePool, expinfrav1.ManagedMachinePoolFinalizer) if err := machinePoolScope.PatchObject(); err != nil { return ctrl.Result{}, err } @@ -200,7 +200,7 @@ func (r *AWSManagedMachinePoolReconciler) reconcileDelete( return reconcile.Result{}, errors.Wrapf(err, "failed to reconcile machine pool deletion for AWSManagedMachinePool %s/%s", machinePoolScope.ManagedMachinePool.Namespace, machinePoolScope.ManagedMachinePool.Name) } - controllerutil.RemoveFinalizer(machinePoolScope.ManagedMachinePool, infrav1exp.ManagedMachinePoolFinalizer) + controllerutil.RemoveFinalizer(machinePoolScope.ManagedMachinePool, expinfrav1.ManagedMachinePoolFinalizer) return reconcile.Result{}, nil } @@ -228,7 +228,7 @@ func GetOwnerClusterKey(obj metav1.ObjectMeta) (*client.ObjectKey, error) { func managedControlPlaneToManagedMachinePoolMapFunc(c client.Client, gvk schema.GroupVersionKind, log logr.Logger) handler.MapFunc { return func(o client.Object) []reconcile.Request { ctx := context.Background() - awsControlPlane, ok := o.(*controlplanev1.AWSManagedControlPlane) + awsControlPlane, ok := o.(*ekscontrolplanev1.AWSManagedControlPlane) if !ok { panic(fmt.Sprintf("Expected a AWSManagedControlPlane but got a %T", o)) } @@ -246,7 +246,7 @@ func managedControlPlaneToManagedMachinePoolMapFunc(c client.Client, gvk schema. return nil } - managedPoolForClusterList := capiv1exp.MachinePoolList{} + managedPoolForClusterList := expclusterv1.MachinePoolList{} if err := c.List( ctx, &managedPoolForClusterList, client.InNamespace(clusterKey.Namespace), client.MatchingLabels{clusterv1.ClusterLabelName: clusterKey.Name}, ); err != nil { diff --git a/exp/controllers/suite_test.go b/exp/controllers/suite_test.go index 85dc3b57e5..b1cf18c3ab 100644 --- a/exp/controllers/suite_test.go +++ b/exp/controllers/suite_test.go @@ -24,11 +24,11 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/test/helpers" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" // +kubebuilder:scaffold:imports ) @@ -52,8 +52,8 @@ func TestMain(m *testing.M) { func setup() { utilruntime.Must(infrav1.AddToScheme(scheme.Scheme)) utilruntime.Must(clusterv1.AddToScheme(scheme.Scheme)) - utilruntime.Must(infrav1exp.AddToScheme(scheme.Scheme)) - utilruntime.Must(clusterv1exp.AddToScheme(scheme.Scheme)) + utilruntime.Must(expinfrav1.AddToScheme(scheme.Scheme)) + utilruntime.Must(expclusterv1.AddToScheme(scheme.Scheme)) testEnvConfig := helpers.NewTestEnvironmentConfiguration([]string{ path.Join("config", "crd", "bases"), }, @@ -75,10 +75,10 @@ func setup() { if err := (&infrav1.AWSMachineList{}).SetupWebhookWithManager(testEnv); err != nil { panic(fmt.Sprintf("Unable to setup AWSMachineList webhook: %v", err)) } - if err := (&infrav1exp.AWSMachinePool{}).SetupWebhookWithManager(testEnv); err != nil { + if err := (&expinfrav1.AWSMachinePool{}).SetupWebhookWithManager(testEnv); err != nil { panic(fmt.Sprintf("Unable to setup AWSMachinePool webhook: %v", err)) } - if err := (&infrav1exp.AWSManagedMachinePool{}).SetupWebhookWithManager(testEnv); err != nil { + if err := (&expinfrav1.AWSManagedMachinePool{}).SetupWebhookWithManager(testEnv); err != nil { panic(fmt.Sprintf("Unable to setup AWSManagedMachinePool webhook: %v", err)) } go func() { diff --git a/exp/instancestate/awsinstancestate_controller.go b/exp/instancestate/awsinstancestate_controller.go index ffd6e67bba..09cb603506 100644 --- a/exp/instancestate/awsinstancestate_controller.go +++ b/exp/instancestate/awsinstancestate_controller.go @@ -27,7 +27,7 @@ import ( "github.com/aws/aws-sdk-go/service/sqs/sqsiface" "github.com/go-logr/logr" apierrors "k8s.io/apimachinery/pkg/api/errors" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/controllers" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/instancestate" diff --git a/exp/instancestate/awsinstancestate_controller_test.go b/exp/instancestate/awsinstancestate_controller_test.go index 664f990ceb..79c4b234d5 100644 --- a/exp/instancestate/awsinstancestate_controller_test.go +++ b/exp/instancestate/awsinstancestate_controller_test.go @@ -31,7 +31,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/controllers" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/instancestate/mock_sqsiface" ctrl "sigs.k8s.io/controller-runtime" diff --git a/exp/instancestate/helpers_test.go b/exp/instancestate/helpers_test.go index a6f7425460..fb1e2b7435 100644 --- a/exp/instancestate/helpers_test.go +++ b/exp/instancestate/helpers_test.go @@ -28,7 +28,7 @@ import ( "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ) func createAWSCluster(name string) *infrav1.AWSCluster { diff --git a/exp/instancestate/suite_test.go b/exp/instancestate/suite_test.go index b5a57381c9..8e8e9090d5 100644 --- a/exp/instancestate/suite_test.go +++ b/exp/instancestate/suite_test.go @@ -25,12 +25,12 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/instancestate/mock_sqsiface" "sigs.k8s.io/cluster-api-provider-aws/test/helpers" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -57,8 +57,8 @@ func TestMain(m *testing.M) { func setup() { utilruntime.Must(infrav1.AddToScheme(scheme.Scheme)) utilruntime.Must(clusterv1.AddToScheme(scheme.Scheme)) - utilruntime.Must(infrav1exp.AddToScheme(scheme.Scheme)) - utilruntime.Must(clusterv1exp.AddToScheme(scheme.Scheme)) + utilruntime.Must(expinfrav1.AddToScheme(scheme.Scheme)) + utilruntime.Must(expclusterv1.AddToScheme(scheme.Scheme)) testEnvConfig := helpers.NewTestEnvironmentConfiguration([]string{ path.Join("config", "crd", "bases"), }, @@ -80,10 +80,10 @@ func setup() { if err := (&infrav1.AWSMachineList{}).SetupWebhookWithManager(testEnv); err != nil { panic(fmt.Sprintf("Unable to setup AWSMachineList webhook: %v", err)) } - if err := (&infrav1exp.AWSMachinePool{}).SetupWebhookWithManager(testEnv); err != nil { + if err := (&expinfrav1.AWSMachinePool{}).SetupWebhookWithManager(testEnv); err != nil { panic(fmt.Sprintf("Unable to setup AWSMachinePool webhook: %v", err)) } - if err := (&infrav1exp.AWSManagedMachinePool{}).SetupWebhookWithManager(testEnv); err != nil { + if err := (&expinfrav1.AWSManagedMachinePool{}).SetupWebhookWithManager(testEnv); err != nil { panic(fmt.Sprintf("Unable to setup AWSManagedMachinePool webhook: %v", err)) } } diff --git a/go.mod b/go.mod index e9981c19ff..a5c6368e81 100644 --- a/go.mod +++ b/go.mod @@ -2,42 +2,75 @@ module sigs.k8s.io/cluster-api-provider-aws go 1.16 -replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v0.4.1 +replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.0.0-rc.0.0.20211006034833-18ecf48ff1ca +// Versions to be held for v1beta1 +// sigs.k8s.io/controller-runtime on v0.10.x +// k8s.io/* on v0.22.x +// github.com/go-logr/logr on v0.4.x +// k8s.io/klog/v2 on v2.10.x require ( + github.com/BurntSushi/toml v0.4.1 // indirect github.com/apparentlymart/go-cidr v1.1.0 github.com/aws/amazon-vpc-cni-k8s v1.9.1 github.com/aws/aws-lambda-go v1.27.0 - github.com/aws/aws-sdk-go v1.40.33 + github.com/aws/aws-sdk-go v1.40.56 github.com/awslabs/goformation/v4 v4.19.5 github.com/blang/semver v3.5.1+incompatible + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/containerd/containerd v1.5.7 // indirect + github.com/coredns/caddy v1.1.1 // indirect + github.com/coredns/corefile-migration v1.0.13 // indirect + github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect + github.com/docker/docker v20.10.9+incompatible // indirect + github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46 // indirect + github.com/evanphx/json-patch/v5 v5.5.0 // indirect + github.com/fatih/color v1.13.0 // indirect github.com/go-logr/logr v0.4.0 github.com/gofrs/flock v0.8.1 github.com/golang/mock v1.6.0 + github.com/google/go-querystring v1.1.0 // indirect github.com/google/goexpect v0.0.0-20210430020637-ab937bf7fd6f github.com/google/gofuzz v1.2.0 github.com/google/goterm v0.0.0-20200907032337-555d40f16ae2 // indirect + github.com/google/uuid v1.3.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/mattn/go-colorable v0.1.11 // indirect + github.com/mitchellh/go-wordwrap v1.0.1 // indirect + github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect github.com/onsi/ginkgo v1.16.4 - github.com/onsi/gomega v1.15.0 + github.com/onsi/gomega v1.16.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.11.0 + github.com/prometheus/common v0.31.1 // indirect + github.com/prometheus/procfs v0.7.3 // indirect + github.com/russross/blackfriday v1.6.0 // indirect github.com/sergi/go-diff v1.2.0 github.com/spf13/cobra v1.2.1 github.com/spf13/pflag v1.0.5 - golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e - golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d + github.com/spf13/viper v1.9.0 // indirect + golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 + golang.org/x/net v0.0.0-20211005215030-d2e5035098b3 + golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef // indirect + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/genproto v0.0.0-20211005153810-c76a74d43a8e // indirect + google.golang.org/grpc v1.41.0 // indirect gopkg.in/yaml.v2 v2.4.0 k8s.io/api v0.22.2 k8s.io/apiextensions-apiserver v0.22.2 k8s.io/apimachinery v0.22.2 k8s.io/cli-runtime v0.22.2 k8s.io/client-go v0.22.2 + k8s.io/cluster-bootstrap v0.22.2 // indirect k8s.io/component-base v0.22.2 k8s.io/klog/v2 v2.10.0 - k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a + k8s.io/kube-openapi v0.0.0-20210929172449-94abcedd1aa4 // indirect + k8s.io/kubectl v0.22.2 // indirect + k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b sigs.k8s.io/aws-iam-authenticator v0.5.3 - sigs.k8s.io/cluster-api v0.4.2 - sigs.k8s.io/cluster-api/test v0.4.2 - sigs.k8s.io/controller-runtime v0.10.1 - sigs.k8s.io/yaml v1.2.0 + sigs.k8s.io/cluster-api v1.0.0-rc.0.0.20211006034833-18ecf48ff1ca + sigs.k8s.io/cluster-api/test v1.0.0-rc.0.0.20211006034833-18ecf48ff1ca + sigs.k8s.io/controller-runtime v0.10.2 + sigs.k8s.io/yaml v1.3.0 ) diff --git a/go.sum b/go.sum index eab01fb2cc..e0fbdc372a 100644 --- a/go.sum +++ b/go.sum @@ -19,6 +19,11 @@ cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmW cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -28,6 +33,7 @@ cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM7 cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/firestore v1.6.0/go.mod h1:afJwI0vaXwAG54kI7A//lP/lSPDkQORQuMkv56TxEPU= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= @@ -64,8 +70,9 @@ github.com/Azure/go-autorest/logger v0.2.0/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZ github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw= +github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= @@ -87,6 +94,7 @@ github.com/Microsoft/hcsshim v0.8.9/go.mod h1:5692vkUqntj1idxauYlpoINNKeqCiG6Sg3 github.com/Microsoft/hcsshim v0.8.14/go.mod h1:NtVKoYxQuTLx6gEq0L96c9Ju4JbRJ4nY2ow3VK6a9Lg= github.com/Microsoft/hcsshim v0.8.15/go.mod h1:x38A4YbHbdxJtc0sF6oIz+RG0npwSCAvn69iY6URG00= github.com/Microsoft/hcsshim v0.8.16/go.mod h1:o5/SZqmR7x9JNKsW3pu+nqHm0MF8vbA+VxGOoXdC600= +github.com/Microsoft/hcsshim v0.8.21/go.mod h1:+w2gRZ5ReXQhFOrvSQeNfhrYB/dg3oDwTOcER2fw4I4= github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= github.com/Microsoft/hcsshim/test v0.0.0-20210227013316-43a75bb4edd3/go.mod h1:mw7qgWloBUl75W/gVH3cQszUg1+gUITj7D6NY7ywVnY= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= @@ -115,6 +123,7 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/amazon-vpc-cni-k8s v1.9.1 h1:nUvjYFCQCoNu/qP0equnyrtdb34mIQ8KPJm2jk9XY9s= @@ -124,8 +133,8 @@ github.com/aws/aws-lambda-go v1.27.0/go.mod h1:jJmlefzPfGnckuHdXX7/80O3BvUUi12XO github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= github.com/aws/aws-sdk-go v1.37.1/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go v1.40.6/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= -github.com/aws/aws-sdk-go v1.40.33 h1:I9CCcb+jCC73//P+5mqeHzIMwTzJ6MDEZm8b/XoSg/w= -github.com/aws/aws-sdk-go v1.40.33/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= +github.com/aws/aws-sdk-go v1.40.56 h1:FM2yjR0UUYFzDTMx+mH9Vyw1k1EUUxsAFzk+BjkzANA= +github.com/aws/aws-sdk-go v1.40.56/go.mod h1:585smgzpB/KqRA+K3y/NL/oYRqQvpNJYvLm+LY1U59Q= github.com/awslabs/goformation/v4 v4.19.5 h1:Y+Tzh01tWg8gf//AgGKUamaja7Wx9NPiJf1FpZu4/iU= github.com/awslabs/goformation/v4 v4.19.5/go.mod h1:JoNpnVCBOUtEz9bFxc9sjy8uBUCLF5c4D1L7RhRTVM8= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= @@ -137,6 +146,7 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= +github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= @@ -154,10 +164,12 @@ github.com/certifi/gocertifi v0.0.0-20191021191039-0944d244cd40/go.mod h1:sGbDF6 github.com/certifi/gocertifi v0.0.0-20200922220541-2c3bb06c6054/go.mod h1:sGbDF6GwGcLpkNXPUTkMRoywsNa/ol15pxFe6ERfguA= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= +github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -165,11 +177,13 @@ github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmE github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= +github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h6jFvWxBdQXxjopDMZyH2UVceIRfR84bdzbkoKrsWNo= github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA= @@ -205,8 +219,10 @@ github.com/containerd/containerd v1.5.0-beta.1/go.mod h1:5HfvG1V2FsKesEGQ17k5/T7 github.com/containerd/containerd v1.5.0-beta.3/go.mod h1:/wr9AVtEM7x9c+n0+stptlo/uBBoBORwEx6ardVcmKU= github.com/containerd/containerd v1.5.0-beta.4/go.mod h1:GmdgZd2zA2GYIBZ0w09ZvgqEq8EfBp/m3lcVZIvPHhI= github.com/containerd/containerd v1.5.0-rc.0/go.mod h1:V/IXoMqNGgBlabz3tHD2TWDoTJseu1FGOKuoA4nNb2s= -github.com/containerd/containerd v1.5.2 h1:MG/Bg1pbmMb61j3wHCFWPxESXHieiKr2xG64px/k8zQ= +github.com/containerd/containerd v1.5.1/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= github.com/containerd/containerd v1.5.2/go.mod h1:0DOxVqwDy2iZvrZp2JUx/E+hS0UNTVn7dJnIOwtYR4g= +github.com/containerd/containerd v1.5.7 h1:rQyoYtj4KddB3bxG6SAqd4+08gePNyJjRqvOIfV3rkM= +github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0QMhscqVp1AR9c= github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= @@ -257,10 +273,12 @@ github.com/containernetworking/plugins v0.9.1/go.mod h1:xP/idU2ldlzN6m4p5LmGiwRD github.com/containers/ocicrypt v1.0.1/go.mod h1:MeJDzk1RJHv89LjsH0Sp5KTY3ZYkjXO/C+bKAeWFIrc= github.com/containers/ocicrypt v1.1.0/go.mod h1:b8AOe0YR67uU8OqfVNcznfFpAzu3rdgUV4GP9qXPfu4= github.com/containers/ocicrypt v1.1.1/go.mod h1:Dm55fwWm1YZAjYRaJ94z2mfZikIyIN4B0oB3dj3jFxY= -github.com/coredns/caddy v1.1.0 h1:ezvsPrT/tA/7pYDBZxu0cT0VmWk75AfIaf6GSYCNMf0= github.com/coredns/caddy v1.1.0/go.mod h1:A6ntJQlAWuQfFlsd9hvigKbo2WS0VUs2l1e2F+BawD4= -github.com/coredns/corefile-migration v1.0.12 h1:TJGATo0YLQJVIKJZLajXE1IrhRFtYTR1cYsGIT1YNEk= +github.com/coredns/caddy v1.1.1 h1:2eYKZT7i6yxIfGP3qLJoJ7HAsDJqYB+X68g4NYjSrE0= +github.com/coredns/caddy v1.1.1/go.mod h1:A6ntJQlAWuQfFlsd9hvigKbo2WS0VUs2l1e2F+BawD4= github.com/coredns/corefile-migration v1.0.12/go.mod h1:NJOI8ceUF/NTgEwtjD+TUq3/BnH/GF7WAM3RzCa3hBo= +github.com/coredns/corefile-migration v1.0.13 h1:ld5RswmH1xjqBUEukw4QxC1PakLNNoVlsZEV8FGwoV8= +github.com/coredns/corefile-migration v1.0.13/go.mod h1:XnhgULOEouimnzgn0t4WPuFDN2/PJQcTxdWKC5eXNGE= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -282,8 +300,9 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= -github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/cpuguy83/go-md2man/v2 v2.0.1 h1:r/myEWzV9lfsM1tFLgDyu0atFtJ1fXn261LKYj/3DxU= +github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.11 h1:07n33Z8lZxZ2qwegKbObQohDhXDQxiMMz1NOUGYlesw= @@ -308,8 +327,9 @@ github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.7+incompatible h1:Z6O9Nhsjv+ayUEeI1IojKbYcsGdgYSNqxe1s2MYzUhQ= github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.9+incompatible h1:JlsVnETOjM2RLQa0Cc1XCIspUdXW3Zenq9P54uXBm6k= +github.com/docker/docker v20.10.9+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-events v0.0.0-20170721190031-9461782956ad/go.mod h1:Uw6UezgYA44ePAFQYUehOuCzmy5zmg/+nl2ZfMWGkpA= @@ -322,8 +342,9 @@ github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD github.com/docker/libtrust v0.0.0-20150114040149-fa567046d9b1/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/drone/envsubst/v2 v2.0.0-20210615175204-7bf45dbf5372 h1:lMxlL2YBq247PkbbAhbcpEzDhqRp9IX6LSVy5WUz97s= github.com/drone/envsubst/v2 v2.0.0-20210615175204-7bf45dbf5372/go.mod h1:esf2rsHFNlZlxsqsZDojNBcnNs5REqIvRrWRHqX0vEU= +github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46 h1:7QPwrLT79GlD5sizHf27aoY2RTvw62mO6x7mxkScNk0= +github.com/drone/envsubst/v2 v2.0.0-20210730161058-179042472c46/go.mod h1:esf2rsHFNlZlxsqsZDojNBcnNs5REqIvRrWRHqX0vEU= github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= @@ -338,6 +359,7 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v0.5.2/go.mod h1:ZWS5hhDbVDyob71nXKNL0+PWn6ToqBHMikGIFbs31qQ= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= @@ -345,22 +367,25 @@ github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLi github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.11.0+incompatible h1:glyUF9yIYtMHzn8xaKw5rMhdWcwsYV8dZHIq5567/xs= github.com/evanphx/json-patch v4.11.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch/v5 v5.2.0 h1:8ozOH5xxoMYDt5/u+yMTsVXydVCbTORFnOOoq2lumco= github.com/evanphx/json-patch/v5 v5.2.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= +github.com/evanphx/json-patch/v5 v5.5.0 h1:bAmFiUJ+o0o2B4OiTFeE3MqCOtyo+jjPP9iZ0VRxYUc= +github.com/evanphx/json-patch/v5 v5.5.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4= github.com/exponent-io/jsonpath v0.0.0-20151013193312-d6023ce2651d/go.mod h1:ZZMPRZwes7CROmyNKgQzC3XPs6L/G2EJLHddWejkmf4= github.com/fatih/camelcase v1.0.0/go.mod h1:yN2Sb0lFhZJUdVvtELVWefmrXpuZESvPmqwoZc+/fpc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= -github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc= github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/form3tech-oss/jwt-go v3.2.3+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/fullsailor/pkcs7 v0.0.0-20190404230743-d7302db945fa/go.mod h1:KnogPXtdwXqoenmZCw6S+25EAm2MkxbG0deNDu4cbSA= github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= @@ -496,6 +521,7 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangplus/testing v0.0.0-20180327235837-af21d9c3145e/go.mod h1:0AA//k/eakGydO4jKRoRL2j92ZKSzTgj9tclaCrvXHk= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -516,8 +542,9 @@ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-github/v33 v33.0.0 h1:qAf9yP0qc54ufQxzwv+u9H0tiVOnPJxo0lI/JXqw3ZM= github.com/google/go-github/v33 v33.0.0/go.mod h1:GMdDnVZY/2TsWgp/lkYnpSAh6TrzhANBBwm6k6TTEXg= github.com/google/go-jsonnet v0.16.0/go.mod h1:sOcuej3UW1vpPTZOr8L7RQimqai1a57bt5j22LzGZCw= -github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= +github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/goexpect v0.0.0-20210430020637-ab937bf7fd6f h1:7MmqygqdeJtziBUpm4Z9ThROFZUaVGaePMfcDnluf1E= github.com/google/goexpect v0.0.0-20210430020637-ab937bf7fd6f/go.mod h1:n1ej5+FqyEytMt/mugVDZLIiqTMO+vsrgY+kM6ohzN0= github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= @@ -531,6 +558,7 @@ github.com/google/goterm v0.0.0-20200907032337-555d40f16ae2/go.mod h1:nOFQdrUlIl github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= @@ -542,15 +570,20 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= @@ -559,7 +592,6 @@ github.com/googleapis/gnostic v0.5.1/go.mod h1:6U4PtQXGIEt/Z3h5MAT7FNofLnw9vXk2c github.com/googleapis/gnostic v0.5.5 h1:9fHAtK0uDfpveeqqo1hkEZJcFvYXAiCN3UutL8F9xHw= github.com/googleapis/gnostic v0.5.5/go.mod h1:7+EbHbldMins07ALC74bsA81Ovc97DwqyJO1AENw9kA= github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/handlers v0.0.0-20150720190736-60c7bfde3e33/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/mux v1.7.2 h1:zoNxOV7WjqXptQOVngLmcSQgXmgk4NMz1HibBchjl/I= @@ -578,15 +610,20 @@ github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -599,8 +636,11 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -630,11 +670,11 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= @@ -675,14 +715,19 @@ github.com/markbates/pkger v0.17.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQ github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.11 h1:nQ+aFkoE2TMGc0b68U2OKSexC+eq46+XwZzWXHRmPYs= +github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= @@ -692,20 +737,24 @@ github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5 github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo= +github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= github.com/moby/locker v1.0.1/go.mod h1:S7SDdo5zpBK84bzzVlKr2V0hz+7x9hWbYC/kq7oQppc= github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= @@ -715,15 +764,17 @@ github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2J github.com/moby/sys/symlink v0.1.0/go.mod h1:GGDODQmbFOjFsXvfLVn3+ZRxkch54RkSiGqsZeMYowQ= github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= github.com/moby/term v0.0.0-20201216013528-df9cb8a40635/go.mod h1:FBS0z0QWA44HXygs7VXDUOGoN/1TV3RuWkLO04am3wc= -github.com/moby/term v0.0.0-20210610120745-9d4ed1856297 h1:yH0SvLzcbZxcJXho2yh7CqdENGMQe73Cw3woZBpPli0= github.com/moby/term v0.0.0-20210610120745-9d4ed1856297/go.mod h1:vgPCkQMyxTZ7IDy8SXRufE172gr8+K/JE/7hHFxHW3A= +github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 h1:dcztxKSvZ4Id8iPpHERQBbIJfabdt4wUm5qy3wOL2Zc= +github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6/go.mod h1:E2VnQOmVuvZB6UYnnDB0qG5Nq/1tD9acaOpo6xmt0Kw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= @@ -762,9 +813,9 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.12.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= -github.com/onsi/gomega v1.15.0 h1:WjP/FQ/sk43MRmnEcT+MlDw2TFvkrXlprrPST/IudjU= github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= +github.com/onsi/gomega v1.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= +github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -779,21 +830,25 @@ github.com/opencontainers/runc v0.1.1/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59P github.com/opencontainers/runc v1.0.0-rc8.0.20190926000215-3e425f80a8c9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v1.0.0-rc9/go.mod h1:qT5XzbpPznkRYVz/mWwUaVBUv2rmF59PVA73FjuZG0U= github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84SM2ImC1fxBuqJ/H0= +github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runtime-spec v0.1.2-0.20190507144316-5b71a03e2700/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.2-0.20190207185410-29686dbc5559/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.3-0.20200929063507-e6143ca7d51d/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= +github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-tools v0.0.0-20181011054405-1d69bd0f9c39/go.mod h1:r3f7wjNzSs2extwzU3Y+6pKfobzPh+kKFJ3ofN+3nfs= github.com/opencontainers/selinux v1.6.0/go.mod h1:VVGKuOLlE7v4PJyT6h7mNWvq1rzqiriPsEqVhc+svHE= github.com/opencontainers/selinux v1.8.0/go.mod h1:RScLhm78qiWa2gbVCcGkC7tCGdgk3ogry1nUQF8Evvo= +github.com/opencontainers/selinux v1.8.2/go.mod h1:MUIHuUEvKB1wtJjQdOyYRgOnLD2xAPP8dBsCoU0KuF8= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.8.1/go.mod h1:T2/BmBdy8dvIRq1a/8aqjN41wvWlN4lrapLU/GW4pbc= -github.com/pelletier/go-toml v1.9.3 h1:zeC5b1GviRUyKYd6OJPvBU/mcVDVoL1OhT17FCt5dSQ= github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -805,6 +860,7 @@ github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -828,8 +884,9 @@ github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.6.0/go.mod h1:eBmuwkDJBwy6iBfxCBob6t6dR6ENT/y+J+Zk0j9GMYc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= -github.com/prometheus/common v0.26.0 h1:iMAkS2TDoNWnKM+Kopnx/8tnEStIfpYA0ur0xQzzhMQ= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.31.1 h1:d18hG4PkHnNAKNMOmFuXFaiY8Us0nird/2m60uS1AMs= +github.com/prometheus/common v0.31.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20180125133057-cb4147076ac7/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181204211112-1dc9a6cbc91a/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= @@ -842,8 +899,9 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.6.0 h1:mxy4L2jP6qMonqmq+aTtOx1ifVWUgG/TAmntgbh3xv4= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= @@ -851,12 +909,15 @@ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= +github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= +github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/safchain/ethtool v0.0.0-20190326074333-42ed695e3de8/go.mod h1:Z0q5wiBQGYcxhMZ6gUqHn6pYNLypFAvaL3UvgZLR0U4= +github.com/sagikazarmark/crypt v0.1.0/go.mod h1:B/mN0msZuINBtQ1zZLEQcegFJJf9vnYIR88KRMEuODE= github.com/sanathkr/go-yaml v0.0.0-20170819195128-ed9d249f429b h1:jUK33OXuZP/l6babJtnLo1qsGvq6G9so9KMflGAm4YA= github.com/sanathkr/go-yaml v0.0.0-20170819195128-ed9d249f429b/go.mod h1:8458kAagoME2+LN5//WxE71ysZ3B7r22fdgb7qVmXSY= github.com/sanathkr/yaml v0.0.0-20170819201035-0056894fa522 h1:fOCp11H0yuyAt2wqlbJtbyPzSgaxHTv8uN1pMpkG1t8= @@ -868,7 +929,6 @@ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAm github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= @@ -879,10 +939,8 @@ github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrf github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= github.com/soheilhy/cmux v0.1.5/go.mod h1:T7TcVDs9LWfQgPlPsdngu6I6QIoyIFZDDC6sNE1GqG0= @@ -892,8 +950,9 @@ github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTd github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= @@ -914,8 +973,9 @@ github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= -github.com/spf13/viper v1.8.1 h1:Kq1fyeebqsBfbjZj4EL7gj2IO0mMaiyjYUWcUsl2O44= github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +github.com/spf13/viper v1.9.0 h1:yR6EXjTp0y0cLN8OZg1CRZmOBdI88UcGkhgyJhu6nZk= +github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4= github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980/go.mod h1:AO3tvPzVZ/ayst6UlUKUv6rcPQInYe3IknH3jYhAKu8= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.0.0-20180129172003-8a3f7159479f/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -1027,7 +1087,6 @@ go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9E go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= -go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.19.0 h1:mZQZefskPPCMIBCSEH0v2/iUqqLrYtaeqwD6FUGUnFE= go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1044,6 +1103,7 @@ golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -1051,8 +1111,9 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= -golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e h1:VvfwVmMH40bpMeizC9/K7ipM5Qjucuu16RWfneFPyhQ= -golang.org/x/crypto v0.0.0-20210813211128-0a44fdfbc16e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1118,6 +1179,7 @@ golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -1147,10 +1209,12 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d h1:LO7XpTYMwTqxjLcGWPijK3vRXg1aWdlNOVOHRq45d7c= -golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211005215030-d2e5035098b3 h1:G64nFNerDErBd2KdvHvIn3Ee6ccUQBTfhDZEO0DccfU= +golang.org/x/net v0.0.0-20211005215030-d2e5035098b3/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1163,8 +1227,11 @@ golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914 h1:3B43BWw0xEBsLZ/NO1VALz6fppU3481pik+2Ksv45z8= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1209,9 +1276,12 @@ golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191002063906-3421d5a6bb1c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1269,16 +1339,23 @@ golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2 h1:c8PlLMqBbOHoqtjteWm5/kbe6rNY2pbRfbIMVnepueo= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef h1:fPxZ3Umkct3LZ8gK9nbk+DWDJ9fstZa2grBn+lWVKPs= +golang.org/x/sys v0.0.0-20211004093028-2c5d950f24ef/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1287,8 +1364,9 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1320,6 +1398,7 @@ golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgw golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190812233024-afc3694995b6/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20190920225731-5eefd052ad72/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -1364,6 +1443,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1400,6 +1481,12 @@ google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjR google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1454,8 +1541,20 @@ google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= -google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c h1:wtujag7C+4D6KMoulW9YauvK2lgdvCMS260jsqqBXr0= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20211005153810-c76a74d43a8e h1:Im71rbA1N3CbIag/PumYhQcNR8bLNmuOtRIyOnnLsT8= +google.golang.org/genproto v0.0.0-20211005153810-c76a74d43a8e/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1481,9 +1580,14 @@ google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAG google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= -google.golang.org/grpc v1.39.0 h1:Klz8I9kdtkIN6EpHHUOMLCYhTn/2WAe5a0s1hcBkdTI= google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E= +google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -1495,8 +1599,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1512,8 +1617,9 @@ gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKW gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.63.2 h1:tGK/CyBg7SMzb60vP1M03vNZ3VDu3wGQJwn7Sxi9r3c= +gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.2.2/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI= @@ -1553,12 +1659,10 @@ k8s.io/api v0.18.6/go.mod h1:eeyxr+cwCjMdLAmr2W3RyDI0VvTawSg/3RFFBEnmZGI= k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= -k8s.io/api v0.21.2/go.mod h1:Lv6UGJZ1rlMI1qusN8ruAp9PUBFyBwpEHAdG24vIsiU= -k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= +k8s.io/api v0.21.4/go.mod h1:fTVGP+M4D8+00FN2cMnJqk/eb/GH53bvmNs2SVTmpFk= k8s.io/api v0.22.2 h1:M8ZzAD0V6725Fjg53fKeTJxGsJvRbk4TEm/fexHMtfw= k8s.io/api v0.22.2/go.mod h1:y3ydYpLJAaDI+BbSe2xmGcqxiWHmWjkEeIbiwHvnPR8= k8s.io/apiextensions-apiserver v0.18.6/go.mod h1:lv89S7fUysXjLZO7ke783xOwVTm6lKizADfvUM/SS/M= -k8s.io/apiextensions-apiserver v0.21.3/go.mod h1:kl6dap3Gd45+21Jnh6utCx8Z2xxLm8LGDkprcd+KbsE= k8s.io/apiextensions-apiserver v0.22.2 h1:zK7qI8Ery7j2CaN23UCFaC1hj7dMiI87n01+nKuewd4= k8s.io/apiextensions-apiserver v0.22.2/go.mod h1:2E0Ve/isxNl7tWLSUDgi6+cmwHi5fQRdwGVCxbC+KFA= k8s.io/apimachinery v0.16.8/go.mod h1:Xk2vD2TRRpuWYLQNM6lT9R7DSFZUYG03SarNkbGrnKE= @@ -1567,18 +1671,16 @@ k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRp k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= -k8s.io/apimachinery v0.21.2/go.mod h1:CdTY8fU/BlvAbJ2z/8kBwimGki5Zp8/fbVuLY8gJumM= -k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= +k8s.io/apimachinery v0.21.4/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= k8s.io/apimachinery v0.22.2 h1:ejz6y/zNma8clPVfNDLnPbleBo6MpoFy/HBiBqCouVk= k8s.io/apimachinery v0.22.2/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= k8s.io/apiserver v0.18.6/go.mod h1:Zt2XvTHuaZjBz6EFYzpp+X4hTmgWGy8AthNVnTdm3Wg= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= -k8s.io/apiserver v0.21.3/go.mod h1:eDPWlZG6/cCCMj/JBcEpDoK+I+6i3r9GsChYBHSbAzU= k8s.io/apiserver v0.22.2 h1:TdIfZJc6YNhu2WxeAOWq1TvukHF0Sfx0+ln4XK9qnL4= k8s.io/apiserver v0.22.2/go.mod h1:vrpMmbyjWrgdyOvZTSpsusQq5iigKNWv9o9KlDAbBHI= -k8s.io/cli-runtime v0.21.2/go.mod h1:8u/jFcM0QpoI28f6sfrAAIslLCXUYKD5SsPPMWiHYrI= +k8s.io/cli-runtime v0.21.4/go.mod h1:eRbLHYkdVWzvG87yrkgGd8CqX6/+fAG9DTdAqTXmlRY= k8s.io/cli-runtime v0.22.2 h1:fsd9rFk9FSaVq4SUq1fM27c8CFGsYZUJ/3BkgmjYWuY= k8s.io/cli-runtime v0.22.2/go.mod h1:tkm2YeORFpbgQHEK/igqttvPTRIHFRz5kATlw53zlMI= k8s.io/client-go v0.16.8/go.mod h1:WmPuN0yJTKHXoklExKxzo3jSXmr3EnN+65uaTb5VuNs= @@ -1586,27 +1688,26 @@ k8s.io/client-go v0.18.6/go.mod h1:/fwtGLjYMS1MaM5oi+eXhKwG+1UHidUEXRh6cNsdO0Q= k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= -k8s.io/client-go v0.21.2/go.mod h1:HdJ9iknWpbl3vMGtib6T2PyI/VYxiZfq936WNVHBRrA= -k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= +k8s.io/client-go v0.21.4/go.mod h1:t0/eMKyUAq/DoQ7vW8NVVA00/nomlwC+eInsS8PxSew= k8s.io/client-go v0.22.2 h1:DaSQgs02aCC1QcwUdkKZWOeaVsQjYvWv8ZazcZ6JcHc= k8s.io/client-go v0.22.2/go.mod h1:sAlhrkVDf50ZHx6z4K0S40wISNTarf1r800F+RlCF6U= -k8s.io/cluster-bootstrap v0.21.2 h1:GXvCxl619A0edhAprX8U5gUZ5lQCUf7xhDa7SkXnlx0= -k8s.io/cluster-bootstrap v0.21.2/go.mod h1:OEm/gajtWz/ohbS4NGxkyTp/6f1fW3TBThgCQ1ljhHo= +k8s.io/cluster-bootstrap v0.21.4/go.mod h1:GtXGuiEtdV4XQJcscR6qQCm/vtQWkhUi3qnl9KL9jzw= +k8s.io/cluster-bootstrap v0.22.2 h1:jP6Nkp3CdSfr50cAn/7WGsNS52zrwMhvr0V+E3Vkh/w= +k8s.io/cluster-bootstrap v0.22.2/go.mod h1:ZkmQKprEqvrUccMnbRHISsMscA1dsQ8SffM9nHq6CgE= k8s.io/code-generator v0.16.8/go.mod h1:wFdrXdVi/UC+xIfLi+4l9elsTT/uEF61IfcN2wOLULQ= k8s.io/code-generator v0.18.6/go.mod h1:TgNEVx9hCyPGpdtCWA34olQYLkh3ok9ar7XfSsr8b6c= -k8s.io/code-generator v0.21.2/go.mod h1:8mXJDCB7HcRo1xiEQstcguZkbxZaqeUOrO9SsicWs3U= -k8s.io/code-generator v0.21.3/go.mod h1:K3y0Bv9Cz2cOW2vXUrNZlFbflhuPvuadW6JdnN6gGKo= +k8s.io/code-generator v0.21.4/go.mod h1:K3y0Bv9Cz2cOW2vXUrNZlFbflhuPvuadW6JdnN6gGKo= k8s.io/code-generator v0.22.2/go.mod h1:eV77Y09IopzeXOJzndrDyCI88UBok2h6WxAlBwpxa+o= k8s.io/component-base v0.16.8/go.mod h1:Q8UWOWShpP3MZZny4n/15gOncfaaVtc9SbCdkM5MhUE= k8s.io/component-base v0.18.6/go.mod h1:knSVsibPR5K6EW2XOjEHik6sdU5nCvKMrzMt2D4In14= k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= -k8s.io/component-base v0.21.2/go.mod h1:9lvmIThzdlrJj5Hp8Z/TOgIkdfsNARQ1pT+3PByuiuc= -k8s.io/component-base v0.21.3/go.mod h1:kkuhtfEHeZM6LkX0saqSK8PbdO7A0HigUngmhhrwfGQ= +k8s.io/component-base v0.21.4/go.mod h1:ZKG0eHVX+tUDcaoIGpU3Vtk4TIjMddN9uhEWDmW6Nyg= k8s.io/component-base v0.22.2 h1:vNIvE0AIrLhjX8drH0BgCNJcR4QZxMXcJzBsDplDx9M= k8s.io/component-base v0.22.2/go.mod h1:5Br2QhI9OTe79p+TzPe9JKNQYvEKbq9rTJDWllunGug= -k8s.io/component-helpers v0.21.2/go.mod h1:DbyFt/A0p6Cv+R5+QOGSJ5f5t4xDfI8Yb89a57DgJlQ= +k8s.io/component-helpers v0.21.4/go.mod h1:/5TBNWmxaAymZweO1JWv3Pt5rcYJV1LbWWY0x1rDdVU= +k8s.io/component-helpers v0.22.2/go.mod h1:+N61JAR9aKYSWbnLA88YcFr9K/6ISYvRNybX7QW7Rs8= k8s.io/cri-api v0.0.0-20191107035106-03d130a7dc28/go.mod h1:9a7E6pmKLfuq8ZL31k2PDpgvSdyZfUOH9czlEmpblFk= k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM= k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= @@ -1617,6 +1718,7 @@ k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8 k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= +k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= @@ -1632,20 +1734,24 @@ k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKf k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= -k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e h1:KLHHjkdQFomZy8+06csTWZ0m1343QqxZhR2LJ1OxCYM= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= -k8s.io/kubectl v0.21.2 h1:9XPCetvOMDqrIZZXb1Ei+g8t6KrIp9ENJaysQjUuLiE= -k8s.io/kubectl v0.21.2/go.mod h1:PgeUclpG8VVmmQIl8zpLar3IQEpFc9mrmvlwY3CK1xo= +k8s.io/kube-openapi v0.0.0-20210929172449-94abcedd1aa4 h1:9GQ7xPpVr9vdAKKCslflyylc7qGdtGtfOQu2r+W4fAk= +k8s.io/kube-openapi v0.0.0-20210929172449-94abcedd1aa4/go.mod h1:gULf0pSS32YtLlO7+li/EV8/0y5mG/sO32H4OUsHIQg= +k8s.io/kubectl v0.21.4/go.mod h1:rRYB5HeScoGQKxZDQmus17pTSVIuqfm0D31ApET/qSM= +k8s.io/kubectl v0.22.2 h1:KMyYNZoBshaL3XKx04X07DtpoD4vMrdkfiN/G2Qx/PU= +k8s.io/kubectl v0.22.2/go.mod h1:BApg2j0edxLArCOfO0ievI27EeTQqBDMNU9VQH734iQ= k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/metrics v0.21.2/go.mod h1:wzlOINZMCtWq8dR9gHlyaOemmYlOpAoldEIXE82gAhI= +k8s.io/metrics v0.21.4/go.mod h1:uhWoVuVumUMSeCa1B1p2tm4Y4XuZIg0n24QEtB54wuA= +k8s.io/metrics v0.22.2/go.mod h1:GUcsBtpsqQD1tKFS/2wCKu4ZBowwRncLOJH1rgWs3uw= k8s.io/sample-controller v0.16.8/go.mod h1:aXlORS1ekU77qhGybB5t3JORDurzDpWgvMYxmCsiuos= k8s.io/utils v0.0.0-20190801114015-581e00157fb1/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= k8s.io/utils v0.0.0-20200603063816-c1c6865ac451/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210722164352-7f3ee0f31471/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a h1:8dYfu/Fc9Gz2rNJKB9IQRGgQOh2clmRzNIPPY1xLY5g= +k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= k8s.io/utils v0.0.0-20210819203725-bdf08cb9a70a/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b h1:wxEMGetGMur3J1xuGLQY7GEQYg9bZxKn3tKo5k/eYcs= +k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= modernc.org/cc v1.0.0/go.mod h1:1Sk4//wdnYJiUIxnW8ddKpaOJCF37yAdqYnkxUpaYxw= modernc.org/golex v1.0.0/go.mod h1:b/QX9oBD/LhixY6NDh+IdGv17hgB+51fET1i2kPSmvk= modernc.org/mathutil v1.0.0/go.mod h1:wU0vUrJsVWBZ4P6e7xtFJEhFSNsfRLJ8H458uRjg03k= @@ -1657,24 +1763,24 @@ rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.7/go.mod h1:PHgbrJT7lCHcxMU+mDHEm+nx46H4zuuHZkDP6icnhu0= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/aws-iam-authenticator v0.5.3 h1:EyqQ/uxzbe2mDETZZmuMnv0xHITnyLhZfPlGb6Mma20= sigs.k8s.io/aws-iam-authenticator v0.5.3/go.mod h1:DIq7gy0lvnyaG88AgFyJzUVeix+ia5msHEp4RL0102I= -sigs.k8s.io/cluster-api v0.4.1 h1:U59FF58H2JuZEP1B1vFmUKo/zjm2jpGIIYRiYYyvX64= -sigs.k8s.io/cluster-api v0.4.1/go.mod h1:u67M5oUqQWNnZ/Ilkp4cts/w4Z/EaF4Z0ZuxpppvCo8= -sigs.k8s.io/cluster-api/test v0.4.2 h1:e1rohMoDi7UTheOn/rijXLWqdTV+nQIZweHHPiAIvpk= -sigs.k8s.io/cluster-api/test v0.4.2/go.mod h1:g8amTA9ZdBWcBAgeyJbQH9MB88T2bGBCu+JO3aISeQY= +sigs.k8s.io/cluster-api v1.0.0-rc.0.0.20211006034833-18ecf48ff1ca h1:jiPYB2XU7ZGV3rsxbpXRyR4NaHobB+KIZwkdBt5r+nk= +sigs.k8s.io/cluster-api v1.0.0-rc.0.0.20211006034833-18ecf48ff1ca/go.mod h1:bfX9bsz7d5+ZvFz5HtEQiUZszVNMfjbClzWWqRmoPOA= +sigs.k8s.io/cluster-api/test v1.0.0-rc.0.0.20211006034833-18ecf48ff1ca h1:fQzGRVEdbiIoPgj3Kw4XaycO0MLqjJJjRRXk77QxYTI= +sigs.k8s.io/cluster-api/test v1.0.0-rc.0.0.20211006034833-18ecf48ff1ca/go.mod h1:MsWYwlkr58jrFCHHfsqgeoVqMOfY47lfV8+BRuQNWss= sigs.k8s.io/controller-runtime v0.6.3/go.mod h1:WlZNXcM0++oyaQt4B7C2lEE5JYRs8vJUzRP4N4JpdAY= -sigs.k8s.io/controller-runtime v0.9.6/go.mod h1:q6PpkM5vqQubEKUKOM6qr06oXGzOBcCby1DA9FbyZeA= -sigs.k8s.io/controller-runtime v0.10.1 h1:+eLHgY/VrJWnfg6iXUqhCUqNXgPH1NZeP9drNAAgWlg= -sigs.k8s.io/controller-runtime v0.10.1/go.mod h1:CQp8eyUQZ/Q7PJvnIrB6/hgfTC1kBkGylwsLgOQi1WY= +sigs.k8s.io/controller-runtime v0.10.2 h1:jW8qiY+yMnnPx6O9hu63tgcwaKzd1yLYui+mpvClOOc= +sigs.k8s.io/controller-runtime v0.10.2/go.mod h1:CQp8eyUQZ/Q7PJvnIrB6/hgfTC1kBkGylwsLgOQi1WY= sigs.k8s.io/kind v0.11.1 h1:pVzOkhUwMBrCB0Q/WllQDO3v14Y+o2V0tFgjTqIUjwA= sigs.k8s.io/kind v0.11.1/go.mod h1:fRpgVhtqAWrtLB9ED7zQahUimpUXuG/iHT88xYqEGIA= sigs.k8s.io/kustomize/api v0.8.8/go.mod h1:He1zoK0nk43Pc6NlV085xDXDXTNprtcyKZVm3swsdNY= sigs.k8s.io/kustomize/api v0.8.11/go.mod h1:a77Ls36JdfCWojpUqR6m60pdGY1AYFix4AH83nJtY1g= sigs.k8s.io/kustomize/cmd/config v0.9.10/go.mod h1:Mrby0WnRH7hA6OwOYnYpfpiY0WJIMgYrEDfwOeFdMK0= +sigs.k8s.io/kustomize/cmd/config v0.9.13/go.mod h1:7547FLF8W/lTaDf0BDqFTbZxM9zqwEJqCKN9sSR0xSs= sigs.k8s.io/kustomize/kustomize/v4 v4.1.2/go.mod h1:PxBvo4WGYlCLeRPL+ziT64wBXqbgfcalOS/SXa/tcyo= +sigs.k8s.io/kustomize/kustomize/v4 v4.2.0/go.mod h1:MOkR6fmhwG7hEDRXBYELTi5GSFcLwfqwzTRHW3kv5go= sigs.k8s.io/kustomize/kyaml v0.10.17/go.mod h1:mlQFagmkm1P+W4lZJbJ/yaxMd8PqMRSC4cPcfUVt5Hg= sigs.k8s.io/kustomize/kyaml v0.11.0/go.mod h1:GNMwjim4Ypgp/MueD3zXHLRJEjz7RvtPae0AwlvEMFM= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= @@ -1683,9 +1789,9 @@ sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= -sigs.k8s.io/structured-merge-diff/v4 v4.1.0/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno= sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= -sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= +sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= diff --git a/hack/gen-test-flavors.sh b/hack/gen-test-flavors.sh index 76482eacc6..bc7e8e84e9 100755 --- a/hack/gen-test-flavors.sh +++ b/hack/gen-test-flavors.sh @@ -21,8 +21,17 @@ set -o pipefail root=$(dirname "${BASH_SOURCE[0]}")/.. kustomize="${root}/hack/tools/bin/kustomize" -test_dir="${root}/test/e2e/data/infrastructure-aws/" +test_dir_path="test/e2e/data/infrastructure-aws" +test_dir="${root}/${test_dir_path}/" +src_dir="${test_dir_path}/kustomize_sources/" +generated_dir="${test_dir}/generated" -find "${test_dir}"* -maxdepth 1 -type d -print0 | xargs -0 -I {} basename {} | grep -v patches | grep -v addons | grep -v cni | grep -v base | xargs -I {} sh -c "${kustomize} build --load-restrictor LoadRestrictionsNone --reorder none ${test_dir}{} > ${test_dir}cluster-template-{}.yaml" +echo Checking for template sources in "$test_dir" + +mkdir -p "${generated_dir}" + +# Ignore non kustomized +find "${src_dir}"* -maxdepth 1 -type d \ + -print0 | xargs -0 -I {} basename {} | grep -v patches | grep -v addons | grep -v cni | grep -v base | xargs -I {} sh -c "${kustomize} build --load-restrictor LoadRestrictionsNone --reorder none ${src_dir}{} > ${generated_dir}/cluster-template-{}.yaml" ## move the default template to the default file expected by clusterctl -mv "${test_dir}/cluster-template-default.yaml" "${test_dir}/cluster-template.yaml" +mv "${generated_dir}/cluster-template-default.yaml" "${generated_dir}/cluster-template.yaml" diff --git a/hack/tools/Makefile b/hack/tools/Makefile index 44787b4006..209a34d536 100644 --- a/hack/tools/Makefile +++ b/hack/tools/Makefile @@ -73,8 +73,8 @@ $(CONTROLLER_GEN): $(BIN_DIR) go.mod go.sum # Build controller-gen from tools fo go build -tags=tools -o $@ sigs.k8s.io/controller-tools/cmd/controller-gen CONVERSION_GEN := $(BIN_DIR)/conversion-gen -$(CONVERSION_GEN): $(BIN_DIR) go.mod go.sum - go build -tags=tools -o $@ k8s.io/code-generator/cmd/conversion-gen +$(CONVERSION_GEN): $(BIN_DIR) go.mod go.sum $(call rwildcard,.,third_party/conversion-gen/*.*) + go build -tags=tools -o $@ ./third_party/conversion-gen DEFAULTER_GEN := $(BIN_DIR)/defaulter-gen $(DEFAULTER_GEN): $(BIN_DIR) go.mod go.sum diff --git a/hack/tools/go.mod b/hack/tools/go.mod index f864675b76..397a510b7c 100644 --- a/hack/tools/go.mod +++ b/hack/tools/go.mod @@ -5,18 +5,21 @@ go 1.16 require ( github.com/a8m/envsubst v1.2.0 github.com/ahmetb/gen-crd-api-reference-docs v0.3.0 - github.com/docker/docker v20.10.8+incompatible // indirect + github.com/docker/docker v20.10.9+incompatible // indirect github.com/golang/mock v1.6.0 github.com/golangci/golangci-lint v1.42.1 github.com/itchyny/gojq v0.12.5 github.com/onsi/ginkgo v1.16.4 + github.com/spf13/pflag v1.0.5 k8s.io/apimachinery v0.22.2 k8s.io/code-generator v0.22.2 + k8s.io/gengo v0.0.0-20201214224949-b6c5ce23f027 k8s.io/klog v1.0.0 // indirect + k8s.io/klog/v2 v2.10.0 k8s.io/release v0.11.0 - sigs.k8s.io/cluster-api/hack/tools v0.0.0-20210812230458-f6fd5ed7dc0f + sigs.k8s.io/cluster-api/hack/tools v0.0.0-20211006034833-18ecf48ff1ca sigs.k8s.io/controller-tools v0.7.0 sigs.k8s.io/kind v0.11.1 - sigs.k8s.io/kustomize/kustomize/v4 v4.3.0 + sigs.k8s.io/kustomize/kustomize/v4 v4.4.0 sigs.k8s.io/testing_frameworks v0.1.2 ) diff --git a/hack/tools/go.sum b/hack/tools/go.sum index 4be5f753fc..650e901118 100644 --- a/hack/tools/go.sum +++ b/hack/tools/go.sum @@ -71,7 +71,6 @@ github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg6 github.com/Azure/go-autorest v10.8.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= -github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= github.com/Azure/go-autorest/autorest v0.11.18/go.mod h1:dSiJPy22c3u0OtOKDNttNgqpNFY/GeWa7GH/Pz56QRA= github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= @@ -183,6 +182,7 @@ github.com/aws/aws-sdk-go v1.36.30/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2z github.com/aws/aws-sdk-go v1.37.6/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20160804104726-4c0e84591b9a/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= @@ -376,8 +376,8 @@ github.com/docker/distribution v2.7.1-0.20190205005809-0d3efadf0154+incompatible github.com/docker/distribution v2.7.1+incompatible h1:a5mlkVzth6W5A4fOsS3D2EO5BUmsJpcB+cRlLU7cSug= github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v20.10.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/docker v20.10.8+incompatible h1:RVqD337BgQicVCzYrrlhLDWhq6OAD2PJDUg2LsEUvKM= -github.com/docker/docker v20.10.8+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/docker v20.10.9+incompatible h1:JlsVnETOjM2RLQa0Cc1XCIspUdXW3Zenq9P54uXBm6k= +github.com/docker/docker v20.10.9+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/docker-credential-helpers v0.6.3 h1:zI2p9+1NQYdnG6sMU26EX4aVGlqbInSQxQXLvzJ4RPQ= github.com/docker/docker-credential-helpers v0.6.3/go.mod h1:WRaJzqw3CTB9bk10avuGsjVBZsD05qeibJ1/TYlvc0Y= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= @@ -497,7 +497,6 @@ github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL9 github.com/go-openapi/jsonreference v0.19.5 h1:1WJP/wi4OjB4iV8KVbH73rQaoialJrqv8gitZLxGLtM= github.com/go-openapi/jsonreference v0.19.5/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= -github.com/go-openapi/spec v0.19.5/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14 h1:gm3vOOXfiuw5i9p5N9xJvfjvuofpyvLA9Wr6QfK5Fng= @@ -1051,7 +1050,6 @@ github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= -github.com/onsi/ginkgo v1.16.1/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= @@ -1067,8 +1065,9 @@ github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDs github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg= github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= -github.com/onsi/gomega v1.14.0 h1:ep6kpPVwmr/nTbklSx2nrLNSIO62DoYAhnPNIMhK8gI= github.com/onsi/gomega v1.14.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= +github.com/onsi/gomega v1.15.0 h1:WjP/FQ/sk43MRmnEcT+MlDw2TFvkrXlprrPST/IudjU= +github.com/onsi/gomega v1.15.0/go.mod h1:cIuvLEne0aoVhAgh/O6ac0Op8WWw9H6eYCriF+tEHG0= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -1467,6 +1466,7 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/zap v1.19.0/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= golang.org/dl v0.0.0-20190829154251-82a15e2f2ead/go.mod h1:IUMfjQLJQd4UTqG1Z90tenwKoCX93Gn3MAQJMOSBsDQ= golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180501155221-613d6eafa307/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1532,7 +1532,6 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191209134235-331c550502dd/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.1-0.20200828183125-ce943fd02449/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -1595,7 +1594,6 @@ golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= golang.org/x/net v0.0.0-20210326060303-6b1517762897/go.mod h1:uSPa2vr4CLtc/ILN5odXGNXS6mhrKVzTaCXzk9m6W3k= @@ -1735,7 +1733,6 @@ golang.org/x/sys v0.0.0-20210324051608-47abb6519492/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210503080704-8803ae5d1324/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2121,36 +2118,29 @@ honnef.co/go/tools v0.2.1/go.mod h1:lPVVZ2BS5TfnjLyizF7o7hv7j9/L+8cZY2hLyjP9cGY= k8s.io/api v0.20.1/go.mod h1:KqwcCVogGxQY3nBlRpwt+wpAMF/KjaCc7RpywacvqUo= k8s.io/api v0.20.4/go.mod h1:++lNL1AJMkDymriNniQsWRkMDzRaX2Y/POTUi8yvqYQ= k8s.io/api v0.20.6/go.mod h1:X9e8Qag6JV/bL5G6bU8sdVRltWKmdHsFUGS3eVndqE8= -k8s.io/api v0.21.3/go.mod h1:hUgeYHUbBp23Ue4qdX9tR8/ANi/g3ehylAqDn9NWVOg= k8s.io/api v0.22.2 h1:M8ZzAD0V6725Fjg53fKeTJxGsJvRbk4TEm/fexHMtfw= k8s.io/api v0.22.2/go.mod h1:y3ydYpLJAaDI+BbSe2xmGcqxiWHmWjkEeIbiwHvnPR8= -k8s.io/apiextensions-apiserver v0.21.3/go.mod h1:kl6dap3Gd45+21Jnh6utCx8Z2xxLm8LGDkprcd+KbsE= k8s.io/apiextensions-apiserver v0.22.2 h1:zK7qI8Ery7j2CaN23UCFaC1hj7dMiI87n01+nKuewd4= k8s.io/apiextensions-apiserver v0.22.2/go.mod h1:2E0Ve/isxNl7tWLSUDgi6+cmwHi5fQRdwGVCxbC+KFA= k8s.io/apimachinery v0.20.1/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.2/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.4/go.mod h1:WlLqWAHZGg07AeltaI0MV5uk1Omp8xaN0JGLY6gkRpU= k8s.io/apimachinery v0.20.6/go.mod h1:ejZXtW1Ra6V1O5H8xPBGz+T3+4gfkTCeExAHKU57MAc= -k8s.io/apimachinery v0.21.3/go.mod h1:H/IM+5vH9kZRNJ4l3x/fXP/5bOPJaVP/guptnZPeCFI= k8s.io/apimachinery v0.22.2 h1:ejz6y/zNma8clPVfNDLnPbleBo6MpoFy/HBiBqCouVk= k8s.io/apimachinery v0.22.2/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0= k8s.io/apiserver v0.20.1/go.mod h1:ro5QHeQkgMS7ZGpvf4tSMx6bBOgPfE+f52KwvXfScaU= k8s.io/apiserver v0.20.4/go.mod h1:Mc80thBKOyy7tbvFtB4kJv1kbdD0eIH8k8vianJcbFM= k8s.io/apiserver v0.20.6/go.mod h1:QIJXNt6i6JB+0YQRNcS0hdRHJlMhflFmsBDeSgT1r8Q= -k8s.io/apiserver v0.21.3/go.mod h1:eDPWlZG6/cCCMj/JBcEpDoK+I+6i3r9GsChYBHSbAzU= k8s.io/apiserver v0.22.2/go.mod h1:vrpMmbyjWrgdyOvZTSpsusQq5iigKNWv9o9KlDAbBHI= k8s.io/client-go v0.20.1/go.mod h1:/zcHdt1TeWSd5HoUe6elJmHSQ6uLLgp4bIJHVEuy+/Y= k8s.io/client-go v0.20.4/go.mod h1:LiMv25ND1gLUdBeYxBIwKpkSC5IsozMMmOOeSJboP+k= k8s.io/client-go v0.20.6/go.mod h1:nNQMnOvEUEsOzRRFIIkdmYOjAZrC8bgq0ExboWSU1I0= -k8s.io/client-go v0.21.3/go.mod h1:+VPhCgTsaFmGILxR/7E1N0S+ryO010QBeNCv5JwRGYU= k8s.io/client-go v0.22.2/go.mod h1:sAlhrkVDf50ZHx6z4K0S40wISNTarf1r800F+RlCF6U= -k8s.io/code-generator v0.21.3/go.mod h1:K3y0Bv9Cz2cOW2vXUrNZlFbflhuPvuadW6JdnN6gGKo= k8s.io/code-generator v0.22.2 h1:+bUv9lpTnAWABtPkvO4x0kfz7j/kDEchVt0P/wXU3jQ= k8s.io/code-generator v0.22.2/go.mod h1:eV77Y09IopzeXOJzndrDyCI88UBok2h6WxAlBwpxa+o= k8s.io/component-base v0.20.1/go.mod h1:guxkoJnNoh8LNrbtiQOlyp2Y2XFCZQmrcg2n/DeYNLk= k8s.io/component-base v0.20.4/go.mod h1:t4p9EdiagbVCJKrQ1RsA5/V4rFQNDfRlevJajlGwgjI= k8s.io/component-base v0.20.6/go.mod h1:6f1MPBAeI+mvuts3sIdtpjljHWBQ2cIy38oBIWMYnrM= -k8s.io/component-base v0.21.3/go.mod h1:kkuhtfEHeZM6LkX0saqSK8PbdO7A0HigUngmhhrwfGQ= k8s.io/component-base v0.22.2/go.mod h1:5Br2QhI9OTe79p+TzPe9JKNQYvEKbq9rTJDWllunGug= k8s.io/cri-api v0.17.3/go.mod h1:X1sbHmuXhwaHs9xxYffLqJogVsnI+f6cPRcgPel7ywM= k8s.io/cri-api v0.20.1/go.mod h1:2JRbKt+BFLTjtrILYVqQK5jqhI+XNdF6UiGMgczeBCI= @@ -2166,11 +2156,10 @@ k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= -k8s.io/klog/v2 v2.9.0 h1:D7HV+n1V57XeZ0m6tdRkfknthUaM06VFbWldOFh8kzM= k8s.io/klog/v2 v2.9.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/klog/v2 v2.10.0 h1:R2HDMDJsHVTHA2n4RjwbeYXdOcBymXdX/JRb1v0VGhE= +k8s.io/klog/v2 v2.10.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= -k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e h1:KLHHjkdQFomZy8+06csTWZ0m1343QqxZhR2LJ1OxCYM= k8s.io/kube-openapi v0.0.0-20210421082810-95288971da7e/go.mod h1:vHXdDvt9+2spS2Rx9ql3I8tycm3H9FDfdUoIuKCefvw= k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= @@ -2194,12 +2183,10 @@ rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.14/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.19/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.22/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= -sigs.k8s.io/cluster-api/hack/tools v0.0.0-20210812230458-f6fd5ed7dc0f h1:yk4ylUiJt9eoBkUrpfj3vdcFtnp3p2CYXPzNrdGwYxc= -sigs.k8s.io/cluster-api/hack/tools v0.0.0-20210812230458-f6fd5ed7dc0f/go.mod h1:T9x98UNESLWmDtB2/JKsc3f7Yksidrrh2g+nptWi8MM= -sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20210706144019-ef5c8a3ffd28/go.mod h1:jqzBWjsNdxfl/cDmihB034I5aCqlfw2p24HYs3Eo4K4= -sigs.k8s.io/controller-tools v0.6.2/go.mod h1:oaeGpjXn6+ZSEIQkUe/+3I40PNiDYp9aeawbt3xTgJ8= +sigs.k8s.io/cluster-api/hack/tools v0.0.0-20211006034833-18ecf48ff1ca h1:Hp2yob2/CDxkjm6KjPJkXNXa+Z5i3AUsQbPSa1lC7FA= +sigs.k8s.io/cluster-api/hack/tools v0.0.0-20211006034833-18ecf48ff1ca/go.mod h1:m4QpFepjhLGazCmHkqftCs+gdo2AQ6eV4+OE1eMRVao= +sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20210827150604-1730628f118b/go.mod h1:Fxb8+lsIhcPWKq89RReMSzjcv3COhP0D37vJplt4ABg= sigs.k8s.io/controller-tools v0.7.0 h1:iZIz1vEcavyEfxjcTLs1WH/MPf4vhPCtTKhoHqV8/G0= sigs.k8s.io/controller-tools v0.7.0/go.mod h1:bpBAo0VcSDDLuWt47evLhMLPxRPxMDInTEH/YbdeMK0= sigs.k8s.io/k8s-container-image-promoter v1.339.0/go.mod h1:xOKpNZcaBOs6mImuFMUN4L+12izUeqIdelvgHV2u1tM= @@ -2207,14 +2194,14 @@ sigs.k8s.io/kind v0.11.1 h1:pVzOkhUwMBrCB0Q/WllQDO3v14Y+o2V0tFgjTqIUjwA= sigs.k8s.io/kind v0.11.1/go.mod h1:fRpgVhtqAWrtLB9ED7zQahUimpUXuG/iHT88xYqEGIA= sigs.k8s.io/kubebuilder/docs/book/utils v0.0.0-20210702145813-742983631190 h1:y13LG4qWQA8VxwrrLWp458Gw8i9nfy1qImu8kW1jOkg= sigs.k8s.io/kubebuilder/docs/book/utils v0.0.0-20210702145813-742983631190/go.mod h1:NRdZafr4zSCseLQggdvIMXa7umxf+Q+PJzrj3wFwiGE= -sigs.k8s.io/kustomize/api v0.9.0 h1:yGQnm/2GBbHBLSVbM0CsqgPmqK/NSDbhSGbXuhuVN7s= -sigs.k8s.io/kustomize/api v0.9.0/go.mod h1:bOF7z4DcRIXcOCeSbVq5o9JhMRnNzWqrRSSBFtz05A4= -sigs.k8s.io/kustomize/cmd/config v0.10.0 h1:6XPkaOu9eFdvrcqHpfmYAKoBvE01JdvsTVvtDuAFM+8= -sigs.k8s.io/kustomize/cmd/config v0.10.0/go.mod h1:XS4NFKucjk0/+nPKJwSMoZYCjey2PB0ipNoZabXUFPU= -sigs.k8s.io/kustomize/kustomize/v4 v4.3.0 h1:a7CKjGA13Ww2YGvvR1IyepK4gwTkTJvQjEiPRt5NC6M= -sigs.k8s.io/kustomize/kustomize/v4 v4.3.0/go.mod h1:DIY5NOrlusDfJg5n/+BLJA1LSobTYYblY0dk+rAf8SA= -sigs.k8s.io/kustomize/kyaml v0.11.1 h1:MWihd9syKG7VQnAzr/OpKb94FvH+cw96nEV1u3it7pI= -sigs.k8s.io/kustomize/kyaml v0.11.1/go.mod h1:FTJxEZ86ScK184NpGSAQcfEqee0nul8oLCK30D47m4E= +sigs.k8s.io/kustomize/api v0.10.0 h1:HK5gVSlVV24AmZ2fTHUIchZ6osaYNegK1jAdx7lJ/mU= +sigs.k8s.io/kustomize/api v0.10.0/go.mod h1:syysqD8Oews9oghLfCitMCuCPxxu4MErSJ6uw8ge9jk= +sigs.k8s.io/kustomize/cmd/config v0.10.1 h1:eqpN9eUSn3XIfvPabit8lpIqUbWKS7f4lOB4D2cr5CQ= +sigs.k8s.io/kustomize/cmd/config v0.10.1/go.mod h1:9W5pDv3cgDfMjOXEga4yC9lUpkgAaecW+lZmHOMeX2I= +sigs.k8s.io/kustomize/kustomize/v4 v4.4.0 h1:9XRoalyIWESf0TzWORgiVTH9FpaTBCqsz9X19jeJjrw= +sigs.k8s.io/kustomize/kustomize/v4 v4.4.0/go.mod h1:HDKLDwopJznPOE5ejB9j/R09hg08kGbhLnD/6uIObgA= +sigs.k8s.io/kustomize/kyaml v0.12.0 h1:k08l8SLwnKa/eXXB5GW2/OnEc/4gJF90VDFebsOwqw4= +sigs.k8s.io/kustomize/kyaml v0.12.0/go.mod h1:FTJxEZ86ScK184NpGSAQcfEqee0nul8oLCK30D47m4E= sigs.k8s.io/mdtoc v1.0.1 h1:6ECKhQnbetwZBR6R2IeT2LH+1w+2Zsip0iXjikgaXIk= sigs.k8s.io/mdtoc v1.0.1/go.mod h1:COYBtOjsaCg7o7SC4eaLwEXPuVRSuiVuLLRrHd7kShw= sigs.k8s.io/release-sdk v0.1.0/go.mod h1:XhDgjf0bu2Vuyosp0Cc/mc3UUJiWS171S7WsNxA9iY0= diff --git a/hack/tools/third_party/conversion-gen/LICENSE b/hack/tools/third_party/conversion-gen/LICENSE new file mode 100644 index 0000000000..d645695673 --- /dev/null +++ b/hack/tools/third_party/conversion-gen/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/hack/tools/third_party/conversion-gen/README.md b/hack/tools/third_party/conversion-gen/README.md new file mode 100644 index 0000000000..e03c6bf55e --- /dev/null +++ b/hack/tools/third_party/conversion-gen/README.md @@ -0,0 +1,24 @@ +# code-generator + +Golang code-generators used to implement [Kubernetes-style API types](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md). + +## Purpose + +These code-generators can be used +- in the context of [CustomResourceDefinition](https://kubernetes.io/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/) to build native, versioned clients, + informers and other helpers +- in the context of [User-provider API Servers](https://github.com/kubernetes/apiserver) to build conversions between internal and versioned types, defaulters, protobuf codecs, + internal and versioned clients and informers. + +## Resources +- The example [sample controller](https://github.com/kubernetes/sample-controller) shows a code example of a controller that uses the clients, listers and informers generated by this library. +- The article [Kubernetes Deep Dive: Code Generation for CustomResources](https://blog.openshift.com/kubernetes-deep-dive-code-generation-customresources/) gives a step by step instruction on how to use this library. + +## Compatibility + +HEAD of this repo will match HEAD of k8s.io/apiserver, k8s.io/apimachinery, and k8s.io/client-go. + +## Where does it come from? + +`code-generator` is synced from https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/code-generator. +Code changes are made in that location, merged into `k8s.io/kubernetes` and later synced here. diff --git a/hack/tools/third_party/conversion-gen/generators/conversion.go b/hack/tools/third_party/conversion-gen/generators/conversion.go new file mode 100644 index 0000000000..a348d8de3a --- /dev/null +++ b/hack/tools/third_party/conversion-gen/generators/conversion.go @@ -0,0 +1,1222 @@ +/* +Copyright 2016 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 generators + +import ( + "bytes" + "fmt" + "io" + "path/filepath" + "reflect" + "sort" + "strings" + + "k8s.io/gengo/args" + "k8s.io/gengo/generator" + "k8s.io/gengo/namer" + "k8s.io/gengo/types" + + "k8s.io/klog/v2" + + conversionargs "k8s.io/code-generator/cmd/conversion-gen/args" + genutil "k8s.io/code-generator/pkg/util" +) + +// These are the comment tags that carry parameters for conversion generation. +const ( + // e.g., "+k8s:conversion-gen=" in doc.go, where is the + // import path of the package the peer types are defined in. + // e.g., "+k8s:conversion-gen=false" in a type's comment will let + // conversion-gen skip that type. + tagName = "k8s:conversion-gen" + // e.g. "+k8s:conversion-gen:explicit-from=net/url.Values" in the type comment + // will result in generating conversion from net/url.Values. + explicitFromTagName = "k8s:conversion-gen:explicit-from" + // e.g., "+k8s:conversion-gen-external-types=" in doc.go, where + // is the relative path to the package the types are defined in. + externalTypesTagName = "k8s:conversion-gen-external-types" +) + +func extractTag(comments []string) []string { + return types.ExtractCommentTags("+", comments)[tagName] +} + +func extractExplicitFromTag(comments []string) []string { + return types.ExtractCommentTags("+", comments)[explicitFromTagName] +} + +func extractExternalTypesTag(comments []string) []string { + return types.ExtractCommentTags("+", comments)[externalTypesTagName] +} + +func isCopyOnly(comments []string) bool { + values := types.ExtractCommentTags("+", comments)["k8s:conversion-fn"] + return len(values) == 1 && values[0] == "copy-only" +} + +func isDrop(comments []string) bool { + values := types.ExtractCommentTags("+", comments)["k8s:conversion-fn"] + return len(values) == 1 && values[0] == "drop" +} + +// TODO: This is created only to reduce number of changes in a single PR. +// Remove it and use PublicNamer instead. +func conversionNamer() *namer.NameStrategy { + return &namer.NameStrategy{ + Join: func(pre string, in []string, post string) string { + return strings.Join(in, "_") + }, + PrependPackageNames: 1, + } +} + +func defaultFnNamer() *namer.NameStrategy { + return &namer.NameStrategy{ + Prefix: "SetDefaults_", + Join: func(pre string, in []string, post string) string { + return pre + strings.Join(in, "_") + post + }, + } +} + +// NameSystems returns the name system used by the generators in this package. +func NameSystems() namer.NameSystems { + return namer.NameSystems{ + "public": conversionNamer(), + "raw": namer.NewRawNamer("", nil), + "defaultfn": defaultFnNamer(), + } +} + +// DefaultNameSystem returns the default name system for ordering the types to be +// processed by the generators in this package. +func DefaultNameSystem() string { + return "public" +} + +func getPeerTypeFor(context *generator.Context, t *types.Type, potenialPeerPkgs []string) *types.Type { + for _, ppp := range potenialPeerPkgs { + p := context.Universe.Package(ppp) + if p == nil { + continue + } + if p.Has(t.Name.Name) { + return p.Type(t.Name.Name) + } + } + return nil +} + +type conversionPair struct { + inType *types.Type + outType *types.Type +} + +// All of the types in conversions map are of type "DeclarationOf" with +// the underlying type being "Func". +type conversionFuncMap map[conversionPair]*types.Type + +// Returns all manually-defined conversion functions in the package. +func getManualConversionFunctions(context *generator.Context, pkg *types.Package, manualMap conversionFuncMap) { + if pkg == nil { + klog.Warning("Skipping nil package passed to getManualConversionFunctions") + return + } + klog.V(5).Infof("Scanning for conversion functions in %v", pkg.Name) + + scopeName := types.Ref(conversionPackagePath, "Scope").Name + errorName := types.Ref("", "error").Name + buffer := &bytes.Buffer{} + sw := generator.NewSnippetWriter(buffer, context, "$", "$") + + for _, f := range pkg.Functions { + if f.Underlying == nil || f.Underlying.Kind != types.Func { + klog.Errorf("Malformed function: %#v", f) + continue + } + if f.Underlying.Signature == nil { + klog.Errorf("Function without signature: %#v", f) + continue + } + klog.V(8).Infof("Considering function %s", f.Name) + signature := f.Underlying.Signature + // Check whether the function is conversion function. + // Note that all of them have signature: + // func Convert_inType_To_outType(inType, outType, conversion.Scope) error + if signature.Receiver != nil { + klog.V(8).Infof("%s has a receiver", f.Name) + continue + } + if len(signature.Parameters) != 3 || signature.Parameters[2].Name != scopeName { + klog.V(8).Infof("%s has wrong parameters", f.Name) + continue + } + if len(signature.Results) != 1 || signature.Results[0].Name != errorName { + klog.V(8).Infof("%s has wrong results", f.Name) + continue + } + inType := signature.Parameters[0] + outType := signature.Parameters[1] + if inType.Kind != types.Pointer || outType.Kind != types.Pointer { + klog.V(8).Infof("%s has wrong parameter types", f.Name) + continue + } + // Now check if the name satisfies the convention. + // TODO: This should call the Namer directly. + args := argsFromType(inType.Elem, outType.Elem) + sw.Do("Convert_$.inType|public$_To_$.outType|public$", args) + if f.Name.Name == buffer.String() { + klog.V(4).Infof("Found conversion function %s", f.Name) + key := conversionPair{inType.Elem, outType.Elem} + // We might scan the same package twice, and that's OK. + // @randomvariable: Temporarily disable duplicate static conversion detection + // if v, ok := manualMap[key]; ok && v != nil && v.Name.Package != pkg.Path { + // panic(fmt.Sprintf("duplicate static conversion defined: %s -> %s from:\n%s.%s\n%s.%s", key.inType, key.outType, v.Name.Package, v.Name.Name, f.Name.Package, f.Name.Name)) + // } + manualMap[key] = f + } else { + // prevent user error when they don't get the correct conversion signature + if strings.HasPrefix(f.Name.Name, "Convert_") { + klog.Errorf("Rename function %s %s -> %s to match expected conversion signature", f.Name.Package, f.Name.Name, buffer.String()) + } + klog.V(8).Infof("%s has wrong name", f.Name) + } + buffer.Reset() + } +} + +func Packages(context *generator.Context, arguments *args.GeneratorArgs) generator.Packages { + boilerplate, err := arguments.LoadGoBoilerplate() + if err != nil { + klog.Fatalf("Failed loading boilerplate: %v", err) + } + + packages := generator.Packages{} + header := append([]byte(fmt.Sprintf("// +build !%s\n\n", arguments.GeneratedBuildTag)), boilerplate...) + + // Accumulate pre-existing conversion functions. + // TODO: This is too ad-hoc. We need a better way. + manualConversions := conversionFuncMap{} + + // Record types that are memory equivalent. A type is memory equivalent + // if it has the same memory layout and no nested manual conversion is + // defined. + // TODO: in the future, relax the nested manual conversion requirement + // if we can show that a large enough types are memory identical but + // have non-trivial conversion + memoryEquivalentTypes := equalMemoryTypes{} + + // We are generating conversions only for packages that are explicitly + // passed as InputDir. + processed := map[string]bool{} + for _, i := range context.Inputs { + // skip duplicates + if processed[i] { + continue + } + processed[i] = true + + klog.V(5).Infof("considering pkg %q", i) + pkg := context.Universe[i] + // typesPkg is where the versioned types are defined. Sometimes it is + // different from pkg. For example, kubernetes core/v1 types are defined + // in vendor/k8s.io/api/core/v1, while pkg is at pkg/api/v1. + typesPkg := pkg + if pkg == nil { + // If the input had no Go files, for example. + continue + } + + // Add conversion and defaulting functions. + getManualConversionFunctions(context, pkg, manualConversions) + + // Only generate conversions for packages which explicitly request it + // by specifying one or more "+k8s:conversion-gen=" + // in their doc.go file. + peerPkgs := extractTag(pkg.Comments) + if peerPkgs != nil { + klog.V(5).Infof(" tags: %q", peerPkgs) + if len(peerPkgs) == 1 && peerPkgs[0] == "false" { + // If a single +k8s:conversion-gen=false tag is defined, we still want + // the generator to fire for this package for explicit conversions, but + // we are clearing the peerPkgs to not generate any standard conversions. + peerPkgs = nil + } + } else { + klog.V(5).Infof(" no tag") + continue + } + skipUnsafe := false + extraDirs := []string{} + if customArgs, ok := arguments.CustomArgs.(*conversionargs.CustomArgs); ok { + if len(peerPkgs) > 0 { + peerPkgs = append(peerPkgs, customArgs.BasePeerDirs...) + peerPkgs = append(peerPkgs, customArgs.ExtraPeerDirs...) + } + extraDirs = customArgs.ExtraDirs + skipUnsafe = customArgs.SkipUnsafe + } + + // if the external types are not in the same package where the conversion functions to be generated + externalTypesValues := extractExternalTypesTag(pkg.Comments) + if externalTypesValues != nil { + if len(externalTypesValues) != 1 { + klog.Fatalf(" expect only one value for %q tag, got: %q", externalTypesTagName, externalTypesValues) + } + externalTypes := externalTypesValues[0] + klog.V(5).Infof(" external types tags: %q", externalTypes) + var err error + typesPkg, err = context.AddDirectory(externalTypes) + if err != nil { + klog.Fatalf("cannot import package %s", externalTypes) + } + // update context.Order to the latest context.Universe + orderer := namer.Orderer{Namer: namer.NewPublicNamer(1)} + context.Order = orderer.OrderUniverse(context.Universe) + } + + // if the source path is within a /vendor/ directory (for example, + // k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1), allow + // generation to output to the proper relative path (under vendor). + // Otherwise, the generator will create the file in the wrong location + // in the output directory. + // TODO: build a more fundamental concept in gengo for dealing with modifications + // to vendored packages. + for i := range peerPkgs { + peerPkgs[i] = genutil.Vendorless(peerPkgs[i]) + } + for i := range extraDirs { + extraDirs[i] = genutil.Vendorless(extraDirs[i]) + } + + // Make sure our peer-packages are added and fully parsed. + for _, pp := range append(peerPkgs, extraDirs...) { + context.AddDir(pp) + p := context.Universe[pp] + if nil == p { + klog.Fatalf("failed to find pkg: %s", pp) + } + getManualConversionFunctions(context, p, manualConversions) + } + + unsafeEquality := TypesEqual(memoryEquivalentTypes) + if skipUnsafe { + unsafeEquality = noEquality{} + } + + path := pkg.Path + // if the source path is within a /vendor/ directory (for example, + // k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1), allow + // generation to output to the proper relative path (under vendor). + // Otherwise, the generator will create the file in the wrong location + // in the output directory. + // TODO: build a more fundamental concept in gengo for dealing with modifications + // to vendored packages. + if strings.HasPrefix(pkg.SourcePath, arguments.OutputBase) { + expandedPath := strings.TrimPrefix(pkg.SourcePath, arguments.OutputBase) + if strings.Contains(expandedPath, "/vendor/") { + path = expandedPath + } + } + packages = append(packages, + &generator.DefaultPackage{ + PackageName: filepath.Base(pkg.Path), + PackagePath: path, + HeaderText: header, + GeneratorFunc: func(c *generator.Context) (generators []generator.Generator) { + return []generator.Generator{ + NewGenConversion(arguments.OutputFileBaseName, typesPkg.Path, pkg.Path, manualConversions, peerPkgs, unsafeEquality), + } + }, + FilterFunc: func(c *generator.Context, t *types.Type) bool { + return t.Name.Package == typesPkg.Path + }, + }) + } + + // If there is a manual conversion defined between two types, exclude it + // from being a candidate for unsafe conversion + for k, v := range manualConversions { + if isCopyOnly(v.CommentLines) { + klog.V(5).Infof("Conversion function %s will not block memory copy because it is copy-only", v.Name) + continue + } + // this type should be excluded from all equivalence, because the converter must be called. + memoryEquivalentTypes.Skip(k.inType, k.outType) + } + + return packages +} + +type equalMemoryTypes map[conversionPair]bool + +func (e equalMemoryTypes) Skip(a, b *types.Type) { + e[conversionPair{a, b}] = false + e[conversionPair{b, a}] = false +} + +func (e equalMemoryTypes) Equal(a, b *types.Type) bool { + // alreadyVisitedTypes holds all the types that have already been checked in the structural type recursion. + alreadyVisitedTypes := make(map[*types.Type]bool) + return e.cachingEqual(a, b, alreadyVisitedTypes) +} + +func (e equalMemoryTypes) cachingEqual(a, b *types.Type, alreadyVisitedTypes map[*types.Type]bool) bool { + if a == b { + return true + } + if equal, ok := e[conversionPair{a, b}]; ok { + return equal + } + if equal, ok := e[conversionPair{b, a}]; ok { + return equal + } + result := e.equal(a, b, alreadyVisitedTypes) + e[conversionPair{a, b}] = result + e[conversionPair{b, a}] = result + return result +} + +func (e equalMemoryTypes) equal(a, b *types.Type, alreadyVisitedTypes map[*types.Type]bool) bool { + in, out := unwrapAlias(a), unwrapAlias(b) + switch { + case in == out: + return true + case in.Kind == out.Kind: + // if the type exists already, return early to avoid recursion + if alreadyVisitedTypes[in] { + return true + } + alreadyVisitedTypes[in] = true + + switch in.Kind { + case types.Struct: + if len(in.Members) != len(out.Members) { + return false + } + for i, inMember := range in.Members { + outMember := out.Members[i] + if !e.cachingEqual(inMember.Type, outMember.Type, alreadyVisitedTypes) { + return false + } + } + return true + case types.Pointer: + return e.cachingEqual(in.Elem, out.Elem, alreadyVisitedTypes) + case types.Map: + return e.cachingEqual(in.Key, out.Key, alreadyVisitedTypes) && e.cachingEqual(in.Elem, out.Elem, alreadyVisitedTypes) + case types.Slice: + return e.cachingEqual(in.Elem, out.Elem, alreadyVisitedTypes) + case types.Interface: + // TODO: determine whether the interfaces are actually equivalent - for now, they must have the + // same type. + return false + case types.Builtin: + return in.Name.Name == out.Name.Name + } + } + return false +} + +func findMember(t *types.Type, name string) (types.Member, bool) { + if t.Kind != types.Struct { + return types.Member{}, false + } + for _, member := range t.Members { + if member.Name == name { + return member, true + } + } + return types.Member{}, false +} + +// unwrapAlias recurses down aliased types to find the bedrock type. +func unwrapAlias(in *types.Type) *types.Type { + for in.Kind == types.Alias { + in = in.Underlying + } + return in +} + +const ( + runtimePackagePath = "k8s.io/apimachinery/pkg/runtime" + conversionPackagePath = "k8s.io/apimachinery/pkg/conversion" +) + +type noEquality struct{} + +func (noEquality) Equal(_, _ *types.Type) bool { return false } + +type TypesEqual interface { + Equal(a, b *types.Type) bool +} + +// genConversion produces a file with a autogenerated conversions. +type genConversion struct { + generator.DefaultGen + // the package that contains the types that conversion func are going to be + // generated for + typesPackage string + // the package that the conversion funcs are going to be output to + outputPackage string + // packages that contain the peer of types in typesPacakge + peerPackages []string + manualConversions conversionFuncMap + imports namer.ImportTracker + types []*types.Type + explicitConversions []conversionPair + skippedFields map[*types.Type][]string + useUnsafe TypesEqual +} + +func NewGenConversion(sanitizedName, typesPackage, outputPackage string, manualConversions conversionFuncMap, peerPkgs []string, useUnsafe TypesEqual) generator.Generator { + return &genConversion{ + DefaultGen: generator.DefaultGen{ + OptionalName: sanitizedName, + }, + typesPackage: typesPackage, + outputPackage: outputPackage, + peerPackages: peerPkgs, + manualConversions: manualConversions, + imports: generator.NewImportTracker(), + types: []*types.Type{}, + explicitConversions: []conversionPair{}, + skippedFields: map[*types.Type][]string{}, + useUnsafe: useUnsafe, + } +} + +func (g *genConversion) Namers(c *generator.Context) namer.NameSystems { + // Have the raw namer for this file track what it imports. + return namer.NameSystems{ + "raw": namer.NewRawNamer(g.outputPackage, g.imports), + "publicIT": &namerPlusImportTracking{ + delegate: conversionNamer(), + tracker: g.imports, + }, + } +} + +type namerPlusImportTracking struct { + delegate namer.Namer + tracker namer.ImportTracker +} + +func (n *namerPlusImportTracking) Name(t *types.Type) string { + n.tracker.AddType(t) + return n.delegate.Name(t) +} + +func (g *genConversion) convertibleOnlyWithinPackage(inType, outType *types.Type) bool { + var t *types.Type + var other *types.Type + if inType.Name.Package == g.typesPackage { + t, other = inType, outType + } else { + t, other = outType, inType + } + + if t.Name.Package != g.typesPackage { + return false + } + // If the type has opted out, skip it. + tagvals := extractTag(t.CommentLines) + if tagvals != nil { + if tagvals[0] != "false" { + klog.Fatalf("Type %v: unsupported %s value: %q", t, tagName, tagvals[0]) + } + klog.V(5).Infof("type %v requests no conversion generation, skipping", t) + return false + } + // TODO: Consider generating functions for other kinds too. + if t.Kind != types.Struct { + return false + } + // Also, filter out private types. + if namer.IsPrivateGoName(other.Name.Name) { + return false + } + return true +} + +func getExplicitFromTypes(t *types.Type) []types.Name { + comments := append(t.SecondClosestCommentLines, t.CommentLines...) + paths := extractExplicitFromTag(comments) + result := []types.Name{} + for _, path := range paths { + items := strings.Split(path, ".") + if len(items) != 2 { + klog.Errorf("Unexpected k8s:conversion-gen:explicit-from tag: %s", path) + continue + } + switch { + case items[0] == "net/url" && items[1] == "Values": + default: + klog.Fatalf("Not supported k8s:conversion-gen:explicit-from tag: %s", path) + } + result = append(result, types.Name{Package: items[0], Name: items[1]}) + } + return result +} + +func (g *genConversion) Filter(c *generator.Context, t *types.Type) bool { + convertibleWithPeer := func() bool { + peerType := getPeerTypeFor(c, t, g.peerPackages) + if peerType == nil { + return false + } + if !g.convertibleOnlyWithinPackage(t, peerType) { + return false + } + g.types = append(g.types, t) + return true + }() + + explicitlyConvertible := func() bool { + inTypes := getExplicitFromTypes(t) + if len(inTypes) == 0 { + return false + } + for i := range inTypes { + pair := conversionPair{ + inType: &types.Type{Name: inTypes[i]}, + outType: t, + } + g.explicitConversions = append(g.explicitConversions, pair) + } + return true + }() + + return convertibleWithPeer || explicitlyConvertible +} + +func (g *genConversion) isOtherPackage(pkg string) bool { + if pkg == g.outputPackage { + return false + } + if strings.HasSuffix(pkg, `"`+g.outputPackage+`"`) { + return false + } + return true +} + +func (g *genConversion) Imports(c *generator.Context) (imports []string) { + var importLines []string + for _, singleImport := range g.imports.ImportLines() { + if g.isOtherPackage(singleImport) { + importLines = append(importLines, singleImport) + } + } + return importLines +} + +func argsFromType(inType, outType *types.Type) generator.Args { + return generator.Args{ + "inType": inType, + "outType": outType, + } +} + +const nameTmpl = "Convert_$.inType|publicIT$_To_$.outType|publicIT$" + +func (g *genConversion) preexists(inType, outType *types.Type) (*types.Type, bool) { + function, ok := g.manualConversions[conversionPair{inType, outType}] + return function, ok +} + +func (g *genConversion) Init(c *generator.Context, w io.Writer) error { + if klog.V(5).Enabled() { + if m, ok := g.useUnsafe.(equalMemoryTypes); ok { + var result []string + klog.Info("All objects without identical memory layout:") + for k, v := range m { + if v { + continue + } + result = append(result, fmt.Sprintf(" %s -> %s = %t", k.inType, k.outType, v)) + } + sort.Strings(result) + for _, s := range result { + klog.Infof(s) + } + } + } + sw := generator.NewSnippetWriter(w, c, "$", "$") + sw.Do("func init() {\n", nil) + sw.Do("localSchemeBuilder.Register(RegisterConversions)\n", nil) + sw.Do("}\n", nil) + + scheme := c.Universe.Type(types.Name{Package: runtimePackagePath, Name: "Scheme"}) + schemePtr := &types.Type{ + Kind: types.Pointer, + Elem: scheme, + } + sw.Do("// RegisterConversions adds conversion functions to the given scheme.\n", nil) + sw.Do("// Public to allow building arbitrary schemes.\n", nil) + sw.Do("func RegisterConversions(s $.|raw$) error {\n", schemePtr) + for _, t := range g.types { + peerType := getPeerTypeFor(c, t, g.peerPackages) + if _, found := g.preexists(t, peerType); !found { + args := argsFromType(t, peerType).With("Scope", types.Ref(conversionPackagePath, "Scope")) + sw.Do("if err := s.AddGeneratedConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return "+nameTmpl+"(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) + } + if _, found := g.preexists(peerType, t); !found { + args := argsFromType(peerType, t).With("Scope", types.Ref(conversionPackagePath, "Scope")) + sw.Do("if err := s.AddGeneratedConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return "+nameTmpl+"(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) + } + } + + for i := range g.explicitConversions { + args := argsFromType(g.explicitConversions[i].inType, g.explicitConversions[i].outType).With("Scope", types.Ref(conversionPackagePath, "Scope")) + sw.Do("if err := s.AddGeneratedConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return "+nameTmpl+"(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) + } + + var pairs []conversionPair + for pair, t := range g.manualConversions { + if t.Name.Package != g.outputPackage { + continue + } + pairs = append(pairs, pair) + } + // sort by name of the conversion function + sort.Slice(pairs, func(i, j int) bool { + if g.manualConversions[pairs[i]].Name.Name < g.manualConversions[pairs[j]].Name.Name { + return true + } + return false + }) + for _, pair := range pairs { + args := argsFromType(pair.inType, pair.outType).With("Scope", types.Ref(conversionPackagePath, "Scope")).With("fn", g.manualConversions[pair]) + sw.Do("if err := s.AddConversionFunc((*$.inType|raw$)(nil), (*$.outType|raw$)(nil), func(a, b interface{}, scope $.Scope|raw$) error { return $.fn|raw$(a.(*$.inType|raw$), b.(*$.outType|raw$), scope) }); err != nil { return err }\n", args) + } + + sw.Do("return nil\n", nil) + sw.Do("}\n\n", nil) + return sw.Error() +} + +func (g *genConversion) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error { + klog.V(5).Infof("generating for type %v", t) + sw := generator.NewSnippetWriter(w, c, "$", "$") + + if peerType := getPeerTypeFor(c, t, g.peerPackages); peerType != nil { + g.generateConversion(t, peerType, sw) + g.generateConversion(peerType, t, sw) + } + + for _, inTypeName := range getExplicitFromTypes(t) { + inPkg, ok := c.Universe[inTypeName.Package] + if !ok { + klog.Errorf("Unrecognized package: %s", inTypeName.Package) + continue + } + inType, ok := inPkg.Types[inTypeName.Name] + if !ok { + klog.Errorf("Unrecognized type in package %s: %s", inTypeName.Package, inTypeName.Name) + continue + } + switch { + case inType.Name.Package == "net/url" && inType.Name.Name == "Values": + g.generateFromUrlValues(inType, t, sw) + default: + klog.Errorf("Not supported input type: %#v", inType.Name) + } + } + + return sw.Error() +} + +func (g *genConversion) generateConversion(inType, outType *types.Type, sw *generator.SnippetWriter) { + args := argsFromType(inType, outType). + With("Scope", types.Ref(conversionPackagePath, "Scope")) + + sw.Do("func auto"+nameTmpl+"(in *$.inType|raw$, out *$.outType|raw$, s $.Scope|raw$) error {\n", args) + g.generateFor(inType, outType, sw) + sw.Do("return nil\n", nil) + sw.Do("}\n\n", nil) + + if _, found := g.preexists(inType, outType); found { + // There is a public manual Conversion method: use it. + } else if skipped := g.skippedFields[inType]; len(skipped) != 0 { + // The inType had some fields we could not generate. + klog.Errorf("Warning: could not find nor generate a final Conversion function for %v -> %v", inType, outType) + klog.Errorf(" the following fields need manual conversion:") + for _, f := range skipped { + klog.Errorf(" - %v", f) + } + } else { + // Emit a public conversion function. + sw.Do("// "+nameTmpl+" is an autogenerated conversion function.\n", args) + sw.Do("func "+nameTmpl+"(in *$.inType|raw$, out *$.outType|raw$, s $.Scope|raw$) error {\n", args) + sw.Do("return auto"+nameTmpl+"(in, out, s)\n", args) + sw.Do("}\n\n", nil) + } +} + +// we use the system of shadowing 'in' and 'out' so that the same code is valid +// at any nesting level. This makes the autogenerator easy to understand, and +// the compiler shouldn't care. +func (g *genConversion) generateFor(inType, outType *types.Type, sw *generator.SnippetWriter) { + klog.V(5).Infof("generating %v -> %v", inType, outType) + var f func(*types.Type, *types.Type, *generator.SnippetWriter) + + switch inType.Kind { + case types.Builtin: + f = g.doBuiltin + case types.Map: + f = g.doMap + case types.Slice: + f = g.doSlice + case types.Struct: + f = g.doStruct + case types.Pointer: + f = g.doPointer + case types.Alias: + f = g.doAlias + default: + f = g.doUnknown + } + + f(inType, outType, sw) +} + +func (g *genConversion) doBuiltin(inType, outType *types.Type, sw *generator.SnippetWriter) { + if inType == outType { + sw.Do("*out = *in\n", nil) + } else { + sw.Do("*out = $.|raw$(*in)\n", outType) + } +} + +func (g *genConversion) doMap(inType, outType *types.Type, sw *generator.SnippetWriter) { + sw.Do("*out = make($.|raw$, len(*in))\n", outType) + if isDirectlyAssignable(inType.Key, outType.Key) { + sw.Do("for key, val := range *in {\n", nil) + if isDirectlyAssignable(inType.Elem, outType.Elem) { + if inType.Key == outType.Key { + sw.Do("(*out)[key] = ", nil) + } else { + sw.Do("(*out)[$.|raw$(key)] = ", outType.Key) + } + if inType.Elem == outType.Elem { + sw.Do("val\n", nil) + } else { + sw.Do("$.|raw$(val)\n", outType.Elem) + } + } else { + conversionExists := true + if function, ok := g.preexists(inType.Elem, outType.Elem); ok { + sw.Do("newVal := new($.|raw$)\n", outType.Elem) + sw.Do("if err := $.|raw$(&val, newVal, s); err != nil {\n", function) + } else if g.convertibleOnlyWithinPackage(inType.Elem, outType.Elem) { + sw.Do("newVal := new($.|raw$)\n", outType.Elem) + sw.Do("if err := "+nameTmpl+"(&val, newVal, s); err != nil {\n", argsFromType(inType.Elem, outType.Elem)) + } else { + args := argsFromType(inType.Elem, outType.Elem) + sw.Do("// FIXME: Provide conversion function to convert $.inType|raw$ to $.outType|raw$\n", args) + sw.Do("compileErrorOnMissingConversion()\n", nil) + conversionExists = false + } + if conversionExists { + sw.Do("return err\n", nil) + sw.Do("}\n", nil) + if inType.Key == outType.Key { + sw.Do("(*out)[key] = *newVal\n", nil) + } else { + sw.Do("(*out)[$.|raw$(key)] = *newVal\n", outType.Key) + } + } + } + } else { + // TODO: Implement it when necessary. + sw.Do("for range *in {\n", nil) + sw.Do("// FIXME: Converting unassignable keys unsupported $.|raw$\n", inType.Key) + } + sw.Do("}\n", nil) +} + +func (g *genConversion) doSlice(inType, outType *types.Type, sw *generator.SnippetWriter) { + sw.Do("*out = make($.|raw$, len(*in))\n", outType) + if inType.Elem == outType.Elem && inType.Elem.Kind == types.Builtin { + sw.Do("copy(*out, *in)\n", nil) + } else { + sw.Do("for i := range *in {\n", nil) + if isDirectlyAssignable(inType.Elem, outType.Elem) { + if inType.Elem == outType.Elem { + sw.Do("(*out)[i] = (*in)[i]\n", nil) + } else { + sw.Do("(*out)[i] = $.|raw$((*in)[i])\n", outType.Elem) + } + } else { + conversionExists := true + if function, ok := g.preexists(inType.Elem, outType.Elem); ok { + sw.Do("if err := $.|raw$(&(*in)[i], &(*out)[i], s); err != nil {\n", function) + } else if g.convertibleOnlyWithinPackage(inType.Elem, outType.Elem) { + sw.Do("if err := "+nameTmpl+"(&(*in)[i], &(*out)[i], s); err != nil {\n", argsFromType(inType.Elem, outType.Elem)) + } else { + args := argsFromType(inType.Elem, outType.Elem) + sw.Do("// FIXME: Provide conversion function to convert $.inType|raw$ to $.outType|raw$\n", args) + sw.Do("compileErrorOnMissingConversion()\n", nil) + conversionExists = false + } + if conversionExists { + sw.Do("return err\n", nil) + sw.Do("}\n", nil) + } + } + sw.Do("}\n", nil) + } +} + +func (g *genConversion) doStruct(inType, outType *types.Type, sw *generator.SnippetWriter) { + for _, inMember := range inType.Members { + if tagvals := extractTag(inMember.CommentLines); tagvals != nil && tagvals[0] == "false" { + // This field is excluded from conversion. + sw.Do("// INFO: in."+inMember.Name+" opted out of conversion generation\n", nil) + continue + } + outMember, found := findMember(outType, inMember.Name) + if !found { + // This field doesn't exist in the peer. + sw.Do("// WARNING: in."+inMember.Name+" requires manual conversion: does not exist in peer-type\n", nil) + g.skippedFields[inType] = append(g.skippedFields[inType], inMember.Name) + continue + } + + inMemberType, outMemberType := inMember.Type, outMember.Type + // create a copy of both underlying types but give them the top level alias name (since aliases + // are assignable) + if underlying := unwrapAlias(inMemberType); underlying != inMemberType { + copied := *underlying + copied.Name = inMemberType.Name + inMemberType = &copied + } + if underlying := unwrapAlias(outMemberType); underlying != outMemberType { + copied := *underlying + copied.Name = outMemberType.Name + outMemberType = &copied + } + + args := argsFromType(inMemberType, outMemberType).With("name", inMember.Name) + + // try a direct memory copy for any type that has exactly equivalent values + if g.useUnsafe.Equal(inMemberType, outMemberType) { + args = args. + With("Pointer", types.Ref("unsafe", "Pointer")). + With("SliceHeader", types.Ref("reflect", "SliceHeader")) + switch inMemberType.Kind { + case types.Pointer: + sw.Do("out.$.name$ = ($.outType|raw$)($.Pointer|raw$(in.$.name$))\n", args) + continue + case types.Map: + sw.Do("out.$.name$ = *(*$.outType|raw$)($.Pointer|raw$(&in.$.name$))\n", args) + continue + case types.Slice: + sw.Do("out.$.name$ = *(*$.outType|raw$)($.Pointer|raw$(&in.$.name$))\n", args) + continue + } + } + + // check based on the top level name, not the underlying names + if function, ok := g.preexists(inMember.Type, outMember.Type); ok { + if isDrop(function.CommentLines) { + continue + } + // copy-only functions that are directly assignable can be inlined instead of invoked. + // As an example, conversion functions exist that allow types with private fields to be + // correctly copied between types. These functions are equivalent to a memory assignment, + // and are necessary for the reflection path, but should not block memory conversion. + // Convert_unversioned_Time_to_unversioned_Time is an example of this logic. + if !isCopyOnly(function.CommentLines) || !g.isFastConversion(inMemberType, outMemberType) { + args["function"] = function + sw.Do("if err := $.function|raw$(&in.$.name$, &out.$.name$, s); err != nil {\n", args) + sw.Do("return err\n", nil) + sw.Do("}\n", nil) + continue + } + klog.V(5).Infof("Skipped function %s because it is copy-only and we can use direct assignment", function.Name) + } + + // If we can't auto-convert, punt before we emit any code. + if inMemberType.Kind != outMemberType.Kind { + sw.Do("// WARNING: in."+inMember.Name+" requires manual conversion: inconvertible types ("+ + inMemberType.String()+" vs "+outMemberType.String()+")\n", nil) + g.skippedFields[inType] = append(g.skippedFields[inType], inMember.Name) + continue + } + + switch inMemberType.Kind { + case types.Builtin: + if inMemberType == outMemberType { + sw.Do("out.$.name$ = in.$.name$\n", args) + } else { + sw.Do("out.$.name$ = $.outType|raw$(in.$.name$)\n", args) + } + case types.Map, types.Slice, types.Pointer: + if g.isDirectlyAssignable(inMemberType, outMemberType) { + sw.Do("out.$.name$ = in.$.name$\n", args) + continue + } + + sw.Do("if in.$.name$ != nil {\n", args) + sw.Do("in, out := &in.$.name$, &out.$.name$\n", args) + g.generateFor(inMemberType, outMemberType, sw) + sw.Do("} else {\n", nil) + sw.Do("out.$.name$ = nil\n", args) + sw.Do("}\n", nil) + case types.Struct: + if g.isDirectlyAssignable(inMemberType, outMemberType) { + sw.Do("out.$.name$ = in.$.name$\n", args) + continue + } + conversionExists := true + if g.convertibleOnlyWithinPackage(inMemberType, outMemberType) { + sw.Do("if err := "+nameTmpl+"(&in.$.name$, &out.$.name$, s); err != nil {\n", args) + } else { + args := argsFromType(inMemberType, outMemberType) + sw.Do("// FIXME: Provide conversion function to convert $.inType|raw$ to $.outType|raw$\n", args) + sw.Do("compileErrorOnMissingConversion()\n", nil) + conversionExists = false + } + if conversionExists { + sw.Do("return err\n", nil) + sw.Do("}\n", nil) + } + case types.Alias: + if isDirectlyAssignable(inMemberType, outMemberType) { + if inMemberType == outMemberType { + sw.Do("out.$.name$ = in.$.name$\n", args) + } else { + sw.Do("out.$.name$ = $.outType|raw$(in.$.name$)\n", args) + } + } else { + conversionExists := true + if g.convertibleOnlyWithinPackage(inMemberType, outMemberType) { + sw.Do("if err := "+nameTmpl+"(&in.$.name$, &out.$.name$, s); err != nil {\n", args) + } else { + args := argsFromType(inMemberType, outMemberType) + sw.Do("// FIXME: Provide conversion function to convert $.inType|raw$ to $.outType|raw$\n", args) + sw.Do("compileErrorOnMissingConversion()\n", nil) + conversionExists = false + } + if conversionExists { + sw.Do("return err\n", nil) + sw.Do("}\n", nil) + } + } + default: + conversionExists := true + if g.convertibleOnlyWithinPackage(inMemberType, outMemberType) { + sw.Do("if err := "+nameTmpl+"(&in.$.name$, &out.$.name$, s); err != nil {\n", args) + } else { + args := argsFromType(inMemberType, outMemberType) + sw.Do("// FIXME: Provide conversion function to convert $.inType|raw$ to $.outType|raw$\n", args) + sw.Do("compileErrorOnMissingConversion()\n", nil) + conversionExists = false + } + if conversionExists { + sw.Do("return err\n", nil) + sw.Do("}\n", nil) + } + } + } +} + +func (g *genConversion) isFastConversion(inType, outType *types.Type) bool { + switch inType.Kind { + case types.Builtin: + return true + case types.Map, types.Slice, types.Pointer, types.Struct, types.Alias: + return g.isDirectlyAssignable(inType, outType) + default: + return false + } +} + +func (g *genConversion) isDirectlyAssignable(inType, outType *types.Type) bool { + return unwrapAlias(inType) == unwrapAlias(outType) +} + +func (g *genConversion) doPointer(inType, outType *types.Type, sw *generator.SnippetWriter) { + sw.Do("*out = new($.Elem|raw$)\n", outType) + if isDirectlyAssignable(inType.Elem, outType.Elem) { + if inType.Elem == outType.Elem { + sw.Do("**out = **in\n", nil) + } else { + sw.Do("**out = $.|raw$(**in)\n", outType.Elem) + } + } else { + conversionExists := true + if function, ok := g.preexists(inType.Elem, outType.Elem); ok { + sw.Do("if err := $.|raw$(*in, *out, s); err != nil {\n", function) + } else if g.convertibleOnlyWithinPackage(inType.Elem, outType.Elem) { + sw.Do("if err := "+nameTmpl+"(*in, *out, s); err != nil {\n", argsFromType(inType.Elem, outType.Elem)) + } else { + args := argsFromType(inType.Elem, outType.Elem) + sw.Do("// FIXME: Provide conversion function to convert $.inType|raw$ to $.outType|raw$\n", args) + sw.Do("compileErrorOnMissingConversion()\n", nil) + conversionExists = false + } + if conversionExists { + sw.Do("return err\n", nil) + sw.Do("}\n", nil) + } + } +} + +func (g *genConversion) doAlias(inType, outType *types.Type, sw *generator.SnippetWriter) { + // TODO: Add support for aliases. + g.doUnknown(inType, outType, sw) +} + +func (g *genConversion) doUnknown(inType, outType *types.Type, sw *generator.SnippetWriter) { + sw.Do("// FIXME: Type $.|raw$ is unsupported.\n", inType) +} + +func (g *genConversion) generateFromUrlValues(inType, outType *types.Type, sw *generator.SnippetWriter) { + args := generator.Args{ + "inType": inType, + "outType": outType, + "Scope": types.Ref(conversionPackagePath, "Scope"), + } + sw.Do("func auto"+nameTmpl+"(in *$.inType|raw$, out *$.outType|raw$, s $.Scope|raw$) error {\n", args) + for _, outMember := range outType.Members { + if tagvals := extractTag(outMember.CommentLines); tagvals != nil && tagvals[0] == "false" { + // This field is excluded from conversion. + sw.Do("// INFO: in."+outMember.Name+" opted out of conversion generation\n", nil) + continue + } + jsonTag := reflect.StructTag(outMember.Tags).Get("json") + index := strings.Index(jsonTag, ",") + if index == -1 { + index = len(jsonTag) + } + if index == 0 { + memberArgs := generator.Args{ + "name": outMember.Name, + } + sw.Do("// WARNING: Field $.name$ does not have json tag, skipping.\n\n", memberArgs) + continue + } + memberArgs := generator.Args{ + "name": outMember.Name, + "tag": jsonTag[:index], + } + sw.Do("if values, ok := map[string][]string(*in)[\"$.tag$\"]; ok && len(values) > 0 {\n", memberArgs) + g.fromValuesEntry(inType.Underlying.Elem, outMember, sw) + sw.Do("} else {\n", nil) + g.setZeroValue(outMember, sw) + sw.Do("}\n", nil) + } + sw.Do("return nil\n", nil) + sw.Do("}\n\n", nil) + + if _, found := g.preexists(inType, outType); found { + // There is a public manual Conversion method: use it. + } else { + // Emit a public conversion function. + sw.Do("// "+nameTmpl+" is an autogenerated conversion function.\n", args) + sw.Do("func "+nameTmpl+"(in *$.inType|raw$, out *$.outType|raw$, s $.Scope|raw$) error {\n", args) + sw.Do("return auto"+nameTmpl+"(in, out, s)\n", args) + sw.Do("}\n\n", nil) + } +} + +func (g *genConversion) fromValuesEntry(inType *types.Type, outMember types.Member, sw *generator.SnippetWriter) { + memberArgs := generator.Args{ + "name": outMember.Name, + "type": outMember.Type, + } + if function, ok := g.preexists(inType, outMember.Type); ok { + args := memberArgs.With("function", function) + sw.Do("if err := $.function|raw$(&values, &out.$.name$, s); err != nil {\n", args) + sw.Do("return err\n", nil) + sw.Do("}\n", nil) + return + } + switch { + case outMember.Type == types.String: + sw.Do("out.$.name$ = values[0]\n", memberArgs) + case g.useUnsafe.Equal(inType, outMember.Type): + args := memberArgs.With("Pointer", types.Ref("unsafe", "Pointer")) + switch inType.Kind { + case types.Pointer: + sw.Do("out.$.name$ = ($.type|raw$)($.Pointer|raw$(&values))\n", args) + case types.Map, types.Slice: + sw.Do("out.$.name$ = *(*$.type|raw$)($.Pointer|raw$(&values))\n", args) + default: + // TODO: Support other types to allow more auto-conversions. + sw.Do("// FIXME: out.$.name$ is of not yet supported type and requires manual conversion\n", memberArgs) + } + default: + // TODO: Support other types to allow more auto-conversions. + sw.Do("// FIXME: out.$.name$ is of not yet supported type and requires manual conversion\n", memberArgs) + } +} + +func (g *genConversion) setZeroValue(outMember types.Member, sw *generator.SnippetWriter) { + outMemberType := unwrapAlias(outMember.Type) + memberArgs := generator.Args{ + "name": outMember.Name, + "alias": outMember.Type, + "type": outMemberType, + } + + switch outMemberType.Kind { + case types.Builtin: + switch outMemberType { + case types.String: + sw.Do("out.$.name$ = \"\"\n", memberArgs) + case types.Int64, types.Int32, types.Int16, types.Int, types.Uint64, types.Uint32, types.Uint16, types.Uint: + sw.Do("out.$.name$ = 0\n", memberArgs) + case types.Uintptr, types.Byte: + sw.Do("out.$.name$ = 0\n", memberArgs) + case types.Float64, types.Float32, types.Float: + sw.Do("out.$.name$ = 0\n", memberArgs) + case types.Bool: + sw.Do("out.$.name$ = false\n", memberArgs) + default: + sw.Do("// FIXME: out.$.name$ is of unsupported type and requires manual conversion\n", memberArgs) + } + case types.Struct: + if outMemberType == outMember.Type { + sw.Do("out.$.name$ = $.type|raw${}\n", memberArgs) + } else { + sw.Do("out.$.name$ = $.alias|raw$($.type|raw${})\n", memberArgs) + } + case types.Map, types.Slice, types.Pointer: + sw.Do("out.$.name$ = nil\n", memberArgs) + case types.Alias: + // outMemberType was already unwrapped from aliases - so that should never happen. + sw.Do("// FIXME: unexpected error for out.$.name$\n", memberArgs) + case types.Interface, types.Array: + sw.Do("out.$.name$ = nil\n", memberArgs) + default: + sw.Do("// FIXME: out.$.name$ is of unsupported type and requires manual conversion\n", memberArgs) + } +} + +func isDirectlyAssignable(inType, outType *types.Type) bool { + // TODO: This should maybe check for actual assignability between the two + // types, rather than superficial traits that happen to indicate it is + // assignable in the ways we currently use this code. + return inType.IsAssignable() && (inType.IsPrimitive() || isSamePackage(inType, outType)) +} + +func isSamePackage(inType, outType *types.Type) bool { + return inType.Name.Package == outType.Name.Package +} diff --git a/hack/tools/third_party/conversion-gen/main.go b/hack/tools/third_party/conversion-gen/main.go new file mode 100644 index 0000000000..ae44b35942 --- /dev/null +++ b/hack/tools/third_party/conversion-gen/main.go @@ -0,0 +1,135 @@ +/* +Copyright 2016 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. +*/ + +// conversion-gen is a tool for auto-generating functions that convert +// between internal and external types. A general conversion code +// generation task involves three sets of packages: (1) a set of +// packages containing internal types, (2) a single package containing +// the external types, and (3) a single destination package (i.e., +// where the generated conversion functions go, and where the +// developer-authored conversion functions are). The packages +// containing the internal types play the role known as "peer +// packages" in the general code-generation framework of Kubernetes. +// +// For each conversion task, `conversion-gen` will generate functions +// that efficiently convert between same-name types in the two +// (internal, external) packages. The generated functions include +// ones named +// autoConvert___To__ +// for each such pair of types --- both with (pkg1,pkg2) = +// (internal,external) and (pkg1,pkg2) = (external,internal). The +// generated conversion functions recurse on the structure of the data +// types. For structs, source and destination fields are matched up +// according to name; if a source field has no corresponding +// destination or there is a fundamental mismatch in the type of the +// field then the generated autoConvert_... function has just a +// warning comment about that field. The generated conversion +// functions use standard value assignment wherever possible. For +// compound types, the generated conversion functions call the +// `Convert...` functions for the subsidiary types. +// +// For each pair of types `conversion-gen` will also generate a +// function named +// Convert___To__ +// if both of two conditions are met: (1) the destination package does +// not contain a function of that name in a non-generated file and (2) +// the generation of the corresponding autoConvert_... function did +// not run into trouble with a missing or fundamentally differently +// typed field. A generated Convert_... function simply calls the +// corresponding `autoConvert...` function. `conversion_gen` also +// generates a function that updates a given `runtime.Scheme` by +// registering all the Convert_... functions found and generated. +// Thus developers can override the generated behavior for selected +// type pairs by putting the desired Convert_... functions in +// non-generated files. Further, developers are practically required +// to override the generated behavior when there are missing or +// fundamentally differently typed fields. +// +// `conversion-gen` will scan its `--input-dirs`, looking at the +// package defined in each of those directories for comment tags that +// define a conversion code generation task. A package requests +// conversion code generation by including one or more comment in the +// package's `doc.go` file (currently anywhere in that file is +// acceptable, but the recommended location is above the `package` +// statement), of the form: +// // +k8s:conversion-gen= +// This introduces a conversion task, for which the destination +// package is the one containing the file with the tag and the tag +// identifies a package containing internal types. If there is also a +// tag of the form +// // +k8s:conversion-gen-external-types= +// then it identifies the package containing the external types; +// otherwise they are in the destination package. +// +// For each conversion code generation task, the full set of internal +// packages (AKA peer packages) consists of the ones specified in the +// `k8s:conversion-gen` tags PLUS any specified in the +// `--base-peer-dirs` and `--extra-peer-dirs` flags on the command +// line. +// +// When generating for a package, individual types or fields of structs may opt +// out of Conversion generation by specifying a comment on the of the form: +// // +k8s:conversion-gen=false +package main + +import ( + "flag" + + "github.com/spf13/pflag" + "k8s.io/klog/v2" + + generatorargs "k8s.io/code-generator/cmd/conversion-gen/args" + "k8s.io/code-generator/pkg/util" + "sigs.k8s.io/cluster-api-provider-aws/hack/tools/third_party/conversion-gen/generators" +) + +func main() { + klog.InitFlags(nil) + genericArgs, customArgs := generatorargs.NewDefaults() + + // Override defaults. + // TODO: move this out of conversion-gen + genericArgs.GoHeaderFilePath = util.BoilerplatePath() + + genericArgs.AddFlags(pflag.CommandLine) + customArgs.AddFlags(pflag.CommandLine) + flag.Set("logtostderr", "true") + pflag.CommandLine.AddGoFlagSet(flag.CommandLine) + pflag.Parse() + + // k8s.io/apimachinery/pkg/runtime contains a number of manual conversions, + // that we need to generate conversions. + // Packages being dependencies of explicitly requested packages are only + // partially scanned - only types explicitly used are being traversed. + // Not used functions or types are omitted. + // Adding this explicitly to InputDirs ensures that the package is fully + // scanned and all functions are parsed and processed. + genericArgs.InputDirs = append(genericArgs.InputDirs, "k8s.io/apimachinery/pkg/runtime") + + if err := generatorargs.Validate(genericArgs); err != nil { + klog.Fatalf("Error: %v", err) + } + + // Run it. + if err := genericArgs.Execute( + generators.NameSystems(), + generators.DefaultNameSystem(), + generators.Packages, + ); err != nil { + klog.Fatalf("Error: %v", err) + } + klog.V(2).Info("Completed successfully.") +} diff --git a/iam/api/v1beta1/types.go b/iam/api/v1beta1/types.go new file mode 100644 index 0000000000..97ecbf9298 --- /dev/null +++ b/iam/api/v1beta1/types.go @@ -0,0 +1,168 @@ +/* +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. +*/ + +// +k8s:deepcopy-gen=package,register +// +k8s:defaulter-gen=TypeMeta +// +groupName=iam.aws.infrastructure.cluster.x-k8s.io +// +gencrdrefdocs:force +package v1beta1 + +import ( + "encoding/json" + + "github.com/pkg/errors" +) + +type ( + // Effect defines an AWS IAM effect. + Effect string + + // ConditionOperator defines an AWS condition operator. + ConditionOperator string + + // PrincipalType defines an AWS principle type. + PrincipalType string +) + +const ( + + // Any is the AWS IAM policy grammar wildcard. + Any = "*" + + // CurrentVersion is the latest version of the AWS IAM policy grammar. + CurrentVersion = "2012-10-17" + + // EffectAllow is the Allow effect in an AWS IAM policy statement entry. + EffectAllow Effect = "Allow" + + // EffectDeny is the Deny effect in an AWS IAM policy statement entry. + EffectDeny Effect = "Deny" + + // PrincipalAWS is the identity type covering AWS ARNs. + PrincipalAWS PrincipalType = "AWS" + + // PrincipalFederated is the identity type covering federated identities. + PrincipalFederated PrincipalType = "Federated" + + // PrincipalService is the identity type covering AWS services. + PrincipalService PrincipalType = "Service" + + // StringEquals is an AWS IAM policy condition operator. + StringEquals ConditionOperator = "StringEquals" + + // StringNotEquals is an AWS IAM policy condition operator. + StringNotEquals ConditionOperator = "StringNotEquals" + + // StringEqualsIgnoreCase is an AWS IAM policy condition operator. + StringEqualsIgnoreCase ConditionOperator = "StringEqualsIgnoreCase" + + // StringLike is an AWS IAM policy condition operator. + StringLike ConditionOperator = "StringLike" + + // StringNotLike is an AWS IAM policy condition operator. + StringNotLike ConditionOperator = "StringNotLike" + + // DefaultNameSuffix is the default suffix appended to all AWS IAM roles created by clusterawsadm. + DefaultNameSuffix = ".cluster-api-provider-aws.sigs.k8s.io" +) + +// PolicyDocument represents an AWS IAM policy document, and can be +// converted into JSON using "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/converters". +type PolicyDocument struct { + Version string + Statement Statements + ID string `json:"Id,omitempty"` +} + +// StatementEntry represents each "statement" block in an AWS IAM policy document. +type StatementEntry struct { + Sid string `json:",omitempty"` + Principal Principals `json:",omitempty"` + NotPrincipal Principals `json:",omitempty"` + Effect Effect `json:"Effect"` + Action Actions `json:"Action"` + Resource Resources `json:",omitempty"` + Condition Conditions `json:"Condition,omitempty"` +} + +// Statements is the list of StatementEntries. +type Statements []StatementEntry + +// Principals is the map of all identities a statement entry refers to. +type Principals map[PrincipalType]PrincipalID + +// Actions is the list of actions. +type Actions []string + +// UnmarshalJSON is an Actions Unmarshaler. +func (actions *Actions) UnmarshalJSON(data []byte) error { + var ids []string + if err := json.Unmarshal(data, &ids); err == nil { + *actions = Actions(ids) + return nil + } + var id string + if err := json.Unmarshal(data, &id); err != nil { + return errors.Wrap(err, "couldn't unmarshal as either []string or string") + } + *actions = []string{id} + return nil +} + +// Resources is the list of resources. +type Resources []string + +// PrincipalID represents the list of all identities, such as ARNs. +type PrincipalID []string + +// UnmarshalJSON defines an Unmarshaler for a PrincipalID. +func (identityID *PrincipalID) UnmarshalJSON(data []byte) error { + var ids []string + if err := json.Unmarshal(data, &ids); err == nil { + *identityID = PrincipalID(ids) + return nil + } + var id string + if err := json.Unmarshal(data, &id); err != nil { + return errors.Wrap(err, "couldn't unmarshal as either []string or string") + } + *identityID = []string{id} + return nil +} + +// Conditions is the map of all conditions in the statement entry. +type Conditions map[ConditionOperator]interface{} + +// DeepCopyInto copies the receiver, writing into out. in must be non-nil. +func (in Conditions) DeepCopyInto(out *Conditions) { + { + in := &in + *out = make(Conditions, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } +} + +// DeepCopy copies the receiver, creating a new Conditions. +func (in Conditions) DeepCopy() Conditions { + if in == nil { + return nil + } + out := new(Conditions) + in.DeepCopyInto(out) + return *out +} diff --git a/iam/api/v1beta1/zz_generated.deepcopy.go b/iam/api/v1beta1/zz_generated.deepcopy.go new file mode 100644 index 0000000000..896489924b --- /dev/null +++ b/iam/api/v1beta1/zz_generated.deepcopy.go @@ -0,0 +1,208 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by controller-gen. DO NOT EDIT. + +package v1beta1 + +import () + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Actions) DeepCopyInto(out *Actions) { + { + in := &in + *out = make(Actions, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Actions. +func (in Actions) DeepCopy() Actions { + if in == nil { + return nil + } + out := new(Actions) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PolicyDocument) DeepCopyInto(out *PolicyDocument) { + *out = *in + if in.Statement != nil { + in, out := &in.Statement, &out.Statement + *out = make(Statements, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PolicyDocument. +func (in *PolicyDocument) DeepCopy() *PolicyDocument { + if in == nil { + return nil + } + out := new(PolicyDocument) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in PrincipalID) DeepCopyInto(out *PrincipalID) { + { + in := &in + *out = make(PrincipalID, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PrincipalID. +func (in PrincipalID) DeepCopy() PrincipalID { + if in == nil { + return nil + } + out := new(PrincipalID) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Principals) DeepCopyInto(out *Principals) { + { + in := &in + *out = make(Principals, len(*in)) + for key, val := range *in { + var outVal []string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = make(PrincipalID, len(*in)) + copy(*out, *in) + } + (*out)[key] = outVal + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Principals. +func (in Principals) DeepCopy() Principals { + if in == nil { + return nil + } + out := new(Principals) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Resources) DeepCopyInto(out *Resources) { + { + in := &in + *out = make(Resources, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Resources. +func (in Resources) DeepCopy() Resources { + if in == nil { + return nil + } + out := new(Resources) + in.DeepCopyInto(out) + return *out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *StatementEntry) DeepCopyInto(out *StatementEntry) { + *out = *in + if in.Principal != nil { + in, out := &in.Principal, &out.Principal + *out = make(Principals, len(*in)) + for key, val := range *in { + var outVal []string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = make(PrincipalID, len(*in)) + copy(*out, *in) + } + (*out)[key] = outVal + } + } + if in.NotPrincipal != nil { + in, out := &in.NotPrincipal, &out.NotPrincipal + *out = make(Principals, len(*in)) + for key, val := range *in { + var outVal []string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = make(PrincipalID, len(*in)) + copy(*out, *in) + } + (*out)[key] = outVal + } + } + if in.Action != nil { + in, out := &in.Action, &out.Action + *out = make(Actions, len(*in)) + copy(*out, *in) + } + if in.Resource != nil { + in, out := &in.Resource, &out.Resource + *out = make(Resources, len(*in)) + copy(*out, *in) + } + out.Condition = in.Condition.DeepCopy() +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatementEntry. +func (in *StatementEntry) DeepCopy() *StatementEntry { + if in == nil { + return nil + } + out := new(StatementEntry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in Statements) DeepCopyInto(out *Statements) { + { + in := &in + *out = make(Statements, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Statements. +func (in Statements) DeepCopy() Statements { + if in == nil { + return nil + } + out := new(Statements) + in.DeepCopyInto(out) + return *out +} diff --git a/main.go b/main.go index 5850716ff1..8bc1b6b6c8 100644 --- a/main.go +++ b/main.go @@ -29,34 +29,39 @@ import ( "github.com/spf13/pflag" "k8s.io/apimachinery/pkg/runtime" - clientgoscheme "k8s.io/client-go/kubernetes/scheme" - "k8s.io/client-go/tools/leaderelection/resourcelock" + cgscheme "k8s.io/client-go/kubernetes/scheme" cgrecord "k8s.io/client-go/tools/record" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/controller" + + "k8s.io/client-go/tools/leaderelection/resourcelock" infrav1alpha3 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" infrav1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - bootstrapv1alpha3 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha3" - bootstrapv1alpha4 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha4" - bootstrapv1controllers "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/controllers" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + eksbootstrapv1alpha3 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha3" + eksbootstrapv1alpha4 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha4" + eksbootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1beta1" + eksbootstrapcontrollers "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/controllers" "sigs.k8s.io/cluster-api-provider-aws/controllers" - controlplanev1alpha3 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3" - controlplanev1alpha4 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" - controlplanev1controllers "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/controllers" - infrav1alpha3exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha3" - infrav1alpha4exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + ekscontrolplanev1alpha3 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3" + ekscontrolplanev1alpha4 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + ekscontrolplanecontrollers "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/controllers" + expinfrav1alpha3 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha3" + expinfrav1alpha4 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/exp/controlleridentitycreator" - controllersexp "sigs.k8s.io/cluster-api-provider-aws/exp/controllers" + expcontrollers "sigs.k8s.io/cluster-api-provider-aws/exp/controllers" "sigs.k8s.io/cluster-api-provider-aws/exp/instancestate" "sigs.k8s.io/cluster-api-provider-aws/feature" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/endpoints" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/record" "sigs.k8s.io/cluster-api-provider-aws/version" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha4" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/controller" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" // +kubebuilder:scaffold:imports ) @@ -66,17 +71,21 @@ var ( ) func init() { - _ = clientgoscheme.AddToScheme(scheme) + _ = eksbootstrapv1.AddToScheme(scheme) + _ = eksbootstrapv1alpha3.AddToScheme(scheme) + _ = eksbootstrapv1alpha4.AddToScheme(scheme) + _ = cgscheme.AddToScheme(scheme) + _ = clusterv1.AddToScheme(scheme) + _ = expclusterv1.AddToScheme(scheme) + _ = ekscontrolplanev1.AddToScheme(scheme) + _ = ekscontrolplanev1alpha3.AddToScheme(scheme) + _ = ekscontrolplanev1alpha4.AddToScheme(scheme) + _ = infrav1.AddToScheme(scheme) _ = infrav1alpha3.AddToScheme(scheme) + _ = expinfrav1alpha3.AddToScheme(scheme) _ = infrav1alpha4.AddToScheme(scheme) - _ = infrav1alpha3exp.AddToScheme(scheme) - _ = infrav1alpha4exp.AddToScheme(scheme) - _ = clusterv1.AddToScheme(scheme) - _ = controlplanev1alpha3.AddToScheme(scheme) - _ = controlplanev1alpha4.AddToScheme(scheme) - _ = clusterv1exp.AddToScheme(scheme) - _ = bootstrapv1alpha3.AddToScheme(scheme) - _ = bootstrapv1alpha4.AddToScheme(scheme) + _ = expinfrav1alpha4.AddToScheme(scheme) + _ = expinfrav1.AddToScheme(scheme) // +kubebuilder:scaffold:scheme } @@ -167,7 +176,7 @@ func main() { Recorder: mgr.GetEventRecorderFor("awsmachine-controller"), Endpoints: AWSServiceEndpoints, WatchFilterValue: watchFilterValue, - }).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: awsMachineConcurrency}); err != nil { + }).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: awsMachineConcurrency, RecoverPanic: true}); err != nil { setupLog.Error(err, "unable to create controller", "controller", "AWSMachine") os.Exit(1) } @@ -176,74 +185,74 @@ func main() { Recorder: mgr.GetEventRecorderFor("awscluster-controller"), Endpoints: AWSServiceEndpoints, WatchFilterValue: watchFilterValue, - }).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: awsClusterConcurrency}); err != nil { + }).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: awsClusterConcurrency, RecoverPanic: true}); err != nil { setupLog.Error(err, "unable to create controller", "controller", "AWSCluster") os.Exit(1) } enableGates(ctx, mgr, AWSServiceEndpoints) - if err = (&infrav1alpha4.AWSMachineTemplate{}).SetupWebhookWithManager(mgr); err != nil { + if err = (&infrav1.AWSMachineTemplate{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AWSMachineTemplate") os.Exit(1) } - if err = (&infrav1alpha4.AWSMachineTemplateList{}).SetupWebhookWithManager(mgr); err != nil { + if err = (&infrav1.AWSMachineTemplateList{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AWSMachineTemplateList") os.Exit(1) } - if err = (&infrav1alpha4.AWSCluster{}).SetupWebhookWithManager(mgr); err != nil { + if err = (&infrav1.AWSCluster{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AWSCluster") os.Exit(1) } - if err = (&infrav1alpha4.AWSClusterTemplate{}).SetupWebhookWithManager(mgr); err != nil { + if err = (&infrav1.AWSClusterTemplate{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AWSClusterTemplate") os.Exit(1) } - if err = (&infrav1alpha4.AWSClusterList{}).SetupWebhookWithManager(mgr); err != nil { + if err = (&infrav1.AWSClusterList{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AWSClusterList") os.Exit(1) } - if err = (&infrav1alpha4.AWSClusterControllerIdentity{}).SetupWebhookWithManager(mgr); err != nil { + if err = (&infrav1.AWSClusterControllerIdentity{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AWSClusterControllerIdentity") os.Exit(1) } - if err = (&infrav1alpha4.AWSClusterRoleIdentity{}).SetupWebhookWithManager(mgr); err != nil { + if err = (&infrav1.AWSClusterRoleIdentity{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AWSClusterRoleIdentity") os.Exit(1) } - if err = (&infrav1alpha4.AWSClusterStaticIdentity{}).SetupWebhookWithManager(mgr); err != nil { + if err = (&infrav1.AWSClusterStaticIdentity{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AWSClusterStaticIdentity") os.Exit(1) } - if err = (&infrav1alpha4.AWSMachine{}).SetupWebhookWithManager(mgr); err != nil { + if err = (&infrav1.AWSMachine{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AWSMachine") os.Exit(1) } - if err = (&infrav1alpha4.AWSMachineList{}).SetupWebhookWithManager(mgr); err != nil { + if err = (&infrav1.AWSMachineList{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AWSMachineList") os.Exit(1) } - if err = (&infrav1alpha4.AWSClusterControllerIdentityList{}).SetupWebhookWithManager(mgr); err != nil { + if err = (&infrav1.AWSClusterControllerIdentityList{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AWSClusterControllerIdentityList") os.Exit(1) } - if err = (&infrav1alpha4.AWSClusterRoleIdentityList{}).SetupWebhookWithManager(mgr); err != nil { + if err = (&infrav1.AWSClusterRoleIdentityList{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AWSClusterRoleIdentityList") os.Exit(1) } if feature.Gates.Enabled(feature.EKS) { setupLog.Info("enabling EKS webhooks") - if err := (&controlplanev1alpha4.AWSManagedControlPlane{}).SetupWebhookWithManager(mgr); err != nil { + if err := (&ekscontrolplanev1.AWSManagedControlPlane{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AWSManagedControlPlane") os.Exit(1) } if feature.Gates.Enabled(feature.EKSFargate) { - if err = (&infrav1alpha4exp.AWSFargateProfile{}).SetupWebhookWithManager(mgr); err != nil { + if err = (&expinfrav1.AWSFargateProfile{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AWSFargateProfile") os.Exit(1) } } if feature.Gates.Enabled(feature.MachinePool) { - if err = (&infrav1alpha4exp.AWSManagedMachinePool{}).SetupWebhookWithManager(mgr); err != nil { + if err = (&expinfrav1.AWSManagedMachinePool{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AWSManagedMachinePool") os.Exit(1) } @@ -251,7 +260,7 @@ func main() { } if feature.Gates.Enabled(feature.MachinePool) { setupLog.Info("enabling webhook for AWSMachinePool") - if err = (&infrav1alpha4exp.AWSMachinePool{}).SetupWebhookWithManager(mgr); err != nil { + if err = (&expinfrav1.AWSMachinePool{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AWSMachinePool") os.Exit(1) } @@ -290,49 +299,49 @@ func enableGates(ctx context.Context, mgr ctrl.Manager, awsServiceEndpoints []sc } setupLog.V(2).Info("enabling EKS control plane controller") - if err := (&controlplanev1controllers.AWSManagedControlPlaneReconciler{ + if err := (&ekscontrolplanecontrollers.AWSManagedControlPlaneReconciler{ Client: mgr.GetClient(), EnableIAM: enableIAM, AllowAdditionalRoles: allowAddRoles, Endpoints: awsServiceEndpoints, WatchFilterValue: watchFilterValue, - }).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: awsClusterConcurrency}); err != nil { + }).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: awsClusterConcurrency, RecoverPanic: true}); err != nil { setupLog.Error(err, "unable to create controller", "controller", "AWSManagedControlPlane") os.Exit(1) } setupLog.V(2).Info("enabling EKS bootstrap controller") - if err := (&bootstrapv1controllers.EKSConfigReconciler{ + if err := (&eksbootstrapcontrollers.EKSConfigReconciler{ Client: mgr.GetClient(), WatchFilterValue: watchFilterValue, - }).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: awsClusterConcurrency}); err != nil { + }).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: awsClusterConcurrency, RecoverPanic: true}); err != nil { setupLog.Error(err, "unable to create controller", "controller", "EKSConfig") os.Exit(1) } if feature.Gates.Enabled(feature.EKSFargate) { setupLog.V(2).Info("enabling EKS fargate profile controller") - if err := (&controllersexp.AWSFargateProfileReconciler{ + if err := (&expcontrollers.AWSFargateProfileReconciler{ Client: mgr.GetClient(), Recorder: mgr.GetEventRecorderFor("awsfargateprofile-reconciler"), EnableIAM: enableIAM, Endpoints: awsServiceEndpoints, WatchFilterValue: watchFilterValue, - }).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: awsClusterConcurrency}); err != nil { + }).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: awsClusterConcurrency, RecoverPanic: true}); err != nil { setupLog.Error(err, "unable to create controller", "controller", "AWSFargateProfile") } } if feature.Gates.Enabled(feature.MachinePool) { setupLog.V(2).Info("enabling EKS managed machine pool controller") - if err := (&controllersexp.AWSManagedMachinePoolReconciler{ + if err := (&expcontrollers.AWSManagedMachinePoolReconciler{ + AllowAdditionalRoles: allowAddRoles, Client: mgr.GetClient(), - Recorder: mgr.GetEventRecorderFor("awsmanagedmachinepool-reconciler"), EnableIAM: enableIAM, - AllowAdditionalRoles: allowAddRoles, Endpoints: awsServiceEndpoints, + Recorder: mgr.GetEventRecorderFor("awsmanagedmachinepool-reconciler"), WatchFilterValue: watchFilterValue, - }).SetupWithManager(ctx, mgr, controller.Options{}); err != nil { + }).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: instanceStateConcurrency, RecoverPanic: true}); err != nil { setupLog.Error(err, "unable to create controller", "controller", "AWSManagedMachinePool") os.Exit(1) } @@ -340,11 +349,11 @@ func enableGates(ctx context.Context, mgr ctrl.Manager, awsServiceEndpoints []sc } if feature.Gates.Enabled(feature.MachinePool) { setupLog.V(2).Info("enabling machine pool controller") - if err := (&controllersexp.AWSMachinePoolReconciler{ + if err := (&expcontrollers.AWSMachinePoolReconciler{ Client: mgr.GetClient(), Recorder: mgr.GetEventRecorderFor("awsmachinepool-controller"), WatchFilterValue: watchFilterValue, - }).SetupWithManager(ctx, mgr); err != nil { + }).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: instanceStateConcurrency, RecoverPanic: true}); err != nil { setupLog.Error(err, "unable to create controller", "controller", "AWSMachinePool") os.Exit(1) } @@ -356,7 +365,7 @@ func enableGates(ctx context.Context, mgr ctrl.Manager, awsServiceEndpoints []sc Log: ctrl.Log.WithName("controllers").WithName("AWSInstanceStateController"), Endpoints: awsServiceEndpoints, WatchFilterValue: watchFilterValue, - }).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: instanceStateConcurrency}); err != nil { + }).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: instanceStateConcurrency, RecoverPanic: true}); err != nil { setupLog.Error(err, "unable to create controller", "controller", "AWSInstanceStateController") os.Exit(1) } @@ -368,7 +377,7 @@ func enableGates(ctx context.Context, mgr ctrl.Manager, awsServiceEndpoints []sc Log: ctrl.Log.WithName("controllers").WithName("AWSControllerIdentity"), Endpoints: awsServiceEndpoints, WatchFilterValue: watchFilterValue, - }).SetupWithManager(ctx, mgr, controller.Options{}); err != nil { + }).SetupWithManager(ctx, mgr, controller.Options{MaxConcurrentReconciles: awsClusterConcurrency, RecoverPanic: true}); err != nil { setupLog.Error(err, "unable to create controller", "controller", "AWSControllerIdentity") os.Exit(1) } diff --git a/metadata.yaml b/metadata.yaml index 75f0f202e7..f49ec7d2c1 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -17,3 +17,6 @@ releaseSeries: - major: 0 minor: 7 contract: v1alpha4 + - major: 1 + minor: 0 + contract: v1beta1 diff --git a/pkg/cloud/awserrors/errors.go b/pkg/cloud/awserrors/errors.go index 8713d66460..e99775548a 100644 --- a/pkg/cloud/awserrors/errors.go +++ b/pkg/cloud/awserrors/errors.go @@ -25,25 +25,29 @@ import ( // Error singletons for AWS errors. const ( + AssociationIDNotFound = "InvalidAssociationID.NotFound" AuthFailure = "AuthFailure" - InUseIPAddress = "InvalidIPAddress.InUse" + BucketAlreadyOwnedByYou = "BucketAlreadyOwnedByYou" + EIPNotFound = "InvalidElasticIpID.NotFound" + GatewayNotFound = "InvalidGatewayID.NotFound" GroupNotFound = "InvalidGroup.NotFound" - PermissionNotFound = "InvalidPermission.NotFound" - VPCNotFound = "InvalidVpcID.NotFound" - SubnetNotFound = "InvalidSubnetID.NotFound" InternetGatewayNotFound = "InvalidInternetGatewayID.NotFound" - NATGatewayNotFound = "InvalidNatGatewayID.NotFound" - GatewayNotFound = "InvalidGatewayID.NotFound" - EIPNotFound = "InvalidElasticIpID.NotFound" - RouteTableNotFound = "InvalidRouteTableID.NotFound" - LoadBalancerNotFound = "LoadBalancerNotFound" - ResourceNotFound = "InvalidResourceID.NotFound" - InvalidSubnet = "InvalidSubnet" - AssociationIDNotFound = "InvalidAssociationID.NotFound" + InUseIPAddress = "InvalidIPAddress.InUse" + InvalidAccessKeyID = "InvalidAccessKeyId" + InvalidClientTokenID = "InvalidClientTokenId" InvalidInstanceID = "InvalidInstanceID.NotFound" + InvalidSubnet = "InvalidSubnet" LaunchTemplateNameNotFound = "InvalidLaunchTemplateName.NotFoundException" - ResourceExists = "ResourceExistsException" + LoadBalancerNotFound = "LoadBalancerNotFound" + NATGatewayNotFound = "InvalidNatGatewayID.NotFound" NoCredentialProviders = "NoCredentialProviders" + NoSuchKey = "NoSuchKey" + PermissionNotFound = "InvalidPermission.NotFound" + ResourceExists = "ResourceExistsException" + ResourceNotFound = "InvalidResourceID.NotFound" + RouteTableNotFound = "InvalidRouteTableID.NotFound" + SubnetNotFound = "InvalidSubnetID.NotFound" + VPCNotFound = "InvalidVpcID.NotFound" ) var _ error = &EC2Error{} @@ -92,6 +96,13 @@ func NewConflict(msg string) error { } } +func IsBucketAlreadyOwnedByYou(err error) bool { + if code, ok := Code(err); ok { + return code == BucketAlreadyOwnedByYou + } + return false +} + // IsResourceExists checks the state of the resource. func IsResourceExists(err error) bool { if code, ok := Code(err); ok { diff --git a/pkg/cloud/converters/eks.go b/pkg/cloud/converters/eks.go index 33a2f9ffdc..06b4cb4b50 100644 --- a/pkg/cloud/converters/eks.go +++ b/pkg/cloud/converters/eks.go @@ -24,8 +24,8 @@ import ( "github.com/aws/aws-sdk-go/service/eks" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/eks/identityprovider" ) @@ -73,7 +73,7 @@ func FromAWSStringSlice(from []*string) []string { } // TaintToSDK is used to a CAPA Taint to AWS SDK taint. -func TaintToSDK(taint infrav1exp.Taint) (*eks.Taint, error) { +func TaintToSDK(taint expinfrav1.Taint) (*eks.Taint, error) { convertedEffect, err := TaintEffectToSDK(taint.Effect) if err != nil { return nil, fmt.Errorf("converting taint effect %s: %w", taint.Effect, err) @@ -86,7 +86,7 @@ func TaintToSDK(taint infrav1exp.Taint) (*eks.Taint, error) { } // TaintsToSDK is used to convert an array of CAPA Taints to AWS SDK taints. -func TaintsToSDK(taints infrav1exp.Taints) ([]*eks.Taint, error) { +func TaintsToSDK(taints expinfrav1.Taints) ([]*eks.Taint, error) { converted := []*eks.Taint{} for _, taint := range taints { @@ -101,14 +101,14 @@ func TaintsToSDK(taints infrav1exp.Taints) ([]*eks.Taint, error) { } // TaintsFromSDK is used to convert an array of AWS SDK taints to CAPA Taints. -func TaintsFromSDK(taints []*eks.Taint) (infrav1exp.Taints, error) { - converted := infrav1exp.Taints{} +func TaintsFromSDK(taints []*eks.Taint) (expinfrav1.Taints, error) { + converted := expinfrav1.Taints{} for _, taint := range taints { convertedEffect, err := TaintEffectFromSDK(*taint.Effect) if err != nil { return nil, fmt.Errorf("converting taint effect %s: %w", *taint.Effect, err) } - converted = append(converted, infrav1exp.Taint{ + converted = append(converted, expinfrav1.Taint{ Effect: convertedEffect, Key: *taint.Key, Value: *taint.Value, @@ -119,13 +119,13 @@ func TaintsFromSDK(taints []*eks.Taint) (infrav1exp.Taints, error) { } // TaintEffectToSDK is used to convert a TaintEffect to the AWS SDK taint effect value. -func TaintEffectToSDK(effect infrav1exp.TaintEffect) (string, error) { +func TaintEffectToSDK(effect expinfrav1.TaintEffect) (string, error) { switch effect { - case infrav1exp.TaintEffectNoExecute: + case expinfrav1.TaintEffectNoExecute: return eks.TaintEffectNoExecute, nil - case infrav1exp.TaintEffectPreferNoSchedule: + case expinfrav1.TaintEffectPreferNoSchedule: return eks.TaintEffectPreferNoSchedule, nil - case infrav1exp.TaintEffectNoSchedule: + case expinfrav1.TaintEffectNoSchedule: return eks.TaintEffectNoSchedule, nil default: return "", ErrUnknowTaintEffect @@ -133,14 +133,14 @@ func TaintEffectToSDK(effect infrav1exp.TaintEffect) (string, error) { } // TaintEffectFromSDK is used to convert a AWS SDK taint effect value to a TaintEffect. -func TaintEffectFromSDK(effect string) (infrav1exp.TaintEffect, error) { +func TaintEffectFromSDK(effect string) (expinfrav1.TaintEffect, error) { switch effect { case eks.TaintEffectNoExecute: - return infrav1exp.TaintEffectNoExecute, nil + return expinfrav1.TaintEffectNoExecute, nil case eks.TaintEffectPreferNoSchedule: - return infrav1exp.TaintEffectPreferNoSchedule, nil + return expinfrav1.TaintEffectPreferNoSchedule, nil case eks.TaintEffectNoSchedule: - return infrav1exp.TaintEffectNoSchedule, nil + return expinfrav1.TaintEffectNoSchedule, nil default: return "", ErrUnknowTaintEffect } @@ -165,11 +165,11 @@ func ConvertSDKToIdentityProvider(in *ekscontrolplanev1.OIDCIdentityProviderConf } // CapacityTypeToSDK is used to convert a CapacityType to the AWS SDK capacity type value. -func CapacityTypeToSDK(capacityType infrav1exp.ManagedMachinePoolCapacityType) (string, error) { +func CapacityTypeToSDK(capacityType expinfrav1.ManagedMachinePoolCapacityType) (string, error) { switch capacityType { - case infrav1exp.ManagedMachinePoolCapacityTypeOnDemand: + case expinfrav1.ManagedMachinePoolCapacityTypeOnDemand: return eks.CapacityTypesOnDemand, nil - case infrav1exp.ManagedMachinePoolCapacityTypeSpot: + case expinfrav1.ManagedMachinePoolCapacityTypeSpot: return eks.CapacityTypesSpot, nil default: return "", ErrUnknownCapacityType diff --git a/pkg/cloud/converters/tags.go b/pkg/cloud/converters/tags.go index 863d4add9f..c4e34ceb2c 100644 --- a/pkg/cloud/converters/tags.go +++ b/pkg/cloud/converters/tags.go @@ -23,7 +23,7 @@ import ( "github.com/aws/aws-sdk-go/service/elb" "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/aws/aws-sdk-go/service/ssm" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ) // TagsToMap converts a []*ec2.Tag into a infrav1.Tags. diff --git a/pkg/cloud/filter/ec2.go b/pkg/cloud/filter/ec2.go index 5da3d6ee99..3df19f1ce6 100644 --- a/pkg/cloud/filter/ec2.go +++ b/pkg/cloud/filter/ec2.go @@ -21,7 +21,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ) const ( diff --git a/pkg/cloud/identity/identity.go b/pkg/cloud/identity/identity.go index 5a270b6d0d..832dc4775d 100644 --- a/pkg/cloud/identity/identity.go +++ b/pkg/cloud/identity/identity.go @@ -29,7 +29,7 @@ import ( "github.com/aws/aws-sdk-go/service/sts/stsiface" "github.com/go-logr/logr" corev1 "k8s.io/api/core/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ) // AWSPrincipalTypeProvider defines the interface for AWS Principal Type Provider. diff --git a/pkg/cloud/identity/identity_test.go b/pkg/cloud/identity/identity_test.go index 090ea70512..5b6ae53419 100644 --- a/pkg/cloud/identity/identity_test.go +++ b/pkg/cloud/identity/identity_test.go @@ -30,7 +30,7 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/sts/mock_stsiface" ) diff --git a/pkg/cloud/interfaces.go b/pkg/cloud/interfaces.go index 49d4fd5c0f..5974f07b81 100644 --- a/pkg/cloud/interfaces.go +++ b/pkg/cloud/interfaces.go @@ -19,9 +19,9 @@ package cloud import ( awsclient "github.com/aws/aws-sdk-go/aws/client" "github.com/go-logr/logr" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/throttle" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/pkg/cloud/scope/cluster.go b/pkg/cloud/scope/cluster.go index 6e71d1edf3..315be60b9c 100644 --- a/pkg/cloud/scope/cluster.go +++ b/pkg/cloud/scope/cluster.go @@ -24,10 +24,10 @@ import ( "github.com/go-logr/logr" "github.com/pkg/errors" "k8s.io/klog/v2/klogr" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/throttle" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/pkg/cloud/scope/ec2.go b/pkg/cloud/scope/ec2.go index de552fe27d..431a526f59 100644 --- a/pkg/cloud/scope/ec2.go +++ b/pkg/cloud/scope/ec2.go @@ -17,7 +17,7 @@ limitations under the License. package scope import ( - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud" ) diff --git a/pkg/cloud/scope/elb.go b/pkg/cloud/scope/elb.go index 9bab1dd638..00474adf0c 100644 --- a/pkg/cloud/scope/elb.go +++ b/pkg/cloud/scope/elb.go @@ -17,7 +17,7 @@ limitations under the License. package scope import ( - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud" ) diff --git a/pkg/cloud/scope/fargate.go b/pkg/cloud/scope/fargate.go index 39a42e4c2f..6d41804aa6 100644 --- a/pkg/cloud/scope/fargate.go +++ b/pkg/cloud/scope/fargate.go @@ -25,14 +25,14 @@ import ( "k8s.io/klog/v2/klogr" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/throttle" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/controller-runtime/pkg/client" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - controlplanev1exp "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud" ) @@ -41,8 +41,8 @@ type FargateProfileScopeParams struct { Client client.Client Logger logr.Logger Cluster *clusterv1.Cluster - ControlPlane *controlplanev1exp.AWSManagedControlPlane - FargateProfile *infrav1exp.AWSFargateProfile + ControlPlane *ekscontrolplanev1.AWSManagedControlPlane + FargateProfile *expinfrav1.AWSFargateProfile ControllerName string Endpoints []ServiceEndpoint Session awsclient.ConfigProvider @@ -99,8 +99,8 @@ type FargateProfileScope struct { patchHelper *patch.Helper Cluster *clusterv1.Cluster - ControlPlane *controlplanev1exp.AWSManagedControlPlane - FargateProfile *infrav1exp.AWSFargateProfile + ControlPlane *ekscontrolplanev1.AWSManagedControlPlane + FargateProfile *expinfrav1.AWSFargateProfile session awsclient.ConfigProvider serviceLimiters throttle.ServiceLimiters @@ -166,7 +166,7 @@ func (s *FargateProfileScope) IAMReadyFalse(reason string, err string) error { } conditions.MarkFalse( s.FargateProfile, - infrav1exp.IAMFargateRolesReadyCondition, + expinfrav1.IAMFargateRolesReadyCondition, reason, severity, err, @@ -183,10 +183,10 @@ func (s *FargateProfileScope) PatchObject() error { context.TODO(), s.FargateProfile, patch.WithOwnedConditions{Conditions: []clusterv1.ConditionType{ - infrav1exp.EKSFargateProfileReadyCondition, - infrav1exp.EKSFargateCreatingCondition, - infrav1exp.EKSFargateDeletingCondition, - infrav1exp.IAMFargateRolesReadyCondition, + expinfrav1.EKSFargateProfileReadyCondition, + expinfrav1.EKSFargateCreatingCondition, + expinfrav1.EKSFargateDeletingCondition, + expinfrav1.IAMFargateRolesReadyCondition, }}) } diff --git a/pkg/cloud/scope/machine.go b/pkg/cloud/scope/machine.go index da530d1707..4038e35eab 100644 --- a/pkg/cloud/scope/machine.go +++ b/pkg/cloud/scope/machine.go @@ -27,8 +27,8 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/klog/v2/klogr" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/noderefutil" capierrors "sigs.k8s.io/cluster-api/errors" "sigs.k8s.io/cluster-api/util" diff --git a/pkg/cloud/scope/machine_test.go b/pkg/cloud/scope/machine_test.go index 369194279a..6743c59609 100644 --- a/pkg/cloud/scope/machine_test.go +++ b/pkg/cloud/scope/machine_test.go @@ -26,8 +26,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) diff --git a/pkg/cloud/scope/machinepool.go b/pkg/cloud/scope/machinepool.go index d70743d39e..ac0e146420 100644 --- a/pkg/cloud/scope/machinepool.go +++ b/pkg/cloud/scope/machinepool.go @@ -28,12 +28,12 @@ import ( "k8s.io/apimachinery/pkg/types" "k8s.io/klog/v2/klogr" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" capierrors "sigs.k8s.io/cluster-api/errors" - expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/pkg/cloud/scope/managedcontrolplane.go b/pkg/cloud/scope/managedcontrolplane.go index a3f4db5012..cbbf9d2340 100644 --- a/pkg/cloud/scope/managedcontrolplane.go +++ b/pkg/cloud/scope/managedcontrolplane.go @@ -30,13 +30,13 @@ import ( amazoncni "github.com/aws/amazon-vpc-cni-k8s/pkg/apis/crd/v1alpha1" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/controller-runtime/pkg/client" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud" ) diff --git a/pkg/cloud/scope/managednodegroup.go b/pkg/cloud/scope/managednodegroup.go index a4c7bda8ed..1c45a4d64e 100644 --- a/pkg/cloud/scope/managednodegroup.go +++ b/pkg/cloud/scope/managednodegroup.go @@ -26,15 +26,15 @@ import ( "k8s.io/klog/v2/klogr" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/throttle" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/controller-runtime/pkg/client" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - controlplanev1exp "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud" ) @@ -43,9 +43,9 @@ type ManagedMachinePoolScopeParams struct { Client client.Client Logger logr.Logger Cluster *clusterv1.Cluster - ControlPlane *controlplanev1exp.AWSManagedControlPlane - ManagedMachinePool *infrav1exp.AWSManagedMachinePool - MachinePool *clusterv1exp.MachinePool + ControlPlane *ekscontrolplanev1.AWSManagedControlPlane + ManagedMachinePool *expinfrav1.AWSManagedMachinePool + MachinePool *expclusterv1.MachinePool ControllerName string Endpoints []ServiceEndpoint Session awsclient.ConfigProvider @@ -110,9 +110,9 @@ type ManagedMachinePoolScope struct { patchHelper *patch.Helper Cluster *clusterv1.Cluster - ControlPlane *controlplanev1exp.AWSManagedControlPlane - ManagedMachinePool *infrav1exp.AWSManagedMachinePool - MachinePool *clusterv1exp.MachinePool + ControlPlane *ekscontrolplanev1.AWSManagedControlPlane + ManagedMachinePool *expinfrav1.AWSManagedMachinePool + MachinePool *expclusterv1.MachinePool session awsclient.ConfigProvider serviceLimiters throttle.ServiceLimiters @@ -204,7 +204,7 @@ func (s *ManagedMachinePoolScope) NodegroupReadyFalse(reason string, err string) } conditions.MarkFalse( s.ManagedMachinePool, - infrav1exp.EKSNodegroupReadyCondition, + expinfrav1.EKSNodegroupReadyCondition, reason, severity, err, @@ -224,7 +224,7 @@ func (s *ManagedMachinePoolScope) IAMReadyFalse(reason string, err string) error } conditions.MarkFalse( s.ManagedMachinePool, - infrav1exp.IAMNodegroupRolesReadyCondition, + expinfrav1.IAMNodegroupRolesReadyCondition, reason, severity, err, @@ -241,8 +241,8 @@ func (s *ManagedMachinePoolScope) PatchObject() error { context.TODO(), s.ManagedMachinePool, patch.WithOwnedConditions{Conditions: []clusterv1.ConditionType{ - infrav1exp.EKSNodegroupReadyCondition, - infrav1exp.IAMNodegroupRolesReadyCondition, + expinfrav1.EKSNodegroupReadyCondition, + expinfrav1.IAMNodegroupRolesReadyCondition, }}) } diff --git a/pkg/cloud/scope/session.go b/pkg/cloud/scope/session.go index b9b59b0659..0449f70610 100644 --- a/pkg/cloud/scope/session.go +++ b/pkg/cloud/scope/session.go @@ -34,12 +34,12 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/identity" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/throttle" "sigs.k8s.io/cluster-api-provider-aws/util/system" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" diff --git a/pkg/cloud/scope/session_test.go b/pkg/cloud/scope/session_test.go index 5496129519..929b303cc4 100644 --- a/pkg/cloud/scope/session_test.go +++ b/pkg/cloud/scope/session_test.go @@ -28,10 +28,10 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/klog/v2/klogr" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/identity" "sigs.k8s.io/cluster-api-provider-aws/util/system" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) diff --git a/pkg/cloud/scope/shared.go b/pkg/cloud/scope/shared.go index dfbd0cec97..caac5e5375 100644 --- a/pkg/cloud/scope/shared.go +++ b/pkg/cloud/scope/shared.go @@ -22,7 +22,7 @@ import ( "github.com/go-logr/logr" "github.com/pkg/errors" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ) var ( diff --git a/pkg/cloud/scope/shared_test.go b/pkg/cloud/scope/shared_test.go index f0b2e6e3e7..e852dca053 100644 --- a/pkg/cloud/scope/shared_test.go +++ b/pkg/cloud/scope/shared_test.go @@ -24,7 +24,7 @@ import ( "k8s.io/klog/v2/klogr" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ) func TestSubnetPlacement(t *testing.T) { diff --git a/pkg/cloud/services/autoscaling/autoscalinggroup.go b/pkg/cloud/services/autoscaling/autoscalinggroup.go index 4b2d38d2c5..41a173c4bb 100644 --- a/pkg/cloud/services/autoscaling/autoscalinggroup.go +++ b/pkg/cloud/services/autoscaling/autoscalinggroup.go @@ -24,8 +24,8 @@ import ( "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/pkg/errors" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" diff --git a/pkg/cloud/services/autoscaling/autoscalinggroup_test.go b/pkg/cloud/services/autoscaling/autoscalinggroup_test.go index eb0a5f7464..4a91b5ba81 100644 --- a/pkg/cloud/services/autoscaling/autoscalinggroup_test.go +++ b/pkg/cloud/services/autoscaling/autoscalinggroup_test.go @@ -26,12 +26,12 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/golang/mock/gomock" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/autoscaling/mock_autoscalingiface" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestService_GetASGByName(t *testing.T) { diff --git a/pkg/cloud/services/awsnode/cni.go b/pkg/cloud/services/awsnode/cni.go index 1b44226ab2..c81262cad9 100644 --- a/pkg/cloud/services/awsnode/cni.go +++ b/pkg/cloud/services/awsnode/cni.go @@ -30,7 +30,7 @@ import ( "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/record" ) diff --git a/pkg/cloud/services/awsnode/service.go b/pkg/cloud/services/awsnode/service.go index e0593122f0..8b62852eeb 100644 --- a/pkg/cloud/services/awsnode/service.go +++ b/pkg/cloud/services/awsnode/service.go @@ -19,7 +19,7 @@ package awsnode import ( "sigs.k8s.io/controller-runtime/pkg/client" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud" ) diff --git a/pkg/cloud/services/awsnode/subnets.go b/pkg/cloud/services/awsnode/subnets.go index e87dede5e8..6fe07236b6 100644 --- a/pkg/cloud/services/awsnode/subnets.go +++ b/pkg/cloud/services/awsnode/subnets.go @@ -16,13 +16,15 @@ limitations under the License. package awsnode -import "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" +import ( + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" +) -func (s *Service) secondarySubnets() []*v1alpha4.SubnetSpec { - subnets := []*v1alpha4.SubnetSpec{} +func (s *Service) secondarySubnets() []*infrav1.SubnetSpec { + subnets := []*infrav1.SubnetSpec{} for _, sub := range s.scope.Subnets() { subnet := sub.DeepCopy() - if val, ok := subnet.Tags[v1alpha4.NameAWSSubnetAssociation]; ok && val == v1alpha4.SecondarySubnetTagValue { + if val, ok := subnet.Tags[infrav1.NameAWSSubnetAssociation]; ok && val == infrav1.SecondarySubnetTagValue { subnets = append(subnets, subnet) } } diff --git a/pkg/cloud/services/ec2/ami.go b/pkg/cloud/services/ec2/ami.go index f395486569..99d21c1776 100644 --- a/pkg/cloud/services/ec2/ami.go +++ b/pkg/cloud/services/ec2/ami.go @@ -24,7 +24,7 @@ import ( "text/template" "time" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" @@ -229,7 +229,7 @@ func (s *Service) defaultBastionAMILookup(region string) string { } } -func (s *Service) eksAMILookup(kubernetesVersion string, amiType *v1alpha4.EKSAMILookupType) (string, error) { +func (s *Service) eksAMILookup(kubernetesVersion string, amiType *infrav1.EKSAMILookupType) (string, error) { // format ssm parameter path properly formattedVersion, err := formatVersionForEKS(kubernetesVersion) if err != nil { @@ -239,11 +239,11 @@ func (s *Service) eksAMILookup(kubernetesVersion string, amiType *v1alpha4.EKSAM var paramName string if amiType == nil { - amiType = new(v1alpha4.EKSAMILookupType) + amiType = new(infrav1.EKSAMILookupType) } switch *amiType { - case v1alpha4.AmazonLinuxGPU: + case infrav1.AmazonLinuxGPU: paramName = fmt.Sprintf(eksGPUAmiSSMParameterFormat, formattedVersion) default: paramName = fmt.Sprintf(eksAmiSSMParameterFormat, formattedVersion) diff --git a/pkg/cloud/services/ec2/ami_test.go b/pkg/cloud/services/ec2/ami_test.go index 9852c07241..e82dbacff9 100644 --- a/pkg/cloud/services/ec2/ami_test.go +++ b/pkg/cloud/services/ec2/ami_test.go @@ -26,10 +26,10 @@ import ( "github.com/golang/mock/gomock" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2/mock_ec2iface" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) diff --git a/pkg/cloud/services/ec2/bastion.go b/pkg/cloud/services/ec2/bastion.go index 248caab470..32eeab3f6b 100644 --- a/pkg/cloud/services/ec2/bastion.go +++ b/pkg/cloud/services/ec2/bastion.go @@ -21,13 +21,13 @@ import ( "fmt" "strings" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/filter" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/userdata" diff --git a/pkg/cloud/services/ec2/bastion_test.go b/pkg/cloud/services/ec2/bastion_test.go index 3f6126f9d1..24894cf2c3 100644 --- a/pkg/cloud/services/ec2/bastion_test.go +++ b/pkg/cloud/services/ec2/bastion_test.go @@ -27,11 +27,11 @@ import ( . "github.com/onsi/gomega" "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/filter" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2/mock_ec2iface" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) diff --git a/pkg/cloud/services/ec2/instances.go b/pkg/cloud/services/ec2/instances.go index cac561ffea..7037e64750 100644 --- a/pkg/cloud/services/ec2/instances.go +++ b/pkg/cloud/services/ec2/instances.go @@ -29,7 +29,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/filter" @@ -37,7 +37,7 @@ import ( "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/userdata" "sigs.k8s.io/cluster-api-provider-aws/pkg/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" capierrors "sigs.k8s.io/cluster-api/errors" ) diff --git a/pkg/cloud/services/ec2/instances_test.go b/pkg/cloud/services/ec2/instances_test.go index 9330ef513e..99432542a1 100644 --- a/pkg/cloud/services/ec2/instances_test.go +++ b/pkg/cloud/services/ec2/instances_test.go @@ -31,13 +31,13 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/filter" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2/mock_ec2iface" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/userdata" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) diff --git a/pkg/cloud/services/ec2/launchtemplate.go b/pkg/cloud/services/ec2/launchtemplate.go index d235975a7c..6c46a75ef5 100644 --- a/pkg/cloud/services/ec2/launchtemplate.go +++ b/pkg/cloud/services/ec2/launchtemplate.go @@ -27,8 +27,8 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/userdata" diff --git a/pkg/cloud/services/ec2/launchtemplate_test.go b/pkg/cloud/services/ec2/launchtemplate_test.go index 94402b2c4c..a651b7cc20 100644 --- a/pkg/cloud/services/ec2/launchtemplate_test.go +++ b/pkg/cloud/services/ec2/launchtemplate_test.go @@ -29,13 +29,13 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/ec2" "github.com/golang/mock/gomock" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2/mock_ec2iface" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/userdata" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) const ( diff --git a/pkg/cloud/services/ec2/mock_ec2iface/ec2api_mock.go b/pkg/cloud/services/ec2/mock_ec2iface/ec2api_mock.go index e010697d08..c243b9ae57 100644 --- a/pkg/cloud/services/ec2/mock_ec2iface/ec2api_mock.go +++ b/pkg/cloud/services/ec2/mock_ec2iface/ec2api_mock.go @@ -1767,6 +1767,56 @@ func (mr *MockEC2APIMockRecorder) CancelCapacityReservation(arg0 interface{}) *g return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CancelCapacityReservation", reflect.TypeOf((*MockEC2API)(nil).CancelCapacityReservation), arg0) } +// CancelCapacityReservationFleets mocks base method. +func (m *MockEC2API) CancelCapacityReservationFleets(arg0 *ec2.CancelCapacityReservationFleetsInput) (*ec2.CancelCapacityReservationFleetsOutput, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CancelCapacityReservationFleets", arg0) + ret0, _ := ret[0].(*ec2.CancelCapacityReservationFleetsOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CancelCapacityReservationFleets indicates an expected call of CancelCapacityReservationFleets. +func (mr *MockEC2APIMockRecorder) CancelCapacityReservationFleets(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CancelCapacityReservationFleets", reflect.TypeOf((*MockEC2API)(nil).CancelCapacityReservationFleets), arg0) +} + +// CancelCapacityReservationFleetsRequest mocks base method. +func (m *MockEC2API) CancelCapacityReservationFleetsRequest(arg0 *ec2.CancelCapacityReservationFleetsInput) (*request.Request, *ec2.CancelCapacityReservationFleetsOutput) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CancelCapacityReservationFleetsRequest", arg0) + ret0, _ := ret[0].(*request.Request) + ret1, _ := ret[1].(*ec2.CancelCapacityReservationFleetsOutput) + return ret0, ret1 +} + +// CancelCapacityReservationFleetsRequest indicates an expected call of CancelCapacityReservationFleetsRequest. +func (mr *MockEC2APIMockRecorder) CancelCapacityReservationFleetsRequest(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CancelCapacityReservationFleetsRequest", reflect.TypeOf((*MockEC2API)(nil).CancelCapacityReservationFleetsRequest), arg0) +} + +// CancelCapacityReservationFleetsWithContext mocks base method. +func (m *MockEC2API) CancelCapacityReservationFleetsWithContext(arg0 context.Context, arg1 *ec2.CancelCapacityReservationFleetsInput, arg2 ...request.Option) (*ec2.CancelCapacityReservationFleetsOutput, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CancelCapacityReservationFleetsWithContext", varargs...) + ret0, _ := ret[0].(*ec2.CancelCapacityReservationFleetsOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CancelCapacityReservationFleetsWithContext indicates an expected call of CancelCapacityReservationFleetsWithContext. +func (mr *MockEC2APIMockRecorder) CancelCapacityReservationFleetsWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CancelCapacityReservationFleetsWithContext", reflect.TypeOf((*MockEC2API)(nil).CancelCapacityReservationFleetsWithContext), varargs...) +} + // CancelCapacityReservationRequest mocks base method. func (m *MockEC2API) CancelCapacityReservationRequest(arg0 *ec2.CancelCapacityReservationInput) (*request.Request, *ec2.CancelCapacityReservationOutput) { m.ctrl.T.Helper() @@ -2317,6 +2367,56 @@ func (mr *MockEC2APIMockRecorder) CreateCapacityReservation(arg0 interface{}) *g return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateCapacityReservation", reflect.TypeOf((*MockEC2API)(nil).CreateCapacityReservation), arg0) } +// CreateCapacityReservationFleet mocks base method. +func (m *MockEC2API) CreateCapacityReservationFleet(arg0 *ec2.CreateCapacityReservationFleetInput) (*ec2.CreateCapacityReservationFleetOutput, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateCapacityReservationFleet", arg0) + ret0, _ := ret[0].(*ec2.CreateCapacityReservationFleetOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateCapacityReservationFleet indicates an expected call of CreateCapacityReservationFleet. +func (mr *MockEC2APIMockRecorder) CreateCapacityReservationFleet(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateCapacityReservationFleet", reflect.TypeOf((*MockEC2API)(nil).CreateCapacityReservationFleet), arg0) +} + +// CreateCapacityReservationFleetRequest mocks base method. +func (m *MockEC2API) CreateCapacityReservationFleetRequest(arg0 *ec2.CreateCapacityReservationFleetInput) (*request.Request, *ec2.CreateCapacityReservationFleetOutput) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateCapacityReservationFleetRequest", arg0) + ret0, _ := ret[0].(*request.Request) + ret1, _ := ret[1].(*ec2.CreateCapacityReservationFleetOutput) + return ret0, ret1 +} + +// CreateCapacityReservationFleetRequest indicates an expected call of CreateCapacityReservationFleetRequest. +func (mr *MockEC2APIMockRecorder) CreateCapacityReservationFleetRequest(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateCapacityReservationFleetRequest", reflect.TypeOf((*MockEC2API)(nil).CreateCapacityReservationFleetRequest), arg0) +} + +// CreateCapacityReservationFleetWithContext mocks base method. +func (m *MockEC2API) CreateCapacityReservationFleetWithContext(arg0 context.Context, arg1 *ec2.CreateCapacityReservationFleetInput, arg2 ...request.Option) (*ec2.CreateCapacityReservationFleetOutput, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "CreateCapacityReservationFleetWithContext", varargs...) + ret0, _ := ret[0].(*ec2.CreateCapacityReservationFleetOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// CreateCapacityReservationFleetWithContext indicates an expected call of CreateCapacityReservationFleetWithContext. +func (mr *MockEC2APIMockRecorder) CreateCapacityReservationFleetWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateCapacityReservationFleetWithContext", reflect.TypeOf((*MockEC2API)(nil).CreateCapacityReservationFleetWithContext), varargs...) +} + // CreateCapacityReservationRequest mocks base method. func (m *MockEC2API) CreateCapacityReservationRequest(arg0 *ec2.CreateCapacityReservationInput) (*request.Request, *ec2.CreateCapacityReservationOutput) { m.ctrl.T.Helper() @@ -8968,6 +9068,89 @@ func (mr *MockEC2APIMockRecorder) DescribeByoipCidrsWithContext(arg0, arg1 inter return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeByoipCidrsWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeByoipCidrsWithContext), varargs...) } +// DescribeCapacityReservationFleets mocks base method. +func (m *MockEC2API) DescribeCapacityReservationFleets(arg0 *ec2.DescribeCapacityReservationFleetsInput) (*ec2.DescribeCapacityReservationFleetsOutput, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeCapacityReservationFleets", arg0) + ret0, _ := ret[0].(*ec2.DescribeCapacityReservationFleetsOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DescribeCapacityReservationFleets indicates an expected call of DescribeCapacityReservationFleets. +func (mr *MockEC2APIMockRecorder) DescribeCapacityReservationFleets(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeCapacityReservationFleets", reflect.TypeOf((*MockEC2API)(nil).DescribeCapacityReservationFleets), arg0) +} + +// DescribeCapacityReservationFleetsPages mocks base method. +func (m *MockEC2API) DescribeCapacityReservationFleetsPages(arg0 *ec2.DescribeCapacityReservationFleetsInput, arg1 func(*ec2.DescribeCapacityReservationFleetsOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeCapacityReservationFleetsPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeCapacityReservationFleetsPages indicates an expected call of DescribeCapacityReservationFleetsPages. +func (mr *MockEC2APIMockRecorder) DescribeCapacityReservationFleetsPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeCapacityReservationFleetsPages", reflect.TypeOf((*MockEC2API)(nil).DescribeCapacityReservationFleetsPages), arg0, arg1) +} + +// DescribeCapacityReservationFleetsPagesWithContext mocks base method. +func (m *MockEC2API) DescribeCapacityReservationFleetsPagesWithContext(arg0 context.Context, arg1 *ec2.DescribeCapacityReservationFleetsInput, arg2 func(*ec2.DescribeCapacityReservationFleetsOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeCapacityReservationFleetsPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// DescribeCapacityReservationFleetsPagesWithContext indicates an expected call of DescribeCapacityReservationFleetsPagesWithContext. +func (mr *MockEC2APIMockRecorder) DescribeCapacityReservationFleetsPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeCapacityReservationFleetsPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeCapacityReservationFleetsPagesWithContext), varargs...) +} + +// DescribeCapacityReservationFleetsRequest mocks base method. +func (m *MockEC2API) DescribeCapacityReservationFleetsRequest(arg0 *ec2.DescribeCapacityReservationFleetsInput) (*request.Request, *ec2.DescribeCapacityReservationFleetsOutput) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DescribeCapacityReservationFleetsRequest", arg0) + ret0, _ := ret[0].(*request.Request) + ret1, _ := ret[1].(*ec2.DescribeCapacityReservationFleetsOutput) + return ret0, ret1 +} + +// DescribeCapacityReservationFleetsRequest indicates an expected call of DescribeCapacityReservationFleetsRequest. +func (mr *MockEC2APIMockRecorder) DescribeCapacityReservationFleetsRequest(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeCapacityReservationFleetsRequest", reflect.TypeOf((*MockEC2API)(nil).DescribeCapacityReservationFleetsRequest), arg0) +} + +// DescribeCapacityReservationFleetsWithContext mocks base method. +func (m *MockEC2API) DescribeCapacityReservationFleetsWithContext(arg0 context.Context, arg1 *ec2.DescribeCapacityReservationFleetsInput, arg2 ...request.Option) (*ec2.DescribeCapacityReservationFleetsOutput, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DescribeCapacityReservationFleetsWithContext", varargs...) + ret0, _ := ret[0].(*ec2.DescribeCapacityReservationFleetsOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DescribeCapacityReservationFleetsWithContext indicates an expected call of DescribeCapacityReservationFleetsWithContext. +func (mr *MockEC2APIMockRecorder) DescribeCapacityReservationFleetsWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DescribeCapacityReservationFleetsWithContext", reflect.TypeOf((*MockEC2API)(nil).DescribeCapacityReservationFleetsWithContext), varargs...) +} + // DescribeCapacityReservations mocks base method. func (m *MockEC2API) DescribeCapacityReservations(arg0 *ec2.DescribeCapacityReservationsInput) (*ec2.DescribeCapacityReservationsOutput, error) { m.ctrl.T.Helper() @@ -21119,6 +21302,139 @@ func (mr *MockEC2APIMockRecorder) GetTransitGatewayRouteTablePropagationsWithCon return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTransitGatewayRouteTablePropagationsWithContext", reflect.TypeOf((*MockEC2API)(nil).GetTransitGatewayRouteTablePropagationsWithContext), varargs...) } +// GetVpnConnectionDeviceSampleConfiguration mocks base method. +func (m *MockEC2API) GetVpnConnectionDeviceSampleConfiguration(arg0 *ec2.GetVpnConnectionDeviceSampleConfigurationInput) (*ec2.GetVpnConnectionDeviceSampleConfigurationOutput, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetVpnConnectionDeviceSampleConfiguration", arg0) + ret0, _ := ret[0].(*ec2.GetVpnConnectionDeviceSampleConfigurationOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetVpnConnectionDeviceSampleConfiguration indicates an expected call of GetVpnConnectionDeviceSampleConfiguration. +func (mr *MockEC2APIMockRecorder) GetVpnConnectionDeviceSampleConfiguration(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVpnConnectionDeviceSampleConfiguration", reflect.TypeOf((*MockEC2API)(nil).GetVpnConnectionDeviceSampleConfiguration), arg0) +} + +// GetVpnConnectionDeviceSampleConfigurationRequest mocks base method. +func (m *MockEC2API) GetVpnConnectionDeviceSampleConfigurationRequest(arg0 *ec2.GetVpnConnectionDeviceSampleConfigurationInput) (*request.Request, *ec2.GetVpnConnectionDeviceSampleConfigurationOutput) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetVpnConnectionDeviceSampleConfigurationRequest", arg0) + ret0, _ := ret[0].(*request.Request) + ret1, _ := ret[1].(*ec2.GetVpnConnectionDeviceSampleConfigurationOutput) + return ret0, ret1 +} + +// GetVpnConnectionDeviceSampleConfigurationRequest indicates an expected call of GetVpnConnectionDeviceSampleConfigurationRequest. +func (mr *MockEC2APIMockRecorder) GetVpnConnectionDeviceSampleConfigurationRequest(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVpnConnectionDeviceSampleConfigurationRequest", reflect.TypeOf((*MockEC2API)(nil).GetVpnConnectionDeviceSampleConfigurationRequest), arg0) +} + +// GetVpnConnectionDeviceSampleConfigurationWithContext mocks base method. +func (m *MockEC2API) GetVpnConnectionDeviceSampleConfigurationWithContext(arg0 context.Context, arg1 *ec2.GetVpnConnectionDeviceSampleConfigurationInput, arg2 ...request.Option) (*ec2.GetVpnConnectionDeviceSampleConfigurationOutput, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetVpnConnectionDeviceSampleConfigurationWithContext", varargs...) + ret0, _ := ret[0].(*ec2.GetVpnConnectionDeviceSampleConfigurationOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetVpnConnectionDeviceSampleConfigurationWithContext indicates an expected call of GetVpnConnectionDeviceSampleConfigurationWithContext. +func (mr *MockEC2APIMockRecorder) GetVpnConnectionDeviceSampleConfigurationWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVpnConnectionDeviceSampleConfigurationWithContext", reflect.TypeOf((*MockEC2API)(nil).GetVpnConnectionDeviceSampleConfigurationWithContext), varargs...) +} + +// GetVpnConnectionDeviceTypes mocks base method. +func (m *MockEC2API) GetVpnConnectionDeviceTypes(arg0 *ec2.GetVpnConnectionDeviceTypesInput) (*ec2.GetVpnConnectionDeviceTypesOutput, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetVpnConnectionDeviceTypes", arg0) + ret0, _ := ret[0].(*ec2.GetVpnConnectionDeviceTypesOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetVpnConnectionDeviceTypes indicates an expected call of GetVpnConnectionDeviceTypes. +func (mr *MockEC2APIMockRecorder) GetVpnConnectionDeviceTypes(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVpnConnectionDeviceTypes", reflect.TypeOf((*MockEC2API)(nil).GetVpnConnectionDeviceTypes), arg0) +} + +// GetVpnConnectionDeviceTypesPages mocks base method. +func (m *MockEC2API) GetVpnConnectionDeviceTypesPages(arg0 *ec2.GetVpnConnectionDeviceTypesInput, arg1 func(*ec2.GetVpnConnectionDeviceTypesOutput, bool) bool) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetVpnConnectionDeviceTypesPages", arg0, arg1) + ret0, _ := ret[0].(error) + return ret0 +} + +// GetVpnConnectionDeviceTypesPages indicates an expected call of GetVpnConnectionDeviceTypesPages. +func (mr *MockEC2APIMockRecorder) GetVpnConnectionDeviceTypesPages(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVpnConnectionDeviceTypesPages", reflect.TypeOf((*MockEC2API)(nil).GetVpnConnectionDeviceTypesPages), arg0, arg1) +} + +// GetVpnConnectionDeviceTypesPagesWithContext mocks base method. +func (m *MockEC2API) GetVpnConnectionDeviceTypesPagesWithContext(arg0 context.Context, arg1 *ec2.GetVpnConnectionDeviceTypesInput, arg2 func(*ec2.GetVpnConnectionDeviceTypesOutput, bool) bool, arg3 ...request.Option) error { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1, arg2} + for _, a := range arg3 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetVpnConnectionDeviceTypesPagesWithContext", varargs...) + ret0, _ := ret[0].(error) + return ret0 +} + +// GetVpnConnectionDeviceTypesPagesWithContext indicates an expected call of GetVpnConnectionDeviceTypesPagesWithContext. +func (mr *MockEC2APIMockRecorder) GetVpnConnectionDeviceTypesPagesWithContext(arg0, arg1, arg2 interface{}, arg3 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1, arg2}, arg3...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVpnConnectionDeviceTypesPagesWithContext", reflect.TypeOf((*MockEC2API)(nil).GetVpnConnectionDeviceTypesPagesWithContext), varargs...) +} + +// GetVpnConnectionDeviceTypesRequest mocks base method. +func (m *MockEC2API) GetVpnConnectionDeviceTypesRequest(arg0 *ec2.GetVpnConnectionDeviceTypesInput) (*request.Request, *ec2.GetVpnConnectionDeviceTypesOutput) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetVpnConnectionDeviceTypesRequest", arg0) + ret0, _ := ret[0].(*request.Request) + ret1, _ := ret[1].(*ec2.GetVpnConnectionDeviceTypesOutput) + return ret0, ret1 +} + +// GetVpnConnectionDeviceTypesRequest indicates an expected call of GetVpnConnectionDeviceTypesRequest. +func (mr *MockEC2APIMockRecorder) GetVpnConnectionDeviceTypesRequest(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVpnConnectionDeviceTypesRequest", reflect.TypeOf((*MockEC2API)(nil).GetVpnConnectionDeviceTypesRequest), arg0) +} + +// GetVpnConnectionDeviceTypesWithContext mocks base method. +func (m *MockEC2API) GetVpnConnectionDeviceTypesWithContext(arg0 context.Context, arg1 *ec2.GetVpnConnectionDeviceTypesInput, arg2 ...request.Option) (*ec2.GetVpnConnectionDeviceTypesOutput, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetVpnConnectionDeviceTypesWithContext", varargs...) + ret0, _ := ret[0].(*ec2.GetVpnConnectionDeviceTypesOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetVpnConnectionDeviceTypesWithContext indicates an expected call of GetVpnConnectionDeviceTypesWithContext. +func (mr *MockEC2APIMockRecorder) GetVpnConnectionDeviceTypesWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVpnConnectionDeviceTypesWithContext", reflect.TypeOf((*MockEC2API)(nil).GetVpnConnectionDeviceTypesWithContext), varargs...) +} + // ImportClientVpnClientCertificateRevocationList mocks base method. func (m *MockEC2API) ImportClientVpnClientCertificateRevocationList(arg0 *ec2.ImportClientVpnClientCertificateRevocationListInput) (*ec2.ImportClientVpnClientCertificateRevocationListOutput, error) { m.ctrl.T.Helper() @@ -21534,6 +21850,56 @@ func (mr *MockEC2APIMockRecorder) ModifyCapacityReservation(arg0 interface{}) *g return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ModifyCapacityReservation", reflect.TypeOf((*MockEC2API)(nil).ModifyCapacityReservation), arg0) } +// ModifyCapacityReservationFleet mocks base method. +func (m *MockEC2API) ModifyCapacityReservationFleet(arg0 *ec2.ModifyCapacityReservationFleetInput) (*ec2.ModifyCapacityReservationFleetOutput, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ModifyCapacityReservationFleet", arg0) + ret0, _ := ret[0].(*ec2.ModifyCapacityReservationFleetOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ModifyCapacityReservationFleet indicates an expected call of ModifyCapacityReservationFleet. +func (mr *MockEC2APIMockRecorder) ModifyCapacityReservationFleet(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ModifyCapacityReservationFleet", reflect.TypeOf((*MockEC2API)(nil).ModifyCapacityReservationFleet), arg0) +} + +// ModifyCapacityReservationFleetRequest mocks base method. +func (m *MockEC2API) ModifyCapacityReservationFleetRequest(arg0 *ec2.ModifyCapacityReservationFleetInput) (*request.Request, *ec2.ModifyCapacityReservationFleetOutput) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ModifyCapacityReservationFleetRequest", arg0) + ret0, _ := ret[0].(*request.Request) + ret1, _ := ret[1].(*ec2.ModifyCapacityReservationFleetOutput) + return ret0, ret1 +} + +// ModifyCapacityReservationFleetRequest indicates an expected call of ModifyCapacityReservationFleetRequest. +func (mr *MockEC2APIMockRecorder) ModifyCapacityReservationFleetRequest(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ModifyCapacityReservationFleetRequest", reflect.TypeOf((*MockEC2API)(nil).ModifyCapacityReservationFleetRequest), arg0) +} + +// ModifyCapacityReservationFleetWithContext mocks base method. +func (m *MockEC2API) ModifyCapacityReservationFleetWithContext(arg0 context.Context, arg1 *ec2.ModifyCapacityReservationFleetInput, arg2 ...request.Option) (*ec2.ModifyCapacityReservationFleetOutput, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "ModifyCapacityReservationFleetWithContext", varargs...) + ret0, _ := ret[0].(*ec2.ModifyCapacityReservationFleetOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ModifyCapacityReservationFleetWithContext indicates an expected call of ModifyCapacityReservationFleetWithContext. +func (mr *MockEC2APIMockRecorder) ModifyCapacityReservationFleetWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ModifyCapacityReservationFleetWithContext", reflect.TypeOf((*MockEC2API)(nil).ModifyCapacityReservationFleetWithContext), varargs...) +} + // ModifyCapacityReservationRequest mocks base method. func (m *MockEC2API) ModifyCapacityReservationRequest(arg0 *ec2.ModifyCapacityReservationInput) (*request.Request, *ec2.ModifyCapacityReservationOutput) { m.ctrl.T.Helper() diff --git a/pkg/cloud/services/eks/addons.go b/pkg/cloud/services/eks/addons.go index 2d276c152d..101ed81493 100644 --- a/pkg/cloud/services/eks/addons.go +++ b/pkg/cloud/services/eks/addons.go @@ -23,8 +23,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eks" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/converters" eksaddons "sigs.k8s.io/cluster-api-provider-aws/pkg/eks/addons" "sigs.k8s.io/cluster-api-provider-aws/pkg/record" diff --git a/pkg/cloud/services/eks/cluster.go b/pkg/cloud/services/eks/cluster.go index 1e26543697..18baa77c54 100644 --- a/pkg/cloud/services/eks/cluster.go +++ b/pkg/cloud/services/eks/cluster.go @@ -38,11 +38,11 @@ import ( "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/wait" "sigs.k8s.io/cluster-api-provider-aws/pkg/internal/tristate" "sigs.k8s.io/cluster-api-provider-aws/pkg/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" ) func (s *Service) reconcileCluster(ctx context.Context) error { @@ -143,12 +143,12 @@ func (s *Service) setStatus(cluster *eks.Cluster) error { case eks.ClusterStatusActive: s.scope.ControlPlane.Status.Ready = true s.scope.ControlPlane.Status.FailureMessage = nil - if conditions.IsTrue(s.scope.ControlPlane, controlplanev1.EKSControlPlaneCreatingCondition) { + if conditions.IsTrue(s.scope.ControlPlane, ekscontrolplanev1.EKSControlPlaneCreatingCondition) { record.Eventf(s.scope.ControlPlane, "SuccessfulCreateEKSControlPlane", "Created new EKS control plane %s", s.scope.KubernetesClusterName()) - conditions.MarkFalse(s.scope.ControlPlane, controlplanev1.EKSControlPlaneCreatingCondition, "created", clusterv1.ConditionSeverityInfo, "") + conditions.MarkFalse(s.scope.ControlPlane, ekscontrolplanev1.EKSControlPlaneCreatingCondition, "created", clusterv1.ConditionSeverityInfo, "") } - if conditions.IsTrue(s.scope.ControlPlane, controlplanev1.EKSControlPlaneUpdatingCondition) { - conditions.MarkFalse(s.scope.ControlPlane, controlplanev1.EKSControlPlaneUpdatingCondition, "updated", clusterv1.ConditionSeverityInfo, "") + if conditions.IsTrue(s.scope.ControlPlane, ekscontrolplanev1.EKSControlPlaneUpdatingCondition) { + conditions.MarkFalse(s.scope.ControlPlane, ekscontrolplanev1.EKSControlPlaneUpdatingCondition, "updated", clusterv1.ConditionSeverityInfo, "") record.Eventf(s.scope.ControlPlane, "SuccessfulUpdateEKSControlPlane", "Updated EKS control plane %s", s.scope.KubernetesClusterName()) } // TODO FailureReason @@ -219,7 +219,7 @@ func (s *Service) deleteClusterAndWait(cluster *eks.Cluster) error { return nil } -func makeEksEncryptionConfigs(encryptionConfig *controlplanev1.EncryptionConfig) []*eks.EncryptionConfig { +func makeEksEncryptionConfigs(encryptionConfig *ekscontrolplanev1.EncryptionConfig) []*eks.EncryptionConfig { cfg := []*eks.EncryptionConfig{} if encryptionConfig == nil { @@ -241,7 +241,7 @@ func makeEksEncryptionConfigs(encryptionConfig *controlplanev1.EncryptionConfig) }) } -func makeVpcConfig(subnets infrav1.Subnets, endpointAccess controlplanev1.EndpointAccess, securityGroups map[infrav1.SecurityGroupRole]infrav1.SecurityGroup) (*eks.VpcConfigRequest, error) { +func makeVpcConfig(subnets infrav1.Subnets, endpointAccess ekscontrolplanev1.EndpointAccess, securityGroups map[infrav1.SecurityGroupRole]infrav1.SecurityGroup) (*eks.VpcConfigRequest, error) { // TODO: Do we need to just add the private subnets? if len(subnets) < 2 { return nil, awserrors.NewFailedDependency("at least 2 subnets is required") @@ -284,7 +284,7 @@ func makeVpcConfig(subnets infrav1.Subnets, endpointAccess controlplanev1.Endpoi return vpcConfig, nil } -func makeEksLogging(loggingSpec *controlplanev1.ControlPlaneLoggingSpec) *eks.Logging { +func makeEksLogging(loggingSpec *ekscontrolplanev1.ControlPlaneLoggingSpec) *eks.Logging { if loggingSpec == nil { return nil } @@ -373,7 +373,7 @@ func (s *Service) createCluster(eksClusterName string) (*eks.Cluster, error) { } return false, err } - conditions.MarkTrue(s.scope.ControlPlane, controlplanev1.EKSControlPlaneCreatingCondition) + conditions.MarkTrue(s.scope.ControlPlane, ekscontrolplanev1.EKSControlPlaneCreatingCondition) record.Eventf(s.scope.ControlPlane, "InitiatedCreateEKSControlPlane", "Initiated creation of a new EKS control plane %s", s.scope.KubernetesClusterName()) return true, nil }, awserrors.ResourceNotFound); err != nil { //TODO: change the error that can be retried @@ -437,7 +437,7 @@ func (s *Service) reconcileClusterConfig(cluster *eks.Cluster) error { } return false, err } - conditions.MarkTrue(s.scope.ControlPlane, controlplanev1.EKSControlPlaneUpdatingCondition) + conditions.MarkTrue(s.scope.ControlPlane, ekscontrolplanev1.EKSControlPlaneUpdatingCondition) record.Eventf(s.scope.ControlPlane, "InitiatedUpdateEKSControlPlane", "Initiated update of a new EKS control plane %s", s.scope.KubernetesClusterName()) return true, nil }); err != nil { @@ -560,7 +560,7 @@ func (s *Service) reconcileClusterVersion(cluster *eks.Cluster) error { return false, err } - conditions.MarkTrue(s.scope.ControlPlane, controlplanev1.EKSControlPlaneUpdatingCondition) + conditions.MarkTrue(s.scope.ControlPlane, ekscontrolplanev1.EKSControlPlaneUpdatingCondition) record.Eventf(s.scope.ControlPlane, "InitiatedUpdateEKSControlPlane", "Initiated update of EKS control plane %s to version %s", s.scope.KubernetesClusterName(), nextVersionString) return true, nil @@ -617,7 +617,7 @@ func (s *Service) updateEncryptionConfig(updatedEncryptionConfigs []*eks.Encrypt return false, err } - conditions.MarkTrue(s.scope.ControlPlane, controlplanev1.EKSControlPlaneUpdatingCondition) + conditions.MarkTrue(s.scope.ControlPlane, ekscontrolplanev1.EKSControlPlaneUpdatingCondition) record.Eventf(s.scope.ControlPlane, "InitiatedUpdateEncryptionConfig", "Initiated update of encryption config in EKS control plane %s", s.scope.KubernetesClusterName()) return true, nil diff --git a/pkg/cloud/services/eks/cluster_test.go b/pkg/cloud/services/eks/cluster_test.go index 212be2cf71..010faaa400 100644 --- a/pkg/cloud/services/eks/cluster_test.go +++ b/pkg/cloud/services/eks/cluster_test.go @@ -30,11 +30,11 @@ import ( "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/version" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/eks/mock_eksiface" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestMakeEksEncryptionConfigs(t *testing.T) { diff --git a/pkg/cloud/services/eks/config.go b/pkg/cloud/services/eks/config.go index a56167a7a7..775d2b63e5 100644 --- a/pkg/cloud/services/eks/config.go +++ b/pkg/cloud/services/eks/config.go @@ -36,7 +36,7 @@ import ( "sigs.k8s.io/cluster-api/util/kubeconfig" "sigs.k8s.io/cluster-api/util/secret" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/record" ) diff --git a/pkg/cloud/services/eks/eks.go b/pkg/cloud/services/eks/eks.go index 757a19f1f1..60eedd3dfb 100644 --- a/pkg/cloud/services/eks/eks.go +++ b/pkg/cloud/services/eks/eks.go @@ -20,11 +20,11 @@ import ( "context" "github.com/pkg/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/record" ) @@ -95,26 +95,26 @@ func (s *NodegroupService) ReconcilePool() error { if err := s.reconcileNodegroupIAMRole(); err != nil { conditions.MarkFalse( s.scope.ManagedMachinePool, - infrav1exp.IAMNodegroupRolesReadyCondition, - infrav1exp.IAMNodegroupRolesReconciliationFailedReason, + expinfrav1.IAMNodegroupRolesReadyCondition, + expinfrav1.IAMNodegroupRolesReconciliationFailedReason, clusterv1.ConditionSeverityError, err.Error(), ) return err } - conditions.MarkTrue(s.scope.ManagedMachinePool, infrav1exp.IAMNodegroupRolesReadyCondition) + conditions.MarkTrue(s.scope.ManagedMachinePool, expinfrav1.IAMNodegroupRolesReadyCondition) if err := s.reconcileNodegroup(); err != nil { conditions.MarkFalse( s.scope.ManagedMachinePool, - infrav1exp.EKSNodegroupReadyCondition, - infrav1exp.EKSNodegroupReconciliationFailedReason, + expinfrav1.EKSNodegroupReadyCondition, + expinfrav1.EKSNodegroupReconciliationFailedReason, clusterv1.ConditionSeverityError, err.Error(), ) return err } - conditions.MarkTrue(s.scope.ManagedMachinePool, infrav1exp.EKSNodegroupReadyCondition) + conditions.MarkTrue(s.scope.ManagedMachinePool, expinfrav1.EKSNodegroupReadyCondition) return nil } diff --git a/pkg/cloud/services/eks/fargate.go b/pkg/cloud/services/eks/fargate.go index 3477a9ae38..d27597bf5c 100644 --- a/pkg/cloud/services/eks/fargate.go +++ b/pkg/cloud/services/eks/fargate.go @@ -25,10 +25,10 @@ import ( "github.com/aws/aws-sdk-go/service/eks" "github.com/aws/aws-sdk-go/service/iam" "github.com/pkg/errors" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" capierrors "sigs.k8s.io/cluster-api/errors" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/controller-runtime/pkg/reconcile" @@ -50,8 +50,8 @@ func (s *FargateService) Reconcile() (reconcile.Result, error) { if err != nil { conditions.MarkFalse( s.scope.FargateProfile, - infrav1exp.IAMFargateRolesReadyCondition, - infrav1exp.IAMFargateRolesReconciliationFailedReason, + expinfrav1.IAMFargateRolesReadyCondition, + expinfrav1.IAMFargateRolesReconciliationFailedReason, clusterv1.ConditionSeverityError, err.Error(), ) @@ -63,14 +63,14 @@ func (s *FargateService) Reconcile() (reconcile.Result, error) { return requeueRoleUpdating(), nil } - conditions.MarkTrue(s.scope.FargateProfile, infrav1exp.IAMFargateRolesReadyCondition) + conditions.MarkTrue(s.scope.FargateProfile, expinfrav1.IAMFargateRolesReadyCondition) requeue, err = s.reconcileFargateProfile() if err != nil { conditions.MarkFalse( s.scope.FargateProfile, clusterv1.ReadyCondition, - infrav1exp.EKSFargateReconciliationFailedReason, + expinfrav1.EKSFargateReconciliationFailedReason, clusterv1.ConditionSeverityError, err.Error(), ) @@ -120,34 +120,34 @@ func (s *FargateService) handleStatus(profile *eks.FargateProfile) (requeue bool switch *profile.Status { case eks.FargateProfileStatusCreating: s.scope.FargateProfile.Status.Ready = false - if conditions.IsTrue(s.scope.FargateProfile, infrav1exp.EKSFargateDeletingCondition) { - conditions.MarkFalse(s.scope.FargateProfile, infrav1exp.EKSFargateDeletingCondition, infrav1exp.EKSFargateCreatingReason, clusterv1.ConditionSeverityInfo, "") + if conditions.IsTrue(s.scope.FargateProfile, expinfrav1.EKSFargateDeletingCondition) { + conditions.MarkFalse(s.scope.FargateProfile, expinfrav1.EKSFargateDeletingCondition, expinfrav1.EKSFargateCreatingReason, clusterv1.ConditionSeverityInfo, "") } - if !conditions.IsTrue(s.scope.FargateProfile, infrav1exp.EKSFargateCreatingCondition) { + if !conditions.IsTrue(s.scope.FargateProfile, expinfrav1.EKSFargateCreatingCondition) { record.Eventf(s.scope.FargateProfile, "InitiatedCreateEKSFargateProfile", "Started creating EKS fargate profile %s", s.scope.FargateProfile.Spec.ProfileName) - conditions.MarkTrue(s.scope.FargateProfile, infrav1exp.EKSFargateCreatingCondition) + conditions.MarkTrue(s.scope.FargateProfile, expinfrav1.EKSFargateCreatingCondition) } - conditions.MarkFalse(s.scope.FargateProfile, infrav1exp.EKSFargateProfileReadyCondition, infrav1exp.EKSFargateCreatingReason, clusterv1.ConditionSeverityInfo, "") + conditions.MarkFalse(s.scope.FargateProfile, expinfrav1.EKSFargateProfileReadyCondition, expinfrav1.EKSFargateCreatingReason, clusterv1.ConditionSeverityInfo, "") case eks.FargateProfileStatusCreateFailed, eks.FargateProfileStatusDeleteFailed: s.scope.FargateProfile.Status.Ready = false s.scope.FargateProfile.Status.FailureMessage = aws.String(fmt.Sprintf("unexpected profile status: %s", *profile.Status)) - reason := capierrors.MachineStatusError(infrav1exp.EKSFargateFailedReason) + reason := capierrors.MachineStatusError(expinfrav1.EKSFargateFailedReason) s.scope.FargateProfile.Status.FailureReason = &reason - conditions.MarkFalse(s.scope.FargateProfile, infrav1exp.EKSFargateProfileReadyCondition, infrav1exp.EKSFargateFailedReason, clusterv1.ConditionSeverityError, "") + conditions.MarkFalse(s.scope.FargateProfile, expinfrav1.EKSFargateProfileReadyCondition, expinfrav1.EKSFargateFailedReason, clusterv1.ConditionSeverityError, "") case eks.FargateProfileStatusActive: s.scope.FargateProfile.Status.Ready = true - if conditions.IsTrue(s.scope.FargateProfile, infrav1exp.EKSFargateCreatingCondition) { + if conditions.IsTrue(s.scope.FargateProfile, expinfrav1.EKSFargateCreatingCondition) { record.Eventf(s.scope.FargateProfile, "SuccessfulCreateEKSFargateProfile", "Created new EKS fargate profile %s", s.scope.FargateProfile.Spec.ProfileName) - conditions.MarkFalse(s.scope.FargateProfile, infrav1exp.EKSFargateCreatingCondition, infrav1exp.EKSFargateCreatedReason, clusterv1.ConditionSeverityInfo, "") + conditions.MarkFalse(s.scope.FargateProfile, expinfrav1.EKSFargateCreatingCondition, expinfrav1.EKSFargateCreatedReason, clusterv1.ConditionSeverityInfo, "") } - conditions.MarkTrue(s.scope.FargateProfile, infrav1exp.EKSFargateProfileReadyCondition) + conditions.MarkTrue(s.scope.FargateProfile, expinfrav1.EKSFargateProfileReadyCondition) case eks.FargateProfileStatusDeleting: s.scope.FargateProfile.Status.Ready = false - if !conditions.IsTrue(s.scope.FargateProfile, infrav1exp.EKSFargateDeletingCondition) { + if !conditions.IsTrue(s.scope.FargateProfile, expinfrav1.EKSFargateDeletingCondition) { record.Eventf(s.scope.FargateProfile, "InitiatedDeleteEKSFargateProfile", "Started deleting EKS fargate profile %s", s.scope.FargateProfile.Spec.ProfileName) - conditions.MarkTrue(s.scope.FargateProfile, infrav1exp.EKSFargateDeletingCondition) + conditions.MarkTrue(s.scope.FargateProfile, expinfrav1.EKSFargateDeletingCondition) } - conditions.MarkFalse(s.scope.FargateProfile, infrav1exp.EKSFargateProfileReadyCondition, infrav1exp.EKSFargateDeletingReason, clusterv1.ConditionSeverityInfo, "") + conditions.MarkFalse(s.scope.FargateProfile, expinfrav1.EKSFargateProfileReadyCondition, expinfrav1.EKSFargateDeletingReason, clusterv1.ConditionSeverityInfo, "") } switch *profile.Status { case eks.FargateProfileStatusCreating, eks.FargateProfileStatusDeleting: @@ -166,7 +166,7 @@ func (s *FargateService) ReconcileDelete() (reconcile.Result, error) { conditions.MarkFalse( s.scope.FargateProfile, clusterv1.ReadyCondition, - infrav1exp.EKSFargateReconciliationFailedReason, + expinfrav1.EKSFargateReconciliationFailedReason, clusterv1.ConditionSeverityError, err.Error(), ) @@ -181,8 +181,8 @@ func (s *FargateService) ReconcileDelete() (reconcile.Result, error) { if err != nil { conditions.MarkFalse( s.scope.FargateProfile, - infrav1exp.IAMFargateRolesReadyCondition, - infrav1exp.IAMFargateRolesReconciliationFailedReason, + expinfrav1.IAMFargateRolesReadyCondition, + expinfrav1.IAMFargateRolesReconciliationFailedReason, clusterv1.ConditionSeverityError, err.Error(), ) @@ -267,11 +267,11 @@ func (s *FargateService) deleteFargateProfile() (requeue bool, err error) { return false, errors.Wrap(err, "failed to describe profile") } if profile == nil { - if conditions.IsTrue(s.scope.FargateProfile, infrav1exp.EKSFargateDeletingCondition) { + if conditions.IsTrue(s.scope.FargateProfile, expinfrav1.EKSFargateDeletingCondition) { record.Eventf(s.scope.FargateProfile, "SuccessfulDeleteEKSFargateProfile", "Deleted EKS fargate profile %s", s.scope.FargateProfile.Spec.ProfileName) - conditions.MarkFalse(s.scope.FargateProfile, infrav1exp.EKSFargateDeletingCondition, infrav1exp.EKSFargateDeletedReason, clusterv1.ConditionSeverityInfo, "") + conditions.MarkFalse(s.scope.FargateProfile, expinfrav1.EKSFargateDeletingCondition, expinfrav1.EKSFargateDeletedReason, clusterv1.ConditionSeverityInfo, "") } - conditions.MarkFalse(s.scope.FargateProfile, infrav1exp.EKSFargateProfileReadyCondition, infrav1exp.EKSFargateDeletedReason, clusterv1.ConditionSeverityInfo, "") + conditions.MarkFalse(s.scope.FargateProfile, expinfrav1.EKSFargateProfileReadyCondition, expinfrav1.EKSFargateDeletedReason, clusterv1.ConditionSeverityInfo, "") return false, nil } diff --git a/pkg/cloud/services/eks/iam/iam.go b/pkg/cloud/services/eks/iam/iam.go index c98535704a..b68242f2cb 100644 --- a/pkg/cloud/services/eks/iam/iam.go +++ b/pkg/cloud/services/eks/iam/iam.go @@ -31,8 +31,9 @@ import ( "github.com/go-logr/logr" "github.com/pkg/errors" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/converters" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" ) const ( @@ -178,7 +179,7 @@ func RoleTags(key string, additionalTags infrav1.Tags) []*iam.Tag { func (s *IAMService) CreateRole( roleName string, key string, - trustRelationship *infrav1.PolicyDocument, + trustRelationship *iamv1.PolicyDocument, additionalTags infrav1.Tags, ) (*iam.Role, error) { tags := RoleTags(key, additionalTags) @@ -206,7 +207,7 @@ func (s *IAMService) CreateRole( func (s *IAMService) EnsureTagsAndPolicy( role *iam.Role, key string, - trustRelationship *infrav1.PolicyDocument, + trustRelationship *iamv1.PolicyDocument, additionalTags infrav1.Tags, ) (bool, error) { s.V(2).Info("Ensuring tags and AssumeRolePolicyDocument are set on role") @@ -216,7 +217,7 @@ func (s *IAMService) EnsureTagsAndPolicy( return false, errors.Wrap(err, "couldn't decode AssumeRolePolicyDocument") } - var rolePolicyDocument infrav1.PolicyDocument + var rolePolicyDocument iamv1.PolicyDocument err = json.Unmarshal([]byte(rolePolicyDocumentRaw), &rolePolicyDocument) if err != nil { return false, errors.Wrap(err, "couldn't unmarshal AssumeRolePolicyDocument") @@ -330,16 +331,16 @@ func (s *IAMService) IsUnmanaged(role *iam.Role, key string) bool { } // ControlPlaneTrustRelationship will generate a ControlPlane PolicyDocument. -func ControlPlaneTrustRelationship(enableFargate bool) *infrav1.PolicyDocument { - identity := make(infrav1.Principals) +func ControlPlaneTrustRelationship(enableFargate bool) *iamv1.PolicyDocument { + identity := make(iamv1.Principals) identity["Service"] = []string{"eks.amazonaws.com"} if enableFargate { identity["Service"] = append(identity["Service"], EKSFargateService) } - policy := &infrav1.PolicyDocument{ + policy := &iamv1.PolicyDocument{ Version: "2012-10-17", - Statement: []infrav1.StatementEntry{ + Statement: []iamv1.StatementEntry{ { Effect: "Allow", Action: []string{ @@ -354,13 +355,13 @@ func ControlPlaneTrustRelationship(enableFargate bool) *infrav1.PolicyDocument { } // FargateTrustRelationship will generate a Fargate PolicyDocument. -func FargateTrustRelationship() *infrav1.PolicyDocument { - identity := make(infrav1.Principals) +func FargateTrustRelationship() *iamv1.PolicyDocument { + identity := make(iamv1.Principals) identity["Service"] = []string{EKSFargateService} - policy := &infrav1.PolicyDocument{ + policy := &iamv1.PolicyDocument{ Version: "2012-10-17", - Statement: []infrav1.StatementEntry{ + Statement: []iamv1.StatementEntry{ { Effect: "Allow", Action: []string{ @@ -375,13 +376,13 @@ func FargateTrustRelationship() *infrav1.PolicyDocument { } // NodegroupTrustRelationship will generate a Nodegroup PolicyDocument. -func NodegroupTrustRelationship() *infrav1.PolicyDocument { - identity := make(infrav1.Principals) +func NodegroupTrustRelationship() *iamv1.PolicyDocument { + identity := make(iamv1.Principals) identity["Service"] = []string{"ec2.amazonaws.com"} - policy := &infrav1.PolicyDocument{ + policy := &iamv1.PolicyDocument{ Version: "2012-10-17", - Statement: []infrav1.StatementEntry{ + Statement: []iamv1.StatementEntry{ { Effect: "Allow", Action: []string{ diff --git a/pkg/cloud/services/eks/identity_provider.go b/pkg/cloud/services/eks/identity_provider.go index 3c8c437c57..b79c9c2f8d 100644 --- a/pkg/cloud/services/eks/identity_provider.go +++ b/pkg/cloud/services/eks/identity_provider.go @@ -23,7 +23,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eks" "github.com/pkg/errors" - "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/eks/identityprovider" ) @@ -73,7 +73,7 @@ func (s *Service) reconcileIdentityProvider(ctx context.Context) error { } if latest != nil { - s.scope.ControlPlane.Status.IdentityProviderStatus = v1alpha4.IdentityProviderStatus{ + s.scope.ControlPlane.Status.IdentityProviderStatus = ekscontrolplanev1.IdentityProviderStatus{ ARN: aws.StringValue(latest.IdentityProviderConfigArn), Status: aws.StringValue(latest.Status), } diff --git a/pkg/cloud/services/eks/mock_eksiface/eksapi_mock.go b/pkg/cloud/services/eks/mock_eksiface/eksapi_mock.go index ab76835e65..f8c2defa37 100644 --- a/pkg/cloud/services/eks/mock_eksiface/eksapi_mock.go +++ b/pkg/cloud/services/eks/mock_eksiface/eksapi_mock.go @@ -552,6 +552,56 @@ func (mr *MockEKSAPIMockRecorder) DeleteNodegroupWithContext(arg0, arg1 interfac return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteNodegroupWithContext", reflect.TypeOf((*MockEKSAPI)(nil).DeleteNodegroupWithContext), varargs...) } +// DeregisterCluster mocks base method. +func (m *MockEKSAPI) DeregisterCluster(arg0 *eks.DeregisterClusterInput) (*eks.DeregisterClusterOutput, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeregisterCluster", arg0) + ret0, _ := ret[0].(*eks.DeregisterClusterOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeregisterCluster indicates an expected call of DeregisterCluster. +func (mr *MockEKSAPIMockRecorder) DeregisterCluster(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeregisterCluster", reflect.TypeOf((*MockEKSAPI)(nil).DeregisterCluster), arg0) +} + +// DeregisterClusterRequest mocks base method. +func (m *MockEKSAPI) DeregisterClusterRequest(arg0 *eks.DeregisterClusterInput) (*request.Request, *eks.DeregisterClusterOutput) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeregisterClusterRequest", arg0) + ret0, _ := ret[0].(*request.Request) + ret1, _ := ret[1].(*eks.DeregisterClusterOutput) + return ret0, ret1 +} + +// DeregisterClusterRequest indicates an expected call of DeregisterClusterRequest. +func (mr *MockEKSAPIMockRecorder) DeregisterClusterRequest(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeregisterClusterRequest", reflect.TypeOf((*MockEKSAPI)(nil).DeregisterClusterRequest), arg0) +} + +// DeregisterClusterWithContext mocks base method. +func (m *MockEKSAPI) DeregisterClusterWithContext(arg0 context.Context, arg1 *eks.DeregisterClusterInput, arg2 ...request.Option) (*eks.DeregisterClusterOutput, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "DeregisterClusterWithContext", varargs...) + ret0, _ := ret[0].(*eks.DeregisterClusterOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeregisterClusterWithContext indicates an expected call of DeregisterClusterWithContext. +func (mr *MockEKSAPIMockRecorder) DeregisterClusterWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeregisterClusterWithContext", reflect.TypeOf((*MockEKSAPI)(nil).DeregisterClusterWithContext), varargs...) +} + // DescribeAddon mocks base method. func (m *MockEKSAPI) DescribeAddon(arg0 *eks.DescribeAddonInput) (*eks.DescribeAddonOutput, error) { m.ctrl.T.Helper() @@ -1533,6 +1583,56 @@ func (mr *MockEKSAPIMockRecorder) ListUpdatesWithContext(arg0, arg1 interface{}, return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListUpdatesWithContext", reflect.TypeOf((*MockEKSAPI)(nil).ListUpdatesWithContext), varargs...) } +// RegisterCluster mocks base method. +func (m *MockEKSAPI) RegisterCluster(arg0 *eks.RegisterClusterInput) (*eks.RegisterClusterOutput, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RegisterCluster", arg0) + ret0, _ := ret[0].(*eks.RegisterClusterOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// RegisterCluster indicates an expected call of RegisterCluster. +func (mr *MockEKSAPIMockRecorder) RegisterCluster(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterCluster", reflect.TypeOf((*MockEKSAPI)(nil).RegisterCluster), arg0) +} + +// RegisterClusterRequest mocks base method. +func (m *MockEKSAPI) RegisterClusterRequest(arg0 *eks.RegisterClusterInput) (*request.Request, *eks.RegisterClusterOutput) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "RegisterClusterRequest", arg0) + ret0, _ := ret[0].(*request.Request) + ret1, _ := ret[1].(*eks.RegisterClusterOutput) + return ret0, ret1 +} + +// RegisterClusterRequest indicates an expected call of RegisterClusterRequest. +func (mr *MockEKSAPIMockRecorder) RegisterClusterRequest(arg0 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterClusterRequest", reflect.TypeOf((*MockEKSAPI)(nil).RegisterClusterRequest), arg0) +} + +// RegisterClusterWithContext mocks base method. +func (m *MockEKSAPI) RegisterClusterWithContext(arg0 context.Context, arg1 *eks.RegisterClusterInput, arg2 ...request.Option) (*eks.RegisterClusterOutput, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "RegisterClusterWithContext", varargs...) + ret0, _ := ret[0].(*eks.RegisterClusterOutput) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// RegisterClusterWithContext indicates an expected call of RegisterClusterWithContext. +func (mr *MockEKSAPIMockRecorder) RegisterClusterWithContext(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterClusterWithContext", reflect.TypeOf((*MockEKSAPI)(nil).RegisterClusterWithContext), varargs...) +} + // TagResource mocks base method. func (m *MockEKSAPI) TagResource(arg0 *eks.TagResourceInput) (*eks.TagResourceOutput, error) { m.ctrl.T.Helper() diff --git a/pkg/cloud/services/eks/nodegroup.go b/pkg/cloud/services/eks/nodegroup.go index 0dc9bcfdc8..9e87d6db08 100644 --- a/pkg/cloud/services/eks/nodegroup.go +++ b/pkg/cloud/services/eks/nodegroup.go @@ -27,12 +27,12 @@ import ( "github.com/pkg/errors" "k8s.io/apimachinery/pkg/util/version" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/noderefutil" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - controlplanev1exp "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/wait" "sigs.k8s.io/cluster-api-provider-aws/pkg/record" @@ -121,9 +121,9 @@ func (s *NodegroupService) remoteAccess() (*eks.RemoteAccessConfig, error) { // We add the EKS created cluster security group to the allowed security // groups by default to prevent the API default of 0.0.0.0/0 from taking effect // in case SourceSecurityGroups is empty - clusterSG, ok := controlPlane.Status.Network.SecurityGroups[controlplanev1exp.SecurityGroupCluster] + clusterSG, ok := controlPlane.Status.Network.SecurityGroups[ekscontrolplanev1.SecurityGroupCluster] if !ok { - return nil, errors.Errorf("%s security group not found on control plane", controlplanev1exp.SecurityGroupCluster) + return nil, errors.Errorf("%s security group not found on control plane", ekscontrolplanev1.SecurityGroupCluster) } sSGs = append(sSGs, clusterSG.ID) @@ -345,7 +345,7 @@ func createLabelUpdate(specLabels map[string]string, ng *eks.Nodegroup) *eks.Upd return nil } -func (s *NodegroupService) createTaintsUpdate(specTaints infrav1exp.Taints, ng *eks.Nodegroup) (*eks.UpdateTaintsPayload, error) { +func (s *NodegroupService) createTaintsUpdate(specTaints expinfrav1.Taints, ng *eks.Nodegroup) (*eks.UpdateTaintsPayload, error) { s.V(2).Info("Creating taints update for node group", "name", *ng.NodegroupName, "num_current", len(ng.Taints), "num_required", len(specTaints)) current, err := converters.TaintsFromSDK(ng.Taints) if err != nil { diff --git a/pkg/cloud/services/eks/oidc.go b/pkg/cloud/services/eks/oidc.go index 54ec171673..d43e36540b 100644 --- a/pkg/cloud/services/eks/oidc.go +++ b/pkg/cloud/services/eks/oidc.go @@ -28,8 +28,8 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/converters" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -141,21 +141,21 @@ func (s *Service) deleteOIDCProvider() error { return nil } -func (s *Service) buildOIDCTrustPolicy() v1alpha4.PolicyDocument { +func (s *Service) buildOIDCTrustPolicy() iamv1.PolicyDocument { providerARN := s.scope.ControlPlane.Status.OIDCProvider.ARN conditionValue := providerARN[strings.Index(providerARN, "/")+1:] + ":sub" - return v1alpha4.PolicyDocument{ + return iamv1.PolicyDocument{ Version: "2012-10-17", - Statement: v1alpha4.Statements{ - v1alpha4.StatementEntry{ + Statement: iamv1.Statements{ + iamv1.StatementEntry{ Sid: "", Effect: "Allow", - Principal: v1alpha4.Principals{ - v1alpha4.PrincipalFederated: v1alpha4.PrincipalID{providerARN}, + Principal: iamv1.Principals{ + iamv1.PrincipalFederated: iamv1.PrincipalID{providerARN}, }, - Action: v1alpha4.Actions{"sts:AssumeRoleWithWebIdentity"}, - Condition: v1alpha4.Conditions{ + Action: iamv1.Actions{"sts:AssumeRoleWithWebIdentity"}, + Condition: iamv1.Conditions{ "ForAnyValue:StringLike": map[string][]string{ conditionValue: {"system:serviceaccount:${SERVICE_ACCOUNT_NAMESPACE}:${SERVICE_ACCOUNT_NAME}"}, }, diff --git a/pkg/cloud/services/eks/roles.go b/pkg/cloud/services/eks/roles.go index 81e116caab..ff979d2534 100644 --- a/pkg/cloud/services/eks/roles.go +++ b/pkg/cloud/services/eks/roles.go @@ -24,12 +24,12 @@ import ( "github.com/aws/aws-sdk-go/service/iam" "github.com/pkg/errors" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" eksiam "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/eks/iam" "sigs.k8s.io/cluster-api-provider-aws/pkg/eks" "sigs.k8s.io/cluster-api-provider-aws/pkg/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) const ( @@ -159,7 +159,7 @@ func (s *NodegroupService) reconcileNodegroupIAMRole() error { var err error if !s.scope.EnableIAM() { s.scope.Info("no EKS nodegroup role specified, using default EKS nodegroup role") - roleName = infrav1exp.DefaultEKSNodegroupRole + roleName = expinfrav1.DefaultEKSNodegroupRole } else { s.scope.Info("no EKS nodegroup role specified, using role based on nodegroup name") roleName, err = eks.GenerateEKSName( @@ -276,7 +276,7 @@ func (s *FargateService) reconcileFargateIAMRole() (requeue bool, err error) { var roleName string if !s.scope.EnableIAM() { s.scope.Info("no EKS fargate role specified, using default EKS fargate role") - roleName = infrav1exp.DefaultEKSFargateRole + roleName = expinfrav1.DefaultEKSFargateRole } else { s.scope.Info("no EKS fargate role specified, using role based on fargate profile name") roleName, err = eks.GenerateEKSName( diff --git a/pkg/cloud/services/eks/securitygroup.go b/pkg/cloud/services/eks/securitygroup.go index 9012dae05b..2413ec65bd 100644 --- a/pkg/cloud/services/eks/securitygroup.go +++ b/pkg/cloud/services/eks/securitygroup.go @@ -23,8 +23,8 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/eks" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/converters" ) diff --git a/pkg/cloud/services/eks/tags.go b/pkg/cloud/services/eks/tags.go index fc74b1289f..c8b3a0fe41 100644 --- a/pkg/cloud/services/eks/tags.go +++ b/pkg/cloud/services/eks/tags.go @@ -23,7 +23,7 @@ import ( "github.com/aws/aws-sdk-go/service/eks" "github.com/aws/aws-sdk-go/service/eks/eksiface" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/tags" ) diff --git a/pkg/cloud/services/elb/loadbalancer.go b/pkg/cloud/services/elb/loadbalancer.go index 288136af91..64cc244b12 100644 --- a/pkg/cloud/services/elb/loadbalancer.go +++ b/pkg/cloud/services/elb/loadbalancer.go @@ -29,13 +29,13 @@ import ( rgapi "github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/util/sets" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/wait" "sigs.k8s.io/cluster-api-provider-aws/pkg/hash" "sigs.k8s.io/cluster-api-provider-aws/pkg/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" ) diff --git a/pkg/cloud/services/elb/loadbalancer_test.go b/pkg/cloud/services/elb/loadbalancer_test.go index 5197d4c0a5..6dba191841 100644 --- a/pkg/cloud/services/elb/loadbalancer_test.go +++ b/pkg/cloud/services/elb/loadbalancer_test.go @@ -30,12 +30,12 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2/mock_ec2iface" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/elb/mock_elbiface" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/elb/mock_resourcegroupstaggingapiiface" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) diff --git a/pkg/cloud/services/iamauth/configmap.go b/pkg/cloud/services/iamauth/configmap.go index 81bec2f704..0cb3774e0c 100644 --- a/pkg/cloud/services/iamauth/configmap.go +++ b/pkg/cloud/services/iamauth/configmap.go @@ -30,7 +30,7 @@ import ( crclient "sigs.k8s.io/controller-runtime/pkg/client" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" ) const ( diff --git a/pkg/cloud/services/iamauth/configmap_test.go b/pkg/cloud/services/iamauth/configmap_test.go index 180bf8bfcd..21aa2c7a66 100644 --- a/pkg/cloud/services/iamauth/configmap_test.go +++ b/pkg/cloud/services/iamauth/configmap_test.go @@ -30,7 +30,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client/fake" "sigs.k8s.io/yaml" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" ) var ( diff --git a/pkg/cloud/services/iamauth/crd.go b/pkg/cloud/services/iamauth/crd.go index e1b21ec376..bd0125486a 100644 --- a/pkg/cloud/services/iamauth/crd.go +++ b/pkg/cloud/services/iamauth/crd.go @@ -25,7 +25,7 @@ import ( iamauthv1 "sigs.k8s.io/aws-iam-authenticator/pkg/mapper/crd/apis/iamauthenticator/v1alpha1" crclient "sigs.k8s.io/controller-runtime/pkg/client" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" ) type crdBackend struct { diff --git a/pkg/cloud/services/iamauth/crd_test.go b/pkg/cloud/services/iamauth/crd_test.go index f5a7ce0b0d..818a3a3260 100644 --- a/pkg/cloud/services/iamauth/crd_test.go +++ b/pkg/cloud/services/iamauth/crd_test.go @@ -30,7 +30,7 @@ import ( crclient "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" ) func TestAddRoleMappingCRD(t *testing.T) { diff --git a/pkg/cloud/services/iamauth/iamauth.go b/pkg/cloud/services/iamauth/iamauth.go index 0044b2be81..bc8e583681 100644 --- a/pkg/cloud/services/iamauth/iamauth.go +++ b/pkg/cloud/services/iamauth/iamauth.go @@ -19,7 +19,7 @@ package iamauth import ( crclient "sigs.k8s.io/controller-runtime/pkg/client" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" ) const ( diff --git a/pkg/cloud/services/iamauth/reconcile.go b/pkg/cloud/services/iamauth/reconcile.go index b45f3e490b..4e4521875c 100644 --- a/pkg/cloud/services/iamauth/reconcile.go +++ b/pkg/cloud/services/iamauth/reconcile.go @@ -28,8 +28,8 @@ import ( "sigs.k8s.io/cluster-api/controllers/remote" "sigs.k8s.io/controller-runtime/pkg/client" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" ) // ReconcileIAMAuthenticator is used to create the aws-iam-authenticator in a cluster. @@ -64,7 +64,7 @@ func (s *Service) ReconcileIAMAuthenticator(ctx context.Context) error { return fmt.Errorf("getting aws-iam-authenticator backend: %w", err) } - roleARN := fmt.Sprintf("arn:aws:iam::%s:role/nodes%s", accountID, infrav1.DefaultNameSuffix) + roleARN := fmt.Sprintf("arn:aws:iam::%s:role/nodes%s", accountID, iamv1.DefaultNameSuffix) nodesRoleMapping := ekscontrolplanev1.RoleMapping{ RoleARN: roleARN, KubernetesMapping: ekscontrolplanev1.KubernetesMapping{ diff --git a/pkg/cloud/services/iamauth/service.go b/pkg/cloud/services/iamauth/service.go index 659f6f8e78..2516c866a3 100644 --- a/pkg/cloud/services/iamauth/service.go +++ b/pkg/cloud/services/iamauth/service.go @@ -21,7 +21,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" ) diff --git a/pkg/cloud/services/instancestate/helpers_test.go b/pkg/cloud/services/instancestate/helpers_test.go index 65035b1047..3ee98d9e6a 100644 --- a/pkg/cloud/services/instancestate/helpers_test.go +++ b/pkg/cloud/services/instancestate/helpers_test.go @@ -19,9 +19,9 @@ package instancestate import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) diff --git a/pkg/cloud/services/instancestate/queue.go b/pkg/cloud/services/instancestate/queue.go index a08dfadc7f..e679534ab7 100644 --- a/pkg/cloud/services/instancestate/queue.go +++ b/pkg/cloud/services/instancestate/queue.go @@ -26,7 +26,7 @@ import ( "github.com/aws/aws-sdk-go/service/sqs" "github.com/pkg/errors" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" ) func (s *Service) reconcileSQSQueue() error { @@ -66,17 +66,17 @@ func (s *Service) deleteSQSQueue() error { func (s *Service) createPolicyForRule(input *createPolicyForRuleInput) error { attrs := make(map[string]string) - policy := v1alpha4.PolicyDocument{ - Version: v1alpha4.CurrentVersion, + policy := iamv1.PolicyDocument{ + Version: iamv1.CurrentVersion, ID: input.QueueArn, - Statement: v1alpha4.Statements{ - v1alpha4.StatementEntry{ + Statement: iamv1.Statements{ + iamv1.StatementEntry{ Sid: fmt.Sprintf("CAPAEvents_%s_%s", s.getEC2RuleName(), GenerateQueueName(s.scope.Name())), - Effect: v1alpha4.EffectAllow, - Principal: v1alpha4.Principals{v1alpha4.PrincipalService: v1alpha4.PrincipalID{"events.amazonaws.com"}}, - Action: v1alpha4.Actions{"sqs:SendMessage"}, - Resource: v1alpha4.Resources{input.QueueArn}, - Condition: v1alpha4.Conditions{ + Effect: iamv1.EffectAllow, + Principal: iamv1.Principals{iamv1.PrincipalService: iamv1.PrincipalID{"events.amazonaws.com"}}, + Action: iamv1.Actions{"sqs:SendMessage"}, + Resource: iamv1.Resources{input.QueueArn}, + Condition: iamv1.Conditions{ "ArnEquals": map[string]string{"aws:SourceArn": input.RuleArn}, }, }, diff --git a/pkg/cloud/services/instancestate/rule.go b/pkg/cloud/services/instancestate/rule.go index f2a7a5a501..e224a38ab7 100644 --- a/pkg/cloud/services/instancestate/rule.go +++ b/pkg/cloud/services/instancestate/rule.go @@ -26,7 +26,7 @@ import ( "github.com/aws/aws-sdk-go/service/sqs" "github.com/pkg/errors" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ) // Ec2StateChangeNotification defines the EC2 instance's state change notification. diff --git a/pkg/cloud/services/instancestate/rule_test.go b/pkg/cloud/services/instancestate/rule_test.go index 0a121769aa..2aba7c5bf9 100644 --- a/pkg/cloud/services/instancestate/rule_test.go +++ b/pkg/cloud/services/instancestate/rule_test.go @@ -27,7 +27,7 @@ import ( "github.com/golang/mock/gomock" . "github.com/onsi/gomega" "github.com/pkg/errors" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/instancestate/mock_eventbridgeiface" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/instancestate/mock_sqsiface" ) diff --git a/pkg/cloud/services/interfaces.go b/pkg/cloud/services/interfaces.go index e88a549949..11b0d1e3de 100644 --- a/pkg/cloud/services/interfaces.go +++ b/pkg/cloud/services/interfaces.go @@ -17,8 +17,8 @@ limitations under the License. package services import ( - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" ) diff --git a/pkg/cloud/services/mock_services/autoscaling_interface_mock.go b/pkg/cloud/services/mock_services/autoscaling_interface_mock.go index 465f959973..b6e8fdd418 100644 --- a/pkg/cloud/services/mock_services/autoscaling_interface_mock.go +++ b/pkg/cloud/services/mock_services/autoscaling_interface_mock.go @@ -24,7 +24,7 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - v1alpha4 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" scope "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" ) @@ -52,10 +52,10 @@ func (m *MockASGInterface) EXPECT() *MockASGInterfaceMockRecorder { } // ASGIfExists mocks base method. -func (m *MockASGInterface) ASGIfExists(arg0 *string) (*v1alpha4.AutoScalingGroup, error) { +func (m *MockASGInterface) ASGIfExists(arg0 *string) (*v1beta1.AutoScalingGroup, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ASGIfExists", arg0) - ret0, _ := ret[0].(*v1alpha4.AutoScalingGroup) + ret0, _ := ret[0].(*v1beta1.AutoScalingGroup) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -82,10 +82,10 @@ func (mr *MockASGInterfaceMockRecorder) CanStartASGInstanceRefresh(arg0 interfac } // CreateASG mocks base method. -func (m *MockASGInterface) CreateASG(arg0 *scope.MachinePoolScope) (*v1alpha4.AutoScalingGroup, error) { +func (m *MockASGInterface) CreateASG(arg0 *scope.MachinePoolScope) (*v1beta1.AutoScalingGroup, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateASG", arg0) - ret0, _ := ret[0].(*v1alpha4.AutoScalingGroup) + ret0, _ := ret[0].(*v1beta1.AutoScalingGroup) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -111,10 +111,10 @@ func (mr *MockASGInterfaceMockRecorder) DeleteASGAndWait(arg0 interface{}) *gomo } // GetASGByName mocks base method. -func (m *MockASGInterface) GetASGByName(arg0 *scope.MachinePoolScope) (*v1alpha4.AutoScalingGroup, error) { +func (m *MockASGInterface) GetASGByName(arg0 *scope.MachinePoolScope) (*v1beta1.AutoScalingGroup, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetASGByName", arg0) - ret0, _ := ret[0].(*v1alpha4.AutoScalingGroup) + ret0, _ := ret[0].(*v1beta1.AutoScalingGroup) ret1, _ := ret[1].(error) return ret0, ret1 } diff --git a/pkg/cloud/services/mock_services/ec2_machine_interface_mock.go b/pkg/cloud/services/mock_services/ec2_machine_interface_mock.go index 3168774b10..0abe36fbdc 100644 --- a/pkg/cloud/services/mock_services/ec2_machine_interface_mock.go +++ b/pkg/cloud/services/mock_services/ec2_machine_interface_mock.go @@ -24,8 +24,8 @@ import ( reflect "reflect" gomock "github.com/golang/mock/gomock" - v1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - v1alpha40 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + v1beta1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + v1beta10 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" scope "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" ) @@ -53,10 +53,10 @@ func (m *MockEC2MachineInterface) EXPECT() *MockEC2MachineInterfaceMockRecorder } // CreateInstance mocks base method. -func (m *MockEC2MachineInterface) CreateInstance(arg0 *scope.MachineScope, arg1 []byte) (*v1alpha4.Instance, error) { +func (m *MockEC2MachineInterface) CreateInstance(arg0 *scope.MachineScope, arg1 []byte) (*v1beta1.Instance, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CreateInstance", arg0, arg1) - ret0, _ := ret[0].(*v1alpha4.Instance) + ret0, _ := ret[0].(*v1beta1.Instance) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -155,7 +155,7 @@ func (mr *MockEC2MachineInterfaceMockRecorder) GetCoreSecurityGroups(arg0 interf } // GetFilteredSecurityGroupID mocks base method. -func (m *MockEC2MachineInterface) GetFilteredSecurityGroupID(arg0 v1alpha4.AWSResourceReference) (string, error) { +func (m *MockEC2MachineInterface) GetFilteredSecurityGroupID(arg0 v1beta1.AWSResourceReference) (string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetFilteredSecurityGroupID", arg0) ret0, _ := ret[0].(string) @@ -185,10 +185,10 @@ func (mr *MockEC2MachineInterfaceMockRecorder) GetInstanceSecurityGroups(arg0 in } // GetLaunchTemplate mocks base method. -func (m *MockEC2MachineInterface) GetLaunchTemplate(arg0 string) (*v1alpha40.AWSLaunchTemplate, string, error) { +func (m *MockEC2MachineInterface) GetLaunchTemplate(arg0 string) (*v1beta10.AWSLaunchTemplate, string, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetLaunchTemplate", arg0) - ret0, _ := ret[0].(*v1alpha40.AWSLaunchTemplate) + ret0, _ := ret[0].(*v1beta10.AWSLaunchTemplate) ret1, _ := ret[1].(string) ret2, _ := ret[2].(error) return ret0, ret1, ret2 @@ -216,10 +216,10 @@ func (mr *MockEC2MachineInterfaceMockRecorder) GetLaunchTemplateID(arg0 interfac } // GetRunningInstanceByTags mocks base method. -func (m *MockEC2MachineInterface) GetRunningInstanceByTags(arg0 *scope.MachineScope) (*v1alpha4.Instance, error) { +func (m *MockEC2MachineInterface) GetRunningInstanceByTags(arg0 *scope.MachineScope) (*v1beta1.Instance, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetRunningInstanceByTags", arg0) - ret0, _ := ret[0].(*v1alpha4.Instance) + ret0, _ := ret[0].(*v1beta1.Instance) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -231,10 +231,10 @@ func (mr *MockEC2MachineInterfaceMockRecorder) GetRunningInstanceByTags(arg0 int } // InstanceIfExists mocks base method. -func (m *MockEC2MachineInterface) InstanceIfExists(arg0 *string) (*v1alpha4.Instance, error) { +func (m *MockEC2MachineInterface) InstanceIfExists(arg0 *string) (*v1beta1.Instance, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "InstanceIfExists", arg0) - ret0, _ := ret[0].(*v1alpha4.Instance) + ret0, _ := ret[0].(*v1beta1.Instance) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -246,7 +246,7 @@ func (mr *MockEC2MachineInterfaceMockRecorder) InstanceIfExists(arg0 interface{} } // LaunchTemplateNeedsUpdate mocks base method. -func (m *MockEC2MachineInterface) LaunchTemplateNeedsUpdate(arg0 *scope.MachinePoolScope, arg1, arg2 *v1alpha40.AWSLaunchTemplate) (bool, error) { +func (m *MockEC2MachineInterface) LaunchTemplateNeedsUpdate(arg0 *scope.MachinePoolScope, arg1, arg2 *v1beta10.AWSLaunchTemplate) (bool, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LaunchTemplateNeedsUpdate", arg0, arg1, arg2) ret0, _ := ret[0].(bool) diff --git a/pkg/cloud/services/network/eips.go b/pkg/cloud/services/network/eips.go index fd3cf72811..d50623e554 100644 --- a/pkg/cloud/services/network/eips.go +++ b/pkg/cloud/services/network/eips.go @@ -22,7 +22,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/filter" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/wait" diff --git a/pkg/cloud/services/network/gateways.go b/pkg/cloud/services/network/gateways.go index c4a3e6c99a..f615d4628c 100644 --- a/pkg/cloud/services/network/gateways.go +++ b/pkg/cloud/services/network/gateways.go @@ -22,7 +22,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/filter" diff --git a/pkg/cloud/services/network/gateways_test.go b/pkg/cloud/services/network/gateways_test.go index 922c2a3510..38388cfd94 100644 --- a/pkg/cloud/services/network/gateways_test.go +++ b/pkg/cloud/services/network/gateways_test.go @@ -26,10 +26,10 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/golang/mock/gomock" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2/mock_ec2iface" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestReconcileInternetGateways(t *testing.T) { diff --git a/pkg/cloud/services/network/natgateways.go b/pkg/cloud/services/network/natgateways.go index f0ee36338f..bc7e28ef52 100644 --- a/pkg/cloud/services/network/natgateways.go +++ b/pkg/cloud/services/network/natgateways.go @@ -20,13 +20,13 @@ import ( "fmt" kerrors "k8s.io/apimachinery/pkg/util/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/filter" diff --git a/pkg/cloud/services/network/natgateways_test.go b/pkg/cloud/services/network/natgateways_test.go index 1e3139f6bb..71a8efe04e 100644 --- a/pkg/cloud/services/network/natgateways_test.go +++ b/pkg/cloud/services/network/natgateways_test.go @@ -25,10 +25,10 @@ import ( "github.com/golang/mock/gomock" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2/mock_ec2iface" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) diff --git a/pkg/cloud/services/network/network.go b/pkg/cloud/services/network/network.go index 9f7af3ef85..9607aa508c 100644 --- a/pkg/cloud/services/network/network.go +++ b/pkg/cloud/services/network/network.go @@ -17,9 +17,9 @@ limitations under the License. package network import ( - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" ) diff --git a/pkg/cloud/services/network/routetables.go b/pkg/cloud/services/network/routetables.go index e9628ea9d7..30a3734aa4 100644 --- a/pkg/cloud/services/network/routetables.go +++ b/pkg/cloud/services/network/routetables.go @@ -22,7 +22,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/filter" diff --git a/pkg/cloud/services/network/routetables_test.go b/pkg/cloud/services/network/routetables_test.go index b2cb7cb3c1..42d3e3187d 100644 --- a/pkg/cloud/services/network/routetables_test.go +++ b/pkg/cloud/services/network/routetables_test.go @@ -29,10 +29,10 @@ import ( "github.com/golang/mock/gomock" "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2/mock_ec2iface" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) func TestReconcileRouteTables(t *testing.T) { diff --git a/pkg/cloud/services/network/service.go b/pkg/cloud/services/network/service.go index b7b443dcad..c26adf7c2f 100644 --- a/pkg/cloud/services/network/service.go +++ b/pkg/cloud/services/network/service.go @@ -19,7 +19,7 @@ package network import ( "github.com/aws/aws-sdk-go/service/ec2/ec2iface" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" ) diff --git a/pkg/cloud/services/network/subnets.go b/pkg/cloud/services/network/subnets.go index fbb9aee855..274049affb 100644 --- a/pkg/cloud/services/network/subnets.go +++ b/pkg/cloud/services/network/subnets.go @@ -25,7 +25,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/filter" diff --git a/pkg/cloud/services/network/subnets_test.go b/pkg/cloud/services/network/subnets_test.go index 278467d3ba..40d8a7a878 100644 --- a/pkg/cloud/services/network/subnets_test.go +++ b/pkg/cloud/services/network/subnets_test.go @@ -29,10 +29,10 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/golang/mock/gomock" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2/mock_ec2iface" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" ) const ( diff --git a/pkg/cloud/services/network/vpc.go b/pkg/cloud/services/network/vpc.go index 8ceb981983..acc5080138 100644 --- a/pkg/cloud/services/network/vpc.go +++ b/pkg/cloud/services/network/vpc.go @@ -23,7 +23,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" kerrors "k8s.io/apimachinery/pkg/util/errors" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/filter" @@ -31,7 +31,7 @@ import ( "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/wait" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/tags" "sigs.k8s.io/cluster-api-provider-aws/pkg/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" ) diff --git a/pkg/cloud/services/network/vpc_test.go b/pkg/cloud/services/network/vpc_test.go index 7b1cef3619..6915d4c4d4 100644 --- a/pkg/cloud/services/network/vpc_test.go +++ b/pkg/cloud/services/network/vpc_test.go @@ -31,10 +31,10 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/diff" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2/mock_ec2iface" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) diff --git a/pkg/cloud/services/secretsmanager/secret.go b/pkg/cloud/services/secretsmanager/secret.go index f62772e5fe..d5c663c33c 100644 --- a/pkg/cloud/services/secretsmanager/secret.go +++ b/pkg/cloud/services/secretsmanager/secret.go @@ -24,7 +24,7 @@ import ( "github.com/aws/aws-sdk-go/service/secretsmanager" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/uuid" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" diff --git a/pkg/cloud/services/securitygroup/securitygroups.go b/pkg/cloud/services/securitygroup/securitygroups.go index 10a3651b06..5ade63b6f2 100644 --- a/pkg/cloud/services/securitygroup/securitygroups.go +++ b/pkg/cloud/services/securitygroup/securitygroups.go @@ -24,7 +24,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/pkg/errors" kerrors "k8s.io/apimachinery/pkg/util/errors" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/filter" @@ -32,7 +32,7 @@ import ( "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/wait" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/tags" "sigs.k8s.io/cluster-api-provider-aws/pkg/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" ) diff --git a/pkg/cloud/services/securitygroup/securitygroups_test.go b/pkg/cloud/services/securitygroup/securitygroups_test.go index 5ba4f635e7..7a85ed7ceb 100644 --- a/pkg/cloud/services/securitygroup/securitygroups_test.go +++ b/pkg/cloud/services/securitygroup/securitygroups_test.go @@ -30,11 +30,11 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/sets" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2/mock_ec2iface" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client/fake" ) diff --git a/pkg/cloud/services/securitygroup/service.go b/pkg/cloud/services/securitygroup/service.go index c19fd0003a..55aab41cf0 100644 --- a/pkg/cloud/services/securitygroup/service.go +++ b/pkg/cloud/services/securitygroup/service.go @@ -19,7 +19,7 @@ package securitygroup import ( "github.com/aws/aws-sdk-go/service/ec2/ec2iface" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" ) diff --git a/pkg/cloud/services/ssm/secret.go b/pkg/cloud/services/ssm/secret.go index 03ad741bcc..ee6d44c3a8 100644 --- a/pkg/cloud/services/ssm/secret.go +++ b/pkg/cloud/services/ssm/secret.go @@ -25,7 +25,7 @@ import ( "github.com/aws/aws-sdk-go/service/ssm" kerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/uuid" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/awserrors" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/converters" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" diff --git a/pkg/cloud/tags/tags.go b/pkg/cloud/tags/tags.go index 0703625b39..a54ea29807 100644 --- a/pkg/cloud/tags/tags.go +++ b/pkg/cloud/tags/tags.go @@ -27,7 +27,7 @@ import ( "github.com/aws/aws-sdk-go/service/eks/eksiface" "github.com/pkg/errors" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ) var ( diff --git a/pkg/cloud/tags/tags_test.go b/pkg/cloud/tags/tags_test.go index bb88c20ca6..164658d80e 100644 --- a/pkg/cloud/tags/tags_test.go +++ b/pkg/cloud/tags/tags_test.go @@ -20,7 +20,7 @@ import ( "reflect" "testing" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ) func TestTags_ComputeDiff(t *testing.T) { diff --git a/pkg/eks/addons/plan.go b/pkg/eks/addons/plan.go index 793b55481c..1dcc6b5c8d 100644 --- a/pkg/eks/addons/plan.go +++ b/pkg/eks/addons/plan.go @@ -22,7 +22,7 @@ import ( "github.com/aws/aws-sdk-go/service/eks" "github.com/aws/aws-sdk-go/service/eks/eksiface" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/planner" ) diff --git a/pkg/eks/addons/plan_test.go b/pkg/eks/addons/plan_test.go index 33a70c98b0..c7b0f62350 100644 --- a/pkg/eks/addons/plan_test.go +++ b/pkg/eks/addons/plan_test.go @@ -26,7 +26,7 @@ import ( "github.com/golang/mock/gomock" . "github.com/onsi/gomega" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/eks/mock_eksiface" ) diff --git a/pkg/eks/addons/types.go b/pkg/eks/addons/types.go index 72cce15462..1641a62171 100644 --- a/pkg/eks/addons/types.go +++ b/pkg/eks/addons/types.go @@ -19,7 +19,7 @@ package addons import ( "reflect" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ) // EKSAddon represents an EKS addon. diff --git a/pkg/eks/identityprovider/plan_test.go b/pkg/eks/identityprovider/plan_test.go index 7ecfa74800..657e96403e 100644 --- a/pkg/eks/identityprovider/plan_test.go +++ b/pkg/eks/identityprovider/plan_test.go @@ -26,7 +26,7 @@ import ( . "github.com/onsi/gomega" "k8s.io/klog/v2/klogr" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/eks/mock_eksiface" ) diff --git a/pkg/eks/identityprovider/types.go b/pkg/eks/identityprovider/types.go index c8cae81a1e..b5308d2613 100644 --- a/pkg/eks/identityprovider/types.go +++ b/pkg/eks/identityprovider/types.go @@ -19,7 +19,7 @@ package identityprovider import ( "reflect" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ) // OidcIdentityProviderConfig represents the configuration for an OpenID Connect (OIDC) diff --git a/pkg/record/recorder.go b/pkg/record/recorder.go index 469172bbd4..b45e478722 100644 --- a/pkg/record/recorder.go +++ b/pkg/record/recorder.go @@ -21,22 +21,22 @@ import ( "sync" corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/client-go/tools/record" + runtime "k8s.io/apimachinery/pkg/runtime" + cgrecord "k8s.io/client-go/tools/record" ) var ( initOnce sync.Once - defaultRecorder record.EventRecorder + defaultRecorder cgrecord.EventRecorder ) func init() { - defaultRecorder = new(record.FakeRecorder) + defaultRecorder = new(cgrecord.FakeRecorder) } // InitFromRecorder initializes the global default recorder. It can only be called once. // Subsequent calls are considered noops. -func InitFromRecorder(recorder record.EventRecorder) { +func InitFromRecorder(recorder cgrecord.EventRecorder) { initOnce.Do(func() { defaultRecorder = recorder }) diff --git a/scripts/ci-test.sh b/scripts/ci-test.sh index 8fde415a6f..413dec302c 100755 --- a/scripts/ci-test.sh +++ b/scripts/ci-test.sh @@ -22,8 +22,8 @@ REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. # shellcheck source=../hack/ensure-go.sh source "${REPO_ROOT}/hack/ensure-go.sh" -cd "${REPO_ROOT}" && \ - source ./scripts/fetch_ext_bins.sh && \ - fetch_tools && \ - setup_envs && \ - make generate lint test +cd "${REPO_ROOT}" && + source ./scripts/fetch_ext_bins.sh && + fetch_tools && + setup_envs && + make lint test diff --git a/templates/cluster-template-eks-fargate.yaml b/templates/cluster-template-eks-fargate.yaml index 3dd5999b40..e14cc7644b 100644 --- a/templates/cluster-template-eks-fargate.yaml +++ b/templates/cluster-template-eks-fargate.yaml @@ -1,5 +1,5 @@ --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: "${CLUSTER_NAME}" @@ -9,20 +9,20 @@ spec: cidrBlocks: ["192.168.0.0/16"] infrastructureRef: kind: AWSManagedControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" controlPlaneRef: kind: AWSManagedControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSManagedCluster metadata: name: "${CLUSTER_NAME}" --- kind: AWSManagedControlPlane -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane" spec: @@ -30,7 +30,7 @@ spec: sshKeyName: "${AWS_SSH_KEY_NAME}" version: "${KUBERNETES_VERSION}" --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSFargateProfile metadata: name: "${CLUSTER_NAME}-fargate-0" diff --git a/templates/cluster-template-eks-managedmachinepool-gpu.yaml b/templates/cluster-template-eks-managedmachinepool-gpu.yaml index b69d941a38..4b916128ba 100644 --- a/templates/cluster-template-eks-managedmachinepool-gpu.yaml +++ b/templates/cluster-template-eks-managedmachinepool-gpu.yaml @@ -1,5 +1,5 @@ --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: "${CLUSTER_NAME}" @@ -11,15 +11,15 @@ spec: cidrBlocks: ["192.168.0.0/16"] infrastructureRef: kind: AWSManagedControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" controlPlaneRef: kind: AWSManagedControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" --- kind: AWSManagedControlPlane -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane" spec: @@ -31,7 +31,7 @@ spec: version: "${VPC_ADDON_VERSION:=v1.7.5-eksbuild.1}" conflictResolution: "overwrite" --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: MachinePool metadata: name: "${CLUSTER_NAME}-pool-0" @@ -45,10 +45,10 @@ spec: dataSecretName: "" infrastructureRef: name: "${CLUSTER_NAME}-pool-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSManagedMachinePool --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSManagedMachinePool metadata: name: "${CLUSTER_NAME}-pool-0" @@ -56,7 +56,7 @@ spec: amiType: "AL2_x86_64_GPU" instanceType: "g4dn.xlarge" --- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 +apiVersion: addons.cluster.x-k8s.io/v1beta1 kind: ClusterResourceSet metadata: name: crs-nvidia diff --git a/templates/cluster-template-eks-managedmachinepool-vpccni.yaml b/templates/cluster-template-eks-managedmachinepool-vpccni.yaml index e93f969276..7f4d9ae3d8 100644 --- a/templates/cluster-template-eks-managedmachinepool-vpccni.yaml +++ b/templates/cluster-template-eks-managedmachinepool-vpccni.yaml @@ -1,5 +1,5 @@ --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: "${CLUSTER_NAME}" @@ -9,15 +9,15 @@ spec: cidrBlocks: ["192.168.0.0/16"] infrastructureRef: kind: AWSManagedControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" controlPlaneRef: kind: AWSManagedControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" --- kind: AWSManagedControlPlane -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane" spec: @@ -29,7 +29,7 @@ spec: version: "${VPC_ADDON_VERSION:=v1.7.5-eksbuild.1}" conflictResolution: "overwrite" --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: MachinePool metadata: name: "${CLUSTER_NAME}-pool-0" @@ -43,10 +43,10 @@ spec: dataSecretName: "" infrastructureRef: name: "${CLUSTER_NAME}-pool-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSManagedMachinePool --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSManagedMachinePool metadata: name: "${CLUSTER_NAME}-pool-0" diff --git a/templates/cluster-template-eks-managedmachinepool.yaml b/templates/cluster-template-eks-managedmachinepool.yaml index aec951c0e8..93ce90497e 100644 --- a/templates/cluster-template-eks-managedmachinepool.yaml +++ b/templates/cluster-template-eks-managedmachinepool.yaml @@ -1,5 +1,5 @@ --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: "${CLUSTER_NAME}" @@ -9,15 +9,15 @@ spec: cidrBlocks: ["192.168.0.0/16"] infrastructureRef: kind: AWSManagedControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" controlPlaneRef: kind: AWSManagedControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" --- kind: AWSManagedControlPlane -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane" spec: @@ -25,7 +25,7 @@ spec: sshKeyName: "${AWS_SSH_KEY_NAME}" version: "${KUBERNETES_VERSION}" --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: MachinePool metadata: name: "${CLUSTER_NAME}-pool-0" @@ -39,10 +39,10 @@ spec: dataSecretName: "" infrastructureRef: name: "${CLUSTER_NAME}-pool-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSManagedMachinePool --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSManagedMachinePool metadata: name: "${CLUSTER_NAME}-pool-0" diff --git a/templates/cluster-template-eks.yaml b/templates/cluster-template-eks.yaml index 8a11701fd4..1d8ddb74ae 100644 --- a/templates/cluster-template-eks.yaml +++ b/templates/cluster-template-eks.yaml @@ -1,5 +1,5 @@ --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: "${CLUSTER_NAME}" @@ -9,15 +9,15 @@ spec: cidrBlocks: ["192.168.0.0/16"] infrastructureRef: kind: AWSManagedControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" controlPlaneRef: kind: AWSManagedControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" --- kind: AWSManagedControlPlane -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane" spec: @@ -25,7 +25,7 @@ spec: sshKeyName: "${AWS_SSH_KEY_NAME}" version: "${KUBERNETES_VERSION}" --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: MachineDeployment metadata: name: "${CLUSTER_NAME}-md-0" @@ -41,14 +41,14 @@ spec: bootstrap: configRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: EKSConfigTemplate infrastructureRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachineTemplate --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachineTemplate metadata: name: "${CLUSTER_NAME}-md-0" @@ -59,11 +59,9 @@ spec: iamInstanceProfile: "nodes.cluster-api-provider-aws.sigs.k8s.io" sshKeyName: "${AWS_SSH_KEY_NAME}" --- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 +apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: EKSConfigTemplate metadata: name: "${CLUSTER_NAME}-md-0" spec: template: {} - - diff --git a/templates/cluster-template-machinepool.yaml b/templates/cluster-template-machinepool.yaml index a5ee5a5156..f077264717 100644 --- a/templates/cluster-template-machinepool.yaml +++ b/templates/cluster-template-machinepool.yaml @@ -1,19 +1,19 @@ --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: "${CLUSTER_NAME}" spec: infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSCluster name: "${CLUSTER_NAME}" controlPlaneRef: kind: KubeadmControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSCluster metadata: name: "${CLUSTER_NAME}" @@ -22,7 +22,7 @@ spec: sshKeyName: "${AWS_SSH_KEY_NAME}" --- kind: KubeadmControlPlane -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane" spec: @@ -30,7 +30,7 @@ spec: machineTemplate: infrastructureRef: kind: AWSMachineTemplate - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" kubeadmConfigSpec: initConfiguration: @@ -53,7 +53,7 @@ spec: version: "${KUBERNETES_VERSION}" --- kind: AWSMachineTemplate -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane" spec: @@ -63,7 +63,7 @@ spec: iamInstanceProfile: "control-plane.cluster-api-provider-aws.sigs.k8s.io" sshKeyName: "${AWS_SSH_KEY_NAME}" --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: MachinePool metadata: name: ${CLUSTER_NAME}-mp-0 @@ -75,17 +75,17 @@ spec: spec: bootstrap: configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: KubeadmConfig name: ${CLUSTER_NAME}-mp-0 clusterName: ${CLUSTER_NAME} infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachinePool name: ${CLUSTER_NAME}-mp-0 version: ${KUBERNETES_VERSION} --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachinePool metadata: name: ${CLUSTER_NAME}-mp-0 @@ -93,7 +93,7 @@ metadata: spec: minSize: 1 maxSize: 10 - availabilityZones: + availabilityZones: - "${AWS_REGION}" awsLaunchTemplate: instanceType: "${AWS_CONTROL_PLANE_MACHINE_TYPE}" @@ -101,7 +101,7 @@ spec: subnets: - ${AWS_SUBNET} --- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 +apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: KubeadmConfig metadata: name: ${CLUSTER_NAME}-mp-0 diff --git a/templates/cluster-template.yaml b/templates/cluster-template.yaml index 7a17f44def..ca118b6eb5 100644 --- a/templates/cluster-template.yaml +++ b/templates/cluster-template.yaml @@ -1,5 +1,5 @@ --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: "${CLUSTER_NAME}" @@ -8,15 +8,15 @@ spec: pods: cidrBlocks: ["192.168.0.0/16"] infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSCluster name: "${CLUSTER_NAME}" controlPlaneRef: kind: KubeadmControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSCluster metadata: name: "${CLUSTER_NAME}" @@ -25,7 +25,7 @@ spec: sshKeyName: "${AWS_SSH_KEY_NAME}" --- kind: KubeadmControlPlane -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane" spec: @@ -33,7 +33,7 @@ spec: machineTemplate: infrastructureRef: kind: AWSMachineTemplate - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" kubeadmConfigSpec: initConfiguration: @@ -56,7 +56,7 @@ spec: version: "${KUBERNETES_VERSION}" --- kind: AWSMachineTemplate -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane" spec: @@ -66,7 +66,7 @@ spec: iamInstanceProfile: "control-plane.cluster-api-provider-aws.sigs.k8s.io" sshKeyName: "${AWS_SSH_KEY_NAME}" --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: MachineDeployment metadata: name: "${CLUSTER_NAME}-md-0" @@ -82,14 +82,14 @@ spec: bootstrap: configRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: KubeadmConfigTemplate infrastructureRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachineTemplate --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachineTemplate metadata: name: "${CLUSTER_NAME}-md-0" @@ -100,7 +100,7 @@ spec: iamInstanceProfile: "nodes.cluster-api-provider-aws.sigs.k8s.io" sshKeyName: "${AWS_SSH_KEY_NAME}" --- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 +apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: KubeadmConfigTemplate metadata: name: "${CLUSTER_NAME}-md-0" diff --git a/test/e2e/data/ci-artifacts-platform-kustomization-for-upgrade.yaml b/test/e2e/data/ci-artifacts-platform-kustomization-for-upgrade.yaml index be0665cfb1..8d6d073509 100644 --- a/test/e2e/data/ci-artifacts-platform-kustomization-for-upgrade.yaml +++ b/test/e2e/data/ci-artifacts-platform-kustomization-for-upgrade.yaml @@ -1,5 +1,5 @@ --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: MachineDeployment metadata: name: "${CLUSTER_NAME}-md-0" @@ -8,16 +8,16 @@ spec: spec: infrastructureRef: name: "${CLUSTER_NAME}-md-1" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachineTemplate --- kind: KubeadmControlPlane -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane" spec: machineTemplate: infrastructureRef: kind: AWSMachineTemplate - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane-1" diff --git a/test/e2e/data/ci-artifacts-platform-kustomization.yaml b/test/e2e/data/ci-artifacts-platform-kustomization.yaml index 5a47eb99bb..350740ca58 100644 --- a/test/e2e/data/ci-artifacts-platform-kustomization.yaml +++ b/test/e2e/data/ci-artifacts-platform-kustomization.yaml @@ -1,5 +1,5 @@ --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachineTemplate metadata: name: "${CLUSTER_NAME}-control-plane" @@ -9,7 +9,7 @@ spec: ami: id: ${IMAGE_ID} --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachineTemplate metadata: name: ${CLUSTER_NAME}-md-0 diff --git a/test/e2e/data/e2e_conf.yaml b/test/e2e/data/e2e_conf.yaml index 03688bf7b9..3a43ec28b0 100644 --- a/test/e2e/data/e2e_conf.yaml +++ b/test/e2e/data/e2e_conf.yaml @@ -19,27 +19,41 @@ images: loadBehavior: mustLoad ## PLEASE KEEP THESE UP TO DATE WITH THE COMPONENTS - - name: quay.io/jetstack/cert-manager-cainjector:v1.1.0 + + # Cluster API v1beta1 Preloads + - name: quay.io/jetstack/cert-manager-cainjector:v1.5.0 loadBehavior: tryLoad - - name: quay.io/jetstack/cert-manager-webhook:v1.1.0 + - name: quay.io/jetstack/cert-manager-webhook:v1.5.0 loadBehavior: tryLoad - - name: quay.io/jetstack/cert-manager-controller:v1.1.0 + - name: quay.io/jetstack/cert-manager-controller:v1.5.0 loadBehavior: tryLoad - - name: k8s.gcr.io/cluster-api/kubeadm-control-plane-controller:v0.4.1 + - name: k8s.gcr.io/cluster-api/cluster-api-controller:v1.0.0-rc.0 loadBehavior: tryLoad - - name: k8s.gcr.io/cluster-api/kubeadm-bootstrap-controller:v0.4.1 + - name: k8s.gcr.io/cluster-api/kubeadm-bootstrap-controller:v1.0.0-rc.0 loadBehavior: tryLoad - - name: k8s.gcr.io/cluster-api/cluster-api-controller:v0.4.1 + - name: k8s.gcr.io/cluster-api/kubeadm-control-plane-controller:v1.0.0-rc.0 loadBehavior: tryLoad providers: - - name: cluster-api type: CoreProvider versions: - - name: v0.4.1 - # Use manifest from source files - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.1/core-components.yaml" + - name: v0.3.23 # latest published release in the v1alpha3 series; this is used for v1alpha3 --> v1beta1 clusterctl upgrades test only. + contract: v1alpha3 + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.3.23/core-components.yaml" + type: "url" + files: + - sourcePath: "./shared/v1alpha3/metadata.yaml" + replacements: + - old: "imagePullPolicy: Always" + new: "imagePullPolicy: IfNotPresent" + - old: "--leader-elect" + new: "--leader-elect=false" + - old: --metrics-bind-addr=127.0.0.1:8080 + new: --metrics-bind-addr=:8080 + - name: v0.4.3 # latest published release in the v1alpha4 series; this is used for v1alpha4 --> v1beta1 clusterctl upgrades test only. + contract: v1alpha4 + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.3/core-components.yaml" type: "url" files: - sourcePath: "./shared/v1alpha4/metadata.yaml" @@ -50,9 +64,12 @@ providers: new: "--leader-elect=false" - old: --metrics-bind-addr=127.0.0.1:8080 new: --metrics-bind-addr=:8080 - - name: v0.3.16 # latest published release - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.3.16/core-components.yaml" + - name: v1.0.0 + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.0-rc.0/core-components.yaml" type: "url" + contract: v1beta1 + files: + - sourcePath: "./shared/v1beta1/metadata.yaml" replacements: - old: "imagePullPolicy: Always" new: "imagePullPolicy: IfNotPresent" @@ -60,17 +77,39 @@ providers: new: "--leader-elect=false" - old: --metrics-bind-addr=127.0.0.1:8080 new: --metrics-bind-addr=:8080 - - - name: kubeadm type: BootstrapProvider files: - sourcePath: "./shared/v1alpha4/metadata.yaml" versions: - - name: v0.4.1 - # Use manifest from source files - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.1/bootstrap-components.yaml" + - name: v0.3.23 # latest published release in the v1alpha3 series; this is used for v1alpha3 --> v1beta1 clusterctl upgrades test only. + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.3.23/bootstrap-components.yaml" type: "url" + contract: v1alpha3 + files: + - sourcePath: "./shared/v1alpha3/metadata.yaml" + replacements: + - old: --metrics-addr=127.0.0.1:8080 + new: --metrics-addr=:8080 + - name: v0.4.3 # latest published release in the v1alpha4 series; this is used for v1alpha4 --> v1beta1 clusterctl upgrades test only. + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.3/bootstrap-components.yaml" + type: "url" + contract: v1alpha4 + files: + - sourcePath: "./shared/v1alpha4/metadata.yaml" + replacements: + - old: "imagePullPolicy: Always" + new: "imagePullPolicy: IfNotPresent" + - old: "--leader-elect" + new: "--leader-elect=false" + - old: --metrics-bind-addr=127.0.0.1:8080 + new: --metrics-bind-addr=:8080 + - name: v1.0.0 + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.0-rc.0/bootstrap-components.yaml" + type: "url" + contract: v1beta1 + files: + - sourcePath: "./shared/v1beta1/metadata.yaml" replacements: - old: "imagePullPolicy: Always" new: "imagePullPolicy: IfNotPresent" @@ -84,10 +123,35 @@ providers: files: - sourcePath: "./shared/v1alpha4/metadata.yaml" versions: - - name: v0.4.1 + - name: v0.3.23 # latest published release in the v1alpha3 series; this is used for v1alpha3 --> v1beta1 clusterctl upgrades test only. + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.3.23/control-plane-components.yaml" + type: "url" + contract: v1alpha3 + files: + - sourcePath: "./shared/v1alpha3/metadata.yaml" + replacements: + - old: --metrics-addr=127.0.0.1:8080 + new: --metrics-addr=:8080 + - name: v0.4.3 # latest published release in the v1alpha4 series; this is used for v1alpha4 --> v1beta1 clusterctl upgrades test only. # Use manifest from source files - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.1/control-plane-components.yaml" + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.3/control-plane-components.yaml" type: "url" + contract: v1alpha4 + files: + - sourcePath: "./shared/v1alpha4/metadata.yaml" + replacements: + - old: "imagePullPolicy: Always" + new: "imagePullPolicy: IfNotPresent" + - old: "--leader-elect" + new: "--leader-elect=false" + - old: --metrics-bind-addr=127.0.0.1:8080 + new: --metrics-bind-addr=:8080 + - name: v1.0.0 + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.0-rc.0/control-plane-components.yaml" + type: "url" + contract: v1beta1 + files: + - sourcePath: "./shared/v1beta1/metadata.yaml" replacements: - old: "imagePullPolicy: Always" new: "imagePullPolicy: IfNotPresent" @@ -95,15 +159,43 @@ providers: new: "--leader-elect=false" - old: --metrics-bind-addr=127.0.0.1:8080 new: --metrics-bind-addr=:8080 - - name: aws type: InfrastructureProvider versions: - - name: v0.7.0 + - name: v0.6.8 # latest published release in the v1alpha3 series; this is used for v1alpha3 --> v1beta1 clusterctl upgrades test only. + value: "https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/download/v0.6.8/infrastructure-components.yaml" + type: "url" + contract: v1alpha3 + files: + - sourcePath: "./shared/v1alpha3_provider/metadata.yaml" + - sourcePath: "./infrastructure-aws/capi-upgrades/v1alpha3/cluster-template.yaml" + - name: v0.7.0 # latest published release in the v1alpha4 series; this is used for v1alpha4 --> v1beta1 clusterctl upgrades test only. + value: "https://github.com/kubernetes-sigs/cluster-api-provider-aws/releases/download/v0.7.0/infrastructure-components.yaml" + type: "url" + contract: v1alpha4 + files: + - sourcePath: "./shared/v1alpha4_provider/metadata.yaml" + - sourcePath: "./infrastructure-aws/capi-upgrades/v1alpha4/cluster-template.yaml" + - name: v1.0.0 # Use manifest from source files value: ../../../config/default + contract: v1beta1 files: - - sourcePath: "./shared/v1alpha4_provider/metadata.yaml" + - sourcePath: "./shared/v1beta1_provider/metadata.yaml" + - sourcePath: "./infrastructure-aws/generated/cluster-template.yaml" + - sourcePath: "./infrastructure-aws/generated/cluster-template-capi-upgrade.yaml" + - sourcePath: "./infrastructure-aws/generated/cluster-template-ssm.yaml" + - sourcePath: "./infrastructure-aws/generated/cluster-template-multi-az.yaml" + - sourcePath: "./infrastructure-aws/generated/cluster-template-limit-az.yaml" + - sourcePath: "./infrastructure-aws/generated/cluster-template-spot-instances.yaml" + - sourcePath: "./infrastructure-aws/generated/cluster-template-md-remediation.yaml" + - sourcePath: "./infrastructure-aws/generated/cluster-template-kcp-remediation.yaml" + - sourcePath: "./infrastructure-aws/generated/cluster-template-kcp-scale-in.yaml" + - sourcePath: "./infrastructure-aws/generated/cluster-template-machine-pool.yaml" + - sourcePath: "./infrastructure-aws/generated/cluster-template-upgrade-to-main.yaml" + - sourcePath: "./infrastructure-aws/generated/cluster-template-simple-multitenancy.yaml" + - sourcePath: "./infrastructure-aws/generated/cluster-template-nested-multitenancy.yaml" + - sourcePath: "./infrastructure-aws/generated/cluster-template-external-cloud-provider.yaml" replacements: - old: "imagePullPolicy: Always" new: "imagePullPolicy: IfNotPresent" @@ -115,35 +207,6 @@ providers: new: gcr.io/k8s-staging-cluster-api/capa-manager:e2e - old: gcr.io/k8s-staging-cluster-api-aws/cluster-api-aws-controller:latest new: gcr.io/k8s-staging-cluster-api/capa-manager:e2e - files: - # Add a cluster template - - sourcePath: "./shared/v1alpha4/metadata.yaml" - targetName: "metadata.yaml" - - sourcePath: "./infrastructure-aws/cluster-template.yaml" - - sourcePath: "./infrastructure-aws/cluster-template-ssm.yaml" - targetName: "cluster-template-ssm.yaml" - - sourcePath: "./infrastructure-aws/cluster-template-multi-az.yaml" - targetName: "cluster-template-multi-az.yaml" - - sourcePath: "./infrastructure-aws/cluster-template-limit-az.yaml" - targetName: "cluster-template-limit-az.yaml" - - sourcePath: "./infrastructure-aws/cluster-template-spot-instances.yaml" - targetName: "cluster-template-spot-instances.yaml" - - sourcePath: "./infrastructure-aws/cluster-template-md-remediation.yaml" - targetName: "cluster-template-md-remediation.yaml" - - sourcePath: "./infrastructure-aws/cluster-template-kcp-remediation.yaml" - targetName: "cluster-template-kcp-remediation.yaml" - - sourcePath: "./infrastructure-aws/cluster-template-kcp-scale-in.yaml" - targetName: "cluster-template-kcp-scale-in.yaml" - - sourcePath: "./infrastructure-aws/cluster-template-machine-pool.yaml" - targetName: "cluster-template-machine-pool.yaml" - - sourcePath: "./infrastructure-aws/cluster-template-upgrade-to-main.yaml" - targetName: "cluster-template-upgrade-to-main.yaml" - - sourcePath: "./infrastructure-aws/cluster-template-simple-multitenancy.yaml" - targetName: "cluster-template-simple-multitenancy.yaml" - - sourcePath: "./infrastructure-aws/cluster-template-nested-multitenancy.yaml" - targetName: "cluster-template-nested-multitenancy.yaml" - - sourcePath: "./infrastructure-aws/cluster-template-external-cloud-provider.yaml" - targetName: "cluster-template-external-cloud-provider.yaml" variables: CNI: "../../data/cni/calico.yaml" @@ -164,6 +227,11 @@ variables: MULTI_TENANCY_ROLE_NAME: "multi-tenancy-role" MULTI_TENANCY_NESTED_ROLE_NAME: "multi-tenancy-nested-role" IP_FAMILY: "IPv4" + # NOTE: INIT_WITH_BINARY and INIT_WITH_KUBERNETES_VERSION are only used by the clusterctl upgrade test to initialize + # the management cluster to be upgraded. + INIT_WITH_BINARY: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.3.23/clusterctl-{OS}-{ARCH}" + INIT_WITH_PROVIDERS_CONTRACT: "v1alpha3" + INIT_WITH_KUBERNETES_VERSION: "v1.21.2" intervals: default/wait-cluster: ["25m", "10s"] diff --git a/test/e2e/data/e2e_eks_conf.yaml b/test/e2e/data/e2e_eks_conf.yaml index e214f79819..6ffe10922a 100644 --- a/test/e2e/data/e2e_eks_conf.yaml +++ b/test/e2e/data/e2e_eks_conf.yaml @@ -19,29 +19,121 @@ images: loadBehavior: mustLoad ## PLEASE KEEP THESE UP TO DATE WITH THE COMPONENTS - - name: quay.io/jetstack/cert-manager-cainjector:v1.1.0 + - name: quay.io/jetstack/cert-manager-cainjector:v1.5.0 loadBehavior: tryLoad - - name: quay.io/jetstack/cert-manager-webhook:v1.1.0 + - name: quay.io/jetstack/cert-manager-webhook:v1.5.0 loadBehavior: tryLoad - - name: quay.io/jetstack/cert-manager-controller:v1.1.0 + - name: quay.io/jetstack/cert-manager-controller:v1.5.0 loadBehavior: tryLoad - - name: k8s.gcr.io/cluster-api/kubeadm-control-plane-controller:v0.4.1 + - name: k8s.gcr.io/cluster-api/kubeadm-control-plane-controller:v1.0.0-rc.0 loadBehavior: tryLoad - - name: k8s.gcr.io/cluster-api/kubeadm-bootstrap-controller:v0.4.1 + - name: k8s.gcr.io/cluster-api/kubeadm-bootstrap-controller:v1.0.0-rc.0 loadBehavior: tryLoad - - name: k8s.gcr.io/cluster-api/cluster-api-controller:v0.4.1 + - name: k8s.gcr.io/cluster-api/cluster-api-controller:v1.0.0-rc.0 loadBehavior: tryLoad - providers: - - name: cluster-api type: CoreProvider versions: - - name: v0.4.1 + - name: v0.3.23 # latest published release in the v1alpha3 series; this is used for v1alpha3 --> v1beta1 clusterctl upgrades test only. + contract: v1alpha3 + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.3.23/core-components.yaml" + type: "url" + files: + - sourcePath: "./shared/v1alpha3/metadata.yaml" + replacements: + - old: "imagePullPolicy: Always" + new: "imagePullPolicy: IfNotPresent" + - old: "--leader-elect" + new: "--leader-elect=false" + - old: --metrics-bind-addr=127.0.0.1:8080 + new: --metrics-bind-addr=:8080 + - name: v0.4.3 # latest published release in the v1alpha4 series; this is used for v1alpha4 --> v1beta1 clusterctl upgrades test only. + contract: v1alpha4 + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.3/core-components.yaml" + type: "url" + files: + - sourcePath: "./shared/v1alpha4/metadata.yaml" + replacements: + - old: "imagePullPolicy: Always" + new: "imagePullPolicy: IfNotPresent" + - old: "--leader-elect" + new: "--leader-elect=false" + - old: --metrics-bind-addr=127.0.0.1:8080 + new: --metrics-bind-addr=:8080 + - name: v1.0.0 + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.0-rc.0/core-components.yaml" + type: "url" + contract: v1beta1 + files: + - sourcePath: "./shared/v1beta1/metadata.yaml" + replacements: + - old: "imagePullPolicy: Always" + new: "imagePullPolicy: IfNotPresent" + - old: "--leader-elect" + new: "--leader-elect=false" + - old: --metrics-bind-addr=127.0.0.1:8080 + new: --metrics-bind-addr=:8080 + - name: kubeadm + type: BootstrapProvider + files: + - sourcePath: "./shared/v1alpha4/metadata.yaml" + versions: + - name: v0.3.23 # latest published release in the v1alpha3 series; this is used for v1alpha3 --> v1beta1 clusterctl upgrades test only. + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.3.23/bootstrap-components.yaml" + type: "url" + contract: v1alpha3 + files: + - sourcePath: "./shared/v1alpha3/metadata.yaml" + replacements: + - old: --metrics-addr=127.0.0.1:8080 + new: --metrics-addr=:8080 + - name: v0.4.3 # latest published release in the v1alpha4 series; this is used for v1alpha4 --> v1beta1 clusterctl upgrades test only. + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.3/bootstrap-components.yaml" + type: "url" + contract: v1alpha4 + files: + - sourcePath: "./shared/v1alpha4/metadata.yaml" + replacements: + - old: "imagePullPolicy: Always" + new: "imagePullPolicy: IfNotPresent" + - old: "--leader-elect" + new: "--leader-elect=false" + - old: --metrics-bind-addr=127.0.0.1:8080 + new: --metrics-bind-addr=:8080 + - name: v1.0.0 + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.0-rc.0/bootstrap-components.yaml" + type: "url" + contract: v1beta1 + files: + - sourcePath: "./shared/v1beta1/metadata.yaml" + replacements: + - old: "imagePullPolicy: Always" + new: "imagePullPolicy: IfNotPresent" + - old: "--leader-elect" + new: "--leader-elect=false" + - old: --metrics-bind-addr=127.0.0.1:8080 + new: --metrics-bind-addr=:8080 + - name: kubeadm + type: ControlPlaneProvider + files: + - sourcePath: "./shared/v1alpha4/metadata.yaml" + versions: + - name: v0.3.23 # latest published release in the v1alpha3 series; this is used for v1alpha3 --> v1beta1 clusterctl upgrades test only. + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.3.23/control-plane-components.yaml" + type: "url" + contract: v1alpha3 + files: + - sourcePath: "./shared/v1alpha3/metadata.yaml" + replacements: + - old: --metrics-addr=127.0.0.1:8080 + new: --metrics-addr=:8080 + - name: v0.4.3 # latest published release in the v1alpha4 series; this is used for v1alpha4 --> v1beta1 clusterctl upgrades test only. # Use manifest from source files - value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.1/core-components.yaml" + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.3/control-plane-components.yaml" type: "url" + contract: v1alpha4 files: - sourcePath: "./shared/v1alpha4/metadata.yaml" replacements: @@ -51,15 +143,27 @@ providers: new: "--leader-elect=false" - old: --metrics-bind-addr=127.0.0.1:8080 new: --metrics-bind-addr=:8080 - + - name: v1.0.0 + value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.0.0-rc.0/control-plane-components.yaml" + type: "url" + contract: v1beta1 + files: + - sourcePath: "./shared/v1beta1/metadata.yaml" + replacements: + - old: "imagePullPolicy: Always" + new: "imagePullPolicy: IfNotPresent" + - old: "--leader-elect" + new: "--leader-elect=false" + - old: --metrics-bind-addr=127.0.0.1:8080 + new: --metrics-bind-addr=:8080 - name: aws type: InfrastructureProvider versions: - - name: v0.7.0 + - name: v1.0.0 # Use manifest from source files value: ../../../config/default files: - - sourcePath: "./shared/v1alpha4_provider/metadata.yaml" + - sourcePath: "./shared/v1beta1_provider/metadata.yaml" replacements: - old: "imagePullPolicy: Always" new: "imagePullPolicy: IfNotPresent" @@ -72,8 +176,6 @@ providers: - old: gcr.io/k8s-staging-cluster-api-aws/cluster-api-aws-controller:latest new: gcr.io/k8s-staging-cluster-api/capa-manager:e2e files: - - sourcePath: "./shared/v1alpha4/metadata.yaml" - targetName: "metadata.yaml" - sourcePath: "./eks/cluster-template-eks-control-plane-only.yaml" targetName: "cluster-template-eks-control-plane-only.yaml" - sourcePath: "./eks/cluster-template-eks-control-plane-only-withaddon.yaml" @@ -85,7 +187,6 @@ providers: - sourcePath: "./eks/cluster-template-eks-managedmachinepool.yaml" targetName: "cluster-template-eks-managedmachinepool.yaml" - variables: KUBERNETES_VERSION: "v1.19.8" CNI: "../../data/cni/calico_eks.yaml" diff --git a/test/e2e/data/eks/cluster-template-eks-control-plane-only-withaddon.yaml b/test/e2e/data/eks/cluster-template-eks-control-plane-only-withaddon.yaml index 32065a2fae..ce04ca372f 100644 --- a/test/e2e/data/eks/cluster-template-eks-control-plane-only-withaddon.yaml +++ b/test/e2e/data/eks/cluster-template-eks-control-plane-only-withaddon.yaml @@ -1,5 +1,5 @@ --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: "${CLUSTER_NAME}" @@ -9,15 +9,15 @@ spec: cidrBlocks: ["192.168.0.0/16"] infrastructureRef: kind: AWSManagedControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" controlPlaneRef: kind: AWSManagedControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" --- kind: AWSManagedControlPlane -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane" spec: diff --git a/test/e2e/data/eks/cluster-template-eks-control-plane-only.yaml b/test/e2e/data/eks/cluster-template-eks-control-plane-only.yaml index 5b05b3a433..0e753b1461 100644 --- a/test/e2e/data/eks/cluster-template-eks-control-plane-only.yaml +++ b/test/e2e/data/eks/cluster-template-eks-control-plane-only.yaml @@ -1,5 +1,5 @@ --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: "${CLUSTER_NAME}" @@ -9,15 +9,15 @@ spec: cidrBlocks: ["192.168.0.0/16"] infrastructureRef: kind: AWSManagedControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" controlPlaneRef: kind: AWSManagedControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" --- kind: AWSManagedControlPlane -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane" spec: diff --git a/test/e2e/data/eks/cluster-template-eks-machine-deployment-only.yaml b/test/e2e/data/eks/cluster-template-eks-machine-deployment-only.yaml index 09f9b94eb8..26309bcbfc 100644 --- a/test/e2e/data/eks/cluster-template-eks-machine-deployment-only.yaml +++ b/test/e2e/data/eks/cluster-template-eks-machine-deployment-only.yaml @@ -1,4 +1,4 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: MachineDeployment metadata: name: "${CLUSTER_NAME}-md-0" @@ -14,14 +14,14 @@ spec: bootstrap: configRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: EKSConfigTemplate infrastructureRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachineTemplate --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachineTemplate metadata: name: "${CLUSTER_NAME}-md-0" @@ -32,7 +32,7 @@ spec: iamInstanceProfile: "nodes.cluster-api-provider-aws.sigs.k8s.io" sshKeyName: "${AWS_SSH_KEY_NAME}" --- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 +apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: EKSConfigTemplate metadata: name: "${CLUSTER_NAME}-md-0" diff --git a/test/e2e/data/eks/cluster-template-eks-managed-machinepool-only.yaml b/test/e2e/data/eks/cluster-template-eks-managed-machinepool-only.yaml index 4c906b12d5..e5f4d01f54 100644 --- a/test/e2e/data/eks/cluster-template-eks-managed-machinepool-only.yaml +++ b/test/e2e/data/eks/cluster-template-eks-managed-machinepool-only.yaml @@ -1,4 +1,4 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: MachinePool metadata: name: "${CLUSTER_NAME}-pool-0" @@ -12,14 +12,14 @@ spec: dataSecretName: "" infrastructureRef: name: "${CLUSTER_NAME}-pool-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSManagedMachinePool --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSManagedMachinePool metadata: name: "${CLUSTER_NAME}-pool-0" spec: scaling: minSize: 1 - maxSize: 2 \ No newline at end of file + maxSize: 2 diff --git a/test/e2e/data/eks/cluster-template-eks-managedmachinepool.yaml b/test/e2e/data/eks/cluster-template-eks-managedmachinepool.yaml index aec951c0e8..93ce90497e 100644 --- a/test/e2e/data/eks/cluster-template-eks-managedmachinepool.yaml +++ b/test/e2e/data/eks/cluster-template-eks-managedmachinepool.yaml @@ -1,5 +1,5 @@ --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: "${CLUSTER_NAME}" @@ -9,15 +9,15 @@ spec: cidrBlocks: ["192.168.0.0/16"] infrastructureRef: kind: AWSManagedControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" controlPlaneRef: kind: AWSManagedControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" --- kind: AWSManagedControlPlane -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane" spec: @@ -25,7 +25,7 @@ spec: sshKeyName: "${AWS_SSH_KEY_NAME}" version: "${KUBERNETES_VERSION}" --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: MachinePool metadata: name: "${CLUSTER_NAME}-pool-0" @@ -39,10 +39,10 @@ spec: dataSecretName: "" infrastructureRef: name: "${CLUSTER_NAME}-pool-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSManagedMachinePool --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSManagedMachinePool metadata: name: "${CLUSTER_NAME}-pool-0" diff --git a/test/e2e/data/infrastructure-aws/.gitignore b/test/e2e/data/infrastructure-aws/.gitignore new file mode 100644 index 0000000000..86d4c2dd38 --- /dev/null +++ b/test/e2e/data/infrastructure-aws/.gitignore @@ -0,0 +1 @@ +generated diff --git a/test/e2e/data/infrastructure-aws/README.md b/test/e2e/data/infrastructure-aws/README.md index 4ff249adff..d6aa0558fc 100644 --- a/test/e2e/data/infrastructure-aws/README.md +++ b/test/e2e/data/infrastructure-aws/README.md @@ -6,12 +6,12 @@ All the flavors that are tested in e2e suites are located under `./test/e2e/data To generate all e2e test flavors, run `make generate-test-flavors`. -To add a new cluster manifest for e2e tests, simply add a new directory under `./test/e2e/data/infrastructure-aws/` with a `kustomization.yaml` +To add a new cluster manifest for e2e tests, simply add a new directory under `./test/e2e/data/infrastructure-aws/kustomize_sources` with a `kustomization.yaml` Example: ```bash -cp ./test/e2e/data/infrastructure-aws/default/ ./test/e2e/data/infrastructure-aws/custom-template/ -# Do necessary changes in custom-template/. +cp -R ./test/e2e/data/infrastructure-aws/default/ ./test/e2e/data/infrastructure-aws/kustomize_sources/custom-template/ +# Do necessary changes in custom-template/. make generate-test-flavors ``` `cluster-template-custom.yaml` will be automatically created and can be found under `./test/e2e/data/infrastructure-aws/`. @@ -20,7 +20,7 @@ To use this new manifest in the tests, add it to `./test/e2e/data/e2e_conf.yaml` ```yaml files: # Add a cluster template - - sourcePath: "./infrastructure-aws/cluster-template-custom.yaml" + - sourcePath: "./infrastructure-aws/generated/cluster-template-custom.yaml" targetName: "cluster-template-custom.yaml" ``` @@ -31,4 +31,4 @@ In e2e tests, this manifest can be used by setting the flavor to `custom` (clust Flavor: "custom", }, }, result) -``` \ No newline at end of file +``` diff --git a/test/e2e/data/infrastructure-aws/capi-upgrades/v1alpha3/cluster-template.yaml b/test/e2e/data/infrastructure-aws/capi-upgrades/v1alpha3/cluster-template.yaml new file mode 100644 index 0000000000..0bafd4746e --- /dev/null +++ b/test/e2e/data/infrastructure-aws/capi-upgrades/v1alpha3/cluster-template.yaml @@ -0,0 +1,113 @@ +--- +apiVersion: cluster.x-k8s.io/v1alpha3 +kind: Cluster +metadata: + name: "${CLUSTER_NAME}" +spec: + clusterNetwork: + pods: + cidrBlocks: ["192.168.0.0/16"] + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 + kind: AWSCluster + name: "${CLUSTER_NAME}" + controlPlaneRef: + kind: KubeadmControlPlane + apiVersion: controlplane.cluster.x-k8s.io/v1alpha3 + name: "${CLUSTER_NAME}-control-plane" +--- +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 +kind: AWSCluster +metadata: + name: "${CLUSTER_NAME}" +spec: + region: "${AWS_REGION}" + sshKeyName: "${AWS_SSH_KEY_NAME}" +--- +kind: KubeadmControlPlane +apiVersion: controlplane.cluster.x-k8s.io/v1alpha3 +metadata: + name: "${CLUSTER_NAME}-control-plane" +spec: + replicas: ${CONTROL_PLANE_MACHINE_COUNT} + infrastructureTemplate: + kind: AWSMachineTemplate + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 + name: "${CLUSTER_NAME}-control-plane" + kubeadmConfigSpec: + initConfiguration: + nodeRegistration: + name: '{{ ds.meta_data.local_hostname }}' + kubeletExtraArgs: + cloud-provider: aws + clusterConfiguration: + apiServer: + extraArgs: + cloud-provider: aws + controllerManager: + extraArgs: + cloud-provider: aws + joinConfiguration: + nodeRegistration: + name: '{{ ds.meta_data.local_hostname }}' + kubeletExtraArgs: + cloud-provider: aws + version: "${KUBERNETES_VERSION}" +--- +kind: AWSMachineTemplate +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 +metadata: + name: "${CLUSTER_NAME}-control-plane" +spec: + template: + spec: + instanceType: "${AWS_CONTROL_PLANE_MACHINE_TYPE}" + iamInstanceProfile: "control-plane.cluster-api-provider-aws.sigs.k8s.io" + sshKeyName: "${AWS_SSH_KEY_NAME}" +--- +apiVersion: cluster.x-k8s.io/v1alpha3 +kind: MachineDeployment +metadata: + name: "${CLUSTER_NAME}-md-0" +spec: + clusterName: "${CLUSTER_NAME}" + replicas: ${WORKER_MACHINE_COUNT} + selector: + matchLabels: + template: + spec: + clusterName: "${CLUSTER_NAME}" + version: "${KUBERNETES_VERSION}" + bootstrap: + configRef: + name: "${CLUSTER_NAME}-md-0" + apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 + kind: KubeadmConfigTemplate + infrastructureRef: + name: "${CLUSTER_NAME}-md-0" + apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 + kind: AWSMachineTemplate +--- +apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3 +kind: AWSMachineTemplate +metadata: + name: "${CLUSTER_NAME}-md-0" +spec: + template: + spec: + instanceType: "${AWS_NODE_MACHINE_TYPE}" + iamInstanceProfile: "nodes.cluster-api-provider-aws.sigs.k8s.io" + sshKeyName: "${AWS_SSH_KEY_NAME}" +--- +apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3 +kind: KubeadmConfigTemplate +metadata: + name: "${CLUSTER_NAME}-md-0" +spec: + template: + spec: + joinConfiguration: + nodeRegistration: + name: '{{ ds.meta_data.local_hostname }}' + kubeletExtraArgs: + cloud-provider: aws diff --git a/test/e2e/data/infrastructure-aws/cluster-template.yaml b/test/e2e/data/infrastructure-aws/capi-upgrades/v1alpha4/cluster-template.yaml similarity index 100% rename from test/e2e/data/infrastructure-aws/cluster-template.yaml rename to test/e2e/data/infrastructure-aws/capi-upgrades/v1alpha4/cluster-template.yaml diff --git a/test/e2e/data/infrastructure-aws/cluster-template-external-cloud-provider.yaml b/test/e2e/data/infrastructure-aws/cluster-template-external-cloud-provider.yaml deleted file mode 100644 index 011275c488..0000000000 --- a/test/e2e/data/infrastructure-aws/cluster-template-external-cloud-provider.yaml +++ /dev/null @@ -1,992 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: Cluster -metadata: - labels: - ccm: external - cni: ${CLUSTER_NAME}-crs-0 - csi: external - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSCluster - name: ${CLUSTER_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSCluster -metadata: - name: ${CLUSTER_NAME} -spec: - network: - vpc: - availabilityZoneUsageLimit: 1 - region: ${AWS_REGION} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - apiServer: - extraArgs: - cloud-provider: external - controllerManager: - extraArgs: - cloud-provider: external - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: external - name: '{{ ds.meta_data.local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: external - name: '{{ ds.meta_data.local_hostname }}' - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_CONTROL_PLANE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_NODE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: external - name: '{{ ds.meta_data.local_hostname }}' ---- -apiVersion: v1 -data: ${CNI_RESOURCES} -kind: ConfigMap -metadata: - name: cni-${CLUSTER_NAME}-crs-0 ---- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 -kind: ClusterResourceSet -metadata: - name: ${CLUSTER_NAME}-crs-0 -spec: - clusterSelector: - matchLabels: - cni: ${CLUSTER_NAME}-crs-0 - resources: - - kind: ConfigMap - name: cni-${CLUSTER_NAME}-crs-0 - strategy: ApplyOnce ---- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 -kind: ClusterResourceSet -metadata: - name: crs-ccm -spec: - clusterSelector: - matchLabels: - ccm: external - resources: - - kind: ConfigMap - name: cloud-controller-manager-addon - strategy: ApplyOnce ---- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 -kind: ClusterResourceSet -metadata: - name: crs-csi -spec: - clusterSelector: - matchLabels: - csi: external - resources: - - kind: ConfigMap - name: aws-ebs-csi-driver-addon - strategy: ApplyOnce ---- -apiVersion: v1 -data: - aws-ccm-external.yaml: | - --- - apiVersion: apps/v1 - kind: DaemonSet - metadata: - name: aws-cloud-controller-manager - namespace: kube-system - labels: - k8s-app: aws-cloud-controller-manager - spec: - selector: - matchLabels: - k8s-app: aws-cloud-controller-manager - updateStrategy: - type: RollingUpdate - template: - metadata: - labels: - k8s-app: aws-cloud-controller-manager - spec: - nodeSelector: - node-role.kubernetes.io/master: "" - tolerations: - - key: node.cloudprovider.kubernetes.io/uninitialized - value: "true" - effect: NoSchedule - - key: node-role.kubernetes.io/master - effect: NoSchedule - - effect: NoSchedule - key: node-role.kubernetes.io/control-plane - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: Exists - - matchExpressions: - - key: node-role.kubernetes.io/master - operator: Exists - serviceAccountName: cloud-controller-manager - containers: - - name: aws-cloud-controller-manager - image: gcr.io/k8s-staging-provider-aws/cloud-controller-manager:v1.20.0-alpha.0 - args: - - --v=2 - resources: - requests: - cpu: 200m - hostNetwork: true - --- - apiVersion: v1 - kind: ServiceAccount - metadata: - name: cloud-controller-manager - namespace: kube-system - --- - apiVersion: rbac.authorization.k8s.io/v1 - kind: RoleBinding - metadata: - name: cloud-controller-manager:apiserver-authentication-reader - namespace: kube-system - roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: extension-apiserver-authentication-reader - subjects: - - apiGroup: "" - kind: ServiceAccount - name: cloud-controller-manager - namespace: kube-system - --- - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRole - metadata: - name: system:cloud-controller-manager - rules: - - apiGroups: - - "" - resources: - - events - verbs: - - create - - patch - - update - - apiGroups: - - "" - resources: - - nodes - verbs: - - '*' - - apiGroups: - - "" - resources: - - nodes/status - verbs: - - patch - - apiGroups: - - "" - resources: - - services - verbs: - - list - - patch - - update - - watch - - apiGroups: - - "" - resources: - - services/status - verbs: - - list - - patch - - update - - watch - - apiGroups: - - "" - resources: - - serviceaccounts - verbs: - - create - - apiGroups: - - "" - resources: - - persistentvolumes - verbs: - - get - - list - - update - - watch - - apiGroups: - - "" - resources: - - configmaps - verbs: - - list - - watch - - apiGroups: - - "" - resources: - - endpoints - verbs: - - create - - get - - list - - watch - - update - - apiGroups: - - coordination.k8s.io - resources: - - leases - verbs: - - create - - get - - list - - watch - - update - --- - kind: ClusterRoleBinding - apiVersion: rbac.authorization.k8s.io/v1 - metadata: - name: system:cloud-controller-manager - roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: system:cloud-controller-manager - subjects: - - apiGroup: "" - kind: ServiceAccount - name: cloud-controller-manager - namespace: kube-system -kind: ConfigMap -metadata: - annotations: - note: generated - labels: - type: generated - name: cloud-controller-manager-addon ---- -apiVersion: v1 -data: - aws-ebs-csi-external.yaml: |- - apiVersion: v1 - kind: Secret - metadata: - name: aws-secret - namespace: kube-system - stringData: - key_id: "" - access_key: "" - --- - apiVersion: v1 - kind: ServiceAccount - metadata: - labels: - app.kubernetes.io/name: aws-ebs-csi-driver - name: ebs-csi-controller-sa - namespace: kube-system - --- - apiVersion: v1 - kind: ServiceAccount - metadata: - labels: - app.kubernetes.io/name: aws-ebs-csi-driver - name: ebs-csi-node-sa - namespace: kube-system - --- - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRole - metadata: - labels: - app.kubernetes.io/name: aws-ebs-csi-driver - name: ebs-external-attacher-role - rules: - - apiGroups: - - "" - resources: - - persistentvolumes - verbs: - - get - - list - - watch - - update - - patch - - apiGroups: - - "" - resources: - - nodes - verbs: - - get - - list - - watch - - apiGroups: - - csi.storage.k8s.io - resources: - - csinodeinfos - verbs: - - get - - list - - watch - - apiGroups: - - storage.k8s.io - resources: - - volumeattachments - verbs: - - get - - list - - watch - - update - - patch - - apiGroups: - - storage.k8s.io - resources: - - volumeattachments/status - verbs: - - patch - --- - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRole - metadata: - labels: - app.kubernetes.io/name: aws-ebs-csi-driver - name: ebs-external-provisioner-role - rules: - - apiGroups: - - "" - resources: - - persistentvolumes - verbs: - - get - - list - - watch - - create - - delete - - apiGroups: - - "" - resources: - - persistentvolumeclaims - verbs: - - get - - list - - watch - - update - - apiGroups: - - storage.k8s.io - resources: - - storageclasses - verbs: - - get - - list - - watch - - apiGroups: - - "" - resources: - - events - verbs: - - list - - watch - - create - - update - - patch - - apiGroups: - - snapshot.storage.k8s.io - resources: - - volumesnapshots - verbs: - - get - - list - - apiGroups: - - snapshot.storage.k8s.io - resources: - - volumesnapshotcontents - verbs: - - get - - list - - apiGroups: - - storage.k8s.io - resources: - - csinodes - verbs: - - get - - list - - watch - - apiGroups: - - "" - resources: - - nodes - verbs: - - get - - list - - watch - - apiGroups: - - coordination.k8s.io - resources: - - leases - verbs: - - get - - watch - - list - - delete - - update - - create - - apiGroups: - - storage.k8s.io - resources: - - volumeattachments - verbs: - - get - - list - - watch - --- - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRole - metadata: - labels: - app.kubernetes.io/name: aws-ebs-csi-driver - name: ebs-external-resizer-role - rules: - - apiGroups: - - "" - resources: - - persistentvolumes - verbs: - - get - - list - - watch - - update - - patch - - apiGroups: - - "" - resources: - - persistentvolumeclaims - verbs: - - get - - list - - watch - - apiGroups: - - "" - resources: - - persistentvolumeclaims/status - verbs: - - update - - patch - - apiGroups: - - storage.k8s.io - resources: - - storageclasses - verbs: - - get - - list - - watch - - apiGroups: - - "" - resources: - - events - verbs: - - list - - watch - - create - - update - - patch - - apiGroups: - - "" - resources: - - pods - verbs: - - get - - list - - watch - --- - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRole - metadata: - labels: - app.kubernetes.io/name: aws-ebs-csi-driver - name: ebs-external-snapshotter-role - rules: - - apiGroups: - - "" - resources: - - events - verbs: - - list - - watch - - create - - update - - patch - - apiGroups: - - "" - resources: - - secrets - verbs: - - get - - list - - apiGroups: - - snapshot.storage.k8s.io - resources: - - volumesnapshotclasses - verbs: - - get - - list - - watch - - apiGroups: - - snapshot.storage.k8s.io - resources: - - volumesnapshotcontents - verbs: - - create - - get - - list - - watch - - update - - delete - - apiGroups: - - snapshot.storage.k8s.io - resources: - - volumesnapshotcontents/status - verbs: - - update - --- - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRoleBinding - metadata: - labels: - app.kubernetes.io/name: aws-ebs-csi-driver - name: ebs-csi-attacher-binding - roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: ebs-external-attacher-role - subjects: - - kind: ServiceAccount - name: ebs-csi-controller-sa - namespace: kube-system - --- - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRoleBinding - metadata: - labels: - app.kubernetes.io/name: aws-ebs-csi-driver - name: ebs-csi-provisioner-binding - roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: ebs-external-provisioner-role - subjects: - - kind: ServiceAccount - name: ebs-csi-controller-sa - namespace: kube-system - --- - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRoleBinding - metadata: - labels: - app.kubernetes.io/name: aws-ebs-csi-driver - name: ebs-csi-resizer-binding - roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: ebs-external-resizer-role - subjects: - - kind: ServiceAccount - name: ebs-csi-controller-sa - namespace: kube-system - --- - apiVersion: rbac.authorization.k8s.io/v1 - kind: ClusterRoleBinding - metadata: - labels: - app.kubernetes.io/name: aws-ebs-csi-driver - name: ebs-csi-snapshotter-binding - roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: ebs-external-snapshotter-role - subjects: - - kind: ServiceAccount - name: ebs-csi-controller-sa - namespace: kube-system - --- - apiVersion: apps/v1 - kind: Deployment - metadata: - labels: - app.kubernetes.io/name: aws-ebs-csi-driver - name: ebs-csi-controller - namespace: kube-system - spec: - replicas: 2 - selector: - matchLabels: - app: ebs-csi-controller - app.kubernetes.io/name: aws-ebs-csi-driver - template: - metadata: - labels: - app: ebs-csi-controller - app.kubernetes.io/name: aws-ebs-csi-driver - spec: - containers: - - args: - - --endpoint=$(CSI_ENDPOINT) - - --logtostderr - - --v=2 - env: - - name: CSI_ENDPOINT - value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock - - name: CSI_NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - - name: AWS_ACCESS_KEY_ID - valueFrom: - secretKeyRef: - key: key_id - name: aws-secret - optional: true - - name: AWS_SECRET_ACCESS_KEY - valueFrom: - secretKeyRef: - key: access_key - name: aws-secret - optional: true - image: k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.2.0 - imagePullPolicy: IfNotPresent - livenessProbe: - failureThreshold: 5 - httpGet: - path: /healthz - port: healthz - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 3 - name: ebs-plugin - ports: - - containerPort: 9808 - name: healthz - protocol: TCP - readinessProbe: - failureThreshold: 5 - httpGet: - path: /healthz - port: healthz - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 3 - volumeMounts: - - mountPath: /var/lib/csi/sockets/pluginproxy/ - name: socket-dir - - args: - - --csi-address=$(ADDRESS) - - --v=2 - - --feature-gates=Topology=true - - --extra-create-metadata - - --leader-election=true - - --default-fstype=ext4 - env: - - name: ADDRESS - value: /var/lib/csi/sockets/pluginproxy/csi.sock - image: k8s.gcr.io/sig-storage/csi-provisioner:v2.1.1 - name: csi-provisioner - volumeMounts: - - mountPath: /var/lib/csi/sockets/pluginproxy/ - name: socket-dir - - args: - - --csi-address=$(ADDRESS) - - --v=2 - - --leader-election=true - env: - - name: ADDRESS - value: /var/lib/csi/sockets/pluginproxy/csi.sock - image: k8s.gcr.io/sig-storage/csi-attacher:v3.1.0 - name: csi-attacher - volumeMounts: - - mountPath: /var/lib/csi/sockets/pluginproxy/ - name: socket-dir - - args: - - --csi-address=$(ADDRESS) - - --leader-election=true - env: - - name: ADDRESS - value: /var/lib/csi/sockets/pluginproxy/csi.sock - image: k8s.gcr.io/sig-storage/csi-snapshotter:v3.0.3 - name: csi-snapshotter - volumeMounts: - - mountPath: /var/lib/csi/sockets/pluginproxy/ - name: socket-dir - - args: - - --csi-address=$(ADDRESS) - - --v=2 - env: - - name: ADDRESS - value: /var/lib/csi/sockets/pluginproxy/csi.sock - image: k8s.gcr.io/sig-storage/csi-resizer:v1.0.0 - imagePullPolicy: Always - name: csi-resizer - volumeMounts: - - mountPath: /var/lib/csi/sockets/pluginproxy/ - name: socket-dir - - args: - - --csi-address=/csi/csi.sock - image: k8s.gcr.io/sig-storage/livenessprobe:v2.2.0 - name: liveness-probe - volumeMounts: - - mountPath: /csi - name: socket-dir - nodeSelector: - kubernetes.io/os: linux - priorityClassName: system-cluster-critical - serviceAccountName: ebs-csi-controller-sa - tolerations: - - key: CriticalAddonsOnly - operator: Exists - - effect: NoExecute - operator: Exists - tolerationSeconds: 300 - - key: node-role.kubernetes.io/master - effect: NoSchedule - - effect: NoSchedule - key: node-role.kubernetes.io/control-plane - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: node-role.kubernetes.io/control-plane - operator: Exists - - matchExpressions: - - key: node-role.kubernetes.io/master - operator: Exists - volumes: - - emptyDir: {} - name: socket-dir - --- - apiVersion: policy/v1beta1 - kind: PodDisruptionBudget - metadata: - labels: - app.kubernetes.io/name: aws-ebs-csi-driver - name: ebs-csi-controller - namespace: kube-system - spec: - maxUnavailable: 1 - selector: - matchLabels: - app: ebs-csi-controller - app.kubernetes.io/name: aws-ebs-csi-driver - --- - apiVersion: apps/v1 - kind: DaemonSet - metadata: - labels: - app.kubernetes.io/name: aws-ebs-csi-driver - name: ebs-csi-node - namespace: kube-system - spec: - selector: - matchLabels: - app: ebs-csi-node - app.kubernetes.io/name: aws-ebs-csi-driver - template: - metadata: - labels: - app: ebs-csi-node - app.kubernetes.io/name: aws-ebs-csi-driver - spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: eks.amazonaws.com/compute-type - operator: NotIn - values: - - fargate - containers: - - args: - - node - - --endpoint=$(CSI_ENDPOINT) - - --logtostderr - - --v=2 - env: - - name: CSI_ENDPOINT - value: unix:/csi/csi.sock - - name: CSI_NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - image: k8s.gcr.io/provider-aws/aws-ebs-csi-driver:v1.2.0 - livenessProbe: - failureThreshold: 5 - httpGet: - path: /healthz - port: healthz - initialDelaySeconds: 10 - periodSeconds: 10 - timeoutSeconds: 3 - name: ebs-plugin - ports: - - containerPort: 9808 - name: healthz - protocol: TCP - securityContext: - privileged: true - volumeMounts: - - mountPath: /var/lib/kubelet - mountPropagation: Bidirectional - name: kubelet-dir - - mountPath: /csi - name: plugin-dir - - mountPath: /dev - name: device-dir - - args: - - --csi-address=$(ADDRESS) - - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH) - - --v=2 - env: - - name: ADDRESS - value: /csi/csi.sock - - name: DRIVER_REG_SOCK_PATH - value: /var/lib/kubelet/plugins/ebs.csi.aws.com/csi.sock - image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.1.0 - name: node-driver-registrar - volumeMounts: - - mountPath: /csi - name: plugin-dir - - mountPath: /registration - name: registration-dir - - args: - - --csi-address=/csi/csi.sock - image: k8s.gcr.io/sig-storage/livenessprobe:v2.2.0 - name: liveness-probe - volumeMounts: - - mountPath: /csi - name: plugin-dir - nodeSelector: - kubernetes.io/os: linux - priorityClassName: system-node-critical - serviceAccountName: ebs-csi-node-sa - tolerations: - - key: CriticalAddonsOnly - operator: Exists - - effect: NoExecute - operator: Exists - tolerationSeconds: 300 - volumes: - - hostPath: - path: /var/lib/kubelet - type: Directory - name: kubelet-dir - - hostPath: - path: /var/lib/kubelet/plugins/ebs.csi.aws.com/ - type: DirectoryOrCreate - name: plugin-dir - - hostPath: - path: /var/lib/kubelet/plugins_registry/ - type: Directory - name: registration-dir - - hostPath: - path: /dev - type: Directory - name: device-dir - updateStrategy: - rollingUpdate: - maxUnavailable: 10% - type: RollingUpdate - --- - apiVersion: storage.k8s.io/v1 - kind: CSIDriver - metadata: - labels: - app.kubernetes.io/name: aws-ebs-csi-driver - name: ebs.csi.aws.com - spec: - attachRequired: true - podInfoOnMount: false -kind: ConfigMap -metadata: - annotations: - note: generated - labels: - type: generated - name: aws-ebs-csi-driver-addon diff --git a/test/e2e/data/infrastructure-aws/cluster-template-kcp-remediation.yaml b/test/e2e/data/infrastructure-aws/cluster-template-kcp-remediation.yaml deleted file mode 100644 index 56e347a177..0000000000 --- a/test/e2e/data/infrastructure-aws/cluster-template-kcp-remediation.yaml +++ /dev/null @@ -1,153 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: Cluster -metadata: - labels: - cni: ${CLUSTER_NAME}-crs-0 - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSCluster - name: ${CLUSTER_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSCluster -metadata: - name: ${CLUSTER_NAME} -spec: - network: - vpc: - availabilityZoneUsageLimit: 1 - region: ${AWS_REGION} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - apiServer: - extraArgs: - cloud-provider: aws - controllerManager: - extraArgs: - cloud-provider: aws - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_CONTROL_PLANE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_NODE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' ---- -apiVersion: v1 -data: ${CNI_RESOURCES} -kind: ConfigMap -metadata: - name: cni-${CLUSTER_NAME}-crs-0 ---- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 -kind: ClusterResourceSet -metadata: - name: ${CLUSTER_NAME}-crs-0 -spec: - clusterSelector: - matchLabels: - cni: ${CLUSTER_NAME}-crs-0 - resources: - - kind: ConfigMap - name: cni-${CLUSTER_NAME}-crs-0 - strategy: ApplyOnce ---- -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachineHealthCheck -metadata: - name: ${CLUSTER_NAME}-mhc-0 -spec: - clusterName: ${CLUSTER_NAME} - maxUnhealthy: 100% - selector: - matchLabels: - cluster.x-k8s.io/control-plane: "" - unhealthyConditions: - - status: "False" - timeout: 10s - type: e2e.remediation.condition diff --git a/test/e2e/data/infrastructure-aws/cluster-template-kcp-scale-in.yaml b/test/e2e/data/infrastructure-aws/cluster-template-kcp-scale-in.yaml deleted file mode 100644 index 49b8674308..0000000000 --- a/test/e2e/data/infrastructure-aws/cluster-template-kcp-scale-in.yaml +++ /dev/null @@ -1,141 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: Cluster -metadata: - labels: - cni: ${CLUSTER_NAME}-crs-0 - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSCluster - name: ${CLUSTER_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSCluster -metadata: - name: ${CLUSTER_NAME} -spec: - network: - vpc: - availabilityZoneUsageLimit: 1 - region: ${AWS_REGION} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - apiServer: - extraArgs: - cloud-provider: aws - controllerManager: - extraArgs: - cloud-provider: aws - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - rolloutStrategy: - rollingUpdate: - maxSurge: 0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_CONTROL_PLANE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_NODE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' ---- -apiVersion: v1 -data: ${CNI_RESOURCES} -kind: ConfigMap -metadata: - name: cni-${CLUSTER_NAME}-crs-0 ---- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 -kind: ClusterResourceSet -metadata: - name: ${CLUSTER_NAME}-crs-0 -spec: - clusterSelector: - matchLabels: - cni: ${CLUSTER_NAME}-crs-0 - resources: - - kind: ConfigMap - name: cni-${CLUSTER_NAME}-crs-0 - strategy: ApplyOnce diff --git a/test/e2e/data/infrastructure-aws/cluster-template-limit-az.yaml b/test/e2e/data/infrastructure-aws/cluster-template-limit-az.yaml deleted file mode 100644 index 37de215eb3..0000000000 --- a/test/e2e/data/infrastructure-aws/cluster-template-limit-az.yaml +++ /dev/null @@ -1,138 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: Cluster -metadata: - labels: - cni: ${CLUSTER_NAME}-crs-0 - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSCluster - name: ${CLUSTER_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSCluster -metadata: - name: ${CLUSTER_NAME} -spec: - network: - vpc: - availabilityZoneUsageLimit: 1 - region: ${AWS_REGION} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - apiServer: - extraArgs: - cloud-provider: aws - controllerManager: - extraArgs: - cloud-provider: aws - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_CONTROL_PLANE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_NODE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' ---- -apiVersion: v1 -data: ${CNI_RESOURCES} -kind: ConfigMap -metadata: - name: cni-${CLUSTER_NAME}-crs-0 ---- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 -kind: ClusterResourceSet -metadata: - name: ${CLUSTER_NAME}-crs-0 -spec: - clusterSelector: - matchLabels: - cni: ${CLUSTER_NAME}-crs-0 - resources: - - kind: ConfigMap - name: cni-${CLUSTER_NAME}-crs-0 - strategy: ApplyOnce diff --git a/test/e2e/data/infrastructure-aws/cluster-template-machine-pool.yaml b/test/e2e/data/infrastructure-aws/cluster-template-machine-pool.yaml deleted file mode 100644 index 958f81e00b..0000000000 --- a/test/e2e/data/infrastructure-aws/cluster-template-machine-pool.yaml +++ /dev/null @@ -1,135 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: Cluster -metadata: - labels: - cni: ${CLUSTER_NAME}-crs-0 - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSCluster - name: ${CLUSTER_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSCluster -metadata: - name: ${CLUSTER_NAME} -spec: - network: - vpc: - availabilityZoneUsageLimit: 1 - region: ${AWS_REGION} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - apiServer: - extraArgs: - cloud-provider: aws - controllerManager: - extraArgs: - cloud-provider: aws - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_CONTROL_PLANE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachinePool -metadata: - name: ${CLUSTER_NAME}-mp-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 - kind: KubeadmConfig - name: ${CLUSTER_NAME}-mp-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachinePool - name: ${CLUSTER_NAME}-mp-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachinePool -metadata: - name: ${CLUSTER_NAME}-mp-0 -spec: - awsLaunchTemplate: - iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_CONTROL_PLANE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} - maxSize: 4 - minSize: 1 ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 -kind: KubeadmConfig -metadata: - name: ${CLUSTER_NAME}-mp-0 -spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' ---- -apiVersion: v1 -data: ${CNI_RESOURCES} -kind: ConfigMap -metadata: - name: cni-${CLUSTER_NAME}-crs-0 ---- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 -kind: ClusterResourceSet -metadata: - name: ${CLUSTER_NAME}-crs-0 -spec: - clusterSelector: - matchLabels: - cni: ${CLUSTER_NAME}-crs-0 - resources: - - kind: ConfigMap - name: cni-${CLUSTER_NAME}-crs-0 - strategy: ApplyOnce diff --git a/test/e2e/data/infrastructure-aws/cluster-template-md-remediation.yaml b/test/e2e/data/infrastructure-aws/cluster-template-md-remediation.yaml deleted file mode 100644 index 77adf04c43..0000000000 --- a/test/e2e/data/infrastructure-aws/cluster-template-md-remediation.yaml +++ /dev/null @@ -1,155 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: Cluster -metadata: - labels: - cni: ${CLUSTER_NAME}-crs-0 - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSCluster - name: ${CLUSTER_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSCluster -metadata: - name: ${CLUSTER_NAME} -spec: - network: - vpc: - availabilityZoneUsageLimit: 1 - region: ${AWS_REGION} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - apiServer: - extraArgs: - cloud-provider: aws - controllerManager: - extraArgs: - cloud-provider: aws - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_CONTROL_PLANE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: {} - template: - metadata: - labels: - e2e.remediation.label: "" - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_NODE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' ---- -apiVersion: v1 -data: ${CNI_RESOURCES} -kind: ConfigMap -metadata: - name: cni-${CLUSTER_NAME}-crs-0 ---- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 -kind: ClusterResourceSet -metadata: - name: ${CLUSTER_NAME}-crs-0 -spec: - clusterSelector: - matchLabels: - cni: ${CLUSTER_NAME}-crs-0 - resources: - - kind: ConfigMap - name: cni-${CLUSTER_NAME}-crs-0 - strategy: ApplyOnce ---- -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachineHealthCheck -metadata: - name: ${CLUSTER_NAME}-mhc-0 -spec: - clusterName: ${CLUSTER_NAME} - maxUnhealthy: 100% - selector: - matchLabels: - e2e.remediation.label: "" - unhealthyConditions: - - status: "False" - timeout: 10s - type: e2e.remediation.condition diff --git a/test/e2e/data/infrastructure-aws/cluster-template-multi-az.yaml b/test/e2e/data/infrastructure-aws/cluster-template-multi-az.yaml deleted file mode 100644 index 5389f6d5a4..0000000000 --- a/test/e2e/data/infrastructure-aws/cluster-template-multi-az.yaml +++ /dev/null @@ -1,147 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: Cluster -metadata: - labels: - cni: ${CLUSTER_NAME}-crs-0 - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSCluster - name: ${CLUSTER_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSCluster -metadata: - name: ${CLUSTER_NAME} -spec: - network: - subnets: - - availabilityZone: ${AWS_AVAILABILITY_ZONE_1} - cidrBlock: 10.0.0.0/24 - - availabilityZone: ${AWS_AVAILABILITY_ZONE_1} - cidrBlock: 10.0.1.0/24 - isPublic: true - - availabilityZone: ${AWS_AVAILABILITY_ZONE_2} - cidrBlock: 10.0.2.0/24 - - availabilityZone: ${AWS_AVAILABILITY_ZONE_2} - cidrBlock: 10.0.3.0/24 - isPublic: true - region: ${AWS_REGION} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - apiServer: - extraArgs: - cloud-provider: aws - controllerManager: - extraArgs: - cloud-provider: aws - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_CONTROL_PLANE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_NODE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' ---- -apiVersion: v1 -data: ${CNI_RESOURCES} -kind: ConfigMap -metadata: - name: cni-${CLUSTER_NAME}-crs-0 ---- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 -kind: ClusterResourceSet -metadata: - name: ${CLUSTER_NAME}-crs-0 -spec: - clusterSelector: - matchLabels: - cni: ${CLUSTER_NAME}-crs-0 - resources: - - kind: ConfigMap - name: cni-${CLUSTER_NAME}-crs-0 - strategy: ApplyOnce diff --git a/test/e2e/data/infrastructure-aws/cluster-template-nested-multitenancy.yaml b/test/e2e/data/infrastructure-aws/cluster-template-nested-multitenancy.yaml deleted file mode 100644 index 7095ae4508..0000000000 --- a/test/e2e/data/infrastructure-aws/cluster-template-nested-multitenancy.yaml +++ /dev/null @@ -1,166 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: Cluster -metadata: - labels: - cni: ${CLUSTER_NAME}-crs-0 - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSCluster - name: ${CLUSTER_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSCluster -metadata: - name: ${CLUSTER_NAME} -spec: - identityRef: - kind: AWSClusterRoleIdentity - name: ${MULTI_TENANCY_NESTED_IDENTITY_NAME} - network: - vpc: - availabilityZoneUsageLimit: 1 - region: ${AWS_REGION} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - apiServer: - extraArgs: - cloud-provider: aws - controllerManager: - extraArgs: - cloud-provider: aws - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_CONTROL_PLANE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_NODE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' ---- -apiVersion: v1 -data: ${CNI_RESOURCES} -kind: ConfigMap -metadata: - name: cni-${CLUSTER_NAME}-crs-0 ---- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 -kind: ClusterResourceSet -metadata: - name: ${CLUSTER_NAME}-crs-0 -spec: - clusterSelector: - matchLabels: - cni: ${CLUSTER_NAME}-crs-0 - resources: - - kind: ConfigMap - name: cni-${CLUSTER_NAME}-crs-0 - strategy: ApplyOnce ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSClusterRoleIdentity -metadata: - name: ${MULTI_TENANCY_JUMP_IDENTITY_NAME} -spec: - allowedNamespaces: {} - durationSeconds: 900 - roleARN: ${MULTI_TENANCY_JUMP_ROLE_ARN} - sessionName: ${MULTI_TENANCY_JUMP_IDENTITY_NAME}-session - sourceIdentityRef: - kind: AWSClusterControllerIdentity - name: default ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSClusterRoleIdentity -metadata: - name: ${MULTI_TENANCY_NESTED_IDENTITY_NAME} -spec: - allowedNamespaces: {} - roleARN: ${MULTI_TENANCY_NESTED_ROLE_ARN} - sessionName: ${MULTI_TENANCY_NESTED_IDENTITY_NAME}-session - sourceIdentityRef: - kind: AWSClusterRoleIdentity - name: ${MULTI_TENANCY_JUMP_IDENTITY_NAME} diff --git a/test/e2e/data/infrastructure-aws/cluster-template-simple-multitenancy.yaml b/test/e2e/data/infrastructure-aws/cluster-template-simple-multitenancy.yaml deleted file mode 100644 index c6cabe9204..0000000000 --- a/test/e2e/data/infrastructure-aws/cluster-template-simple-multitenancy.yaml +++ /dev/null @@ -1,154 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: Cluster -metadata: - labels: - cni: ${CLUSTER_NAME}-crs-0 - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSCluster - name: ${CLUSTER_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSCluster -metadata: - name: ${CLUSTER_NAME} -spec: - identityRef: - kind: AWSClusterRoleIdentity - name: ${MULTI_TENANCY_SIMPLE_IDENTITY_NAME} - network: - vpc: - availabilityZoneUsageLimit: 1 - region: ${AWS_REGION} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - apiServer: - extraArgs: - cloud-provider: aws - controllerManager: - extraArgs: - cloud-provider: aws - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_CONTROL_PLANE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_NODE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' ---- -apiVersion: v1 -data: ${CNI_RESOURCES} -kind: ConfigMap -metadata: - name: cni-${CLUSTER_NAME}-crs-0 ---- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 -kind: ClusterResourceSet -metadata: - name: ${CLUSTER_NAME}-crs-0 -spec: - clusterSelector: - matchLabels: - cni: ${CLUSTER_NAME}-crs-0 - resources: - - kind: ConfigMap - name: cni-${CLUSTER_NAME}-crs-0 - strategy: ApplyOnce ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSClusterRoleIdentity -metadata: - name: ${MULTI_TENANCY_SIMPLE_IDENTITY_NAME} -spec: - allowedNamespaces: {} - durationSeconds: 900 - roleARN: ${MULTI_TENANCY_SIMPLE_ROLE_ARN} - sessionName: ${MULTI_TENANCY_SIMPLE_IDENTITY_NAME}-session - sourceIdentityRef: - kind: AWSClusterControllerIdentity - name: default diff --git a/test/e2e/data/infrastructure-aws/cluster-template-spot-instances.yaml b/test/e2e/data/infrastructure-aws/cluster-template-spot-instances.yaml deleted file mode 100644 index 24dde5c5f8..0000000000 --- a/test/e2e/data/infrastructure-aws/cluster-template-spot-instances.yaml +++ /dev/null @@ -1,137 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: Cluster -metadata: - labels: - cni: ${CLUSTER_NAME}-crs-0 - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSCluster - name: ${CLUSTER_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSCluster -metadata: - name: ${CLUSTER_NAME} -spec: - region: ${AWS_REGION} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - apiServer: - extraArgs: - cloud-provider: aws - controllerManager: - extraArgs: - cloud-provider: aws - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_CONTROL_PLANE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_NODE_MACHINE_TYPE} - spotMarketOptions: - maxPrice: "" - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' ---- -apiVersion: v1 -data: ${CNI_RESOURCES} -kind: ConfigMap -metadata: - name: cni-${CLUSTER_NAME}-crs-0 ---- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 -kind: ClusterResourceSet -metadata: - name: ${CLUSTER_NAME}-crs-0 -spec: - clusterSelector: - matchLabels: - cni: ${CLUSTER_NAME}-crs-0 - resources: - - kind: ConfigMap - name: cni-${CLUSTER_NAME}-crs-0 - strategy: ApplyOnce diff --git a/test/e2e/data/infrastructure-aws/cluster-template-ssm.yaml b/test/e2e/data/infrastructure-aws/cluster-template-ssm.yaml deleted file mode 100644 index a1705c837e..0000000000 --- a/test/e2e/data/infrastructure-aws/cluster-template-ssm.yaml +++ /dev/null @@ -1,139 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: Cluster -metadata: - labels: - cni: ${CLUSTER_NAME}-crs-0 - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSCluster - name: ${CLUSTER_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSCluster -metadata: - name: ${CLUSTER_NAME} -spec: - region: ${AWS_REGION} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - apiServer: - extraArgs: - cloud-provider: aws - controllerManager: - extraArgs: - cloud-provider: aws - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - cloudInit: - secureSecretsBackend: ssm-parameter-store - iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_CONTROL_PLANE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - cloudInit: - secureSecretsBackend: ssm-parameter-store - iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_NODE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' ---- -apiVersion: v1 -data: ${CNI_RESOURCES} -kind: ConfigMap -metadata: - name: cni-${CLUSTER_NAME}-crs-0 ---- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 -kind: ClusterResourceSet -metadata: - name: ${CLUSTER_NAME}-crs-0 -spec: - clusterSelector: - matchLabels: - cni: ${CLUSTER_NAME}-crs-0 - resources: - - kind: ConfigMap - name: cni-${CLUSTER_NAME}-crs-0 - strategy: ApplyOnce diff --git a/test/e2e/data/infrastructure-aws/cluster-template-upgrade-to-main.yaml b/test/e2e/data/infrastructure-aws/cluster-template-upgrade-to-main.yaml deleted file mode 100644 index 3e1ce37234..0000000000 --- a/test/e2e/data/infrastructure-aws/cluster-template-upgrade-to-main.yaml +++ /dev/null @@ -1,161 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: Cluster -metadata: - labels: - cni: ${CLUSTER_NAME}-crs-0 - name: ${CLUSTER_NAME} -spec: - clusterNetwork: - pods: - cidrBlocks: - - 192.168.0.0/16 - controlPlaneRef: - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 - kind: KubeadmControlPlane - name: ${CLUSTER_NAME}-control-plane - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSCluster - name: ${CLUSTER_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSCluster -metadata: - name: ${CLUSTER_NAME} -spec: - region: ${AWS_REGION} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 -kind: KubeadmControlPlane -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - kubeadmConfigSpec: - clusterConfiguration: - apiServer: - extraArgs: - cloud-provider: aws - controllerManager: - extraArgs: - cloud-provider: aws - initConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' - machineTemplate: - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-control-plane - replicas: ${CONTROL_PLANE_MACHINE_COUNT} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane -spec: - template: - spec: - iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_CONTROL_PLANE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachineDeployment -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - selector: - matchLabels: null - template: - spec: - bootstrap: - configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 - kind: KubeadmConfigTemplate - name: ${CLUSTER_NAME}-md-0 - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AWSMachineTemplate - name: ${CLUSTER_NAME}-md-0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_NODE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 -kind: KubeadmConfigTemplate -metadata: - name: ${CLUSTER_NAME}-md-0 -spec: - template: - spec: - joinConfiguration: - nodeRegistration: - kubeletExtraArgs: - cloud-provider: aws - name: '{{ ds.meta_data.local_hostname }}' ---- -apiVersion: v1 -data: ${CNI_RESOURCES} -kind: ConfigMap -metadata: - name: cni-${CLUSTER_NAME}-crs-0 ---- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 -kind: ClusterResourceSet -metadata: - name: ${CLUSTER_NAME}-crs-0 -spec: - clusterSelector: - matchLabels: - cni: ${CLUSTER_NAME}-crs-0 - resources: - - kind: ConfigMap - name: cni-${CLUSTER_NAME}-crs-0 - strategy: ApplyOnce ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-control-plane-1 -spec: - template: - spec: - ami: - id: ${IMAGE_ID} - iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_CONTROL_PLANE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AWSMachineTemplate -metadata: - name: ${CLUSTER_NAME}-md-1 -spec: - template: - spec: - ami: - id: ${IMAGE_ID} - iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io - instanceType: ${AWS_NODE_MACHINE_TYPE} - sshKeyName: ${AWS_SSH_KEY_NAME} diff --git a/test/e2e/data/infrastructure-aws/addons/cni/cluster-resource-set-cni.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/addons/cni/cluster-resource-set-cni.yaml similarity index 88% rename from test/e2e/data/infrastructure-aws/addons/cni/cluster-resource-set-cni.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/addons/cni/cluster-resource-set-cni.yaml index ac7b2134bb..c8dc505441 100644 --- a/test/e2e/data/infrastructure-aws/addons/cni/cluster-resource-set-cni.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/addons/cni/cluster-resource-set-cni.yaml @@ -5,7 +5,7 @@ metadata: name: "cni-${CLUSTER_NAME}-crs-0" data: "${CNI_RESOURCES}" --- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 +apiVersion: addons.cluster.x-k8s.io/v1beta1 kind: ClusterResourceSet metadata: name: "${CLUSTER_NAME}-crs-0" diff --git a/test/e2e/data/infrastructure-aws/base/cluster-template.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/base/cluster-template.yaml similarity index 80% rename from test/e2e/data/infrastructure-aws/base/cluster-template.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/base/cluster-template.yaml index 6f58af0ffa..89ee0e715d 100644 --- a/test/e2e/data/infrastructure-aws/base/cluster-template.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/base/cluster-template.yaml @@ -1,5 +1,5 @@ --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: "${CLUSTER_NAME}" @@ -8,15 +8,15 @@ spec: pods: cidrBlocks: ["192.168.0.0/16"] infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSCluster name: "${CLUSTER_NAME}" controlPlaneRef: kind: KubeadmControlPlane - apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSCluster metadata: name: "${CLUSTER_NAME}" @@ -25,7 +25,7 @@ spec: sshKeyName: "${AWS_SSH_KEY_NAME}" --- kind: KubeadmControlPlane -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane" spec: @@ -33,7 +33,7 @@ spec: machineTemplate: infrastructureRef: kind: AWSMachineTemplate - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 name: "${CLUSTER_NAME}-control-plane" kubeadmConfigSpec: initConfiguration: @@ -56,7 +56,7 @@ spec: version: "${KUBERNETES_VERSION}" --- kind: AWSMachineTemplate -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane" spec: diff --git a/test/e2e/data/infrastructure-aws/base/kustomization.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/base/kustomization.yaml similarity index 100% rename from test/e2e/data/infrastructure-aws/base/kustomization.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/base/kustomization.yaml diff --git a/test/e2e/data/infrastructure-aws/kustomize_sources/capi-upgrade/kustomization.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/capi-upgrade/kustomization.yaml new file mode 100644 index 0000000000..d6b457e15d --- /dev/null +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/capi-upgrade/kustomization.yaml @@ -0,0 +1,4 @@ +resources: + - ../default +patchesStrategicMerge: + - patches/image-injection.yaml diff --git a/test/e2e/data/infrastructure-aws/kustomize_sources/capi-upgrade/patches/image-injection.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/capi-upgrade/patches/image-injection.yaml new file mode 100644 index 0000000000..8dbd3a236a --- /dev/null +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/capi-upgrade/patches/image-injection.yaml @@ -0,0 +1,23 @@ +--- +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 +kind: KubeadmControlPlane +metadata: + name: ${CLUSTER_NAME}-control-plane +spec: + kubeadmConfigSpec: + preKubeadmCommands: + - mkdir -p /opt/cluster-api + - aws s3 cp "s3://${CAPI_IMAGES_BUCKET}/${E2E_IMAGE_SHA}" /opt/cluster-api/image.tar + - ctr -n k8s.io images import /opt/cluster-api/image.tar +--- +apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 +kind: KubeadmConfigTemplate +metadata: + name: ${CLUSTER_NAME}-md-0 +spec: + template: + spec: + preKubeadmCommands: + - mkdir -p /opt/cluster-api + - aws s3 cp "s3://${CAPI_IMAGES_BUCKET}/${E2E_IMAGE_SHA}" /opt/cluster-api/image.tar + - ctr -n k8s.io images import /opt/cluster-api/image.tar diff --git a/test/e2e/data/infrastructure-aws/default/kustomization.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/default/kustomization.yaml similarity index 100% rename from test/e2e/data/infrastructure-aws/default/kustomization.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/default/kustomization.yaml diff --git a/test/e2e/data/infrastructure-aws/default/machine-deployment.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/default/machine-deployment.yaml similarity index 79% rename from test/e2e/data/infrastructure-aws/default/machine-deployment.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/default/machine-deployment.yaml index 991d75a0d2..688f12c48e 100644 --- a/test/e2e/data/infrastructure-aws/default/machine-deployment.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/default/machine-deployment.yaml @@ -1,5 +1,5 @@ --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: MachineDeployment metadata: name: "${CLUSTER_NAME}-md-0" @@ -15,14 +15,14 @@ spec: bootstrap: configRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: KubeadmConfigTemplate infrastructureRef: name: "${CLUSTER_NAME}-md-0" - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachineTemplate --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachineTemplate metadata: name: "${CLUSTER_NAME}-md-0" @@ -33,7 +33,7 @@ spec: iamInstanceProfile: "nodes.cluster-api-provider-aws.sigs.k8s.io" sshKeyName: "${AWS_SSH_KEY_NAME}" --- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 +apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: KubeadmConfigTemplate metadata: name: "${CLUSTER_NAME}-md-0" diff --git a/test/e2e/data/infrastructure-aws/default/patches/cluster-resource-set-cni.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/default/patches/cluster-resource-set-cni.yaml similarity index 88% rename from test/e2e/data/infrastructure-aws/default/patches/cluster-resource-set-cni.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/default/patches/cluster-resource-set-cni.yaml index ac7b2134bb..c8dc505441 100644 --- a/test/e2e/data/infrastructure-aws/default/patches/cluster-resource-set-cni.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/default/patches/cluster-resource-set-cni.yaml @@ -5,7 +5,7 @@ metadata: name: "cni-${CLUSTER_NAME}-crs-0" data: "${CNI_RESOURCES}" --- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 +apiVersion: addons.cluster.x-k8s.io/v1beta1 kind: ClusterResourceSet metadata: name: "${CLUSTER_NAME}-crs-0" diff --git a/test/e2e/data/infrastructure-aws/external-cloud-provider/aws-ccm-external.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/external-cloud-provider/aws-ccm-external.yaml similarity index 100% rename from test/e2e/data/infrastructure-aws/external-cloud-provider/aws-ccm-external.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/external-cloud-provider/aws-ccm-external.yaml diff --git a/test/e2e/data/infrastructure-aws/external-cloud-provider/aws-ebs-csi-external.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/external-cloud-provider/aws-ebs-csi-external.yaml similarity index 100% rename from test/e2e/data/infrastructure-aws/external-cloud-provider/aws-ebs-csi-external.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/external-cloud-provider/aws-ebs-csi-external.yaml diff --git a/test/e2e/data/infrastructure-aws/external-cloud-provider/ccm-resource-set.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/external-cloud-provider/ccm-resource-set.yaml similarity index 82% rename from test/e2e/data/infrastructure-aws/external-cloud-provider/ccm-resource-set.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/external-cloud-provider/ccm-resource-set.yaml index f719657247..8b9ccbc348 100644 --- a/test/e2e/data/infrastructure-aws/external-cloud-provider/ccm-resource-set.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/external-cloud-provider/ccm-resource-set.yaml @@ -1,5 +1,5 @@ --- -apiVersion: addons.cluster.x-k8s.io/v1alpha4 +apiVersion: addons.cluster.x-k8s.io/v1beta1 kind: ClusterResourceSet metadata: name: crs-ccm diff --git a/test/e2e/data/infrastructure-aws/external-cloud-provider/csi-resource-set.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/external-cloud-provider/csi-resource-set.yaml similarity index 82% rename from test/e2e/data/infrastructure-aws/external-cloud-provider/csi-resource-set.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/external-cloud-provider/csi-resource-set.yaml index 06fa1e0274..2819576215 100644 --- a/test/e2e/data/infrastructure-aws/external-cloud-provider/csi-resource-set.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/external-cloud-provider/csi-resource-set.yaml @@ -1,4 +1,4 @@ -apiVersion: addons.cluster.x-k8s.io/v1alpha4 +apiVersion: addons.cluster.x-k8s.io/v1beta1 kind: ClusterResourceSet metadata: name: crs-csi diff --git a/test/e2e/data/infrastructure-aws/external-cloud-provider/kustomization.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/external-cloud-provider/kustomization.yaml similarity index 100% rename from test/e2e/data/infrastructure-aws/external-cloud-provider/kustomization.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/external-cloud-provider/kustomization.yaml diff --git a/test/e2e/data/infrastructure-aws/external-cloud-provider/patches/external-cloud-provider.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/external-cloud-provider/patches/external-cloud-provider.yaml similarity index 85% rename from test/e2e/data/infrastructure-aws/external-cloud-provider/patches/external-cloud-provider.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/external-cloud-provider/patches/external-cloud-provider.yaml index 1577a5fc9f..6dc0a21cf2 100644 --- a/test/e2e/data/infrastructure-aws/external-cloud-provider/patches/external-cloud-provider.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/external-cloud-provider/patches/external-cloud-provider.yaml @@ -1,5 +1,5 @@ --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: ${CLUSTER_NAME} @@ -7,7 +7,7 @@ metadata: ccm: "external" csi: "external" --- -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 kind: KubeadmControlPlane metadata: name: ${CLUSTER_NAME}-control-plane @@ -29,7 +29,7 @@ spec: kubeletExtraArgs: cloud-provider: external --- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 +apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: KubeadmConfigTemplate metadata: name: ${CLUSTER_NAME}-md-0 diff --git a/test/e2e/data/infrastructure-aws/kcp-remediation/kustomization.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/kcp-remediation/kustomization.yaml similarity index 100% rename from test/e2e/data/infrastructure-aws/kcp-remediation/kustomization.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/kcp-remediation/kustomization.yaml diff --git a/test/e2e/data/infrastructure-aws/kcp-remediation/mhc.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/kcp-remediation/mhc.yaml similarity index 93% rename from test/e2e/data/infrastructure-aws/kcp-remediation/mhc.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/kcp-remediation/mhc.yaml index 6978e36b36..12fdb28465 100644 --- a/test/e2e/data/infrastructure-aws/kcp-remediation/mhc.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/kcp-remediation/mhc.yaml @@ -2,7 +2,7 @@ # MachineHealthCheck object with # - a selector that targets all controlplane machines with label cluster.x-k8s.io/control-plane: "" # - unhealthyConditions triggering remediation after 10s the condition is set -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: MachineHealthCheck metadata: name: "${CLUSTER_NAME}-mhc-0" diff --git a/test/e2e/data/infrastructure-aws/kcp-scale-in/kustomization.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/kcp-scale-in/kustomization.yaml similarity index 100% rename from test/e2e/data/infrastructure-aws/kcp-scale-in/kustomization.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/kcp-scale-in/kustomization.yaml diff --git a/test/e2e/data/infrastructure-aws/kcp-scale-in/patches/kcp-surge.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/kcp-scale-in/patches/kcp-surge.yaml similarity index 73% rename from test/e2e/data/infrastructure-aws/kcp-scale-in/patches/kcp-surge.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/kcp-scale-in/patches/kcp-surge.yaml index 49fdfe457d..39a0a17f23 100644 --- a/test/e2e/data/infrastructure-aws/kcp-scale-in/patches/kcp-surge.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/kcp-scale-in/patches/kcp-surge.yaml @@ -1,6 +1,6 @@ --- kind: KubeadmControlPlane -apiVersion: controlplane.cluster.x-k8s.io/v1alpha4 +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane" spec: diff --git a/test/e2e/data/infrastructure-aws/limit-az/kustomization.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/limit-az/kustomization.yaml similarity index 100% rename from test/e2e/data/infrastructure-aws/limit-az/kustomization.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/limit-az/kustomization.yaml diff --git a/test/e2e/data/infrastructure-aws/limit-az/patches/limit-az.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/limit-az/patches/limit-az.yaml similarity index 69% rename from test/e2e/data/infrastructure-aws/limit-az/patches/limit-az.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/limit-az/patches/limit-az.yaml index 087998ef4c..bc70e4eaa3 100644 --- a/test/e2e/data/infrastructure-aws/limit-az/patches/limit-az.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/limit-az/patches/limit-az.yaml @@ -1,5 +1,5 @@ --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSCluster metadata: name: "${CLUSTER_NAME}" diff --git a/test/e2e/data/infrastructure-aws/machine-pool/kustomization.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/machine-pool/kustomization.yaml similarity index 100% rename from test/e2e/data/infrastructure-aws/machine-pool/kustomization.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/machine-pool/kustomization.yaml diff --git a/test/e2e/data/infrastructure-aws/machine-pool/machine-pool.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/machine-pool/machine-pool.yaml similarity index 77% rename from test/e2e/data/infrastructure-aws/machine-pool/machine-pool.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/machine-pool/machine-pool.yaml index 336131cfac..fd075fbbaa 100644 --- a/test/e2e/data/infrastructure-aws/machine-pool/machine-pool.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/machine-pool/machine-pool.yaml @@ -1,5 +1,5 @@ --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: MachinePool metadata: name: ${CLUSTER_NAME}-mp-0 @@ -10,17 +10,17 @@ spec: spec: bootstrap: configRef: - apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: KubeadmConfig name: ${CLUSTER_NAME}-mp-0 clusterName: ${CLUSTER_NAME} infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachinePool name: ${CLUSTER_NAME}-mp-0 version: ${KUBERNETES_VERSION} --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachinePool metadata: name: ${CLUSTER_NAME}-mp-0 @@ -32,7 +32,7 @@ spec: iamInstanceProfile: "nodes.cluster-api-provider-aws.sigs.k8s.io" sshKeyName: "${AWS_SSH_KEY_NAME}" --- -apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4 +apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 kind: KubeadmConfig metadata: name: ${CLUSTER_NAME}-mp-0 diff --git a/test/e2e/data/infrastructure-aws/machine-pool/patches/limit-az.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/machine-pool/patches/limit-az.yaml similarity index 69% rename from test/e2e/data/infrastructure-aws/machine-pool/patches/limit-az.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/machine-pool/patches/limit-az.yaml index 087998ef4c..bc70e4eaa3 100644 --- a/test/e2e/data/infrastructure-aws/machine-pool/patches/limit-az.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/machine-pool/patches/limit-az.yaml @@ -1,5 +1,5 @@ --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSCluster metadata: name: "${CLUSTER_NAME}" diff --git a/test/e2e/data/infrastructure-aws/md-remediation/kustomization.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/md-remediation/kustomization.yaml similarity index 100% rename from test/e2e/data/infrastructure-aws/md-remediation/kustomization.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/md-remediation/kustomization.yaml diff --git a/test/e2e/data/infrastructure-aws/md-remediation/mhc.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/md-remediation/mhc.yaml similarity index 92% rename from test/e2e/data/infrastructure-aws/md-remediation/mhc.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/md-remediation/mhc.yaml index 0a63e1e93c..c107225909 100644 --- a/test/e2e/data/infrastructure-aws/md-remediation/mhc.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/md-remediation/mhc.yaml @@ -2,7 +2,7 @@ # MachineHealthCheck object with # - a selector that targets all the machines with label e2e.remediation.label="" # - unhealthyConditions triggering remediation after 10s the condition is set -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: MachineHealthCheck metadata: name: "${CLUSTER_NAME}-mhc-0" @@ -16,4 +16,3 @@ spec: - type: e2e.remediation.condition status: "False" timeout: 10s - diff --git a/test/e2e/data/infrastructure-aws/md-remediation/patches/mhc-label.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/md-remediation/patches/mhc-label.yaml similarity index 82% rename from test/e2e/data/infrastructure-aws/md-remediation/patches/mhc-label.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/md-remediation/patches/mhc-label.yaml index 3c8e4280fb..99d4d16c4c 100644 --- a/test/e2e/data/infrastructure-aws/md-remediation/patches/mhc-label.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/md-remediation/patches/mhc-label.yaml @@ -1,5 +1,5 @@ --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: MachineDeployment metadata: name: "${CLUSTER_NAME}-md-0" diff --git a/test/e2e/data/infrastructure-aws/multi-az/kustomization.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/multi-az/kustomization.yaml similarity index 100% rename from test/e2e/data/infrastructure-aws/multi-az/kustomization.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/multi-az/kustomization.yaml diff --git a/test/e2e/data/infrastructure-aws/multi-az/patches/multi-az.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/multi-az/patches/multi-az.yaml similarity index 90% rename from test/e2e/data/infrastructure-aws/multi-az/patches/multi-az.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/multi-az/patches/multi-az.yaml index 5b22cf82b0..5202624bb5 100644 --- a/test/e2e/data/infrastructure-aws/multi-az/patches/multi-az.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/multi-az/patches/multi-az.yaml @@ -1,5 +1,5 @@ --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSCluster metadata: name: "${CLUSTER_NAME}" diff --git a/test/e2e/data/infrastructure-aws/nested-multitenancy/kustomization.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/nested-multitenancy/kustomization.yaml similarity index 100% rename from test/e2e/data/infrastructure-aws/nested-multitenancy/kustomization.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/nested-multitenancy/kustomization.yaml diff --git a/test/e2e/data/infrastructure-aws/nested-multitenancy/patches/role-identity.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/nested-multitenancy/patches/role-identity.yaml similarity index 52% rename from test/e2e/data/infrastructure-aws/nested-multitenancy/patches/role-identity.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/nested-multitenancy/patches/role-identity.yaml index 698909d3da..a46d7be52b 100644 --- a/test/e2e/data/infrastructure-aws/nested-multitenancy/patches/role-identity.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/nested-multitenancy/patches/role-identity.yaml @@ -1,9 +1,9 @@ --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSCluster metadata: name: "${CLUSTER_NAME}" spec: identityRef: kind: AWSClusterRoleIdentity - name: "${MULTI_TENANCY_NESTED_IDENTITY_NAME}" \ No newline at end of file + name: "${MULTI_TENANCY_NESTED_IDENTITY_NAME}" diff --git a/test/e2e/data/infrastructure-aws/nested-multitenancy/role.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/nested-multitenancy/role.yaml similarity index 86% rename from test/e2e/data/infrastructure-aws/nested-multitenancy/role.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/nested-multitenancy/role.yaml index 18cbee0647..f6724f1964 100644 --- a/test/e2e/data/infrastructure-aws/nested-multitenancy/role.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/nested-multitenancy/role.yaml @@ -1,5 +1,5 @@ --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSClusterRoleIdentity metadata: name: "${MULTI_TENANCY_JUMP_IDENTITY_NAME}" @@ -12,7 +12,7 @@ spec: name: "default" allowedNamespaces: {} --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSClusterRoleIdentity metadata: name: "${MULTI_TENANCY_NESTED_IDENTITY_NAME}" diff --git a/test/e2e/data/infrastructure-aws/patches/cluster-cni.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/patches/cluster-cni.yaml similarity index 71% rename from test/e2e/data/infrastructure-aws/patches/cluster-cni.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/patches/cluster-cni.yaml index a218ccea65..56f37101c0 100644 --- a/test/e2e/data/infrastructure-aws/patches/cluster-cni.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/patches/cluster-cni.yaml @@ -1,5 +1,5 @@ --- -apiVersion: cluster.x-k8s.io/v1alpha4 +apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: ${CLUSTER_NAME} diff --git a/test/e2e/data/infrastructure-aws/simple-multitenancy/kustomization.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/simple-multitenancy/kustomization.yaml similarity index 100% rename from test/e2e/data/infrastructure-aws/simple-multitenancy/kustomization.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/simple-multitenancy/kustomization.yaml diff --git a/test/e2e/data/infrastructure-aws/simple-multitenancy/patches/role-identity.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/simple-multitenancy/patches/role-identity.yaml similarity index 52% rename from test/e2e/data/infrastructure-aws/simple-multitenancy/patches/role-identity.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/simple-multitenancy/patches/role-identity.yaml index 14f1402126..3a88a97dba 100644 --- a/test/e2e/data/infrastructure-aws/simple-multitenancy/patches/role-identity.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/simple-multitenancy/patches/role-identity.yaml @@ -1,9 +1,9 @@ --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSCluster metadata: name: "${CLUSTER_NAME}" spec: identityRef: kind: AWSClusterRoleIdentity - name: "${MULTI_TENANCY_SIMPLE_IDENTITY_NAME}" \ No newline at end of file + name: "${MULTI_TENANCY_SIMPLE_IDENTITY_NAME}" diff --git a/test/e2e/data/infrastructure-aws/simple-multitenancy/role.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/simple-multitenancy/role.yaml similarity index 86% rename from test/e2e/data/infrastructure-aws/simple-multitenancy/role.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/simple-multitenancy/role.yaml index 547bbf9c65..757b00acd4 100644 --- a/test/e2e/data/infrastructure-aws/simple-multitenancy/role.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/simple-multitenancy/role.yaml @@ -1,5 +1,5 @@ --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSClusterRoleIdentity metadata: name: "${MULTI_TENANCY_SIMPLE_IDENTITY_NAME}" diff --git a/test/e2e/data/infrastructure-aws/spot-instances/kustomization.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/spot-instances/kustomization.yaml similarity index 100% rename from test/e2e/data/infrastructure-aws/spot-instances/kustomization.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/spot-instances/kustomization.yaml diff --git a/test/e2e/data/infrastructure-aws/spot-instances/patches/spot-instances.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/spot-instances/patches/spot-instances.yaml similarity index 73% rename from test/e2e/data/infrastructure-aws/spot-instances/patches/spot-instances.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/spot-instances/patches/spot-instances.yaml index 3b488be4ed..bca01ae32d 100644 --- a/test/e2e/data/infrastructure-aws/spot-instances/patches/spot-instances.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/spot-instances/patches/spot-instances.yaml @@ -1,5 +1,5 @@ --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachineTemplate metadata: name: "${CLUSTER_NAME}-md-0" diff --git a/test/e2e/data/infrastructure-aws/ssm/kustomization.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/ssm/kustomization.yaml similarity index 100% rename from test/e2e/data/infrastructure-aws/ssm/kustomization.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/ssm/kustomization.yaml diff --git a/test/e2e/data/infrastructure-aws/ssm/patches/ssm.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/ssm/patches/ssm.yaml similarity index 76% rename from test/e2e/data/infrastructure-aws/ssm/patches/ssm.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/ssm/patches/ssm.yaml index 34a2da4867..a8fd41c49e 100644 --- a/test/e2e/data/infrastructure-aws/ssm/patches/ssm.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/ssm/patches/ssm.yaml @@ -1,6 +1,6 @@ --- kind: AWSMachineTemplate -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane" spec: @@ -9,7 +9,7 @@ spec: cloudInit: secureSecretsBackend: ssm-parameter-store --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachineTemplate metadata: name: "${CLUSTER_NAME}-md-0" diff --git a/test/e2e/data/infrastructure-aws/upgrade-to-main/kustomization.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/upgrade-to-main/kustomization.yaml similarity index 100% rename from test/e2e/data/infrastructure-aws/upgrade-to-main/kustomization.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/upgrade-to-main/kustomization.yaml diff --git a/test/e2e/data/infrastructure-aws/upgrade-to-main/machinetemplates.yaml b/test/e2e/data/infrastructure-aws/kustomize_sources/upgrade-to-main/machinetemplates.yaml similarity index 85% rename from test/e2e/data/infrastructure-aws/upgrade-to-main/machinetemplates.yaml rename to test/e2e/data/infrastructure-aws/kustomize_sources/upgrade-to-main/machinetemplates.yaml index 27e9a89dd4..d1f444955e 100644 --- a/test/e2e/data/infrastructure-aws/upgrade-to-main/machinetemplates.yaml +++ b/test/e2e/data/infrastructure-aws/kustomize_sources/upgrade-to-main/machinetemplates.yaml @@ -1,6 +1,6 @@ --- kind: AWSMachineTemplate -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 metadata: name: "${CLUSTER_NAME}-control-plane-1" spec: @@ -12,7 +12,7 @@ spec: iamInstanceProfile: "control-plane.cluster-api-provider-aws.sigs.k8s.io" sshKeyName: "${AWS_SSH_KEY_NAME}" --- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AWSMachineTemplate metadata: name: "${CLUSTER_NAME}-md-1" diff --git a/test/e2e/data/shared/v1alpha3/metadata.yaml b/test/e2e/data/shared/v1alpha3/metadata.yaml new file mode 100644 index 0000000000..69306d3bef --- /dev/null +++ b/test/e2e/data/shared/v1alpha3/metadata.yaml @@ -0,0 +1,13 @@ +# maps release series of major.minor to cluster-api contract version +# the contract version may change between minor or major versions, but *not* +# between patch versions. +# +# update this file only when a new major or minor version is released +apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3 +releaseSeries: + - major: 0 + minor: 4 + contract: v1alpha4 + - major: 0 + minor: 3 + contract: v1alpha3 diff --git a/test/e2e/data/shared/v1alpha3_provider/metadata.yaml b/test/e2e/data/shared/v1alpha3_provider/metadata.yaml new file mode 100644 index 0000000000..f6251a859c --- /dev/null +++ b/test/e2e/data/shared/v1alpha3_provider/metadata.yaml @@ -0,0 +1,16 @@ +# maps release series of major.minor to cluster-api contract version +# the contract version may change between minor or major versions, but *not* +# between patch versions. +# +# update this file only when a new major or minor version is released +apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3 +releaseSeries: + - major: 0 + minor: 4 + contract: v1alpha2 + - major: 0 + minor: 5 + contract: v1alpha3 + - major: 0 + minor: 6 + contract: v1alpha3 diff --git a/test/e2e/data/shared/v1beta1/metadata.yaml b/test/e2e/data/shared/v1beta1/metadata.yaml new file mode 100644 index 0000000000..18f6677b45 --- /dev/null +++ b/test/e2e/data/shared/v1beta1/metadata.yaml @@ -0,0 +1,16 @@ +# maps release series of major.minor to cluster-api contract version +# the contract version may change between minor or major versions, but *not* +# between patch versions. +# +# update this file only when a new major or minor version is released +apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3 +releaseSeries: + - major: 1 + minor: 0 + contract: v1beta1 + - major: 0 + minor: 4 + contract: v1alpha4 + - major: 0 + minor: 3 + contract: v1alpha3 diff --git a/test/e2e/data/shared/v1beta1_provider/metadata.yaml b/test/e2e/data/shared/v1beta1_provider/metadata.yaml new file mode 100644 index 0000000000..f49ec7d2c1 --- /dev/null +++ b/test/e2e/data/shared/v1beta1_provider/metadata.yaml @@ -0,0 +1,22 @@ +# maps release series of major.minor to cluster-api contract version +# the contract version may change between minor or major versions, but *not* +# between patch versions. +# +# update this file only when a new major or minor version is released +apiVersion: clusterctl.cluster.x-k8s.io/v1alpha3 +releaseSeries: + - major: 0 + minor: 4 + contract: v1alpha2 + - major: 0 + minor: 5 + contract: v1alpha3 + - major: 0 + minor: 6 + contract: v1alpha3 + - major: 0 + minor: 7 + contract: v1alpha4 + - major: 1 + minor: 0 + contract: v1beta1 diff --git a/test/e2e/shared/aws.go b/test/e2e/shared/aws.go index 4d609573fe..4ff14625f0 100644 --- a/test/e2e/shared/aws.go +++ b/test/e2e/shared/aws.go @@ -28,6 +28,8 @@ import ( "path/filepath" "strings" "time" + "os/exec" + "bytes" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" @@ -42,8 +44,12 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/eks" "github.com/aws/aws-sdk-go/service/iam" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/aws/aws-sdk-go/service/s3/s3manager" + "github.com/aws/aws-sdk-go/service/sts" "github.com/aws/aws-sdk-go/service/servicequotas" cfn_iam "github.com/awslabs/goformation/v4/cloudformation/iam" + "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/wait" cfn_bootstrap "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/cloudformation/bootstrap" cloudformation "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/cloudformation/service" "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/credentials" @@ -235,6 +241,106 @@ func deleteCloudFormationStack(prov client.ConfigProvider, t *cfn_bootstrap.Temp }) } +func ensureTestImageUploaded(e2eCtx *E2EContext) (string, string, error) { + By("Determining the account ID") + stsSvc := sts.New(e2eCtx.BootstrapUserAWSSession) + accountInfo := &sts.GetCallerIdentityOutput{} + if err := wait.WaitForWithRetryable(wait.NewBackoff(), func() (bool, error) { + var intErr error + accountInfo, intErr = stsSvc.GetCallerIdentity(&sts.GetCallerIdentityInput{}) + if intErr != nil { + return false, intErr + } + return true, nil + }, awserrors.InvalidClientTokenID); err != nil { + return "", "", nil + } + region, err := credentials.ResolveRegion("") + if err != nil { + return "", "", err + } + accountID := aws.StringValue(accountInfo.Account) + bucketName := fmt.Sprintf("capi-images.%s.%s.oci-images", region, accountID) + By("Creating an S3 bucket for container images") + s3Svc := s3.New(e2eCtx.BootstrapUserAWSSession) + if err := wait.WaitForWithRetryable(wait.NewBackoff(), func() (bool, error) { + _, err = s3Svc.CreateBucket(&s3.CreateBucketInput{ + ACL: aws.String("public-read"), + Bucket: aws.String(bucketName), + }) + if err != nil && !awserrors.IsBucketAlreadyOwnedByYou(err) { + return false, err + } + return true, nil + }, awserrors.InvalidAccessKeyID); err != nil { + return "", "", nil + } + + dir, err := ioutil.TempDir(e2eCtx.Settings.ArtifactFolder, "containers") + if err != nil { + return "", "", err + } + defer os.RemoveAll(dir) + + dockerImage := fmt.Sprintf("%s/image.tar", dir) + + + Byf("Saving the e2e image to %s", dockerImage) + err = exec.Command("docker", "save", "gcr.io/k8s-staging-cluster-api/capa-manager:e2e", "-o", dockerImage).Run() + + if err != nil { + return "", "", err + } + + cmd := exec.Command("docker", "inspect", "--format='{{index .Id}}'", "gcr.io/k8s-staging-cluster-api/capa-manager:e2e") + var stdOut bytes.Buffer + cmd.Stdout = &stdOut + err = cmd.Run() + + if err != nil { + return "","", err + } + + imageSha := strings.ReplaceAll(strings.TrimSuffix(string(stdOut.Bytes()), "\n"), "'", "") + + uploader := s3manager.NewUploader(e2eCtx.AWSSession) + + f, err := os.Open(dockerImage) + if err != nil { + return "", "", err + } + + Byf("Uploading the e2e image to s3:///%s/%s", bucketName, imageSha) + _, err = uploader.Upload(&s3manager.UploadInput{ + Bucket: aws.String(bucketName), + Key: aws.String(imageSha), + Body: f, + }) + + Byf("Making the image public") + if err := wait.WaitForWithRetryable(wait.NewBackoff(), func() (bool, error) { + _, err = s3Svc.PutObjectAcl(&s3.PutObjectAclInput{ + ACL: aws.String("public-read"), + Bucket: aws.String(bucketName), + Key: aws.String(imageSha), + }) + if err != nil { + return false, err + } + return true, nil + }, awserrors.NoSuchKey); err != nil { + return "", "", nil + } + + + if err != nil { + return "", "", err + } + + Byf("Image uploaded to s3:///%s/%s", bucketName, imageSha) + return bucketName, imageSha, nil +} + // ensureNoServiceLinkedRoles removes an auto-created IAM role, and tests // the controller's IAM permissions to use ELB and Spot instances successfully func ensureNoServiceLinkedRoles(prov client.ConfigProvider) { diff --git a/test/e2e/shared/common.go b/test/e2e/shared/common.go index a7a8e913e9..c01c99f2a2 100644 --- a/test/e2e/shared/common.go +++ b/test/e2e/shared/common.go @@ -30,7 +30,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/clusterctl" "sigs.k8s.io/cluster-api/util" diff --git a/test/e2e/shared/defaults.go b/test/e2e/shared/defaults.go index 7a311930d1..502ce0d7f9 100644 --- a/test/e2e/shared/defaults.go +++ b/test/e2e/shared/defaults.go @@ -27,7 +27,7 @@ import ( "github.com/aws/aws-sdk-go/service/iam" "k8s.io/apimachinery/pkg/runtime" clientgoscheme "k8s.io/client-go/kubernetes/scheme" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" ) @@ -159,7 +159,7 @@ func getLimitedResources() map[string]*ServiceQuota { func DefaultScheme() *runtime.Scheme { sc := runtime.NewScheme() framework.TryAddDefaultSchemes(sc) - _ = v1alpha4.AddToScheme(sc) + _ = infrav1.AddToScheme(sc) _ = clientgoscheme.AddToScheme(sc) return sc } @@ -177,5 +177,5 @@ func CreateDefaultFlags(ctx *E2EContext) { flag.BoolVar(&ctx.Settings.SkipCloudFormationDeletion, "skip-cloudformation-deletion", false, "if true, an AWS CloudFormation stack will not be deleted") flag.BoolVar(&ctx.Settings.SkipCloudFormationCreation, "skip-cloudformation-creation", false, "if true, an AWS CloudFormation stack will not be created") flag.StringVar(&ctx.Settings.DataFolder, "data-folder", "", "path to the data folder") - flag.StringVar(&ctx.Settings.SourceTemplate, "source-template", "infrastructure-aws/cluster-template.yaml", "path to the data folder") + flag.StringVar(&ctx.Settings.SourceTemplate, "source-template", "infrastructure-aws/generated/cluster-template.yaml", "path to the data folder") } diff --git a/test/e2e/shared/identity.go b/test/e2e/shared/identity.go index e2c7e77b5c..1e2359a68f 100644 --- a/test/e2e/shared/identity.go +++ b/test/e2e/shared/identity.go @@ -26,7 +26,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ) const ( diff --git a/test/e2e/shared/suite.go b/test/e2e/shared/suite.go index c8564d3755..2a1de5ada0 100644 --- a/test/e2e/shared/suite.go +++ b/test/e2e/shared/suite.go @@ -41,17 +41,18 @@ import ( ) type synchronizedBeforeTestSuiteConfig struct { - ArtifactFolder string `json:"artifactFolder,omitempty"` - ConfigPath string `json:"configPath,omitempty"` - ClusterctlConfigPath string `json:"clusterctlConfigPath,omitempty"` - KubeconfigPath string `json:"kubeconfigPath,omitempty"` - Region string `json:"region,omitempty"` - E2EConfig clusterctl.E2EConfig `json:"e2eConfig,omitempty"` - BootstrapAccessKey *iam.AccessKey `json:"bootstrapAccessKey,omitempty"` - KubetestConfigFilePath string `json:"kubetestConfigFilePath,omitempty"` - UseCIArtifacts bool `json:"useCIArtifacts,omitempty"` - GinkgoNodes int `json:"ginkgoNodes,omitempty"` - GinkgoSlowSpecThreshold int `json:"ginkgoSlowSpecThreshold,omitempty"` + ArtifactFolder string `json:"artifactFolder,omitempty"` + ConfigPath string `json:"configPath,omitempty"` + ClusterctlConfigPath string `json:"clusterctlConfigPath,omitempty"` + KubeconfigPath string `json:"kubeconfigPath,omitempty"` + Region string `json:"region,omitempty"` + E2EConfig clusterctl.E2EConfig `json:"e2eConfig,omitempty"` + BootstrapAccessKey *iam.AccessKey `json:"bootstrapAccessKey,omitempty"` + KubetestConfigFilePath string `json:"kubetestConfigFilePath,omitempty"` + UseCIArtifacts bool `json:"useCIArtifacts,omitempty"` + GinkgoNodes int `json:"ginkgoNodes,omitempty"` + GinkgoSlowSpecThreshold int `json:"ginkgoSlowSpecThreshold,omitempty"` + Base64EncodedCredentials string `json:"base64EncodedCredentials,omitempty"` } // Node1BeforeSuite is the common setup down on the first ginkgo node before the test suite runs @@ -70,7 +71,7 @@ func Node1BeforeSuite(e2eCtx *E2EContext) []byte { // Create CI manifest for upgrading to Kubernetes main test platformKustomization, err := ioutil.ReadFile(filepath.Join(e2eCtx.Settings.DataFolder, "ci-artifacts-platform-kustomization-for-upgrade.yaml")) Expect(err).NotTo(HaveOccurred()) - sourceTemplateForUpgrade, err := ioutil.ReadFile(filepath.Join(e2eCtx.Settings.DataFolder, "infrastructure-aws/cluster-template-upgrade-to-main.yaml")) + sourceTemplateForUpgrade, err := ioutil.ReadFile(filepath.Join(e2eCtx.Settings.DataFolder, "infrastructure-aws/generated/cluster-template-upgrade-to-main.yaml")) Expect(err).NotTo(HaveOccurred()) ciTemplateForUpgradePath, err := kubernetesversions.GenerateCIArtifactsInjectedTemplateForDebian( @@ -137,6 +138,10 @@ func Node1BeforeSuite(e2eCtx *E2EContext) []byte { ensureSSHKeyPair(e2eCtx.AWSSession, DefaultSSHKeyPairName) e2eCtx.Environment.BootstrapAccessKey = newUserAccessKey(e2eCtx.AWSSession, boostrapTemplate.Spec.BootstrapUser.UserName) e2eCtx.BootstrapUserAWSSession = NewAWSSessionWithKey(e2eCtx.Environment.BootstrapAccessKey) + bucket, imageSha, err := ensureTestImageUploaded(e2eCtx) + Expect(err).NotTo(HaveOccurred()) + e2eCtx.E2EConfig.Variables["CAPI_IMAGES_BUCKET"] = bucket + e2eCtx.E2EConfig.Variables["E2E_IMAGE_SHA"] = imageSha // Image ID is needed when using a CI Kubernetes version. This is used in conformance test and upgrade to main test. if !e2eCtx.IsManaged { @@ -149,7 +154,8 @@ func Node1BeforeSuite(e2eCtx *E2EContext) []byte { By("Setting up the bootstrap cluster") e2eCtx.Environment.BootstrapClusterProvider, e2eCtx.Environment.BootstrapClusterProxy = setupBootstrapCluster(e2eCtx.E2EConfig, e2eCtx.Environment.Scheme, e2eCtx.Settings.UseExistingCluster) - SetEnvVar("AWS_B64ENCODED_CREDENTIALS", encodeCredentials(e2eCtx.Environment.BootstrapAccessKey, boostrapTemplate.Spec.Region), true) + base64EncodedCredentials := encodeCredentials(e2eCtx.Environment.BootstrapAccessKey, boostrapTemplate.Spec.Region) + SetEnvVar("AWS_B64ENCODED_CREDENTIALS", base64EncodedCredentials, true) By("Writing AWS service quotas to a file for parallel tests") quotas := EnsureServiceQuotas(e2eCtx.BootstrapUserAWSSession) @@ -162,17 +168,18 @@ func Node1BeforeSuite(e2eCtx *E2EContext) []byte { CreateAWSClusterControllerIdentity(e2eCtx.Environment.BootstrapClusterProxy.GetClient()) conf := synchronizedBeforeTestSuiteConfig{ - ArtifactFolder: e2eCtx.Settings.ArtifactFolder, - ConfigPath: e2eCtx.Settings.ConfigPath, - ClusterctlConfigPath: e2eCtx.Environment.ClusterctlConfigPath, - KubeconfigPath: e2eCtx.Environment.BootstrapClusterProxy.GetKubeconfigPath(), - Region: getBootstrapTemplate(e2eCtx).Spec.Region, - E2EConfig: *e2eCtx.E2EConfig, - BootstrapAccessKey: e2eCtx.Environment.BootstrapAccessKey, - KubetestConfigFilePath: e2eCtx.Settings.KubetestConfigFilePath, - UseCIArtifacts: e2eCtx.Settings.UseCIArtifacts, - GinkgoNodes: e2eCtx.Settings.GinkgoNodes, - GinkgoSlowSpecThreshold: e2eCtx.Settings.GinkgoSlowSpecThreshold, + ArtifactFolder: e2eCtx.Settings.ArtifactFolder, + ConfigPath: e2eCtx.Settings.ConfigPath, + ClusterctlConfigPath: e2eCtx.Environment.ClusterctlConfigPath, + KubeconfigPath: e2eCtx.Environment.BootstrapClusterProxy.GetKubeconfigPath(), + Region: getBootstrapTemplate(e2eCtx).Spec.Region, + E2EConfig: *e2eCtx.E2EConfig, + BootstrapAccessKey: e2eCtx.Environment.BootstrapAccessKey, + KubetestConfigFilePath: e2eCtx.Settings.KubetestConfigFilePath, + UseCIArtifacts: e2eCtx.Settings.UseCIArtifacts, + GinkgoNodes: e2eCtx.Settings.GinkgoNodes, + GinkgoSlowSpecThreshold: e2eCtx.Settings.GinkgoSlowSpecThreshold, + Base64EncodedCredentials: base64EncodedCredentials, } data, err := yaml.Marshal(conf) @@ -202,6 +209,7 @@ func AllNodesBeforeSuite(e2eCtx *E2EContext, data []byte) { SetEnvVar(AwsAvailabilityZone2, *azs[1].ZoneName, false) SetEnvVar("AWS_REGION", conf.Region, false) SetEnvVar("AWS_SSH_KEY_NAME", DefaultSSHKeyPairName, false) + SetEnvVar("AWS_B64ENCODED_CREDENTIALS", conf.Base64EncodedCredentials, true) e2eCtx.Environment.ResourceTicker = time.NewTicker(time.Second * 5) e2eCtx.Environment.ResourceTickerDone = make(chan bool) // Get EC2 logs every minute diff --git a/test/e2e/shared/template.go b/test/e2e/shared/template.go index f71137e22d..a5b8916e2e 100644 --- a/test/e2e/shared/template.go +++ b/test/e2e/shared/template.go @@ -30,10 +30,11 @@ import ( "gopkg.in/yaml.v2" cfn_iam "github.com/awslabs/goformation/v4/cloudformation/iam" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" - "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1alpha1" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" + bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1beta1" cfn_bootstrap "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/cloudformation/bootstrap" "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/credentials" + iamv1 "sigs.k8s.io/cluster-api-provider-aws/iam/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/clusterctl" ) @@ -52,21 +53,54 @@ func newBootstrapTemplate(e2eCtx *E2EContext) *cfn_bootstrap.Template { By("Creating a bootstrap AWSIAMConfiguration") t := cfn_bootstrap.NewTemplate() t.Spec.BootstrapUser.Enable = true - t.Spec.BootstrapUser.ExtraStatements = []v1alpha4.StatementEntry{ + t.Spec.BootstrapUser.ExtraStatements = []iamv1.StatementEntry{ { - Effect: "Allow", - Action: []string{"sts:AssumeRole"}, - Resource: []string{ - cloudformation.GetAtt(MultiTenancySimpleRole.RoleName(), "Arn"), - cloudformation.GetAtt(MultiTenancyJumpRole.RoleName(), "Arn"), + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{ + iamv1.Any, }, + Action: iamv1.Actions{ + "s3:*", + "sts:*", + "servicequotas:GetServiceQuota", + "servicequotas:RequestServiceQuotaIncrease", + "servicequotas:ListRequestedServiceQuotaChangeHistory", + "elasticloadbalancing:DescribeAccountLimits", + "ec2:DescribeAccountLimits", + "cloudtrail:LookupEvents", + "ssm:StartSession", + "ssm:DescribeSessions", + "ssm:GetConnectionStatus", + "ssm:DescribeInstanceProperties", + "ssm:GetDocument", + "ssm:TerminateSession", + "ssm:ResumeSession", + }, + }, + { + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{ + "arn:*:iam::*:role/aws-service-role/servicequotas.amazonaws.com/AWSServiceRoleForServiceQuotas", + "arn:*:iam::*:role/aws-service-role/support.amazonaws.com/AWSServiceRoleForSupport", + "arn:*:iam::*:role/aws-service-role/trustedadvisor.amazonaws.com/AWSServiceRoleForTrustedAdvisor", + }, + Action: iamv1.Actions{ + "iam:CreateServiceLinkedRole", + }, + }, + } + t.Spec.Nodes.ExtraStatements = []iamv1.StatementEntry{ + { + Effect: iamv1.EffectAllow, + Action: []string{"s3:Get*", "s3:List*"}, + Resource: []string{iamv1.Any}, }, } - t.Spec.SecureSecretsBackends = []v1alpha4.SecretBackend{ - v1alpha4.SecretBackendSecretsManager, - v1alpha4.SecretBackendSSMParameterStore, + t.Spec.SecureSecretsBackends = []infrav1.SecretBackend{ + infrav1.SecretBackendSecretsManager, + infrav1.SecretBackendSSMParameterStore, } - t.Spec.EventBridge = &v1alpha1.EventBridgeConfig{ + t.Spec.EventBridge = &bootstrapv1.EventBridgeConfig{ Enable: true, } @@ -90,46 +124,9 @@ func newBootstrapTemplate(e2eCtx *E2EContext) *cfn_bootstrap.Template { func renderCustomCloudFormation(t *cfn_bootstrap.Template) *cloudformation.Template { cloudformationTemplate := t.RenderCloudFormation() appendMultiTenancyRoles(t, cloudformationTemplate) - appendExtraPoliciesToBootstrapUser(t) return cloudformationTemplate } -func appendExtraPoliciesToBootstrapUser(t *cfn_bootstrap.Template) { - t.Spec.BootstrapUser.ExtraStatements = append(t.Spec.BootstrapUser.ExtraStatements, v1alpha4.StatementEntry{ - Effect: v1alpha4.EffectAllow, - Resource: v1alpha4.Resources{ - "*", - }, - Action: v1alpha4.Actions{ - "servicequotas:GetServiceQuota", - "servicequotas:RequestServiceQuotaIncrease", - "servicequotas:ListRequestedServiceQuotaChangeHistory", - "elasticloadbalancing:DescribeAccountLimits", - "ec2:DescribeAccountLimits", - "cloudtrail:LookupEvents", - "ssm:StartSession", - "ssm:DescribeSessions", - "ssm:GetConnectionStatus", - "ssm:DescribeInstanceProperties", - "ssm:GetDocument", - "ssm:TerminateSession", - "ssm:ResumeSession", - }, - }) - t.Spec.BootstrapUser.ExtraStatements = append(t.Spec.BootstrapUser.ExtraStatements, v1alpha4.StatementEntry{ - Effect: v1alpha4.EffectAllow, - Resource: v1alpha4.Resources{ - "arn:*:iam::*:role/aws-service-role/autoscaling.amazonaws.com/AWSServiceRoleForAutoScaling", - "arn:*:iam::*:role/aws-service-role/servicequotas.amazonaws.com/AWSServiceRoleForServiceQuotas", - "arn:*:iam::*:role/aws-service-role/support.amazonaws.com/AWSServiceRoleForSupport", - "arn:*:iam::*:role/aws-service-role/trustedadvisor.amazonaws.com/AWSServiceRoleForTrustedAdvisor", - }, - Action: v1alpha4.Actions{ - "iam:CreateServiceLinkedRole", - }, - }) -} - func appendMultiTenancyRoles(t *cfn_bootstrap.Template, cfnt *cloudformation.Template) { controllersPolicy := cfnt.Resources[string(cfn_bootstrap.ControllersPolicy)].(*cfn_iam.ManagedPolicy) @@ -140,13 +137,13 @@ func appendMultiTenancyRoles(t *cfn_bootstrap.Template, cfnt *cloudformation.Tem ) cfnt.Resources[MultiTenancyJumpPolicy] = &cfn_iam.ManagedPolicy{ ManagedPolicyName: MultiTenancyJumpPolicy, - PolicyDocument: &v1alpha4.PolicyDocument{ - Version: v1alpha4.CurrentVersion, - Statement: []v1alpha4.StatementEntry{ + PolicyDocument: &iamv1.PolicyDocument{ + Version: iamv1.CurrentVersion, + Statement: []iamv1.StatementEntry{ { - Effect: v1alpha4.EffectAllow, - Resource: v1alpha4.Resources{cloudformation.GetAtt(MultiTenancyNestedRole.RoleName(), "Arn")}, - Action: v1alpha4.Actions{"sts:AssumeRole"}, + Effect: iamv1.EffectAllow, + Resource: iamv1.Resources{cloudformation.GetAtt(MultiTenancyNestedRole.RoleName(), "Arn")}, + Action: iamv1.Actions{"sts:AssumeRole"}, }, }, }, @@ -155,15 +152,15 @@ func appendMultiTenancyRoles(t *cfn_bootstrap.Template, cfnt *cloudformation.Tem cfnt.Resources[MultiTenancySimpleRole.RoleName()] = &cfn_iam.Role{ RoleName: MultiTenancySimpleRole.RoleName(), - AssumeRolePolicyDocument: cfn_bootstrap.AssumeRolePolicy(v1alpha4.PrincipalAWS, []string{accountRef}), + AssumeRolePolicyDocument: cfn_bootstrap.AssumeRolePolicy(iamv1.PrincipalAWS, []string{accountRef}), } cfnt.Resources[MultiTenancyJumpRole.RoleName()] = &cfn_iam.Role{ RoleName: MultiTenancyJumpRole.RoleName(), - AssumeRolePolicyDocument: cfn_bootstrap.AssumeRolePolicy(v1alpha4.PrincipalAWS, []string{accountRef}), + AssumeRolePolicyDocument: cfn_bootstrap.AssumeRolePolicy(iamv1.PrincipalAWS, []string{accountRef}), } cfnt.Resources[MultiTenancyNestedRole.RoleName()] = &cfn_iam.Role{ RoleName: MultiTenancyNestedRole.RoleName(), - AssumeRolePolicyDocument: cfn_bootstrap.AssumeRolePolicy(v1alpha4.PrincipalAWS, []string{accountRef}), + AssumeRolePolicyDocument: cfn_bootstrap.AssumeRolePolicy(iamv1.PrincipalAWS, []string{accountRef}), } } diff --git a/test/e2e/suites/managed/addon.go b/test/e2e/suites/managed/addon.go index 1ac57f5f2a..9a51d4f466 100644 --- a/test/e2e/suites/managed/addon.go +++ b/test/e2e/suites/managed/addon.go @@ -32,7 +32,7 @@ import ( "sigs.k8s.io/cluster-api/test/framework/clusterctl" crclient "sigs.k8s.io/controller-runtime/pkg/client" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/test/e2e/shared" ) diff --git a/test/e2e/suites/managed/addon_helpers.go b/test/e2e/suites/managed/addon_helpers.go index 226a2151e8..ef5c6d225a 100644 --- a/test/e2e/suites/managed/addon_helpers.go +++ b/test/e2e/suites/managed/addon_helpers.go @@ -27,7 +27,7 @@ import ( "github.com/aws/aws-sdk-go/aws/client" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" ) type waitForEKSAddonToHaveStatusInput struct { diff --git a/test/e2e/suites/managed/cluster.go b/test/e2e/suites/managed/cluster.go index 161102fcec..bbe2cd9f6a 100644 --- a/test/e2e/suites/managed/cluster.go +++ b/test/e2e/suites/managed/cluster.go @@ -35,7 +35,7 @@ import ( "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/clusterctl" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/test/e2e/shared" ) diff --git a/test/e2e/suites/managed/control_plane.go b/test/e2e/suites/managed/control_plane.go index 870fb0a8b6..9528e42c45 100644 --- a/test/e2e/suites/managed/control_plane.go +++ b/test/e2e/suites/managed/control_plane.go @@ -32,7 +32,7 @@ import ( "sigs.k8s.io/cluster-api/util/patch" crclient "sigs.k8s.io/controller-runtime/pkg/client" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/test/e2e/shared" ) diff --git a/test/e2e/suites/managed/control_plane_helpers.go b/test/e2e/suites/managed/control_plane_helpers.go index 10e326942d..eca2a5aea3 100644 --- a/test/e2e/suites/managed/control_plane_helpers.go +++ b/test/e2e/suites/managed/control_plane_helpers.go @@ -30,7 +30,7 @@ import ( "k8s.io/apimachinery/pkg/util/version" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" ) type waitForControlPlaneToBeUpgradedInput struct { diff --git a/test/e2e/suites/managed/eks_test.go b/test/e2e/suites/managed/eks_test.go index fa5d11c56f..0eb140aaba 100644 --- a/test/e2e/suites/managed/eks_test.go +++ b/test/e2e/suites/managed/eks_test.go @@ -29,7 +29,7 @@ import ( "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/util" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/test/e2e/shared" ) diff --git a/test/e2e/suites/managed/helpers.go b/test/e2e/suites/managed/helpers.go index 9fb6f35070..26142f606f 100644 --- a/test/e2e/suites/managed/helpers.go +++ b/test/e2e/suites/managed/helpers.go @@ -37,7 +37,7 @@ import ( "sigs.k8s.io/cluster-api/test/framework/clusterctl" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" ) const ( diff --git a/test/e2e/suites/managed/machine_deployment.go b/test/e2e/suites/managed/machine_deployment.go index 1ca5bccd89..1ab910e601 100644 --- a/test/e2e/suites/managed/machine_deployment.go +++ b/test/e2e/suites/managed/machine_deployment.go @@ -27,7 +27,7 @@ import ( corev1 "k8s.io/api/core/v1" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/clusterctl" diff --git a/test/e2e/suites/managed/machine_deployment_helpers.go b/test/e2e/suites/managed/machine_deployment_helpers.go index 8c7c15fa02..3ebeee7e99 100644 --- a/test/e2e/suites/managed/machine_deployment_helpers.go +++ b/test/e2e/suites/managed/machine_deployment_helpers.go @@ -24,7 +24,7 @@ import ( . "github.com/onsi/gomega" apierrors "k8s.io/apimachinery/pkg/api/errors" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/test/e2e/suites/managed/machine_pool_helpers.go b/test/e2e/suites/managed/machine_pool_helpers.go index 8e4d7b9ca7..4ecc99efbf 100644 --- a/test/e2e/suites/managed/machine_pool_helpers.go +++ b/test/e2e/suites/managed/machine_pool_helpers.go @@ -24,7 +24,7 @@ import ( . "github.com/onsi/gomega" apierrors "k8s.io/apimachinery/pkg/api/errors" - clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/controller-runtime/pkg/client" @@ -32,7 +32,7 @@ import ( ) type deleteMachinePoolInput struct { - MachinePool *clusterv1exp.MachinePool + MachinePool *expclusterv1.MachinePool Deleter framework.Deleter } @@ -42,14 +42,14 @@ func deleteMachinePool(ctx context.Context, input deleteMachinePoolInput) { } type waitForMachinePoolDeletedInput struct { - MachinePool *clusterv1exp.MachinePool + MachinePool *expclusterv1.MachinePool Getter framework.Getter } func waitForMachinePoolDeleted(ctx context.Context, input waitForMachinePoolDeletedInput, intervals ...interface{}) { shared.Byf("Waiting for machine pool %s to be deleted", input.MachinePool.GetName()) Eventually(func() bool { - mp := &clusterv1exp.MachinePool{} + mp := &expclusterv1.MachinePool{} key := client.ObjectKey{ Namespace: input.MachinePool.GetNamespace(), Name: input.MachinePool.GetName(), diff --git a/test/e2e/suites/managed/managed_suite_test.go b/test/e2e/suites/managed/managed_suite_test.go index 98f59b631f..b50af3e6b2 100644 --- a/test/e2e/suites/managed/managed_suite_test.go +++ b/test/e2e/suites/managed/managed_suite_test.go @@ -26,12 +26,12 @@ import ( . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/runtime" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" - infrav1alpha4exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1beta1" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/test/e2e/shared" ) @@ -79,10 +79,10 @@ func runUpgradeTests() bool { func initScheme() *runtime.Scheme { sc := shared.DefaultScheme() - _ = infrav1alpha4exp.AddToScheme(sc) + _ = expinfrav1.AddToScheme(sc) _ = clusterv1.AddToScheme(sc) _ = controlplanev1.AddToScheme(sc) - _ = clusterv1exp.AddToScheme(sc) + _ = expclusterv1.AddToScheme(sc) return sc } diff --git a/test/e2e/suites/unmanaged/helpers_test.go b/test/e2e/suites/unmanaged/helpers_test.go index 0ac1621dba..ab30c278d2 100644 --- a/test/e2e/suites/unmanaged/helpers_test.go +++ b/test/e2e/suites/unmanaged/helpers_test.go @@ -45,11 +45,11 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" apimachinerytypes "k8s.io/apimachinery/pkg/types" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/test/e2e/shared" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" - bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1alpha4" - controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" + bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" + controlplanev1 "sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/clusterctl" client_runtime "sigs.k8s.io/controller-runtime/pkg/client" @@ -141,7 +141,7 @@ func createLBService(svcNamespace string, svcName string, k8sclient crclient.Cli return elbName } -func deleteLBService(svcNamespace string, svcName string, k8sclient crclient.Client){ +func deleteLBService(svcNamespace string, svcName string, k8sclient crclient.Client) { svcSpec := corev1.ServiceSpec{ Type: corev1.ServiceTypeLoadBalancer, Ports: []corev1.ServicePort{ @@ -161,7 +161,7 @@ func createPodTemplateSpec(statefulsetinfo statefulSetInfo) corev1.PodTemplateSp ginkgo.By("Creating PodTemplateSpec config object") podTemplateSpec := corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ - Name: statefulsetinfo.name, + Name: statefulsetinfo.name, Labels: statefulsetinfo.selector, }, Spec: corev1.PodSpec{ @@ -180,7 +180,7 @@ func createPodTemplateSpec(statefulsetinfo statefulSetInfo) corev1.PodTemplateSp { Name: statefulsetinfo.volumeName, VolumeSource: corev1.VolumeSource{ - PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ClaimName: statefulsetinfo.volumeName }, + PersistentVolumeClaim: &corev1.PersistentVolumeClaimVolumeSource{ClaimName: statefulsetinfo.volumeName}, }, }, }, @@ -271,10 +271,10 @@ func createStorageClass(storageClassName string, k8sclient crclient.Client) { }, Parameters: map[string]string{ "csi.storage.k8s.io/fstype": "xfs", - "type": "io1", - "iopsPerGB": "100", + "type": "io1", + "iopsPerGB": "100", }, - Provisioner: "ebs.csi.aws.com", + Provisioner: "ebs.csi.aws.com", AllowVolumeExpansion: &volExpansion, VolumeBindingMode: &bindingMode, AllowedTopologies: []corev1.TopologySelectorTerm{{ @@ -357,7 +357,7 @@ func deployStatefulSet(statefulsetinfo statefulSetInfo, volClaimTemp corev1.Pers statefulset := appsv1.StatefulSet{ ObjectMeta: metav1.ObjectMeta{Name: statefulsetinfo.name, Namespace: statefulsetinfo.namespace}, Spec: appsv1.StatefulSetSpec{ - ServiceName: statefulsetinfo.svcName, + ServiceName: statefulsetinfo.svcName, Replicas: &statefulsetinfo.replicas, Selector: &metav1.LabelSelector{MatchLabels: statefulsetinfo.selector}, Template: podTemplate, diff --git a/test/e2e/suites/unmanaged/unmanaged_CAPI_test.go b/test/e2e/suites/unmanaged/unmanaged_CAPI_test.go index 503a75442a..c99617d6d8 100644 --- a/test/e2e/suites/unmanaged/unmanaged_CAPI_test.go +++ b/test/e2e/suites/unmanaged/unmanaged_CAPI_test.go @@ -39,7 +39,7 @@ var _ = ginkgo.Context("[unmanaged] [Cluster API Framework]", func() { }) // DEPRECATED. Should be replaced with the conformance upgrade spec - ginkgo.Describe("KCP Upgrade Spec - Single Control Plane Cluster", func() { + ginkgo.PDescribe("[Deprecated] KCP Upgrade Spec - Single Control Plane Cluster", func() { // As the resources cannot be defined by the It() clause in CAPI tests, using the largest values required for all It() tests in this CAPI test. requiredResources := &shared.TestResource{EC2: 2, IGW: 1, NGW: 1, VPC: 1, ClassicLB: 1, EIP: 3} ginkgo.BeforeEach(func() { @@ -60,7 +60,7 @@ var _ = ginkgo.Context("[unmanaged] [Cluster API Framework]", func() { }) // DEPRECATED. Should be replaced with the conformance upgrade spec - ginkgo.Describe("KCP Upgrade Spec - HA Control Plane Cluster using Scale-In", func() { + ginkgo.PDescribe("[Deprecated] KCP Upgrade Spec - HA Control Plane Cluster using Scale-In", func() { // As the resources cannot be defined by the It() clause in CAPI tests, using the largest values required for all It() tests in this CAPI test. requiredResources := &shared.TestResource{EC2: 4, IGW: 1, NGW: 1, VPC: 1, ClassicLB: 1, EIP: 3} ginkgo.BeforeEach(func() { @@ -127,9 +127,9 @@ var _ = ginkgo.Context("[unmanaged] [Cluster API Framework]", func() { }) }) - ginkgo.Describe("Running the Clusterctl Upgrade Spec", func() { + ginkgo.PDescribe("Running the v1alpha3->v1beta1 Clusterctl Upgrade Spec", func() { // As the resources cannot be defined by the It() clause in CAPI tests, using the largest values required for all It() tests in this CAPI test. - requiredResources := &shared.TestResource{EC2: 4, IGW: 1, NGW: 1, VPC: 1, ClassicLB: 1, EIP: 1} + requiredResources := &shared.TestResource{EC2: 13, IGW: 3, NGW: 3, VPC: 3, ClassicLB: 3, EIP: 3} ginkgo.BeforeEach(func() { requiredResources.WriteRequestedResources(e2eCtx, "capi-clusterctl-upgrade-test") Expect(shared.AcquireResources(requiredResources, config.GinkgoConfig.ParallelNode, flock.New(shared.ResourceQuotaFilePath))).To(Succeed()) @@ -142,6 +142,7 @@ var _ = ginkgo.Context("[unmanaged] [Cluster API Framework]", func() { BootstrapClusterProxy: e2eCtx.Environment.BootstrapClusterProxy, ArtifactFolder: e2eCtx.Settings.ArtifactFolder, SkipCleanup: e2eCtx.Settings.SkipCleanup, + MgmtFlavor: "capi-upgrade", } }) ginkgo.AfterEach(func() { diff --git a/test/e2e/suites/unmanaged/unmanaged_functional_test.go b/test/e2e/suites/unmanaged/unmanaged_functional_test.go index b3890cb9e3..c0988bb0e5 100644 --- a/test/e2e/suites/unmanaged/unmanaged_functional_test.go +++ b/test/e2e/suites/unmanaged/unmanaged_functional_test.go @@ -21,12 +21,13 @@ package unmanaged import ( "context" "fmt" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "os" "path/filepath" "strings" "time" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/blang/semver" "github.com/gofrs/flock" "github.com/onsi/ginkgo" @@ -34,16 +35,16 @@ import ( . "github.com/onsi/gomega" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1beta1" "sigs.k8s.io/cluster-api-provider-aws/exp/instancestate" "sigs.k8s.io/cluster-api-provider-aws/test/e2e/shared" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework" "sigs.k8s.io/cluster-api/test/framework/clusterctl" "sigs.k8s.io/cluster-api/util" ) -var _ = ginkgo.Context("[unmanaged] [functional]", func() { +var _ = ginkgo.PContext("[unmanaged] [functional]", func() { var ( ctx context.Context result *clusterctl.ApplyClusterTemplateAndWaitResult diff --git a/test/helpers/envtest.go b/test/helpers/envtest.go index 0d02c6f8ae..e0d9675b99 100644 --- a/test/helpers/envtest.go +++ b/test/helpers/envtest.go @@ -42,7 +42,7 @@ import ( "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" "sigs.k8s.io/cluster-api-provider-aws/test/helpers/external" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/cmd/clusterctl/log" utilyaml "sigs.k8s.io/cluster-api/util/yaml" ctrl "sigs.k8s.io/controller-runtime" @@ -215,7 +215,6 @@ func (t *TestEnvironmentConfiguration) Build() (*TestEnvironment, error) { func buildModifiedWebhook(tag string, relativeFilePath string) (admissionv1.MutatingWebhookConfiguration, admissionv1.ValidatingWebhookConfiguration, error) { var mutatingWebhook admissionv1.MutatingWebhookConfiguration var validatingWebhook admissionv1.ValidatingWebhookConfiguration - data, err := ioutil.ReadFile(filepath.Clean(filepath.Join(root, relativeFilePath))) if err != nil { return mutatingWebhook, validatingWebhook, errors.Wrap(err, "failed to read webhook configuration file") diff --git a/test/helpers/external/cluster.go b/test/helpers/external/cluster.go index efbe32bc7b..66ce07f027 100644 --- a/test/helpers/external/cluster.go +++ b/test/helpers/external/cluster.go @@ -26,7 +26,7 @@ import ( const ( clusterAPIGroup = "cluster.x-k8s.io" - clusterAPITestVersion = "v1alpha4" + clusterAPITestVersion = "v1beta1" ) var ( diff --git a/versions.mk b/versions.mk index 15cb416712..36b82d6648 100644 --- a/versions.mk +++ b/versions.mk @@ -15,5 +15,5 @@ MDBOOK_VERSION := v0.4.5 PLANTUML_VERSION := 1.2020.16 GH_VERSION := 1.2.0 -CERT_MANAGER_VERSION := v1.1.0 -CAPI_VERSION := v0.4.1 +CERT_MANAGER_VERSION := v1.5.3 +CAPI_VERSION := v1.0.0-rc.0