Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 1 addition & 47 deletions charts/base-cluster/templates/global/helmRepositories.yaml
Original file line number Diff line number Diff line change
@@ -1,47 +1 @@
{{- range $name, $config := .Values.global.helmRepositories }}
{{- $create := true -}}
{{- if $config.condition -}}
{{- $create = eq (include "common.tplvalues.render" (dict "value" $config.condition "context" (deepCopy $))) "true" -}}
{{- end -}}
{{- if $create -}}
{{- if eq ($config.type | default "helm") "helm" }}
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: {{ $name | quote }}
namespace: {{ $.Release.Namespace }}
labels: {{- include "common.labels.standard" $ | nindent 4 }}
spec:
interval: {{ $config.interval | default "5m" }}
url: {{ $config.url }}
{{- if $config.url | hasPrefix "oci://" }}
type: oci
{{- end }}
---
{{ else -}}
{{- range $chartName, $chartConfig := $config.charts -}}
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: {{ printf "%s-%s" $name $chartName | quote }}
namespace: {{ $.Release.Namespace }}
labels: {{- include "common.labels.standard" $ | nindent 4 }}
spec:
interval: {{ $chartConfig.interval | default "5m" }}
url: {{ $config.url }}
{{- $refOptions := (list "branch" "commit" "semver" "tag") -}}
{{- $ref := (list nil) | first -}}
{{- range $refName := $refOptions -}}
{{- $value := dig $refName nil $chartConfig -}}
{{- if $value -}}
{{- $ref = dict $refName $value -}}
{{- end -}}
{{- end }}
{{- if $ref }}
ref: {{- toYaml $ref | nindent 4 }}
{{- end }}
---
{{ end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- include "common.helm.repositories" (dict "context" .) -}}
Comment thread
cwrau marked this conversation as resolved.
Comment thread
cwrau marked this conversation as resolved.
Comment thread
cwrau marked this conversation as resolved.
180 changes: 2 additions & 178 deletions charts/base-cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,178 +178,7 @@
"additionalProperties": false
},
"helmRepositories": {
"type": "object",
"description": "A map of helmRepositories to create, the key is the name",
"additionalProperties": {
"type": "object",
"properties": {
"url": {
"type": "string",
"pattern": "(https|oci)://.+"
},
"interval": {
"type": "string",
"description": "The interval in which to update the repository",
"pattern": "[0-9]+[mhd]"
},
"condition": {
"$ref": "#/$defs/condition"
},
"charts": {
"type": "object",
"description": "Which charts are deployed in which version using this repo, used internally",
"additionalProperties": {
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"properties": {
"branch": {
"type": "string"
},
"commit": {
"type": "string"
},
"semver": {
"type": "string"
},
"tag": {
"type": "string"
},
"path": {
"type": "string",
"description": "Path of the chart in the repository"
},
"interval": {
"type": "string",
"description": "The interval in which to update the repository",
"pattern": "[0-9]+[mhd]"
}
},
"oneOf": [
{
"required": [
"branch"
]
},
{
"required": [
"commit"
]
},
{
"required": [
"semver"
]
},
{
"required": [
"tag"
]
},
{
"not": {
"anyOf": [
{
"required": [
"branch"
]
},
{
"required": [
"commit"
]
},
{
"required": [
"semver"
]
},
{
"required": [
"tag"
]
}
]
}
}
],
"additionalProperties": false
}
]
}
},
"type": {
"type": "string",
"enum": [
"git",
"helm"
],
"default": "helm"
}
},
"oneOf": [
{
"properties": {
"url": {
"type": "string",
"pattern": "(https|oci)://.+"
},
"charts": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"oneOf": [
{
"not": {
"required": [
"type"
]
}
},
{
"properties": {
"type": {
"const": "helm"
}
},
"required": [
"type"
]
}
]
},
{
"properties": {
"url": {
"type": "string",
"pattern": "https://.+"
},
"type": {
"const": "git"
}
},
"not": {
"required": [
"interval"
]
},
"required": [
"charts",
"type"
]
}
],
"additionalProperties": false,
"required": [
"url"
]
}
"$ref": "https://raw.githubusercontent.com/teutonet/teutonet-helm-charts/main/charts/common/values.schema.json#/$defs/helmRepositories"
Comment thread
cwrau marked this conversation as resolved.
Comment thread
cwrau marked this conversation as resolved.
},
Comment thread
cwrau marked this conversation as resolved.
"certificates": {
"type": "object",
Expand Down Expand Up @@ -1800,12 +1629,7 @@
"pattern": "(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])\\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])"
},
"condition": {
"type": "string",
"description": "A condition with which to decide to include the resource. This will be templated. Must return the literal `true`, truthy values don't work.",
"examples": [
"{{ true }}",
"{{ eq .Values.global.baseDomain \"teuto.net\" }}"
]
"$ref": "https://raw.githubusercontent.com/teutonet/teutonet-helm-charts/main/charts/common/values.schema.json#/$defs/condition"
Comment thread
cwrau marked this conversation as resolved.
Comment thread
cwrau marked this conversation as resolved.
},
Comment thread
cwrau marked this conversation as resolved.
"targetNamespaces": {
"description": "The namespaces to sync the secret into, or `ALL` for all namespaces",
Expand Down
Loading