-
Notifications
You must be signed in to change notification settings - Fork 871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update chart and tests to Helm 3 #146
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# PodDisruptionBudget to prevent degrading the server cluster through | ||
# voluntary cluster changes. | ||
{{ template "vault.mode" . }} | ||
{{- if and (and (eq (.Values.global.enabled | toString) "true") (eq .mode "ha")) (eq (.Values.server.ha.disruptionBudget.enabled | toString) "true") -}} | ||
# PodDisruptionBudget to prevent degrading the server cluster through | ||
# voluntary cluster changes. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for cleaning up the generated yaml templates! |
||
apiVersion: policy/v1beta1 | ||
kind: PodDisruptionBudget | ||
metadata: | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -37,7 +37,7 @@ RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s | |||||
mv ./kubectl /usr/local/bin/kubectl | ||||||
|
||||||
# helm | ||||||
RUN curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash | ||||||
RUN curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get-helm-3 | bash | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this lives under the helm org now, per https://helm.sh/docs/intro/install/#from-script:
Suggested change
|
||||||
|
||||||
# bats | ||||||
RUN curl -sSL https://github.com/bats-core/bats-core/archive/v${BATS_VERSION}.tar.gz -o /tmp/bats.tgz \ | ||||||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,56 +4,52 @@ load _helpers | |
|
||
@test "server/ClusterRoleBinding: disabled by default" { | ||
cd `chart_dir` | ||
local actual=$(helm template \ | ||
-x templates/server-clusterrolebinding.yaml \ | ||
run helm template \ | ||
--show-only templates/server-clusterrolebinding.yaml \ | ||
--set 'server.dev.enabled=true' \ | ||
. | tee /dev/stderr | | ||
yq 'length > 0' | tee /dev/stderr) | ||
[ "${actual}" = "false" ] | ||
. | ||
[ "$status" -eq 1 ] | ||
|
||
local actual=$(helm template \ | ||
-x templates/server-clusterrolebinding.yaml \ | ||
run helm template \ | ||
--show-only templates/server-clusterrolebinding.yaml \ | ||
--set 'server.ha.enabled=true' \ | ||
. | tee /dev/stderr | | ||
yq 'length > 0' | tee /dev/stderr) | ||
[ "${actual}" = "false" ] | ||
. | ||
[ "$status" -eq 1 ] | ||
|
||
local actual=$(helm template \ | ||
-x templates/server-clusterrolebinding.yaml \ | ||
. | tee /dev/stderr | | ||
yq 'length > 0' | tee /dev/stderr) | ||
[ "${actual}" = "false" ] | ||
run helm template \ | ||
--show-only templates/server-clusterrolebinding.yaml \ | ||
. | ||
[ "$status" -eq 1 ] | ||
} | ||
|
||
@test "server/ClusterRoleBinding: disable with global.enabled" { | ||
cd `chart_dir` | ||
local actual=$(helm template \ | ||
-x templates/server-clusterrolebinding.yaml \ | ||
run helm template \ | ||
--show-only templates/server-clusterrolebinding.yaml \ | ||
--set 'global.enabled=false' \ | ||
. | tee /dev/stderr | | ||
yq 'length > 0' | tee /dev/stderr) | ||
[ "${actual}" = "false" ] | ||
. | ||
[ "$status" -eq 1 ] | ||
Comment on lines
+27
to
+31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an interesting idea, since the clusterrolebinding template will be empty, though I would suggest keeping the existing style for consistency between tests. Something like this? local actual=$( (helm template \
--show-only templates/server-clusterrolebinding.yaml \
--set 'global.enabled=false' \
. || echo "---") | tee /dev/stderr |
yq 'length > 0' | tee /dev/stderr)
[ "${actual}" = "false" ] |
||
} | ||
|
||
@test "server/ClusterRoleBinding: can enable with server.authDelegator" { | ||
cd `chart_dir` | ||
local actual=$(helm template \ | ||
-x templates/server-clusterrolebinding.yaml \ | ||
--show-only templates/server-clusterrolebinding.yaml \ | ||
--set 'server.authDelegator.enabled=true' \ | ||
. | tee /dev/stderr | | ||
yq 'length > 0' | tee /dev/stderr) | ||
[ "${actual}" = "true" ] | ||
|
||
local actual=$(helm template \ | ||
-x templates/server-clusterrolebinding.yaml \ | ||
--show-only templates/server-clusterrolebinding.yaml \ | ||
--set 'server.authDelegator.enabled=true' \ | ||
--set 'server.ha.enabled=true' \ | ||
. | tee /dev/stderr | | ||
yq 'length > 0' | tee /dev/stderr) | ||
[ "${actual}" = "true" ] | ||
|
||
local actual=$(helm template \ | ||
-x templates/server-clusterrolebinding.yaml \ | ||
--show-only templates/server-clusterrolebinding.yaml \ | ||
--set 'server.authDelegator.enabled=true' \ | ||
--set 'server.dev.enabled=true' \ | ||
. | tee /dev/stderr | | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please leave this as v1 for now.