mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-13 01:50:55 +00:00
Add namespace for config map and secret generators
This commit is contained in:
33
pkg/commands/build/testdata/testcase-generators-namespace/expected.yaml
vendored
Normal file
33
pkg/commands/build/testdata/testcase-generators-namespace/expected.yaml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
apiVersion: v1
|
||||
data:
|
||||
altGreeting: Good Morning from default namespace!
|
||||
enableRisky: "false"
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: the-map-4959m5tm6c
|
||||
---
|
||||
apiVersion: v1
|
||||
data:
|
||||
altGreeting: Good Morning from non-default namespace!
|
||||
enableRisky: "false"
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: the-non-default-namespace-map-b6h49k7mt8
|
||||
namespace: non-default
|
||||
---
|
||||
apiVersion: v1
|
||||
data:
|
||||
password.txt: dmVyeSRlY3JldA==
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: the-secret-cfbmct72tb
|
||||
type: Opaque
|
||||
---
|
||||
apiVersion: v1
|
||||
data:
|
||||
password.txt: dmVyeSRlY3JldA==
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: the-non-default-namespace-secret-255294gd9d
|
||||
namespace: non-default
|
||||
type: Opaque
|
||||
19
pkg/commands/build/testdata/testcase-generators-namespace/in/kustomization.yaml
vendored
Normal file
19
pkg/commands/build/testdata/testcase-generators-namespace/in/kustomization.yaml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
configMapGenerator:
|
||||
- name: the-non-default-namespace-map
|
||||
namespace: non-default
|
||||
literals:
|
||||
- altGreeting=Good Morning from non-default namespace!
|
||||
- enableRisky="false"
|
||||
- name: the-map
|
||||
literals:
|
||||
- altGreeting=Good Morning from default namespace!
|
||||
- enableRisky="false"
|
||||
|
||||
secretGenerator:
|
||||
- name: the-non-default-namespace-secret
|
||||
namespace: non-default
|
||||
commands:
|
||||
password.txt: "cat password.txt"
|
||||
- name: the-secret
|
||||
commands:
|
||||
password.txt: "cat password.txt"
|
||||
1
pkg/commands/build/testdata/testcase-generators-namespace/in/password.txt
vendored
Normal file
1
pkg/commands/build/testdata/testcase-generators-namespace/in/password.txt
vendored
Normal file
@@ -0,0 +1 @@
|
||||
very$ecret
|
||||
4
pkg/commands/build/testdata/testcase-generators-namespace/test.yaml
vendored
Normal file
4
pkg/commands/build/testdata/testcase-generators-namespace/test.yaml
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
description: generators-namespace
|
||||
args: []
|
||||
filename: testdata/testcase-generators-namespace/in
|
||||
expectedStdout: testdata/testcase-generators-namespace/expected.yaml
|
||||
@@ -153,6 +153,9 @@ type ConfigMapArgs struct {
|
||||
// hash(content of configmap).
|
||||
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
||||
|
||||
// Namespace for the configmap, optional
|
||||
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
|
||||
|
||||
// behavior of configmap, must be one of create, merge and replace
|
||||
// 'create': create a new one;
|
||||
// 'replace': replace the existing one;
|
||||
@@ -170,6 +173,9 @@ type SecretArgs struct {
|
||||
// hash(content of secret).
|
||||
Name string `json:"name,omitempty" yaml:"name,omitempty"`
|
||||
|
||||
// Namespace for the secret, optional
|
||||
Namespace string `json:"namespace,omitempty" yaml:"namespace,omitempty"`
|
||||
|
||||
// behavior of secretGenerator, must be one of create, merge and replace
|
||||
// 'create': create a new one;
|
||||
// 'replace': replace the existing one;
|
||||
|
||||
Reference in New Issue
Block a user