Skip to content

Commit

Permalink
fix affected kyaml tests
Browse files Browse the repository at this point in the history
  • Loading branch information
natasha41575 committed Jun 25, 2021
1 parent ca661d1 commit 066587d
Show file tree
Hide file tree
Showing 18 changed files with 19 additions and 33 deletions.
3 changes: 3 additions & 0 deletions kyaml/filesys/filesystem_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright 2021 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0

package filesys

import (
Expand Down
1 change: 0 additions & 1 deletion kyaml/kio/byteio_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ var _ Writer = ByteWriter{}
func (w ByteWriter) Write(inputNodes []*yaml.RNode) error {
// Copy the nodes to prevent writer from mutating the original nodes.
nodes := copyRNodes(inputNodes)
yaml.DoSerializationHacksOnNodes(nodes)
if w.Sort {
if err := kioutil.SortNodes(nodes); err != nil {
return errors.Wrap(err)
Expand Down
2 changes: 1 addition & 1 deletion kyaml/kio/filters/fmtr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions kyaml/kio/filters/testyaml/testyaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions kyaml/kio/pkgio_reader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,10 @@ func TestLocalPackageReader_Read_JSON(t *testing.T) {
if !assert.Len(t, nodes, 2) {
t.FailNow()
}
// TODO: Fix https://github.com/go-yaml/yaml/issues/44 so these are printed correctly
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 {
Expand Down

0 comments on commit 066587d

Please sign in to comment.