Deprecate 'bases:' field.

This commit is contained in:
Jeffrey Regan
2019-06-18 07:28:58 -07:00
parent 0dbe78149d
commit cc531af665
24 changed files with 156 additions and 152 deletions

View File

@@ -133,6 +133,7 @@ func TestPreserveComments(t *testing.T) {
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../namespaces
- pod.yaml
- service.yaml
# something you may want to keep
@@ -144,8 +145,6 @@ vars:
apiVersion: v1
kind: Service
name: my-service
bases:
- ../namespaces
# some descriptions for the patches
patchesStrategicMerge:
- service.yaml
@@ -176,10 +175,11 @@ func TestPreserveCommentsWithAdjust(t *testing.T) {
# shem qing some comments
# Some comments
# This is some comment we should preserve
# don't delete it
resources:
RESOURCES:
- ../namespaces
- pod.yaml
# See which field this comment goes into
- service.yaml
@@ -197,9 +197,6 @@ vars:
kind: Service
name: my-service
BASES:
- ../namespaces
# some descriptions for the patches
patchesStrategicMerge:
@@ -214,11 +211,12 @@ generatorOptions:
# shem qing some comments
# Some comments
# This is some comment we should preserve
# don't delete it
# See which field this comment goes into
resources:
- ../namespaces
- pod.yaml
- service.yaml
@@ -235,9 +233,6 @@ vars:
kind: Service
name: my-service
bases:
- ../namespaces
# some descriptions for the patches
patchesStrategicMerge:
@@ -263,7 +258,9 @@ generatorOptions:
}
bytes, _ := fSys.ReadFile(mf.path)
if !reflect.DeepEqual(expected, bytes) {
t.Fatal("written kustomization with comments is not the same as original one\n", string(bytes))
if string(expected) != string(bytes) {
t.Fatalf(
"expected =\n%s\n\nactual =\n%s\n",
string(expected), string(bytes))
}
}