Skip to content

Commit dfe1cd0

Browse files
authored
Add label to helm generated resources (#362)
Signed-off-by: Allen Li <[email protected]>
1 parent bbc99a0 commit dfe1cd0

File tree

7 files changed

+21
-7
lines changed

7 files changed

+21
-7
lines changed

helm-cluster-scoped/templates/00-crd.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ metadata:
55
controller-gen.kubebuilder.io/version: v0.5.0
66
creationTimestamp: null
77
name: namespacescopes.operator.ibm.com
8+
labels:
9+
component-id: {{ .Chart.Name }}
810
spec:
911
group: operator.ibm.com
1012
names:

helm-cluster-scoped/templates/01-cluster-rbac.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ kind: ClusterRole
22
apiVersion: rbac.authorization.k8s.io/v1
33
metadata:
44
name: ibm-namespace-scope-operator
5+
labels:
6+
component-id: {{ .Chart.Name }}
57
rules:
68
- verbs:
79
- create
@@ -28,6 +30,8 @@ kind: ClusterRoleBinding
2830
apiVersion: rbac.authorization.k8s.io/v1
2931
metadata:
3032
name: ibm-namespace-scope-operator
33+
labels:
34+
component-id: {{ .Chart.Name }}
3135
subjects:
3236
- kind: ServiceAccount
3337
name: ibm-namespace-scope-operator

helm-cluster-scoped/values.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# imagePullPrefix: icr.io
22
# imagePullSecret: ibm-entitlement-key
3-
imageRegistryNamespaceOperator: cpopen
4-
imageRegistryNamespaceOperand: cpopen/cpfs
3+
cpfs:
4+
imageRegistryNamespaceOperator: cpopen
5+
imageRegistryNamespaceOperand: cpopen/cpfs
56

67
# operatorNamespace: ""

helm/templates/00-rbac.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ apiVersion: rbac.authorization.k8s.io/v1
33
metadata:
44
name: ibm-namespace-scope-operator
55
namespace: {{ .Values.global.operatorNamespace }}
6+
labels:
7+
component-id: {{ .Chart.Name }}
68
rules:
79
- verbs:
810
- create
@@ -81,6 +83,8 @@ apiVersion: rbac.authorization.k8s.io/v1
8183
metadata:
8284
name: ibm-namespace-scope-operator
8385
namespace: {{ .Values.global.operatorNamespace }}
86+
labels:
87+
component-id: {{ .Chart.Name }}
8488
subjects:
8589
- kind: ServiceAccount
8690
name: ibm-namespace-scope-operator
@@ -97,5 +101,6 @@ metadata:
97101
app.kubernetes.io/instance: ibm-namespace-scope-operator
98102
app.kubernetes.io/managed-by: ibm-namespace-scope-operator
99103
app.kubernetes.io/name: ibm-namespace-scope-operator
104+
component-id: {{ .Chart.Name }}
100105
name: ibm-namespace-scope-operator
101106
namespace: {{ .Values.global.operatorNamespace }}

helm/templates/01-operator-deployment.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ metadata:
88
app.kubernetes.io/managed-by: ibm-namespace-scope-operator
99
app.kubernetes.io/name: ibm-namespace-scope-operator
1010
productName: IBM_Cloud_Platform_Common_Services
11+
component-id: {{ .Chart.Name }}
1112
spec:
1213
replicas: 1
1314
selector:
@@ -50,7 +51,7 @@ spec:
5051
]
5152
capabilities: Seamless Upgrades
5253
productName: IBM Cloud Platform Common Services
53-
containerImage: {{ .Values.global.imagePullPrefix }}/{{ .Values.imageRegistryNamespaceOperator }}/ibm-namespace-scope-operator:4.2.12
54+
containerImage: {{ .Values.global.imagePullPrefix }}/{{ .Values.cpfs.imageRegistryNamespaceOperator }}/ibm-namespace-scope-operator:4.2.12
5455
productMetric: FREE
5556
spec:
5657
restartPolicy: Always
@@ -104,7 +105,7 @@ spec:
104105
type: RuntimeDefault
105106
imagePullPolicy: IfNotPresent
106107
terminationMessagePolicy: File
107-
image: {{ .Values.global.imagePullPrefix }}/{{ .Values.imageRegistryNamespaceOperator }}/ibm-namespace-scope-operator:4.2.12
108+
image: {{ .Values.global.imagePullPrefix }}/{{ .Values.cpfs.imageRegistryNamespaceOperator }}/ibm-namespace-scope-operator:4.2.12
108109
serviceAccount: ibm-namespace-scope-operator
109110
dnsPolicy: ClusterFirst
110111
strategy:

helm/templates/02-nss-cr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ kind: NamespaceScope
33
metadata:
44
labels:
55
foundationservices.cloudpak.ibm.com: nss
6+
component-id: {{ .Chart.Name }}
67
name: common-service
78
namespace: {{ .Values.global.operatorNamespace }}
89
spec:

helm/values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ global:
55
imagePullSecret: ibm-entitlement-key
66
licenseAccept: true
77
tetheredNamespace: []
8-
9-
imageRegistryNamespaceOperator: cpopen
10-
imageRegistryNamespaceOperand: cpopen/cpfs
8+
cpfs:
9+
imageRegistryNamespaceOperator: cpopen
10+
imageRegistryNamespaceOperand: cpopen/cpfs

0 commit comments

Comments
 (0)