Skip to content

Commit

Permalink
Allow setting namespace metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
bastjan committed Jan 30, 2024
1 parent 50d89fb commit b35979e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
3 changes: 3 additions & 0 deletions class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ parameters:
=_metadata:
multi_instance: true
namespace: ${_instance}
namespaceMetadata:
labels:
openshift.io/cluster-monitoring: 'true'

images:
reporting:
Expand Down
7 changes: 3 additions & 4 deletions component/main.jsonnet
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// main template for appuio-reporting
local alerts = import 'alerts.libsonnet';
local common = import 'common.libsonnet';
local com = import 'lib/commodore.libjsonnet';
local kap = import 'lib/kapitan.libjsonnet';
local kube = import 'lib/kube.libjsonnet';
local netPol = import 'networkpolicies.libsonnet';
Expand Down Expand Up @@ -190,10 +191,8 @@ local backfillCJ = function(rule, product, index)
{
'00_namespace': kube.Namespace(params.namespace) {
metadata+: {
labels+: common.Labels {
'openshift.io/cluster-monitoring': 'true',
},
},
labels+: common.Labels,
} + com.makeMergeable(params.namespaceMetadata),
},
'01_netpol': netPol.Policies,
'10_prom_secret': promURLSecret,
Expand Down

0 comments on commit b35979e

Please sign in to comment.