diff --git a/kyaml/go.sum b/kyaml/go.sum index 6d1920b01aa..3fd62d67e3f 100644 --- a/kyaml/go.sum +++ b/kyaml/go.sum @@ -95,6 +95,8 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.7.0 h1:aizVhC/NAAcKWb+5QsU1iNOZb4Yws5UO2I+aIprQITM= github.com/mailru/easyjson v0.7.0/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/mikebz/yaml v0.0.0-20210617073151-b708c49f632c h1:FJXP8Z0s5lmq8fz2rqi0shEL3S01gNyoRvt5/vRVjEU= +github.com/mikebz/yaml v0.0.0-20210617073151-b708c49f632c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= diff --git a/kyaml/kio/filters/fmtr_test.go b/kyaml/kio/filters/fmtr_test.go index 156bbcf6434..b1de46205e5 100644 --- a/kyaml/kio/filters/fmtr_test.go +++ b/kyaml/kio/filters/fmtr_test.go @@ -416,9 +416,9 @@ spec: image: nginx:1.7.9 ports: - containerPort: 80 + # this is a container - name: b-nginx image: nginx:1.7.9 - # this is a container ports: # this is a port - containerPort: 80 diff --git a/kyaml/kio/filters/testdata/dataset1-expected/java/java-deployment.resource.yaml b/kyaml/kio/filters/testdata/dataset1-expected/java/java-deployment.resource.yaml index 7ca9554fa84..919936367f6 100644 --- a/kyaml/kio/filters/testdata/dataset1-expected/java/java-deployment.resource.yaml +++ b/kyaml/kio/filters/testdata/dataset1-expected/java/java-deployment.resource.yaml @@ -37,7 +37,6 @@ spec: name: app-config env: - name: JAVA_OPTS - value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap - -Djava.security.egd=file:/dev/./urandom + value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Djava.security.egd=file:/dev/./urandom imagePullPolicy: Always minReadySeconds: 20 diff --git a/kyaml/kio/filters/testdata/dataset1-localupdates/java/java-deployment.resource.yaml b/kyaml/kio/filters/testdata/dataset1-localupdates/java/java-deployment.resource.yaml index 9972cc0236e..e1b8b0bfc99 100644 --- a/kyaml/kio/filters/testdata/dataset1-localupdates/java/java-deployment.resource.yaml +++ b/kyaml/kio/filters/testdata/dataset1-localupdates/java/java-deployment.resource.yaml @@ -35,7 +35,6 @@ spec: name: app-config env: - name: JAVA_OPTS - value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap - -Djava.security.egd=file:/dev/./urandom + value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Djava.security.egd=file:/dev/./urandom imagePullPolicy: Always minReadySeconds: 20 diff --git a/kyaml/kio/filters/testdata/dataset1-remoteupdates/java/java-deployment.resource.yaml b/kyaml/kio/filters/testdata/dataset1-remoteupdates/java/java-deployment.resource.yaml index ef6c8f1d93d..7769d0f623a 100644 --- a/kyaml/kio/filters/testdata/dataset1-remoteupdates/java/java-deployment.resource.yaml +++ b/kyaml/kio/filters/testdata/dataset1-remoteupdates/java/java-deployment.resource.yaml @@ -34,7 +34,6 @@ spec: name: app-config env: - name: JAVA_OPTS - value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap - -Djava.security.egd=file:/dev/./urandom + value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Djava.security.egd=file:/dev/./urandom imagePullPolicy: Always minReadySeconds: 5 diff --git a/kyaml/kio/filters/testdata/dataset1/java/java-deployment.resource.yaml b/kyaml/kio/filters/testdata/dataset1/java/java-deployment.resource.yaml index 53ffa5b4f81..cf39a9c709b 100644 --- a/kyaml/kio/filters/testdata/dataset1/java/java-deployment.resource.yaml +++ b/kyaml/kio/filters/testdata/dataset1/java/java-deployment.resource.yaml @@ -32,7 +32,6 @@ spec: name: app-config env: - name: JAVA_OPTS - value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap - -Djava.security.egd=file:/dev/./urandom + value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Djava.security.egd=file:/dev/./urandom imagePullPolicy: Always minReadySeconds: 5 diff --git a/kyaml/kio/filters/testdata/dataset1/rails/rails-deployment.resource.yaml b/kyaml/kio/filters/testdata/dataset1/rails/rails-deployment.resource.yaml index f6073ea52f7..d6e7a97c6fe 100644 --- a/kyaml/kio/filters/testdata/dataset1/rails/rails-deployment.resource.yaml +++ b/kyaml/kio/filters/testdata/dataset1/rails/rails-deployment.resource.yaml @@ -30,7 +30,6 @@ spec: name: rails-app-config env: - name: JAVA_OPTS - value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap - -Djava.security.egd=file:/dev/./urandom + value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Djava.security.egd=file:/dev/./urandom imagePullPolicy: Always minReadySeconds: 5 diff --git a/kyaml/kio/filters/testdata2/dataset1-expected/java/java-deployment-1.resource.yaml b/kyaml/kio/filters/testdata2/dataset1-expected/java/java-deployment-1.resource.yaml index ea1d0f540bd..64ff7b24c34 100644 --- a/kyaml/kio/filters/testdata2/dataset1-expected/java/java-deployment-1.resource.yaml +++ b/kyaml/kio/filters/testdata2/dataset1-expected/java/java-deployment-1.resource.yaml @@ -32,7 +32,6 @@ spec: name: app-config env: - name: JAVA_OPTS - value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap - -Djava.security.egd=file:/dev/./urandom + value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Djava.security.egd=file:/dev/./urandom imagePullPolicy: Always minReadySeconds: 15 diff --git a/kyaml/kio/filters/testdata2/dataset1-expected/java/java-deployment-2.resource.yaml b/kyaml/kio/filters/testdata2/dataset1-expected/java/java-deployment-2.resource.yaml index 6b13e787275..04b129bf111 100644 --- a/kyaml/kio/filters/testdata2/dataset1-expected/java/java-deployment-2.resource.yaml +++ b/kyaml/kio/filters/testdata2/dataset1-expected/java/java-deployment-2.resource.yaml @@ -32,7 +32,6 @@ spec: name: app-config env: - name: JAVA_OPTS - value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap - -Djava.security.egd=file:/dev/./urandom + value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Djava.security.egd=file:/dev/./urandom imagePullPolicy: Always minReadySeconds: 25 diff --git a/kyaml/kio/filters/testdata2/dataset1-localupdates/java/java-deployment-1.resource.yaml b/kyaml/kio/filters/testdata2/dataset1-localupdates/java/java-deployment-1.resource.yaml index 658a1ec80cf..629c96377d3 100644 --- a/kyaml/kio/filters/testdata2/dataset1-localupdates/java/java-deployment-1.resource.yaml +++ b/kyaml/kio/filters/testdata2/dataset1-localupdates/java/java-deployment-1.resource.yaml @@ -32,7 +32,6 @@ spec: name: app-config env: - name: JAVA_OPTS - value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap - -Djava.security.egd=file:/dev/./urandom + value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Djava.security.egd=file:/dev/./urandom imagePullPolicy: Always minReadySeconds: 15 diff --git a/kyaml/kio/filters/testdata2/dataset1-localupdates/java/java-deployment-2.resource.yaml b/kyaml/kio/filters/testdata2/dataset1-localupdates/java/java-deployment-2.resource.yaml index 64baafe9453..039399f112b 100644 --- a/kyaml/kio/filters/testdata2/dataset1-localupdates/java/java-deployment-2.resource.yaml +++ b/kyaml/kio/filters/testdata2/dataset1-localupdates/java/java-deployment-2.resource.yaml @@ -32,7 +32,6 @@ spec: name: app-config env: - name: JAVA_OPTS - value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap - -Djava.security.egd=file:/dev/./urandom + value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Djava.security.egd=file:/dev/./urandom imagePullPolicy: Always minReadySeconds: 25 diff --git a/kyaml/kio/filters/testdata2/dataset1-remoteupdates/java/java-deployment-1.resource.yaml b/kyaml/kio/filters/testdata2/dataset1-remoteupdates/java/java-deployment-1.resource.yaml index c8174a0b31b..b539ae6b6b3 100644 --- a/kyaml/kio/filters/testdata2/dataset1-remoteupdates/java/java-deployment-1.resource.yaml +++ b/kyaml/kio/filters/testdata2/dataset1-remoteupdates/java/java-deployment-1.resource.yaml @@ -32,7 +32,6 @@ spec: name: app-config env: - name: JAVA_OPTS - value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap - -Djava.security.egd=file:/dev/./urandom + value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Djava.security.egd=file:/dev/./urandom imagePullPolicy: Always minReadySeconds: 5 diff --git a/kyaml/kio/filters/testdata2/dataset1-remoteupdates/java/java-deployment-2.resource.yaml b/kyaml/kio/filters/testdata2/dataset1-remoteupdates/java/java-deployment-2.resource.yaml index 9caeaaea155..779c1fec281 100644 --- a/kyaml/kio/filters/testdata2/dataset1-remoteupdates/java/java-deployment-2.resource.yaml +++ b/kyaml/kio/filters/testdata2/dataset1-remoteupdates/java/java-deployment-2.resource.yaml @@ -32,7 +32,6 @@ spec: name: app-config env: - name: JAVA_OPTS - value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap - -Djava.security.egd=file:/dev/./urandom + value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Djava.security.egd=file:/dev/./urandom imagePullPolicy: Always minReadySeconds: 10 diff --git a/kyaml/kio/filters/testdata2/dataset1/java/java-deployment-1.resource.yaml b/kyaml/kio/filters/testdata2/dataset1/java/java-deployment-1.resource.yaml index 53ffa5b4f81..cf39a9c709b 100644 --- a/kyaml/kio/filters/testdata2/dataset1/java/java-deployment-1.resource.yaml +++ b/kyaml/kio/filters/testdata2/dataset1/java/java-deployment-1.resource.yaml @@ -32,7 +32,6 @@ spec: name: app-config env: - name: JAVA_OPTS - value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap - -Djava.security.egd=file:/dev/./urandom + value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Djava.security.egd=file:/dev/./urandom imagePullPolicy: Always minReadySeconds: 5 diff --git a/kyaml/kio/filters/testdata2/dataset1/java/java-deployment-2.resource.yaml b/kyaml/kio/filters/testdata2/dataset1/java/java-deployment-2.resource.yaml index 9c5cdc3aa8e..73a652ec60c 100644 --- a/kyaml/kio/filters/testdata2/dataset1/java/java-deployment-2.resource.yaml +++ b/kyaml/kio/filters/testdata2/dataset1/java/java-deployment-2.resource.yaml @@ -32,7 +32,6 @@ spec: name: app-config env: - name: JAVA_OPTS - value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap - -Djava.security.egd=file:/dev/./urandom + value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Djava.security.egd=file:/dev/./urandom imagePullPolicy: Always minReadySeconds: 10 diff --git a/kyaml/kio/filters/testyaml/testyaml.go b/kyaml/kio/filters/testyaml/testyaml.go index 01644b3112a..f6462f983bc 100644 --- a/kyaml/kio/filters/testyaml/testyaml.go +++ b/kyaml/kio/filters/testyaml/testyaml.go @@ -98,8 +98,7 @@ status2: `) var FormattedFlowYAML1 = []byte( - `{"apiVersion": "example.com/v1beta1", "kind": "MyType", "spec": "a", "status": {"conditions": [ - 3, 1, 2]}} + `{"apiVersion": "example.com/v1beta1", "kind": "MyType", "spec": "a", "status": {"conditions": [3, 1, 2]}} `) var FormattedYaml3 = []byte(`apiVersion: v1 diff --git a/kyaml/kio/pkgio_reader_test.go b/kyaml/kio/pkgio_reader_test.go index 039c53f2bc0..4e8f845d399 100644 --- a/kyaml/kio/pkgio_reader_test.go +++ b/kyaml/kio/pkgio_reader_test.go @@ -227,8 +227,7 @@ func TestLocalPackageReader_Read_JSON(t *testing.T) { expected := []string{ `{"a": "b", metadata: {annotations: {config.kubernetes.io/index: '0', config.kubernetes.io/path: 'a_test.json'}}} `, - `{"e": "f", "g": {"h": ["i", "j"]}, metadata: {annotations: {config.kubernetes.io/index: '0', - config.kubernetes.io/path: 'b_test.json'}}} + `{"e": "f", "g": {"h": ["i", "j"]}, metadata: {annotations: {config.kubernetes.io/index: '0', config.kubernetes.io/path: 'b_test.json'}}} `, } for i := range nodes { diff --git a/kyaml/yaml/match_test.go b/kyaml/yaml/match_test.go index 70852398b3f..8a112292f95 100644 --- a/kyaml/yaml/match_test.go +++ b/kyaml/yaml/match_test.go @@ -61,7 +61,7 @@ spec: "- nginx:1.7.9\n"}, {[]string{ "spec", "template", "spec", "containers", "[name=.*]", "ports"}, - "- - containerPort: 80\n- - containerPort: 8081\n - containerPort: 9090\n"}, + "-\n- containerPort: 80\n-\n- containerPort: 8081\n- containerPort: 9090\n"}, {[]string{ "spec", "template", "spec", "containers", "[name=.*]", "ports", "[containerPort=8.*]"}, "- containerPort: 80\n- containerPort: 8081\n"},