Skip to content

Commit

Permalink
Merge pull request #62 from projectsyn/feat/namespace-annotation-labels
Browse files Browse the repository at this point in the history
Add option to define namespace labels and annotations
  • Loading branch information
glrf authored Jul 3, 2023
2 parents f969b53 + ed1a91c commit b927193
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 3 deletions.
3 changes: 3 additions & 0 deletions class/defaults.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
parameters:
crossplane:
namespace: syn-crossplane
namespaceLabels: {}
namespaceAnnotations: {}

charts:
crossplane: 1.11.0
images:
Expand Down
7 changes: 6 additions & 1 deletion component/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ local namespace =
;

{
'00_namespace': namespace,
'00_namespace': namespace {
metadata+: {
labels+: params.namespaceLabels,
annotations+: params.namespaceAnnotations,
},
},
'01_rbac_finalizer_clusterrole': rbacFinalizerRole,
'01_rbac_finalizer_clusterrolebinding': rbacFinalizerRoleBinding,
[if std.length(providers) > 0 then '10_providers']: providers,
Expand Down
16 changes: 16 additions & 0 deletions docs/modules/ROOT/pages/references/parameters.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@ default:: `syn-crossplane`

The namespace in which to deploy Crossplane.

== `namespaceLabels`

[horizontal]
type:: dict
default:: `{}`

Additional labels to add to the created namespace.

== `namespaceAnnotations`

[horizontal]
type:: dict
default:: `{}`

Additional annotations to add to the created namespace.

== `providers`

[horizontal]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
apiVersion: v1
kind: Namespace
metadata:
annotations: {}
annotations:
openshift.io/node-selector: node-role.kubernetes.io/infra=
labels:
foo: bar
name: syn-crossplane
name: syn-crossplane
6 changes: 5 additions & 1 deletion tests/openshift4.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
parameters:
facts:
distribution: openshift4
crossplane: {}
crossplane:
namespaceLabels:
foo: bar
namespaceAnnotations:
openshift.io/node-selector: node-role.kubernetes.io/infra=

0 comments on commit b927193

Please sign in to comment.