Skip to content

Commit

Permalink
Fix rendering namespaceQuotaOverrides config (#210)
Browse files Browse the repository at this point in the history
Follow up of #207
  • Loading branch information
bastjan authored Oct 11, 2024
1 parent 4504600 commit ab27c57
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
16 changes: 16 additions & 0 deletions component/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,21 @@ local appuioNsProvisionersRoleBinding = kube.ClusterRoleBinding('appuio-ns-provi
],
};

local namespaceQuotaOverrides = [
kube.ConfigMap('override-%s' % org) {
metadata+: {
labels+: {
// this label is informational only here
'appuio.io/organization': org,
},
},
data+: {
namespaceQuota: '%s' % params.namespaceQuotaOverrides[org],
},
} + common.DefaultLabels
for org in std.filter(function(key) key != null && params.namespaceQuotaOverrides[key] != null, std.objectFields(params.namespaceQuotaOverrides))
];

{
'00_namespace': kube.Namespace(params.namespace) {
metadata+: {
Expand All @@ -71,4 +86,5 @@ local appuioNsProvisionersRoleBinding = kube.ClusterRoleBinding('appuio-ns-provi
'01_appuio_ns_provisioner_role': appuioNsProvisionerRole + common.DefaultLabels,
'01_appuio_ns_provisioners_crb': appuioNsProvisionersRoleBinding + common.DefaultLabels,

[if std.length(namespaceQuotaOverrides) > 0 then '13_namespace_quota_overrides']: namespaceQuotaOverrides,
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
data:
namespaceQuota: '50'
kind: ConfigMap
metadata:
annotations: {}
labels:
app.kubernetes.io/component: appuio-cloud
app.kubernetes.io/managed-by: commodore
app.kubernetes.io/name: appuio-cloud
appuio.io/organization: example-company
name: override-example-company
name: override-example-company

0 comments on commit ab27c57

Please sign in to comment.