Skip to content

Commit

Permalink
Merge pull request #39 from controlplaneio-fluxcd/fix-instance
Browse files Browse the repository at this point in the history
flux-instance: Add `commonMetadata` and `sync.name` to values
  • Loading branch information
stefanprodan authored Jan 9, 2025
2 parents 93d4742 + a3dbb42 commit 12eccd6
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
3 changes: 2 additions & 1 deletion charts/flux-instance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ helm -n flux-system uninstall flux
| commonLabels | object | `{}` | Common labels to add to all deployed objects including pods. |
| fullnameOverride | string | `"flux"` | |
| instance.cluster | object | `{"domain":"cluster.local","multitenant":false,"networkPolicy":true,"tenantDefaultServiceAccount":"default","type":"kubernetes"}` | Cluster https://fluxcd.control-plane.io/operator/fluxinstance/#cluster-configuration |
| instance.commonMetadata | object | `{"annotations":{},"labels":{}}` | Common metadata https://fluxcd.control-plane.io/operator/fluxinstance/#common-metadata |
| instance.components | list | `["source-controller","kustomize-controller","helm-controller","notification-controller"]` | Components https://fluxcd.control-plane.io/operator/fluxinstance/#components-configuration |
| 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 |
| instance.kustomize.patches | list | `[]` | Kustomize patches https://fluxcd.control-plane.io/operator/fluxinstance/#kustomize-patches |
| instance.sharding | object | `{"key":"sharding.fluxcd.io/key","shards":[]}` | Sharding https://fluxcd.control-plane.io/operator/fluxinstance/#sharding-configuration |
| instance.storage | object | `{"class":"","size":""}` | Storage https://fluxcd.control-plane.io/operator/fluxinstance/#storage-configuration |
| instance.sync | object | `{"kind":"GitRepository","path":"","pullSecret":"","ref":"","url":""}` | Sync https://fluxcd.control-plane.io/operator/fluxinstance/#sync-configuration |
| instance.sync | object | `{"kind":"GitRepository","name":"","path":"","pullSecret":"","ref":"","url":""}` | Sync https://fluxcd.control-plane.io/operator/fluxinstance/#sync-configuration |
| nameOverride | string | `""` | |

## Source Code
Expand Down
14 changes: 14 additions & 0 deletions charts/flux-instance/templates/instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,27 @@ spec:
{{- end }}
components: {{ .Values.instance.components | toYaml | nindent 4 }}
cluster: {{ .Values.instance.cluster | toYaml | nindent 4 }}
{{- if or .Values.instance.commonMetadata.annotations .Values.instance.commonMetadata.labels }}
commonMetadata:
{{- with .Values.instance.commonMetadata.annotations }}
annotations:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.instance.commonMetadata.labels }}
labels:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
kustomize: {{ .Values.instance.kustomize | toYaml | nindent 4 }}
{{- if .Values.instance.sync.url }}
sync:
kind: {{ .Values.instance.sync.kind }}
url: {{ .Values.instance.sync.url }}
ref: {{ .Values.instance.sync.ref }}
path: {{ .Values.instance.sync.path }}
{{- if .Values.instance.sync.name }}
name: {{ .Values.instance.sync.name }}
{{- end }}
{{- if .Values.instance.sync.pullSecret }}
pullSecret: {{ .Values.instance.sync.pullSecret }}
{{- end }}
Expand Down
16 changes: 16 additions & 0 deletions charts/flux-instance/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@
},
"type": "object"
},
"commonMetadata": {
"properties": {
"annotations": {
"properties": {},
"type": "object"
},
"labels": {
"properties": {},
"type": "object"
}
},
"type": "object"
},
"components": {
"items": {
"enum": [
Expand Down Expand Up @@ -123,6 +136,9 @@
],
"type": "string"
},
"name": {
"type": "string"
},
"path": {
"type": "string"
},
Expand Down
5 changes: 5 additions & 0 deletions charts/flux-instance/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ instance:
networkPolicy: true
multitenant: false
tenantDefaultServiceAccount: "default"
# -- Common metadata https://fluxcd.control-plane.io/operator/fluxinstance/#common-metadata
commonMetadata: # @schema required: false
labels: { }
annotations: { }
# -- Storage https://fluxcd.control-plane.io/operator/fluxinstance/#storage-configuration
storage: # @schema required: false
class: ""
Expand All @@ -38,6 +42,7 @@ instance:
ref: ""
path: ""
pullSecret: ""
name: ""
kustomize: # @schema required: false
# -- Kustomize patches https://fluxcd.control-plane.io/operator/fluxinstance/#kustomize-patches
patches: [] # @schema item: object
Expand Down

0 comments on commit 12eccd6

Please sign in to comment.