Implement namespace overriding

This commit is contained in:
stefanprodan 2020-09-29 15:39:44 +03:00
parent a0f705ff6e
commit e5e2cd7dcb
3 changed files with 10 additions and 3 deletions

View File

@ -165,7 +165,8 @@ spec:
Defaults to false.
type: boolean
targetNamespace:
description: TargetNamespace sets or overrides the kustomization namespace.
description: TargetNamespace sets or overrides the namespace in the
kustomization.yaml file.
maxLength: 63
minLength: 1
type: string

View File

@ -76,6 +76,10 @@ func (kg *KustomizeGenerator) WriteFile(dirPath string) (string, error) {
}
}
if kg.kustomization.Spec.TargetNamespace != "" {
kus.Namespace = kg.kustomization.Spec.TargetNamespace
}
kd, err := yaml.Marshal(kus)
if err != nil {
return "", err

View File

@ -196,7 +196,8 @@ string
</td>
<td>
<em>(Optional)</em>
<p>TargetNamespace sets or overrides the kustomization namespace.</p>
<p>TargetNamespace sets or overrides the namespace in the
kustomization.yaml file.</p>
</td>
</tr>
<tr>
@ -657,7 +658,8 @@ string
</td>
<td>
<em>(Optional)</em>
<p>TargetNamespace sets or overrides the kustomization namespace.</p>
<p>TargetNamespace sets or overrides the namespace in the
kustomization.yaml file.</p>
</td>
</tr>
<tr>