mv basereusenameprefix_test to api/krusty/, Provide another high level example.

This commit is contained in:
Dingshujie
2019-11-29 20:05:46 +08:00
committed by DingShujie
parent 763cb4e925
commit 8a2b3cd1d9

View File

@@ -1,12 +1,10 @@
// Copyright 2019 The Kubernetes Authors. // Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
package target_test package krusty_test
import ( import (
"testing" "testing"
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
) )
// Here is a structure of a kustomization of two components, component1 // Here is a structure of a kustomization of two components, component1
@@ -40,7 +38,7 @@ import (
// ├── kustomization.yaml // ├── kustomization.yaml
func TestBaseReuseNameConflict(t *testing.T) { func TestBaseReuseNameConflict(t *testing.T) {
th := kusttest_test.NewKustTestHarness(t, "/app") th := makeTestHarness(t)
th.WriteK("/app/component1/base", ` th.WriteK("/app/component1/base", `
resources: resources:
- ../../shared - ../../shared
@@ -117,10 +115,7 @@ resources:
- component2/overlay - component2/overlay
`) `)
m, err := th.MakeKustTarget().MakeCustomizedResMap() m := th.Run("/app", th.MakeDefaultOptions())
if err != nil {
t.Fatalf("Err: %v", err)
}
th.AssertActualEqualsExpected(m, ` th.AssertActualEqualsExpected(m, `
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim