diff --git a/kyaml/Makefile b/kyaml/Makefile index b068770b4..8ef332976 100644 --- a/kyaml/Makefile +++ b/kyaml/Makefile @@ -34,6 +34,9 @@ test: vet: go vet ./... +# sed command was added to resolve https://github.com/kubernetes-sigs/kustomize/issues/2767 +# it changes the ports merge key in kyaml/openapi/kubernetesapi/swagger.json +# likely related to https://github.com/kubernetes/kubernetes/issues/39188 openapi: sed -i 's/"x-kubernetes-patch-merge-key": "containerPort"/"x-kubernetes-patch-merge-key": "name"/g' 'openapi/kubernetesapi/swagger.json' (which $(GOPATH)/bin/go-bindata || go get -v github.com/go-bindata/go-bindata) diff --git a/plugin/builtin/patchtransformer/PatchTransformer_test.go b/plugin/builtin/patchtransformer/PatchTransformer_test.go index 1dec4da46..9bd026496 100644 --- a/plugin/builtin/patchtransformer/PatchTransformer_test.go +++ b/plugin/builtin/patchtransformer/PatchTransformer_test.go @@ -640,6 +640,7 @@ spec: path: /test `) } + func TestPatchTransformerJsonAsYaml(t *testing.T) { th := kusttest_test.MakeEnhancedHarness(t). PrepBuiltin("PatchTransformer") @@ -691,6 +692,10 @@ spec: `) } +// test for https://github.com/kubernetes-sigs/kustomize/issues/2767 +// resolved with a sed command in kyaml/Makefile that edits the file +// kyaml/openapi/kubernetesapi/swagger.json to change the ports merge key +// likely related to https://github.com/kubernetes/kubernetes/issues/39188 func TestPatchTransformerSimilarArrays(t *testing.T) { th := kusttest_test.MakeEnhancedHarness(t). PrepBuiltin("PatchTransformer")