Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Use kubeyaml for YAML updates #976

Merged
merged 7 commits into from
May 30, 2018
Merged
Changes from 1 commit
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
96 changes: 47 additions & 49 deletions cluster/kubernetes/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,27 @@ spec:
imagePullSecrets:
- name: quay-secret
containers:
- name: pr-assigner
image: quay.io/weaveworks/pr-assigner:master-6f5e816
imagePullPolicy: IfNotPresent
args:
- --conf_path=/config/pr-assigner.json
env:
- name: GITHUB_TOKEN
valueFrom:
secretKeyRef:
name: pr-assigner
key: githubtoken
volumeMounts:
- name: config-volume
mountPath: /config
volumes:
- name: pr-assigner
image: quay.io/weaveworks/pr-assigner:master-6f5e816
imagePullPolicy: IfNotPresent
args:
- --conf_path=/config/pr-assigner.json
env:
- name: GITHUB_TOKEN
valueFrom:
secretKeyRef:
name: pr-assigner
key: githubtoken
volumeMounts:
- name: config-volume
configMap:
name: pr-assigner
items:
- key: conffile
path: pr-assigner.json
mountPath: /config
volumes:
- name: config-volume
configMap:
name: pr-assigner
items:
- key: conffile
path: pr-assigner.json
`

const case1resource = "extra:deployment/pr-assigner"
Expand All @@ -114,27 +114,27 @@ spec:
imagePullSecrets:
- name: quay-secret
containers:
- name: pr-assigner
image: quay.io/weaveworks/pr-assigner:master-1234567
imagePullPolicy: IfNotPresent
args:
- --conf_path=/config/pr-assigner.json
env:
- name: GITHUB_TOKEN
valueFrom:
secretKeyRef:
name: pr-assigner
key: githubtoken
volumeMounts:
- name: config-volume
mountPath: /config
volumes:
- name: pr-assigner
image: quay.io/weaveworks/pr-assigner:master-1234567
imagePullPolicy: IfNotPresent
args:
- --conf_path=/config/pr-assigner.json
env:
- name: GITHUB_TOKEN
valueFrom:
secretKeyRef:
name: pr-assigner
key: githubtoken
volumeMounts:
- name: config-volume
configMap:
name: pr-assigner
items:
- key: conffile
path: pr-assigner.json
mountPath: /config
volumes:
- name: config-volume
configMap:
name: pr-assigner
items:
- key: conffile
path: pr-assigner.json
`

// Version looks like a number
Expand All @@ -149,7 +149,6 @@ spec:
metadata:
labels:
name: fluxy
version: master-a000001

This comment was marked as abuse.

This comment was marked as abuse.

spec:
volumes:
- name: key
Expand Down Expand Up @@ -194,7 +193,6 @@ spec:
metadata:
labels:
name: fluxy
version: "1234567"

This comment was marked as abuse.

spec:
volumes:
- name: key
Expand Down Expand Up @@ -230,7 +228,7 @@ apiVersion: extensions/v1beta1
kind: Deployment
metadata:
namespace: monitoring
name: grafana # comment, and only one space
name: grafana # comment, and only one space indent
spec:
replicas: 1
template:
Expand Down Expand Up @@ -262,8 +260,8 @@ const case3out = `---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
namespace: monitoring
name: grafana # comment, and only one space
namespace: monitoring
name: grafana # comment, and only one space indent
spec:
replicas: 1
template:
Expand Down Expand Up @@ -313,7 +311,7 @@ spec:
runAsUser: 10001
capabilities:
drop:
- all
- all
readOnlyRootFilesystem: true
`

Expand Down Expand Up @@ -349,7 +347,7 @@ spec:
runAsUser: 10001
capabilities:
drop:
- all
- all
readOnlyRootFilesystem: true
`

Expand Down Expand Up @@ -439,7 +437,7 @@ spec:
- containerPort: 80
image: nginx:1.10-alpine
name: nginx
- image: nginx:1.10-alpine # testing comments, and this image is on the first line.
- image: nginx:1.10-alpine # testing comments, and this image is on the first line.
name: nginx2
`

Expand Down Expand Up @@ -515,7 +513,7 @@ spec:
labels:
name: authfe
annotations:
prometheus.io.port: "8080"
prometheus.io.port: '8080'
spec:
# blank comment spacers in the following
containers:
Expand Down