Skip to content

Commit 9980b9b

Browse files
authored
Merge pull request #239 from cloudogu/bug/fixing-netpols-commitmessage
Fix netPols commit message
2 parents 0235ed7 + d89236a commit 9980b9b

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/main/groovy/com/cloudogu/gitops/features/PrometheusStack.groovy

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,13 @@ class PrometheusStack extends Feature implements FeatureWithImage {
120120
if (config.application['namespaceIsolation'] || config.application['netpols']) {
121121
ScmmRepo clusterResourcesRepo = scmmRepoProvider.getRepo('argocd/cluster-resources')
122122
clusterResourcesRepo.cloneRepo()
123-
String commitText=""
124123
for (String currentNamespace : namespaceList) {
125124

126-
if(config.application['namespaceIsolation']) {
125+
if (config.application['namespaceIsolation']) {
127126
def rbacYaml = new TemplatingEngine().template(new File(RBAC_NAMESPACE_ISOLATION_TEMPLATE),
128-
[namespace: currentNamespace,
127+
[namespace : currentNamespace,
129128
namePrefix: namePrefix])
130129
clusterResourcesRepo.writeFile("misc/monitoring/rbac/${currentNamespace}.yaml", rbacYaml)
131-
commitText+="Add namespace-isolated RBAC for PrometheusStack. "
132130
}
133131

134132
if (config.application['netpols']) {
@@ -137,11 +135,9 @@ class PrometheusStack extends Feature implements FeatureWithImage {
137135
namePrefix: namePrefix])
138136

139137
clusterResourcesRepo.writeFile("misc/monitoring/netpols/${currentNamespace}.yaml", netpolsYaml)
140-
commitText+="Network Policies allowing Prometheus scraping in namespaces"
141138
}
142139
}
143-
144-
clusterResourcesRepo.commitAndPush(commitText)
140+
clusterResourcesRepo.commitAndPush('Adding namespace-isolated RBAC and network policies if enabled.')
145141
}
146142

147143
def tmpHelmValues = fileSystemUtils.createTempFile()

0 commit comments

Comments
 (0)