Skip to content

Commit 8ed1dfb

Browse files
Simon Emmsroboquat
Simon Emms
authored andcommitted
[kots]: reduce helm timeout if TLS cert secret exists
1 parent 64fe0d5 commit 8ed1dfb

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

install/kots/manifests/gitpod-installer-job.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,16 +251,23 @@ spec:
251251
echo "Gitpod: Escape any Golang template values"
252252
sed -i -r 's/(.*\{\{.*)/{{`\1`}}/' "${GITPOD_OBJECTS}/templates/gitpod.yaml"
253253
254+
# If certificate secret already exists, set the timeout to 5m
255+
CERT_SECRET=$(kubectl get secrets -n {{repl Namespace }} https-certificates -o jsonpath='{.metadata.name}' || echo '')
256+
HELM_TIMEOUT="5m"
257+
if [ "${CERT_SECRET}" = "" ]; then
258+
HELM_TIMEOUT="1h"
259+
fi
260+
254261
# The long timeout is to ensure the TLS cert is created (if required)
255-
echo "Gitpod: Apply the Kubernetes objects"
262+
echo "Gitpod: Apply the Kubernetes objects with timeout of ${HELM_TIMEOUT}"
256263
helm upgrade \
257264
--atomic \
258265
--cleanup-on-fail \
259266
--create-namespace \
260267
--install \
261268
--namespace="{{repl Namespace }}" \
262269
--reset-values \
263-
--timeout 1h \
270+
--timeout "${HELM_TIMEOUT}" \
264271
--wait \
265272
gitpod \
266273
"${GITPOD_OBJECTS}"

0 commit comments

Comments
 (0)