Skip to content

Commit dfc512f

Browse files
authored
Merge pull request #5278 from audrastump/certmanagerInstallationCheck
cert manager is only installed if version mismatch or not yet installed
2 parents d2dac62 + 90d711d commit dfc512f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tilt_modules/cert_manager/Tiltfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,13 @@ def deploy_cert_manager(registry="quay.io/jetstack", version="v1.3.1", load_to_k
4747
# NOTE!
4848
# Applying the same manifest twice to same cluster kubectl get stuck with older versions of kubernetes/cert-manager.
4949
# https://github.com/jetstack/cert-manager/issues/3121
50-
print("Installing cert-manager")
51-
local("kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/{}/cert-manager.yaml".format(version), quiet=silent, echo_off=silent)
50+
51+
#verify that the installed version is the same as the version parameter and cert-manager is installed
52+
#install the cert-manager if one of these is false
53+
installed_version = local("kubectl get deployment -n cert-manager cert-manager -o=jsonpath='{.spec.template.spec.containers[0].image}' | awk -F':' '{print $2}'")
54+
if str(installed_version).strip()!= version:
55+
print("Cert-manager either not installed or version mismatch, installing...")
56+
local("kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/{}/cert-manager.yaml".format(version))
5257

5358
# verifies cert-manager is properly working (https://cert-manager.io/docs/installation/kubernetes/#verifying-the-installation)
5459
# 1. wait for the cert-manager to be running

0 commit comments

Comments
 (0)