Skip to content

Commit

Permalink
Making all nameshavea-ingress-gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
jmurret committed Mar 22, 2022
1 parent d39093a commit 92c3ae1
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
8 changes: 4 additions & 4 deletions charts/consul/templates/terminating-gateways-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "consul.fullname" $root }}-{{ .name }}
name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
namespace: {{ $root.Release.Namespace }}
labels:
app: {{ template "consul.name" $root }}
chart: {{ template "consul.chart" $root }}
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
spec:
replicas: {{ default $defaults.replicas .replicas }}
selector:
Expand All @@ -42,7 +42,7 @@ spec:
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
template:
metadata:
labels:
Expand All @@ -51,7 +51,7 @@ spec:
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
annotations:
{{- if (and $root.Values.global.secretsBackend.vault.enabled $root.Values.global.tls.enabled) }}
"vault.hashicorp.com/agent-init-first": "true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ template "consul.fullname" $root }}-{{ .name }}
name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
namespace: {{ $root.Release.Namespace }}
labels:
app: {{ template "consul.name" $root }}
chart: {{ template "consul.chart" $root }}
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
spec:
privileged: false
# Required to prevent escalations to root.
Expand Down
6 changes: 3 additions & 3 deletions charts/consul/templates/terminating-gateways-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ template "consul.fullname" $root }}-{{ .name }}
name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
namespace: {{ $root.Release.Namespace }}
labels:
app: {{ template "consul.name" $root }}
chart: {{ template "consul.chart" $root }}
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
{{- if (or $root.Values.global.acls.manageSystemACLs $root.Values.global.enablePodSecurityPolicies) }}
rules:
{{- if $root.Values.global.enablePodSecurityPolicies }}
- apiGroups: ["policy"]
resources: ["podsecuritypolicies"]
resourceNames:
- {{ template "consul.fullname" $root }}-{{ .name }}
- {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
verbs:
- use
{{- end }}
Expand Down
8 changes: 4 additions & 4 deletions charts/consul/templates/terminating-gateways-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "consul.fullname" $root }}-{{ .name }}
name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
namespace: {{ $root.Release.Namespace }}
labels:
app: {{ template "consul.name" $root }}
chart: {{ template "consul.chart" $root }}
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ template "consul.fullname" $root }}-{{ .name }}
name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
subjects:
- kind: ServiceAccount
name: {{ template "consul.fullname" $root }}-{{ .name }}
name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
namespace: {{ $root.Release.Namespace }}
---
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metadata:
heritage: {{ $root.Release.Service }}
release: {{ $root.Release.Name }}
component: terminating-gateway
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}
terminating-gateway-name: {{ template "consul.fullname" $root }}-{{ .name }}-terminating-gateway
{{- if (or $defaults.serviceAccount.annotations $serviceAccount.annotations) }}
annotations:
{{- if $defaults.serviceAccount.annotations }}
Expand Down
6 changes: 3 additions & 3 deletions charts/consul/test/unit/terminating-gateways-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ load _helpers
[ "${actual}" = "true" ]

local actual=$(echo $object | yq -r '.metadata.name' | tee /dev/stderr)
[ "${actual}" = "RELEASE-NAME-consul-terminating-gateway" ]
[ "${actual}" = "RELEASE-NAME-consul-terminating-gateway-terminating-gateway" ]
}

@test "terminatingGateways/Deployment: Adds consul service volumeMount to gateway container" {
Expand Down Expand Up @@ -1406,10 +1406,10 @@ EOF
yq -s -r '.' | tee /dev/stderr)

local actual=$(echo $object | yq -r '.[0].metadata.name' | tee /dev/stderr)
[ "${actual}" = "RELEASE-NAME-consul-gateway1" ]
[ "${actual}" = "RELEASE-NAME-consul-gateway1-terminating-gateway" ]

local actual=$(echo $object | yq -r '.[1].metadata.name' | tee /dev/stderr)
[ "${actual}" = "RELEASE-NAME-consul-gateway2" ]
[ "${actual}" = "RELEASE-NAME-consul-gateway2-terminating-gateway" ]

local actual=$(echo $object | yq '.[0] | length > 0' | tee /dev/stderr)
[ "${actual}" = "true" ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ load _helpers
[ "${actual}" = "false" ]

local actual=$(echo $object | yq -r '.[0].metadata.name' | tee /dev/stderr)
[ "${actual}" = "RELEASE-NAME-consul-gateway1" ]
[ "${actual}" = "RELEASE-NAME-consul-gateway1-terminating-gateway" ]

local actual=$(echo $object | yq -r '.[1].metadata.name' | tee /dev/stderr)
[ "${actual}" = "RELEASE-NAME-consul-gateway2" ]
[ "${actual}" = "RELEASE-NAME-consul-gateway2-terminating-gateway" ]
}
4 changes: 2 additions & 2 deletions charts/consul/test/unit/terminating-gateways-role.bats
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ load _helpers
yq -s -r '.' | tee /dev/stderr)

local actual=$(echo $object | yq -r '.[0].metadata.name' | tee /dev/stderr)
[ "${actual}" = "RELEASE-NAME-consul-gateway1" ]
[ "${actual}" = "RELEASE-NAME-consul-gateway1-terminating-gateway" ]

local actual=$(echo $object | yq -r '.[1].metadata.name' | tee /dev/stderr)
[ "${actual}" = "RELEASE-NAME-consul-gateway2" ]
[ "${actual}" = "RELEASE-NAME-consul-gateway2-terminating-gateway" ]

local actual=$(echo $object | yq '.[0].rules | length' | tee /dev/stderr)
[ "${actual}" = "2" ]
Expand Down
4 changes: 2 additions & 2 deletions charts/consul/test/unit/terminating-gateways-rolebinding.bats
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ load _helpers
yq -s -r '.' | tee /dev/stderr)

local actual=$(echo $object | yq -r '.[0].metadata.name' | tee /dev/stderr)
[ "${actual}" = "RELEASE-NAME-consul-gateway1" ]
[ "${actual}" = "RELEASE-NAME-consul-gateway1-terminating-gateway" ]

local actual=$(echo $object | yq -r '.[1].metadata.name' | tee /dev/stderr)
[ "${actual}" = "RELEASE-NAME-consul-gateway2" ]
[ "${actual}" = "RELEASE-NAME-consul-gateway2-terminating-gateway" ]

local actual=$(echo $object | yq '.[2] | length > 0' | tee /dev/stderr)
[ "${actual}" = "false" ]
Expand Down

0 comments on commit 92c3ae1

Please sign in to comment.