Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Commit

Permalink
Fix Flux for public repo
Browse files Browse the repository at this point in the history
  • Loading branch information
hieumoscow authored Mar 31, 2022
1 parent 9253cae commit 6c4d9c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion caf_solution/add-ons/aks_secure_baseline_v2/flux/flux.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ locals {
content : v
}
]
sync = [for v in data.kubectl_file_documents.sync.documents : {
flux_sync_yaml_without_secret = [for x in data.kubectl_file_documents.sync.documents : (length(regexall("kind: GitRepository", x)) == 0) ? x : replace(x, "/\n.*(secretRef:)\n.*(name: flux-system)/", "")]

sync = [for v in can (var.setting.secret.data) ? data.kubectl_file_documents.sync.documents : local.flux_sync_yaml_without_secret : {
data : yamldecode(v)
content : v
}
Expand All @@ -60,6 +62,7 @@ resource "kubectl_manifest" "sync" {


resource "kubernetes_secret" "fluxauth" {
count = can(var.setting.secret.data) ? 1 : 0
depends_on = [kubectl_manifest.install]

metadata {
Expand Down

0 comments on commit 6c4d9c2

Please sign in to comment.