Skip to content

Commit 12eccd6

Browse files
authored
Merge pull request #39 from controlplaneio-fluxcd/fix-instance
flux-instance: Add `commonMetadata` and `sync.name` to values
2 parents 93d4742 + a3dbb42 commit 12eccd6

File tree

4 files changed

+37
-1
lines changed

4 files changed

+37
-1
lines changed

charts/flux-instance/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ helm -n flux-system uninstall flux
3838
| commonLabels | object | `{}` | Common labels to add to all deployed objects including pods. |
3939
| fullnameOverride | string | `"flux"` | |
4040
| instance.cluster | object | `{"domain":"cluster.local","multitenant":false,"networkPolicy":true,"tenantDefaultServiceAccount":"default","type":"kubernetes"}` | Cluster https://fluxcd.control-plane.io/operator/fluxinstance/#cluster-configuration |
41+
| instance.commonMetadata | object | `{"annotations":{},"labels":{}}` | Common metadata https://fluxcd.control-plane.io/operator/fluxinstance/#common-metadata |
4142
| instance.components | list | `["source-controller","kustomize-controller","helm-controller","notification-controller"]` | Components https://fluxcd.control-plane.io/operator/fluxinstance/#components-configuration |
4243
| instance.distribution | object | `{"artifact":"oci://ghcr.io/controlplaneio-fluxcd/flux-operator-manifests:latest","imagePullSecret":"","registry":"ghcr.io/fluxcd","version":"2.x"}` | Distribution https://fluxcd.control-plane.io/operator/fluxinstance/#distribution-configuration |
4344
| instance.kustomize.patches | list | `[]` | Kustomize patches https://fluxcd.control-plane.io/operator/fluxinstance/#kustomize-patches |
4445
| instance.sharding | object | `{"key":"sharding.fluxcd.io/key","shards":[]}` | Sharding https://fluxcd.control-plane.io/operator/fluxinstance/#sharding-configuration |
4546
| instance.storage | object | `{"class":"","size":""}` | Storage https://fluxcd.control-plane.io/operator/fluxinstance/#storage-configuration |
46-
| instance.sync | object | `{"kind":"GitRepository","path":"","pullSecret":"","ref":"","url":""}` | Sync https://fluxcd.control-plane.io/operator/fluxinstance/#sync-configuration |
47+
| instance.sync | object | `{"kind":"GitRepository","name":"","path":"","pullSecret":"","ref":"","url":""}` | Sync https://fluxcd.control-plane.io/operator/fluxinstance/#sync-configuration |
4748
| nameOverride | string | `""` | |
4849

4950
## Source Code

charts/flux-instance/templates/instance.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,27 @@ spec:
2222
{{- end }}
2323
components: {{ .Values.instance.components | toYaml | nindent 4 }}
2424
cluster: {{ .Values.instance.cluster | toYaml | nindent 4 }}
25+
{{- if or .Values.instance.commonMetadata.annotations .Values.instance.commonMetadata.labels }}
26+
commonMetadata:
27+
{{- with .Values.instance.commonMetadata.annotations }}
28+
annotations:
29+
{{- toYaml . | nindent 6 }}
30+
{{- end }}
31+
{{- with .Values.instance.commonMetadata.labels }}
32+
labels:
33+
{{- toYaml . | nindent 6 }}
34+
{{- end }}
35+
{{- end }}
2536
kustomize: {{ .Values.instance.kustomize | toYaml | nindent 4 }}
2637
{{- if .Values.instance.sync.url }}
2738
sync:
2839
kind: {{ .Values.instance.sync.kind }}
2940
url: {{ .Values.instance.sync.url }}
3041
ref: {{ .Values.instance.sync.ref }}
3142
path: {{ .Values.instance.sync.path }}
43+
{{- if .Values.instance.sync.name }}
44+
name: {{ .Values.instance.sync.name }}
45+
{{- end }}
3246
{{- if .Values.instance.sync.pullSecret }}
3347
pullSecret: {{ .Values.instance.sync.pullSecret }}
3448
{{- end }}

charts/flux-instance/values.schema.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@
4141
},
4242
"type": "object"
4343
},
44+
"commonMetadata": {
45+
"properties": {
46+
"annotations": {
47+
"properties": {},
48+
"type": "object"
49+
},
50+
"labels": {
51+
"properties": {},
52+
"type": "object"
53+
}
54+
},
55+
"type": "object"
56+
},
4457
"components": {
4558
"items": {
4659
"enum": [
@@ -123,6 +136,9 @@
123136
],
124137
"type": "string"
125138
},
139+
"name": {
140+
"type": "string"
141+
},
126142
"path": {
127143
"type": "string"
128144
},

charts/flux-instance/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ instance:
2323
networkPolicy: true
2424
multitenant: false
2525
tenantDefaultServiceAccount: "default"
26+
# -- Common metadata https://fluxcd.control-plane.io/operator/fluxinstance/#common-metadata
27+
commonMetadata: # @schema required: false
28+
labels: { }
29+
annotations: { }
2630
# -- Storage https://fluxcd.control-plane.io/operator/fluxinstance/#storage-configuration
2731
storage: # @schema required: false
2832
class: ""
@@ -38,6 +42,7 @@ instance:
3842
ref: ""
3943
path: ""
4044
pullSecret: ""
45+
name: ""
4146
kustomize: # @schema required: false
4247
# -- Kustomize patches https://fluxcd.control-plane.io/operator/fluxinstance/#kustomize-patches
4348
patches: [] # @schema item: object

0 commit comments

Comments
 (0)