mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-10 16:42:51 +00:00
Cover #1155 with a test.
This commit is contained in:
@@ -17,6 +17,7 @@ limitations under the License.
|
|||||||
package target_test
|
package target_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"sigs.k8s.io/kustomize/pkg/kusttest"
|
"sigs.k8s.io/kustomize/pkg/kusttest"
|
||||||
@@ -479,3 +480,28 @@ spec:
|
|||||||
name: configmap-in-base
|
name: configmap-in-base
|
||||||
`)
|
`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestGeneratingIntoNamespaces(t *testing.T) {
|
||||||
|
th := kusttest_test.NewKustTestHarness(t, "/app")
|
||||||
|
th.WriteK("/app", `
|
||||||
|
configMapGenerator:
|
||||||
|
- name: test
|
||||||
|
namespace: bob
|
||||||
|
literals:
|
||||||
|
- key=value
|
||||||
|
- name: test
|
||||||
|
namespace: kube-system
|
||||||
|
literals:
|
||||||
|
- key=value
|
||||||
|
`)
|
||||||
|
_, err := th.MakeKustTarget().MakeCustomizedResMap()
|
||||||
|
// Document #1155
|
||||||
|
// This actually should be nil; it should work, and
|
||||||
|
// have some expected output.
|
||||||
|
if err == nil {
|
||||||
|
t.Fatalf("expected error")
|
||||||
|
}
|
||||||
|
if !strings.Contains(err.Error(), "must merge or replace") {
|
||||||
|
t.Fatalf("unexpected error %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user