Skip to content

Commit

Permalink
Merge pull request #110 from Jont828/clusterctl-move-label
Browse files Browse the repository at this point in the history
🌱 Set ClusterctlMoveHierarchyLabel on HelmChartProxy in CRD definition
  • Loading branch information
k8s-ci-robot authored Oct 16, 2023
2 parents 5a8285a + de5bb35 commit 2832b10
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ TAG ?= dev
ARCH ?= $(shell go env GOARCH)
ALL_ARCH = amd64 arm arm64 ppc64le s390x

# Allow overriding manifest generation destination directory
MANIFEST_ROOT ?= config
CRD_ROOT ?= $(MANIFEST_ROOT)/crd/bases
WEBHOOK_ROOT ?= $(MANIFEST_ROOT)/webhook
RBAC_ROOT ?= $(MANIFEST_ROOT)/rbac

# Allow overriding the imagePullPolicy
PULL_POLICY ?= Always

Expand Down Expand Up @@ -234,8 +240,17 @@ generate: ## Run all generate-* targets

.PHONY: generate-manifests
generate-manifests: $(CONTROLLER_GEN) $(KUSTOMIZE) ## Generate manifests e.g. CRD, RBAC etc. for core
# $(MAKE) clean-generated-yaml SRC_DIRS="./config/crd/bases"
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
$(CONTROLLER_GEN) \
paths=./api/... \
crd:crdVersions=v1 \
rbac:roleName=manager-role \
output:crd:dir=$(CRD_ROOT) \
output:webhook:dir=$(WEBHOOK_ROOT) \
webhook
$(CONTROLLER_GEN) \
paths=./controllers/... \
output:rbac:dir=$(RBAC_ROOT) \
rbac:roleName=manager-role

.PHONY: generate-go
generate-go: $(CONTROLLER_GEN) $(MOCKGEN) $(KUSTOMIZE) ## Generate manifests e.g. CRD, RBAC etc. for core
Expand Down Expand Up @@ -561,7 +576,6 @@ set-manifest-image:
.PHONY: clean
clean: ## Remove generated binaries, GitBook files, Helm charts, and Tilt build files
$(MAKE) clean-bin
$(MAKE) clean-book
$(MAKE) clean-charts
$(MAKE) clean-tilt

Expand Down
3 changes: 3 additions & 0 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ patchesStrategicMerge:
- patches/cainjection_in_helmreleaseproxies.yaml
#+kubebuilder:scaffold:crdkustomizecainjectionpatch

# Adds clusterctl move hierarchy label to HelmChartProxies so they can be discovered by clusterctl move.
- patches/clusterctl_move_label_in_helmchartproxies.yaml

# the following config is for teaching kustomize how to do kustomization for CRDs.
configurations:
- kustomizeconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# The following patch adds the `clusterctl.cluster.x-k8s.io/move-hierarchy` label to the HelmChartProxy CRD type.
# Note that this label will be present on the HelmChartProxy kind, not HelmChartProxy objects themselves.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
labels:
clusterctl.cluster.x-k8s.io/move-hierarchy: "true"
name: helmchartproxies.addons.cluster.x-k8s.io

0 comments on commit 2832b10

Please sign in to comment.