Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Enable Openshift for connect injector #972

Merged
merged 1 commit into from
May 25, 2021
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
IMPROVEMENTS:
* Connect: Allow overwriting Kubernetes HTTP probes when running with transparent proxy enabled.
[[GH-953](https://github.com/hashicorp/consul-helm/pull/953)]
* Connect: Enable OpenShift for the connect-injector so that we can support running with transparent
proxy enabled. [[GH-972](https://github.com/hashicorp/consul-helm/pull/972)]

BUG FIXES:
* OpenShift: support `server.exposeGossipAndRPCPorts`. [[GH-932](https://github.com/hashicorp/consul-helm/issues/932)]
Expand Down
3 changes: 3 additions & 0 deletions templates/connect-inject-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ spec:
{{- else }}
-default-enable-transparent-proxy=false \
{{- end }}
{{- if .Values.global.openshift.enabled }}
-enable-openshift \
{{- end }}
{{- if .Values.connectInject.transparentProxy.defaultOverwriteProbes }}
-transparent-proxy-default-overwrite-probes=true \
{{- else }}
Expand Down
26 changes: 26 additions & 0 deletions test/unit/connect-inject-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1419,5 +1419,31 @@ EOF
. | tee /dev/stderr |
yq '.spec.template.spec.containers[0].command | any(contains("-transparent-proxy-default-overwrite-probes=false"))' | tee /dev/stderr)

[ "${actual}" = "true" ]
}

#--------------------------------------------------------------------
# openshift

@test "connectInject/Deployment: openshift is is not set by default" {
cd `chart_dir`
local actual=$(helm template \
-s templates/connect-inject-deployment.yaml \
--set 'connectInject.enabled=true' \
. | tee /dev/stderr |
yq '.spec.template.spec.containers[0].command | any(contains("-enable-openshift"))' | tee /dev/stderr)

[ "${actual}" = "false" ]
}

@test "connectInject/Deployment: -enable-openshift is set when global.openshift.enabled is true" {
cd `chart_dir`
local actual=$(helm template \
-s templates/connect-inject-deployment.yaml \
--set 'connectInject.enabled=true' \
--set 'global.openshift.enabled=true' \
. | tee /dev/stderr |
yq '.spec.template.spec.containers[0].command | any(contains("-enable-openshift"))' | tee /dev/stderr)

[ "${actual}" = "true" ]
}