Skip to content

Commit b28bda0

Browse files
authored
Add labels during CRD generation (#509)
1 parent a0ac714 commit b28bda0

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ config/crd/bases/coherence.oracle.com_coherence.yaml: kustomize $(API_GO_FILES)
529529
$(CONTROLLER_GEN) "crd:trivialVersions=true,crdVersions={v1}" \
530530
rbac:roleName=manager-role paths="{./api/...,./controllers/...}" \
531531
output:crd:artifacts:config=config/crd/bases
532+
cd config/crd && $(KUSTOMIZE) edit add label "app.kubernetes.io/version:$(VERSION)" -f
532533
$(KUSTOMIZE) build config/crd > $(BUILD_ASSETS)/crd_v1.yaml
533534

534535
# ----------------------------------------------------------------------------------------------------------------------

config/crd/kustomization.yaml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
14
# This kustomization.yaml is not intended to be run by itself,
25
# since it depends on service name and namespace that are out of this kustomize package.
36
# It should be run by config/default
47
resources:
58
- bases/coherence.oracle.com_coherence.yaml
69
# +kubebuilder:scaffold:crdkustomizeresource
710

8-
patchesStrategicMerge:
911
# patches here are for enabling the conversion webhook for each CRD
1012
#- patches/webhook_in_coherence.yaml
1113
# +kubebuilder:scaffold:crdkustomizewebhookpatch
@@ -20,9 +22,16 @@ configurations:
2022
- kustomizeconfig.yaml
2123

2224
patchesJson6902:
23-
- path: patches/coherence.oracle.com_coherence_crd_patch.json
24-
target:
25-
group: apiextensions.k8s.io
26-
version: v1
27-
kind: CustomResourceDefinition
28-
name: coherence.coherence.oracle.com
25+
- path: patches/coherence.oracle.com_coherence_crd_patch.json
26+
target:
27+
group: apiextensions.k8s.io
28+
kind: CustomResourceDefinition
29+
name: coherence.coherence.oracle.com
30+
version: v1
31+
32+
commonLabels:
33+
app.kubernetes.io/component: crd
34+
app.kubernetes.io/instance: coherence-operator-crd
35+
app.kubernetes.io/name: coherence-operator
36+
app.kubernetes.io/part-of: coherence-operator
37+
app.kubernetes.io/version: 3.2.3

0 commit comments

Comments
 (0)