Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT MERGE: demonstrate required changes for yaml update #4004

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/config/internal/commands/cmdwrap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ items:
name: test
app: nginx
ports:
# This i the port.
- name: http
# This i the port.
natasha41575 marked this conversation as resolved.
Show resolved Hide resolved
port: 8080
targetPort: 8080
`
Expand Down Expand Up @@ -169,8 +169,8 @@ items:
name: test
app: nginx
ports:
# This i the port.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments are reordered here. Why?

Copy link
Contributor

@KnVerey KnVerey Jun 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a bug fix. If you look at the input fixture above, the comments are in the new position, not the old:

- apiVersion: v1
  kind: Service
  metadata:
    name: test
    labels:
      app: nginx
      name: test
  spec:
    ports:
    # This i the port.
    - port: 8080
      targetPort: 8080
      name: http
    selector:
      app: nginx
      name: test

- name: http
# This i the port.
port: 8080
targetPort: 8080
`
Expand Down Expand Up @@ -269,8 +269,8 @@ items:
name: test
app: nginx
ports:
# This i the port.
- name: http
# This i the port.
port: 8080
targetPort: 8080
`
Expand Down
12 changes: 4 additions & 8 deletions cmd/config/internal/commands/merge3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ spec:
name: app-config
env:
- name: JAVA_OPTS
value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap
-Djava.security.egd=file:/dev/./urandom
natasha41575 marked this conversation as resolved.
Show resolved Hide resolved
value: -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Djava.security.egd=file:/dev/./urandom
imagePullPolicy: Always
minReadySeconds: 5
`), 0600)
Expand Down Expand Up @@ -104,8 +103,7 @@ 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
`), 0600)
Expand Down Expand Up @@ -152,8 +150,7 @@ 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
`), 0600)
Expand Down Expand Up @@ -201,8 +198,7 @@ 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
`), 0600)
Expand Down
13 changes: 3 additions & 10 deletions cmd/config/internal/commands/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,8 @@ func TestSourceCommandJSON(t *testing.T) {
if !assert.Equal(t, `apiVersion: config.kubernetes.io/v1alpha1
kind: ResourceList
items:
- {"kind": "Deployment", "metadata": {"labels": {"app": "nginx2"}, "name": "foo",
"annotations": {"app": "nginx2", config.kubernetes.io/index: '0', config.kubernetes.io/path: 'f1.json'}},
"spec": {"replicas": 1}}
- {"apiVersion": "v1", "kind": "Abstraction", "metadata": {"name": "foo", "annotations": {
"config.kubernetes.io/function": "container:\n image: gcr.io/example/reconciler:v1\n",
"config.kubernetes.io/local-config": "true", config.kubernetes.io/index: '0',
config.kubernetes.io/path: 'f2.json'}}, "spec": {"replicas": 3}}
- {"kind": "Deployment", "metadata": {"labels": {"app": "nginx2"}, "name": "foo", "annotations": {"app": "nginx2", config.kubernetes.io/index: '0', config.kubernetes.io/path: 'f1.json'}}, "spec": {"replicas": 1}}
natasha41575 marked this conversation as resolved.
Show resolved Hide resolved
- {"apiVersion": "v1", "kind": "Abstraction", "metadata": {"name": "foo", "annotations": {"config.kubernetes.io/function": "container:\n image: gcr.io/example/reconciler:v1\n", "config.kubernetes.io/local-config": "true", config.kubernetes.io/index: '0', config.kubernetes.io/path: 'f2.json'}}, "spec": {"replicas": 3}}
`, b.String()) {
return
}
Expand Down Expand Up @@ -307,9 +302,7 @@ func TestSourceCommandJSON_Stdin(t *testing.T) {
if !assert.Equal(t, `apiVersion: config.kubernetes.io/v1alpha1
kind: ResourceList
items:
- {"kind": "Deployment", "metadata": {"labels": {"app": "nginx2"}, "name": "foo",
"annotations": {"app": "nginx2", config.kubernetes.io/index: '0'}}, "spec": {
"replicas": 1}}
- {"kind": "Deployment", "metadata": {"labels": {"app": "nginx2"}, "name": "foo", "annotations": {"app": "nginx2", config.kubernetes.io/index: '0'}}, "spec": {"replicas": 1}}
`, out.String()) {
return
}
Expand Down
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
natasha41575 marked this conversation as resolved.
Show resolved Hide resolved
- 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
natasha41575 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading