Skip to content

Commit

Permalink
update proxy injector code to add volumes by default
Browse files Browse the repository at this point in the history
update test files

Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
  • Loading branch information
Pothulapati committed Mar 25, 2020
1 parent e310587 commit 4a2691a
Show file tree
Hide file tree
Showing 30 changed files with 118 additions and 121 deletions.
14 changes: 6 additions & 8 deletions charts/patch/templates/patch.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,17 @@
},
{{- end }}
{{- if .Values.global.proxy }}
{{- if .Values.addRootVolumes }}
{
"op": "add",
"path": "{{$prefix}}/spec/volumes",
"value": []
},
{{- end }}
{
"op": "add",
"path": "{{$prefix}}/spec/volumes/-",
"value":
{{- include "partials.proxy.volumes.labels" . | fromYaml | toPrettyJson | nindent 6 }}
},
{{- if not .Values.global.proxy.disableIdentity -}}
{
"op": "add",
Expand All @@ -78,12 +82,6 @@
}
},
{{- end }}
{
"op": "add",
"path": "{{$prefix}}/spec/volumes/-",
"value":
{{- include "partials.proxy.volumes.labels" . | fromYaml | toPrettyJson | nindent 6 }}
},
{
"op": "add",
"path": "{{$prefix}}/spec/containers/-",
Expand Down
6 changes: 3 additions & 3 deletions cli/cmd/testdata/inject-filepath/expected/injected_nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -300,13 +300,13 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
6 changes: 3 additions & 3 deletions cli/cmd/testdata/inject-filepath/expected/injected_redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
6 changes: 3 additions & 3 deletions cli/cmd/testdata/inject_contour.golden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,13 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
24 changes: 12 additions & 12 deletions cli/cmd/testdata/inject_emojivoto_already_injected.golden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -322,15 +322,15 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -489,15 +489,15 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -656,13 +656,13 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
6 changes: 3 additions & 3 deletions cli/cmd/testdata/inject_emojivoto_deployment.golden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -322,13 +322,13 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
6 changes: 3 additions & 3 deletions cli/cmd/testdata/inject_emojivoto_deployment_debug.golden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,15 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---

---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ spec:
runAsUser: 0
terminationMessagePolicy: FallbackToLogsOnError
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ spec:
- mountPath: /var/run/linkerd/identity/end-entity
name: linkerd-identity-end-entity
volumes:
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
- downwardAPI:
items:
- fieldRef:
fieldPath: metadata.labels
path: labels
name: podinfo
- emptyDir:
medium: Memory
name: linkerd-identity-end-entity
---
Loading

0 comments on commit 4a2691a

Please sign in to comment.