Skip to content

Commit 72f4dad

Browse files
authored
Merge pull request #2121 from sedefsavas/v1alpha42
⚠️ Generate v1alpha4 types
2 parents 7e56f4e + a19098a commit 72f4dad

File tree

361 files changed

+15905
-4434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

361 files changed

+15905
-4434
lines changed

.golangci.yml

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ linters:
1616
- gci
1717
- nlreturn
1818
- gocritic
19+
- exhaustivestruct
20+
- wrapcheck
1921
# Run with --fast=false for more extensive checks
2022
fast: true
2123
issues:

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616

1717
# Build the manager binary
18-
FROM golang:1.13.15 as builder
18+
FROM golang:1.16.2 as builder
1919
WORKDIR /workspace
2020

2121
# Run this with docker build --build_arg $(go env GOPROXY) to override the goproxy

Makefile

+22-18
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ CORE_CONTROLLER_IMG ?= $(REGISTRY)/$(CORE_IMAGE_NAME)
9292
CORE_CONTROLLER_ORIGINAL_IMG := gcr.io/k8s-staging-cluster-api-aws/cluster-api-aws-controller
9393
CORE_CONTROLLER_NAME := capa-controller-manager
9494
CORE_MANIFEST_FILE := infrastructure-components
95-
CORE_CONFIG_DIR := config
95+
CORE_CONFIG_DIR := config/default
9696
CORE_NAMESPACE := capa-system
9797

9898
# bootstrap
@@ -101,7 +101,7 @@ EKS_BOOTSTRAP_CONTROLLER_IMG ?= $(REGISTRY)/$(EKS_BOOTSTRAP_IMAGE_NAME)
101101
EKS_BOOTSTRAP_CONTROLLER_ORIGINAL_IMG := gcr.io/k8s-staging-cluster-api-aws/eks-bootstrap-controller
102102
EKS_BOOTSTRAP_CONTROLLER_NAME := capa-eks-bootstrap-controller-manager
103103
EKS_BOOTSTRAP_MANIFEST_FILE := eks-bootstrap-components
104-
EKS_BOOTSTRAP_CONFIG_DIR := bootstrap/eks/config
104+
EKS_BOOTSTRAP_CONFIG_DIR := bootstrap/eks/config/default
105105
EKS_BOOTSTRAP_NAMESPACE := capa-eks-bootstrap-system
106106

107107
# bootstrap
@@ -110,7 +110,7 @@ EKS_CONTROLPLANE_CONTROLLER_IMG ?= $(REGISTRY)/$(EKS_CONTROLPLANE_IMAGE_NAME)
110110
EKS_CONTROLPLANE_CONTROLLER_ORIGINAL_IMG := gcr.io/k8s-staging-cluster-api-aws/eks-controlplane-controller
111111
EKS_CONTROLPLANE_CONTROLLER_NAME := capa-eks-control-plane-controller-manager
112112
EKS_CONTROLPLANE_MANIFEST_FILE := eks-controlplane-components
113-
EKS_CONTROLPLANE_CONFIG_DIR := controlplane/eks/config
113+
EKS_CONTROLPLANE_CONFIG_DIR := controlplane/eks/config/default
114114
EKS_CONTROLPLANE_NAMESPACE := capa-eks-control-plane-system
115115

116116
# Allow overriding manifest generation destination directory
@@ -238,7 +238,7 @@ generate-go: $(MOCKGEN)
238238

239239
.PHONY: generate-go-core
240240
generate-go-core: ## Runs Go related generate targets
241-
$(MAKE) -B $(CONTROLLER_GEN) $(CONVERSION_GEN) $(DEFAULTER_GEN)
241+
$(MAKE) -B $(CONTROLLER_GEN) $(DEFAULTER_GEN) $(CONVERSION_GEN)
242242
$(CONTROLLER_GEN) \
243243
paths=./api/... \
244244
paths=./$(EXP_DIR)/api/... \
@@ -254,21 +254,36 @@ generate-go-core: ## Runs Go related generate targets
254254
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt
255255

256256
$(CONVERSION_GEN) \
257-
--input-dirs=./api/v1alpha2 \
257+
--input-dirs=./api/v1alpha3 \
258+
--extra-peer-dirs=sigs.k8s.io/cluster-api/api/v1alpha3 \
259+
--build-tag=ignore_autogenerated_core_v1alpha3 \
258260
--output-file-base=zz_generated.conversion $(GEN_OUTPUT_BASE) \
259261
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt
260262

263+
$(CONVERSION_GEN) \
264+
--input-dirs=./$(EXP_DIR)/api/v1alpha3 \
265+
--output-file-base=zz_generated.conversion \
266+
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt $(GEN_OUTPUT_BASE)
267+
261268
.PHONY: generate-go-eks-bootstrap
262269
generate-go-eks-bootstrap: $(CONTROLLER_GEN)
263270
$(CONTROLLER_GEN) \
264271
paths=./bootstrap/eks/api/... \
265272
object:headerFile=./hack/boilerplate/boilerplate.generatego.txt
273+
$(CONVERSION_GEN) \
274+
--input-dirs=./bootstrap/eks/api/v1alpha3 \
275+
--output-file-base=zz_generated.conversion $(GEN_OUTPUT_BASE) \
276+
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt
266277

267278
.PHONY: generate-go-eks-controlplane
268279
generate-go-eks-controlplane: $(CONTROLLER_GEN) $(CONVERSION_GEN)
269280
$(CONTROLLER_GEN) \
270281
paths=./controlplane/eks/api/... \
271282
object:headerFile=./hack/boilerplate/boilerplate.generatego.txt
283+
$(CONVERSION_GEN) \
284+
--input-dirs=./controlplane/eks/api/v1alpha3 \
285+
--output-file-base=zz_generated.conversion $(GEN_OUTPUT_BASE) \
286+
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt
272287

273288
.PHONY: generate-manifests
274289
generate-manifests:
@@ -530,7 +545,6 @@ $(RELEASE_DIR)/$(CORE_MANIFEST_FILE).yaml:
530545
CONTROLLER_NAME=$(CORE_CONTROLLER_NAME) \
531546
PROVIDER_CONFIG_DIR=$(CORE_CONFIG_DIR) \
532547
NAMESPACE=$(CORE_NAMESPACE) \
533-
WEBHOOK_ENABLED=true
534548

535549
.PHONY: $(RELEASE_DIR)/$(EKS_BOOTSTRAP_MANIFEST_FILE).yaml
536550
$(RELEASE_DIR)/$(EKS_BOOTSTRAP_MANIFEST_FILE).yaml:
@@ -551,7 +565,6 @@ $(RELEASE_DIR)/$(EKS_CONTROLPLANE_MANIFEST_FILE).yaml:
551565
CONTROLLER_NAME=$(EKS_CONTROLPLANE_CONTROLLER_NAME) \
552566
PROVIDER_CONFIG_DIR=$(EKS_CONTROLPLANE_CONFIG_DIR) \
553567
NAMESPACE=$(EKS_CONTROLPLANE_NAMESPACE) \
554-
WEBHOOK_ENABLED=true
555568

556569
.PHONY: compiled-manifest
557570
compiled-manifest: $(RELEASE_DIR) $(KUSTOMIZE)
@@ -568,21 +581,12 @@ image-patch-source-manifest: $(IMAGE_PATCH_DIR) $(KUSTOMIZE)
568581
.PHONY: image-patch-kustomization
569582
image-patch-kustomization: $(IMAGE_PATCH_DIR)
570583
mkdir -p $(IMAGE_PATCH_DIR)/$(PROVIDER)
571-
@if [ "${WEBHOOK_ENABLED}" = "true" ]; then \
572-
$(MAKE) image-patch-kustomization-with-webhook; else \
573-
$(MAKE) image-patch-kustomization-without-webhook; \
574-
fi
575-
576-
.PHONY: image-patch-kustomization-with-webhook
577-
image-patch-kustomization-with-webhook: $(IMAGE_PATCH_DIR) $(GOJQ)
578-
mkdir -p $(IMAGE_PATCH_DIR)/$(PROVIDER)
579-
$(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)"' \
580-
"hack/image-patch/kustomization.yaml" > $(IMAGE_PATCH_DIR)/$(PROVIDER)/kustomization.yaml
584+
$(MAKE) image-patch-kustomization-without-webhook
581585

582586
.PHONY: image-patch-kustomization-without-webhook
583587
image-patch-kustomization-without-webhook: $(IMAGE_PATCH_DIR) $(GOJQ)
584588
mkdir -p $(IMAGE_PATCH_DIR)/$(PROVIDER)
585-
$(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)"' \
589+
$(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)"' \
586590
"hack/image-patch/kustomization.yaml" > $(IMAGE_PATCH_DIR)/$(PROVIDER)/kustomization.yaml
587591

588592
.PHONY: image-patch-pull-policy

PROJECT

+23-5
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,38 @@ domain: cluster.x-k8s.io
33
repo: sigs.k8s.io/cluster-api-provider-aws
44
resources:
55
- group: infrastructure
6-
version: v1alpha2
6+
version: v1alpha3
77
kind: AWSMachine
88
- group: infrastructure
9-
version: v1alpha2
9+
version: v1alpha3
1010
kind: AWSCluster
1111
- group: infrastructure
12-
version: v1alpha2
12+
version: v1alpha3
1313
kind: AWSMachineTemplate
1414
- group: infrastructure
1515
version: v1alpha3
16-
kind: AWSMachine
16+
kind: AWSClusterStaticIdentity
1717
- group: infrastructure
1818
version: v1alpha3
19-
kind: AWSCluster
19+
kind: AWSClusterRoleIdentity
2020
- group: infrastructure
2121
version: v1alpha3
22+
kind: AWSClusterControllerIdentity
23+
- group: infrastructure
24+
version: v1alpha4
25+
kind: AWSMachine
26+
- group: infrastructure
27+
version: v1alpha4
28+
kind: AWSCluster
29+
- group: infrastructure
30+
version: v1alpha4
2231
kind: AWSMachineTemplate
32+
- group: infrastructure
33+
version: v1alpha4
34+
kind: AWSClusterStaticIdentity
35+
- group: infrastructure
36+
version: v1alpha4
37+
kind: AWSClusterRoleIdentity
38+
- group: infrastructure
39+
version: v1alpha4
40+
kind: AWSClusterControllerIdentity

0 commit comments

Comments
 (0)