Skip to content

Commit

Permalink
Merge pull request #166 from appuio/fix/remove-config
Browse files Browse the repository at this point in the history
Allow removing appuio-cloud-agent config entries by setting them to `null`
  • Loading branch information
simu authored Jul 10, 2023
2 parents 3a627e9 + 22252d1 commit 303c23d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
36 changes: 21 additions & 15 deletions component/agent.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,27 @@ local defaultOrganizationClusterRoles = std.prune(
);


local configMap = kube.ConfigMap('appuio-cloud-agent-config') {
metadata+: {
namespace: params.namespace,
},
data: {
'config.yaml': std.manifestYamlDoc(params.agent.config {
local subjects = mapSubjects(super._subjects),
_subjects:: null,
PrivilegedGroups: subjects.groups,
PrivilegedUsers: subjects.users,
PrivilegedClusterRoles: common.FlattenSet(super.PrivilegedClusterRoles),
DefaultOrganizationClusterRoles: defaultOrganizationClusterRoles,
}),
},
};
local configMap =
local cleanConfig = {
[k]: params.agent.config[k]
for k in std.objectFields(params.agent.config)
if params.agent.config[k] != null
};
kube.ConfigMap('appuio-cloud-agent-config') {
metadata+: {
namespace: params.namespace,
},
data: {
'config.yaml': std.manifestYamlDoc(cleanConfig {
local subjects = mapSubjects(super._subjects),
_subjects:: null,
PrivilegedGroups: subjects.groups,
PrivilegedUsers: subjects.users,
PrivilegedClusterRoles: common.FlattenSet(super.PrivilegedClusterRoles),
DefaultOrganizationClusterRoles: defaultOrganizationClusterRoles,
}),
},
};

local deployment = loadManifest('manager/manager.yaml') {
metadata+: {
Expand Down
1 change: 1 addition & 0 deletions docs/modules/ROOT/pages/references/parameters.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ default:: https://github.com/appuio/component-appuio-cloud/blob/master/class/def
This parameter allows configuring the APPUiO Cloud Agent.
See the https://github.com/appuio/appuio-cloud-agent/blob/HEAD/config.go[Agent repository] for an overview of the available configuration options.

Configuration parameters can be removed in the hierarchy by setting them to `null`.

==== `agent.config._subjects`

Expand Down

0 comments on commit 303c23d

Please sign in to comment.