Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashwin Venkatesh committed Dec 15, 2021
1 parent e6e585a commit d64fb41
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 29 deletions.
4 changes: 0 additions & 4 deletions charts/consul/templates/server-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,8 @@ spec:
{{ tpl .Values.server.tolerations . | nindent 8 | trim }}
{{- end }}
{{- if .Values.server.topologySpreadConstraints }}
{{- if and (ge .Capabilities.KubeVersion.Major "1") (ge .Capabilities.KubeVersion.Minor "18") }}
topologySpreadConstraints:
{{ tpl .Values.server.topologySpreadConstraints . | nindent 8 | trim }}
{{- else }}
{{- fail "`topologySpreadConstraints` requires Kubernetes 1.18 and above." }}
{{- end }}
{{- end }}
terminationGracePeriodSeconds: 30
serviceAccountName: {{ template "consul.fullname" . }}-server
Expand Down
9 changes: 0 additions & 9 deletions charts/consul/test/unit/server-statefulset.bats
Original file line number Diff line number Diff line change
Expand Up @@ -788,15 +788,6 @@ load _helpers
. | tee /dev/stderr |
yq '.spec.template.spec.topologySpreadConstraints == "foobar"' | tee /dev/stderr)
[ "${actual}" = "true" ]

# todo: test for Kube versions < 1.18 when helm supports --kube-version flag (https://github.com/helm/helm/pull/9040)
# not supported before 1.18
# run helm template \
# -s templates/server-statefulset.yaml \
# --kube-version "1.17" \
# .
# [ "$status" -eq 1 ]
# [[ "$output" =~ "`topologySpreadConstraints` requires Kubernetes 1.18 and above." ]]
}

#--------------------------------------------------------------------
Expand Down
16 changes: 0 additions & 16 deletions charts/consul/test/unit/ui-ingress.bats
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ load _helpers
--set 'ui.ingress.enabled=true' \
--set 'global.tls.enabled=false' \
--set 'ui.ingress.hosts[0].host=foo.com' \
--kube-version "1.18" \
. | tee /dev/stderr |
yq -r '.spec.rules[0].http.paths[0].backend.servicePort' | tee /dev/stderr)
[ "${actual}" = "80" ]
Expand All @@ -92,7 +91,6 @@ load _helpers
--set 'ui.ingress.enabled=true' \
--set 'global.tls.enabled=true' \
--set 'ui.ingress.hosts[0].host=foo.com' \
--kube-version "1.18" \
. | tee /dev/stderr |
yq -r '.spec.rules[0].http.paths[0].backend.servicePort' | tee /dev/stderr)
[ "${actual}" = "443" ]
Expand All @@ -119,7 +117,6 @@ load _helpers
--set 'global.tls.enabled=true' \
--set 'global.tls.httpsOnly=false' \
--set 'ui.ingress.hosts[0].host=foo.com' \
--kube-version "1.18" \
. | tee /dev/stderr |
yq -r '.spec.rules[0].http.paths[0].backend.servicePort' | tee /dev/stderr)
[ "${actual}" = "80" ]
Expand Down Expand Up @@ -147,7 +144,6 @@ load _helpers
--set 'global.tls.enabled=true' \
--set 'global.tls.httpsOnly=false' \
--set 'ui.ingress.hosts[0].host=foo.com' \
--kube-version "1.18" \
. | tee /dev/stderr |
yq -r '.spec.rules[0].http.paths[1].backend.servicePort' | tee /dev/stderr)
[ "${actual}" = "443" ]
Expand Down Expand Up @@ -279,15 +275,3 @@ load _helpers
[ "${actual}" = "nginx" ]
}

@test "ui/Ingress: cannot set ingressClassName for Kube version < 1.18" {
cd `chart_dir`
local actual=$(helm template \
-s templates/ui-ingress.yaml \
--set 'ui.ingress.enabled=true' \
--set 'ui.ingress.ingressClassName=nginx' \
--kube-version "1.17" \
. | tee /dev/stderr |
yq -r '.spec.ingressClassName' | tee /dev/stderr)
[ "${actual}" = "null" ]
}

0 comments on commit d64fb41

Please sign in to comment.