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

Commit

Permalink
Enable Openshift for connect injector
Browse files Browse the repository at this point in the history
  • Loading branch information
ishustava committed May 25, 2021
1 parent aba0aa1 commit 2f6aefe
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
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
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
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" ]
}

0 comments on commit 2f6aefe

Please sign in to comment.