Skip to content

Commit

Permalink
Add additional_facts parameter to inject the additional dynamic fac…
Browse files Browse the repository at this point in the history
…ts from the hierarchy
  • Loading branch information
bastjan committed Nov 14, 2023
1 parent 3f434f1 commit 927c84a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ parameters:
argocd:
image: quay.io/argoproj/argocd
tag: 'v2.3.12@sha256:57474c3c31d2e3606e9c7dad2e449e604a48ac8e9aaaa413274aed41e6550e59'

additional_facts: {}
16 changes: 16 additions & 0 deletions component/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,24 @@ local deployment = kube.Deployment('steward') {
},
};

local additionalFacts = kube.ConfigMap('additional-facts') {
metadata+: {
namespace: params.namespace,
labels: {
'app.kubernetes.io/name': 'steward',
'app.kubernetes.io/managed-by': 'syn',
},
},
data: std.mapWithKey(
function(_, v)
if std.isString(v) then v else std.manifestJsonMinified(v),
std.prune(params.additional_facts)
),
};

{
'01_rbac': [ cluster_role, service_account, cluster_role_binding ],
'05_secret': secret,
'10_deployment': deployment,
'20_additional_facts': additionalFacts,
}
8 changes: 7 additions & 1 deletion tests/defaults.yml
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@

parameters:
steward:
additional_facts:
blub: blub
blubobj:
blub: blub
deleted_blub: null

0 comments on commit 927c84a

Please sign in to comment.