diff --git a/.golangci.yml b/.golangci.yml index 820979aec8..90939e5349 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -16,6 +16,8 @@ linters: - gci - nlreturn - gocritic + - exhaustivestruct + - wrapcheck # Run with --fast=false for more extensive checks fast: true issues: diff --git a/Dockerfile b/Dockerfile index bc28f2671a..2b3747fe87 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ # limitations under the License. # Build the manager binary -FROM golang:1.13.15 as builder +FROM golang:1.16.2 as builder WORKDIR /workspace # Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy diff --git a/Makefile b/Makefile index a234e735f7..cb69f48354 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,7 @@ CORE_CONTROLLER_IMG ?= $(REGISTRY)/$(CORE_IMAGE_NAME) CORE_CONTROLLER_ORIGINAL_IMG := gcr.io/k8s-staging-cluster-api-aws/cluster-api-aws-controller CORE_CONTROLLER_NAME := capa-controller-manager CORE_MANIFEST_FILE := infrastructure-components -CORE_CONFIG_DIR := config +CORE_CONFIG_DIR := config/default CORE_NAMESPACE := capa-system # bootstrap @@ -101,7 +101,7 @@ EKS_BOOTSTRAP_CONTROLLER_IMG ?= $(REGISTRY)/$(EKS_BOOTSTRAP_IMAGE_NAME) EKS_BOOTSTRAP_CONTROLLER_ORIGINAL_IMG := gcr.io/k8s-staging-cluster-api-aws/eks-bootstrap-controller EKS_BOOTSTRAP_CONTROLLER_NAME := capa-eks-bootstrap-controller-manager EKS_BOOTSTRAP_MANIFEST_FILE := eks-bootstrap-components -EKS_BOOTSTRAP_CONFIG_DIR := bootstrap/eks/config +EKS_BOOTSTRAP_CONFIG_DIR := bootstrap/eks/config/default EKS_BOOTSTRAP_NAMESPACE := capa-eks-bootstrap-system # bootstrap @@ -110,7 +110,7 @@ EKS_CONTROLPLANE_CONTROLLER_IMG ?= $(REGISTRY)/$(EKS_CONTROLPLANE_IMAGE_NAME) EKS_CONTROLPLANE_CONTROLLER_ORIGINAL_IMG := gcr.io/k8s-staging-cluster-api-aws/eks-controlplane-controller EKS_CONTROLPLANE_CONTROLLER_NAME := capa-eks-control-plane-controller-manager EKS_CONTROLPLANE_MANIFEST_FILE := eks-controlplane-components -EKS_CONTROLPLANE_CONFIG_DIR := controlplane/eks/config +EKS_CONTROLPLANE_CONFIG_DIR := controlplane/eks/config/default EKS_CONTROLPLANE_NAMESPACE := capa-eks-control-plane-system # Allow overriding manifest generation destination directory @@ -238,7 +238,7 @@ generate-go: $(MOCKGEN) .PHONY: generate-go-core generate-go-core: ## Runs Go related generate targets - $(MAKE) -B $(CONTROLLER_GEN) $(CONVERSION_GEN) $(DEFAULTER_GEN) + $(MAKE) -B $(CONTROLLER_GEN) $(DEFAULTER_GEN) $(CONVERSION_GEN) $(CONTROLLER_GEN) \ paths=./api/... \ paths=./$(EXP_DIR)/api/... \ @@ -254,21 +254,36 @@ generate-go-core: ## Runs Go related generate targets --go-header-file=./hack/boilerplate/boilerplate.generatego.txt $(CONVERSION_GEN) \ - --input-dirs=./api/v1alpha2 \ + --input-dirs=./api/v1alpha3 \ + --extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha3 \ + --build-tag=ignore_autogenerated_core_v1alpha3 \ --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 \ + --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 \ + --output-file-base=zz_generated.conversion $(GEN_OUTPUT_BASE) \ + --go-header-file=./hack/boilerplate/boilerplate.generatego.txt .PHONY: generate-manifests generate-manifests: @@ -530,7 +545,6 @@ $(RELEASE_DIR)/$(CORE_MANIFEST_FILE).yaml: CONTROLLER_NAME=$(CORE_CONTROLLER_NAME) \ PROVIDER_CONFIG_DIR=$(CORE_CONFIG_DIR) \ NAMESPACE=$(CORE_NAMESPACE) \ - WEBHOOK_ENABLED=true .PHONY: $(RELEASE_DIR)/$(EKS_BOOTSTRAP_MANIFEST_FILE).yaml $(RELEASE_DIR)/$(EKS_BOOTSTRAP_MANIFEST_FILE).yaml: @@ -551,7 +565,6 @@ $(RELEASE_DIR)/$(EKS_CONTROLPLANE_MANIFEST_FILE).yaml: CONTROLLER_NAME=$(EKS_CONTROLPLANE_CONTROLLER_NAME) \ PROVIDER_CONFIG_DIR=$(EKS_CONTROLPLANE_CONFIG_DIR) \ NAMESPACE=$(EKS_CONTROLPLANE_NAMESPACE) \ - WEBHOOK_ENABLED=true .PHONY: compiled-manifest compiled-manifest: $(RELEASE_DIR) $(KUSTOMIZE) @@ -568,21 +581,12 @@ image-patch-source-manifest: $(IMAGE_PATCH_DIR) $(KUSTOMIZE) .PHONY: image-patch-kustomization image-patch-kustomization: $(IMAGE_PATCH_DIR) mkdir -p $(IMAGE_PATCH_DIR)/$(PROVIDER) - @if [ "${WEBHOOK_ENABLED}" = "true" ]; then \ - $(MAKE) image-patch-kustomization-with-webhook; else \ - $(MAKE) image-patch-kustomization-without-webhook; \ - fi - -.PHONY: image-patch-kustomization-with-webhook -image-patch-kustomization-with-webhook: $(IMAGE_PATCH_DIR) $(GOJQ) - mkdir -p $(IMAGE_PATCH_DIR)/$(PROVIDER) - $(GOJQ) --yaml-input --yaml-output '.images[0]={"name":"$(OLD_IMG)","newName":"$(MANIFEST_IMG)","newTag":"$(TAG)"}|.patchesJson6902[0].target.name="$(CONTROLLER_NAME)"|.patchesJson6902[0].target.namespace="$(NAMESPACE)"|.patchesJson6902[1].target.name="$(CONTROLLER_NAME)"' \ - "hack/image-patch/kustomization.yaml" > $(IMAGE_PATCH_DIR)/$(PROVIDER)/kustomization.yaml + $(MAKE) image-patch-kustomization-without-webhook .PHONY: image-patch-kustomization-without-webhook image-patch-kustomization-without-webhook: $(IMAGE_PATCH_DIR) $(GOJQ) mkdir -p $(IMAGE_PATCH_DIR)/$(PROVIDER) - $(GOJQ) --yaml-input --yaml-output '.images[0]={"name":"$(OLD_IMG)","newName":"$(MANIFEST_IMG)","newTag":"$(TAG)"}|del(.patchesJson6902[1])|.patchesJson6902[0].target.name="$(CONTROLLER_NAME)"|.patchesJson6902[0].target.namespace="$(NAMESPACE)"' \ + $(GOJQ) --yaml-input --yaml-output '.images[0]={"name":"$(OLD_IMG)","newName":"$(MANIFEST_IMG)","newTag":"$(TAG)"}|.patchesJson6902[0].target.name="$(CONTROLLER_NAME)"|.patchesJson6902[0].target.namespace="$(NAMESPACE)"' \ "hack/image-patch/kustomization.yaml" > $(IMAGE_PATCH_DIR)/$(PROVIDER)/kustomization.yaml .PHONY: image-patch-pull-policy diff --git a/PROJECT b/PROJECT index b4ab51162f..2e644d01f3 100644 --- a/PROJECT +++ b/PROJECT @@ -3,20 +3,38 @@ domain: cluster.x-k8s.io repo: sigs.k8s.io/cluster-api-provider-aws resources: - group: infrastructure - version: v1alpha2 + version: v1alpha3 kind: AWSMachine - group: infrastructure - version: v1alpha2 + version: v1alpha3 kind: AWSCluster - group: infrastructure - version: v1alpha2 + version: v1alpha3 kind: AWSMachineTemplate - group: infrastructure version: v1alpha3 - kind: AWSMachine + kind: AWSClusterStaticIdentity - group: infrastructure version: v1alpha3 - kind: AWSCluster + kind: AWSClusterRoleIdentity - group: infrastructure version: v1alpha3 + kind: AWSClusterControllerIdentity +- group: infrastructure + version: v1alpha4 + kind: AWSMachine +- group: infrastructure + version: v1alpha4 + kind: AWSCluster +- group: infrastructure + version: v1alpha4 kind: AWSMachineTemplate +- group: infrastructure + version: v1alpha4 + kind: AWSClusterStaticIdentity +- group: infrastructure + version: v1alpha4 + kind: AWSClusterRoleIdentity +- group: infrastructure + version: v1alpha4 + kind: AWSClusterControllerIdentity diff --git a/api/v1alpha3/awscluster_types.go b/api/v1alpha3/awscluster_types.go index f80dba681c..6a742ad5e1 100644 --- a/api/v1alpha3/awscluster_types.go +++ b/api/v1alpha3/awscluster_types.go @@ -183,7 +183,6 @@ type AWSClusterStatus struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsclusters,scope=Namespaced,categories=cluster-api -// +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" diff --git a/api/v1alpha3/awscluster_webhook.go b/api/v1alpha3/awscluster_webhook.go deleted file mode 100644 index 8e9f87f622..0000000000 --- a/api/v1alpha3/awscluster_webhook.go +++ /dev/null @@ -1,126 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - "fmt" - "reflect" - - 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/v1alpha3" - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -// log is for logging in this package. -var _ = logf.Log.WithName("awscluster-resource") - -func (r *AWSCluster) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha3-awscluster,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusters,versions=v1alpha3,name=validation.awscluster.infrastructure.cluster.x-k8s.io,sideEffects=None -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha3-awscluster,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusters,versions=v1alpha3,name=default.awscluster.infrastructure.cluster.x-k8s.io,sideEffects=None - -var ( - _ webhook.Validator = &AWSCluster{} - _ webhook.Defaulter = &AWSCluster{} -) - -func (r *AWSCluster) ValidateCreate() error { - var allErrs field.ErrorList - - allErrs = append(allErrs, r.Spec.Bastion.Validate()...) - allErrs = append(allErrs, r.validateSSHKeyName()...) - - return aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -func (r *AWSCluster) ValidateDelete() error { - return nil -} - -func (r *AWSCluster) ValidateUpdate(old runtime.Object) error { - var allErrs field.ErrorList - - oldC, ok := old.(*AWSCluster) - if !ok { - return apierrors.NewBadRequest(fmt.Sprintf("expected an AWSCluster but got a %T", old)) - } - - if r.Spec.Region != oldC.Spec.Region { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "region"), r.Spec.Region, "field is immutable"), - ) - } - - existingLoadBalancer := &AWSLoadBalancerSpec{} - newLoadBalancer := &AWSLoadBalancerSpec{} - - if oldC.Spec.ControlPlaneLoadBalancer != nil { - existingLoadBalancer = oldC.Spec.ControlPlaneLoadBalancer.DeepCopy() - } - if r.Spec.ControlPlaneLoadBalancer != nil { - newLoadBalancer = r.Spec.ControlPlaneLoadBalancer.DeepCopy() - } - if !reflect.DeepEqual(existingLoadBalancer.Scheme, newLoadBalancer.Scheme) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "controlPlaneLoadBalancer", "scheme"), - r.Spec.ControlPlaneLoadBalancer.Scheme, "field is immutable"), - ) - } - - if !reflect.DeepEqual(oldC.Spec.ControlPlaneEndpoint, clusterv1.APIEndpoint{}) && - !reflect.DeepEqual(r.Spec.ControlPlaneEndpoint, oldC.Spec.ControlPlaneEndpoint) { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "controlPlaneEndpoint"), r.Spec.ControlPlaneEndpoint, "field is immutable"), - ) - } - - // If a identityRef is already set, do not allow removal of it. - if oldC.Spec.IdentityRef != nil && r.Spec.IdentityRef == nil { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "identityRef"), - r.Spec.IdentityRef, "field cannot be set to nil"), - ) - } - - allErrs = append(allErrs, r.Spec.Bastion.Validate()...) - - return aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -func (r *AWSCluster) Default() { - SetDefaults_Bastion(&r.Spec.Bastion) - SetDefaults_NetworkSpec(&r.Spec.NetworkSpec) - - if r.Spec.IdentityRef == nil { - r.Spec.IdentityRef = &AWSIdentityReference{ - Kind: ControllerIdentityKind, - Name: AWSClusterControllerIdentityName, - } - } -} - -func (r *AWSCluster) validateSSHKeyName() field.ErrorList { - return validateSSHKeyName(r.Spec.SSHKeyName) -} diff --git a/api/v1alpha3/awscluster_webhook_test.go b/api/v1alpha3/awscluster_webhook_test.go deleted file mode 100644 index 79f860870d..0000000000 --- a/api/v1alpha3/awscluster_webhook_test.go +++ /dev/null @@ -1,426 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - "context" - "testing" - - . "github.com/onsi/gomega" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" -) - -func TestAWSCluster_ValidateCreate(t *testing.T) { - tests := []struct { - name string - cluster *AWSCluster - wantErr bool - }{ - // The SSHKeyName tests were moved to sshkeyname_test.go - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - cluster := tt.cluster.DeepCopy() - cluster.ObjectMeta = metav1.ObjectMeta{ - GenerateName: "cluster-", - Namespace: "default", - } - ctx := context.TODO() - if err := testEnv.Create(ctx, cluster); (err != nil) != tt.wantErr { - t.Errorf("ValidateCreate() error = %v, wantErr %v", err, tt.wantErr) - } - }) - } -} - -func TestAWSCluster_ValidateUpdate(t *testing.T) { - tests := []struct { - name string - oldCluster *AWSCluster - newCluster *AWSCluster - wantErr bool - }{ - { - name: "region is immutable", - oldCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - Region: "us-east-1", - }, - }, - newCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - Region: "us-east-2", - }, - }, - wantErr: true, - }, - { - name: "controlPlaneLoadBalancer scheme is immutable", - oldCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - ControlPlaneLoadBalancer: &AWSLoadBalancerSpec{ - Scheme: &ClassicELBSchemeInternal, - }, - }, - }, - newCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - ControlPlaneLoadBalancer: &AWSLoadBalancerSpec{ - Scheme: &ClassicELBSchemeInternetFacing, - }, - }, - }, - wantErr: true, - }, - { - name: "controlPlaneLoadBalancer crossZoneLoadBalancer is mutable", - oldCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - ControlPlaneLoadBalancer: &AWSLoadBalancerSpec{ - CrossZoneLoadBalancing: false, - }, - }, - }, - newCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - ControlPlaneLoadBalancer: &AWSLoadBalancerSpec{ - CrossZoneLoadBalancing: true, - }, - }, - }, - wantErr: false, - }, - { - name: "controlPlaneEndpoint is immutable", - oldCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - ControlPlaneEndpoint: clusterv1.APIEndpoint{ - Host: "example.com", - Port: int32(8000), - }, - }, - }, - newCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - ControlPlaneEndpoint: clusterv1.APIEndpoint{ - Host: "foo.example.com", - Port: int32(9000), - }, - }, - }, - wantErr: true, - }, - { - name: "controlPlaneEndpoint can be updated if it is empty", - oldCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - ControlPlaneEndpoint: clusterv1.APIEndpoint{}, - }, - }, - newCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - ControlPlaneEndpoint: clusterv1.APIEndpoint{ - Host: "example.com", - Port: int32(8000), - }, - }, - }, - wantErr: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ctx := context.TODO() - cluster := tt.oldCluster.DeepCopy() - cluster.ObjectMeta = metav1.ObjectMeta{ - GenerateName: "cluster-", - Namespace: "default", - } - if err := testEnv.Create(ctx, cluster); err != nil { - t.Errorf("failed to create cluster: %v", err) - } - cluster.Spec = tt.newCluster.Spec - if err := testEnv.Update(ctx, cluster); (err != nil) != tt.wantErr { - t.Errorf("ValidateUpdate() error = %v, wantErr %v", err, tt.wantErr) - } - }, - ) - } -} - -func TestAWSCluster_DefaultCNIIngressRules(t *testing.T) { - AZUsageLimit := 3 - defaultVPCSpec := VPCSpec{ - AvailabilityZoneUsageLimit: &AZUsageLimit, - AvailabilityZoneSelection: &AZSelectionSchemeOrdered, - } - g := NewWithT(t) - tests := []struct { - name string - beforeCluster *AWSCluster - afterCluster *AWSCluster - }{ - { - name: "CNI ingressRules are updated cni spec undefined", - beforeCluster: &AWSCluster{ - Spec: AWSClusterSpec{}, - }, - afterCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - NetworkSpec: NetworkSpec{ - VPC: defaultVPCSpec, - CNI: &CNISpec{ - CNIIngressRules: CNIIngressRules{ - { - Description: "bgp (calico)", - Protocol: SecurityGroupProtocolTCP, - FromPort: 179, - ToPort: 179, - }, - { - Description: "IP-in-IP (calico)", - Protocol: SecurityGroupProtocolIPinIP, - FromPort: -1, - ToPort: 65535, - }, - }, - }, - }, - }, - }, - }, - { - name: "CNIIngressRules are not added for empty CNISpec", - beforeCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - NetworkSpec: NetworkSpec{ - VPC: defaultVPCSpec, - CNI: &CNISpec{}, - }, - }, - }, - afterCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - NetworkSpec: NetworkSpec{ - VPC: defaultVPCSpec, - CNI: &CNISpec{}, - }, - }, - }, - }, - { - name: "CNI ingressRules are unmodified when they exist", - beforeCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - NetworkSpec: NetworkSpec{ - VPC: defaultVPCSpec, - CNI: &CNISpec{ - CNIIngressRules: CNIIngressRules{ - { - Description: "Antrea 1", - Protocol: SecurityGroupProtocolTCP, - FromPort: 10349, - ToPort: 10349, - }, - }, - }, - }, - }, - }, - afterCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - NetworkSpec: NetworkSpec{ - VPC: defaultVPCSpec, - CNI: &CNISpec{ - CNIIngressRules: CNIIngressRules{ - { - Description: "Antrea 1", - Protocol: SecurityGroupProtocolTCP, - FromPort: 10349, - ToPort: 10349, - }, - }, - }, - }, - }, - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ctx := context.TODO() - cluster := tt.beforeCluster.DeepCopy() - cluster.ObjectMeta = metav1.ObjectMeta{ - GenerateName: "cluster-", - Namespace: "default", - } - g.Expect(testEnv.Create(ctx, cluster)).To(Succeed()) - g.Expect(cluster.Spec.NetworkSpec).To(Equal(tt.afterCluster.Spec.NetworkSpec)) - }) - } -} - -func TestAWSCluster_ValidateAllowedCIDRBlocks(t *testing.T) { - tests := []struct { - name string - awsc *AWSCluster - wantErr bool - }{ - { - name: "allow valid CIDRs", - awsc: &AWSCluster{ - Spec: AWSClusterSpec{ - Bastion: Bastion{ - AllowedCIDRBlocks: []string{ - "192.168.0.0/16", - "192.168.0.1/32", - }, - }, - }, - }, - wantErr: false, - }, - { - name: "disableIngressRules allowed with empty CIDR block", - awsc: &AWSCluster{ - Spec: AWSClusterSpec{ - Bastion: Bastion{ - AllowedCIDRBlocks: []string{}, - DisableIngressRules: true, - }, - }, - }, - wantErr: false, - }, - { - name: "disableIngressRules not allowed with CIDR blocks", - awsc: &AWSCluster{ - Spec: AWSClusterSpec{ - Bastion: Bastion{ - AllowedCIDRBlocks: []string{ - "192.168.0.0/16", - "192.168.0.1/32", - }, - DisableIngressRules: true, - }, - }, - }, - wantErr: true, - }, - { - name: "invalid CIDR block with invalid network", - awsc: &AWSCluster{ - Spec: AWSClusterSpec{ - Bastion: Bastion{ - AllowedCIDRBlocks: []string{ - "100.200.300.400/99", - }, - }, - }, - }, - wantErr: true, - }, - { - name: "invalid CIDR block with garbage string", - awsc: &AWSCluster{ - Spec: AWSClusterSpec{ - Bastion: Bastion{ - AllowedCIDRBlocks: []string{ - "abcdefg", - }, - }, - }, - }, - wantErr: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ctx := context.TODO() - cluster := tt.awsc.DeepCopy() - cluster.ObjectMeta = metav1.ObjectMeta{ - GenerateName: "cluster-", - Namespace: "default", - } - if err := testEnv.Create(ctx, cluster); (err != nil) != tt.wantErr { - t.Errorf("ValidateAllowedCIDRBlocks() error = %v, wantErr %v", err, tt.wantErr) - } - }) - } -} - -func TestAWSCluster_DefaultAllowedCIDRBlocks(t *testing.T) { - g := NewWithT(t) - tests := []struct { - name string - beforeCluster *AWSCluster - afterCluster *AWSCluster - }{ - { - name: "empty AllowedCIDRBlocks is defaulted to allow open ingress to bastion host", - beforeCluster: &AWSCluster{ - Spec: AWSClusterSpec{}, - }, - afterCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - Bastion: Bastion{ - AllowedCIDRBlocks: []string{ - "0.0.0.0/0", - }, - }, - }, - }, - }, - { - name: "empty AllowedCIDRBlocks is kept if DisableIngressRules is true", - beforeCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - Bastion: Bastion{ - AllowedCIDRBlocks: []string{}, - DisableIngressRules: true, - Enabled: true, - }, - }, - }, - afterCluster: &AWSCluster{ - Spec: AWSClusterSpec{ - Bastion: Bastion{ - AllowedCIDRBlocks: []string{}, - DisableIngressRules: true, - Enabled: true, - }, - }, - }, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ctx := context.TODO() - cluster := tt.beforeCluster.DeepCopy() - cluster.ObjectMeta = metav1.ObjectMeta{ - GenerateName: "cluster-", - Namespace: "default", - } - g.Expect(testEnv.Create(ctx, cluster)).To(Succeed()) - g.Expect(cluster.Spec.Bastion).To(Equal(tt.afterCluster.Spec.Bastion)) - }) - } -} diff --git a/api/v1alpha3/awsclustercontrolleridentity_webhook.go b/api/v1alpha3/awsclustercontrolleridentity_webhook.go deleted file mode 100644 index 3e4988eaf7..0000000000 --- a/api/v1alpha3/awsclustercontrolleridentity_webhook.go +++ /dev/null @@ -1,81 +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 ( - "fmt" - "reflect" - - "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -// log is for logging in this package. -var _ = logf.Log.WithName("awsclustercontrolleridentity-resource") - -func (r *AWSClusterControllerIdentity) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha3-awsclustercontrolleridentity,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclustercontrolleridentities,versions=v1alpha3,name=validation.awsclustercontrolleridentity.infrastructure.cluster.x-k8s.io,sideEffects=None -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha3-awsclustercontrolleridentity,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclustercontrolleridentities,versions=v1alpha3,name=default.awsclustercontrolleridentity.infrastructure.cluster.x-k8s.io,sideEffects=None - -var ( - _ webhook.Validator = &AWSClusterControllerIdentity{} - _ webhook.Defaulter = &AWSClusterControllerIdentity{} -) - -func (r *AWSClusterControllerIdentity) ValidateCreate() error { - // Ensures AWSClusterControllerIdentity being singleton by only allowing "default" as name - if r.Name != AWSClusterControllerIdentityName { - return field.Invalid(field.NewPath("name"), - r.Name, "AWSClusterControllerIdentity is a singleton and only acceptable name is default") - } - - return nil -} - -func (r *AWSClusterControllerIdentity) ValidateDelete() error { - return nil -} - -func (r *AWSClusterControllerIdentity) ValidateUpdate(old runtime.Object) error { - oldP, ok := old.(*AWSClusterControllerIdentity) - if !ok { - return apierrors.NewBadRequest(fmt.Sprintf("expected an AWSClusterControllerIdentity but got a %T", old)) - } - - if !reflect.DeepEqual(r.Spec, oldP.Spec) { - return errors.New("AWSClusterControllerIdentity is immutable") - } - - if r.Name != oldP.Name { - return field.Invalid(field.NewPath("name"), - r.Name, "AWSClusterControllerIdentity is a singleton and only acceptable name is default") - } - return nil -} - -func (r *AWSClusterControllerIdentity) Default() { -} diff --git a/api/v1alpha3/awsclustercontrolleridentity_webhook_test.go b/api/v1alpha3/awsclustercontrolleridentity_webhook_test.go deleted file mode 100644 index 5a8bd2ad00..0000000000 --- a/api/v1alpha3/awsclustercontrolleridentity_webhook_test.go +++ /dev/null @@ -1,132 +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 ( - "context" - "testing" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func TestAWSClusterControllerValidateCreate(t *testing.T) { - tests := []struct { - name string - identity *AWSClusterControllerIdentity - wantError bool - }{ - { - name: "only allow AWSClusterControllerIdentity creation with name default", - identity: &AWSClusterControllerIdentity{ - ObjectMeta: metav1.ObjectMeta{ - Name: "default", - }, - }, - wantError: false, - }, - { - name: "do not allow AWSClusterControllerIdentity creation with name other than default", - identity: &AWSClusterControllerIdentity{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - }, - wantError: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - identity := tt.identity.DeepCopy() - identity.TypeMeta = metav1.TypeMeta{ - APIVersion: GroupVersion.String(), - Kind: "AWSClusterControllerIdentity", - } - ctx := context.TODO() - if err := testEnv.Create(ctx, identity); (err != nil) != tt.wantError { - t.Errorf("ValidateCreate() error = %v, wantErr %v", err, tt.wantError) - } - testEnv.Delete(ctx, identity) - }) - } -} - -func TestAWSClusterControllerValidateUpdate(t *testing.T) { - controllerIdentity := &AWSClusterControllerIdentity{ - TypeMeta: metav1.TypeMeta{ - APIVersion: GroupVersion.String(), - Kind: "AWSClusterControllerIdentity", - }, - ObjectMeta: metav1.ObjectMeta{ - Name: AWSClusterControllerIdentityName, - }, - Spec: AWSClusterControllerIdentitySpec{ - AWSClusterIdentitySpec: AWSClusterIdentitySpec{ - AllowedNamespaces: &AllowedNamespaces{}, - }, - }, - } - - ctx := context.TODO() - defer testEnv.Delete(ctx, controllerIdentity) - - if err := testEnv.Create(ctx, controllerIdentity); err != nil { - t.Errorf("controllerIdentity creation failed %v", err) - } - - tests := []struct { - name string - identity *AWSClusterControllerIdentity - wantError bool - }{ - { - name: "do not allow any spec changes", - identity: &AWSClusterControllerIdentity{ - ObjectMeta: metav1.ObjectMeta{ - Name: "default", - }, - }, - wantError: true, - }, - { - name: "do not allow name change", - identity: &AWSClusterControllerIdentity{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - }, - wantError: true, - }, - { - name: "no error when updating with same object", - identity: controllerIdentity, - wantError: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - identity := tt.identity.DeepCopy() - identity.TypeMeta = metav1.TypeMeta{ - APIVersion: GroupVersion.String(), - Kind: "AWSClusterControllerIdentity", - } - ctx := context.TODO() - if err := testEnv.Update(ctx, identity); (err != nil) != tt.wantError { - t.Errorf("ValidateUpdate() error = %v, wantErr %v", err, tt.wantError) - } - }) - } -} diff --git a/api/v1alpha3/awsclustercontrolleridentitylist_webhook.go b/api/v1alpha3/awsclustercontrolleridentitylist_webhook.go deleted file mode 100644 index b6d866e0ca..0000000000 --- a/api/v1alpha3/awsclustercontrolleridentitylist_webhook.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" -) - -// log is for logging in this package. -var _ = logf.Log.WithName("awsclustercontrolleridentitylist-resource") - -func (r *AWSClusterControllerIdentityList) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} diff --git a/api/v1alpha3/awsclusterlist_webhook.go b/api/v1alpha3/awsclusterlist_webhook.go deleted file mode 100644 index fd87b7e91d..0000000000 --- a/api/v1alpha3/awsclusterlist_webhook.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" -) - -// log is for logging in this package. -var _ = logf.Log.WithName("awsclusterlist-resource") - -func (r *AWSClusterList) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} diff --git a/api/v1alpha3/awsclusterroleidentity_webhook.go b/api/v1alpha3/awsclusterroleidentity_webhook.go deleted file mode 100644 index ec5c93db04..0000000000 --- a/api/v1alpha3/awsclusterroleidentity_webhook.go +++ /dev/null @@ -1,75 +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 ( - "fmt" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -// log is for logging in this package. -var _ = logf.Log.WithName("awsclusterroleidentity-resource") - -func (r *AWSClusterRoleIdentity) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha3-awsclusterroleidentity,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusterroleidentities,versions=v1alpha3,name=validation.awsclusterroleidentity.infrastructure.cluster.x-k8s.io,sideEffects=None -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha3-awsclusterroleidentity,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsclusterroleidentities,versions=v1alpha3,name=default.awsclusterroleidentity.infrastructure.cluster.x-k8s.io,sideEffects=None - -var ( - _ webhook.Validator = &AWSClusterRoleIdentity{} - _ webhook.Defaulter = &AWSClusterRoleIdentity{} -) - -func (r *AWSClusterRoleIdentity) ValidateCreate() error { - if r.Spec.SourceIdentityRef == nil { - return field.Invalid(field.NewPath("spec", "sourceIdentityRef"), - r.Spec.SourceIdentityRef, "field cannot be set to nil") - } - return nil -} - -func (r *AWSClusterRoleIdentity) ValidateDelete() error { - return nil -} - -func (r *AWSClusterRoleIdentity) ValidateUpdate(old runtime.Object) error { - oldP, ok := old.(*AWSClusterRoleIdentity) - if !ok { - return apierrors.NewBadRequest(fmt.Sprintf("expected an AWSClusterRoleIdentity but got a %T", old)) - } - - // If a SourceIdentityRef is set, do not allow removal of it. - if oldP.Spec.SourceIdentityRef != nil && r.Spec.SourceIdentityRef == nil { - return field.Invalid(field.NewPath("spec", "sourceIdentityRef"), - r.Spec.SourceIdentityRef, "field cannot be set to nil") - } - - return nil -} - -func (r *AWSClusterRoleIdentity) Default() { -} diff --git a/api/v1alpha3/awsclusterroleidentity_webhook_test.go b/api/v1alpha3/awsclusterroleidentity_webhook_test.go deleted file mode 100644 index f0f06fd9ac..0000000000 --- a/api/v1alpha3/awsclusterroleidentity_webhook_test.go +++ /dev/null @@ -1,101 +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 ( - "context" - "testing" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -func TestAWSClusterRoleValidateCreate(t *testing.T) { - tests := []struct { - name string - identity *AWSClusterRoleIdentity - wantError bool - }{ - { - name: "do not allow nil sourceIdentityRef", - identity: &AWSClusterRoleIdentity{ - ObjectMeta: metav1.ObjectMeta{ - Name: "test", - }, - }, - wantError: true, - }, - { - name: "successfully create AWSClusterRoleIdentity", - identity: &AWSClusterRoleIdentity{ - ObjectMeta: metav1.ObjectMeta{ - Name: "role", - }, - Spec: AWSClusterRoleIdentitySpec{ - SourceIdentityRef: &AWSIdentityReference{ - Name: "another-role", - Kind: ClusterRoleIdentityKind, - }, - }, - }, - wantError: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - identity := tt.identity.DeepCopy() - identity.TypeMeta = metav1.TypeMeta{ - APIVersion: GroupVersion.String(), - Kind: "AWSClusterRoleIdentity", - } - ctx := context.TODO() - if err := testEnv.Create(ctx, identity); (err != nil) != tt.wantError { - t.Errorf("ValidateCreate() error = %v, wantErr %v", err, tt.wantError) - } - testEnv.Delete(ctx, identity) - }) - } -} - -func TestAWSClusterRoleValidateUpdate(t *testing.T) { - roleIdentity := &AWSClusterRoleIdentity{ - TypeMeta: metav1.TypeMeta{ - APIVersion: GroupVersion.String(), - Kind: string(ClusterRoleIdentityKind), - }, - ObjectMeta: metav1.ObjectMeta{ - Name: "role", - }, - Spec: AWSClusterRoleIdentitySpec{ - SourceIdentityRef: &AWSIdentityReference{ - Name: "another-role", - Kind: ClusterRoleIdentityKind, - }, - }, - } - - ctx := context.TODO() - defer testEnv.Delete(ctx, roleIdentity) - - if err := testEnv.Create(ctx, roleIdentity); err != nil { - t.Errorf("roleIdentity creation failed %v", err) - } - - roleIdentity.Spec = AWSClusterRoleIdentitySpec{} - if err := testEnv.Update(ctx, roleIdentity); err == nil { - t.Errorf("roleIdentity is updated with nil sourceIdentityRef %v", err) - } -} diff --git a/api/v1alpha3/awsclusterroleidentitylist_webhook.go b/api/v1alpha3/awsclusterroleidentitylist_webhook.go deleted file mode 100644 index 634a22cd3f..0000000000 --- a/api/v1alpha3/awsclusterroleidentitylist_webhook.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" -) - -// log is for logging in this package. -var _ = logf.Log.WithName("awsclusterroleidentitylist-resource") - -func (r *AWSClusterRoleIdentityList) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} diff --git a/api/v1alpha3/awsidentity_types.go b/api/v1alpha3/awsidentity_types.go index f6bcb55556..5f78abe27d 100644 --- a/api/v1alpha3/awsidentity_types.go +++ b/api/v1alpha3/awsidentity_types.go @@ -71,7 +71,6 @@ type AWSRoleSpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsclusterstaticidentities,scope=Cluster,categories=cluster-api -// +kubebuilder:storageversion // 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. @@ -104,7 +103,6 @@ type AWSClusterStaticIdentitySpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsclusterroleidentities,scope=Cluster,categories=cluster-api -// +kubebuilder:storageversion // AWSClusterRoleIdentity is the Schema for the awsclusterroleidentities API // It is used to assume a role using the provided sourceRef. @@ -147,7 +145,6 @@ type AWSClusterRoleIdentitySpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsclustercontrolleridentities,scope=Cluster,categories=cluster-api -// +kubebuilder:storageversion // 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/v1alpha3/awsmachine_conversion.go b/api/v1alpha3/awsmachine_conversion.go deleted file mode 100644 index 02155988c0..0000000000 --- a/api/v1alpha3/awsmachine_conversion.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -// Hub marks AWSMachine as a conversion hub. -func (*AWSMachine) Hub() {} - -// Hub marks AWSMachineList as a conversion hub. -func (*AWSMachineList) Hub() {} diff --git a/api/v1alpha3/awsmachine_types.go b/api/v1alpha3/awsmachine_types.go index f0ae4e82c2..63f12ce8e4 100644 --- a/api/v1alpha3/awsmachine_types.go +++ b/api/v1alpha3/awsmachine_types.go @@ -239,7 +239,6 @@ type AWSMachineStatus struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsmachines,scope=Namespaced,categories=cluster-api -// +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" diff --git a/api/v1alpha3/awsmachine_webhook.go b/api/v1alpha3/awsmachine_webhook.go deleted file mode 100644 index 6f50bcba44..0000000000 --- a/api/v1alpha3/awsmachine_webhook.go +++ /dev/null @@ -1,205 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - "reflect" - - "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -// log is for logging in this package. -var _ = logf.Log.WithName("awsmachine-resource") - -func (r *AWSMachine) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha3-awsmachine,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmachines,versions=v1alpha3,name=validation.awsmachine.infrastructure.cluster.x-k8s.io,sideEffects=None -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha3-awsmachine,mutating=true,failurePolicy=fail,groups=infrastructure.cluster.x-k8s.io,resources=awsmachines,versions=v1alpha3,name=mawsmachine.kb.io,name=mutation.awsmachine.infrastructure.cluster.x-k8s.io,sideEffects=None - -var ( - _ webhook.Validator = &AWSMachine{} - _ webhook.Defaulter = &AWSMachine{} -) - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type -func (r *AWSMachine) ValidateCreate() error { - var allErrs field.ErrorList - - allErrs = append(allErrs, r.validateCloudInitSecret()...) - allErrs = append(allErrs, r.validateRootVolume()...) - allErrs = append(allErrs, r.validateNonRootVolumes()...) - allErrs = append(allErrs, r.validateSSHKeyName()...) - allErrs = append(allErrs, r.validateAdditionalSecurityGroups()...) - - return aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type -func (r *AWSMachine) ValidateUpdate(old runtime.Object) error { - newAWSMachine, err := runtime.DefaultUnstructuredConverter.ToUnstructured(r) - if err != nil { - return apierrors.NewInvalid(GroupVersion.WithKind("AWSMachine").GroupKind(), r.Name, field.ErrorList{ - field.InternalError(nil, errors.Wrap(err, "failed to convert new AWSMachine to unstructured object")), - }) - } - oldAWSMachine, err := runtime.DefaultUnstructuredConverter.ToUnstructured(old) - if err != nil { - return apierrors.NewInvalid(GroupVersion.WithKind("AWSMachine").GroupKind(), r.Name, field.ErrorList{ - field.InternalError(nil, errors.Wrap(err, "failed to convert old AWSMachine to unstructured object")), - }) - } - - var allErrs field.ErrorList - - allErrs = append(allErrs, r.validateCloudInitSecret()...) - - newAWSMachineSpec := newAWSMachine["spec"].(map[string]interface{}) - oldAWSMachineSpec := oldAWSMachine["spec"].(map[string]interface{}) - - // allow changes to providerID - delete(oldAWSMachineSpec, "providerID") - delete(newAWSMachineSpec, "providerID") - - // allow changes to instanceID - delete(oldAWSMachineSpec, "instanceID") - delete(newAWSMachineSpec, "instanceID") - - // allow changes to additionalTags - delete(oldAWSMachineSpec, "additionalTags") - delete(newAWSMachineSpec, "additionalTags") - - // allow changes to additionalSecurityGroups - delete(oldAWSMachineSpec, "additionalSecurityGroups") - delete(newAWSMachineSpec, "additionalSecurityGroups") - - // allow changes to secretPrefix, secretCount, and secureSecretsBackend - if cloudInit, ok := oldAWSMachineSpec["cloudInit"].(map[string]interface{}); ok { - delete(cloudInit, "secretPrefix") - delete(cloudInit, "secretCount") - delete(cloudInit, "secureSecretsBackend") - } - - if cloudInit, ok := newAWSMachineSpec["cloudInit"].(map[string]interface{}); ok { - delete(cloudInit, "secretPrefix") - delete(cloudInit, "secretCount") - delete(cloudInit, "secureSecretsBackend") - } - - if !reflect.DeepEqual(oldAWSMachineSpec, newAWSMachineSpec) { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec"), "cannot be modified")) - } - - return aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -func (r *AWSMachine) validateCloudInitSecret() field.ErrorList { - var allErrs field.ErrorList - - if r.Spec.CloudInit.InsecureSkipSecretsManager { - if r.Spec.CloudInit.SecretPrefix != "" { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "cloudInit", "secretPrefix"), "cannot be set if spec.cloudInit.insecureSkipSecretsManager is true")) - } - if r.Spec.CloudInit.SecretCount != 0 { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "cloudInit", "secretCount"), "cannot be set if spec.cloudInit.insecureSkipSecretsManager is true")) - } - if r.Spec.CloudInit.SecureSecretsBackend != "" { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "cloudInit", "secureSecretsBackend"), "cannot be set if spec.cloudInit.insecureSkipSecretsManager is true")) - } - } - - if (r.Spec.CloudInit.SecretPrefix != "") != (r.Spec.CloudInit.SecretCount != 0) { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "cloudInit", "secretCount"), "must be set together with spec.CloudInit.SecretPrefix")) - } - - return allErrs -} - -func (r *AWSMachine) validateRootVolume() field.ErrorList { - var allErrs field.ErrorList - - if r.Spec.RootVolume == nil { - return allErrs - } - - if (r.Spec.RootVolume.Type == "io1" || r.Spec.RootVolume.Type == "io2") && r.Spec.RootVolume.IOPS == 0 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.rootVolumeOptions.iops"), "iops required if type is 'io1' or 'io2'")) - } - - if r.Spec.RootVolume.DeviceName != "" { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.rootVolumeOptions.deviceName"), "root volume shouldn't have device name")) - } - - return allErrs -} - -func (r *AWSMachine) validateNonRootVolumes() field.ErrorList { - var allErrs field.ErrorList - - if r.Spec.NonRootVolumes == nil { - return allErrs - } - - for _, volume := range r.Spec.NonRootVolumes { - if (volume.Type == "io1" || volume.Type == "io2") && volume.IOPS == 0 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.nonRootVolumes.volumeOptions.iops"), "iops required if type is 'io1' or 'io2'")) - } - - if volume.DeviceName == "" { - allErrs = append(allErrs, field.Required(field.NewPath("spec.nonRootVolumes.volumeOptions.deviceName"), "non root volume should have device name")) - } - } - - return allErrs -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type -func (r *AWSMachine) ValidateDelete() error { - return nil -} - -// Default implements webhook.Defaulter such that an empty CloudInit will be defined with a default -// SecureSecretsBackend as SecretBackendSecretsManager iff InsecureSkipSecretsManager is unset -func (r *AWSMachine) Default() { - if !r.Spec.CloudInit.InsecureSkipSecretsManager && r.Spec.CloudInit.SecureSecretsBackend == "" { - r.Spec.CloudInit.SecureSecretsBackend = SecretBackendSecretsManager - } -} - -func (r *AWSMachine) validateAdditionalSecurityGroups() field.ErrorList { - var allErrs field.ErrorList - - for _, additionalSecurityGroup := range r.Spec.AdditionalSecurityGroups { - if len(additionalSecurityGroup.Filters) > 0 && additionalSecurityGroup.ID != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec.additionalSecurityGroups"), "only one of ID or Filters may be specified, specifying both is forbidden")) - } - } - return allErrs -} - -func (r *AWSMachine) validateSSHKeyName() field.ErrorList { - return validateSSHKeyName(r.Spec.SSHKeyName) -} diff --git a/api/v1alpha3/awsmachine_webhook_test.go b/api/v1alpha3/awsmachine_webhook_test.go deleted file mode 100644 index 5d9ff3a6fd..0000000000 --- a/api/v1alpha3/awsmachine_webhook_test.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - "context" - "testing" - - "github.com/aws/aws-sdk-go/aws" - . "github.com/onsi/gomega" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/pointer" -) - -func TestAWSMachine_Create(t *testing.T) { - tests := []struct { - name string - machine *AWSMachine - wantErr bool - }{ - { - name: "ensure IOPS exists if type equal to io1", - machine: &AWSMachine{ - Spec: AWSMachineSpec{ - RootVolume: &Volume{ - Type: "io1", - }, - }, - }, - wantErr: true, - }, - { - name: "ensure IOPS exists if type equal to io2", - machine: &AWSMachine{ - Spec: AWSMachineSpec{ - RootVolume: &Volume{ - Type: "io2", - }, - }, - }, - wantErr: true, - }, - { - name: "ensure root volume has no device name", - machine: &AWSMachine{ - Spec: AWSMachineSpec{ - RootVolume: &Volume{ - DeviceName: "name", - }, - }, - }, - wantErr: true, - }, - { - name: "ensure non root volume have device names", - machine: &AWSMachine{ - Spec: AWSMachineSpec{ - NonRootVolumes: []*Volume{ - {}, - }, - }, - }, - wantErr: true, - }, - { - name: "ensure ensure IOPS exists if type equal to io1 for non root volumes", - machine: &AWSMachine{ - Spec: AWSMachineSpec{ - NonRootVolumes: []*Volume{ - { - DeviceName: "name", - Type: "io1", - }, - }, - }, - }, - wantErr: true, - }, - { - name: "ensure ensure IOPS exists if type equal to io2 for non root volumes", - machine: &AWSMachine{ - Spec: AWSMachineSpec{ - NonRootVolumes: []*Volume{ - { - DeviceName: "name", - Type: "io2", - }, - }, - }, - }, - wantErr: true, - }, - { - name: "additional security groups may have id", - machine: &AWSMachine{ - Spec: AWSMachineSpec{ - AdditionalSecurityGroups: []AWSResourceReference{ - { - ID: aws.String("id"), - }, - }, - }, - }, - wantErr: false, - }, - { - name: "additional security groups may have filters", - machine: &AWSMachine{ - Spec: AWSMachineSpec{ - AdditionalSecurityGroups: []AWSResourceReference{ - { - Filters: []Filter{ - { - Name: "example-name", - Values: []string{"example-value"}, - }, - }, - }, - }, - }, - }, - wantErr: false, - }, - { - name: "additional security groups can't have both id and filters", - machine: &AWSMachine{ - Spec: AWSMachineSpec{ - AdditionalSecurityGroups: []AWSResourceReference{ - { - ID: aws.String("id"), - Filters: []Filter{ - { - Name: "example-name", - Values: []string{"example-value"}, - }, - }, - }, - }, - }, - }, - wantErr: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - machine := tt.machine.DeepCopy() - machine.ObjectMeta = metav1.ObjectMeta{ - GenerateName: "machine-", - Namespace: "default", - } - ctx := context.TODO() - if err := testEnv.Create(ctx, machine); (err != nil) != tt.wantErr { - t.Errorf("ValidateCreate() error = %v, wantErr %v", err, tt.wantErr) - } - testEnv.Delete(ctx, machine) - }) - } -} - -func TestAWSMachine_Update(t *testing.T) { - tests := []struct { - name string - oldMachine *AWSMachine - newMachine *AWSMachine - wantErr bool - }{ - { - name: "change in providerid, cloudinit, tags and securitygroups", - oldMachine: &AWSMachine{ - Spec: AWSMachineSpec{ - ProviderID: nil, - AdditionalTags: nil, - AdditionalSecurityGroups: nil, - }, - }, - newMachine: &AWSMachine{ - Spec: AWSMachineSpec{ - ProviderID: pointer.StringPtr("ID"), - AdditionalTags: Tags{ - "key-1": "value-1", - }, - AdditionalSecurityGroups: []AWSResourceReference{ - { - ID: pointer.StringPtr("ID"), - }, - }, - CloudInit: CloudInit{ - SecretPrefix: "test", - SecretCount: 5, - }, - }, - }, - wantErr: false, - }, - { - name: "change in fields other than providerid, tags and securitygroups", - oldMachine: &AWSMachine{ - Spec: AWSMachineSpec{ - ProviderID: nil, - AdditionalTags: nil, - AdditionalSecurityGroups: nil, - }, - }, - newMachine: &AWSMachine{ - Spec: AWSMachineSpec{ - ImageLookupOrg: "test", - InstanceType: "test", - ProviderID: pointer.StringPtr("ID"), - AdditionalTags: Tags{ - "key-1": "value-1", - }, - AdditionalSecurityGroups: []AWSResourceReference{ - { - ID: pointer.StringPtr("ID"), - }, - }, - }, - }, - wantErr: true, - }, - } - for _, tt := range tests { - ctx := context.TODO() - t.Run(tt.name, func(t *testing.T) { - machine := tt.oldMachine.DeepCopy() - machine.ObjectMeta = metav1.ObjectMeta{ - GenerateName: "machine-", - Namespace: "default", - } - if err := testEnv.Create(ctx, machine); err != nil { - t.Errorf("failed to create machine: %v", err) - } - machine.Spec = tt.newMachine.Spec - if err := testEnv.Update(ctx, machine); (err != nil) != tt.wantErr { - t.Errorf("ValidateUpdate() error = %v, wantErr %v", err, tt.wantErr) - } - }) - } -} - -func TestAWSMachine_SecretsBackend(t *testing.T) { - baseMachine := &AWSMachine{ - Spec: AWSMachineSpec{ - ProviderID: nil, - AdditionalTags: nil, - AdditionalSecurityGroups: nil, - }, - } - - tests := []struct { - name string - cloudInit CloudInit - expectedSecretsBackend string - }{ - { - name: "with insecure skip secrets manager unset", - cloudInit: CloudInit{InsecureSkipSecretsManager: false}, - expectedSecretsBackend: "secrets-manager", - }, - { - name: "with insecure skip secrets manager unset and secrets backend set", - cloudInit: CloudInit{InsecureSkipSecretsManager: false, SecureSecretsBackend: "ssm-parameter-store"}, - expectedSecretsBackend: "ssm-parameter-store", - }, - { - name: "with insecure skip secrets manager set", - cloudInit: CloudInit{InsecureSkipSecretsManager: true}, - expectedSecretsBackend: "", - }, - } - - for _, tt := range tests { - ctx := context.TODO() - t.Run(tt.name, func(t *testing.T) { - machine := baseMachine.DeepCopy() - machine.ObjectMeta = metav1.ObjectMeta{ - GenerateName: "machine-", - Namespace: "default", - } - machine.Spec.CloudInit = tt.cloudInit - if err := testEnv.Create(ctx, machine); err != nil { - t.Errorf("failed to create machine: %v", err) - } - g := NewWithT(t) - g.Expect(machine.Spec.CloudInit.SecureSecretsBackend).To(Equal(SecretBackend(tt.expectedSecretsBackend))) - }) - } -} diff --git a/api/v1alpha3/awsmachinelist_webhook.go b/api/v1alpha3/awsmachinelist_webhook.go deleted file mode 100644 index 9ca2967dc3..0000000000 --- a/api/v1alpha3/awsmachinelist_webhook.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" -) - -// log is for logging in this package. -var _ = logf.Log.WithName("awsmachinelist-resource") - -func (r *AWSMachineList) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} diff --git a/api/v1alpha3/awsmachinetemplate_conversion.go b/api/v1alpha3/awsmachinetemplate_conversion.go deleted file mode 100644 index 9c05e84dc7..0000000000 --- a/api/v1alpha3/awsmachinetemplate_conversion.go +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -// Hub marks AWSMachineTemplate as a conversion hub. -func (*AWSMachineTemplate) Hub() {} - -// Hub marks AWSMachineTemplateList as a conversion hub. -func (*AWSMachineTemplateList) Hub() {} diff --git a/api/v1alpha3/awsmachinetemplate_types.go b/api/v1alpha3/awsmachinetemplate_types.go index 4cce33ceda..a6b39772ed 100644 --- a/api/v1alpha3/awsmachinetemplate_types.go +++ b/api/v1alpha3/awsmachinetemplate_types.go @@ -27,7 +27,6 @@ type AWSMachineTemplateSpec struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsmachinetemplates,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion // AWSMachineTemplate is the Schema for the awsmachinetemplates API type AWSMachineTemplate struct { diff --git a/api/v1alpha3/awsmachinetemplate_webhook.go b/api/v1alpha3/awsmachinetemplate_webhook.go deleted file mode 100644 index 70a49678c3..0000000000 --- a/api/v1alpha3/awsmachinetemplate_webhook.go +++ /dev/null @@ -1,81 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - "reflect" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -func (r *AWSMachineTemplate) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha3-awsmachinetemplate,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmachinetemplates,versions=v1alpha3,name=validation.awsmachinetemplate.infrastructure.x-k8s.io,sideEffects=None - -var ( - _ webhook.Validator = &AWSMachineTemplate{} -) - -// ValidateCreate implements webhook.Validator so a webhook will be registered for the type -func (r *AWSMachineTemplate) ValidateCreate() error { - var allErrs field.ErrorList - spec := r.Spec.Template.Spec - - if spec.CloudInit.SecretPrefix != "" { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "template", "spec", "cloudInit", "secretPrefix"), "cannot be set in templates")) - } - - if spec.CloudInit.SecretCount != 0 { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "cloudInit", "secretCount"), "cannot be set in templates")) - } - - if spec.ProviderID != nil { - allErrs = append(allErrs, field.Forbidden(field.NewPath("spec", "template", "spec", "providerID"), "cannot be set in templates")) - } - - return aggregateObjErrors(r.GroupVersionKind().GroupKind(), r.Name, allErrs) -} - -// ValidateUpdate implements webhook.Validator so a webhook will be registered for the type -func (r *AWSMachineTemplate) ValidateUpdate(old runtime.Object) error { - oldAWSMachineTemplate := old.(*AWSMachineTemplate) - - // Allow setting of cloudInit.secureSecretsBackend to "secrets-manager" only to handle v1alpha3 upgrade - if oldAWSMachineTemplate.Spec.Template.Spec.CloudInit.SecureSecretsBackend == "" && r.Spec.Template.Spec.CloudInit.SecureSecretsBackend == SecretBackendSecretsManager { - r.Spec.Template.Spec.CloudInit.SecureSecretsBackend = "" - } - - if !reflect.DeepEqual(r.Spec, oldAWSMachineTemplate.Spec) { - - return apierrors.NewBadRequest("AWSMachineTemplate.Spec is immutable") - } - - return nil -} - -// ValidateDelete implements webhook.Validator so a webhook will be registered for the type -func (r *AWSMachineTemplate) ValidateDelete() error { - return nil -} diff --git a/api/v1alpha3/awsmachinetemplate_webhook_test.go b/api/v1alpha3/awsmachinetemplate_webhook_test.go deleted file mode 100644 index 44ae6f2dfc..0000000000 --- a/api/v1alpha3/awsmachinetemplate_webhook_test.go +++ /dev/null @@ -1,146 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - "context" - "testing" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/pointer" -) - -func TestAWSMachineTemplateValidateCreate(t *testing.T) { - tests := []struct { - name string - inputTemplate *AWSMachineTemplate - wantError bool - }{ - { - name: "don't allow providerID", - inputTemplate: &AWSMachineTemplate{ - ObjectMeta: metav1.ObjectMeta{}, - Spec: AWSMachineTemplateSpec{ - Template: AWSMachineTemplateResource{ - Spec: AWSMachineSpec{ - ProviderID: pointer.StringPtr("something"), - }, - }, - }, - }, - wantError: true, - }, - { - name: "don't allow secretARN", - inputTemplate: &AWSMachineTemplate{ - ObjectMeta: metav1.ObjectMeta{}, - Spec: AWSMachineTemplateSpec{ - Template: AWSMachineTemplateResource{ - Spec: AWSMachineSpec{ - CloudInit: CloudInit{ - SecretPrefix: "something", - }, - }, - }, - }, - }, - wantError: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - template := tt.inputTemplate.DeepCopy() - template.ObjectMeta = metav1.ObjectMeta{ - GenerateName: "template-", - Namespace: "default", - } - ctx := context.TODO() - if err := testEnv.Create(ctx, template); (err != nil) != tt.wantError { - t.Errorf("ValidateCreate() error = %v, wantErr %v", err, tt.wantError) - } - }) - } -} - -func TestAWSMachineTemplateValidateUpdate(t *testing.T) { - tests := []struct { - name string - modifiedTemplate *AWSMachineTemplate - wantError bool - }{ - { - name: "don't allow ssm parameter store", - modifiedTemplate: &AWSMachineTemplate{ - ObjectMeta: metav1.ObjectMeta{}, - Spec: AWSMachineTemplateSpec{ - Template: AWSMachineTemplateResource{ - Spec: AWSMachineSpec{ - CloudInit: CloudInit{ - SecureSecretsBackend: SecretBackendSSMParameterStore, - }, - }, - }, - }, - }, - wantError: true, - }, - { - name: "allow secrets manager", - modifiedTemplate: &AWSMachineTemplate{ - ObjectMeta: metav1.ObjectMeta{}, - Spec: AWSMachineTemplateSpec{ - Template: AWSMachineTemplateResource{ - Spec: AWSMachineSpec{ - CloudInit: CloudInit{ - SecureSecretsBackend: SecretBackendSecretsManager, - }, - }, - }, - }, - }, - wantError: false, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - - ctx := context.TODO() - template := &AWSMachineTemplate{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "template-", - Namespace: "default", - }, - Spec: AWSMachineTemplateSpec{ - Template: AWSMachineTemplateResource{ - Spec: AWSMachineSpec{ - CloudInit: CloudInit{}, - }, - }, - }, - } - - if err := testEnv.Create(ctx, template); err != nil { - t.Errorf("failed to create template: %v", err) - } - template.Spec = tt.modifiedTemplate.Spec - if err := testEnv.Update(ctx, template); (err != nil) != tt.wantError { - t.Errorf("ValidateUpdate() error = %v, wantErr %v", err, tt.wantError) - } - }, - ) - } -} diff --git a/api/v1alpha3/awsmachinetemplatelist_webhook.go b/api/v1alpha3/awsmachinetemplatelist_webhook.go deleted file mode 100644 index 58ea78639c..0000000000 --- a/api/v1alpha3/awsmachinetemplatelist_webhook.go +++ /dev/null @@ -1,31 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" -) - -// log is for logging in this package. -var _ = logf.Log.WithName("awsmachinetemplatelist-resource") - -func (r *AWSMachineTemplateList) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} diff --git a/api/v1alpha3/conversion.go b/api/v1alpha3/conversion.go new file mode 100644 index 0000000000..a114cd4b64 --- /dev/null +++ b/api/v1alpha3/conversion.go @@ -0,0 +1,179 @@ +/* +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" + "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" + "sigs.k8s.io/controller-runtime/pkg/conversion" +) + +func (r *AWSCluster) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSCluster) + + return Convert_v1alpha3_AWSCluster_To_v1alpha4_AWSCluster(r, dst, nil) +} + +func (r *AWSCluster) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSCluster) + + return Convert_v1alpha4_AWSCluster_To_v1alpha3_AWSCluster(src, r, nil) +} + +func (r *AWSClusterList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSClusterList) + + return Convert_v1alpha3_AWSClusterList_To_v1alpha4_AWSClusterList(r, dst, nil) +} + +func (r *AWSClusterList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSClusterList) + + return Convert_v1alpha4_AWSClusterList_To_v1alpha3_AWSClusterList(src, r, nil) +} + +func (r *AWSMachine) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSMachine) + + return Convert_v1alpha3_AWSMachine_To_v1alpha4_AWSMachine(r, dst, nil) +} + +func (r *AWSMachine) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSMachine) + + return Convert_v1alpha4_AWSMachine_To_v1alpha3_AWSMachine(src, r, nil) +} + +func (r *AWSMachineList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSMachineList) + + return Convert_v1alpha3_AWSMachineList_To_v1alpha4_AWSMachineList(r, dst, nil) +} + +func (r *AWSMachineList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSMachineList) + + return Convert_v1alpha4_AWSMachineList_To_v1alpha3_AWSMachineList(src, r, nil) +} + +func (r *AWSMachineTemplate) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSMachineTemplate) + + return Convert_v1alpha3_AWSMachineTemplate_To_v1alpha4_AWSMachineTemplate(r, dst, nil) +} + +func (r *AWSMachineTemplate) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSMachineTemplate) + + return Convert_v1alpha4_AWSMachineTemplate_To_v1alpha3_AWSMachineTemplate(src, r, nil) +} + +func (r *AWSMachineTemplateList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSMachineTemplateList) + + return Convert_v1alpha3_AWSMachineTemplateList_To_v1alpha4_AWSMachineTemplateList(r, dst, nil) +} + +func (r *AWSMachineTemplateList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSMachineTemplateList) + + return Convert_v1alpha4_AWSMachineTemplateList_To_v1alpha3_AWSMachineTemplateList(src, r, nil) +} + +func (r *AWSClusterStaticIdentity) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSClusterStaticIdentity) + + return Convert_v1alpha3_AWSClusterStaticIdentity_To_v1alpha4_AWSClusterStaticIdentity(r, dst, nil) +} + +func (r *AWSClusterStaticIdentity) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSClusterStaticIdentity) + + return Convert_v1alpha4_AWSClusterStaticIdentity_To_v1alpha3_AWSClusterStaticIdentity(src, r, nil) +} + +func (r *AWSClusterStaticIdentityList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSClusterStaticIdentityList) + + return Convert_v1alpha3_AWSClusterStaticIdentityList_To_v1alpha4_AWSClusterStaticIdentityList(r, dst, nil) +} + +func (r *AWSClusterStaticIdentityList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSClusterStaticIdentityList) + + return Convert_v1alpha4_AWSClusterStaticIdentityList_To_v1alpha3_AWSClusterStaticIdentityList(src, r, nil) +} + +func (r *AWSClusterRoleIdentity) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSClusterRoleIdentity) + + return Convert_v1alpha3_AWSClusterRoleIdentity_To_v1alpha4_AWSClusterRoleIdentity(r, dst, nil) +} + +func (r *AWSClusterRoleIdentity) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSClusterRoleIdentity) + + return Convert_v1alpha4_AWSClusterRoleIdentity_To_v1alpha3_AWSClusterRoleIdentity(src, r, nil) +} + +func (r *AWSClusterRoleIdentityList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSClusterRoleIdentityList) + + return Convert_v1alpha3_AWSClusterRoleIdentityList_To_v1alpha4_AWSClusterRoleIdentityList(r, dst, nil) +} + +func (r *AWSClusterRoleIdentityList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSClusterRoleIdentityList) + + return Convert_v1alpha4_AWSClusterRoleIdentityList_To_v1alpha3_AWSClusterRoleIdentityList(src, r, nil) +} + +func (r *AWSClusterControllerIdentity) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSClusterControllerIdentity) + + return Convert_v1alpha3_AWSClusterControllerIdentity_To_v1alpha4_AWSClusterControllerIdentity(r, dst, nil) +} + +func (r *AWSClusterControllerIdentity) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSClusterControllerIdentity) + + return Convert_v1alpha4_AWSClusterControllerIdentity_To_v1alpha3_AWSClusterControllerIdentity(src, r, nil) +} + +func (r *AWSClusterControllerIdentityList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSClusterControllerIdentityList) + + return Convert_v1alpha3_AWSClusterControllerIdentityList_To_v1alpha4_AWSClusterControllerIdentityList(r, dst, nil) +} + +func (r *AWSClusterControllerIdentityList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSClusterControllerIdentityList) + + return Convert_v1alpha4_AWSClusterControllerIdentityList_To_v1alpha3_AWSClusterControllerIdentityList(src, r, nil) +} + +// Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint is an autogenerated conversion function. +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 is an autogenerated conversion function. +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) +} diff --git a/api/v1alpha3/conversion_test.go b/api/v1alpha3/conversion_test.go new file mode 100644 index 0000000000..0410eadef7 --- /dev/null +++ b/api/v1alpha3/conversion_test.go @@ -0,0 +1,70 @@ +/* +Copyright 2020 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha3 + +import ( + "testing" + + . "github.com/onsi/gomega" + + runtime "k8s.io/apimachinery/pkg/runtime" + v1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + 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(v1alpha4.AddToScheme(scheme)).To(Succeed()) + + t.Run("for AWSCluster", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1alpha4.AWSCluster{}, + Spoke: &AWSCluster{}, + })) + + t.Run("for AWSMachine", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1alpha4.AWSMachine{}, + Spoke: &AWSMachine{}, + })) + + t.Run("for AWSMachineTemplate", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1alpha4.AWSMachineTemplate{}, + Spoke: &AWSMachineTemplate{}, + })) + + t.Run("for AWSClusterStaticIdentity", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1alpha4.AWSClusterStaticIdentity{}, + Spoke: &AWSClusterStaticIdentity{}, + })) + + t.Run("for AWSClusterControllerIdentity", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1alpha4.AWSClusterControllerIdentity{}, + Spoke: &AWSClusterControllerIdentity{}, + })) + + t.Run("for AWSClusterRoleIdentity", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1alpha4.AWSClusterRoleIdentity{}, + Spoke: &AWSClusterRoleIdentity{}, + })) +} diff --git a/api/v1alpha3/doc.go b/api/v1alpha3/doc.go index bb7756bbca..4a1d8dcebc 100644 --- a/api/v1alpha3/doc.go +++ b/api/v1alpha3/doc.go @@ -14,6 +14,5 @@ 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/api/v1alpha4 package v1alpha3 diff --git a/api/v1alpha3/groupversion_info.go b/api/v1alpha3/groupversion_info.go index b6614ac163..5a60237421 100644 --- a/api/v1alpha3/groupversion_info.go +++ b/api/v1alpha3/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/v1alpha3/sshkeyname_test.go b/api/v1alpha3/sshkeyname_test.go deleted file mode 100644 index 5c75824f30..0000000000 --- a/api/v1alpha3/sshkeyname_test.go +++ /dev/null @@ -1,94 +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 ( - "context" - "testing" - - "github.com/aws/aws-sdk-go/aws" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" -) - -func Test_SSHKeyName(t *testing.T) { - tests := []struct { - name string - sshKeyName *string - wantErr bool - }{ - { - name: "SSH key name is nil is valid", - sshKeyName: nil, - wantErr: false, - }, - { - name: "SSH key name is an empty string is valid", - sshKeyName: aws.String(""), - wantErr: false, - }, - { - name: "SSH key name with alphanumeric characters is valid", - sshKeyName: aws.String("test123"), - wantErr: false, - }, - { - name: "SSH key name with underscore is valid", - sshKeyName: aws.String("test_key"), - wantErr: false, - }, - { - name: "SSH key name with dash is valid", - sshKeyName: aws.String(`test-key`), - wantErr: false, - }, - { - name: "SSH key name with tab is not valid", - sshKeyName: aws.String("test-capi\t"), - wantErr: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - cluster := &AWSCluster{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "cluster-", - Namespace: "default", - }, - Spec: AWSClusterSpec{ - SSHKeyName: tt.sshKeyName, - }, - } - machine := &AWSMachine{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "machine-", - Namespace: "default", - }, - Spec: AWSMachineSpec{ - SSHKeyName: tt.sshKeyName, - }, - } - for _, obj := range []runtime.Object{cluster, machine} { - ctx := context.TODO() - if err := testEnv.Create(ctx, obj); (err != nil) != tt.wantErr { - t.Errorf("ValidateCreate() error = %v, wantErr %v", err, tt.wantErr) - } - } - }) - } -} diff --git a/api/v1alpha3/suite_test.go b/api/v1alpha3/suite_test.go deleted file mode 100644 index 7e23144f5e..0000000000 --- a/api/v1alpha3/suite_test.go +++ /dev/null @@ -1,99 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - "fmt" - "math/rand" - "os" - "path" - "strconv" - "testing" - - . "github.com/onsi/ginkgo" - . "github.com/onsi/gomega" - - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/client-go/kubernetes/scheme" - "sigs.k8s.io/cluster-api-provider-aws/test/helpers" - "sigs.k8s.io/controller-runtime/pkg/envtest/printer" -) - -var testEnv *helpers.TestEnvironment - -func TestAPIs(t *testing.T) { - RegisterFailHandler(Fail) - - RunSpecsWithDefaultAndCustomReporters(t, - "Controller Suite", - []Reporter{printer.NewlineReporter{}}) -} - -func TestMain(m *testing.M) { - setup() - code := m.Run() - teardown() - os.Exit(code) -} - -func setup() { - utilruntime.Must(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 := (&AWSCluster{}).SetupWebhookWithManager(testEnv); err != nil { - panic(fmt.Sprintf("Unable to setup AWSCluster webhook: %v", err)) - } - if err := (&AWSMachine{}).SetupWebhookWithManager(testEnv); err != nil { - panic(fmt.Sprintf("Unable to setup AWSMachine webhook: %v", err)) - } - if err := (&AWSMachineTemplate{}).SetupWebhookWithManager(testEnv); err != nil { - panic(fmt.Sprintf("Unable to setup AWSMachineTemplate webhook: %v", err)) - } - if err := (&AWSMachineList{}).SetupWebhookWithManager(testEnv); err != nil { - panic(fmt.Sprintf("Unable to setup AWSMachineList webhook: %v", err)) - } - if err := (&AWSClusterControllerIdentity{}).SetupWebhookWithManager(testEnv); err != nil { - panic(fmt.Sprintf("Unable to setup AWSClusterControllerIdentity webhook: %v", err)) - } - if err := (&AWSClusterRoleIdentity{}).SetupWebhookWithManager(testEnv); err != nil { - panic(fmt.Sprintf("Unable to setup AWSClusterRoleIdentity webhook: %v", err)) - } - go func() { - fmt.Println("Starting the manager") - if err := testEnv.StartManager(); 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)) - } -} - -func randomName() string { - return strconv.FormatInt(rand.Int63(), 10) -} diff --git a/api/v1alpha3/tags_test.go b/api/v1alpha3/tags_test.go deleted file mode 100644 index b8be55a2dc..0000000000 --- a/api/v1alpha3/tags_test.go +++ /dev/null @@ -1,163 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -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/v1alpha3/validate.go b/api/v1alpha3/validate.go index 7ccdee91af..17866ee569 100644 --- a/api/v1alpha3/validate.go +++ b/api/v1alpha3/validate.go @@ -19,15 +19,10 @@ package v1alpha3 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/v1alpha3/webhooks.go b/api/v1alpha3/webhooks.go deleted file mode 100644 index 306dccb947..0000000000 --- a/api/v1alpha3/webhooks.go +++ /dev/null @@ -1,35 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/validation/field" -) - -func aggregateObjErrors(gk schema.GroupKind, name string, allErrs field.ErrorList) error { - if len(allErrs) == 0 { - return nil - } - - return apierrors.NewInvalid( - gk, - name, - allErrs, - ) -} diff --git a/api/v1alpha3/zz_generated.conversion.go b/api/v1alpha3/zz_generated.conversion.go new file mode 100644 index 0000000000..348f101f64 --- /dev/null +++ b/api/v1alpha3/zz_generated.conversion.go @@ -0,0 +1,1875 @@ +// +build !ignore_autogenerated_core_v1alpha3 + +/* +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 v1alpha3 + +import ( + time "time" + unsafe "unsafe" + + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" + v1alpha4 "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" + 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((*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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*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) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*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.AddGeneratedConversionFunc((*Network)(nil), (*v1alpha4.Network)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Network_To_v1alpha4_Network(a.(*Network), b.(*v1alpha4.Network), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha4.Network)(nil), (*Network)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Network_To_v1alpha3_Network(a.(*v1alpha4.Network), b.(*Network), 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*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) + }); 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) + }); 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 + } + return nil +} + +func autoConvert_v1alpha3_AWSCluster_To_v1alpha4_AWSCluster(in *AWSCluster, out *v1alpha4.AWSCluster, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_AWSClusterSpec_To_v1alpha4_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 { + 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) +} + +func autoConvert_v1alpha4_AWSCluster_To_v1alpha3_AWSCluster(in *v1alpha4.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 { + return err + } + if err := Convert_v1alpha4_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) +} + +func autoConvert_v1alpha3_AWSClusterControllerIdentity_To_v1alpha4_AWSClusterControllerIdentity(in *AWSClusterControllerIdentity, out *v1alpha4.AWSClusterControllerIdentity, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_AWSClusterControllerIdentitySpec_To_v1alpha4_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) +} + +func autoConvert_v1alpha4_AWSClusterControllerIdentity_To_v1alpha3_AWSClusterControllerIdentity(in *v1alpha4.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 { + 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) +} + +func autoConvert_v1alpha3_AWSClusterControllerIdentityList_To_v1alpha4_AWSClusterControllerIdentityList(in *AWSClusterControllerIdentityList, out *v1alpha4.AWSClusterControllerIdentityList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha4.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) +} + +func autoConvert_v1alpha4_AWSClusterControllerIdentityList_To_v1alpha3_AWSClusterControllerIdentityList(in *v1alpha4.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) +} + +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 { + 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) +} + +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 { + 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) +} + +func autoConvert_v1alpha3_AWSClusterIdentitySpec_To_v1alpha4_AWSClusterIdentitySpec(in *AWSClusterIdentitySpec, out *v1alpha4.AWSClusterIdentitySpec, s conversion.Scope) error { + out.AllowedNamespaces = (*v1alpha4.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) +} + +func autoConvert_v1alpha4_AWSClusterIdentitySpec_To_v1alpha3_AWSClusterIdentitySpec(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_AWSClusterList_To_v1alpha4_AWSClusterList(in *AWSClusterList, out *v1alpha4.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)) + for i := range *in { + if err := Convert_v1alpha3_AWSCluster_To_v1alpha4_AWSCluster(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + 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) +} + +func autoConvert_v1alpha4_AWSClusterList_To_v1alpha3_AWSClusterList(in *v1alpha4.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 { + return err + } + } + } else { + out.Items = nil + } + 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) +} + +func autoConvert_v1alpha3_AWSClusterRoleIdentity_To_v1alpha4_AWSClusterRoleIdentity(in *AWSClusterRoleIdentity, out *v1alpha4.AWSClusterRoleIdentity, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_AWSClusterRoleIdentitySpec_To_v1alpha4_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) +} + +func autoConvert_v1alpha4_AWSClusterRoleIdentity_To_v1alpha3_AWSClusterRoleIdentity(in *v1alpha4.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 { + 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) +} + +func autoConvert_v1alpha3_AWSClusterRoleIdentityList_To_v1alpha4_AWSClusterRoleIdentityList(in *AWSClusterRoleIdentityList, out *v1alpha4.AWSClusterRoleIdentityList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha4.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) +} + +func autoConvert_v1alpha4_AWSClusterRoleIdentityList_To_v1alpha3_AWSClusterRoleIdentityList(in *v1alpha4.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) +} + +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 { + return err + } + if err := Convert_v1alpha3_AWSRoleSpec_To_v1alpha4_AWSRoleSpec(&in.AWSRoleSpec, &out.AWSRoleSpec, s); err != nil { + return err + } + out.ExternalID = in.ExternalID + out.SourceIdentityRef = (*v1alpha4.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) +} + +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 { + return err + } + if err := Convert_v1alpha4_AWSRoleSpec_To_v1alpha3_AWSRoleSpec(&in.AWSRoleSpec, &out.AWSRoleSpec, s); err != nil { + return err + } + out.ExternalID = in.ExternalID + out.SourceIdentityRef = (*AWSIdentityReference)(unsafe.Pointer(in.SourceIdentityRef)) + 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) +} + +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 { + 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 { + return err + } + out.AdditionalTags = *(*v1alpha4.Tags)(unsafe.Pointer(&in.AdditionalTags)) + out.ControlPlaneLoadBalancer = (*v1alpha4.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 { + return err + } + out.IdentityRef = (*v1alpha4.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) +} + +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 { + 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 { + 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_v1alpha4_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) +} + +func autoConvert_v1alpha3_AWSClusterStaticIdentity_To_v1alpha4_AWSClusterStaticIdentity(in *AWSClusterStaticIdentity, out *v1alpha4.AWSClusterStaticIdentity, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_AWSClusterStaticIdentitySpec_To_v1alpha4_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) +} + +func autoConvert_v1alpha4_AWSClusterStaticIdentity_To_v1alpha3_AWSClusterStaticIdentity(in *v1alpha4.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 { + 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) +} + +func autoConvert_v1alpha3_AWSClusterStaticIdentityList_To_v1alpha4_AWSClusterStaticIdentityList(in *AWSClusterStaticIdentityList, out *v1alpha4.AWSClusterStaticIdentityList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha4.AWSClusterStaticIdentity)(unsafe.Pointer(&in.Items)) + 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) +} + +func autoConvert_v1alpha4_AWSClusterStaticIdentityList_To_v1alpha3_AWSClusterStaticIdentityList(in *v1alpha4.AWSClusterStaticIdentityList, out *AWSClusterStaticIdentityList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]AWSClusterStaticIdentity)(unsafe.Pointer(&in.Items)) + 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) +} + +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 { + return err + } + out.SecretRef = in.SecretRef + return nil +} + +// Convert_v1alpha3_AWSClusterStaticIdentitySpec_To_v1alpha4_AWSClusterStaticIdentitySpec is an autogenerated conversion function. +func Convert_v1alpha3_AWSClusterStaticIdentitySpec_To_v1alpha4_AWSClusterStaticIdentitySpec(in *AWSClusterStaticIdentitySpec, out *v1alpha4.AWSClusterStaticIdentitySpec, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSClusterStaticIdentitySpec_To_v1alpha4_AWSClusterStaticIdentitySpec(in, out, s) +} + +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 { + return err + } + out.SecretRef = in.SecretRef + return nil +} + +// Convert_v1alpha4_AWSClusterStaticIdentitySpec_To_v1alpha3_AWSClusterStaticIdentitySpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSClusterStaticIdentitySpec_To_v1alpha3_AWSClusterStaticIdentitySpec(in *v1alpha4.AWSClusterStaticIdentitySpec, out *AWSClusterStaticIdentitySpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSClusterStaticIdentitySpec_To_v1alpha3_AWSClusterStaticIdentitySpec(in, out, s) +} + +func autoConvert_v1alpha3_AWSClusterStatus_To_v1alpha4_AWSClusterStatus(in *AWSClusterStatus, out *v1alpha4.AWSClusterStatus, s conversion.Scope) error { + out.Ready = in.Ready + if err := Convert_v1alpha3_Network_To_v1alpha4_Network(&in.Network, &out.Network, s); err != nil { + return err + } + out.FailureDomains = *(*apiv1alpha4.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) + out.Bastion = (*v1alpha4.Instance)(unsafe.Pointer(in.Bastion)) + out.Conditions = *(*apiv1alpha4.Conditions)(unsafe.Pointer(&in.Conditions)) + 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) +} + +func autoConvert_v1alpha4_AWSClusterStatus_To_v1alpha3_AWSClusterStatus(in *v1alpha4.AWSClusterStatus, out *AWSClusterStatus, s conversion.Scope) error { + out.Ready = in.Ready + if err := Convert_v1alpha4_Network_To_v1alpha3_Network(&in.Network, &out.Network, s); err != nil { + return err + } + out.FailureDomains = *(*apiv1alpha3.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) + out.Bastion = (*Instance)(unsafe.Pointer(in.Bastion)) + out.Conditions = *(*apiv1alpha3.Conditions)(unsafe.Pointer(&in.Conditions)) + 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) +} + +func autoConvert_v1alpha3_AWSIdentityReference_To_v1alpha4_AWSIdentityReference(in *AWSIdentityReference, out *v1alpha4.AWSIdentityReference, s conversion.Scope) error { + out.Name = in.Name + out.Kind = v1alpha4.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) +} + +func autoConvert_v1alpha4_AWSIdentityReference_To_v1alpha3_AWSIdentityReference(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_AWSLoadBalancerSpec_To_v1alpha4_AWSLoadBalancerSpec(in *AWSLoadBalancerSpec, out *v1alpha4.AWSLoadBalancerSpec, s conversion.Scope) error { + out.Scheme = (*v1alpha4.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) +} + +func autoConvert_v1alpha4_AWSLoadBalancerSpec_To_v1alpha3_AWSLoadBalancerSpec(in *v1alpha4.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_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) +} + +func autoConvert_v1alpha3_AWSMachine_To_v1alpha4_AWSMachine(in *AWSMachine, out *v1alpha4.AWSMachine, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_AWSMachineSpec_To_v1alpha4_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 { + 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) +} + +func autoConvert_v1alpha4_AWSMachine_To_v1alpha3_AWSMachine(in *v1alpha4.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 { + return err + } + if err := Convert_v1alpha4_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) +} + +func autoConvert_v1alpha3_AWSMachineList_To_v1alpha4_AWSMachineList(in *AWSMachineList, out *v1alpha4.AWSMachineList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha4.AWSMachine)(unsafe.Pointer(&in.Items)) + 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) +} + +func autoConvert_v1alpha4_AWSMachineList_To_v1alpha3_AWSMachineList(in *v1alpha4.AWSMachineList, out *AWSMachineList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]AWSMachine)(unsafe.Pointer(&in.Items)) + 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) +} + +func autoConvert_v1alpha3_AWSMachineSpec_To_v1alpha4_AWSMachineSpec(in *AWSMachineSpec, out *v1alpha4.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_AWSResourceReference(&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.IAMInstanceProfile = in.IAMInstanceProfile + out.PublicIP = (*bool)(unsafe.Pointer(in.PublicIP)) + out.AdditionalSecurityGroups = *(*[]v1alpha4.AWSResourceReference)(unsafe.Pointer(&in.AdditionalSecurityGroups)) + out.FailureDomain = (*string)(unsafe.Pointer(in.FailureDomain)) + out.Subnet = (*v1alpha4.AWSResourceReference)(unsafe.Pointer(in.Subnet)) + out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) + out.RootVolume = (*v1alpha4.Volume)(unsafe.Pointer(in.RootVolume)) + out.NonRootVolumes = *(*[]*v1alpha4.Volume)(unsafe.Pointer(&in.NonRootVolumes)) + 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 { + return err + } + out.SpotMarketOptions = (*v1alpha4.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) +} + +func autoConvert_v1alpha4_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(in *v1alpha4.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_AWSResourceReference_To_v1alpha3_AWSResourceReference(&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_v1alpha4_CloudInit_To_v1alpha3_CloudInit(&in.CloudInit, &out.CloudInit, s); err != nil { + return err + } + out.SpotMarketOptions = (*SpotMarketOptions)(unsafe.Pointer(in.SpotMarketOptions)) + out.Tenancy = in.Tenancy + return nil +} + +// Convert_v1alpha4_AWSMachineSpec_To_v1alpha3_AWSMachineSpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(in *v1alpha4.AWSMachineSpec, out *AWSMachineSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSMachineSpec_To_v1alpha3_AWSMachineSpec(in, out, s) +} + +func autoConvert_v1alpha3_AWSMachineStatus_To_v1alpha4_AWSMachineStatus(in *AWSMachineStatus, out *v1alpha4.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)) + out.FailureReason = (*errors.MachineStatusError)(unsafe.Pointer(in.FailureReason)) + out.FailureMessage = (*string)(unsafe.Pointer(in.FailureMessage)) + out.Conditions = *(*apiv1alpha4.Conditions)(unsafe.Pointer(&in.Conditions)) + 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) +} + +func autoConvert_v1alpha4_AWSMachineStatus_To_v1alpha3_AWSMachineStatus(in *v1alpha4.AWSMachineStatus, out *AWSMachineStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.Interruptible = in.Interruptible + out.Addresses = *(*[]apiv1alpha3.MachineAddress)(unsafe.Pointer(&in.Addresses)) + 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)) + 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) +} + +func autoConvert_v1alpha3_AWSMachineTemplate_To_v1alpha4_AWSMachineTemplate(in *AWSMachineTemplate, out *v1alpha4.AWSMachineTemplate, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_AWSMachineTemplateSpec_To_v1alpha4_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) +} + +func autoConvert_v1alpha4_AWSMachineTemplate_To_v1alpha3_AWSMachineTemplate(in *v1alpha4.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 { + 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) +} + +func autoConvert_v1alpha3_AWSMachineTemplateList_To_v1alpha4_AWSMachineTemplateList(in *AWSMachineTemplateList, out *v1alpha4.AWSMachineTemplateList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha4.AWSMachineTemplate)(unsafe.Pointer(&in.Items)) + 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) +} + +func autoConvert_v1alpha4_AWSMachineTemplateList_To_v1alpha3_AWSMachineTemplateList(in *v1alpha4.AWSMachineTemplateList, out *AWSMachineTemplateList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]AWSMachineTemplate)(unsafe.Pointer(&in.Items)) + 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) +} + +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 { + 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) +} + +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 { + 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 { + 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) +} + +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 { + 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) +} + +func autoConvert_v1alpha3_AWSResourceReference_To_v1alpha4_AWSResourceReference(in *AWSResourceReference, out *v1alpha4.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)) + 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) +} + +func autoConvert_v1alpha4_AWSResourceReference_To_v1alpha3_AWSResourceReference(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_AWSRoleSpec_To_v1alpha4_AWSRoleSpec(in *AWSRoleSpec, out *v1alpha4.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_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) +} + +func autoConvert_v1alpha4_AWSRoleSpec_To_v1alpha3_AWSRoleSpec(in *v1alpha4.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_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) +} + +func autoConvert_v1alpha3_AllowedNamespaces_To_v1alpha4_AllowedNamespaces(in *AllowedNamespaces, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_AllowedNamespaces_To_v1alpha3_AllowedNamespaces(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_Bastion_To_v1alpha4_Bastion(in *Bastion, out *v1alpha4.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_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) +} + +func autoConvert_v1alpha4_Bastion_To_v1alpha3_Bastion(in *v1alpha4.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_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) +} + +func autoConvert_v1alpha3_BuildParams_To_v1alpha4_BuildParams(in *BuildParams, out *v1alpha4.BuildParams, s conversion.Scope) error { + out.Lifecycle = v1alpha4.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)) + 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) +} + +func autoConvert_v1alpha4_BuildParams_To_v1alpha3_BuildParams(in *v1alpha4.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_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) +} + +func autoConvert_v1alpha3_CNIIngressRule_To_v1alpha4_CNIIngressRule(in *CNIIngressRule, out *v1alpha4.CNIIngressRule, s conversion.Scope) error { + out.Description = in.Description + out.Protocol = v1alpha4.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) +} + +func autoConvert_v1alpha4_CNIIngressRule_To_v1alpha3_CNIIngressRule(in *v1alpha4.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_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) +} + +func autoConvert_v1alpha3_CNISpec_To_v1alpha4_CNISpec(in *CNISpec, out *v1alpha4.CNISpec, s conversion.Scope) error { + out.CNIIngressRules = *(*v1alpha4.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) +} + +func autoConvert_v1alpha4_CNISpec_To_v1alpha3_CNISpec(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_ClassicELB_To_v1alpha4_ClassicELB(in *ClassicELB, out *v1alpha4.ClassicELB, s conversion.Scope) error { + out.Name = in.Name + out.DNSName = in.DNSName + out.Scheme = v1alpha4.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 { + 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) +} + +func autoConvert_v1alpha4_ClassicELB_To_v1alpha3_ClassicELB(in *v1alpha4.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_v1alpha4_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) +} + +func autoConvert_v1alpha3_ClassicELBAttributes_To_v1alpha4_ClassicELBAttributes(in *ClassicELBAttributes, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_ClassicELBAttributes_To_v1alpha3_ClassicELBAttributes(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_ClassicELBHealthCheck_To_v1alpha4_ClassicELBHealthCheck(in *ClassicELBHealthCheck, out *v1alpha4.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_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) +} + +func autoConvert_v1alpha4_ClassicELBHealthCheck_To_v1alpha3_ClassicELBHealthCheck(in *v1alpha4.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_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) +} + +func autoConvert_v1alpha3_ClassicELBListener_To_v1alpha4_ClassicELBListener(in *ClassicELBListener, out *v1alpha4.ClassicELBListener, s conversion.Scope) error { + out.Protocol = v1alpha4.ClassicELBProtocol(in.Protocol) + out.Port = in.Port + out.InstanceProtocol = v1alpha4.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) +} + +func autoConvert_v1alpha4_ClassicELBListener_To_v1alpha3_ClassicELBListener(in *v1alpha4.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_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) +} + +func autoConvert_v1alpha3_CloudInit_To_v1alpha4_CloudInit(in *CloudInit, out *v1alpha4.CloudInit, s conversion.Scope) error { + out.InsecureSkipSecretsManager = in.InsecureSkipSecretsManager + out.SecretCount = in.SecretCount + out.SecretPrefix = in.SecretPrefix + out.SecureSecretsBackend = v1alpha4.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) +} + +func autoConvert_v1alpha4_CloudInit_To_v1alpha3_CloudInit(in *v1alpha4.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_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) +} + +func autoConvert_v1alpha3_Filter_To_v1alpha4_Filter(in *Filter, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_Filter_To_v1alpha3_Filter(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_IngressRule_To_v1alpha4_IngressRule(in *IngressRule, out *v1alpha4.IngressRule, s conversion.Scope) error { + out.Description = in.Description + out.Protocol = v1alpha4.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_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) +} + +func autoConvert_v1alpha4_IngressRule_To_v1alpha3_IngressRule(in *v1alpha4.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_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) +} + +func autoConvert_v1alpha3_Instance_To_v1alpha4_Instance(in *Instance, out *v1alpha4.Instance, s conversion.Scope) error { + out.ID = in.ID + out.State = v1alpha4.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 + out.Addresses = *(*[]apiv1alpha4.MachineAddress)(unsafe.Pointer(&in.Addresses)) + 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 = (*v1alpha4.Volume)(unsafe.Pointer(in.RootVolume)) + out.NonRootVolumes = *(*[]*v1alpha4.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 = (*v1alpha4.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) +} + +func autoConvert_v1alpha4_Instance_To_v1alpha3_Instance(in *v1alpha4.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 + out.Addresses = *(*[]apiv1alpha3.MachineAddress)(unsafe.Pointer(&in.Addresses)) + 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 + return nil +} + +// Convert_v1alpha4_Instance_To_v1alpha3_Instance is an autogenerated conversion function. +func Convert_v1alpha4_Instance_To_v1alpha3_Instance(in *v1alpha4.Instance, out *Instance, s conversion.Scope) error { + return autoConvert_v1alpha4_Instance_To_v1alpha3_Instance(in, out, s) +} + +func autoConvert_v1alpha3_Network_To_v1alpha4_Network(in *Network, out *v1alpha4.Network, s conversion.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_v1alpha3_Network_To_v1alpha4_Network is an autogenerated conversion function. +func Convert_v1alpha3_Network_To_v1alpha4_Network(in *Network, out *v1alpha4.Network, s conversion.Scope) error { + return autoConvert_v1alpha3_Network_To_v1alpha4_Network(in, out, s) +} + +func autoConvert_v1alpha4_Network_To_v1alpha3_Network(in *v1alpha4.Network, out *Network, s conversion.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 +} + +// Convert_v1alpha4_Network_To_v1alpha3_Network is an autogenerated conversion function. +func Convert_v1alpha4_Network_To_v1alpha3_Network(in *v1alpha4.Network, out *Network, s conversion.Scope) error { + return autoConvert_v1alpha4_Network_To_v1alpha3_Network(in, out, s) +} + +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 { + 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)) + 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) +} + +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 { + 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_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) +} + +func autoConvert_v1alpha3_RouteTable_To_v1alpha4_RouteTable(in *RouteTable, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_RouteTable_To_v1alpha3_RouteTable(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_SecurityGroup_To_v1alpha4_SecurityGroup(in *SecurityGroup, out *v1alpha4.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)) + 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) +} + +func autoConvert_v1alpha4_SecurityGroup_To_v1alpha3_SecurityGroup(in *v1alpha4.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_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) +} + +func autoConvert_v1alpha3_SpotMarketOptions_To_v1alpha4_SpotMarketOptions(in *SpotMarketOptions, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_SpotMarketOptions_To_v1alpha3_SpotMarketOptions(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_SubnetSpec_To_v1alpha4_SubnetSpec(in *SubnetSpec, out *v1alpha4.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)) + 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) +} + +func autoConvert_v1alpha4_SubnetSpec_To_v1alpha3_SubnetSpec(in *v1alpha4.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_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) +} + +func autoConvert_v1alpha3_VPCSpec_To_v1alpha4_VPCSpec(in *VPCSpec, out *v1alpha4.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.AvailabilityZoneUsageLimit = (*int)(unsafe.Pointer(in.AvailabilityZoneUsageLimit)) + out.AvailabilityZoneSelection = (*v1alpha4.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) +} + +func autoConvert_v1alpha4_VPCSpec_To_v1alpha3_VPCSpec(in *v1alpha4.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_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) +} + +func autoConvert_v1alpha3_Volume_To_v1alpha4_Volume(in *Volume, out *v1alpha4.Volume, s conversion.Scope) error { + out.DeviceName = in.DeviceName + out.Size = in.Size + out.Type = in.Type + out.IOPS = in.IOPS + out.Encrypted = in.Encrypted + out.EncryptionKey = in.EncryptionKey + 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) +} + +func autoConvert_v1alpha4_Volume_To_v1alpha3_Volume(in *v1alpha4.Volume, out *Volume, s conversion.Scope) error { + out.DeviceName = in.DeviceName + out.Size = in.Size + out.Type = in.Type + out.IOPS = in.IOPS + out.Encrypted = in.Encrypted + out.EncryptionKey = in.EncryptionKey + return nil +} + +// Convert_v1alpha4_Volume_To_v1alpha3_Volume is an autogenerated conversion function. +func Convert_v1alpha4_Volume_To_v1alpha3_Volume(in *v1alpha4.Volume, out *Volume, s conversion.Scope) error { + return autoConvert_v1alpha4_Volume_To_v1alpha3_Volume(in, out, s) +} diff --git a/bootstrap/eks/PROJECT b/bootstrap/eks/PROJECT index d709623cf4..b75ff33b3f 100644 --- a/bootstrap/eks/PROJECT +++ b/bootstrap/eks/PROJECT @@ -7,4 +7,10 @@ resources: - group: bootstrap kind: EKSConfigTemplate version: v1alpha3 +- group: bootstrap + kind: EKSConfig + version: v1alpha4 +- group: bootstrap + kind: EKSConfigTemplate + version: v1alpha4 version: "2" diff --git a/bootstrap/eks/api/v1alpha3/conversion.go b/bootstrap/eks/api/v1alpha3/conversion.go new file mode 100644 index 0000000000..e755a8665d --- /dev/null +++ b/bootstrap/eks/api/v1alpha3/conversion.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 v1alpha3 + +import ( + "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha4" + "sigs.k8s.io/controller-runtime/pkg/conversion" +) + +func (r *EKSConfig) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.EKSConfig) + + return Convert_v1alpha3_EKSConfig_To_v1alpha4_EKSConfig(r, dst, nil) +} + +func (r *EKSConfig) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.EKSConfig) + + return Convert_v1alpha4_EKSConfig_To_v1alpha3_EKSConfig(src, r, nil) +} + +func (r *EKSConfigList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.EKSConfigList) + + return Convert_v1alpha3_EKSConfigList_To_v1alpha4_EKSConfigList(r, dst, nil) +} + +func (r *EKSConfigList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.EKSConfigList) + + return Convert_v1alpha4_EKSConfigList_To_v1alpha3_EKSConfigList(src, r, nil) +} + +func (r *EKSConfigTemplate) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.EKSConfigTemplate) + + return Convert_v1alpha3_EKSConfigTemplate_To_v1alpha4_EKSConfigTemplate(r, dst, nil) +} + +func (r *EKSConfigTemplate) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.EKSConfigTemplate) + + return Convert_v1alpha4_EKSConfigTemplate_To_v1alpha3_EKSConfigTemplate(src, r, nil) +} + +func (r *EKSConfigTemplateList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.EKSConfigTemplateList) + + return Convert_v1alpha3_EKSConfigTemplateList_To_v1alpha4_EKSConfigTemplateList(r, dst, nil) +} + +func (r *EKSConfigTemplateList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.EKSConfigTemplateList) + + return Convert_v1alpha4_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 new file mode 100644 index 0000000000..fa56f50d67 --- /dev/null +++ b/bootstrap/eks/api/v1alpha3/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 v1alpha3 + +import ( + "testing" + + . "github.com/onsi/gomega" + + runtime "k8s.io/apimachinery/pkg/runtime" + v1alpha4 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha4" + 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(v1alpha4.AddToScheme(scheme)).To(Succeed()) + + t.Run("for EKSConfig", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1alpha4.EKSConfig{}, + Spoke: &EKSConfig{}, + })) + + t.Run("for EKSConfigTemplate", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1alpha4.EKSConfigTemplate{}, + Spoke: &EKSConfigTemplate{}, + })) +} diff --git a/api/v1alpha3/awscluster_conversion.go b/bootstrap/eks/api/v1alpha3/doc.go similarity index 79% rename from api/v1alpha3/awscluster_conversion.go rename to bootstrap/eks/api/v1alpha3/doc.go index 7775c5ed8f..95178de1b8 100644 --- a/api/v1alpha3/awscluster_conversion.go +++ b/bootstrap/eks/api/v1alpha3/doc.go @@ -14,10 +14,5 @@ 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 package v1alpha3 - -// Hub marks AWSCluster as a conversion hub. -func (*AWSCluster) Hub() {} - -// Hub marks AWSClusterList as a conversion hub. -func (*AWSClusterList) Hub() {} diff --git a/bootstrap/eks/api/v1alpha3/eksconfig_types.go b/bootstrap/eks/api/v1alpha3/eksconfig_types.go index e52c49476a..588862a526 100644 --- a/bootstrap/eks/api/v1alpha3/eksconfig_types.go +++ b/bootstrap/eks/api/v1alpha3/eksconfig_types.go @@ -59,7 +59,6 @@ type EKSConfigStatus struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=eksconfigs,scope=Namespaced,categories=cluster-api -// +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" diff --git a/bootstrap/eks/api/v1alpha3/eksconfigtemplate_types.go b/bootstrap/eks/api/v1alpha3/eksconfigtemplate_types.go index 12d5b92012..ae09ade3fb 100644 --- a/bootstrap/eks/api/v1alpha3/eksconfigtemplate_types.go +++ b/bootstrap/eks/api/v1alpha3/eksconfigtemplate_types.go @@ -32,7 +32,6 @@ type EKSConfigTemplateResource struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=eksconfigtemplates,scope=Namespaced,categories=cluster-api -// +kubebuilder:storageversion // EKSConfigTemplate is the Schema for the eksconfigtemplates API type EKSConfigTemplate struct { diff --git a/bootstrap/eks/api/v1alpha3/groupversion_info.go b/bootstrap/eks/api/v1alpha3/groupversion_info.go index 9f4677d63f..e1f6a9e552 100644 --- a/bootstrap/eks/api/v1alpha3/groupversion_info.go +++ b/bootstrap/eks/api/v1alpha3/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/v1alpha3/zz_generated.conversion.go b/bootstrap/eks/api/v1alpha3/zz_generated.conversion.go new file mode 100644 index 0000000000..1f60ca3f8a --- /dev/null +++ b/bootstrap/eks/api/v1alpha3/zz_generated.conversion.go @@ -0,0 +1,321 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by conversion-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + unsafe "unsafe" + + conversion "k8s.io/apimachinery/pkg/conversion" + runtime "k8s.io/apimachinery/pkg/runtime" + v1alpha4 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha4" + apiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" + apiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" +) + +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), (*v1alpha4.EKSConfig)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_EKSConfig_To_v1alpha4_EKSConfig(a.(*EKSConfig), b.(*v1alpha4.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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha3_EKSConfig_To_v1alpha4_EKSConfig(in *EKSConfig, out *v1alpha4.EKSConfig, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_EKSConfigSpec_To_v1alpha4_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 { + 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) +} + +func autoConvert_v1alpha4_EKSConfig_To_v1alpha3_EKSConfig(in *v1alpha4.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 { + return err + } + if err := Convert_v1alpha4_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) +} + +func autoConvert_v1alpha3_EKSConfigList_To_v1alpha4_EKSConfigList(in *EKSConfigList, out *v1alpha4.EKSConfigList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha4.EKSConfig)(unsafe.Pointer(&in.Items)) + 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) +} + +func autoConvert_v1alpha4_EKSConfigList_To_v1alpha3_EKSConfigList(in *v1alpha4.EKSConfigList, out *EKSConfigList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]EKSConfig)(unsafe.Pointer(&in.Items)) + 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) +} + +func autoConvert_v1alpha3_EKSConfigSpec_To_v1alpha4_EKSConfigSpec(in *EKSConfigSpec, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_EKSConfigSpec_To_v1alpha3_EKSConfigSpec(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_EKSConfigStatus_To_v1alpha4_EKSConfigStatus(in *EKSConfigStatus, out *v1alpha4.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)) + 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) +} + +func autoConvert_v1alpha4_EKSConfigStatus_To_v1alpha3_EKSConfigStatus(in *v1alpha4.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)) + 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) +} + +func autoConvert_v1alpha3_EKSConfigTemplate_To_v1alpha4_EKSConfigTemplate(in *EKSConfigTemplate, out *v1alpha4.EKSConfigTemplate, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_EKSConfigTemplateSpec_To_v1alpha4_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) +} + +func autoConvert_v1alpha4_EKSConfigTemplate_To_v1alpha3_EKSConfigTemplate(in *v1alpha4.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 { + 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) +} + +func autoConvert_v1alpha3_EKSConfigTemplateList_To_v1alpha4_EKSConfigTemplateList(in *EKSConfigTemplateList, out *v1alpha4.EKSConfigTemplateList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha4.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) +} + +func autoConvert_v1alpha4_EKSConfigTemplateList_To_v1alpha3_EKSConfigTemplateList(in *v1alpha4.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) +} + +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 { + 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) +} + +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 { + 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) +} + +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 { + 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) +} + +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 { + 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) +} diff --git a/bootstrap/eks/controllers/eksconfig_controller.go b/bootstrap/eks/controllers/eksconfig_controller.go index 6f4af8c595..aadafa46b7 100644 --- a/bootstrap/eks/controllers/eksconfig_controller.go +++ b/bootstrap/eks/controllers/eksconfig_controller.go @@ -18,15 +18,23 @@ package controllers import ( "context" + "fmt" - "github.com/go-logr/logr" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/utils/pointer" + bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha4" + "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" + bsutil "sigs.k8s.io/cluster-api/bootstrap/util" + expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" "sigs.k8s.io/cluster-api/feature" + "sigs.k8s.io/cluster-api/util" + "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/cluster-api/util/predicates" @@ -35,24 +43,13 @@ import ( "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/source" - - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" - bsutil "sigs.k8s.io/cluster-api/bootstrap/util" - expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha3" - "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/cluster-api/util/annotations" - - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3" - - bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha3" - "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/internal/userdata" ) // EKSConfigReconciler reconciles a EKSConfig object type EKSConfigReconciler struct { client.Client - Log logr.Logger - Scheme *runtime.Scheme + Scheme *runtime.Scheme + WatchFilterValue string } // +kubebuilder:rbac:groups=bootstrap.cluster.x-k8s.io,resources=eksconfigs,verbs=get;list;watch;create;update;patch;delete @@ -62,9 +59,8 @@ type EKSConfigReconciler struct { // +kubebuilder:rbac:groups=exp.cluster.x-k8s.io,resources=machinepools,verbs=get;list;watch // +kubebuilder:rbac:groups="",resources=secrets,verbs=get;list;watch;create;update;delete; -func (r *EKSConfigReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, rerr error) { - ctx := context.Background() - log := r.Log.WithValues("namespace", req.NamespacedName.Namespace, "name", req.NamespacedName.Name) +func (r *EKSConfigReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, rerr error) { + log := ctrl.LoggerFrom(ctx) // get EKSConfig config := &bootstrapv1.EKSConfig{} @@ -139,10 +135,12 @@ func (r *EKSConfigReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, rerr e } }() - return r.joinWorker(ctx, log, cluster, config) + return r.joinWorker(ctx, cluster, config) } -func (r *EKSConfigReconciler) joinWorker(ctx context.Context, log logr.Logger, cluster *clusterv1.Cluster, config *bootstrapv1.EKSConfig) (ctrl.Result, error) { +func (r *EKSConfigReconciler) joinWorker(ctx context.Context, cluster *clusterv1.Cluster, config *bootstrapv1.EKSConfig) (ctrl.Result, error) { + log := ctrl.LoggerFrom(ctx) + if config.Status.DataSecretName != nil { secretKey := client.ObjectKey{Namespace: config.Namespace, Name: *config.Status.DataSecretName} log = log.WithValues("data-secret-name", secretKey.Name) @@ -173,7 +171,7 @@ func (r *EKSConfigReconciler) joinWorker(ctx context.Context, log logr.Logger, c return ctrl.Result{}, nil } - if !cluster.Status.ControlPlaneInitialized { + if !conditions.IsTrue(cluster, clusterv1.ControlPlaneInitializedCondition) { log.Info("Control Plane has not yet been initialized") conditions.MarkFalse(config, bootstrapv1.DataSecretAvailableCondition, bootstrapv1.WaitingForControlPlaneInitializationReason, clusterv1.ConditionSeverityInfo, "") return ctrl.Result{}, nil @@ -200,7 +198,7 @@ func (r *EKSConfigReconciler) joinWorker(ctx context.Context, log logr.Logger, c } // store userdata as secret - if err := r.storeBootstrapData(ctx, log, cluster, config, userDataScript); err != nil { + 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, "") return ctrl.Result{}, err @@ -209,24 +207,20 @@ func (r *EKSConfigReconciler) joinWorker(ctx context.Context, log logr.Logger, c return ctrl.Result{}, nil } -func (r *EKSConfigReconciler) SetupWithManager(mgr ctrl.Manager, option controller.Options) error { +func (r *EKSConfigReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, option controller.Options) error { b := ctrl.NewControllerManagedBy(mgr). For(&bootstrapv1.EKSConfig{}). WithOptions(option). - WithEventFilter(predicates.ResourceNotPaused(r.Log)). + WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)). Watches( &source.Kind{Type: &clusterv1.Machine{}}, - &handler.EnqueueRequestsFromMapFunc{ - ToRequests: handler.ToRequestsFunc(r.MachineToBootstrapMapFunc), - }, + handler.EnqueueRequestsFromMapFunc(r.MachineToBootstrapMapFunc), ) if feature.Gates.Enabled(feature.MachinePool) { b = b.Watches( &source.Kind{Type: &expv1.MachinePool{}}, - &handler.EnqueueRequestsFromMapFunc{ - ToRequests: handler.ToRequestsFunc(r.MachinePoolToBootstrapMapFunc), - }, + handler.EnqueueRequestsFromMapFunc(r.MachinePoolToBootstrapMapFunc), ) } @@ -237,10 +231,8 @@ func (r *EKSConfigReconciler) SetupWithManager(mgr ctrl.Manager, option controll err = c.Watch( &source.Kind{Type: &clusterv1.Cluster{}}, - &handler.EnqueueRequestsFromMapFunc{ - ToRequests: handler.ToRequestsFunc(r.ClusterToEKSConfigs), - }, - predicates.ClusterUnpausedAndInfrastructureReady(r.Log), + handler.EnqueueRequestsFromMapFunc((r.ClusterToEKSConfigs)), + predicates.ClusterUnpausedAndInfrastructureReady(ctrl.LoggerFrom(ctx)), ) if err != nil { return errors.Wrap(err, "failed adding watch for Clusters to controller manager") @@ -251,7 +243,8 @@ func (r *EKSConfigReconciler) SetupWithManager(mgr ctrl.Manager, option controll // 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, log logr.Logger, cluster *clusterv1.Cluster, config *bootstrapv1.EKSConfig, data []byte) error { +func (r *EKSConfigReconciler) storeBootstrapData(ctx context.Context, cluster *clusterv1.Cluster, config *bootstrapv1.EKSConfig, data []byte) error { + log := ctrl.LoggerFrom(ctx) secret := &corev1.Secret{ ObjectMeta: metav1.ObjectMeta{ Name: config.Name, @@ -291,12 +284,12 @@ func (r *EKSConfigReconciler) storeBootstrapData(ctx context.Context, log logr.L // MachineToBootstrapMapFunc is a handler.ToRequestsFunc to be used to enqueue requests // for EKSConfig reconciliation -func (r *EKSConfigReconciler) MachineToBootstrapMapFunc(o handler.MapObject) []ctrl.Request { +func (r *EKSConfigReconciler) MachineToBootstrapMapFunc(o client.Object) []ctrl.Request { result := []ctrl.Request{} - m, ok := o.Object.(*clusterv1.Machine) + m, ok := o.(*clusterv1.Machine) if !ok { - return nil + 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") { name := client.ObjectKey{Namespace: m.Namespace, Name: m.Spec.Bootstrap.ConfigRef.Name} @@ -307,12 +300,12 @@ func (r *EKSConfigReconciler) MachineToBootstrapMapFunc(o handler.MapObject) []c // MachinePoolToBootstrapMapFunc is a handler.ToRequestsFunc to be uses to enqueue requests // for EKSConfig reconciliation -func (r *EKSConfigReconciler) MachinePoolToBootstrapMapFunc(o handler.MapObject) []ctrl.Request { +func (r *EKSConfigReconciler) MachinePoolToBootstrapMapFunc(o client.Object) []ctrl.Request { result := []ctrl.Request{} - m, ok := o.Object.(*expv1.MachinePool) + m, ok := o.(*expv1.MachinePool) if !ok { - return nil + 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() { @@ -325,12 +318,12 @@ func (r *EKSConfigReconciler) MachinePoolToBootstrapMapFunc(o handler.MapObject) // ClusterToEKSConfigs is a handler.ToRequestsFunc to be used to enqueue requests for // EKSConfig reconciliation -func (r *EKSConfigReconciler) ClusterToEKSConfigs(o handler.MapObject) []ctrl.Request { +func (r *EKSConfigReconciler) ClusterToEKSConfigs(o client.Object) []ctrl.Request { result := []ctrl.Request{} - c, ok := o.Object.(*clusterv1.Cluster) + c, ok := o.(*clusterv1.Cluster) if !ok { - return nil + panic(fmt.Sprintf("Expected a Cluster but got a %T", o)) } selectors := []client.ListOption{ @@ -342,7 +335,6 @@ func (r *EKSConfigReconciler) ClusterToEKSConfigs(o handler.MapObject) []ctrl.Re machineList := &clusterv1.MachineList{} if err := r.Client.List(context.Background(), machineList, selectors...); err != nil { - r.Log.Error(err, "failed to list Machines for Cluster", "name", c.Name, "namespace", c.Namespace) return nil } diff --git a/bootstrap/eks/controllers/eksconfig_controller_reconciler_test.go b/bootstrap/eks/controllers/eksconfig_controller_reconciler_test.go index 4a663015fd..1f5671582b 100644 --- a/bootstrap/eks/controllers/eksconfig_controller_reconciler_test.go +++ b/bootstrap/eks/controllers/eksconfig_controller_reconciler_test.go @@ -22,16 +22,14 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/types" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha3" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + "k8s.io/apimachinery/pkg/types" + bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" "sigs.k8s.io/yaml" - - "sigs.k8s.io/controller-runtime/pkg/log" ) var _ = Describe("EKSConfigReconciler", func() { @@ -52,12 +50,11 @@ var _ = Describe("EKSConfigReconciler", func() { Expect(err).To(BeNil()) reconciler := EKSConfigReconciler{ - Log: log.Log, Client: testEnv.Client, } By("Calling reconcile should requeue") - result, err := reconciler.joinWorker(context.Background(), log.Log, cluster, config) + result, err := reconciler.joinWorker(context.Background(), cluster, config) Expect(err).To(Succeed()) Expect(result.Requeue).To(BeFalse()) }) diff --git a/bootstrap/eks/controllers/eksconfig_controller_test.go b/bootstrap/eks/controllers/eksconfig_controller_test.go index b8cdfd871e..6dd5bf65af 100644 --- a/bootstrap/eks/controllers/eksconfig_controller_test.go +++ b/bootstrap/eks/controllers/eksconfig_controller_test.go @@ -21,9 +21,8 @@ import ( "testing" . "github.com/onsi/gomega" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" - "sigs.k8s.io/cluster-api/test/helpers" - "sigs.k8s.io/controller-runtime/pkg/log" + + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" "sigs.k8s.io/controller-runtime/pkg/reconcile" ) @@ -38,14 +37,11 @@ func TestEKSConfigReconciler_ReturnEarlyIfClusterInfraNotReady(t *testing.T) { InfrastructureReady: false, } - testEnv = helpers.NewTestEnvironment() - reconciler := EKSConfigReconciler{ - Log: log.Log, Client: testEnv.Client, } - result, err := reconciler.joinWorker(context.Background(), log.Log, cluster, config) + result, err := reconciler.joinWorker(context.Background(), cluster, config) g.Expect(result).To(Equal(reconcile.Result{})) g.Expect(err).NotTo(HaveOccurred()) } @@ -58,18 +54,14 @@ func TestEKSConfigReconciler_ReturnEarlyIfClusterControlPlaneNotInitialized(t *t config := newEKSConfig(machine, "cfg") cluster.Status = clusterv1.ClusterStatus{ - InfrastructureReady: true, - ControlPlaneInitialized: false, + InfrastructureReady: true, } - testEnv = helpers.NewTestEnvironment() - reconciler := EKSConfigReconciler{ - Log: log.Log, Client: testEnv.Client, } - result, err := reconciler.joinWorker(context.Background(), log.Log, cluster, config) + result, err := reconciler.joinWorker(context.Background(), cluster, config) g.Expect(result).To(Equal(reconcile.Result{})) g.Expect(err).NotTo(HaveOccurred()) } diff --git a/bootstrap/eks/controllers/suite_test.go b/bootstrap/eks/controllers/suite_test.go index 55e143d7a7..c90649f7ba 100644 --- a/bootstrap/eks/controllers/suite_test.go +++ b/bootstrap/eks/controllers/suite_test.go @@ -17,11 +17,16 @@ limitations under the License. package controllers import ( + "fmt" + "os" + "path" "testing" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "sigs.k8s.io/cluster-api/test/helpers" + + "sigs.k8s.io/cluster-api-provider-aws/test/helpers" + ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" // +kubebuilder:scaffold:imports ) @@ -29,7 +34,10 @@ import ( // These tests use Ginkgo (BDD-style Go testing framework). Refer to // http://onsi.github.io/ginkgo/ to learn more about Ginkgo. -var testEnv *helpers.TestEnvironment +var ( + testEnv *helpers.TestEnvironment + ctx = ctrl.SetupSignalHandler() +) func TestAPIs(t *testing.T) { RegisterFailHandler(Fail) @@ -39,22 +47,37 @@ func TestAPIs(t *testing.T) { []Reporter{printer.NewlineReporter{}}) } -var _ = BeforeSuite(func(done Done) { - By("bootstrapping test environment") - testEnv = helpers.NewTestEnvironment() +func TestMain(m *testing.M) { + setup() + defer func() { + teardown() + }() + code := m.Run() + os.Exit(code) +} - By("starting the manager") +func setup() { + //utilruntime.Must(bootstrapv1.AddToScheme(scheme.Scheme)) + //utilruntime.Must(clusterv1.AddToScheme(scheme.Scheme)) + testEnvConfig := helpers.NewTestEnvironmentConfiguration([]string{ + path.Join("config", "crd", "bases"), + }, + ) + var err error + testEnv, err = testEnvConfig.Build() + if err != nil { + panic(err) + } go func() { - defer GinkgoRecover() - Expect(testEnv.StartManager()).To(Succeed()) + fmt.Println("Starting the manager") + if err := testEnv.StartManager(ctx); err != nil { + panic(fmt.Sprintf("Failed to start the envtest manager: %v", err)) + } }() +} - close(done) -}, 60) - -var _ = AfterSuite(func() { - if testEnv != nil { - By("tearing down the test environment") - Expect(testEnv.Stop()).To(Succeed()) +func teardown() { + if err := testEnv.Stop(); err != nil { + panic(fmt.Sprintf("Failed to stop envtest: %v", err)) } -}) +} diff --git a/bootstrap/eks/main.go b/bootstrap/eks/main.go index 0d4fcdf4dd..6d8f638075 100644 --- a/bootstrap/eks/main.go +++ b/bootstrap/eks/main.go @@ -17,7 +17,9 @@ limitations under the License. package main import ( + "context" "flag" + "fmt" "math/rand" "net/http" _ "net/http/pprof" @@ -29,18 +31,19 @@ import ( clientgoscheme "k8s.io/client-go/kubernetes/scheme" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" + 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" + controlplanev1alpha3 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3" + controlplanev1alpha4 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + expinfrav1alpha3 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha3" + expinfrav1alpha4 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + "sigs.k8s.io/cluster-api-provider-aws/version" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" "sigs.k8s.io/cluster-api/feature" - "sigs.k8s.io/cluster-api/util" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/controller" - - bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/api/v1alpha3" - bootstrapv1controllers "sigs.k8s.io/cluster-api-provider-aws/bootstrap/eks/controllers" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3" - expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha3" - "sigs.k8s.io/cluster-api-provider-aws/version" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" - expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha3" // +kubebuilder:scaffold:imports ) @@ -54,10 +57,14 @@ func init() { _ = clientgoscheme.AddToScheme(scheme) _ = clusterv1.AddToScheme(scheme) - _ = bootstrapv1.AddToScheme(scheme) - _ = expinfrav1.AddToScheme(scheme) + _ = bootstrapv1alpha3.AddToScheme(scheme) + _ = bootstrapv1alpha4.AddToScheme(scheme) + _ = expinfrav1alpha3.AddToScheme(scheme) + _ = expinfrav1alpha4.AddToScheme(scheme) _ = expclusterv1.AddToScheme(scheme) - _ = controlplanev1.AddToScheme(scheme) + _ = controlplanev1alpha3.AddToScheme(scheme) + _ = controlplanev1alpha4.AddToScheme(scheme) + // +kubebuilder:scaffold:scheme } @@ -68,26 +75,28 @@ var ( leaderElectionRenewDeadline time.Duration leaderElectionRetryPeriod time.Duration watchNamespace string + watchFilterValue string profilerAddress string eksConfigConcurrency int syncPeriod time.Duration webhookPort int + webhookCertDir string ) func InitFlags(fs *pflag.FlagSet) { - fs.StringVar(&metricsAddr, "metrics-addr", ":8080", + fs.StringVar(&metricsAddr, "metrics-bind-addr", ":8080", "The address the metric endpoint binds to.") - fs.BoolVar(&enableLeaderElection, "enable-leader-election", false, + fs.BoolVar(&enableLeaderElection, "leader-elect", false, "Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.") - fs.DurationVar(&leaderElectionLeaseDuration, "leader-election-lease-duration", 15*time.Second, + fs.DurationVar(&leaderElectionLeaseDuration, "leader-elect-lease-duration", 15*time.Second, "Interval at which non-leader candidates will wait to force acquire leadership (duration string)") - fs.DurationVar(&leaderElectionRenewDeadline, "leader-election-renew-deadline", 10*time.Second, + fs.DurationVar(&leaderElectionRenewDeadline, "leader-elect-renew-deadline", 10*time.Second, "Duration that the leading controller manager will retry refreshing leadership before giving up (duration string)") - fs.DurationVar(&leaderElectionRetryPeriod, "leader-election-retry-period", 2*time.Second, + fs.DurationVar(&leaderElectionRetryPeriod, "leader-elect-retry-period", 2*time.Second, "Duration the LeaderElector clients should wait between tries of actions (duration string)") fs.StringVar(&watchNamespace, "namespace", "", @@ -102,9 +111,19 @@ func InitFlags(fs *pflag.FlagSet) { fs.DurationVar(&syncPeriod, "sync-period", 10*time.Minute, "The minimum interval at which watched resources are reconciled (e.g. 15m)") - fs.IntVar(&webhookPort, "webhook-port", 0, + fs.IntVar(&webhookPort, "webhook-port", 9443, "Webhook Server port, disabled by default. When enabled, the manager will only work as webhook server, no reconcilers are installed.") + fs.StringVar(&webhookCertDir, "webhook-cert-dir", "/tmp/k8s-webhook-server/serving-certs/", + "Webhook cert dir, only used when webhook-port is specified.") + + fs.StringVar( + &watchFilterValue, + "watch-filter", + "", + fmt.Sprintf("Label value that the controller watches to reconcile cluster-api objects. Label key is always %s. If unspecified, the controller watches for all cluster-api objects.", clusterv1.WatchLabel), + ) + feature.MutableGates.AddFlag(fs) } @@ -130,39 +149,35 @@ func main() { Scheme: scheme, MetricsBindAddress: metricsAddr, LeaderElection: enableLeaderElection, - LeaderElectionID: "eks-bootstrap-manager-leader-election-capa", + LeaderElectionID: "eks-bootstrap-manager-leader-elect-capa", LeaseDuration: &leaderElectionLeaseDuration, RenewDeadline: &leaderElectionRenewDeadline, RetryPeriod: &leaderElectionRetryPeriod, Namespace: watchNamespace, SyncPeriod: &syncPeriod, - NewClient: util.ManagerDelegatingClientFunc, Port: webhookPort, + CertDir: webhookCertDir, }) if err != nil { setupLog.Error(err, "unable to start manager") os.Exit(1) } - - setupReconcilers(mgr) + ctx := ctrl.SetupSignalHandler() + setupReconcilers(ctx, mgr) // +kubebuilder:scaffold:builder setupLog.Info("starting manager", "version", version.Get().String()) - if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil { + if err := mgr.Start(ctx); err != nil { setupLog.Error(err, "problem running manager") os.Exit(1) } } -func setupReconcilers(mgr ctrl.Manager) { - if webhookPort != 0 { - return - } - +func setupReconcilers(ctx context.Context, mgr ctrl.Manager) { if err := (&bootstrapv1controllers.EKSConfigReconciler{ - Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName("EKSConfig"), - }).SetupWithManager(mgr, concurrency(eksConfigConcurrency)); err != nil { + Client: mgr.GetClient(), + WatchFilterValue: watchFilterValue, + }).SetupWithManager(ctx, mgr, concurrency(eksConfigConcurrency)); err != nil { setupLog.Error(err, "unable to create controller", "controller", "EKSConfig") os.Exit(1) } diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 1f2a47e5e7..25376ba925 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -3,8 +3,7 @@ timeout: 3000s options: substitution_option: ALLOW_LOOSE steps: - # 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20210331-c732583' - - name: 'gcr.io/k8s-testimages/gcb-docker-gcloud@sha256:aab41ebf34c7f2ad32fbf2c7bddd1635a49c66f9c57d998f85d7e638bc9d9044' + - name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20210331-c732583' entrypoint: make env: - DOCKER_CLI_EXPERIMENTAL=enabled diff --git a/cmd/clusterawsadm/api/bootstrap/v1alpha1/defaults.go b/cmd/clusterawsadm/api/bootstrap/v1alpha1/defaults.go index 7c55fbff22..d54062f1a0 100644 --- a/cmd/clusterawsadm/api/bootstrap/v1alpha1/defaults.go +++ b/cmd/clusterawsadm/api/bootstrap/v1alpha1/defaults.go @@ -20,7 +20,7 @@ import ( runtime "k8s.io/apimachinery/pkg/runtime" utilpointer "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" ) const ( diff --git a/cmd/clusterawsadm/api/bootstrap/v1alpha1/types.go b/cmd/clusterawsadm/api/bootstrap/v1alpha1/types.go index 037fe24579..775e39aa07 100644 --- a/cmd/clusterawsadm/api/bootstrap/v1alpha1/types.go +++ b/cmd/clusterawsadm/api/bootstrap/v1alpha1/types.go @@ -19,7 +19,7 @@ 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/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" iamv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/iam/v1alpha1" ) diff --git a/cmd/clusterawsadm/api/bootstrap/v1alpha1/zz_generated.deepcopy.go b/cmd/clusterawsadm/api/bootstrap/v1alpha1/zz_generated.deepcopy.go index 1b4d6a7d4e..e14627f1b3 100644 --- a/cmd/clusterawsadm/api/bootstrap/v1alpha1/zz_generated.deepcopy.go +++ b/cmd/clusterawsadm/api/bootstrap/v1alpha1/zz_generated.deepcopy.go @@ -22,7 +22,7 @@ package v1alpha1 import ( "k8s.io/apimachinery/pkg/runtime" - "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" iamv1alpha1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/iam/v1alpha1" ) @@ -75,7 +75,7 @@ func (in *AWSIAMConfigurationSpec) DeepCopyInto(out *AWSIAMConfigurationSpec) { } if in.SecureSecretsBackends != nil { in, out := &in.SecureSecretsBackends, &out.SecureSecretsBackends - *out = make([]v1alpha3.SecretBackend, len(*in)) + *out = make([]v1alpha4.SecretBackend, len(*in)) copy(*out, *in) } } @@ -114,7 +114,7 @@ func (in *AWSIAMRoleSpec) DeepCopyInto(out *AWSIAMRoleSpec) { } if in.Tags != nil { in, out := &in.Tags, &out.Tags - *out = make(v1alpha3.Tags, len(*in)) + *out = make(v1alpha4.Tags, len(*in)) for key, val := range *in { (*out)[key] = val } @@ -153,7 +153,7 @@ func (in *BootstrapUser) DeepCopyInto(out *BootstrapUser) { } if in.Tags != nil { in, out := &in.Tags, &out.Tags - *out = make(v1alpha3.Tags, len(*in)) + *out = make(v1alpha4.Tags, len(*in)) for key, val := range *in { (*out)[key] = val } diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_controller.go b/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_controller.go index 2c54d32a59..6f32063753 100644 --- a/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_controller.go +++ b/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_controller.go @@ -21,7 +21,7 @@ import ( "github.com/awslabs/goformation/v4/cloudformation" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" iamv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/iam/v1alpha1" ) diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_node.go b/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_node.go index 89fc877cb6..d636a73fcc 100644 --- a/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_node.go +++ b/cmd/clusterawsadm/cloudformation/bootstrap/cluster_api_node.go @@ -17,7 +17,7 @@ limitations under the License. package bootstrap import ( - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" iamv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/iam/v1alpha1" ) diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/template.go b/cmd/clusterawsadm/cloudformation/bootstrap/template.go index f47abac201..75196fce74 100644 --- a/cmd/clusterawsadm/cloudformation/bootstrap/template.go +++ b/cmd/clusterawsadm/cloudformation/bootstrap/template.go @@ -25,8 +25,8 @@ import ( bootstrapv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/bootstrap/v1alpha1" iamv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/iam/v1alpha1" "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/converters" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha3" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" eksiam "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/eks/iam" ) diff --git a/cmd/clusterawsadm/cloudformation/bootstrap/template_test.go b/cmd/clusterawsadm/cloudformation/bootstrap/template_test.go index 33aebee814..b101d532bf 100644 --- a/cmd/clusterawsadm/cloudformation/bootstrap/template_test.go +++ b/cmd/clusterawsadm/cloudformation/bootstrap/template_test.go @@ -25,7 +25,7 @@ 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/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" iamv1 "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/api/iam/v1alpha1" "sigs.k8s.io/yaml" ) diff --git a/cmd/clusterawsadm/cmd/alpha/migrate/migrate.go b/cmd/clusterawsadm/cmd/alpha/migrate/migrate.go index 1d0561b021..a924d37cd4 100644 --- a/cmd/clusterawsadm/cmd/alpha/migrate/migrate.go +++ b/cmd/clusterawsadm/cmd/alpha/migrate/migrate.go @@ -26,7 +26,7 @@ import ( 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/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" "sigs.k8s.io/cluster-api-provider-aws/cmd/clusterawsadm/cmd/flags" ) diff --git a/cmd/clusterawsadm/converters/cloudformation.go b/cmd/clusterawsadm/converters/cloudformation.go index 0769661ed1..6f220a1ca6 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/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" ) // MapToCloudFormationTags converts a infrav1.Tags to []tags.Tag diff --git a/controllers/awscluster_controller.go b/controllers/awscluster_controller.go index 004900c45f..7f6a337fff 100644 --- a/controllers/awscluster_controller.go +++ b/controllers/awscluster_controller.go @@ -23,17 +23,24 @@ import ( "reflect" "time" - "sigs.k8s.io/cluster-api/util/patch" - "github.com/go-logr/logr" "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + "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" + "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/elb" + "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" "sigs.k8s.io/cluster-api/util" + "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/conditions" - + "sigs.k8s.io/cluster-api/util/patch" + "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" @@ -43,23 +50,14 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" - "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" - "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/elb" - "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" ) // AWSClusterReconciler reconciles a AwsCluster object type AWSClusterReconciler struct { client.Client - Recorder record.EventRecorder - Log logr.Logger - Endpoints []scope.ServiceEndpoint + Recorder record.EventRecorder + Endpoints []scope.ServiceEndpoint + WatchFilterValue string } // +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=awsclusters,verbs=get;list;watch;create;update;patch;delete @@ -68,9 +66,8 @@ type AWSClusterReconciler struct { // +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=awsclusterroleidentities;awsclusterstaticidentities,verbs=get;list;watch // +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=awsclustercontrolleridentities,verbs=get;list;watch;create; -func (r *AWSClusterReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr error) { - ctx := context.TODO() - log := r.Log.WithValues("namespace", req.Namespace, "awsCluster", req.Name) +func (r *AWSClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error) { + log := ctrl.LoggerFrom(ctx) // Fetch the AWSCluster instance awsCluster := &infrav1.AWSCluster{} @@ -93,7 +90,7 @@ func (r *AWSClusterReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reter return reconcile.Result{}, nil } - if util.IsPaused(cluster, awsCluster) { + if annotations.IsPaused(cluster, awsCluster) { log.Info("AWSCluster or linked Cluster is marked as paused. Won't reconcile") return reconcile.Result{}, nil } @@ -279,11 +276,12 @@ func reconcileNormal(clusterScope *scope.ClusterScope) (reconcile.Result, error) return reconcile.Result{}, nil } -func (r *AWSClusterReconciler) SetupWithManager(mgr ctrl.Manager, options controller.Options) error { +func (r *AWSClusterReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error { + log := ctrl.LoggerFrom(ctx) controller, err := ctrl.NewControllerManagedBy(mgr). WithOptions(options). For(&infrav1.AWSCluster{}). - WithEventFilter(PausedPredicates(r.Log)). + WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(log, r.WatchFilterValue)). WithEventFilter( predicate.Funcs{ // Avoid reconciling if the event triggering the reconciliation is related to incremental status updates @@ -313,14 +311,12 @@ func (r *AWSClusterReconciler) SetupWithManager(mgr ctrl.Manager, options contro return controller.Watch( &source.Kind{Type: &clusterv1.Cluster{}}, - &handler.EnqueueRequestsFromMapFunc{ - ToRequests: handler.ToRequestsFunc(r.requeueAWSClusterForUnpausedCluster), - }, + handler.EnqueueRequestsFromMapFunc(r.requeueAWSClusterForUnpausedCluster(log)), predicate.Funcs{ UpdateFunc: func(e event.UpdateEvent) bool { oldCluster := e.ObjectOld.(*clusterv1.Cluster) newCluster := e.ObjectNew.(*clusterv1.Cluster) - log := r.Log.WithValues("predicate", "updateEvent", "namespace", newCluster.Namespace, "cluster", newCluster.Name) + log := log.WithValues("predicate", "updateEvent", "namespace", newCluster.Namespace, "cluster", newCluster.Name) switch { // return true if Cluster.Spec.Paused has changed from true to false case oldCluster.Spec.Paused && !newCluster.Spec.Paused: @@ -334,7 +330,7 @@ func (r *AWSClusterReconciler) SetupWithManager(mgr ctrl.Manager, options contro }, CreateFunc: func(e event.CreateEvent) bool { cluster := e.Object.(*clusterv1.Cluster) - log := r.Log.WithValues("predicate", "createEvent", "namespace", cluster.Namespace, "cluster", cluster.Name) + log := log.WithValues("predicate", "createEvent", "namespace", cluster.Namespace, "cluster", cluster.Name) // Only need to trigger a reconcile if the Cluster.Spec.Paused is false if !cluster.Spec.Paused { @@ -345,12 +341,12 @@ func (r *AWSClusterReconciler) SetupWithManager(mgr ctrl.Manager, options contro return false }, DeleteFunc: func(e event.DeleteEvent) bool { - log := r.Log.WithValues("predicate", "deleteEvent", "namespace", e.Meta.GetNamespace(), "cluster", e.Meta.GetName()) + log := log.WithValues("predicate", "deleteEvent", "namespace", e.Object.GetNamespace(), "cluster", e.Object.GetName()) log.V(4).Info("Cluster did not match expected conditions, will not attempt to map associated AWSCluster.") return false }, GenericFunc: func(e event.GenericEvent) bool { - log := r.Log.WithValues("predicate", "genericEvent", "namespace", e.Meta.GetNamespace(), "cluster", e.Meta.GetName()) + log := log.WithValues("predicate", "genericEvent", "namespace", e.Object.GetNamespace(), "cluster", e.Object.GetName()) log.V(4).Info("Cluster did not match expected conditions, will not attempt to map associated AWSCluster.") return false }, @@ -358,31 +354,37 @@ func (r *AWSClusterReconciler) SetupWithManager(mgr ctrl.Manager, options contro ) } -func (r *AWSClusterReconciler) requeueAWSClusterForUnpausedCluster(o handler.MapObject) []ctrl.Request { - c := o.Object.(*clusterv1.Cluster) - log := r.Log.WithValues("objectMapper", "clusterToAWSCluster", "namespace", c.Namespace, "cluster", c.Name) +func (r *AWSClusterReconciler) requeueAWSClusterForUnpausedCluster(log logr.Logger) handler.MapFunc { + return func(o client.Object) []ctrl.Request { + c, ok := o.(*clusterv1.Cluster) + if !ok { + panic(fmt.Sprintf("Expected a Cluster but got a %T", o)) + } - // Don't handle deleted clusters - if !c.ObjectMeta.DeletionTimestamp.IsZero() { - log.V(4).Info("Cluster has a deletion timestamp, skipping mapping.") - return nil - } + log := log.WithValues("objectMapper", "clusterToAWSCluster", "namespace", c.Namespace, "cluster", c.Name) - // Make sure the ref is set - if c.Spec.InfrastructureRef == nil { - log.V(4).Info("Cluster does not have an InfrastructureRef, skipping mapping.") - return nil - } + // Don't handle deleted clusters + if !c.ObjectMeta.DeletionTimestamp.IsZero() { + log.V(4).Info("Cluster has a deletion timestamp, skipping mapping.") + return nil + } - if c.Spec.InfrastructureRef.GroupVersionKind().Kind != "AWSCluster" { - log.V(4).Info("Cluster has an InfrastructureRef for a different type, skipping mapping.") - return nil - } + // Make sure the ref is set + if c.Spec.InfrastructureRef == nil { + log.V(4).Info("Cluster does not have an InfrastructureRef, skipping mapping.") + return nil + } - log.V(4).Info("Adding request.", "awsCluster", c.Spec.InfrastructureRef.Name) - return []ctrl.Request{ - { - NamespacedName: client.ObjectKey{Namespace: c.Namespace, Name: c.Spec.InfrastructureRef.Name}, - }, + if c.Spec.InfrastructureRef.GroupVersionKind().Kind != "AWSCluster" { + log.V(4).Info("Cluster has an InfrastructureRef for a different type, skipping mapping.") + return nil + } + + log.V(4).Info("Adding request.", "awsCluster", c.Spec.InfrastructureRef.Name) + return []ctrl.Request{ + { + NamespacedName: client.ObjectKey{Namespace: c.Namespace, Name: c.Spec.InfrastructureRef.Name}, + }, + } } } diff --git a/controllers/awscluster_controller_test.go b/controllers/awscluster_controller_test.go index b028e033c8..8ae4b5303f 100644 --- a/controllers/awscluster_controller_test.go +++ b/controllers/awscluster_controller_test.go @@ -22,10 +22,9 @@ import ( "golang.org/x/net/context" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/log" ) var _ = Describe("AWSClusterReconciler", func() { @@ -38,7 +37,6 @@ var _ = Describe("AWSClusterReconciler", func() { reconciler := &AWSClusterReconciler{ Client: testEnv.Client, - Log: log.Log, } instance := &infrav1.AWSCluster{ObjectMeta: metav1.ObjectMeta{Name: "foo", Namespace: "default"}} @@ -47,7 +45,7 @@ var _ = Describe("AWSClusterReconciler", func() { // Create the AWSCluster object and expect the Reconcile and Deployment to be created Expect(testEnv.Create(ctx, instance)).To(Succeed()) - result, err := reconciler.Reconcile(ctrl.Request{ + result, err := reconciler.Reconcile(ctx, ctrl.Request{ NamespacedName: client.ObjectKey{ Namespace: instance.Namespace, Name: instance.Name, diff --git a/controllers/awsmachine_annotations.go b/controllers/awsmachine_annotations.go index fd1831546e..c9698ea4e7 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/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" ) // updateMachineAnnotationJSON updates the `annotation` on `machine` with diff --git a/controllers/awsmachine_controller.go b/controllers/awsmachine_controller.go index e537e52430..5a36e8e509 100644 --- a/controllers/awsmachine_controller.go +++ b/controllers/awsmachine_controller.go @@ -25,14 +25,27 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/tools/record" "k8s.io/utils/pointer" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + "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" + "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services" + "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2" + "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/elb" + "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/instancestate" + "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" "sigs.k8s.io/cluster-api/controllers/noderefutil" capierrors "sigs.k8s.io/cluster-api/errors" "sigs.k8s.io/cluster-api/util" + "sigs.k8s.io/cluster-api/util/annotations" "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" @@ -41,19 +54,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/predicate" "sigs.k8s.io/controller-runtime/pkg/source" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3" - "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" - "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services" - "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2" - "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/elb" - "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/instancestate" - "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" ) const InstanceIDIndex = ".spec.instanceID" @@ -67,6 +67,7 @@ type AWSMachineReconciler struct { secretsManagerServiceFactory func(cloud.ClusterScoper) services.SecretInterface SSMServiceFactory func(cloud.ClusterScoper) services.SecretInterface Endpoints []scope.ServiceEndpoint + WatchFilterValue string } const ( @@ -114,9 +115,8 @@ func (r *AWSMachineReconciler) getSecretService(machineScope *scope.MachineScope // +kubebuilder:rbac:groups="",resources=namespaces,verbs=get;list;watch // +kubebuilder:rbac:groups="",resources=events,verbs=get;list;watch;create;update;patch -func (r *AWSMachineReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr error) { - ctx := context.TODO() - logger := r.Log.WithValues("namespace", req.Namespace, "awsMachine", req.Name) +func (r *AWSMachineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error) { + log := ctrl.LoggerFrom(ctx) // Fetch the AWSMachine instance. awsMachine := &infrav1.AWSMachine{} @@ -134,38 +134,37 @@ func (r *AWSMachineReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reter return ctrl.Result{}, err } if machine == nil { - logger.Info("Machine Controller has not yet set OwnerRef") + log.Info("Machine Controller has not yet set OwnerRef") return ctrl.Result{}, nil } - logger = logger.WithValues("machine", machine.Name) + log = log.WithValues("machine", machine.Name) // Fetch the Cluster. cluster, err := util.GetClusterFromMetadata(ctx, r.Client, machine.ObjectMeta) if err != nil { - logger.Info("Machine is missing cluster label or cluster does not exist") + log.Info("Machine is missing cluster label or cluster does not exist") return ctrl.Result{}, nil } - if util.IsPaused(cluster, awsMachine) { - logger.Info("AWSMachine or linked Cluster is marked as paused. Won't reconcile") + if annotations.IsPaused(cluster, awsMachine) { + log.Info("AWSMachine or linked Cluster is marked as paused. Won't reconcile") return ctrl.Result{}, nil } - logger = logger.WithValues("cluster", cluster.Name) + log = log.WithValues("cluster", cluster.Name) - infraCluster, err := r.getInfraCluster(ctx, logger, cluster, awsMachine) + infraCluster, err := r.getInfraCluster(ctx, log, cluster, awsMachine) if err != nil { return ctrl.Result{}, errors.New("error getting infra provider cluster or control plane object") } if infraCluster == nil { - logger.Info("AWSCluster or AWSManagedControlPlane is not ready yet") + log.Info("AWSCluster or AWSManagedControlPlane is not ready yet") return ctrl.Result{}, nil } // Create the machine scope machineScope, err := scope.NewMachineScope(scope.MachineScopeParams{ - Logger: logger, Client: r.Client, Cluster: cluster, Machine: machine, @@ -173,7 +172,7 @@ func (r *AWSMachineReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reter AWSMachine: awsMachine, }) if err != nil { - logger.Error(err, "failed to create scope") + log.Error(err, "failed to create scope") return ctrl.Result{}, err } @@ -202,21 +201,22 @@ func (r *AWSMachineReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reter } } -func (r *AWSMachineReconciler) SetupWithManager(mgr ctrl.Manager, options controller.Options) error { +func (r *AWSMachineReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error { + log := ctrl.LoggerFrom(ctx) + AWSClusterToAWSMachines := r.AWSClusterToAWSMachines(log) + controller, err := ctrl.NewControllerManagedBy(mgr). WithOptions(options). For(&infrav1.AWSMachine{}). Watches( &source.Kind{Type: &clusterv1.Machine{}}, - &handler.EnqueueRequestsFromMapFunc{ - ToRequests: util.MachineToInfrastructureMapFunc(infrav1.GroupVersion.WithKind("AWSMachine")), - }, + handler.EnqueueRequestsFromMapFunc(util.MachineToInfrastructureMapFunc(infrav1.GroupVersion.WithKind("AWSMachine"))), ). Watches( &source.Kind{Type: &infrav1.AWSCluster{}}, - &handler.EnqueueRequestsFromMapFunc{ToRequests: handler.ToRequestsFunc(r.AWSClusterToAWSMachines)}, + handler.EnqueueRequestsFromMapFunc(AWSClusterToAWSMachines), ). - WithEventFilter(PausedPredicates(r.Log)). + WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(log, r.WatchFilterValue)). WithEventFilter( predicate.Funcs{ // Avoid reconciling if the event triggering the reconciliation is related to incremental status updates @@ -245,23 +245,22 @@ func (r *AWSMachineReconciler) SetupWithManager(mgr ctrl.Manager, options contro } // Add index to AWSMachine to find by providerID - if err := mgr.GetFieldIndexer().IndexField(&infrav1.AWSMachine{}, + if err := mgr.GetFieldIndexer().IndexField(ctx, &infrav1.AWSMachine{}, InstanceIDIndex, r.indexAWSMachineByInstanceID, ); err != nil { return errors.Wrap(err, "error setting index fields") } + requeueAWSMachinesForUnpausedCluster := r.requeueAWSMachinesForUnpausedCluster(log) return controller.Watch( &source.Kind{Type: &clusterv1.Cluster{}}, - &handler.EnqueueRequestsFromMapFunc{ - ToRequests: handler.ToRequestsFunc(r.requeueAWSMachinesForUnpausedCluster), - }, + handler.EnqueueRequestsFromMapFunc(requeueAWSMachinesForUnpausedCluster), predicate.Funcs{ UpdateFunc: func(e event.UpdateEvent) bool { oldCluster := e.ObjectOld.(*clusterv1.Cluster) newCluster := e.ObjectNew.(*clusterv1.Cluster) - log := r.Log.WithValues("predicate", "updateEvent", "namespace", newCluster.Namespace, "cluster", newCluster.Name) + log := log.WithValues("predicate", "updateEvent", "namespace", newCluster.Namespace, "cluster", newCluster.Name) switch { // never return true for a paused Cluster @@ -284,7 +283,7 @@ func (r *AWSMachineReconciler) SetupWithManager(mgr ctrl.Manager, options contro }, CreateFunc: func(e event.CreateEvent) bool { cluster := e.Object.(*clusterv1.Cluster) - log := r.Log.WithValues("predicateEvent", "create", "namespace", cluster.Namespace, "cluster", cluster.Name) + log := log.WithValues("predicateEvent", "create", "namespace", cluster.Namespace, "cluster", cluster.Name) // Only need to trigger a reconcile if the Cluster.Spec.Paused is false and // Cluster.Status.InfrastructureReady is true @@ -296,12 +295,12 @@ func (r *AWSMachineReconciler) SetupWithManager(mgr ctrl.Manager, options contro return false }, DeleteFunc: func(e event.DeleteEvent) bool { - log := r.Log.WithValues("predicateEvent", "delete", "namespace", e.Meta.GetNamespace(), "cluster", e.Meta.GetName()) + log := log.WithValues("predicateEvent", "delete", "namespace", e.Object.GetNamespace(), "cluster", e.Object.GetName()) log.V(4).Info("Cluster did not match expected conditions, will not attempt to map associated AWSMachine.") return false }, GenericFunc: func(e event.GenericEvent) bool { - log := r.Log.WithValues("predicateEvent", "generic", "namespace", e.Meta.GetNamespace(), "cluster", e.Meta.GetName()) + log := log.WithValues("predicateEvent", "generic", "namespace", e.Object.GetNamespace(), "cluster", e.Object.GetName()) log.V(4).Info("Cluster did not match expected conditions, will not attempt to map associated AWSMachine.") return false }, @@ -766,40 +765,52 @@ func (r *AWSMachineReconciler) reconcileLBAttachment(machineScope *scope.Machine // AWSClusterToAWSMachines is a handler.ToRequestsFunc to be used to enqeue requests for reconciliation // of AWSMachines. -func (r *AWSMachineReconciler) AWSClusterToAWSMachines(o handler.MapObject) []ctrl.Request { - c := o.Object.(*infrav1.AWSCluster) - log := r.Log.WithValues("objectMapper", "awsClusterToAWSMachine", "namespace", c.Namespace, "awsCluster", c.Name) +func (r *AWSMachineReconciler) AWSClusterToAWSMachines(log logr.Logger) handler.MapFunc { + return func(o client.Object) []ctrl.Request { + c, ok := o.(*infrav1.AWSCluster) + if !ok { + panic(fmt.Sprintf("Expected a AWSCluster but got a %T", o)) + } - // Don't handle deleted AWSClusters - if !c.ObjectMeta.DeletionTimestamp.IsZero() { - log.V(4).Info("AWSCluster has a deletion timestamp, skipping mapping.") - return nil - } + log := log.WithValues("objectMapper", "awsClusterToAWSMachine", "namespace", c.Namespace, "awsCluster", c.Name) - cluster, err := util.GetOwnerCluster(context.TODO(), r.Client, c.ObjectMeta) - switch { - case apierrors.IsNotFound(err) || cluster == nil: - log.V(4).Info("Cluster for AWSCluster not found, skipping mapping.") - return nil - case err != nil: - log.Error(err, "Failed to get owning cluster, skipping mapping.") - return nil - } + // Don't handle deleted AWSClusters + if !c.ObjectMeta.DeletionTimestamp.IsZero() { + log.V(4).Info("AWSCluster has a deletion timestamp, skipping mapping.") + return nil + } + + cluster, err := util.GetOwnerCluster(context.TODO(), r.Client, c.ObjectMeta) + switch { + case apierrors.IsNotFound(err) || cluster == nil: + log.V(4).Info("Cluster for AWSCluster not found, skipping mapping.") + return nil + case err != nil: + log.Error(err, "Failed to get owning cluster, skipping mapping.") + return nil + } - return r.requestsForCluster(log, cluster.Namespace, cluster.Name) + return r.requestsForCluster(log, cluster.Namespace, cluster.Name) + } } -func (r *AWSMachineReconciler) requeueAWSMachinesForUnpausedCluster(o handler.MapObject) []ctrl.Request { - c := o.Object.(*clusterv1.Cluster) - log := r.Log.WithValues("objectMapper", "clusterToAWSMachine", "namespace", c.Namespace, "cluster", c.Name) +func (r *AWSMachineReconciler) requeueAWSMachinesForUnpausedCluster(log logr.Logger) handler.MapFunc { + return func(o client.Object) []ctrl.Request { + c, ok := o.(*clusterv1.Cluster) + if !ok { + panic(fmt.Sprintf("Expected a Cluster but got a %T", o)) + } - // Don't handle deleted clusters - if !c.ObjectMeta.DeletionTimestamp.IsZero() { - log.V(4).Info("Cluster has a deletion timestamp, skipping mapping.") - return nil - } + log := log.WithValues("objectMapper", "clusterToAWSMachine", "namespace", c.Namespace, "cluster", c.Name) - return r.requestsForCluster(log, c.Namespace, c.Name) + // Don't handle deleted clusters + if !c.ObjectMeta.DeletionTimestamp.IsZero() { + log.V(4).Info("Cluster has a deletion timestamp, skipping mapping.") + return nil + } + + return r.requestsForCluster(log, c.Namespace, c.Name) + } } func (r *AWSMachineReconciler) requestsForCluster(log logr.Logger, namespace, name string) []ctrl.Request { @@ -887,7 +898,7 @@ func (r *AWSMachineReconciler) getInfraCluster(ctx context.Context, log logr.Log return clusterScope, nil } -func (r *AWSMachineReconciler) indexAWSMachineByInstanceID(o runtime.Object) []string { +func (r *AWSMachineReconciler) indexAWSMachineByInstanceID(o client.Object) []string { awsMachine, ok := o.(*infrav1.AWSMachine) if !ok { r.Log.Error(errors.New("incorrect type"), "expected an AWSMachine", "type", fmt.Sprintf("%T", o)) diff --git a/controllers/awsmachine_controller_test.go b/controllers/awsmachine_controller_test.go index 8db222c8d7..22c2f35cf7 100644 --- a/controllers/awsmachine_controller_test.go +++ b/controllers/awsmachine_controller_test.go @@ -29,17 +29,16 @@ import ( "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/tools/record" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" "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/v1alpha3" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" "sigs.k8s.io/cluster-api/controllers/noderefutil" capierrors "sigs.k8s.io/cluster-api/errors" "sigs.k8s.io/cluster-api/util/conditions" @@ -90,15 +89,22 @@ var _ = Describe("AWSMachineReconciler", func() { }, } + client := fake.NewClientBuilder().WithObjects(awsMachine, secret).Build() ms, err = scope.NewMachineScope( scope.MachineScopeParams{ - Client: fake.NewFakeClient([]runtime.Object{awsMachine, secret}...), + Client: client, Cluster: &clusterv1.Cluster{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test", + }, Status: clusterv1.ClusterStatus{ InfrastructureReady: true, }, }, Machine: &clusterv1.Machine{ + ObjectMeta: metav1.ObjectMeta{ + Name: "test", + }, Spec: clusterv1.MachineSpec{ Bootstrap: clusterv1.Bootstrap{ DataSecretName: pointer.StringPtr("bootstrap-data"), @@ -113,18 +119,13 @@ var _ = Describe("AWSMachineReconciler", func() { cs, err = scope.NewClusterScope( scope.ClusterScopeParams{ + Client: fake.NewClientBuilder().WithObjects(awsMachine, secret).Build(), Cluster: &clusterv1.Cluster{}, - AWSCluster: &infrav1.AWSCluster{}, + AWSCluster: &infrav1.AWSCluster{ObjectMeta: metav1.ObjectMeta{Name: "test"}}, }, ) Expect(err).To(BeNil()) - client := fake.NewFakeClient() - ctx := context.TODO() - client.Create(ctx, awsMachine) - client.Create(ctx, secret) - client.Create(ctx, secret) - ms, err = scope.NewMachineScope( scope.MachineScopeParams{ Client: client, diff --git a/controllers/awsmachine_controller_unit_test.go b/controllers/awsmachine_controller_unit_test.go index 3cd174ae33..9b838da601 100644 --- a/controllers/awsmachine_controller_unit_test.go +++ b/controllers/awsmachine_controller_unit_test.go @@ -25,9 +25,8 @@ import ( v1 "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/v1alpha3" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" - "sigs.k8s.io/controller-runtime/pkg/handler" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" ) func newMachine(clusterName, machineName string) *clusterv1.Machine { @@ -76,8 +75,7 @@ func TestAWSMachineReconciler_AWSClusterToAWSMachines(t *testing.T) { Log: klogr.New(), } - g.Expect(reconciler.AWSClusterToAWSMachines(handler.MapObject{ - Object: &infrav1.AWSCluster{ + requests := reconciler.AWSClusterToAWSMachines(klogr.New())(&infrav1.AWSCluster{ ObjectMeta: metav1.ObjectMeta{ Name: clusterName, Namespace: "default", @@ -89,6 +87,8 @@ func TestAWSMachineReconciler_AWSClusterToAWSMachines(t *testing.T) { }, }, }, - }, - })).Should(HaveLen(2)) + }) + if len(requests) != 2 { + t.Fatalf("Expected 2 but found %d requests", len(requests)) + } } diff --git a/controllers/awsmachine_security_groups.go b/controllers/awsmachine_security_groups.go index 6b5488da2b..48699e2b1d 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/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" "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 6ef017410a..e77a92968b 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/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" service "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services" ) diff --git a/controllers/helpers.go b/controllers/helpers.go deleted file mode 100644 index 749175c486..0000000000 --- a/controllers/helpers.go +++ /dev/null @@ -1,56 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package controllers - -import ( - "strings" - - "github.com/go-logr/logr" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - clusterutil "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/controller-runtime/pkg/event" - "sigs.k8s.io/controller-runtime/pkg/predicate" -) - -func PausedPredicates(logger logr.Logger) predicate.Funcs { - return predicate.Funcs{ - UpdateFunc: func(e event.UpdateEvent) bool { - return processIfUnpaused(logger.WithValues("predicate", "updateEvent"), e.ObjectNew, e.MetaNew) - }, - CreateFunc: func(e event.CreateEvent) bool { - return processIfUnpaused(logger.WithValues("predicate", "createEvent"), e.Object, e.Meta) - }, - DeleteFunc: func(e event.DeleteEvent) bool { - return processIfUnpaused(logger.WithValues("predicate", "deleteEvent"), e.Object, e.Meta) - }, - GenericFunc: func(e event.GenericEvent) bool { - return processIfUnpaused(logger.WithValues("predicate", "genericEvent"), e.Object, e.Meta) - }, - } -} - -func processIfUnpaused(logger logr.Logger, obj runtime.Object, meta metav1.Object) bool { - kind := strings.ToLower(obj.GetObjectKind().GroupVersionKind().Kind) - log := logger.WithValues("namespace", meta.GetNamespace(), kind, meta.GetName()) - if clusterutil.HasPausedAnnotation(meta) { - log.V(4).Info("Resource is paused, will not attempt to map resource") - return false - } - log.V(4).Info("Resource is not paused, will attempt to map resource") - return true -} diff --git a/controllers/suite_test.go b/controllers/suite_test.go index 427207efc3..d80a8983ce 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -27,9 +27,10 @@ import ( utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" "sigs.k8s.io/cluster-api-provider-aws/test/helpers" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" // +kubebuilder:scaffold:imports ) @@ -39,6 +40,7 @@ import ( var ( testEnv *helpers.TestEnvironment + ctx = ctrl.SetupSignalHandler() ) func TestAPIs(t *testing.T) { @@ -83,7 +85,7 @@ func setup() { } go func() { fmt.Println("Starting the manager") - if err := testEnv.StartManager(); err != nil { + if err := testEnv.StartManager(ctx); err != nil { panic(fmt.Sprintf("Failed to start the envtest manager: %v", err)) } }() diff --git a/controlplane/eks/PROJECT b/controlplane/eks/PROJECT index 98d0667bb5..3b74613f53 100644 --- a/controlplane/eks/PROJECT +++ b/controlplane/eks/PROJECT @@ -4,4 +4,7 @@ resources: - group: controlplane kind: AWSManagedControlPlane version: v1alpha3 +- group: controlplane + kind: AWSManagedControlPlane + version: v1alpha4 version: "2" diff --git a/controlplane/eks/api/v1alpha3/awsmanagedcontrolplane_types.go b/controlplane/eks/api/v1alpha3/awsmanagedcontrolplane_types.go index 6c2a978c1f..a0fd1b967f 100644 --- a/controlplane/eks/api/v1alpha3/awsmanagedcontrolplane_types.go +++ b/controlplane/eks/api/v1alpha3/awsmanagedcontrolplane_types.go @@ -231,7 +231,6 @@ type AWSManagedControlPlaneStatus struct { // +kubebuilder:object:root=true // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsmanagedcontrolplanes,shortName=awsmcp,scope=Namespaced,categories=cluster-api -// +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" diff --git a/controlplane/eks/api/v1alpha3/awsmanagedcontrolplane_webhook.go b/controlplane/eks/api/v1alpha3/awsmanagedcontrolplane_webhook.go deleted file mode 100644 index ca2056f4d0..0000000000 --- a/controlplane/eks/api/v1alpha3/awsmanagedcontrolplane_webhook.go +++ /dev/null @@ -1,350 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - "fmt" - "net" - - "github.com/apparentlymart/go-cidr/cidr" - "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" - "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/v1alpha3" - "sigs.k8s.io/cluster-api-provider-aws/pkg/eks" - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -const ( - minAddonVersion = "v1.18.0" - maxClusterNameLength = 100 -) - -// log is for logging in this package. -var mcpLog = logf.Log.WithName("awsmanagedcontrolplane-resource") - -const ( - cidrSizeMax = 65536 - cidrSizeMin = 16 - vpcCniAddon = "vpc-cni" -) - -// SetupWebhookWithManager will setup the webhooks for the AWSManagedControlPlane -func (r *AWSManagedControlPlane) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-controlplane-cluster-x-k8s-io-v1alpha3-awsmanagedcontrolplane,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=controlplane.cluster.x-k8s.io,resources=awsmanagedcontrolplanes,versions=v1alpha3,name=validation.awsmanagedcontrolplanes.controlplane.cluster.x-k8s.io,sideEffects=None -// +kubebuilder:webhook:verbs=create;update,path=/mutate-controlplane-cluster-x-k8s-io-v1alpha3-awsmanagedcontrolplane,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=controlplane.cluster.x-k8s.io,resources=awsmanagedcontrolplanes,versions=v1alpha3,name=default.awsmanagedcontrolplanes.controlplane.cluster.x-k8s.io,sideEffects=None - -var _ webhook.Defaulter = &AWSManagedControlPlane{} -var _ webhook.Validator = &AWSManagedControlPlane{} - -func parseEKSVersion(raw string) (*version.Version, error) { - v, err := version.ParseGeneric(raw) - if err != nil { - return nil, err - } - return version.MustParseGeneric(fmt.Sprintf("%d.%d", v.Major(), v.Minor())), nil -} - -func normalizeVersion(raw string) (string, error) { - // Normalize version (i.e. remove patch, add "v" prefix) if necessary - eksV, err := parseEKSVersion(raw) - if err != nil { - return "", err - } - return fmt.Sprintf("v%d.%d", eksV.Major(), eksV.Minor()), nil -} - -// ValidateCreate will do any extra validation when creating a AWSManagedControlPlane -func (r *AWSManagedControlPlane) ValidateCreate() error { - mcpLog.Info("AWSManagedControlPlane validate create", "name", r.Name) - - var allErrs field.ErrorList - - if r.Spec.EKSClusterName == "" { - allErrs = append(allErrs, field.Required(field.NewPath("spec.eksClusterName"), "eksClusterName is required")) - } - - allErrs = append(allErrs, r.validateEKSVersion(nil)...) - allErrs = append(allErrs, r.Spec.Bastion.Validate()...) - allErrs = append(allErrs, r.validateIAMAuthConfig()...) - allErrs = append(allErrs, r.validateSecondaryCIDR()...) - allErrs = append(allErrs, r.validateEKSAddons()...) - allErrs = append(allErrs, r.validateDisableVPCCNI()...) - - if len(allErrs) == 0 { - return nil - } - - return apierrors.NewInvalid( - r.GroupVersionKind().GroupKind(), - r.Name, - allErrs, - ) -} - -// ValidateUpdate will do any extra validation when updating a AWSManagedControlPlane -func (r *AWSManagedControlPlane) ValidateUpdate(old runtime.Object) error { - mcpLog.Info("AWSManagedControlPlane validate update", "name", r.Name) - oldAWSManagedControlplane, ok := old.(*AWSManagedControlPlane) - if !ok { - return apierrors.NewInvalid(GroupVersion.WithKind("AWSManagedControlPlane").GroupKind(), r.Name, field.ErrorList{ - field.InternalError(nil, errors.New("failed to convert old AWSManagedControlPlane to object")), - }) - } - - var allErrs field.ErrorList - allErrs = append(allErrs, r.validateEKSClusterName()...) - allErrs = append(allErrs, r.validateEKSClusterNameSame(oldAWSManagedControlplane)...) - allErrs = append(allErrs, r.validateEKSVersion(oldAWSManagedControlplane)...) - allErrs = append(allErrs, r.Spec.Bastion.Validate()...) - allErrs = append(allErrs, r.validateIAMAuthConfig()...) - allErrs = append(allErrs, r.validateSecondaryCIDR()...) - allErrs = append(allErrs, r.validateEKSAddons()...) - allErrs = append(allErrs, r.validateDisableVPCCNI()...) - - if r.Spec.Region != oldAWSManagedControlplane.Spec.Region { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "region"), r.Spec.Region, "field is immutable"), - ) - } - - // If a identityRef is already set, do not allow removal of it. - if oldAWSManagedControlplane.Spec.IdentityRef != nil && r.Spec.IdentityRef == nil { - allErrs = append(allErrs, - field.Invalid(field.NewPath("spec", "identityRef"), - r.Spec.IdentityRef, "field cannot be set to nil"), - ) - } - - if len(allErrs) == 0 { - return nil - } - - return apierrors.NewInvalid( - r.GroupVersionKind().GroupKind(), - r.Name, - allErrs, - ) -} - -// ValidateDelete allows you to add any extra validation when deleting -func (r *AWSManagedControlPlane) ValidateDelete() error { - mcpLog.Info("AWSManagedControlPlane validate delete", "name", r.Name) - - return nil -} - -func (r *AWSManagedControlPlane) validateEKSClusterName() field.ErrorList { - var allErrs field.ErrorList - - if r.Spec.EKSClusterName == "" { - allErrs = append(allErrs, field.Required(field.NewPath("spec.eksClusterName"), "eksClusterName is required")) - } - - return allErrs -} - -func (r *AWSManagedControlPlane) validateEKSClusterNameSame(old *AWSManagedControlPlane) field.ErrorList { - var allErrs field.ErrorList - - if r.Spec.EKSClusterName != old.Spec.EKSClusterName { - allErrs = append(allErrs, field.Invalid(field.NewPath("spec.eksClusterName"), r.Spec.EKSClusterName, "eksClusterName is different to current cluster name")) - } - - return allErrs -} - -func (r *AWSManagedControlPlane) validateEKSVersion(old *AWSManagedControlPlane) field.ErrorList { - path := field.NewPath("spec.version") - var allErrs field.ErrorList - - if r.Spec.Version == nil { - return allErrs - } - - v, err := parseEKSVersion(*r.Spec.Version) - if err != nil { - allErrs = append(allErrs, field.Invalid(path, *r.Spec.Version, err.Error())) - } - - if old != nil { - oldV, err := parseEKSVersion(*old.Spec.Version) - if err == nil && (v.Major() < oldV.Major() || v.Minor() < oldV.Minor()) { - allErrs = append(allErrs, field.Invalid(path, *r.Spec.Version, "new version less than old version")) - } - } - - return allErrs -} - -func (r *AWSManagedControlPlane) validateEKSAddons() field.ErrorList { - var allErrs field.ErrorList - - if r.Spec.Addons == nil || len(*r.Spec.Addons) == 0 { - return allErrs - } - - path := field.NewPath("spec.version") - v, err := parseEKSVersion(*r.Spec.Version) - if err != nil { - allErrs = append(allErrs, field.Invalid(path, *r.Spec.Version, err.Error())) - } - - minVersion, _ := version.ParseSemantic(minAddonVersion) - - addonsPath := field.NewPath("spec.addons") - - if v.LessThan(minVersion) { - message := fmt.Sprintf("addons requires Kubernetes %s or greater", minAddonVersion) - allErrs = append(allErrs, field.Invalid(addonsPath, *r.Spec.Version, message)) - } - - return allErrs -} - -func (r *AWSManagedControlPlane) validateIAMAuthConfig() field.ErrorList { - var allErrs field.ErrorList - - parentPath := field.NewPath("spec.iamAuthenticatorConfig") - - cfg := r.Spec.IAMAuthenticatorConfig - if cfg == nil { - return allErrs - } - - for i, userMapping := range cfg.UserMappings { - usersPathName := fmt.Sprintf("mapUsers[%d]", i) - usersPath := parentPath.Child(usersPathName) - errs := userMapping.Validate() - for _, validErr := range errs { - allErrs = append(allErrs, field.Invalid(usersPath, userMapping, validErr.Error())) - } - } - - for i, roleMapping := range cfg.RoleMappings { - rolePathName := fmt.Sprintf("mapRoles[%d]", i) - rolePath := parentPath.Child(rolePathName) - errs := roleMapping.Validate() - for _, validErr := range errs { - allErrs = append(allErrs, field.Invalid(rolePath, roleMapping, validErr.Error())) - } - } - - return allErrs -} - -func (r *AWSManagedControlPlane) validateSecondaryCIDR() field.ErrorList { - var allErrs field.ErrorList - if r.Spec.SecondaryCidrBlock != nil { - cidrField := field.NewPath("spec", "secondaryCidrBlock") - _, validRange1, _ := net.ParseCIDR("100.64.0.0/10") - _, validRange2, _ := net.ParseCIDR("198.19.0.0/16") - - _, ipv4Net, err := net.ParseCIDR(*r.Spec.SecondaryCidrBlock) - if err != nil { - allErrs = append(allErrs, field.Invalid(cidrField, *r.Spec.SecondaryCidrBlock, "must be valid CIDR range")) - return allErrs - } - - cidrSize := cidr.AddressCount(ipv4Net) - if cidrSize > cidrSizeMax || cidrSize < cidrSizeMin { - allErrs = append(allErrs, field.Invalid(cidrField, *r.Spec.SecondaryCidrBlock, "CIDR block sizes must be between a /16 netmask and /28 netmask")) - } - - start, end := cidr.AddressRange(ipv4Net) - if (!validRange1.Contains(start) || !validRange1.Contains(end)) && (!validRange2.Contains(start) || !validRange2.Contains(end)) { - allErrs = append(allErrs, field.Invalid(cidrField, *r.Spec.SecondaryCidrBlock, "must be within the 100.64.0.0/10 or 198.19.0.0/16 range")) - } - } - - if len(allErrs) == 0 { - return nil - } - return allErrs -} - -func (r *AWSManagedControlPlane) validateDisableVPCCNI() field.ErrorList { - var allErrs field.ErrorList - - if r.Spec.DisableVPCCNI { - disableField := field.NewPath("spec", "disableVPCCNI") - - if r.Spec.SecondaryCidrBlock != nil { - allErrs = append(allErrs, field.Invalid(disableField, r.Spec.DisableVPCCNI, "cannot disable vpc cni if a secondary cidr is specified")) - } - - if r.Spec.Addons != nil { - for _, addon := range *r.Spec.Addons { - if addon.Name == vpcCniAddon { - allErrs = append(allErrs, field.Invalid(disableField, r.Spec.DisableVPCCNI, "cannot disable vpc cni if the vpc-cni addon is specified")) - break - } - } - } - } - - if len(allErrs) == 0 { - return nil - } - return allErrs -} - -// Default will set default values for the AWSManagedControlPlane -func (r *AWSManagedControlPlane) Default() { - mcpLog.Info("AWSManagedControlPlane setting defaults", "name", r.Name) - - if r.Spec.EKSClusterName == "" { - mcpLog.Info("EKSClusterName is empty, generating name") - name, err := eks.GenerateEKSName(r.Name, r.Namespace, maxClusterNameLength) - if err != nil { - mcpLog.Error(err, "failed to create EKS cluster name") - return - } - - mcpLog.Info("defaulting EKS cluster name", "cluster-name", name) - r.Spec.EKSClusterName = name - } - - if r.Spec.IdentityRef == nil { - r.Spec.IdentityRef = &infrav1.AWSIdentityReference{ - Kind: infrav1.ControllerIdentityKind, - Name: infrav1.AWSClusterControllerIdentityName, - } - } - - // Normalize version (i.e. remove patch, add "v" prefix) if necessary - if r.Spec.Version != nil { - normalizedV, err := normalizeVersion(*r.Spec.Version) - if err != nil { - mcpLog.Error(err, "couldn't parse version") - return - } - r.Spec.Version = &normalizedV - } - - infrav1.SetDefaults_Bastion(&r.Spec.Bastion) - infrav1.SetDefaults_NetworkSpec(&r.Spec.NetworkSpec) -} diff --git a/controlplane/eks/api/v1alpha3/awsmanagedcontrolplane_webhook_test.go b/controlplane/eks/api/v1alpha3/awsmanagedcontrolplane_webhook_test.go deleted file mode 100644 index 8ab7041cda..0000000000 --- a/controlplane/eks/api/v1alpha3/awsmanagedcontrolplane_webhook_test.go +++ /dev/null @@ -1,519 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - "context" - "strings" - "testing" - - "github.com/aws/aws-sdk-go/aws" - . "github.com/onsi/gomega" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" -) - -var ( - vV1_17_1 = "v1.17.1" - vV1_17 = "v1.17" - vV1_16 = "v1.16" -) - -func TestDefaultingWebhook(t *testing.T) { - defaultTestBastion := infrav1.Bastion{ - AllowedCIDRBlocks: []string{"0.0.0.0/0"}, - } - AZUsageLimit := 3 - defaultVPCSpec := infrav1.VPCSpec{ - AvailabilityZoneUsageLimit: &AZUsageLimit, - AvailabilityZoneSelection: &infrav1.AZSelectionSchemeOrdered, - } - defaultIdentityRef := &infrav1.AWSIdentityReference{ - Kind: infrav1.ControllerIdentityKind, - Name: infrav1.AWSClusterControllerIdentityName, - } - defaultNetworkSpec := infrav1.NetworkSpec{ - VPC: defaultVPCSpec, - CNI: &infrav1.CNISpec{ - CNIIngressRules: []*infrav1.CNIIngressRule{ - { - Description: "bgp (calico)", - Protocol: "tcp", - FromPort: 179, - ToPort: 179, - }, - { - Description: "IP-in-IP (calico)", - Protocol: "4", - FromPort: -1, - ToPort: 65535, - }, - }, - }, - } - - tests := []struct { - name string - resourceName string - resourceNS string - expectHash bool - expect string - spec AWSManagedControlPlaneSpec - expectSpec AWSManagedControlPlaneSpec - }{ - { - name: "less than 100 chars", - resourceName: "cluster1", - resourceNS: "default", - expectHash: false, - expectSpec: AWSManagedControlPlaneSpec{EKSClusterName: "default_cluster1", IdentityRef: defaultIdentityRef, Bastion: defaultTestBastion, NetworkSpec: defaultNetworkSpec, TokenMethod: &EKSTokenMethodIAMAuthenticator}, - }, - { - name: "less than 100 chars, dot in name", - resourceName: "team1.cluster1", - resourceNS: "default", - expectHash: false, - expectSpec: AWSManagedControlPlaneSpec{EKSClusterName: "default_team1_cluster1", IdentityRef: defaultIdentityRef, Bastion: defaultTestBastion, NetworkSpec: defaultNetworkSpec, TokenMethod: &EKSTokenMethodIAMAuthenticator}, - }, - { - name: "more than 100 chars", - resourceName: "abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde", - resourceNS: "default", - expectHash: true, - expectSpec: AWSManagedControlPlaneSpec{EKSClusterName: "capi_", IdentityRef: defaultIdentityRef, Bastion: defaultTestBastion, NetworkSpec: defaultNetworkSpec, TokenMethod: &EKSTokenMethodIAMAuthenticator}, - }, - { - name: "with patch", - resourceName: "cluster1", - resourceNS: "default", - expectHash: false, - spec: AWSManagedControlPlaneSpec{Version: &vV1_17_1}, - expectSpec: AWSManagedControlPlaneSpec{EKSClusterName: "default_cluster1", Version: &vV1_17, IdentityRef: defaultIdentityRef, Bastion: defaultTestBastion, NetworkSpec: defaultNetworkSpec, TokenMethod: &EKSTokenMethodIAMAuthenticator}, - }, - { - name: "with allowed ip on bastion", - resourceName: "cluster1", - resourceNS: "default", - expectHash: false, - spec: AWSManagedControlPlaneSpec{Bastion: infrav1.Bastion{AllowedCIDRBlocks: []string{"100.100.100.100/0"}}}, - expectSpec: AWSManagedControlPlaneSpec{EKSClusterName: "default_cluster1", IdentityRef: defaultIdentityRef, Bastion: infrav1.Bastion{AllowedCIDRBlocks: []string{"100.100.100.100/0"}}, NetworkSpec: defaultNetworkSpec, TokenMethod: &EKSTokenMethodIAMAuthenticator}, - }, - { - name: "with CNI on network", - resourceName: "cluster1", - resourceNS: "default", - expectHash: false, - spec: AWSManagedControlPlaneSpec{NetworkSpec: infrav1.NetworkSpec{CNI: &infrav1.CNISpec{}}}, - expectSpec: AWSManagedControlPlaneSpec{EKSClusterName: "default_cluster1", IdentityRef: defaultIdentityRef, Bastion: defaultTestBastion, NetworkSpec: infrav1.NetworkSpec{CNI: &infrav1.CNISpec{}, VPC: defaultVPCSpec}, TokenMethod: &EKSTokenMethodIAMAuthenticator}, - }, - { - name: "secondary CIDR", - resourceName: "cluster1", - resourceNS: "default", - expectHash: false, - expectSpec: AWSManagedControlPlaneSpec{EKSClusterName: "default_cluster1", IdentityRef: defaultIdentityRef, Bastion: defaultTestBastion, NetworkSpec: defaultNetworkSpec, SecondaryCidrBlock: nil, TokenMethod: &EKSTokenMethodIAMAuthenticator}, - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - ctx := context.TODO() - g := NewWithT(t) - - mcp := &AWSManagedControlPlane{ - ObjectMeta: metav1.ObjectMeta{ - Name: tc.resourceName, - Namespace: tc.resourceNS, - }, - } - mcp.Spec = tc.spec - - g.Expect(testEnv.Create(ctx, mcp)).To(Succeed()) - - defer func() { - testEnv.Delete(ctx, mcp) - }() - - g.Expect(mcp.Spec.EKSClusterName).ToNot(BeEmpty()) - - if tc.expectHash { - g.Expect(strings.HasPrefix(mcp.Spec.EKSClusterName, "capa_")).To(BeTrue()) - // We don't care about the exact name - tc.expectSpec.EKSClusterName = mcp.Spec.EKSClusterName - } - g.Expect(mcp.Spec).To(Equal(tc.expectSpec)) - }) - } -} - -func TestWebhookCreate(t *testing.T) { - tests := []struct { - name string - eksClusterName string - expectError bool - eksVersion string - hasAddon bool - disableVPCCNI bool - secondaryCidr *string - }{ - { - name: "ekscluster specified", - eksClusterName: "default_cluster1", - expectError: false, - hasAddon: false, - disableVPCCNI: false, - }, - { - name: "ekscluster NOT specified", - eksClusterName: "", - expectError: false, - hasAddon: false, - disableVPCCNI: false, - }, - { - name: "invalid version", - eksClusterName: "default_cluster1", - eksVersion: "v1.x17", - expectError: true, - hasAddon: false, - disableVPCCNI: false, - }, - { - name: "addon with allowed k8s version", - eksClusterName: "default_cluster1", - eksVersion: "v1.18", - expectError: false, - hasAddon: true, - disableVPCCNI: false, - }, - { - name: "addon with not allowed k8s version", - eksClusterName: "default_cluster1", - eksVersion: "v1.17", - expectError: true, - hasAddon: true, - disableVPCCNI: false, - }, - { - name: "disable vpc cni allowed with no addon or secondary cidr", - eksClusterName: "default_cluster1", - eksVersion: "v1.19", - expectError: false, - hasAddon: false, - disableVPCCNI: true, - }, - { - name: "disable vpc cni not allowed with vpc cni addon", - eksClusterName: "default_cluster1", - eksVersion: "v1.19", - expectError: true, - hasAddon: true, - disableVPCCNI: true, - }, - { - name: "disable vpc cni not allowed with secondary", - eksClusterName: "default_cluster1", - eksVersion: "v1.19", - expectError: true, - hasAddon: false, - disableVPCCNI: true, - secondaryCidr: aws.String("100.64.0.0/10"), - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - ctx := context.TODO() - g := NewWithT(t) - - mcp := &AWSManagedControlPlane{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "mcp-", - Namespace: "default", - }, - Spec: AWSManagedControlPlaneSpec{ - EKSClusterName: tc.eksClusterName, - DisableVPCCNI: tc.disableVPCCNI, - }, - } - if tc.eksVersion != "" { - mcp.Spec.Version = &tc.eksVersion - } - if tc.hasAddon { - testAddons := []Addon{ - { - Name: vpcCniAddon, - Version: "v1.0.0", - }, - } - mcp.Spec.Addons = &testAddons - } - if tc.secondaryCidr != nil { - mcp.Spec.SecondaryCidrBlock = tc.secondaryCidr - } - - err := testEnv.Create(ctx, mcp) - - if tc.expectError { - g.Expect(err).ToNot(BeNil()) - } else { - g.Expect(err).To(BeNil()) - } - }) - } -} - -func TestWebhookUpdate(t *testing.T) { - tests := []struct { - name string - oldClusterSpec AWSManagedControlPlaneSpec - newClusterSpec AWSManagedControlPlaneSpec - oldClusterName string - newClusterName string - oldEksVersion string - newEksVersion string - expectError bool - }{ - { - name: "ekscluster specified, same cluster names", - oldClusterSpec: AWSManagedControlPlaneSpec{ - EKSClusterName: "default_cluster1", - }, - newClusterSpec: AWSManagedControlPlaneSpec{ - EKSClusterName: "default_cluster1", - }, - expectError: false, - }, - { - name: "ekscluster specified, different cluster names", - oldClusterSpec: AWSManagedControlPlaneSpec{ - EKSClusterName: "default_cluster1", - }, - newClusterSpec: AWSManagedControlPlaneSpec{ - EKSClusterName: "default_cluster2", - }, - expectError: true, - }, - { - name: "old ekscluster specified, no new cluster name", - oldClusterSpec: AWSManagedControlPlaneSpec{ - EKSClusterName: "default_cluster1", - }, - newClusterSpec: AWSManagedControlPlaneSpec{ - EKSClusterName: "", - }, - expectError: true, - }, - { - name: "older version", - oldClusterSpec: AWSManagedControlPlaneSpec{ - EKSClusterName: "default_cluster1", - Version: &vV1_17, - }, - newClusterSpec: AWSManagedControlPlaneSpec{ - EKSClusterName: "default_cluster1", - Version: &vV1_16, - }, - expectError: true, - }, - { - name: "same version", - oldClusterSpec: AWSManagedControlPlaneSpec{ - EKSClusterName: "default_cluster1", - Version: &vV1_17, - }, - newClusterSpec: AWSManagedControlPlaneSpec{ - EKSClusterName: "default_cluster1", - Version: &vV1_17, - }, - expectError: false, - }, - { - name: "newer version", - oldClusterSpec: AWSManagedControlPlaneSpec{ - EKSClusterName: "default_cluster1", - Version: &vV1_16, - }, - newClusterSpec: AWSManagedControlPlaneSpec{ - EKSClusterName: "default_cluster1", - Version: &vV1_17, - }, - expectError: false, - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - g := NewWithT(t) - ctx := context.TODO() - mcp := &AWSManagedControlPlane{ - ObjectMeta: metav1.ObjectMeta{ - GenerateName: "mcp-", - Namespace: "default", - }, - Spec: tc.oldClusterSpec, - } - g.Expect(testEnv.Create(ctx, mcp)).To(Succeed()) - mcp.Spec = tc.newClusterSpec - err := testEnv.Update(ctx, mcp) - - if tc.expectError { - g.Expect(err).ToNot(BeNil()) - } else { - g.Expect(err).To(BeNil()) - } - }) - } -} - -func TestValidatingWebhookCreate_SecondaryCidr(t *testing.T) { - tests := []struct { - name string - expectError bool - cidrRange string - }{ - { - name: "complete range 1", - cidrRange: "100.64.0.0/10", - expectError: true, - }, - { - name: "complete range 2", - cidrRange: "198.19.0.0/16", - expectError: false, - }, - { - name: "subrange", - cidrRange: "100.67.0.0/16", - expectError: false, - }, - { - name: "invalid value", - cidrRange: "not a cidr range", - expectError: true, - }, - { - name: "unsupported range", - cidrRange: "10.0.0.1/20", - expectError: true, - }, - { - name: "too large", - cidrRange: "100.64.0.0/15", - expectError: true, - }, - { - name: "too small", - cidrRange: "100.64.0.0/29", - expectError: true, - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - g := NewWithT(t) - - mcp := &AWSManagedControlPlane{ - Spec: AWSManagedControlPlaneSpec{ - EKSClusterName: "default_cluster1", - }, - } - if tc.cidrRange != "" { - mcp.Spec.SecondaryCidrBlock = &tc.cidrRange - } - err := mcp.ValidateCreate() - - if tc.expectError { - g.Expect(err).ToNot(BeNil()) - } else { - g.Expect(err).To(BeNil()) - } - }) - } -} - -func TestValidatingWebhookUpdate_SecondaryCidr(t *testing.T) { - tests := []struct { - name string - cidrRange string - expectError bool - }{ - { - name: "complete range 1", - cidrRange: "100.64.0.0/10", - expectError: true, - }, - { - name: "complete range 2", - cidrRange: "198.19.0.0/16", - expectError: false, - }, - { - name: "subrange", - cidrRange: "100.67.0.0/16", - expectError: false, - }, - { - name: "invalid value", - cidrRange: "not a cidr range", - expectError: true, - }, - { - name: "unsupported range", - cidrRange: "10.0.0.1/20", - expectError: true, - }, - { - name: "too large", - cidrRange: "100.64.0.0/15", - expectError: true, - }, - { - name: "too small", - cidrRange: "100.64.0.0/29", - expectError: true, - }, - } - - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - g := NewWithT(t) - - newMCP := &AWSManagedControlPlane{ - Spec: AWSManagedControlPlaneSpec{ - EKSClusterName: "default_cluster1", - SecondaryCidrBlock: &tc.cidrRange, - }, - } - oldMCP := &AWSManagedControlPlane{ - Spec: AWSManagedControlPlaneSpec{ - EKSClusterName: "default_cluster1", - SecondaryCidrBlock: nil, - }, - } - - err := newMCP.ValidateUpdate(oldMCP) - - if tc.expectError { - g.Expect(err).ToNot(BeNil()) - } else { - g.Expect(err).To(BeNil()) - } - }) - } -} diff --git a/controlplane/eks/api/v1alpha3/conversion.go b/controlplane/eks/api/v1alpha3/conversion.go new file mode 100644 index 0000000000..1f0dad1942 --- /dev/null +++ b/controlplane/eks/api/v1alpha3/conversion.go @@ -0,0 +1,91 @@ +/* +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" + 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" + clusterapiapiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" + clusterapiapiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + "sigs.k8s.io/controller-runtime/pkg/conversion" +) + +func (r *AWSManagedControlPlane) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSManagedControlPlane) + + return Convert_v1alpha3_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane(r, dst, nil) +} + +func (r *AWSManagedControlPlane) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSManagedControlPlane) + + return Convert_v1alpha4_AWSManagedControlPlane_To_v1alpha3_AWSManagedControlPlane(src, r, nil) +} + +func (r *AWSManagedControlPlaneList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSManagedControlPlaneList) + + return Convert_v1alpha3_AWSManagedControlPlaneList_To_v1alpha4_AWSManagedControlPlaneList(r, dst, nil) +} + +func (r *AWSManagedControlPlaneList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSManagedControlPlaneList) + + return Convert_v1alpha4_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_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_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_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_v1alpha3_Network_To_v1alpha4_Network is an autogenerated conversion function. +func Convert_v1alpha3_Network_To_v1alpha4_Network(in *infrav1alpha3.Network, out *infrav1alpha4.Network, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1alpha3_Network_To_v1alpha4_Network(in, out, s) +} + +// Convert_v1alpha4_Network_To_v1alpha3_Network is an autogenerated conversion function. +func Convert_v1alpha4_Network_To_v1alpha3_Network(in *infrav1alpha4.Network, out *infrav1alpha3.Network, s apiconversion.Scope) error { + return infrav1alpha3.Convert_v1alpha4_Network_To_v1alpha3_Network(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_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) +} diff --git a/controlplane/eks/api/v1alpha3/conversion_test.go b/controlplane/eks/api/v1alpha3/conversion_test.go new file mode 100644 index 0000000000..af8cde8610 --- /dev/null +++ b/controlplane/eks/api/v1alpha3/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 v1alpha3 + +import ( + "testing" + + . "github.com/onsi/gomega" + + runtime "k8s.io/apimachinery/pkg/runtime" + v1alpha4 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + 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(v1alpha4.AddToScheme(scheme)).To(Succeed()) + + t.Run("for AWSManagedControlPlane", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1alpha4.AWSManagedControlPlane{}, + Spoke: &AWSManagedControlPlane{}, + })) +} diff --git a/controlplane/eks/api/v1alpha3/doc.go b/controlplane/eks/api/v1alpha3/doc.go index 9d8309030c..81f5a95fff 100644 --- a/controlplane/eks/api/v1alpha3/doc.go +++ b/controlplane/eks/api/v1alpha3/doc.go @@ -14,7 +14,5 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package v1alpha3 contains API Schema definitions for the controlplane v1alpha3 API group -// +gencrdrefdocs:force -// +groupName=controlplane.cluster.x-k8s.io +// +k8s:conversion-gen=sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4 package v1alpha3 diff --git a/controlplane/eks/api/v1alpha3/groupversion_info.go b/controlplane/eks/api/v1alpha3/groupversion_info.go index 3135726e33..9f59d272ad 100644 --- a/controlplane/eks/api/v1alpha3/groupversion_info.go +++ b/controlplane/eks/api/v1alpha3/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/v1alpha3/suite_test.go b/controlplane/eks/api/v1alpha3/suite_test.go deleted file mode 100644 index 170b5536d1..0000000000 --- a/controlplane/eks/api/v1alpha3/suite_test.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - "fmt" - "math/rand" - "os" - "path" - "strconv" - "testing" - - utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/client-go/kubernetes/scheme" - "sigs.k8s.io/cluster-api-provider-aws/test/helpers" -) - -var testEnv *helpers.TestEnvironment - -func TestMain(m *testing.M) { - setup() - code := m.Run() - teardown() - os.Exit(code) -} - -func setup() { - utilruntime.Must(AddToScheme(scheme.Scheme)) - testEnvConfig := helpers.NewTestEnvironmentConfiguration([]string{ - path.Join("controlplane", "eks", "config", "crd", "bases"), - }, - ).WithWebhookConfiguration("managed", path.Join("controlplane", "eks", "config", "webhook", "manifests.yaml")) - var err error - testEnv, err = testEnvConfig.Build() - if err != nil { - panic(err) - } - if err := (&AWSManagedControlPlane{}).SetupWebhookWithManager(testEnv); err != nil { - panic(fmt.Sprintf("Unable to setup AWSManagedControlPlane webhook: %v", err)) - } - go func() { - fmt.Println("Starting the manager") - if err := testEnv.StartManager(); 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)) - } -} - -func randomName() string { - return strconv.FormatInt(rand.Int63(), 10) -} diff --git a/controlplane/eks/api/v1alpha3/zz_generated.conversion.go b/controlplane/eks/api/v1alpha3/zz_generated.conversion.go new file mode 100644 index 0000000000..a5f3f0c0d4 --- /dev/null +++ b/controlplane/eks/api/v1alpha3/zz_generated.conversion.go @@ -0,0 +1,709 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by conversion-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + unsafe "unsafe" + + 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" +) + +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), (*v1alpha4.AWSManagedControlPlane)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane(a.(*AWSManagedControlPlane), b.(*v1alpha4.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) + }); 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) + }); 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) + }); 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) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*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.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) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*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.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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); err != nil { + return err + } + if err := s.AddConversionFunc((*clusterapiproviderawsapiv1alpha3.Network)(nil), (*clusterapiproviderawsapiv1alpha4.Network)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_Network_To_v1alpha4_Network(a.(*clusterapiproviderawsapiv1alpha3.Network), b.(*clusterapiproviderawsapiv1alpha4.Network), 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((*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.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.Network)(nil), (*clusterapiproviderawsapiv1alpha3.Network)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_Network_To_v1alpha3_Network(a.(*clusterapiproviderawsapiv1alpha4.Network), b.(*clusterapiproviderawsapiv1alpha3.Network), scope) + }); err != nil { + return err + } + return nil +} + +func autoConvert_v1alpha3_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane(in *AWSManagedControlPlane, out *v1alpha4.AWSManagedControlPlane, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_AWSManagedControlPlaneSpec_To_v1alpha4_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 { + 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) +} + +func autoConvert_v1alpha4_AWSManagedControlPlane_To_v1alpha3_AWSManagedControlPlane(in *v1alpha4.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 { + return err + } + if err := Convert_v1alpha4_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) +} + +func autoConvert_v1alpha3_AWSManagedControlPlaneList_To_v1alpha4_AWSManagedControlPlaneList(in *AWSManagedControlPlaneList, out *v1alpha4.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)) + for i := range *in { + if err := Convert_v1alpha3_AWSManagedControlPlane_To_v1alpha4_AWSManagedControlPlane(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + 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) +} + +func autoConvert_v1alpha4_AWSManagedControlPlaneList_To_v1alpha3_AWSManagedControlPlaneList(in *v1alpha4.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 { + return err + } + } + } else { + out.Items = nil + } + 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) +} + +func autoConvert_v1alpha3_AWSManagedControlPlaneSpec_To_v1alpha4_AWSManagedControlPlaneSpec(in *AWSManagedControlPlaneSpec, out *v1alpha4.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 { + 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 = (*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 { + return err + } + if err := Convert_v1alpha3_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_v1alpha3_Bastion_To_v1alpha4_Bastion(&in.Bastion, &out.Bastion, s); err != nil { + return err + } + out.TokenMethod = (*v1alpha4.EKSTokenMethod)(unsafe.Pointer(in.TokenMethod)) + out.AssociateOIDCProvider = in.AssociateOIDCProvider + out.Addons = (*[]v1alpha4.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) +} + +func autoConvert_v1alpha4_AWSManagedControlPlaneSpec_To_v1alpha3_AWSManagedControlPlaneSpec(in *v1alpha4.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 { + 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 = *(*clusterapiproviderawsapiv1alpha3.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 { + return err + } + if err := Convert_v1alpha4_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 { + return err + } + out.TokenMethod = (*EKSTokenMethod)(unsafe.Pointer(in.TokenMethod)) + out.AssociateOIDCProvider = in.AssociateOIDCProvider + out.Addons = (*[]Addon)(unsafe.Pointer(in.Addons)) + out.DisableVPCCNI = in.DisableVPCCNI + return nil +} + +// Convert_v1alpha4_AWSManagedControlPlaneSpec_To_v1alpha3_AWSManagedControlPlaneSpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSManagedControlPlaneSpec_To_v1alpha3_AWSManagedControlPlaneSpec(in *v1alpha4.AWSManagedControlPlaneSpec, out *AWSManagedControlPlaneSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSManagedControlPlaneSpec_To_v1alpha3_AWSManagedControlPlaneSpec(in, out, s) +} + +func autoConvert_v1alpha3_AWSManagedControlPlaneStatus_To_v1alpha4_AWSManagedControlPlaneStatus(in *AWSManagedControlPlaneStatus, out *v1alpha4.AWSManagedControlPlaneStatus, s conversion.Scope) error { + if err := Convert_v1alpha3_Network_To_v1alpha4_Network(&in.Network, &out.Network, s); err != nil { + return err + } + out.FailureDomains = *(*apiv1alpha4.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) + out.Bastion = (*clusterapiproviderawsapiv1alpha4.Instance)(unsafe.Pointer(in.Bastion)) + if err := Convert_v1alpha3_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)) + out.Conditions = *(*apiv1alpha4.Conditions)(unsafe.Pointer(&in.Conditions)) + out.Addons = *(*[]*v1alpha4.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) +} + +func autoConvert_v1alpha4_AWSManagedControlPlaneStatus_To_v1alpha3_AWSManagedControlPlaneStatus(in *v1alpha4.AWSManagedControlPlaneStatus, out *AWSManagedControlPlaneStatus, s conversion.Scope) error { + if err := Convert_v1alpha4_Network_To_v1alpha3_Network(&in.Network, &out.Network, s); err != nil { + return err + } + out.FailureDomains = *(*apiv1alpha3.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) + out.Bastion = (*clusterapiproviderawsapiv1alpha3.Instance)(unsafe.Pointer(in.Bastion)) + if err := Convert_v1alpha4_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)) + out.Addons = *(*[]*AddonState)(unsafe.Pointer(&in.Addons)) + return nil +} + +// Convert_v1alpha4_AWSManagedControlPlaneStatus_To_v1alpha3_AWSManagedControlPlaneStatus is an autogenerated conversion function. +func Convert_v1alpha4_AWSManagedControlPlaneStatus_To_v1alpha3_AWSManagedControlPlaneStatus(in *v1alpha4.AWSManagedControlPlaneStatus, out *AWSManagedControlPlaneStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSManagedControlPlaneStatus_To_v1alpha3_AWSManagedControlPlaneStatus(in, out, s) +} + +func autoConvert_v1alpha3_Addon_To_v1alpha4_Addon(in *Addon, out *v1alpha4.Addon, s conversion.Scope) error { + out.Name = in.Name + out.Version = in.Version + out.ConflictResolution = (*v1alpha4.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) +} + +func autoConvert_v1alpha4_Addon_To_v1alpha3_Addon(in *v1alpha4.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_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) +} + +func autoConvert_v1alpha3_AddonIssue_To_v1alpha4_AddonIssue(in *AddonIssue, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_AddonIssue_To_v1alpha3_AddonIssue(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_AddonState_To_v1alpha4_AddonState(in *AddonState, out *v1alpha4.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 = *(*[]*v1alpha4.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) +} + +func autoConvert_v1alpha4_AddonState_To_v1alpha3_AddonState(in *v1alpha4.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_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) +} + +func autoConvert_v1alpha3_ControlPlaneLoggingSpec_To_v1alpha4_ControlPlaneLoggingSpec(in *ControlPlaneLoggingSpec, out *v1alpha4.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_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) +} + +func autoConvert_v1alpha4_ControlPlaneLoggingSpec_To_v1alpha3_ControlPlaneLoggingSpec(in *v1alpha4.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_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) +} + +func autoConvert_v1alpha3_EncryptionConfig_To_v1alpha4_EncryptionConfig(in *EncryptionConfig, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_EncryptionConfig_To_v1alpha3_EncryptionConfig(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_EndpointAccess_To_v1alpha4_EndpointAccess(in *EndpointAccess, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_EndpointAccess_To_v1alpha3_EndpointAccess(in *v1alpha4.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) +} + +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)) + 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) +} + +func autoConvert_v1alpha4_IAMAuthenticatorConfig_To_v1alpha3_IAMAuthenticatorConfig(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_KubernetesMapping_To_v1alpha4_KubernetesMapping(in *KubernetesMapping, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_KubernetesMapping_To_v1alpha3_KubernetesMapping(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_OIDCProviderStatus_To_v1alpha4_OIDCProviderStatus(in *OIDCProviderStatus, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_OIDCProviderStatus_To_v1alpha3_OIDCProviderStatus(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_RoleMapping_To_v1alpha4_RoleMapping(in *RoleMapping, out *v1alpha4.RoleMapping, s conversion.Scope) error { + out.RoleARN = in.RoleARN + if err := Convert_v1alpha3_KubernetesMapping_To_v1alpha4_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) +} + +func autoConvert_v1alpha4_RoleMapping_To_v1alpha3_RoleMapping(in *v1alpha4.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 { + 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) +} + +func autoConvert_v1alpha3_UserMapping_To_v1alpha4_UserMapping(in *UserMapping, out *v1alpha4.UserMapping, s conversion.Scope) error { + out.UserARN = in.UserARN + if err := Convert_v1alpha3_KubernetesMapping_To_v1alpha4_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) +} + +func autoConvert_v1alpha4_UserMapping_To_v1alpha3_UserMapping(in *v1alpha4.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 { + 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) +} diff --git a/controlplane/eks/api/v1alpha3/zz_generated.deepcopy.go b/controlplane/eks/api/v1alpha3/zz_generated.deepcopy.go index 45b3d2886d..e970144b15 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 ( - "k8s.io/apimachinery/pkg/runtime" + 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/controllers/awsmanagedcontrolplane_controller.go b/controlplane/eks/controllers/awsmanagedcontrolplane_controller.go index 54aaada1c6..f3500113db 100644 --- a/controlplane/eks/controllers/awsmanagedcontrolplane_controller.go +++ b/controlplane/eks/controllers/awsmanagedcontrolplane_controller.go @@ -23,12 +23,23 @@ import ( "github.com/go-logr/logr" "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + 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" + "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" + "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2" + "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/eks" + "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/iamauth" + "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" "sigs.k8s.io/cluster-api/util" + "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/predicates" ctrl "sigs.k8s.io/controller-runtime" @@ -38,18 +49,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha3" - "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" - "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/ec2" - "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/eks" - "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/iamauth" - "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/network" - "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/securitygroup" ) const ( @@ -61,26 +60,26 @@ const ( // AWSManagedControlPlaneReconciler reconciles a AWSManagedControlPlane object type AWSManagedControlPlaneReconciler struct { client.Client - Log logr.Logger Recorder record.EventRecorder Endpoints []scope.ServiceEndpoint EnableIAM bool AllowAdditionalRoles bool + WatchFilterValue string } // SetupWithManager is used to setup the controller -func (r *AWSManagedControlPlaneReconciler) SetupWithManager(mgr ctrl.Manager, options controller.Options) error { +func (r *AWSManagedControlPlaneReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error { + log := ctrl.LoggerFrom(ctx) + awsManagedControlPlane := &controlplanev1.AWSManagedControlPlane{} c, err := ctrl.NewControllerManagedBy(mgr). For(awsManagedControlPlane). WithOptions(options). - WithEventFilter(predicates.ResourceNotPaused(r.Log)). + WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(log, r.WatchFilterValue)). Watches( &source.Kind{Type: &infrav1exp.AWSManagedCluster{}}, - &handler.EnqueueRequestsFromMapFunc{ - ToRequests: handler.ToRequestsFunc(r.managedClusterToManagedControlPlane), - }, + handler.EnqueueRequestsFromMapFunc(r.managedClusterToManagedControlPlane(log)), ). Build(r) @@ -90,10 +89,8 @@ func (r *AWSManagedControlPlaneReconciler) SetupWithManager(mgr ctrl.Manager, op if err = c.Watch( &source.Kind{Type: &clusterv1.Cluster{}}, - &handler.EnqueueRequestsFromMapFunc{ - ToRequests: util.ClusterToInfrastructureMapFunc(awsManagedControlPlane.GroupVersionKind()), - }, - predicates.ClusterUnpausedAndInfrastructureReady(r.Log), + handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(awsManagedControlPlane.GroupVersionKind())), + predicates.ClusterUnpausedAndInfrastructureReady(log), ); err != nil { return fmt.Errorf("failed adding a watch for ready clusters: %w", err) } @@ -114,9 +111,8 @@ func (r *AWSManagedControlPlaneReconciler) SetupWithManager(mgr ctrl.Manager, op // +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=awsclusterroleidentities;awsclusterstaticidentities;awsclustercontrolleridentities,verbs=get;list;watch // Reconcile will reconcile AWSManagedControlPlane Resources -func (r *AWSManagedControlPlaneReconciler) Reconcile(req ctrl.Request) (res ctrl.Result, reterr error) { - logger := r.Log.WithValues("namespace", req.Namespace, "eksControlPlane", req.Name) - ctx := context.Background() +func (r *AWSManagedControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res ctrl.Result, reterr error) { + log := ctrl.LoggerFrom(ctx) // Get the control plane instance awsControlPlane := &controlplanev1.AWSManagedControlPlane{} @@ -130,24 +126,21 @@ func (r *AWSManagedControlPlaneReconciler) Reconcile(req ctrl.Request) (res ctrl // Get the cluster cluster, err := util.GetOwnerCluster(ctx, r.Client, awsControlPlane.ObjectMeta) if err != nil { - logger.Error(err, "Failed to retrieve owner Cluster from the API Server") + log.Error(err, "Failed to retrieve owner Cluster from the API Server") return ctrl.Result{}, err } if cluster == nil { - logger.Info("Cluster Controller has not yet set OwnerRef") + log.Info("Cluster Controller has not yet set OwnerRef") return ctrl.Result{}, nil } - if util.IsPaused(cluster, awsControlPlane) { - logger.Info("Reconciliation is paused for this object") + if annotations.IsPaused(cluster, awsControlPlane) { + log.Info("Reconciliation is paused for this object") return ctrl.Result{}, nil } - logger = logger.WithValues("cluster", cluster.Name) - managedScope, err := scope.NewManagedControlPlaneScope(scope.ManagedControlPlaneScopeParams{ Client: r.Client, - Logger: logger, Cluster: cluster, ControlPlane: awsControlPlane, ControllerName: "awsmanagedcontrolplane", @@ -259,20 +252,22 @@ func (r *AWSManagedControlPlaneReconciler) reconcileNormal(ctx context.Context, } func (r *AWSManagedControlPlaneReconciler) reconcileDelete(ctx context.Context, managedScope *scope.ManagedControlPlaneScope) (_ ctrl.Result, reterr error) { + log := ctrl.LoggerFrom(ctx) + managedScope.Info("Reconciling AWSManagedClusterPlane delete") controlPlane := managedScope.ControlPlane numDependencies, err := r.dependencyCount(ctx, managedScope) if err != nil { - r.Log.Error(err, "error getting controlplane dependencies", "namespace", controlPlane.Namespace, "name", controlPlane.Name) + log.Error(err, "error getting controlplane dependencies", "namespace", controlPlane.Namespace, "name", controlPlane.Name) return reconcile.Result{}, err } if numDependencies > 0 { - r.Log.Info("EKS cluster still has dependencies - requeue needed", "dependencyCount", numDependencies) + log.Info("EKS cluster still has dependencies - requeue needed", "dependencyCount", numDependencies) return reconcile.Result{RequeueAfter: deleteRequeueAfter}, nil } - r.Log.Info("EKS cluster has no dependencies") + log.Info("EKS cluster has no dependencies") ekssvc := eks.NewService(managedScope) ec2svc := ec2.NewService(managedScope) @@ -280,22 +275,22 @@ func (r *AWSManagedControlPlaneReconciler) reconcileDelete(ctx context.Context, sgService := securitygroup.NewService(managedScope) if err := ekssvc.DeleteControlPlane(); err != nil { - r.Log.Error(err, "error deleting EKS cluster for EKS control plane", "namespace", controlPlane.Namespace, "name", controlPlane.Name) + log.Error(err, "error deleting EKS cluster for EKS control plane", "namespace", controlPlane.Namespace, "name", controlPlane.Name) return reconcile.Result{}, err } if err := ec2svc.DeleteBastion(); err != nil { - r.Log.Error(err, "error deleting bastion for AWSManagedControlPlane", "namespace", controlPlane.Namespace, "name", controlPlane.Name) + log.Error(err, "error deleting bastion for AWSManagedControlPlane", "namespace", controlPlane.Namespace, "name", controlPlane.Name) return reconcile.Result{}, err } if err := sgService.DeleteSecurityGroups(); err != nil { - r.Log.Error(err, "error deleting general security groups for AWSManagedControlPlane", "namespace", controlPlane.Namespace, "name", controlPlane.Name) + log.Error(err, "error deleting general security groups for AWSManagedControlPlane", "namespace", controlPlane.Namespace, "name", controlPlane.Name) return reconcile.Result{}, err } if err := networkSvc.DeleteNetwork(); err != nil { - r.Log.Error(err, "error deleting network for AWSManagedControlPlane", "namespace", controlPlane.Namespace, "name", controlPlane.Name) + log.Error(err, "error deleting network for AWSManagedControlPlane", "namespace", controlPlane.Namespace, "name", controlPlane.Name) return reconcile.Result{}, err } @@ -306,15 +301,13 @@ func (r *AWSManagedControlPlaneReconciler) reconcileDelete(ctx context.Context, // ClusterToAWSManagedControlPlane is a handler.ToRequestsFunc to be used to enqueue requests for reconciliation // for AWSManagedControlPlane based on updates to a Cluster. -func (r *AWSManagedControlPlaneReconciler) ClusterToAWSManagedControlPlane(o handler.MapObject) []ctrl.Request { - c, ok := o.Object.(*clusterv1.Cluster) +func (r *AWSManagedControlPlaneReconciler) ClusterToAWSManagedControlPlane(o client.Object) []ctrl.Request { + c, ok := o.(*clusterv1.Cluster) if !ok { - r.Log.Error(nil, fmt.Sprintf("Expected a Cluster but got a %T", o.Object)) - return nil + panic(fmt.Sprintf("Expected a Cluster but got a %T", o)) } if !c.ObjectMeta.DeletionTimestamp.IsZero() { - r.Log.V(4).Info("Cluster has a deletion timestamp, skipping mapping") return nil } @@ -326,51 +319,54 @@ func (r *AWSManagedControlPlaneReconciler) ClusterToAWSManagedControlPlane(o han return nil } -func (r *AWSManagedControlPlaneReconciler) managedClusterToManagedControlPlane(o handler.MapObject) []ctrl.Request { - ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) - defer cancel() +func (r *AWSManagedControlPlaneReconciler) managedClusterToManagedControlPlane(log logr.Logger) handler.MapFunc { + return func(o client.Object) []ctrl.Request { + ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) + defer cancel() - awsManagedCluster, ok := o.Object.(*infrav1exp.AWSManagedCluster) - if !ok { - r.Log.Error(nil, fmt.Sprintf("Expected a AWSManagedCluster but got a %T", o.Object)) - return nil - } + awsManagedCluster, ok := o.(*infrav1exp.AWSManagedCluster) + if !ok { + panic(fmt.Sprintf("Expected a AWSManagedCluster but got a %T", o)) + } - if !awsManagedCluster.ObjectMeta.DeletionTimestamp.IsZero() { - r.Log.V(4).Info("AWSManagedCluster has a deletion timestamp, skipping mapping") - return nil - } + if !awsManagedCluster.ObjectMeta.DeletionTimestamp.IsZero() { + log.V(4).Info("AWSManagedCluster has a deletion timestamp, skipping mapping") + return nil + } - cluster, err := util.GetOwnerCluster(ctx, r.Client, awsManagedCluster.ObjectMeta) - if err != nil { - r.Log.Error(err, "failed to get owning cluster") - return nil - } - if cluster == nil { - r.Log.V(4).Info("Owning cluster not set on AWSManagedCluster, skipping mapping") - return nil - } + cluster, err := util.GetOwnerCluster(ctx, r.Client, awsManagedCluster.ObjectMeta) + if err != nil { + log.Error(err, "failed to get owning cluster") + return nil + } + if cluster == nil { + log.V(4).Info("Owning cluster not set on AWSManagedCluster, skipping mapping") + return nil + } - controlPlaneRef := cluster.Spec.ControlPlaneRef - if controlPlaneRef == nil || controlPlaneRef.Kind != "AWSManagedControlPlane" { - r.Log.V(4).Info("ControlPlaneRef is nil or not AWSManagedControlPlane, skipping mapping") - return nil - } + controlPlaneRef := cluster.Spec.ControlPlaneRef + if controlPlaneRef == nil || controlPlaneRef.Kind != "AWSManagedControlPlane" { + log.V(4).Info("ControlPlaneRef is nil or not AWSManagedControlPlane, skipping mapping") + return nil + } - return []ctrl.Request{ - { - NamespacedName: types.NamespacedName{ - Name: controlPlaneRef.Name, - Namespace: controlPlaneRef.Namespace, + return []ctrl.Request{ + { + NamespacedName: types.NamespacedName{ + Name: controlPlaneRef.Name, + Namespace: controlPlaneRef.Namespace, + }, }, - }, + } } } func (r *AWSManagedControlPlaneReconciler) dependencyCount(ctx context.Context, managedScope *scope.ManagedControlPlaneScope) (int, error) { + log := ctrl.LoggerFrom(ctx) + clusterName := managedScope.Name() namespace := managedScope.Namespace() - r.Log.Info("looking for EKS cluster dependencies", "cluster", clusterName, "namespace", namespace) + log.Info("looking for EKS cluster dependencies", "cluster", clusterName, "namespace", namespace) listOptions := []client.ListOption{ client.InNamespace(namespace), @@ -383,7 +379,7 @@ func (r *AWSManagedControlPlaneReconciler) dependencyCount(ctx context.Context, if err := r.Client.List(ctx, machines, listOptions...); err != nil { return dependencies, fmt.Errorf("failed to list machines for cluster %s/%s: %w", namespace, clusterName, err) } - r.Log.V(2).Info("tested for AWSMachine dependencies", "count", len(machines.Items)) + log.V(2).Info("tested for AWSMachine dependencies", "count", len(machines.Items)) dependencies += len(machines.Items) if feature.Gates.Enabled(feature.MachinePool) { @@ -391,14 +387,14 @@ func (r *AWSManagedControlPlaneReconciler) dependencyCount(ctx context.Context, 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) } - r.Log.V(2).Info("tested for AWSManagedMachinePool dependencies", "count", len(managedMachinePools.Items)) + log.V(2).Info("tested for AWSManagedMachinePool dependencies", "count", len(managedMachinePools.Items)) dependencies += len(managedMachinePools.Items) machinePools := &infrav1exp.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) } - r.Log.V(2).Info("tested for AWSMachinePool dependencies", "count", len(machinePools.Items)) + log.V(2).Info("tested for AWSMachinePool dependencies", "count", len(machinePools.Items)) dependencies += len(machinePools.Items) } diff --git a/controlplane/eks/controllers/suite_test.go b/controlplane/eks/controllers/suite_test.go index 2a7a02639a..a98fa4152e 100644 --- a/controlplane/eks/controllers/suite_test.go +++ b/controlplane/eks/controllers/suite_test.go @@ -22,15 +22,13 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" + controlplanev1alpha4 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/envtest" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - - controlplanev1alpha3 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" // +kubebuilder:scaffold:imports ) @@ -50,7 +48,6 @@ func TestAPIs(t *testing.T) { } var _ = BeforeSuite(func(done Done) { - logf.SetLogger(zap.LoggerTo(GinkgoWriter, true)) By("bootstrapping test environment") testEnv = &envtest.Environment{ @@ -62,10 +59,10 @@ var _ = BeforeSuite(func(done Done) { Expect(err).ToNot(HaveOccurred()) Expect(cfg).ToNot(BeNil()) - err = controlplanev1alpha3.AddToScheme(scheme.Scheme) + err = controlplanev1alpha4.AddToScheme(scheme.Scheme) Expect(err).NotTo(HaveOccurred()) - err = controlplanev1alpha3.AddToScheme(scheme.Scheme) + err = controlplanev1alpha4.AddToScheme(scheme.Scheme) Expect(err).NotTo(HaveOccurred()) // +kubebuilder:scaffold:scheme diff --git a/controlplane/eks/main.go b/controlplane/eks/main.go index 618b0dccc9..e90cde537f 100644 --- a/controlplane/eks/main.go +++ b/controlplane/eks/main.go @@ -17,6 +17,7 @@ limitations under the License. package main import ( + "context" "errors" "flag" "fmt" @@ -31,22 +32,19 @@ import ( 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" - "sigs.k8s.io/controller-runtime/pkg/healthz" - - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/controllers" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha3" + infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" "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" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/controller" + "sigs.k8s.io/controller-runtime/pkg/healthz" // +kubebuilder:scaffold:imports ) @@ -65,13 +63,15 @@ func init() { } var ( - metricsAddr string + metricsBindAddr string enableLeaderElection bool watchNamespace string + watchFilterValue string profilerAddress string eksControlPlaneConcurrency int syncPeriod time.Duration webhookPort int + webhookCertDir string healthAddr string serviceEndpoints string @@ -81,10 +81,10 @@ var ( ) func InitFlags(fs *pflag.FlagSet) { - fs.StringVar(&metricsAddr, "metrics-addr", ":8080", + fs.StringVar(&metricsBindAddr, "metrics-bind-addr", ":8080", "The address the metric endpoint binds to.") - fs.BoolVar(&enableLeaderElection, "enable-leader-election", false, + fs.BoolVar(&enableLeaderElection, "leader-elect", false, "Enable leader election for controller manager. Enabling this will ensure there is only one active controller manager.") fs.StringVar(&watchNamespace, "namespace", "", @@ -99,12 +99,22 @@ func InitFlags(fs *pflag.FlagSet) { fs.DurationVar(&syncPeriod, "sync-period", 10*time.Minute, "The minimum interval at which watched resources are reconciled (e.g. 15m)") - fs.IntVar(&webhookPort, "webhook-port", 0, + fs.IntVar(&webhookPort, "webhook-port", 9443, "Webhook Server port, disabled by default. When enabled, the manager will only work as webhook server, no reconcilers are installed.") + fs.StringVar(&webhookCertDir, "webhook-cert-dir", "/tmp/k8s-webhook-server/serving-certs/", + "Webhook cert dir, only used when webhook-port is specified.") + fs.StringVar(&serviceEndpoints, "service-endpoints", "", "Set custom AWS service endpoins in semi-colon separated format: ${SigningRegion1}:${ServiceID1}=${URL},${ServiceID2}=${URL};${SigningRegion2}...") + fs.StringVar( + &watchFilterValue, + "watch-filter", + "", + fmt.Sprintf("Label value that the controller watches to reconcile cluster-api objects. Label key is always %s. If unspecified, the controller watches for all cluster-api objects.", clusterv1.WatchLabel), + ) + feature.MutableGates.AddFlag(fs) } @@ -160,12 +170,13 @@ func main() { restConfig.UserAgent = "cluster-api-provider-aws-controller" mgr, err := ctrl.NewManager(restConfig, ctrl.Options{ Scheme: scheme, - MetricsBindAddress: metricsAddr, + MetricsBindAddress: metricsBindAddr, LeaderElection: enableLeaderElection, - LeaderElectionID: "eks-controlplane-manager-leader-election-capa", + LeaderElectionID: "eks-controlplane-manager-leader-elect-capa", SyncPeriod: &syncPeriod, Namespace: watchNamespace, EventBroadcaster: broadcaster, + CertDir: webhookCertDir, Port: webhookPort, HealthProbeBindAddress: healthAddr, }) @@ -178,8 +189,8 @@ func main() { record.InitFromRecorder(mgr.GetEventRecorderFor("aws-controller")) setupLog.V(1).Info(fmt.Sprintf("%+v\n", feature.Gates)) - - setupReconcilers(mgr, enableIAM, allowAddRoles, AWSServiceEndpoints) + ctx := ctrl.SetupSignalHandler() + setupReconcilers(ctx, mgr, enableIAM, allowAddRoles, AWSServiceEndpoints) setupWebhooks(mgr) // +kubebuilder:scaffold:builder @@ -195,34 +206,26 @@ func main() { } setupLog.Info("starting manager", "version", version.Get().String()) - if err := mgr.Start(ctrl.SetupSignalHandler()); err != nil { + if err := mgr.Start(ctx); err != nil { setupLog.Error(err, "problem running manager") os.Exit(1) } } -func setupReconcilers(mgr ctrl.Manager, enableIAM bool, allowAddRoles bool, serviceEndpoints []scope.ServiceEndpoint) { - if webhookPort != 0 { - return - } - +func setupReconcilers(ctx context.Context, mgr ctrl.Manager, enableIAM bool, allowAddRoles bool, serviceEndpoints []scope.ServiceEndpoint) { if err := (&controllers.AWSManagedControlPlaneReconciler{ Client: mgr.GetClient(), - Log: ctrl.Log.WithName("controllers").WithName("AWSManagedControlPlane"), EnableIAM: enableIAM, AllowAdditionalRoles: allowAddRoles, Endpoints: serviceEndpoints, - }).SetupWithManager(mgr, concurrency(eksControlPlaneConcurrency)); err != nil { + WatchFilterValue: watchFilterValue, + }).SetupWithManager(ctx, mgr, concurrency(eksControlPlaneConcurrency)); err != nil { setupLog.Error(err, "unable to create controller", "controller", "AWSManagedControlPlane") os.Exit(1) } } func setupWebhooks(mgr ctrl.Manager) { - if webhookPort == 0 { - return - } - if err := (&controlplanev1.AWSManagedControlPlane{}).SetupWebhookWithManager(mgr); err != nil { setupLog.Error(err, "unable to create webhook", "webhook", "AWSManagedControlPlane") os.Exit(1) diff --git a/exp/PROJECT b/exp/PROJECT new file mode 100644 index 0000000000..8dd67fe307 --- /dev/null +++ b/exp/PROJECT @@ -0,0 +1,28 @@ +domain: cluster.x-k8s.io +repo: sigs.k8s.io/cluster-api-provider-aws/exp +resources: +- group: infrastructure + kind: AWSMachinePool + version: v1alpha3 +- group: bootstrap + kind: AWSManagedMachinePool + version: v1alpha3 +- group: bootstrap + kind: AWSManagedCluster + version: v1alpha3 +- group: bootstrap + kind: AWSFargateProfile + version: v1alpha3 +- group: infrastructure + kind: AWSMachinePool + version: v1alpha4 +- group: bootstrap + kind: AWSManagedMachinePool + version: v1alpha4 +- group: bootstrap + kind: AWSManagedCluster + version: v1alpha4 +- group: bootstrap + kind: AWSFargateProfile + version: v1alpha4 +version: "2" diff --git a/exp/api/v1alpha3/awsfargateprofile_types.go b/exp/api/v1alpha3/awsfargateprofile_types.go index 3e3fb6aee2..47e22313da 100644 --- a/exp/api/v1alpha3/awsfargateprofile_types.go +++ b/exp/api/v1alpha3/awsfargateprofile_types.go @@ -129,7 +129,6 @@ type FargateProfileStatus struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsfargateprofiles,scope=Namespaced,categories=cluster-api -// +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" diff --git a/exp/api/v1alpha3/awsfargateprofile_webhook.go b/exp/api/v1alpha3/awsfargateprofile_webhook.go deleted file mode 100644 index 13b8923772..0000000000 --- a/exp/api/v1alpha3/awsfargateprofile_webhook.go +++ /dev/null @@ -1,102 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - "reflect" - - "github.com/pkg/errors" - 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/v1alpha3" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" - - "sigs.k8s.io/cluster-api-provider-aws/pkg/eks" -) - -const ( - maxProfileNameLength = 100 -) - -// SetupWebhookWithManager will setup the webhooks for the AWSFargateProfile -func (r *AWSFargateProfile) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha3-awsfargateprofile,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsfargateprofiles,versions=v1alpha3,name=default.awsfargateprofile.infrastructure.cluster.x-k8s.io,sideEffects=None -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha3-awsfargateprofile,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=fargateprofiles,versions=v1alpha3,name=validation.awsfargateprofile.infrastructure.cluster.x-k8s.io,sideEffects=None - -var _ webhook.Defaulter = &AWSFargateProfile{} -var _ webhook.Validator = &AWSFargateProfile{} - -// Default will set default values for the AWSFargateProfile -func (r *AWSFargateProfile) Default() { - if r.Labels == nil { - r.Labels = make(map[string]string) - } - r.Labels[clusterv1.ClusterLabelName] = r.Spec.ClusterName - - if r.Spec.ProfileName == "" { - name, err := eks.GenerateEKSName(r.Name, r.Namespace, maxProfileNameLength) - if err != nil { - mmpLog.Error(err, "failed to create EKS nodegroup name") - return - } - - r.Spec.ProfileName = name - } -} - -func (r *AWSFargateProfile) ValidateUpdate(oldObj runtime.Object) error { - gv := r.GroupVersionKind().GroupKind() - old, ok := oldObj.(*AWSFargateProfile) - if !ok { - return apierrors.NewInvalid(gv, r.Name, field.ErrorList{ - field.InternalError(nil, errors.Errorf("failed to convert old %s to object", gv.Kind)), - }) - } - - var allErrs field.ErrorList - if !reflect.DeepEqual(old.Spec, r.Spec) { - allErrs = append( - allErrs, - field.Invalid(field.NewPath("spec"), r.Spec, "is immutable"), - ) - } - - if len(allErrs) == 0 { - return nil - } - - return apierrors.NewInvalid( - gv, - r.Name, - allErrs, - ) -} - -func (r *AWSFargateProfile) ValidateCreate() error { - return nil -} - -func (r *AWSFargateProfile) ValidateDelete() error { - return nil -} diff --git a/exp/api/v1alpha3/awsmachinepool_webhook.go b/exp/api/v1alpha3/awsmachinepool_webhook.go deleted file mode 100644 index eacd45c108..0000000000 --- a/exp/api/v1alpha3/awsmachinepool_webhook.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - logf "sigs.k8s.io/controller-runtime/pkg/log" - "time" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/webhook" -) - -var log = logf.Log.WithName("awsmachinepool-resource") - -// SetupWebhookWithManager will setup the webhooks for the AWSMachinePool -func (r *AWSMachinePool) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha3-awsmachinepool,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmachinepools,versions=v1alpha3,name=validation.awsmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha3-awsmachinepool,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmachinepools,versions=v1alpha3,name=default.awsmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None - -var _ webhook.Defaulter = &AWSMachinePool{} -var _ webhook.Validator = &AWSMachinePool{} - -func (r *AWSMachinePool) validateDefaultCoolDown() field.ErrorList { - var allErrs field.ErrorList - if int(r.Spec.DefaultCoolDown.Duration.Seconds()) < 0 { - allErrs = append(allErrs, field.Required(field.NewPath("spec.DefaultCoolDown"), "DefaultCoolDown must be greater than zero")) - } - if len(allErrs) == 0 { - return nil - } - return allErrs -} - -// ValidateCreate will do any extra validation when creating a AWSMachinePool -func (r *AWSMachinePool) ValidateCreate() error { - log.Info("AWSMachinePool validate create", "name", r.Name) - - var allErrs field.ErrorList - - if errs := r.validateDefaultCoolDown(); errs != nil || len(errs) == 0 { - allErrs = append(allErrs, errs...) - } - - if len(allErrs) == 0 { - return nil - } - - return apierrors.NewInvalid( - r.GroupVersionKind().GroupKind(), - r.Name, - allErrs, - ) -} - -// ValidateUpdate will do any extra validation when updating a AWSMachinePool -func (r *AWSMachinePool) ValidateUpdate(old runtime.Object) error { - var allErrs field.ErrorList - if errs := r.validateDefaultCoolDown(); errs != nil || len(errs) == 0 { - allErrs = append(allErrs, errs...) - } - - if len(allErrs) == 0 { - return nil - } - - return apierrors.NewInvalid( - r.GroupVersionKind().GroupKind(), - r.Name, - allErrs, - ) -} - -// ValidateDelete allows you to add any extra validation when deleting -func (r *AWSMachinePool) ValidateDelete() error { - return nil -} - -// Default will set default values for the AWSMachinePool -func (r *AWSMachinePool) Default() { - if int(r.Spec.DefaultCoolDown.Duration.Seconds()) == 0 { - log.Info("DefaultCoolDown is zero, setting 300 seconds as default") - r.Spec.DefaultCoolDown.Duration = 300 * time.Second - } -} diff --git a/exp/api/v1alpha3/awsmanagedcluster_types.go b/exp/api/v1alpha3/awsmanagedcluster_types.go index 09fc229657..073155e693 100644 --- a/exp/api/v1alpha3/awsmanagedcluster_types.go +++ b/exp/api/v1alpha3/awsmanagedcluster_types.go @@ -41,7 +41,6 @@ type AWSManagedClusterStatus struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsmanagedclusters,scope=Namespaced,categories=cluster-api,shortName=awsmc -// +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" diff --git a/exp/api/v1alpha3/awsmanagedmachinepool_types.go b/exp/api/v1alpha3/awsmanagedmachinepool_types.go index 7c9f706445..f80386ad2c 100644 --- a/exp/api/v1alpha3/awsmanagedmachinepool_types.go +++ b/exp/api/v1alpha3/awsmanagedmachinepool_types.go @@ -194,7 +194,6 @@ type AWSManagedMachinePoolStatus struct { // +kubebuilder:object:root=true // +kubebuilder:resource:path=awsmanagedmachinepools,scope=Namespaced,categories=cluster-api -// +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" diff --git a/exp/api/v1alpha3/awsmanagedmachinepool_webhook.go b/exp/api/v1alpha3/awsmanagedmachinepool_webhook.go deleted file mode 100644 index 23486bc59b..0000000000 --- a/exp/api/v1alpha3/awsmanagedmachinepool_webhook.go +++ /dev/null @@ -1,207 +0,0 @@ -/* -Copyright 2020 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha3 - -import ( - "fmt" - "reflect" - - "github.com/pkg/errors" - - apierrors "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/util/validation/field" - - ctrl "sigs.k8s.io/controller-runtime" - logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/webhook" - - "sigs.k8s.io/cluster-api-provider-aws/pkg/eks" -) - -const ( - maxNodegroupNameLength = 100 -) - -// log is for logging in this package. -var mmpLog = logf.Log.WithName("awsmanagedmachinepool-resource") - -// SetupWebhookWithManager will setup the webhooks for the AWSManagedMachinePool -func (r *AWSManagedMachinePool) SetupWebhookWithManager(mgr ctrl.Manager) error { - return ctrl.NewWebhookManagedBy(mgr). - For(r). - Complete() -} - -// +kubebuilder:webhook:verbs=create;update,path=/validate-infrastructure-cluster-x-k8s-io-v1alpha3-awsmanagedmachinepool,mutating=false,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmanagedmachinepools,versions=v1alpha3,name=validation.awsmanagedmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None -// +kubebuilder:webhook:verbs=create;update,path=/mutate-infrastructure-cluster-x-k8s-io-v1alpha3-awsmanagedmachinepool,mutating=true,failurePolicy=fail,matchPolicy=Equivalent,groups=infrastructure.cluster.x-k8s.io,resources=awsmanagedmachinepools,versions=v1alpha3,name=default.awsmanagedmachinepool.infrastructure.cluster.x-k8s.io,sideEffects=None - -var _ webhook.Defaulter = &AWSManagedMachinePool{} -var _ webhook.Validator = &AWSManagedMachinePool{} - -func (r *AWSManagedMachinePool) validateScaling() field.ErrorList { - var allErrs field.ErrorList - if r.Spec.Scaling != nil { // nolint:nestif - minField := field.NewPath("spec", "scaling", "minSize") - maxField := field.NewPath("spec", "scaling", "maxSize") - min := r.Spec.Scaling.MinSize - max := r.Spec.Scaling.MaxSize - if min != nil { - if *min < 0 { - allErrs = append(allErrs, field.Invalid(minField, *min, "must be greater than zero")) - } - if max != nil && *max < *min { - allErrs = append(allErrs, field.Invalid(maxField, *max, fmt.Sprintf("must be greater than field %s", minField.String()))) - } - } - if max != nil && *max < 0 { - allErrs = append(allErrs, field.Invalid(maxField, *max, "must be greater than zero")) - } - } - if len(allErrs) == 0 { - return nil - } - return allErrs -} - -func (r *AWSManagedMachinePool) validateRemoteAccess() field.ErrorList { - var allErrs field.ErrorList - if r.Spec.RemoteAccess == nil { - return allErrs - } - remoteAccessPath := field.NewPath("spec", "remoteAccess") - sourceSecurityGroups := r.Spec.RemoteAccess.SourceSecurityGroups - public := r.Spec.RemoteAccess.Public - - if public && len(sourceSecurityGroups) > 0 { - allErrs = append( - allErrs, - field.Invalid(remoteAccessPath.Child("sourceSecurityGroups"), sourceSecurityGroups, "must be empty if public is set"), - ) - } - - return allErrs -} - -// ValidateCreate will do any extra validation when creating a AWSManagedMachinePool -func (r *AWSManagedMachinePool) ValidateCreate() error { - mmpLog.Info("AWSManagedMachinePool validate create", "name", r.Name) - - var allErrs field.ErrorList - - if r.Spec.EKSNodegroupName == "" { - allErrs = append(allErrs, field.Required(field.NewPath("spec.eksNodegroupName"), "eksNodegroupName is required")) - } - if errs := r.validateScaling(); errs != nil || len(errs) == 0 { - allErrs = append(allErrs, errs...) - } - if errs := r.validateRemoteAccess(); len(errs) > 0 { - allErrs = append(allErrs, errs...) - } - - if len(allErrs) == 0 { - return nil - } - - return apierrors.NewInvalid( - r.GroupVersionKind().GroupKind(), - r.Name, - allErrs, - ) -} - -// ValidateUpdate will do any extra validation when updating a AWSManagedMachinePool -func (r *AWSManagedMachinePool) ValidateUpdate(old runtime.Object) error { - mmpLog.Info("AWSManagedMachinePool validate update", "name", r.Name) - oldPool, ok := old.(*AWSManagedMachinePool) - if !ok { - return apierrors.NewInvalid(GroupVersion.WithKind("AWSManagedMachinePool").GroupKind(), r.Name, field.ErrorList{ - field.InternalError(nil, errors.New("failed to convert old AWSManagedMachinePool to object")), - }) - } - - var allErrs field.ErrorList - allErrs = append(allErrs, r.validateImmutable(oldPool)...) - - if errs := r.validateScaling(); errs != nil || len(errs) == 0 { - allErrs = append(allErrs, errs...) - } - - if len(allErrs) == 0 { - return nil - } - - return apierrors.NewInvalid( - r.GroupVersionKind().GroupKind(), - r.Name, - allErrs, - ) -} - -// ValidateDelete allows you to add any extra validation when deleting -func (r *AWSManagedMachinePool) ValidateDelete() error { - mmpLog.Info("AWSManagedMachinePool validate delete", "name", r.Name) - - return nil -} - -func (r *AWSManagedMachinePool) validateImmutable(old *AWSManagedMachinePool) field.ErrorList { - var allErrs field.ErrorList - - appendErrorIfMutated := func(old, update interface{}, name string) { - if !reflect.DeepEqual(old, update) { - allErrs = append( - allErrs, - field.Invalid(field.NewPath("spec", name), update, "field is immutable"), - ) - } - } - appendErrorIfSetAndMutated := func(old, update interface{}, name string) { - if !reflect.ValueOf(old).IsZero() && !reflect.DeepEqual(old, update) { - allErrs = append( - allErrs, - field.Invalid(field.NewPath("spec", name), update, "field is immutable"), - ) - } - } - - appendErrorIfMutated(old.Spec.EKSNodegroupName, r.Spec.EKSNodegroupName, "eksNodegroupName") - appendErrorIfMutated(old.Spec.SubnetIDs, r.Spec.SubnetIDs, "subnetIDs") - appendErrorIfSetAndMutated(old.Spec.RoleName, r.Spec.RoleName, "roleName") - appendErrorIfMutated(old.Spec.DiskSize, r.Spec.DiskSize, "diskSize") - appendErrorIfMutated(old.Spec.AMIType, r.Spec.AMIType, "amiType") - appendErrorIfMutated(old.Spec.RemoteAccess, r.Spec.RemoteAccess, "remoteAccess") - - return allErrs -} - -// Default will set default values for the AWSManagedMachinePool -func (r *AWSManagedMachinePool) Default() { - mmpLog.Info("AWSManagedMachinePool setting defaults", "name", r.Name) - - if r.Spec.EKSNodegroupName == "" { - mmpLog.Info("EKSNodegroupName is empty, generating name") - name, err := eks.GenerateEKSName(r.Name, r.Namespace, maxNodegroupNameLength) - if err != nil { - mmpLog.Error(err, "failed to create EKS nodegroup name") - return - } - - mmpLog.Info("Generated EKSNodegroupName", "nodegroup-name", name) - r.Spec.EKSNodegroupName = name - } -} diff --git a/exp/api/v1alpha3/conversion.go b/exp/api/v1alpha3/conversion.go new file mode 100644 index 0000000000..66dc84c6f5 --- /dev/null +++ b/exp/api/v1alpha3/conversion.go @@ -0,0 +1,143 @@ +/* +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" + 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" + clusterapiapiv1alpha3 "sigs.k8s.io/cluster-api/api/v1alpha3" + clusterapiapiv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + "sigs.k8s.io/controller-runtime/pkg/conversion" +) + +func (r *AWSMachinePool) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSMachinePool) + + return Convert_v1alpha3_AWSMachinePool_To_v1alpha4_AWSMachinePool(r, dst, nil) +} + +func (r *AWSMachinePool) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSMachinePool) + + return Convert_v1alpha4_AWSMachinePool_To_v1alpha3_AWSMachinePool(src, r, nil) +} + +func (r *AWSMachinePoolList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSMachinePoolList) + + return Convert_v1alpha3_AWSMachinePoolList_To_v1alpha4_AWSMachinePoolList(r, dst, nil) +} + +func (r *AWSMachinePoolList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSMachinePoolList) + + return Convert_v1alpha4_AWSMachinePoolList_To_v1alpha3_AWSMachinePoolList(src, r, nil) +} + +func (r *AWSManagedMachinePool) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSManagedMachinePool) + + return Convert_v1alpha3_AWSManagedMachinePool_To_v1alpha4_AWSManagedMachinePool(r, dst, nil) +} + +func (r *AWSManagedMachinePool) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSManagedMachinePool) + + return Convert_v1alpha4_AWSManagedMachinePool_To_v1alpha3_AWSManagedMachinePool(src, r, nil) +} + +func (r *AWSManagedMachinePoolList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSManagedMachinePoolList) + + return Convert_v1alpha3_AWSManagedMachinePoolList_To_v1alpha4_AWSManagedMachinePoolList(r, dst, nil) +} + +func (r *AWSManagedMachinePoolList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSManagedMachinePoolList) + + return Convert_v1alpha4_AWSManagedMachinePoolList_To_v1alpha3_AWSManagedMachinePoolList(src, r, nil) +} + +func (r *AWSManagedCluster) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSManagedCluster) + + return Convert_v1alpha3_AWSManagedCluster_To_v1alpha4_AWSManagedCluster(r, dst, nil) +} + +func (r *AWSManagedCluster) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSManagedCluster) + + return Convert_v1alpha4_AWSManagedCluster_To_v1alpha3_AWSManagedCluster(src, r, nil) +} + +func (r *AWSManagedClusterList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSManagedClusterList) + + return Convert_v1alpha3_AWSManagedClusterList_To_v1alpha4_AWSManagedClusterList(r, dst, nil) +} + +func (r *AWSManagedClusterList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSManagedClusterList) + + return Convert_v1alpha4_AWSManagedClusterList_To_v1alpha3_AWSManagedClusterList(src, r, nil) +} + +func (r *AWSFargateProfile) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSFargateProfile) + + return Convert_v1alpha3_AWSFargateProfile_To_v1alpha4_AWSFargateProfile(r, dst, nil) +} + +func (r *AWSFargateProfile) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSFargateProfile) + + return Convert_v1alpha4_AWSFargateProfile_To_v1alpha3_AWSFargateProfile(src, r, nil) +} + +func (r *AWSFargateProfileList) ConvertTo(dstRaw conversion.Hub) error { + dst := dstRaw.(*v1alpha4.AWSFargateProfileList) + + return Convert_v1alpha3_AWSFargateProfileList_To_v1alpha4_AWSFargateProfileList(r, dst, nil) +} + +func (r *AWSFargateProfileList) ConvertFrom(srcRaw conversion.Hub) error { + src := srcRaw.(*v1alpha4.AWSFargateProfileList) + + return Convert_v1alpha4_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_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_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_v1alpha4_AWSResourceReference_To_v1alpha3_AWSResourceReference is an autogenerated 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) +} diff --git a/exp/api/v1alpha3/conversion_test.go b/exp/api/v1alpha3/conversion_test.go new file mode 100644 index 0000000000..b956e6ec09 --- /dev/null +++ b/exp/api/v1alpha3/conversion_test.go @@ -0,0 +1,58 @@ +/* +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 ( + "testing" + + . "github.com/onsi/gomega" + + runtime "k8s.io/apimachinery/pkg/runtime" + v1alpha4 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + 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(v1alpha4.AddToScheme(scheme)).To(Succeed()) + + t.Run("for AWSMachinePool", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1alpha4.AWSMachinePool{}, + Spoke: &AWSMachinePool{}, + })) + + t.Run("for AWSManagedMachinePool", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1alpha4.AWSManagedMachinePool{}, + Spoke: &AWSManagedMachinePool{}, + })) + + t.Run("for AWSManagedCluster", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1alpha4.AWSManagedCluster{}, + Spoke: &AWSManagedCluster{}, + })) + + t.Run("for AWSFargateProfile", utilconversion.FuzzTestFunc(utilconversion.FuzzTestFuncInput{ + Scheme: scheme, + Hub: &v1alpha4.AWSFargateProfile{}, + Spoke: &AWSFargateProfile{}, + })) +} diff --git a/exp/api/v1alpha3/doc.go b/exp/api/v1alpha3/doc.go index 0b922645fe..f6a60ab7bd 100644 --- a/exp/api/v1alpha3/doc.go +++ b/exp/api/v1alpha3/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,6 +14,5 @@ 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/v1alpha4 package v1alpha3 diff --git a/exp/api/v1alpha3/groupversion_info.go b/exp/api/v1alpha3/groupversion_info.go index a1124f6a0e..c33933bc1e 100644 --- a/exp/api/v1alpha3/groupversion_info.go +++ b/exp/api/v1alpha3/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/v1alpha3/zz_generated.conversion.go b/exp/api/v1alpha3/zz_generated.conversion.go new file mode 100644 index 0000000000..4d9e1b3d8f --- /dev/null +++ b/exp/api/v1alpha3/zz_generated.conversion.go @@ -0,0 +1,1214 @@ +// +build !ignore_autogenerated + +/* +Copyright The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by conversion-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + unsafe "unsafe" + + 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" + 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), (*v1alpha4.AWSFargateProfile)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSFargateProfile_To_v1alpha4_AWSFargateProfile(a.(*AWSFargateProfile), b.(*v1alpha4.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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSManagedCluster)(nil), (*v1alpha4.AWSManagedCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSManagedCluster_To_v1alpha4_AWSManagedCluster(a.(*AWSManagedCluster), b.(*v1alpha4.AWSManagedCluster), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedCluster)(nil), (*AWSManagedCluster)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSManagedCluster_To_v1alpha3_AWSManagedCluster(a.(*v1alpha4.AWSManagedCluster), b.(*AWSManagedCluster), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSManagedClusterList)(nil), (*v1alpha4.AWSManagedClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSManagedClusterList_To_v1alpha4_AWSManagedClusterList(a.(*AWSManagedClusterList), b.(*v1alpha4.AWSManagedClusterList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedClusterList)(nil), (*AWSManagedClusterList)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSManagedClusterList_To_v1alpha3_AWSManagedClusterList(a.(*v1alpha4.AWSManagedClusterList), b.(*AWSManagedClusterList), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSManagedClusterSpec)(nil), (*v1alpha4.AWSManagedClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSManagedClusterSpec_To_v1alpha4_AWSManagedClusterSpec(a.(*AWSManagedClusterSpec), b.(*v1alpha4.AWSManagedClusterSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedClusterSpec)(nil), (*AWSManagedClusterSpec)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSManagedClusterSpec_To_v1alpha3_AWSManagedClusterSpec(a.(*v1alpha4.AWSManagedClusterSpec), b.(*AWSManagedClusterSpec), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*AWSManagedClusterStatus)(nil), (*v1alpha4.AWSManagedClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha3_AWSManagedClusterStatus_To_v1alpha4_AWSManagedClusterStatus(a.(*AWSManagedClusterStatus), b.(*v1alpha4.AWSManagedClusterStatus), scope) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*v1alpha4.AWSManagedClusterStatus)(nil), (*AWSManagedClusterStatus)(nil), func(a, b interface{}, scope conversion.Scope) error { + return Convert_v1alpha4_AWSManagedClusterStatus_To_v1alpha3_AWSManagedClusterStatus(a.(*v1alpha4.AWSManagedClusterStatus), b.(*AWSManagedClusterStatus), 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); err != nil { + return err + } + if err := s.AddGeneratedConversionFunc((*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.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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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) + }); 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((*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 + } + return nil +} + +func autoConvert_v1alpha3_AWSFargateProfile_To_v1alpha4_AWSFargateProfile(in *AWSFargateProfile, out *v1alpha4.AWSFargateProfile, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_FargateProfileSpec_To_v1alpha4_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 { + 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) +} + +func autoConvert_v1alpha4_AWSFargateProfile_To_v1alpha3_AWSFargateProfile(in *v1alpha4.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 { + return err + } + if err := Convert_v1alpha4_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) +} + +func autoConvert_v1alpha3_AWSFargateProfileList_To_v1alpha4_AWSFargateProfileList(in *AWSFargateProfileList, out *v1alpha4.AWSFargateProfileList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha4.AWSFargateProfile)(unsafe.Pointer(&in.Items)) + 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) +} + +func autoConvert_v1alpha4_AWSFargateProfileList_To_v1alpha3_AWSFargateProfileList(in *v1alpha4.AWSFargateProfileList, out *AWSFargateProfileList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]AWSFargateProfile)(unsafe.Pointer(&in.Items)) + 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) +} + +func autoConvert_v1alpha3_AWSLaunchTemplate_To_v1alpha4_AWSLaunchTemplate(in *AWSLaunchTemplate, out *v1alpha4.AWSLaunchTemplate, s conversion.Scope) error { + out.Name = in.Name + out.IamInstanceProfile = in.IamInstanceProfile + if err := Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AWSResourceReference(&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 = (*clusterapiproviderawsapiv1alpha4.Volume)(unsafe.Pointer(in.RootVolume)) + out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) + out.VersionNumber = (*int64)(unsafe.Pointer(in.VersionNumber)) + if in.AdditionalSecurityGroups != nil { + in, out := &in.AdditionalSecurityGroups, &out.AdditionalSecurityGroups + *out = make([]clusterapiproviderawsapiv1alpha4.AWSResourceReference, len(*in)) + for i := range *in { + if err := Convert_v1alpha3_AWSResourceReference_To_v1alpha4_AWSResourceReference(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.AdditionalSecurityGroups = nil + } + 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) +} + +func autoConvert_v1alpha4_AWSLaunchTemplate_To_v1alpha3_AWSLaunchTemplate(in *v1alpha4.AWSLaunchTemplate, out *AWSLaunchTemplate, s conversion.Scope) error { + out.Name = in.Name + out.IamInstanceProfile = in.IamInstanceProfile + if err := Convert_v1alpha4_AWSResourceReference_To_v1alpha3_AWSResourceReference(&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 = (*clusterapiproviderawsapiv1alpha3.Volume)(unsafe.Pointer(in.RootVolume)) + out.SSHKeyName = (*string)(unsafe.Pointer(in.SSHKeyName)) + out.VersionNumber = (*int64)(unsafe.Pointer(in.VersionNumber)) + if in.AdditionalSecurityGroups != nil { + in, out := &in.AdditionalSecurityGroups, &out.AdditionalSecurityGroups + *out = make([]clusterapiproviderawsapiv1alpha3.AWSResourceReference, len(*in)) + for i := range *in { + if err := Convert_v1alpha4_AWSResourceReference_To_v1alpha3_AWSResourceReference(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.AdditionalSecurityGroups = nil + } + 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) +} + +func autoConvert_v1alpha3_AWSMachinePool_To_v1alpha4_AWSMachinePool(in *AWSMachinePool, out *v1alpha4.AWSMachinePool, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_AWSMachinePoolSpec_To_v1alpha4_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 { + 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) +} + +func autoConvert_v1alpha4_AWSMachinePool_To_v1alpha3_AWSMachinePool(in *v1alpha4.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 { + return err + } + if err := Convert_v1alpha4_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) +} + +func autoConvert_v1alpha3_AWSMachinePoolInstanceStatus_To_v1alpha4_AWSMachinePoolInstanceStatus(in *AWSMachinePoolInstanceStatus, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_AWSMachinePoolInstanceStatus_To_v1alpha3_AWSMachinePoolInstanceStatus(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_AWSMachinePoolList_To_v1alpha4_AWSMachinePoolList(in *AWSMachinePoolList, out *v1alpha4.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)) + for i := range *in { + if err := Convert_v1alpha3_AWSMachinePool_To_v1alpha4_AWSMachinePool(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + 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) +} + +func autoConvert_v1alpha4_AWSMachinePoolList_To_v1alpha3_AWSMachinePoolList(in *v1alpha4.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 { + return err + } + } + } else { + out.Items = nil + } + 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) +} + +func autoConvert_v1alpha3_AWSMachinePoolSpec_To_v1alpha4_AWSMachinePoolSpec(in *AWSMachinePoolSpec, out *v1alpha4.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)) + for i := range *in { + if err := Convert_v1alpha3_AWSResourceReference_To_v1alpha4_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 { + return err + } + out.MixedInstancesPolicy = (*v1alpha4.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.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) +} + +func autoConvert_v1alpha4_AWSMachinePoolSpec_To_v1alpha3_AWSMachinePoolSpec(in *v1alpha4.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)) + for i := range *in { + if err := Convert_v1alpha4_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 { + 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_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) +} + +func autoConvert_v1alpha3_AWSMachinePoolStatus_To_v1alpha4_AWSMachinePoolStatus(in *AWSMachinePoolStatus, out *v1alpha4.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)) + 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)) + 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) +} + +func autoConvert_v1alpha4_AWSMachinePoolStatus_To_v1alpha3_AWSMachinePoolStatus(in *v1alpha4.AWSMachinePoolStatus, out *AWSMachinePoolStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.Replicas = in.Replicas + out.Conditions = *(*apiv1alpha3.Conditions)(unsafe.Pointer(&in.Conditions)) + 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_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) +} + +func autoConvert_v1alpha3_AWSManagedCluster_To_v1alpha4_AWSManagedCluster(in *AWSManagedCluster, out *v1alpha4.AWSManagedCluster, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_AWSManagedClusterSpec_To_v1alpha4_AWSManagedClusterSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha3_AWSManagedClusterStatus_To_v1alpha4_AWSManagedClusterStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_AWSManagedCluster_To_v1alpha4_AWSManagedCluster is an autogenerated conversion function. +func Convert_v1alpha3_AWSManagedCluster_To_v1alpha4_AWSManagedCluster(in *AWSManagedCluster, out *v1alpha4.AWSManagedCluster, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSManagedCluster_To_v1alpha4_AWSManagedCluster(in, out, s) +} + +func autoConvert_v1alpha4_AWSManagedCluster_To_v1alpha3_AWSManagedCluster(in *v1alpha4.AWSManagedCluster, out *AWSManagedCluster, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha4_AWSManagedClusterSpec_To_v1alpha3_AWSManagedClusterSpec(&in.Spec, &out.Spec, s); err != nil { + return err + } + if err := Convert_v1alpha4_AWSManagedClusterStatus_To_v1alpha3_AWSManagedClusterStatus(&in.Status, &out.Status, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSManagedCluster_To_v1alpha3_AWSManagedCluster is an autogenerated conversion function. +func Convert_v1alpha4_AWSManagedCluster_To_v1alpha3_AWSManagedCluster(in *v1alpha4.AWSManagedCluster, out *AWSManagedCluster, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSManagedCluster_To_v1alpha3_AWSManagedCluster(in, out, s) +} + +func autoConvert_v1alpha3_AWSManagedClusterList_To_v1alpha4_AWSManagedClusterList(in *AWSManagedClusterList, out *v1alpha4.AWSManagedClusterList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]v1alpha4.AWSManagedCluster, len(*in)) + for i := range *in { + if err := Convert_v1alpha3_AWSManagedCluster_To_v1alpha4_AWSManagedCluster(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha3_AWSManagedClusterList_To_v1alpha4_AWSManagedClusterList is an autogenerated conversion function. +func Convert_v1alpha3_AWSManagedClusterList_To_v1alpha4_AWSManagedClusterList(in *AWSManagedClusterList, out *v1alpha4.AWSManagedClusterList, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSManagedClusterList_To_v1alpha4_AWSManagedClusterList(in, out, s) +} + +func autoConvert_v1alpha4_AWSManagedClusterList_To_v1alpha3_AWSManagedClusterList(in *v1alpha4.AWSManagedClusterList, out *AWSManagedClusterList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]AWSManagedCluster, len(*in)) + for i := range *in { + if err := Convert_v1alpha4_AWSManagedCluster_To_v1alpha3_AWSManagedCluster(&(*in)[i], &(*out)[i], s); err != nil { + return err + } + } + } else { + out.Items = nil + } + return nil +} + +// Convert_v1alpha4_AWSManagedClusterList_To_v1alpha3_AWSManagedClusterList is an autogenerated conversion function. +func Convert_v1alpha4_AWSManagedClusterList_To_v1alpha3_AWSManagedClusterList(in *v1alpha4.AWSManagedClusterList, out *AWSManagedClusterList, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSManagedClusterList_To_v1alpha3_AWSManagedClusterList(in, out, s) +} + +func autoConvert_v1alpha3_AWSManagedClusterSpec_To_v1alpha4_AWSManagedClusterSpec(in *AWSManagedClusterSpec, out *v1alpha4.AWSManagedClusterSpec, s conversion.Scope) error { + if err := Convert_v1alpha3_APIEndpoint_To_v1alpha4_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha3_AWSManagedClusterSpec_To_v1alpha4_AWSManagedClusterSpec is an autogenerated conversion function. +func Convert_v1alpha3_AWSManagedClusterSpec_To_v1alpha4_AWSManagedClusterSpec(in *AWSManagedClusterSpec, out *v1alpha4.AWSManagedClusterSpec, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSManagedClusterSpec_To_v1alpha4_AWSManagedClusterSpec(in, out, s) +} + +func autoConvert_v1alpha4_AWSManagedClusterSpec_To_v1alpha3_AWSManagedClusterSpec(in *v1alpha4.AWSManagedClusterSpec, out *AWSManagedClusterSpec, s conversion.Scope) error { + if err := Convert_v1alpha4_APIEndpoint_To_v1alpha3_APIEndpoint(&in.ControlPlaneEndpoint, &out.ControlPlaneEndpoint, s); err != nil { + return err + } + return nil +} + +// Convert_v1alpha4_AWSManagedClusterSpec_To_v1alpha3_AWSManagedClusterSpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSManagedClusterSpec_To_v1alpha3_AWSManagedClusterSpec(in *v1alpha4.AWSManagedClusterSpec, out *AWSManagedClusterSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSManagedClusterSpec_To_v1alpha3_AWSManagedClusterSpec(in, out, s) +} + +func autoConvert_v1alpha3_AWSManagedClusterStatus_To_v1alpha4_AWSManagedClusterStatus(in *AWSManagedClusterStatus, out *v1alpha4.AWSManagedClusterStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.FailureDomains = *(*apiv1alpha4.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) + return nil +} + +// Convert_v1alpha3_AWSManagedClusterStatus_To_v1alpha4_AWSManagedClusterStatus is an autogenerated conversion function. +func Convert_v1alpha3_AWSManagedClusterStatus_To_v1alpha4_AWSManagedClusterStatus(in *AWSManagedClusterStatus, out *v1alpha4.AWSManagedClusterStatus, s conversion.Scope) error { + return autoConvert_v1alpha3_AWSManagedClusterStatus_To_v1alpha4_AWSManagedClusterStatus(in, out, s) +} + +func autoConvert_v1alpha4_AWSManagedClusterStatus_To_v1alpha3_AWSManagedClusterStatus(in *v1alpha4.AWSManagedClusterStatus, out *AWSManagedClusterStatus, s conversion.Scope) error { + out.Ready = in.Ready + out.FailureDomains = *(*apiv1alpha3.FailureDomains)(unsafe.Pointer(&in.FailureDomains)) + return nil +} + +// Convert_v1alpha4_AWSManagedClusterStatus_To_v1alpha3_AWSManagedClusterStatus is an autogenerated conversion function. +func Convert_v1alpha4_AWSManagedClusterStatus_To_v1alpha3_AWSManagedClusterStatus(in *v1alpha4.AWSManagedClusterStatus, out *AWSManagedClusterStatus, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSManagedClusterStatus_To_v1alpha3_AWSManagedClusterStatus(in, out, s) +} + +func autoConvert_v1alpha3_AWSManagedMachinePool_To_v1alpha4_AWSManagedMachinePool(in *AWSManagedMachinePool, out *v1alpha4.AWSManagedMachinePool, s conversion.Scope) error { + out.ObjectMeta = in.ObjectMeta + if err := Convert_v1alpha3_AWSManagedMachinePoolSpec_To_v1alpha4_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 { + 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) +} + +func autoConvert_v1alpha4_AWSManagedMachinePool_To_v1alpha3_AWSManagedMachinePool(in *v1alpha4.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 { + return err + } + if err := Convert_v1alpha4_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) +} + +func autoConvert_v1alpha3_AWSManagedMachinePoolList_To_v1alpha4_AWSManagedMachinePoolList(in *AWSManagedMachinePoolList, out *v1alpha4.AWSManagedMachinePoolList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]v1alpha4.AWSManagedMachinePool)(unsafe.Pointer(&in.Items)) + 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) +} + +func autoConvert_v1alpha4_AWSManagedMachinePoolList_To_v1alpha3_AWSManagedMachinePoolList(in *v1alpha4.AWSManagedMachinePoolList, out *AWSManagedMachinePoolList, s conversion.Scope) error { + out.ListMeta = in.ListMeta + out.Items = *(*[]AWSManagedMachinePool)(unsafe.Pointer(&in.Items)) + 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) +} + +func autoConvert_v1alpha3_AWSManagedMachinePoolSpec_To_v1alpha4_AWSManagedMachinePoolSpec(in *AWSManagedMachinePoolSpec, out *v1alpha4.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.RoleName = in.RoleName + out.AMIVersion = (*string)(unsafe.Pointer(in.AMIVersion)) + out.AMIType = (*v1alpha4.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.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) +} + +func autoConvert_v1alpha4_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachinePoolSpec(in *v1alpha4.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.AMIVersion = (*string)(unsafe.Pointer(in.AMIVersion)) + out.AMIType = (*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 = (*ManagedMachinePoolScaling)(unsafe.Pointer(in.Scaling)) + out.RemoteAccess = (*ManagedRemoteAccess)(unsafe.Pointer(in.RemoteAccess)) + out.ProviderIDList = *(*[]string)(unsafe.Pointer(&in.ProviderIDList)) + return nil +} + +// Convert_v1alpha4_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachinePoolSpec is an autogenerated conversion function. +func Convert_v1alpha4_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachinePoolSpec(in *v1alpha4.AWSManagedMachinePoolSpec, out *AWSManagedMachinePoolSpec, s conversion.Scope) error { + return autoConvert_v1alpha4_AWSManagedMachinePoolSpec_To_v1alpha3_AWSManagedMachinePoolSpec(in, out, s) +} + +func autoConvert_v1alpha3_AWSManagedMachinePoolStatus_To_v1alpha4_AWSManagedMachinePoolStatus(in *AWSManagedMachinePoolStatus, out *v1alpha4.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)) + 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) +} + +func autoConvert_v1alpha4_AWSManagedMachinePoolStatus_To_v1alpha3_AWSManagedMachinePoolStatus(in *v1alpha4.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)) + 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) +} + +func autoConvert_v1alpha3_AutoScalingGroup_To_v1alpha4_AutoScalingGroup(in *AutoScalingGroup, out *v1alpha4.AutoScalingGroup, s conversion.Scope) error { + out.ID = in.ID + out.Tags = *(*clusterapiproviderawsapiv1alpha4.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 = (*v1alpha4.MixedInstancesPolicy)(unsafe.Pointer(in.MixedInstancesPolicy)) + out.Status = v1alpha4.ASGStatus(in.Status) + out.Instances = *(*[]clusterapiproviderawsapiv1alpha4.Instance)(unsafe.Pointer(&in.Instances)) + 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) +} + +func autoConvert_v1alpha4_AutoScalingGroup_To_v1alpha3_AutoScalingGroup(in *v1alpha4.AutoScalingGroup, out *AutoScalingGroup, s conversion.Scope) error { + out.ID = in.ID + out.Tags = *(*clusterapiproviderawsapiv1alpha3.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) + out.Instances = *(*[]clusterapiproviderawsapiv1alpha3.Instance)(unsafe.Pointer(&in.Instances)) + 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) +} + +func autoConvert_v1alpha3_BlockDeviceMapping_To_v1alpha4_BlockDeviceMapping(in *BlockDeviceMapping, out *v1alpha4.BlockDeviceMapping, s conversion.Scope) error { + out.DeviceName = in.DeviceName + if err := Convert_v1alpha3_EBS_To_v1alpha4_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) +} + +func autoConvert_v1alpha4_BlockDeviceMapping_To_v1alpha3_BlockDeviceMapping(in *v1alpha4.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 { + 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) +} + +func autoConvert_v1alpha3_EBS_To_v1alpha4_EBS(in *EBS, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_EBS_To_v1alpha3_EBS(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_FargateProfileSpec_To_v1alpha4_FargateProfileSpec(in *FargateProfileSpec, out *v1alpha4.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.RoleName = in.RoleName + out.Selectors = *(*[]v1alpha4.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) +} + +func autoConvert_v1alpha4_FargateProfileSpec_To_v1alpha3_FargateProfileSpec(in *v1alpha4.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.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) +} + +func autoConvert_v1alpha3_FargateProfileStatus_To_v1alpha4_FargateProfileStatus(in *FargateProfileStatus, out *v1alpha4.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)) + 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) +} + +func autoConvert_v1alpha4_FargateProfileStatus_To_v1alpha3_FargateProfileStatus(in *v1alpha4.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)) + 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) +} + +func autoConvert_v1alpha3_FargateSelector_To_v1alpha4_FargateSelector(in *FargateSelector, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_FargateSelector_To_v1alpha3_FargateSelector(in *v1alpha4.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) +} + +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) + 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) +} + +func autoConvert_v1alpha4_InstancesDistribution_To_v1alpha3_InstancesDistribution(in *v1alpha4.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_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) +} + +func autoConvert_v1alpha3_ManagedMachinePoolScaling_To_v1alpha4_ManagedMachinePoolScaling(in *ManagedMachinePoolScaling, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_ManagedMachinePoolScaling_To_v1alpha3_ManagedMachinePoolScaling(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_ManagedRemoteAccess_To_v1alpha4_ManagedRemoteAccess(in *ManagedRemoteAccess, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_ManagedRemoteAccess_To_v1alpha3_ManagedRemoteAccess(in *v1alpha4.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) +} + +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)) + 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) +} + +func autoConvert_v1alpha4_MixedInstancesPolicy_To_v1alpha3_MixedInstancesPolicy(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_Overrides_To_v1alpha4_Overrides(in *Overrides, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_Overrides_To_v1alpha3_Overrides(in *v1alpha4.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) +} + +func autoConvert_v1alpha3_RefreshPreferences_To_v1alpha4_RefreshPreferences(in *RefreshPreferences, out *v1alpha4.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) +} + +func autoConvert_v1alpha4_RefreshPreferences_To_v1alpha3_RefreshPreferences(in *v1alpha4.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) +} diff --git a/exp/api/v1alpha3/zz_generated.deepcopy.go b/exp/api/v1alpha3/zz_generated.deepcopy.go index acb85791e5..0cce3a9870 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 ( - "k8s.io/apimachinery/pkg/runtime" + 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/controlleridentitycreator/awscontrolleridentity_controller.go b/exp/controlleridentitycreator/awscontrolleridentity_controller.go index b10d3e9f31..5b017686c6 100644 --- a/exp/controlleridentitycreator/awscontrolleridentity_controller.go +++ b/exp/controlleridentitycreator/awscontrolleridentity_controller.go @@ -24,11 +24,11 @@ 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/v1alpha3" - "sigs.k8s.io/cluster-api-provider-aws/controllers" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" "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" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" @@ -40,15 +40,15 @@ import ( // AWSControllerIdentityReconciler reconciles a AWSClusterControllerIdentity object type AWSControllerIdentityReconciler struct { client.Client - Log logr.Logger - Endpoints []scope.ServiceEndpoint + Log logr.Logger + Endpoints []scope.ServiceEndpoint + WatchFilterValue string } // +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=awsclustercontrolleridentities,verbs=get;list;watch;create -func (r *AWSControllerIdentityReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { - ctx := context.TODO() - log := r.Log.WithValues("namespace", req.NamespacedName, string(infrav1.ControllerIdentityKind), req.Name) +func (r *AWSControllerIdentityReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { + log := ctrl.LoggerFrom(ctx) var identityRef *infrav1.AWSIdentityReference @@ -130,29 +130,26 @@ func (r *AWSControllerIdentityReconciler) Reconcile(req ctrl.Request) (ctrl.Resu return reconcile.Result{}, err } -func (r *AWSControllerIdentityReconciler) SetupWithManager(mgr ctrl.Manager, options controller.Options) error { +func (r *AWSControllerIdentityReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error { controller := ctrl.NewControllerManagedBy(mgr). For(&infrav1.AWSCluster{}). WithOptions(options). - WithEventFilter(controllers.PausedPredicates(r.Log)) + WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)) if feature.Gates.Enabled(feature.EKS) { controller.Watches( &source.Kind{Type: &controlplanev1.AWSManagedControlPlane{}}, - &handler.EnqueueRequestsFromMapFunc{ - ToRequests: handler.ToRequestsFunc(r.managedControlPlaneMap), - }, + handler.EnqueueRequestsFromMapFunc(r.managedControlPlaneMap), ) } return controller.Complete(r) } -func (r *AWSControllerIdentityReconciler) managedControlPlaneMap(o handler.MapObject) []ctrl.Request { - managedControlPlane, ok := o.Object.(*controlplanev1.AWSManagedControlPlane) +func (r *AWSControllerIdentityReconciler) managedControlPlaneMap(o client.Object) []ctrl.Request { + managedControlPlane, ok := o.(*controlplanev1.AWSManagedControlPlane) if !ok { - r.Log.Error(nil, fmt.Sprintf("Expected a AWSManagedControlPlane but got a %T", o.Object)) - return nil + panic(fmt.Sprintf("Expected a managedControlPlane but got a %T", o)) } return []ctrl.Request{ diff --git a/exp/controlleridentitycreator/awscontrolleridentity_controller_test.go b/exp/controlleridentitycreator/awscontrolleridentity_controller_test.go index 7762b59ec5..19276df26c 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/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/exp/controlleridentitycreator/suite_test.go b/exp/controlleridentitycreator/suite_test.go index 64d14b13f8..90ce44880c 100644 --- a/exp/controlleridentitycreator/suite_test.go +++ b/exp/controlleridentitycreator/suite_test.go @@ -25,12 +25,13 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + ctrl "sigs.k8s.io/controller-runtime" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" "sigs.k8s.io/cluster-api-provider-aws/test/helpers" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" "sigs.k8s.io/controller-runtime/pkg/log" @@ -42,6 +43,7 @@ import ( var ( testEnv *helpers.TestEnvironment + ctx = ctrl.SetupSignalHandler() ) func TestAPIs(t *testing.T) { @@ -91,14 +93,14 @@ func setup() { err = (&AWSControllerIdentityReconciler{ Client: testEnv, Log: log.Log, - }).SetupWithManager(testEnv.Manager, controller.Options{}) + }).SetupWithManager(ctx, testEnv.Manager, controller.Options{}) if err != nil { panic(fmt.Sprintf("Failed to add AWSControllerIdentityReconciler to the envtest manager: %v", err)) } go func() { fmt.Println("Starting the manager") - if err := testEnv.StartManager(); err != nil { + if err := testEnv.StartManager(ctx); err != nil { panic(fmt.Sprintf("Failed to start the envtest manager: %v", err)) } }() diff --git a/exp/controllers/awsfargatepool_controller.go b/exp/controllers/awsfargatepool_controller.go index 72cb603116..237788f901 100644 --- a/exp/controllers/awsfargatepool_controller.go +++ b/exp/controllers/awsfargatepool_controller.go @@ -18,13 +18,17 @@ package controllers import ( "context" + "fmt" "github.com/go-logr/logr" "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + "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" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/predicates" @@ -35,35 +39,27 @@ import ( "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha3" - "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" - "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/eks" ) // AWSFargateProfileReconciler reconciles a AWSFargateProfile object type AWSFargateProfileReconciler struct { client.Client - Log logr.Logger - Recorder record.EventRecorder - Endpoints []scope.ServiceEndpoint - - EnableIAM bool + Recorder record.EventRecorder + Endpoints []scope.ServiceEndpoint + EnableIAM bool + WatchFilterValue string } // SetupWithManager is used to setup the controller -func (r *AWSFargateProfileReconciler) SetupWithManager(mgr ctrl.Manager, options controller.Options) error { - managedControlPlaneToFargateProfileMap := managedControlPlaneToFargateProfileMapFunc(r.Client, r.Log) +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{}). WithOptions(options). - WithEventFilter(predicates.ResourceNotPaused(r.Log)). + WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)). Watches( &source.Kind{Type: &controlplanev1.AWSManagedControlPlane{}}, - &handler.EnqueueRequestsFromMapFunc{ - ToRequests: managedControlPlaneToFargateProfileMap, - }, + handler.EnqueueRequestsFromMapFunc(managedControlPlaneToFargateProfileMap), ). Complete(r) } @@ -75,9 +71,8 @@ func (r *AWSFargateProfileReconciler) SetupWithManager(mgr ctrl.Manager, options // +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=awsfargateprofiles/status,verbs=get;update;patch // Reconcile reconciles AWSFargateProfiles -func (r *AWSFargateProfileReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr error) { - logger := r.Log.WithValues("namespace", req.Namespace, "AWSFargateProfile", req.Name) - ctx := context.Background() +func (r *AWSFargateProfileReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error) { + log := ctrl.LoggerFrom(ctx) fargateProfile := &infrav1exp.AWSFargateProfile{} if err := r.Get(ctx, req.NamespacedName, fargateProfile); err != nil { @@ -89,11 +84,11 @@ func (r *AWSFargateProfileReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result cluster, err := util.GetClusterByName(ctx, r.Client, fargateProfile.Namespace, fargateProfile.Spec.ClusterName) if err != nil { - logger.Info("Failed to retrieve Cluster from AWSFargateProfile") + log.Info("Failed to retrieve Cluster from AWSFargateProfile") return reconcile.Result{}, nil } - logger = logger.WithValues("Cluster", cluster.Name) + log = log.WithValues("Cluster", cluster.Name) controlPlaneKey := client.ObjectKey{ Namespace: fargateProfile.Namespace, @@ -101,14 +96,11 @@ func (r *AWSFargateProfileReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result } controlPlane := &controlplanev1.AWSManagedControlPlane{} if err := r.Client.Get(ctx, controlPlaneKey, controlPlane); err != nil { - logger.Info("Failed to retrieve ControlPlane from AWSFargateProfile") + log.Info("Failed to retrieve ControlPlane from AWSFargateProfile") return reconcile.Result{}, nil } - logger = logger.WithValues("AWSManagedControlPlane", controlPlane.Name) - fargateProfileScope, err := scope.NewFargateProfileScope(scope.FargateProfileScopeParams{ - Logger: logger, Client: r.Client, ControllerName: "awsfargateprofile", Cluster: cluster, @@ -135,7 +127,7 @@ func (r *AWSFargateProfileReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result }() if !controlPlane.Status.Ready { - logger.Info("Control plane is not ready yet") + log.Info("Control plane is not ready yet") conditions.MarkFalse(fargateProfile, clusterv1.ReadyCondition, infrav1exp.WaitingForEKSControlPlaneReason, clusterv1.ConditionSeverityInfo, "") return ctrl.Result{}, nil } @@ -188,13 +180,15 @@ func (r *AWSFargateProfileReconciler) reconcileDelete( return res, nil } -func managedControlPlaneToFargateProfileMapFunc(c client.Client, log logr.Logger) handler.ToRequestsFunc { - return func(o handler.MapObject) []reconcile.Request { +func managedControlPlaneToFargateProfileMapFunc(c client.Client, log logr.Logger) handler.MapFunc { + return func(o client.Object) []ctrl.Request { ctx := context.Background() - awsControlPlane, ok := o.Object.(*controlplanev1.AWSManagedControlPlane) + + awsControlPlane, ok := o.(*controlplanev1.AWSManagedControlPlane) if !ok { - return nil + panic(fmt.Sprintf("Expected a AWSManagedControlPlane but got a %T", o)) } + if !awsControlPlane.ObjectMeta.DeletionTimestamp.IsZero() { return nil } diff --git a/exp/controllers/awsmachinepool_controller.go b/exp/controllers/awsmachinepool_controller.go index c6035dcbaa..1ee81fe2b5 100644 --- a/exp/controllers/awsmachinepool_controller.go +++ b/exp/controllers/awsmachinepool_controller.go @@ -21,9 +21,6 @@ import ( "fmt" "reflect" - "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/cluster-api/util/conditions" - "github.com/go-logr/logr" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" @@ -31,31 +28,33 @@ 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" "sigs.k8s.io/cluster-api-provider-aws/controllers" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" - capiv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha3" + ekscontrolplane "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + "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" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + capiv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha4" + "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/controllerutil" "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" - ekscontrolplane "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha3" - "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" ) // AWSMachinePoolReconciler reconciles a AWSMachinePool object type AWSMachinePoolReconciler struct { client.Client - Log logr.Logger Recorder record.EventRecorder + WatchFilterValue string asgServiceFactory func(cloud.ClusterScoper) services.ASGInterface ec2ServiceFactory func(scope.EC2Scope) services.EC2MachineInterface } @@ -83,9 +82,8 @@ func (r *AWSMachinePoolReconciler) getEC2Service(scope scope.EC2Scope) services. // +kubebuilder:rbac:groups="",resources=namespaces,verbs=get;list;watch // Reconcile is the reconciliation loop for AWSMachinePool -func (r *AWSMachinePoolReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr error) { - ctx := context.TODO() - logger := r.Log.WithValues("namespace", req.Namespace, "awsMachinePool", req.Name) +func (r *AWSMachinePoolReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error) { + log := ctrl.LoggerFrom(ctx) // Fetch the AWSMachinePool . awsMachinePool := &infrav1exp.AWSMachinePool{} @@ -103,32 +101,31 @@ func (r *AWSMachinePoolReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, r return reconcile.Result{}, err } if machinePool == nil { - logger.Info("MachinePool Controller has not yet set OwnerRef") + log.Info("MachinePool Controller has not yet set OwnerRef") return reconcile.Result{}, nil } - logger = logger.WithValues("machinePool", machinePool.Name) + log = log.WithValues("machinePool", machinePool.Name) // Fetch the Cluster. cluster, err := util.GetClusterFromMetadata(ctx, r.Client, machinePool.ObjectMeta) if err != nil { - logger.Info("MachinePool is missing cluster label or cluster does not exist") + log.Info("MachinePool is missing cluster label or cluster does not exist") return reconcile.Result{}, nil } - logger = logger.WithValues("cluster", cluster.Name) + log = log.WithValues("cluster", cluster.Name) - infraCluster, err := r.getInfraCluster(ctx, logger, cluster, awsMachinePool) + infraCluster, err := r.getInfraCluster(ctx, log, cluster, awsMachinePool) if err != nil { return ctrl.Result{}, errors.New("error getting infra provider cluster or control plane object") } if infraCluster == nil { - logger.Info("AWSCluster or AWSManagedControlPlane is not ready yet") + log.Info("AWSCluster or AWSManagedControlPlane is not ready yet") return ctrl.Result{}, nil } // Create the machine pool scope machinePoolScope, err := scope.NewMachinePoolScope(scope.MachinePoolScopeParams{ - Logger: logger, Client: r.Client, Cluster: cluster, MachinePool: machinePool, @@ -136,7 +133,7 @@ func (r *AWSMachinePoolReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, r AWSMachinePool: awsMachinePool, }) if err != nil { - logger.Error(err, "failed to create scope") + log.Error(err, "failed to create scope") return ctrl.Result{}, err } @@ -177,15 +174,14 @@ func (r *AWSMachinePoolReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, r } } -func (r *AWSMachinePoolReconciler) SetupWithManager(mgr ctrl.Manager) error { +func (r *AWSMachinePoolReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error { return ctrl.NewControllerManagedBy(mgr). For(&infrav1exp.AWSMachinePool{}). Watches( &source.Kind{Type: &capiv1exp.MachinePool{}}, - &handler.EnqueueRequestsFromMapFunc{ - ToRequests: machinePoolToInfrastructureMapFunc(infrav1exp.GroupVersion.WithKind("AWSMachinePool")), - }, + handler.EnqueueRequestsFromMapFunc(machinePoolToInfrastructureMapFunc(infrav1exp.GroupVersion.WithKind("AWSMachinePool"))), ). + WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)). Complete(r) } @@ -537,11 +533,11 @@ func getMachinePoolByName(ctx context.Context, c client.Client, namespace, name return m, nil } -func machinePoolToInfrastructureMapFunc(gvk schema.GroupVersionKind) handler.ToRequestsFunc { - return func(o handler.MapObject) []reconcile.Request { - m, ok := o.Object.(*capiv1exp.MachinePool) +func machinePoolToInfrastructureMapFunc(gvk schema.GroupVersionKind) handler.MapFunc { + return func(o client.Object) []reconcile.Request { + m, ok := o.(*capiv1exp.MachinePool) if !ok { - return nil + panic(fmt.Sprintf("Expected a MachinePool but got a %T", o)) } gk := gvk.GroupKind() diff --git a/exp/controllers/awsmachinepool_controller_test.go b/exp/controllers/awsmachinepool_controller_test.go index e918d27313..5f2f7842c0 100644 --- a/exp/controllers/awsmachinepool_controller_test.go +++ b/exp/controllers/awsmachinepool_controller_test.go @@ -21,27 +21,29 @@ import ( "context" "flag" "fmt" + "k8s.io/apimachinery/pkg/runtime" + "sigs.k8s.io/controller-runtime/pkg/client/fake" "github.com/golang/mock/gomock" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "github.com/pkg/errors" + "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/record" "k8s.io/klog/v2" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" - expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" "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/v1alpha3" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" "sigs.k8s.io/cluster-api/controllers/noderefutil" capierrors "sigs.k8s.io/cluster-api/errors" - expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha3" + expclusterv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha4" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" ) @@ -120,12 +122,7 @@ var _ = Describe("AWSMachinePoolReconciler", func() { ) Expect(err).To(BeNil()) - cs, err = scope.NewClusterScope( - scope.ClusterScopeParams{ - Cluster: &clusterv1.Cluster{}, - AWSCluster: &infrav1.AWSCluster{}, - }, - ) + cs, err = setupCluster("test-cluster") Expect(err).To(BeNil()) mockCtrl = gomock.NewController(GinkgoT()) @@ -314,3 +311,20 @@ func expectConditions(m *expinfrav1.AWSMachinePool, expected []conditionAssertio Expect(actual.Reason).To(Equal(c.reason)) } } + +func setupCluster(clusterName string) (*scope.ClusterScope, error) { + scheme := runtime.NewScheme() + _ = infrav1.AddToScheme(scheme) + awsCluster := &infrav1.AWSCluster{ + ObjectMeta: metav1.ObjectMeta{Name: "test"}, + Spec: infrav1.AWSClusterSpec{}, + } + client := fake.NewClientBuilder().WithScheme(scheme).WithObjects(awsCluster).Build() + return scope.NewClusterScope(scope.ClusterScopeParams{ + Cluster: &clusterv1.Cluster{ + ObjectMeta: metav1.ObjectMeta{Name: clusterName}, + }, + AWSCluster: awsCluster, + Client: client, + }) +} diff --git a/exp/controllers/awsmachinepool_tags.go b/exp/controllers/awsmachinepool_tags.go index cf4c7b7abc..2232d8e734 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/v1alpha3" + expinfrav1 "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services" ) diff --git a/exp/controllers/awsmanagedcluster_controller.go b/exp/controllers/awsmanagedcluster_controller.go index e9b51202fe..9dbaafca43 100644 --- a/exp/controllers/awsmanagedcluster_controller.go +++ b/exp/controllers/awsmanagedcluster_controller.go @@ -25,28 +25,28 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/tools/record" - - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" + controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3" + ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" "sigs.k8s.io/cluster-api/util" + "sigs.k8s.io/cluster-api/util/annotations" "sigs.k8s.io/cluster-api/util/patch" "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/handler" "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - - ekscontrolplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha3" ) // AWSManagedClusterReconciler reconciles AWSManagedCluster type AWSManagedClusterReconciler struct { client.Client - Log logr.Logger - Recorder record.EventRecorder + Log logr.Logger + Recorder record.EventRecorder + WatchFilterValue string } // +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=awsmanagedclusters,verbs=get;list;watch;create;update;patch;delete @@ -55,9 +55,8 @@ type AWSManagedClusterReconciler struct { // +kubebuilder:rbac:groups=cluster.x-k8s.io,resources=clusters;clusters/status,verbs=get;list;watch // +kubebuilder:rbac:groups="",resources=secrets,verbs=get;list;watch;create;update;patch;delete -func (r *AWSManagedClusterReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr error) { - ctx := context.Background() - log := r.Log.WithValues("namespace", req.Namespace, "awsManagedCluster", req.Name) +func (r *AWSManagedClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error) { + log := ctrl.LoggerFrom(ctx) // Fetch the AWSManagedCluster instance awsManagedCluster := &infrav1exp.AWSManagedCluster{} @@ -79,7 +78,7 @@ func (r *AWSManagedClusterReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result return reconcile.Result{}, nil } - if util.IsPaused(cluster, awsManagedCluster) { + if annotations.IsPaused(cluster, awsManagedCluster) { log.Info("AWSManagedCluster or linked Cluster is marked as paused. Won't reconcile") return reconcile.Result{}, nil } @@ -118,13 +117,13 @@ func (r *AWSManagedClusterReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result } -func (r *AWSManagedClusterReconciler) SetupWithManager(mgr ctrl.Manager, options controller.Options) error { +func (r *AWSManagedClusterReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error { awsManagedCluster := &infrav1exp.AWSManagedCluster{} controller, err := ctrl.NewControllerManagedBy(mgr). WithOptions(options). For(awsManagedCluster). - WithEventFilter(predicates.ResourceNotPaused(r.Log)). + WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)). Build(r) if err != nil { @@ -134,9 +133,7 @@ func (r *AWSManagedClusterReconciler) SetupWithManager(mgr ctrl.Manager, options // Add a watch for clusterv1.Cluster unpaise if err = controller.Watch( &source.Kind{Type: &clusterv1.Cluster{}}, - &handler.EnqueueRequestsFromMapFunc{ - ToRequests: util.ClusterToInfrastructureMapFunc(awsManagedCluster.GroupVersionKind()), - }, + handler.EnqueueRequestsFromMapFunc(util.ClusterToInfrastructureMapFunc(awsManagedCluster.GroupVersionKind())), predicates.ClusterUnpaused(r.Log), ); err != nil { return fmt.Errorf("failed adding a watch for ready clusters: %w", err) @@ -145,9 +142,7 @@ func (r *AWSManagedClusterReconciler) SetupWithManager(mgr ctrl.Manager, options // Add a watch for AWSManagedControlPlane if err = controller.Watch( &source.Kind{Type: &ekscontrolplanev1.AWSManagedControlPlane{}}, - &handler.EnqueueRequestsFromMapFunc{ - ToRequests: handler.ToRequestsFunc(r.managedControlPlaneToManagedCluster), - }, + handler.EnqueueRequestsFromMapFunc(r.managedControlPlaneToManagedCluster), ); err != nil { return fmt.Errorf("failed adding watch on AWSManagedControlPlane: %w", err) } @@ -155,14 +150,13 @@ func (r *AWSManagedClusterReconciler) SetupWithManager(mgr ctrl.Manager, options return nil } -func (r *AWSManagedClusterReconciler) managedControlPlaneToManagedCluster(o handler.MapObject) []ctrl.Request { +func (r *AWSManagedClusterReconciler) managedControlPlaneToManagedCluster(o client.Object) []ctrl.Request { ctx, cancel := context.WithTimeout(context.Background(), 60*time.Second) defer cancel() - awsManagedControlPlane, ok := o.Object.(*ekscontrolplanev1.AWSManagedControlPlane) + awsManagedControlPlane, ok := o.(*controlplanev1.AWSManagedControlPlane) if !ok { - r.Log.Error(nil, fmt.Sprintf("Expected a AWSManagedControlPlane but got a %T", o.Object)) - return nil + panic(fmt.Sprintf("Expected a managedControlPlane but got a %T", o)) } if !awsManagedControlPlane.ObjectMeta.DeletionTimestamp.IsZero() { diff --git a/exp/controllers/awsmanagedmachinepool_controller.go b/exp/controllers/awsmanagedmachinepool_controller.go index 9632150630..1d85d9e903 100644 --- a/exp/controllers/awsmanagedmachinepool_controller.go +++ b/exp/controllers/awsmanagedmachinepool_controller.go @@ -18,16 +18,20 @@ package controllers import ( "context" + "fmt" "github.com/go-logr/logr" "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/tools/record" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" - capiv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha3" + controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha4" + infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" + "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" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/predicates" @@ -39,45 +43,37 @@ import ( "sigs.k8s.io/controller-runtime/pkg/handler" "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - - controlplanev1 "sigs.k8s.io/cluster-api-provider-aws/controlplane/eks/api/v1alpha3" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha3" - "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/scope" - "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/eks" ) // AWSManagedMachinePoolReconciler reconciles a AWSManagedMachinePool object type AWSManagedMachinePoolReconciler struct { client.Client - Log logr.Logger - Recorder record.EventRecorder - Endpoints []scope.ServiceEndpoint - - EnableIAM bool + Recorder record.EventRecorder + Endpoints []scope.ServiceEndpoint + EnableIAM bool + WatchFilterValue string } // SetupWithManager is used to setup the controller -func (r *AWSManagedMachinePoolReconciler) SetupWithManager(mgr ctrl.Manager, options controller.Options) error { +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()) if err != nil { return errors.Wrapf(err, "failed to find GVK for AWSManagedMachinePool") } - managedControlPlaneToManagedMachinePoolMap := managedControlPlaneToManagedMachinePoolMapFunc(r.Client, gvk, r.Log) + managedControlPlaneToManagedMachinePoolMap := managedControlPlaneToManagedMachinePoolMapFunc(r.Client, gvk, log) return ctrl.NewControllerManagedBy(mgr). For(&infrav1exp.AWSManagedMachinePool{}). WithOptions(options). - WithEventFilter(predicates.ResourceNotPaused(r.Log)). + WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(log, r.WatchFilterValue)). Watches( &source.Kind{Type: &capiv1exp.MachinePool{}}, - &handler.EnqueueRequestsFromMapFunc{ - ToRequests: machinePoolToInfrastructureMapFunc(gvk), - }, + handler.EnqueueRequestsFromMapFunc(machinePoolToInfrastructureMapFunc(gvk)), ). Watches( &source.Kind{Type: &controlplanev1.AWSManagedControlPlane{}}, - &handler.EnqueueRequestsFromMapFunc{ - ToRequests: managedControlPlaneToManagedMachinePoolMap, - }, + handler.EnqueueRequestsFromMapFunc(managedControlPlaneToManagedMachinePoolMap), ). Complete(r) } @@ -89,9 +85,8 @@ func (r *AWSManagedMachinePoolReconciler) SetupWithManager(mgr ctrl.Manager, opt // +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=awsmanagedmachinepools/status,verbs=get;update;patch // Reconcile reconciles AWSManagedMachinePools -func (r *AWSManagedMachinePoolReconciler) Reconcile(req ctrl.Request) (_ ctrl.Result, reterr error) { - logger := r.Log.WithValues("namespace", req.Namespace, "AWSManagedMachinePool", req.Name) - ctx := context.Background() +func (r *AWSManagedMachinePoolReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error) { + log := ctrl.LoggerFrom(ctx) awsPool := &infrav1exp.AWSManagedMachinePool{} if err := r.Get(ctx, req.NamespacedName, awsPool); err != nil { @@ -103,23 +98,23 @@ func (r *AWSManagedMachinePoolReconciler) Reconcile(req ctrl.Request) (_ ctrl.Re machinePool, err := getOwnerMachinePool(ctx, r.Client, awsPool.ObjectMeta) if err != nil { - logger.Error(err, "Failed to retrieve owner MachinePool from the API Server") + log.Error(err, "Failed to retrieve owner MachinePool from the API Server") return ctrl.Result{}, err } if machinePool == nil { - logger.Info("MachinePool Controller has not yet set OwnerRef") + log.Info("MachinePool Controller has not yet set OwnerRef") return ctrl.Result{}, nil } - logger = logger.WithValues("MachinePool", machinePool.Name) + log = log.WithValues("MachinePool", machinePool.Name) cluster, err := util.GetClusterFromMetadata(ctx, r.Client, machinePool.ObjectMeta) if err != nil { - logger.Info("Failed to retrieve Cluster from MachinePool") + log.Info("Failed to retrieve Cluster from MachinePool") return reconcile.Result{}, nil } - logger = logger.WithValues("Cluster", cluster.Name) + log = log.WithValues("Cluster", cluster.Name) controlPlaneKey := client.ObjectKey{ Namespace: awsPool.Namespace, @@ -127,20 +122,17 @@ func (r *AWSManagedMachinePoolReconciler) Reconcile(req ctrl.Request) (_ ctrl.Re } controlPlane := &controlplanev1.AWSManagedControlPlane{} if err := r.Client.Get(ctx, controlPlaneKey, controlPlane); err != nil { - logger.Info("Failed to retrieve ControlPlane from MachinePool") + log.Info("Failed to retrieve ControlPlane from MachinePool") return reconcile.Result{}, nil } - logger = logger.WithValues("AWSManagedControlPlane", controlPlane.Name) - if !controlPlane.Status.Ready { - logger.Info("Control plane is not ready yet") + log.Info("Control plane is not ready yet") conditions.MarkFalse(awsPool, infrav1exp.EKSNodegroupReadyCondition, infrav1exp.WaitingForEKSControlPlaneReason, clusterv1.ConditionSeverityInfo, "") return ctrl.Result{}, nil } machinePoolScope, err := scope.NewManagedMachinePoolScope(scope.ManagedMachinePoolScopeParams{ - Logger: logger, Client: r.Client, ControllerName: "awsmanagedmachinepool", Cluster: cluster, @@ -231,13 +223,14 @@ func GetOwnerClusterKey(obj metav1.ObjectMeta) (*client.ObjectKey, error) { return nil, nil } -func managedControlPlaneToManagedMachinePoolMapFunc(c client.Client, gvk schema.GroupVersionKind, log logr.Logger) handler.ToRequestsFunc { - return func(o handler.MapObject) []reconcile.Request { +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.Object.(*controlplanev1.AWSManagedControlPlane) + awsControlPlane, ok := o.(*controlplanev1.AWSManagedControlPlane) if !ok { - return nil + panic(fmt.Sprintf("Expected a AWSManagedControlPlane but got a %T", o)) } + if !awsControlPlane.ObjectMeta.DeletionTimestamp.IsZero() { return nil } @@ -263,9 +256,7 @@ func managedControlPlaneToManagedMachinePoolMapFunc(c client.Client, gvk schema. var results []ctrl.Request for i := range managedPoolForClusterList.Items { - managedPool := mapFunc.Map(handler.MapObject{ - Object: &managedPoolForClusterList.Items[i], - }) + managedPool := mapFunc(&managedPoolForClusterList.Items[i]) results = append(results, managedPool...) } diff --git a/exp/controllers/suite_test.go b/exp/controllers/suite_test.go index 77853c411b..e580f43637 100644 --- a/exp/controllers/suite_test.go +++ b/exp/controllers/suite_test.go @@ -22,20 +22,20 @@ import ( "path" "testing" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/golang/mock/gomock" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha3" + "github.com/golang/mock/gomock" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" "sigs.k8s.io/cluster-api-provider-aws/test/helpers" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" - clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha3" + 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/client" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" // +kubebuilder:scaffold:imports ) @@ -48,6 +48,7 @@ var ( cfg *rest.Config k8sClient client.Client mockCtrl *gomock.Controller + ctx = ctrl.SetupSignalHandler() ) func TestAPIs(t *testing.T) { @@ -100,7 +101,7 @@ func setup() { } go func() { fmt.Println("Starting the manager") - if err := testEnv.StartManager(); err != nil { + if err := testEnv.StartManager(ctx); err != nil { panic(fmt.Sprintf("Failed to start the envtest manager: %v", err)) } }() diff --git a/exp/instancestate/awsinstancestate_controller.go b/exp/instancestate/awsinstancestate_controller.go index 28e5de9b31..bf0a9715dd 100644 --- a/exp/instancestate/awsinstancestate_controller.go +++ b/exp/instancestate/awsinstancestate_controller.go @@ -27,11 +27,12 @@ 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/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" "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" "sigs.k8s.io/cluster-api/util/patch" + "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" @@ -47,6 +48,7 @@ type AwsInstanceStateReconciler struct { sqsServiceFactory func() sqsiface.SQSAPI queueURLs sync.Map Endpoints []scope.ServiceEndpoint + WatchFilterValue string } // +kubebuilder:rbac:groups=infrastructure.cluster.x-k8s.io,resources=awsclusters,verbs=get;list;watch @@ -69,10 +71,7 @@ func (r *AwsInstanceStateReconciler) getSQSService(region string) (sqsiface.SQSA return scope.NewGlobalSQSClient(globalScope, globalScope), nil } -func (r *AwsInstanceStateReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { - ctx := context.TODO() - _ = r.Log.WithValues("namespace", req.NamespacedName, "awsInstanceState", req.Name) - +func (r *AwsInstanceStateReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { // Fetch the AWSCluster instance awsCluster := &infrav1.AWSCluster{} err := r.Get(ctx, req.NamespacedName, awsCluster) @@ -103,14 +102,14 @@ func (r *AwsInstanceStateReconciler) Reconcile(req ctrl.Request) (ctrl.Result, e return ctrl.Result{}, nil } -func (r *AwsInstanceStateReconciler) SetupWithManager(mgr ctrl.Manager, options controller.Options) error { +func (r *AwsInstanceStateReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error { go func() { r.watchQueuesForInstanceEvents() }() return ctrl.NewControllerManagedBy(mgr). For(&infrav1.AWSCluster{}). WithOptions(options). - WithEventFilter(controllers.PausedPredicates(r.Log)). + WithEventFilter(predicates.ResourceNotPausedAndHasFilterLabel(ctrl.LoggerFrom(ctx), r.WatchFilterValue)). Complete(r) } diff --git a/exp/instancestate/awsinstancestate_controller_test.go b/exp/instancestate/awsinstancestate_controller_test.go index 2d391b9e86..a38d0b28bf 100644 --- a/exp/instancestate/awsinstancestate_controller_test.go +++ b/exp/instancestate/awsinstancestate_controller_test.go @@ -18,15 +18,16 @@ package instancestate import ( "context" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sqs" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/utils/pointer" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" "sigs.k8s.io/cluster-api-provider-aws/controllers" "sigs.k8s.io/controller-runtime/pkg/controller" @@ -74,9 +75,9 @@ var _ = Describe("AWSInstanceStateController", func() { sqsSvs.EXPECT().DeleteMessage(&sqs.DeleteMessageInput{QueueUrl: aws.String("aws-cluster-1-url"), ReceiptHandle: aws.String("message-receipt-handle")}).AnyTimes(). Return(nil, nil) - Expect(k8sManager.GetFieldIndexer().IndexField(&infrav1.AWSMachine{}, + Expect(k8sManager.GetFieldIndexer().IndexField(context.Background(), &infrav1.AWSMachine{}, controllers.InstanceIDIndex, - func(o runtime.Object) []string { + func(o client.Object) []string { m := o.(*infrav1.AWSMachine) if m.Spec.InstanceID != nil { return []string{*m.Spec.InstanceID} @@ -84,13 +85,11 @@ var _ = Describe("AWSInstanceStateController", func() { return nil }, )).ToNot(HaveOccurred()) - err := instanceStateReconciler.SetupWithManager(k8sManager, controller.Options{}) + err := instanceStateReconciler.SetupWithManager(context.Background(), k8sManager, controller.Options{}) Expect(err).ToNot(HaveOccurred()) - stop := make(chan struct{}) - defer close(stop) go func() { defer GinkgoRecover() - err := k8sManager.Start(stop) + err := k8sManager.Start(ctrl.SetupSignalHandler()) Expect(err).ToNot(HaveOccurred()) }() diff --git a/exp/instancestate/helpers_test.go b/exp/instancestate/helpers_test.go index fdba9202bc..231b79ca70 100644 --- a/exp/instancestate/helpers_test.go +++ b/exp/instancestate/helpers_test.go @@ -18,6 +18,7 @@ package instancestate import ( "context" + "sigs.k8s.io/controller-runtime/pkg/client" "time" . "github.com/onsi/ginkgo" @@ -25,9 +26,8 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" ) func createAWSCluster(name string) *infrav1.AWSCluster { @@ -39,7 +39,7 @@ func createAWSCluster(name string) *infrav1.AWSCluster { } } -func persistObject(o runtime.Object) { +func persistObject(o client.Object) { ctx := context.TODO() Expect(k8sClient.Create(ctx, o)).Should(Succeed()) metaObj, err := meta.Accessor(o) diff --git a/exp/instancestate/suite_test.go b/exp/instancestate/suite_test.go index 487838c405..f7cbc18b02 100644 --- a/exp/instancestate/suite_test.go +++ b/exp/instancestate/suite_test.go @@ -19,26 +19,26 @@ package instancestate import ( "testing" - "github.com/aws/aws-sdk-go/service/sqs/sqsiface" - "github.com/golang/mock/gomock" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + + "github.com/aws/aws-sdk-go/service/sqs/sqsiface" + "github.com/golang/mock/gomock" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" "k8s.io/klog/v2" "k8s.io/klog/v2/klogr" "path/filepath" - infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha3" - infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha3" + infrav1 "sigs.k8s.io/cluster-api-provider-aws/api/v1alpha4" + infrav1exp "sigs.k8s.io/cluster-api-provider-aws/exp/api/v1alpha4" "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/services/instancestate/mock_sqsiface" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3" - clusterv1exp "sigs.k8s.io/cluster-api/exp/api/v1alpha3" + 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/client" "sigs.k8s.io/controller-runtime/pkg/envtest" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" logf "sigs.k8s.io/controller-runtime/pkg/log" - "sigs.k8s.io/controller-runtime/pkg/log/zap" ) // These tests use Ginkgo (BDD-style Go testing framework). Refer to @@ -69,7 +69,6 @@ func TestAPIs(t *testing.T) { } var _ = BeforeSuite(func(done Done) { - logf.SetLogger(zap.LoggerTo(GinkgoWriter, true)) By("bootstrapping test environment") testEnv = &envtest.Environment{ CRDDirectoryPaths: []string{filepath.Join("../..", "config", "crd", "bases")}, diff --git a/go.mod b/go.mod index 6cf7681542..81d5728668 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module sigs.k8s.io/cluster-api-provider-aws -go 1.13 +go 1.16 require ( github.com/apparentlymart/go-cidr v1.1.0 @@ -9,32 +9,31 @@ require ( github.com/aws/aws-sdk-go v1.36.26 github.com/awslabs/goformation/v4 v4.15.0 github.com/blang/semver v3.5.1+incompatible - github.com/go-logr/logr v0.1.0 + github.com/go-logr/logr v0.4.0 github.com/golang/mock v1.4.4 github.com/google/goexpect v0.0.0-20200816234442-b5b77125c2c5 github.com/google/goterm v0.0.0-20200907032337-555d40f16ae2 // indirect - github.com/onsi/ginkgo v1.14.1 - github.com/onsi/gomega v1.10.2 + github.com/onsi/ginkgo v1.15.2 + github.com/onsi/gomega v1.11.0 github.com/pkg/errors v0.9.1 - github.com/prometheus/client_golang v1.7.1 + github.com/prometheus/client_golang v1.9.0 github.com/sergi/go-diff v1.1.0 - github.com/spf13/cobra v1.0.0 + github.com/spf13/cobra v1.1.3 github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 - golang.org/x/crypto v0.0.0-20200930160638-afb6bcd081ae - golang.org/x/net v0.0.0-20201110031124-69a78807bb2b - gopkg.in/yaml.v2 v2.3.0 - k8s.io/api v0.17.9 - k8s.io/apiextensions-apiserver v0.17.9 - k8s.io/apimachinery v0.17.9 - k8s.io/cli-runtime v0.17.9 - k8s.io/client-go v0.17.9 - k8s.io/component-base v0.17.9 - k8s.io/klog v1.0.0 - k8s.io/klog/v2 v2.0.0 - k8s.io/utils v0.0.0-20200912215256-4140de9c8800 - sigs.k8s.io/aws-iam-authenticator v0.5.1 - sigs.k8s.io/cluster-api v0.3.15-0.20210309173700-34de71aaaac8 - sigs.k8s.io/controller-runtime v0.5.14 + golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 + golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 + gopkg.in/yaml.v2 v2.4.0 + k8s.io/api v0.21.0-beta.1 + k8s.io/apiextensions-apiserver v0.21.0-beta.1 + k8s.io/apimachinery v0.21.0-beta.1 + k8s.io/cli-runtime v0.21.0-beta.1 + k8s.io/client-go v0.21.0-beta.1 + k8s.io/component-base v0.21.0-beta.1 + k8s.io/klog/v2 v2.8.0 + k8s.io/utils v0.0.0-20210305010621-2afb4311ab10 + sigs.k8s.io/aws-iam-authenticator v0.5.2 + sigs.k8s.io/cluster-api v0.3.11-0.20210416165222-506078bb31ba + sigs.k8s.io/controller-runtime v0.9.0-alpha.1 sigs.k8s.io/yaml v1.2.0 ) diff --git a/go.sum b/go.sum index 5376d9bc2a..de256eab93 100644 --- a/go.sum +++ b/go.sum @@ -1,50 +1,96 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +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= +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/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= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78 h1:w+iIsaOQNcT7OZ575w+acHgRric5iCyQh+xv+KJ4HB8= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= +github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= +github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw= github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= +github.com/Azure/go-autorest/autorest/adal v0.9.5/go.mod h1:B7KF7jKIeC9Mct5spmyCB/A8CG/sEz1vwIRGv/bbw7A= github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= +github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= +github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= +github.com/Azure/go-autorest/logger v0.2.0/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/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/MakeNowJust/heredoc v0.0.0-20170808103936-bb23615498cd/go.mod h1:64YHyfSL2R96J44Nlwm39UHepQbyR5q10x7iYa1ks2E= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= +github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= +github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= +github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/alessio/shellescape v0.0.0-20190409004728-b115ca0f9053 h1:H/GMMKYPkEIC3DF/JWQz8Pdd+Feifov2EIgGfNpeogI= -github.com/alessio/shellescape v0.0.0-20190409004728-b115ca0f9053/go.mod h1:xW8sBma2LE3QxFSzCnH9qe6gAE2yO9GvQaWwX89HxbE= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= +github.com/alessio/shellescape v1.2.2 h1:8LnL+ncxhWT2TR00dfJRT25JWWrhkMZXneHVWnetDZg= +github.com/alessio/shellescape v1.2.2/go.mod h1:PZAiSCk0LJaZkiCSkPv8qIobYglO3FPpyFjDCtHLS30= github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae/go.mod h1:CgnQgUtFrFz9mxFNtED3jI5tLDjKlOM+oUF/sTk6ps0= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= +github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= 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/aryann/difflib v0.0.0-20170710044230-e206f873d14a/go.mod h1:DAHtR1m6lCRdSC2Tm3DSWRPvIPr6xNKyeHdqDQSQT+A= 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.7.5 h1:ZDyu2irxGwEfcIzVm8nTVEA6cs94Hd80UmnLjRWQPpc= github.com/aws/amazon-vpc-cni-k8s v1.7.5/go.mod h1:WFg/NerFMpie+WZBSWvlSojmKkqGV2cznQPdQS6Uwh4= +github.com/aws/aws-lambda-go v1.13.3/go.mod h1:4UKl9IzQMoD+QF79YdCuzCwp8VbmG4VAQwij/eHl5CU= github.com/aws/aws-lambda-go v1.23.0 h1:Vjwow5COkFJp7GePkk9kjAo/DyX36b7wVPKwseQZbRo= github.com/aws/aws-lambda-go v1.23.0/go.mod h1:jJmlefzPfGnckuHdXX7/80O3BvUUi12XOkbv4w9SGLU= +github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.30.0/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.33.14/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/aws/aws-sdk-go v1.36.26 h1:710u7Q1xpbzpigh/RPPUXwr/5X/VwCxTXSeam8icgos= github.com/aws/aws-sdk-go v1.36.26/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/awslabs/goformation/v4 v4.15.0 h1:yZM85dzEKrRIPpMZIdsUV+EWbvhWsfoqC81Fv/aFPck= github.com/awslabs/goformation/v4 v4.15.0/go.mod h1:GcJULxCJfloT+3pbqCluXftdEK2AD/UqpS3hkaaBntg= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -53,28 +99,38 @@ 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/bifurcation/mint v0.0.0-20180715133206-93c51c6ce115/go.mod h1:zVt7zX3K/aDCk9Tj+VM7YymsX66ERvzCJzw8rFCX2JU= +github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84= github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/buger/jsonparser v0.0.0-20180808090653-f4dd9f5a6b44/go.mod h1:bbYlZJ7hK1yFx9hf58LP0zeX7UjIGs20ufpu3evjr+s= github.com/caddyserver/caddy v1.0.3 h1:i9gRhBgvc5ifchwWtSe7pDpsdS9+Q0Rw9oYQmYUTw1w= github.com/caddyserver/caddy v1.0.3/go.mod h1:G+ouvOY32gENkJC+jhgl62TyhvqEsFaDiZ4uw0RzP1E= +github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= +github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= 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/chai2010/gettext-go v0.0.0-20160711120539-c6fed771bfd5/go.mod h1:/iP1qXHoty45bqomnu2LM+VVyAEdWN+vtSHGlQgyxbw= github.com/cheekybits/genny v0.0.0-20170328200008-9127e812e1e9/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= +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= +github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= 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/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= github.com/containernetworking/plugins v0.8.6/go.mod h1:qnw5mN19D8fIwkqW7oHHYDHVlzhJpcY6TQxn/fUyDDM= github.com/coredns/corefile-migration v1.0.11 h1:ptBYGW2ADXIB7ZEBPrhhTvNwJLQfxE3Q9IUMBhJCEeI= github.com/coredns/corefile-migration v1.0.11/go.mod h1:RMy/mXdeDlYwzt0vdMEJvT2hGJ2I86/eO0UdXmH9XNI= 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= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-iptables v0.4.5/go.mod h1:/mVI274lEDI2ns62jHCDnCyBF9Iwsmekav8Dbxlm1MU= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= @@ -83,7 +139,6 @@ github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= -github.com/coreos/pkg v0.0.0-20180108230652-97fdf19511ea/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10 h1:BSKMNlYxDvnunlTymqtgONjNnaRV1sTpcovwwjF22jk= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= @@ -91,6 +146,7 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma 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/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= github.com/d2g/dhcp4server v0.0.0-20181031114812-7d4a0a7f59a5/go.mod h1:Eo87+Kg/IX2hfWJfwxMzLyuSZyxSoAug2nGa1G2QAi8= @@ -99,50 +155,75 @@ github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/daviddengcn/go-colortext v0.0.0-20160507010035-511bcaf42ccd/go.mod h1:dv4zxwHi5C/8AeI+4gX4dCWOIvNi7I6JCSX0HvlKPgE= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= 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/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= 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 v1.0.3-0.20200709223903-efdb65b94e5a h1:pf3CyiWgjOLL7cjFos89AEOPCWSOoQt7tgbEk/SvBAg= -github.com/drone/envsubst v1.0.3-0.20200709223903-efdb65b94e5a/go.mod h1:N2jZmlMufstn1KEqvbHjw40h1KyTmnVzHcSc9bFiJ2g= +github.com/drone/envsubst/v2 v2.0.0-20210305151453-490366e43a3c h1:VoSR0fgAFnC+fYiT50kIhCN8+eEDMx/CMzKh+AJCt9w= +github.com/drone/envsubst/v2 v2.0.0-20210305151453-490366e43a3c/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/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= +github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= +github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/evanphx/json-patch v0.0.0-20200808040245-162e5629780b/go.mod h1:NAJj0yf/KaRKURN6nyi7A9IZydMivZEm9oQLWNjfKDc= github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.5.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/evanphx/json-patch v4.9.0+incompatible h1:kLcOMZeuLAJvL2BPWLMIj5oaZQobrkAqrL+WFZwQses= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= +github.com/evanphx/json-patch/v5 v5.1.0 h1:B0aXl1o/1cP8NbviYiBMkcHBtUjIJ1/Ccg6b+SwCLQg= +github.com/evanphx/json-patch/v5 v5.1.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 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= +github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= 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/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= +github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= 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/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/go-acme/lego v2.5.0+incompatible/go.mod h1:yzMNe9CasVUhkquNvti5nAtPmG94USbYxYrZfTkIn0M= +github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.10.0/go.mod h1:xUsJbQ/Fp4kEt7AFgCuvyX4a71u8h9jB8tj/ORgOZ7o= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logr/logr v0.1.0 h1:M1Tv3VzNlEHg6uyACnRdtrploV2P7wZqH8BoQMtz0cg= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/zapr v0.1.0 h1:h+WVe9j6HAA01niTJPA/kKH0i7e0rLZBCwauQFcRE54= -github.com/go-logr/zapr v0.1.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= +github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= +github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= +github.com/go-logr/zapr v0.4.0 h1:uc1uML3hRYL9/ZZPdgHS/n8Nzo+eaYL/Efxkkamf7OM= +github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aAiEnk= github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277/go.mod h1:k70tL6pCuVxPJOHXQ+wIac1FUrvNkHolPie/cLEU6hI= github.com/go-openapi/analysis v0.17.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= github.com/go-openapi/analysis v0.18.0/go.mod h1:IowGgpVeD0vNm45So8nr+IcQ3pxVtpRoBWb8PVZO0ik= @@ -174,10 +255,12 @@ github.com/go-openapi/spec v0.17.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsd github.com/go-openapi/spec v0.18.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI= github.com/go-openapi/spec v0.19.2/go.mod h1:sCxk3jxKgioEJikev4fgkNmwS+3kuYdJtcsZsD5zxMY= 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/strfmt v0.17.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.18.0/go.mod h1:P82hnJI0CXkErkXi8IKjPbNBM6lV6+5pLP5l494TcyU= github.com/go-openapi/strfmt v0.19.0/go.mod h1:+uW+93UVvGGq2qGaZxdDeJqSAqBqBdl+ZPMF/cC8nDY= github.com/go-openapi/strfmt v0.19.3/go.mod h1:0yX7dbo8mKIvc3XSKp7MNfxw4JytCfCD6+bY1AVL9LU= +github.com/go-openapi/strfmt v0.19.5/go.mod h1:eftuHTlB/dI8Uq8JJOyRlieZf+WkkxUuk0dgdHXr2Qk= github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= github.com/go-openapi/swag v0.18.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg= @@ -185,26 +268,35 @@ github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= -github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= +github.com/go-openapi/validate v0.19.8/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= +github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gobuffalo/flect v0.2.2 h1:PAVD7sp0KOdfswjAw9BpLCU9hXo7wFSzgpQ+zNeks/A= github.com/gobuffalo/flect v0.2.2/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc= +github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= github.com/godbus/dbus v0.0.0-20180201030542-885f9cc04c9c/go.mod h1:/YcGZj5zSblfDWMMoOzV4fas9FZnQYTkDnsGvmh2Grw= github.com/gofrs/flock v0.7.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= @@ -213,24 +305,31 @@ github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/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= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.4.1 h1:/exdXoGamhu5ONeUJH0deniYLWYvQwW66yvlfiiKTu0= -github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +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= @@ -239,29 +338,43 @@ github.com/google/goexpect v0.0.0-20200816234442-b5b77125c2c5/go.mod h1:n1ej5+Fq github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gopacket v1.1.17/go.mod h1:UdDNZ1OO62aGYVnPhxT1U6aI7ukYtA/kB8vaU0diBUM= github.com/google/goterm v0.0.0-20190703233501-fc88cf888a3f/go.mod h1:nOFQdrUlIlx6M6ODdSpBj1NVA+VgLC6kmw60mkw34H4= github.com/google/goterm v0.0.0-20200907032337-555d40f16ae2 h1:CVuJwN34x4xM2aT4sIKhmeib40NeBPhRihNjQmpJsA4= github.com/google/goterm v0.0.0-20200907032337-555d40f16ae2/go.mod h1:nOFQdrUlIlx6M6ODdSpBj1NVA+VgLC6kmw60mkw34H4= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= 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= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= 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 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= +github.com/google/uuid v1.1.2/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/gnostic v0.0.0-20170426233943-68f4ded48ba9/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= 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.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.3.1 h1:WeAefnSUHlBb0iJKwxFDZdbfGwkd7xRNuV+IpXMJhYk= -github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= +github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= +github.com/googleapis/gnostic v0.5.4 h1:ynbQIWjLw7iv6HAFdixb30U7Uvcmx+f4KlLJpmhkTK0= +github.com/googleapis/gnostic v0.5.4/go.mod h1:TRWw1s4gxBGjSe301Dai3c7wXJAZy57+/6tawkOvqHQ= 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/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= +github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v0.0.0-20170926233335-4201258b820c/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gosuri/uitable v0.0.4 h1:IG2xLKRvErL3uhY6e1BylFzG+aJiwQviDDTfOKeKTpY= github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= @@ -271,7 +384,22 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/api v1.3.0/go.mod h1:MmDNSzIMUjNpY/mQ398R4bk2FnqQLoPndWW5VkKPlCE= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.3.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +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-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 v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +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= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -279,53 +407,71 @@ github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+l github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= 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/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/imdario/mergo v0.3.9 h1:UauaLniWCFHWd+Jp9oCEkTBj8VO/9DKg3PV3VCNMDIg= -github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/influxdata/influxdb1-client v0.0.0-20191209144304-8bf82d3c094d/go.mod h1:qj24IKcXYK6Iy9ceXlo3Tc+vtHo9lIhSX5JddghvEPo= github.com/j-keck/arping v0.0.0-20160618110441-2cf9dc699c56/go.mod h1:ymszkNOg6tORTn+6F6j+Jc8TOr5osrynvN6ivFWZ2GA= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jimstudt/http-authentication v0.0.0-20140401203705-3eca13d6893a/go.mod h1:wK6yTYYcgjHE1Z1QtXACPDjcFJyBskHEdagmnq3vsP8= +github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 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.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= 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= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE= +github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= +github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= github.com/lucas-clemente/aes12 v0.0.0-20171027163421-cd47fb39b79f/go.mod h1:JpH9J1c9oX6otFSgdUHwUBUizmKlrMjxWnIAjff4m04= github.com/lucas-clemente/quic-clients v0.1.0/go.mod h1:y5xVIEoObKqULIKivu+gD/LU90pL73bTdtQjPBvtCBk= github.com/lucas-clemente/quic-go v0.10.2/go.mod h1:hvaRS9IHjFLMq76puFJeWNfmn+H70QZ/CXoxqw9bzao= github.com/lucas-clemente/quic-go-certificates v0.0.0-20160823095156-d2f86524cced/go.mod h1:NCcRLrOTZbzhZvixZLlERbJtDtYsmMw8Jc4vS8Z0g58= +github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -335,25 +481,43 @@ github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= +github.com/markbates/pkger v0.17.1/go.mod h1:0JoVlrol20BSywW79rN3kdFFsE5xYM+rSCQDXbLhiuI= github.com/marten-seemann/qtls v0.2.3/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= 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.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +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.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-runewidth v0.0.2 h1:UnlwIPBGaTZfPQ6T1IGzPI0EkYAQmT9fAEJ/poFC63o= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54= +github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-shellwords v1.0.3/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +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/mholt/certmagic v0.6.2-0.20190624175158-6a42ef9fe8c2/go.mod h1:g4cOPxcjV0oFq3qwpjSA30LReKD8AoIfwAY9VvG35NY= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.3/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +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/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 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= +github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= +github.com/moby/term v0.0.0-20200312100748-672ec06f55cd h1:aY7OQNf2XqY/JQ6qREWamhI/81os/agb2BAGpcx5yWI= +github.com/moby/term v0.0.0-20200312100748-672ec06f55cd/go.mod h1:DdlQx2hp0Ss5/fLikoLlEeIYiATotOjgB//nb973jeo= 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= @@ -361,87 +525,129 @@ github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lN 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/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.1/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= +github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= +github.com/nats-io/jwt v0.3.2/go.mod h1:/euKqTS1ZD+zzjYrY7pseZrTtWQSjujC7xjPc8wL6eU= +github.com/nats-io/nats-server/v2 v2.1.2/go.mod h1:Afk+wRZqkMQs/p45uXdrVLuab3gwv3Z8C4HTBu8GD/k= +github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w= +github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= +github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= +github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= +github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.5.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.1 h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4= -github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= +github.com/onsi/ginkgo v1.15.2 h1:l77YT15o814C2qVL47NOyjV/6RbaP7kKdrvZnxQ3Org= +github.com/onsi/ginkgo v1.15.2/go.mod h1:Dd6YFfwBW84ETqqtL0CPyPXillHgY6XhQH3uuCCTr/o= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.2.0/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.10.2 h1:aY/nuoWlKJud2J6U0E3NWsjlg+0GtwXxgEqthRdzlcs= -github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= +github.com/onsi/gomega v1.11.0 h1:+CqWgvj0OZycCaqclBD1pxKHAU+tOkHmQIWvDHq2aug= +github.com/onsi/gomega v1.11.0/go.mod h1:azGKhqFUon9Vuj0YmTfLSmx0FUwqXYSTl5re8lQLTUg= +github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= +github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= +github.com/opentracing/basictracer-go v1.0.0/go.mod h1:QfBfYuafItcjQuMwinw9GhYKwFXS9KnPs5lxoYwgW74= +github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/openzipkin-contrib/zipkin-go-opentracing v0.4.5/go.mod h1:/wsWhb9smxSfWAKL3wpBW7V8scJMt8N8gnaMCS9E/cA= +github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= +github.com/openzipkin/zipkin-go v0.2.1/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= +github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/operator-framework/operator-sdk v0.0.7 h1:feujqHLhibLBbDVrSAFswpSzTVS5mEuarvywJ079mYE= github.com/operator-framework/operator-sdk v0.0.7/go.mod h1:iVyukRkam5JZa8AnjYf+/G3rk7JI1+M6GsU0sq0B9NA= +github.com/pact-foundation/pact-go v1.0.4/go.mod h1:uExwJY4kCzNPcHRj+hCR/HBbOOIwwtUjcrb0b5/5kLM= +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.6.0 h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzIK4= -github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys= +github.com/pelletier/go-toml v1.8.0 h1:Keo9qb7iRJs2voHvunFtuuYFsbWeOBh8/P9v/kVMFtw= +github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= +github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 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/pquerna/cachecontrol v0.0.0-20171018203845-0dec1b30a021/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.2/go.mod h1:OsXs2jCmiKlQ1lTBmv21f2mNfw4xf/QclQDMrYNZzcM= +github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g= -github.com/prometheus/client_golang v1.5.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= +github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.9.0 h1:Rrch9mh17XcxvEu9D9DEpb4isxjGBtcevQjKvxPRQIU= +github.com/prometheus/client_golang v1.9.0/go.mod h1:FqZLKOZnGdFAhOK4nqGHa7D66IdsO+O441Eve7ptJDU= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181126121408-4724e9255275/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= 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.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= +github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.15.0 h1:4fgOnadei3EZvgRwxJ7RMpG1k1pOZth5Pc13tyspaKM= +github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/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= +github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.3/go.mod h1:4A/X28fw3Fc593LaREMrKMqOKvUAntwMDaekg4FpcdQ= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.0.11/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.2.0 h1:wH4vA7pcjKuZzjF7lM8awk4fnuJO6idemZXoKnULUx4= +github.com/prometheus/procfs v0.2.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/remyoudompheng/bigfft v0.0.0-20170806203942-52369c62f446/go.mod h1:uYEyJGbgTkfkS4+E/PavXkNJcbFIpEtjt2B0KDQ5+9M= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= @@ -450,11 +656,14 @@ github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNue 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/v2 v2.0.1/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/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= 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= github.com/sanathkr/yaml v0.0.0-20170819201035-0056894fa522/go.mod h1:tQTYKOQgxoH3v6dEmdHiz4JG+nbxWwM5fgPQUpSZqVQ= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= @@ -464,11 +673,14 @@ github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjM github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= 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 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/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= @@ -477,8 +689,10 @@ github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= +github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= +github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= @@ -489,8 +703,12 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 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.6.2 h1:7aKfF+e8/k68gda3LOjo5RxiUqddoFxVq4BKBPrxk5E= -github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= +github.com/spf13/viper v1.7.0 h1:xVKxvI7ouOI5I+U9s2eeiUfMaWBVoXA3AWskkrqK0VM= +github.com/spf13/viper v1.7.0/go.mod h1:8WkrPz2fc9jxqZNCJI/76HCieCp4Q8HaLFoCha5qpdg= +github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= +github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= +github.com/streadway/handy v0.0.0-20190108123426-d5acb3125c2a/go.mod h1:qNTQ5P5JnDBl6z3cMAg/SywNDC5ABu5ApDIw6lUbRmI= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= @@ -509,43 +727,58 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1 github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli/v2 v2.2.0/go.mod h1:SE9GqnLQmjVa0iPEY0f1w3ygNIYcIJ0OKPMoW2caLfQ= github.com/vektah/gqlparser v1.1.2/go.mod h1:1ycwN7Ij5njmMkPPAOaRFY4rET2Enx7IkVv3vaXspKw= github.com/vishvananda/netlink v0.0.0-20181108222139-023a6dafdcdf/go.mod h1:+SR5DhBJrl6ZM7CoCKvpw5BKroDKQ+PJqOg65H/2ktk= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netns v0.0.0-20180720170159-13995c7128cc/go.mod h1:ZjcWmFBXmLKZu9Nxj3WKYEafiSqer2rnvPr0en9UNpI= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= -github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= -github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= -github.com/xeipuuv/gojsonschema v0.0.0-20181112162635-ac52e6811b56 h1:yhqBHs09SmmUoNOHc9jgK4a60T3XFRtPAkYxVnqgY50= github.com/xeipuuv/gojsonschema v0.0.0-20181112162635-ac52e6811b56/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= +github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/ziutek/telnet v0.0.0-20180329124119-c3b780dc415b/go.mod h1:IZpXDfkJ6tWD3PhBK5YzgQT+xJWh7OsdwiG8hA2MkO4= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mIZCrds/GIG4ncV9HhK5PX7jPg= +go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= go.hein.dev/go-version v0.1.0/go.mod h1:WOEm7DWMroRe5GdUgHMvx+Pji5WWIpMuXmK/3foylXs= go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= +go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= +go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5/go.mod h1:nmDLcffg48OtT/PSW0Hg7FvpRQsQh5OSqIylirxKC7o= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk= go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= +go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0= +go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= -go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -go.uber.org/zap v1.15.0 h1:ZZCA22JRF2gQE5FoNmhmrf7jeJJ2uhqDUNRYKm8dvmM= +go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.15.0/go.mod h1:Mb2vm2krFEG5DV0W9qcHBYFtp/Wku1cvYaqPsS/WYfc= +go.uber.org/zap v1.16.0 h1:uFRZXykJGK9lLY4HtgSw44DnIcAM+kRBP7x5m+NpAOM= +go.uber.org/zap v1.16.0/go.mod h1:MA8QOfq0BHJwdXa996Y4dYkAqRKB8/1K1QMMZVaNZjQ= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -553,35 +786,58 @@ golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= 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-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-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200930160638-afb6bcd081ae h1:duLSQW+DZ5MsXKX7kc4rXlq6/mmxz4G6ewJuBPlhRe0= -golang.org/x/crypto v0.0.0-20200930160638-afb6bcd081ae/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= 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= golang.org/x/exp v0.0.0-20190312203227-4b39c73a6495/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +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/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181005035420-146acd28ed58/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -592,6 +848,8 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190328230028-74de082e2cca/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -600,14 +858,24 @@ golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLL 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-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= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210224082022-3d97a244fca7 h1:OgUuv8lsRpBibGNbSizVwKWlysjaNzmC9gYMhPVfqFM= +golang.org/x/net v0.0.0-20210224082022-3d97a244fca7/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= 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= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -616,12 +884,16 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190124100055-b90733256f2e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -633,37 +905,66 @@ golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190405154228-4b34438f7a67/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606203320-7fc4e5ec1444/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190812172437-4e8604ab3aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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-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-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-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191220142924-d4481acd189f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201214210602-f9fddec55a1e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073 h1:8qxJSnu+7dRq6upnbntrmriWByIakBuct5OM/MdQC1M= +golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +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/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= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= 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= -golang.org/x/time v0.0.0-20191024005414-555d28b269f0 h1:/5xXl8Y5W96D+TtHSlonuFqGHIWVuyCkGJLwGh9JJFs= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba h1:O8mE0/t419eoIwhTFpKVkHiTs/Igowgfkj25AcZrtiE= +golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -676,41 +977,110 @@ golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190624222133-a101b041ded4/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +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-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= golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs= golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200103221440-774c71fcf114/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gomodules.xyz/jsonpatch/v2 v2.0.1 h1:xyiBuvkD2g5n7cYzx6u2sxQvsAy4QJsZFCzGVdzOXZ0= -gomodules.xyz/jsonpatch/v2 v2.0.1/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gomodules.xyz/jsonpatch/v2 v2.1.0 h1:Phva6wqu+xR//Njw6iorylFFgn/z547tw5Ne3HZPQ+k= +gomodules.xyz/jsonpatch/v2 v2.1.0/go.mod h1:IhYNNY4jnS53ZnfE4PAmpKtDpTCj1JFXc+3mwe7XcUU= gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e/go.mod h1:kS+toOQn6AQKjmKJ7gzohV1XkqsFehRA2FbsbkopSuQ= +google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= 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= -google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= -google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= +google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20201019141844-1ed22bb0c154/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a h1:pOwg4OoaRYScjmR4LlLgdtnyoHYTSAVhhqe5uPdpII8= +google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.22.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.29.0/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.31.0 h1:T7P4R73V3SSDPhH7WW7ATbfViLtmamH0DKrP3f9AuDI= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= @@ -719,18 +1089,23 @@ google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 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= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.25/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= @@ -742,6 +1117,7 @@ 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= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -749,83 +1125,107 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200121175148-a6ecf24a6d71/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= +gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= +honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= k8s.io/api v0.0.0-20180712090710-2d6f90ab1293/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.16.8/go.mod h1:a8EOdYHO8en+YHhPBLiW5q+3RfHTr7wxTqqp7emJ7PM= -k8s.io/api v0.17.9 h1:BA/U8qtSNzx7BbmQy3lODbCxVMKGNUpBJ2fjsKt6OOY= -k8s.io/api v0.17.9/go.mod h1:avJJAA1fSV6tnbCGW2K+S+ilDFW7WpNr5BScoiZ1M1U= -k8s.io/apiextensions-apiserver v0.17.9 h1:GWtUr9LErCZBV7QEUIF7wiICPG6wzPukFRrwDv/AIdM= -k8s.io/apiextensions-apiserver v0.17.9/go.mod h1:p2C9cDflVAUPMl5/QOMHxnSzQWF/cDqu7AP2KUXHHMA= +k8s.io/api v0.21.0-beta.1 h1:nIQCL8N0a0AncD6Xs/QPiDbw466AGsPs1K9CG0ZMcTY= +k8s.io/api v0.21.0-beta.1/go.mod h1:8A+GKfJYDnFlmsIqnwi7z2l5+GwI3fbIdAkPu3xiZKA= +k8s.io/apiextensions-apiserver v0.21.0-beta.1 h1:qUvWURtH6TZCabcYEGKVydU4f17qso00ZtSPodbQdEo= +k8s.io/apiextensions-apiserver v0.21.0-beta.1/go.mod h1:vluMqsJ5+hPgM9UtBhkFSGrfD86KUac9yeKVqpGBZz0= k8s.io/apimachinery v0.0.0-20180621070125-103fd098999d/go.mod h1:ccL7Eh7zubPUSh9A3USN90/OzHNSVN6zxzde07TDCL0= k8s.io/apimachinery v0.16.8/go.mod h1:Xk2vD2TRRpuWYLQNM6lT9R7DSFZUYG03SarNkbGrnKE= -k8s.io/apimachinery v0.17.0/go.mod h1:b9qmWdKlLuU9EBh+06BtLcSf/Mu89rWL33naRxs1uZg= -k8s.io/apimachinery v0.17.9 h1:knQxNgMu57Oxlm12J6DS375kmGMeuWV0VNzRRUBB2Yk= -k8s.io/apimachinery v0.17.9/go.mod h1:Lg8zZ5iC/O8UjCqW6DNhcQG2m4TdjF9kwG3891OWbbA= -k8s.io/apiserver v0.17.9 h1:q50QEJ51xdHy2Gl1lo9yJexiyixxof/yDUFdWNnZxh0= -k8s.io/apiserver v0.17.9/go.mod h1:Qaxd3EbeoPRBHVMtFyuKNAObqP6VAkzIMyWYz8KuE2k= -k8s.io/cli-runtime v0.17.9 h1:vfkzgn2Mz/hSTBr6WI+xE6CiwLFff29och5tkLeMskM= -k8s.io/cli-runtime v0.17.9/go.mod h1:oEtKeGGii/gAZxMaXvIIG0A4ig9XjcBuIYrWqVXSqN0= +k8s.io/apimachinery v0.18.8/go.mod h1:6sQd+iHEqmOtALqOFjSWp2KZ9F0wlU/nWm0ZgsYWMig= +k8s.io/apimachinery v0.21.0-beta.1 h1:PFLBa8viYJOvtkOEiyrzzcZSzBHEuu4wwIxzED0utCw= +k8s.io/apimachinery v0.21.0-beta.1/go.mod h1:ZaN7d/yx5I8h2mk8Nu08sdLigsmkt4flkTxCTc9LElI= +k8s.io/apiserver v0.21.0-beta.1 h1:MhdZptxbJ2Nl2CVZRrySi4jiJ8zgCV+j4Qmfo/95yHw= +k8s.io/apiserver v0.21.0-beta.1/go.mod h1:nl/H4DPS1abtRhCj8bhosbyU9XOgnMt0QFK3fAFEhSE= +k8s.io/cli-runtime v0.21.0-beta.1 h1:HpI3sHjY227SgRtmg1AXFXKvA74/Kth+lQ+EGN78C/A= +k8s.io/cli-runtime v0.21.0-beta.1/go.mod h1:JUzUd7rH9KGkeZPz0AF978vEuJdW4tiug1JygiLhEzw= k8s.io/client-go v0.0.0-20180806134042-1f13a808da65/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= k8s.io/client-go v0.16.8/go.mod h1:WmPuN0yJTKHXoklExKxzo3jSXmr3EnN+65uaTb5VuNs= -k8s.io/client-go v0.17.9 h1:qUPhohX4bUBx0L7pfye02aPnu3PQ0t+B8dqHfGvt++k= -k8s.io/client-go v0.17.9/go.mod h1:3cM92qAd1XknA5IRkRfpJhl9OQjkYy97ZEUio70wVnI= -k8s.io/cluster-bootstrap v0.17.9 h1:IH/MwGor5/7bwHClz0PO/8pKq+SU1eSB1rs645pGu8Y= -k8s.io/cluster-bootstrap v0.17.9/go.mod h1:Q6nXn/sqVfMvT1VIJVPxFboYAoqH06PCjZnaYzbpZC0= +k8s.io/client-go v0.21.0-beta.1 h1:gIO2RPWzchI9DnHn1hz0pObztWh7RDVcIUCSKzbxb/g= +k8s.io/client-go v0.21.0-beta.1/go.mod h1:SsWZEBajlozcXLnUS7OD47n9MtuzduVt02GMQO2/DIA= +k8s.io/cluster-bootstrap v0.21.0-beta.1 h1:cRhY9JCzdNqKfassZAbWNzAyWljUumuSvQk3531NcbU= +k8s.io/cluster-bootstrap v0.21.0-beta.1/go.mod h1:q6cVhPidp1sXjZBSMECnoO6XcaEubQejrTmA27j8RQ0= k8s.io/code-generator v0.16.8/go.mod h1:wFdrXdVi/UC+xIfLi+4l9elsTT/uEF61IfcN2wOLULQ= -k8s.io/code-generator v0.17.9/go.mod h1:iiHz51+oTx+Z9D0vB3CH3O4HDDPWrvZyUgUYaIE9h9M= +k8s.io/code-generator v0.21.0-beta.1/go.mod h1:IpCUojpiKp25KNB3/UbEeElznqpQUMvhAOUoC7AbISY= k8s.io/component-base v0.16.8/go.mod h1:Q8UWOWShpP3MZZny4n/15gOncfaaVtc9SbCdkM5MhUE= -k8s.io/component-base v0.17.9 h1:1CmgQ367Eo6UWkfO1sl7Z99KJpbwkrs9aMY5LZTQR9s= -k8s.io/component-base v0.17.9/go.mod h1:Wg22ePDK0mfTa+bEFgZHGwr0h40lXnYy6D7D+f7itFk= +k8s.io/component-base v0.21.0-beta.1 h1:1p2rRyBgoXuCD0rZrG07jXCfkvSnHo0aGCoNCbyhQhY= +k8s.io/component-base v0.21.0-beta.1/go.mod h1:WPMZyV0sNk3ruzA8cWt1EO2KWAnLDK2docEC14JWbTM= +k8s.io/component-helpers v0.21.0-beta.1/go.mod h1:gpNCeSdQi45xUrrxgubi5XJ9tXCrjMNXmNvDh9bjAM4= k8s.io/cri-api v0.0.0-20191107035106-03d130a7dc28/go.mod h1:9a7E6pmKLfuq8ZL31k2PDpgvSdyZfUOH9czlEmpblFk= k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20190822140433-26a664648505/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/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= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/klog/v2 v2.0.0 h1:Foj74zO6RbjjP4hBEKjnYtjjAhGg4jNynUdYF6fJrok= 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.5.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= +k8s.io/klog/v2 v2.8.0 h1:Q3gmuM9hKEjefWFFYF0Mat+YyFJvsUyYuwyNNJ5C9Ts= +k8s.io/klog/v2 v2.8.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= k8s.io/kube-openapi v0.0.0-20190510232812-a01b7d5d6c22/go.mod h1:iU+ZGYsNlvU9XKUSso6SQfKTCCw7lFduMZy26Mgr2Fw= k8s.io/kube-openapi v0.0.0-20190816220812-743ec37842bf/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= -k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29 h1:NeQXVJ2XFSkRoPzRo8AId01ZER+j8oV4SZADT4iBOXQ= -k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM3cOgIqGivxkwSWIWT5YdsDbeAOaU= +k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= +k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7 h1:vEx13qjvaZ4yfObSSXW7BrMc/KQBBT/Jyee8XtLf4x0= +k8s.io/kube-openapi v0.0.0-20210305001622-591a79e4bda7/go.mod h1:wXW5VT87nVfh/iLV8FpR2uDvrFyomxbtb1KivDbvPTE= +k8s.io/kubectl v0.21.0-beta.1 h1:Q7JPuO5ibaBuLoySYUNps5DAjb+9SebxugPyS8RuyoI= +k8s.io/kubectl v0.21.0-beta.1/go.mod h1:v9Wal3y7JAPefA0FuyOugrtayqctOS/5T70vWO8BKGE= +k8s.io/metrics v0.21.0-beta.1/go.mod h1:IZI4MfDwnVzuaA3+SebxHGBLV9Ee6isYjPlZh181Ay0= 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-20191114184206-e782cd3c129f/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -k8s.io/utils v0.0.0-20200619165400-6e3d28b6ed19/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -k8s.io/utils v0.0.0-20200912215256-4140de9c8800 h1:9ZNvfPvVIEsp/T1ez4GQuzCcCTEQWhovSofhqR73A6g= -k8s.io/utils v0.0.0-20200912215256-4140de9c8800/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-20210111153108-fddb29f9d009/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= +k8s.io/utils v0.0.0-20210305010621-2afb4311ab10 h1:u5rPykqiCpL+LBfjRkXvnK71gOgIdmq3eHUEkPrbeTI= +k8s.io/utils v0.0.0-20210305010621-2afb4311ab10/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= modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs= modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= 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/aws-iam-authenticator v0.5.1 h1:0Nv09uOayy99IOYgNamMl0cwTuQWRtEuUu6s3mSgyEs= -sigs.k8s.io/aws-iam-authenticator v0.5.1/go.mod h1:yPDLi58MDx1UtCrRMOykLm1IyKKPGHgcGCafcbn2s3E= -sigs.k8s.io/cluster-api v0.3.15-0.20210309173700-34de71aaaac8 h1:lmD2Ckh8wz4lP2NuQLFLzrhp5yi4TOrwIU+zDmEywBU= -sigs.k8s.io/cluster-api v0.3.15-0.20210309173700-34de71aaaac8/go.mod h1:qGxyPTEJWNpII9SBkeRwv+Xvy6EZRLLLzaxVfBLsBpA= -sigs.k8s.io/controller-runtime v0.5.14 h1:lmoRaPvLg9877ZOnjFivjtyIdqyLbWfcCEilxHXTEj4= -sigs.k8s.io/controller-runtime v0.5.14/go.mod h1:OTqxLuz7gVcrq+BHGUgedRu6b2VIKCEc7Pu4Jbwui0A= -sigs.k8s.io/kind v0.7.1-0.20200303021537-981bd80d3802 h1:L6/8hETA7jvdx3xBcbDifrIN2xaYHE7tA58n+Kdp2Zw= -sigs.k8s.io/kind v0.7.1-0.20200303021537-981bd80d3802/go.mod h1:HIZ3PWUezpklcjkqpFbnYOqaqsAE1JeCTEwkgvPLXjk= -sigs.k8s.io/kustomize v2.0.3+incompatible/go.mod h1:MkjgH3RdOWrievjo6c9T245dYlB5QeXV4WCbnt/PEpU= +sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.0.15/go.mod h1:LEScyzhFmoF5pso/YSeBstl57mOzx9xlU9n85RGrDQg= +sigs.k8s.io/aws-iam-authenticator v0.5.2 h1:eGCtm6lLVpVVpsIBC1y4OwyQRhmg+A/OPXVMTlDKONc= +sigs.k8s.io/aws-iam-authenticator v0.5.2/go.mod h1:yPDLi58MDx1UtCrRMOykLm1IyKKPGHgcGCafcbn2s3E= +sigs.k8s.io/cluster-api v0.3.11-0.20210416165222-506078bb31ba h1:0vXNSAXwTfoMMTZW42QzK0Dm5cDkxCIb6aWhWmHn4DI= +sigs.k8s.io/cluster-api v0.3.11-0.20210416165222-506078bb31ba/go.mod h1:UlBKgiQwcVusfGoS+47AEj2c4yDqiomuZZ+xgw/xDoY= +sigs.k8s.io/controller-runtime v0.9.0-alpha.1 h1:yIYTxDHQfcrYWO1hjZvHhjkGY1fYFo1k07FzlTono4E= +sigs.k8s.io/controller-runtime v0.9.0-alpha.1/go.mod h1:BARxVvgj+8Ihw9modUvYh7/OJmjxuBtLK8P36jdf7rY= +sigs.k8s.io/kind v0.9.0 h1:SoDlXq6pEc7dGagHULNRCCBYrLH6xOi7lqXTRXeAlg4= +sigs.k8s.io/kind v0.9.0/go.mod h1:cxKQWwmbtRDzQ+RNKnR6gZG6fjbeTtItp5cGf+ww+1Y= +sigs.k8s.io/kustomize/api v0.8.5/go.mod h1:M377apnKT5ZHJS++6H4rQoCHmWtt6qTpp3mbe7p6OLY= +sigs.k8s.io/kustomize/cmd/config v0.9.7/go.mod h1:MvXCpHs77cfyxRmCNUQjIqCmZyYsbn5PyQpWiq44nW0= +sigs.k8s.io/kustomize/kustomize/v4 v4.0.5/go.mod h1:C7rYla7sI8EnxHE/xEhRBSHMNfcL91fx0uKmUlUhrBk= +sigs.k8s.io/kustomize/kyaml v0.10.15/go.mod h1:mlQFagmkm1P+W4lZJbJ/yaxMd8PqMRSC4cPcfUVt5Hg= sigs.k8s.io/structured-merge-diff v0.0.0-20190426204423-ea680f03cc65/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e h1:4Z09Hglb792X0kfOBBJUPFEyvVfQWrYT/l8h5EKA6JQ= sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= -sigs.k8s.io/structured-merge-diff/v2 v2.0.1/go.mod h1:Wb7vfKAodbKgf6tn1Kl0VvGj7mRH6DGaRcixXEJXTsE= +sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= +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 h1:4oyYo8NREp49LBBhKxEqCulFjg26rawYKrnCmg+Sr6c= +sigs.k8s.io/structured-merge-diff/v4 v4.0.3/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= 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= +sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0/go.mod h1:hI742Nqp5OhwiqlzhgfbWU4mW4yO10fP+LoT9WOswdU= diff --git a/hack/ensure-go.sh b/hack/ensure-go.sh index 1f674e9c39..9fad9c07c9 100755 --- a/hack/ensure-go.sh +++ b/hack/ensure-go.sh @@ -31,7 +31,7 @@ EOF local go_version IFS=" " read -ra go_version <<< "$(go version)" local minimum_go_version - minimum_go_version=go1.13.0 + minimum_go_version=go1.16.0 if [[ "${minimum_go_version}" != $(echo -e "${minimum_go_version}\n${go_version[2]}" | sort -s -t. -k 1,1 -k 2,2n -k 3,3n | head -n1) && "${go_version[2]}" != "devel" ]]; then cat <