Skip to content

Commit d192b20

Browse files
authored
Merge pull request #107 from blazarecki/add-substituteFrom
Add support for `substituteFrom` to flux-oci-sync and flux-git-sync modules
2 parents c265ebc + 30a2c25 commit d192b20

File tree

6 files changed

+19
-0
lines changed

6 files changed

+19
-0
lines changed

modules/flux-git-sync/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ timoni -n flux-system delete my-repo-sync
3838
| `sync: serviceAccountName:` | `string` | `""` | Service account to impersonate |
3939
| `sync: targetNamespace:` | `string` | `""` | Target namespace |
4040
| `substitute:` | `{[ string]: string}` | `{}` | Configure [post build variable substitution](https://fluxcd.io/flux/components/kustomize/kustomizations/#post-build-variable-substitution) |
41+
| `substituteFrom:` | `[...{kind: string, name: string, optional: bool}]` | `[]` | List of ConfigMaps and Secrets to use for variable substitution |
4142
| `dependsOn:` | `[...{name: string}]` | `{}` | List of dependencies |
4243
| `metadata: labels:` | `{[ string]: string}` | `{}` | Custom labels |
4344
| `metadata: annotations:` | `{[ string]: string}` | `{}` | Custom annotations |

modules/flux-git-sync/templates/config.cue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ import (
3636
}
3737

3838
substitute?: [string]: string
39+
substituteFrom?: [...{
40+
kind: "Secret" | "ConfigMap"
41+
name: string
42+
optional?: bool
43+
}]
3944

4045
dependsOn?: [...{
4146
name: string

modules/flux-git-sync/templates/kustomization.cue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ import (
3030
postBuild: substitute: #config.substitute
3131
}
3232

33+
if #config.substituteFrom != _|_ {
34+
postBuild: substituteFrom: #config.substituteFrom
35+
}
36+
3337
if #config.dependsOn != _|_ {
3438
dependsOn: #config.dependsOn
3539
}

modules/flux-oci-sync/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ timoni -n flux-system delete my-repo-sync
4242
| `sync: serviceAccountName:` | `string` | `""` | Service account to impersonate |
4343
| `sync: targetNamespace:` | `string` | `""` | Target namespace |
4444
| `substitute:` | `{[ string]: string}` | `{}` | Configure [post build variable substitution](https://fluxcd.io/flux/components/kustomize/kustomizations/#post-build-variable-substitution) |
45+
| `substituteFrom:` | `[...{kind: string, name: string, optional: bool}]` | `[]` | List of ConfigMaps and Secrets to use for variable substitution |
4546
| `dependsOn:` | `[...{name: string}]` | `{}` | List of dependencies |
4647
| `metadata: labels:` | `{[ string]: string}` | `{}` | Custom labels |
4748
| `metadata: annotations:` | `{[ string]: string}` | `{}` | Custom annotations |

modules/flux-oci-sync/templates/config.cue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ import (
5454
}
5555

5656
substitute?: [string]: string
57+
substituteFrom?: [...{
58+
kind: "Secret" | "ConfigMap"
59+
name: string
60+
optional?: bool
61+
}]
5762

5863
dependsOn?: [...{
5964
name: string

modules/flux-oci-sync/templates/kustomization.cue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ import (
2828
if #config.substitute != _|_ {
2929
postBuild: substitute: #config.substitute
3030
}
31+
if #config.substituteFrom != _|_ {
32+
postBuild: substituteFrom: #config.substituteFrom
33+
}
3134
if #config.dependsOn != _|_ {
3235
dependsOn: #config.dependsOn
3336
}

0 commit comments

Comments
 (0)