Do not add namespace to cluster-scoped resources
When adding namespace to the helm-generated YAML files, do not add it to cluster-scoped resources like ClusterRole, ClusterRoleBinding, and ValidatingWebhookConfiguration. Regenerate static YAML resource specs.
This commit is contained in:
parent
ded95c73c6
commit
f4585f99a6
7 changed files with 405 additions and 433 deletions
|
|
@ -24,7 +24,9 @@ yaml.indent(mapping=2, sequence=4, offset=2)
|
|||
for manifest in yaml.load_all(sys.stdin.read()):
|
||||
if manifest:
|
||||
# helm template does not have support for namespace declaration
|
||||
if 'metadata' in manifest and 'namespace' not in manifest['metadata']:
|
||||
if ('metadata' in manifest and 'namespace' not in manifest['metadata']
|
||||
and manifest['kind'] != 'Namespace' and manifest['kind'] != 'ClusterRole'
|
||||
and manifest['kind'] != 'ClusterRoleBinding' and manifest['kind'] != 'ValidatingWebhookConfiguration'):
|
||||
manifest['metadata']['namespace'] = sys.argv[1]
|
||||
|
||||
# respect existing replicas definition
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue