Skip to content

Commit

Permalink
Modified conditional gitops configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielscholl committed Oct 3, 2024
1 parent 76206f7 commit abecbb7
Showing 1 changed file with 47 additions and 37 deletions.
84 changes: 47 additions & 37 deletions bicep/modules/blade_service.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -717,38 +717,6 @@ module appConfigMap './aks-config-map/main.bicep' = {
\______| |__| |__| \______/ | _| |_______/
*/

var componentKustomization = {
path: serviceLayerConfig.gitops.components
timeoutInSeconds: 300
syncIntervalInSeconds: 300
retryIntervalInSeconds: 300
prune: true
}

var applicationKustomization = {
path: serviceLayerConfig.gitops.applications
dependsOn: [
'components'
]
timeoutInSeconds: 300
syncIntervalInSeconds: 300
retryIntervalInSeconds: 300
prune: true
}

var experimentalKustomization = {
experimental: {
path: serviceLayerConfig.gitops.experimental
dependsOn: [
'applications'
]
timeoutInSeconds: 300
syncIntervalInSeconds: 300
retryIntervalInSeconds: 300
prune: true
}
}

//--------------Flux Config---------------
module fluxConfiguration 'br/public:avm/res/kubernetes-configuration/flux-configuration:0.3.3' = if(enableSoftwareLoad) {
name: '${bladeConfig.sectionName}-cluster-gitops'
Expand All @@ -768,11 +736,53 @@ module fluxConfiguration 'br/public:avm/res/kubernetes-configuration/flux-config
tag: serviceLayerConfig.gitops.tag
}
}

kustomizations: union(
componentKustomization,
applicationKustomization,
enableExperimental ? experimentalKustomization : {})
kustomizations: enableExperimental ? {
components: {
path: serviceLayerConfig.gitops.components
timeoutInSeconds: 300
syncIntervalInSeconds: 300
retryIntervalInSeconds: 300
prune: true
}
applications: {
path: serviceLayerConfig.gitops.applications
dependsOn: [
'components'
]
timeoutInSeconds: 300
syncIntervalInSeconds: 300
retryIntervalInSeconds: 300
prune: true
}
experimental: {
path: serviceLayerConfig.gitops.experimental
dependsOn: [
'applications'
]
timeoutInSeconds: 300
syncIntervalInSeconds: 300
retryIntervalInSeconds: 300
prune: true
}
} : {
components: {
path: serviceLayerConfig.gitops.components
timeoutInSeconds: 300
syncIntervalInSeconds: 300
retryIntervalInSeconds: 300
prune: true
}
applications: {
path: serviceLayerConfig.gitops.applications
dependsOn: [
'components'
]
timeoutInSeconds: 300
syncIntervalInSeconds: 300
retryIntervalInSeconds: 300
prune: true
}
}
}
dependsOn: [
app_config
Expand Down

0 comments on commit abecbb7

Please sign in to comment.