mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-12 01:14:22 +00:00
Annotate decisions on issue 3304 in plugins.
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
|||||||
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
kusttest_test "sigs.k8s.io/kustomize/api/testutils/kusttest"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO(#3304)
|
// TODO(#3304): DECISION - OK to move to kyaml and not do conflict detection.
|
||||||
const skipConflictDetectionTests = konfig.FlagEnableKyamlDefaultValue
|
const skipConflictDetectionTests = konfig.FlagEnableKyamlDefaultValue
|
||||||
|
|
||||||
func errorContains(err error, possibilities ...string) bool {
|
func errorContains(err error, possibilities ...string) bool {
|
||||||
@@ -609,6 +609,7 @@ spec:
|
|||||||
// when patch1 and patch2 are merged, so the patch
|
// when patch1 and patch2 are merged, so the patch
|
||||||
// applied is effectively only patch2.yaml.
|
// applied is effectively only patch2.yaml.
|
||||||
// So it cannot delete the "B: Y"
|
// So it cannot delete the "B: Y"
|
||||||
|
// TODO(#3304): DECISION - undecided.
|
||||||
konfig.IfApiMachineryElseKyaml(`
|
konfig.IfApiMachineryElseKyaml(`
|
||||||
apiVersion: example.com/v1
|
apiVersion: example.com/v1
|
||||||
kind: Foo
|
kind: Foo
|
||||||
@@ -656,7 +657,7 @@ spec:
|
|||||||
resMap,
|
resMap,
|
||||||
// This time only patch2 was applied. Same answer on the kyaml
|
// This time only patch2 was applied. Same answer on the kyaml
|
||||||
// path, but different answer on apimachinery path (B becomes "true"?)
|
// path, but different answer on apimachinery path (B becomes "true"?)
|
||||||
// The kyaml path is doing better here.
|
// TODO(#3304): DECISION - kyaml doing better here, not a bug.
|
||||||
konfig.IfApiMachineryElseKyaml(`
|
konfig.IfApiMachineryElseKyaml(`
|
||||||
apiVersion: example.com/v1
|
apiVersion: example.com/v1
|
||||||
kind: Foo
|
kind: Foo
|
||||||
@@ -779,7 +780,6 @@ spec:
|
|||||||
// Note that for SMP/WithSchema merge, the name:nginx entry
|
// Note that for SMP/WithSchema merge, the name:nginx entry
|
||||||
// is mandatory
|
// is mandatory
|
||||||
func addLabelAndEnvPatch(kind string) string {
|
func addLabelAndEnvPatch(kind string) string {
|
||||||
|
|
||||||
res := `
|
res := `
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: %s
|
kind: %s
|
||||||
|
|||||||
@@ -44,15 +44,7 @@ literals:
|
|||||||
- VEGETABLE=carrot
|
- VEGETABLE=carrot
|
||||||
`)
|
`)
|
||||||
|
|
||||||
obscure := `obscure: CkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0LApjb25zZWN0ZXR1ciBhZGlwaXNjaW5nIGVsaXQuCg==`
|
expFmt := `
|
||||||
if konfig.FlagEnableKyamlDefaultValue {
|
|
||||||
// The kyaml code does a better job of line wrapping.
|
|
||||||
obscure = `obscure: |
|
|
||||||
CkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0LApjb25zZWN0ZXR1ciBhZGlwaXNjaW5nIG
|
|
||||||
VsaXQuCg==`
|
|
||||||
}
|
|
||||||
|
|
||||||
th.AssertActualEqualsExpected(rm, fmt.Sprintf(`
|
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
data:
|
data:
|
||||||
DB_PASSWORD: aWxvdmV5b3U=
|
DB_PASSWORD: aWxvdmV5b3U=
|
||||||
@@ -65,5 +57,18 @@ metadata:
|
|||||||
name: mySecret
|
name: mySecret
|
||||||
namespace: whatever
|
namespace: whatever
|
||||||
type: Opaque
|
type: Opaque
|
||||||
`, obscure))
|
`
|
||||||
|
th.AssertActualEqualsExpected(
|
||||||
|
rm,
|
||||||
|
// TODO(#3304): DECISION - kyaml doing better here, not a bug.
|
||||||
|
konfig.IfApiMachineryElseKyaml(
|
||||||
|
fmt.Sprintf(
|
||||||
|
expFmt,
|
||||||
|
`obscure: CkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0LApjb25zZWN0ZXR1ciBhZGlwaXNjaW5nIGVsaXQuCg==`),
|
||||||
|
fmt.Sprintf(
|
||||||
|
expFmt,
|
||||||
|
`obscure: |
|
||||||
|
CkxvcmVtIGlwc3VtIGRvbG9yIHNpdCBhbWV0LApjb25zZWN0ZXR1ciBhZGlwaXNjaW5nIG
|
||||||
|
VsaXQuCg==`),
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user