Skip to content

Commit 60b7ea4

Browse files
committed
Update cert_manager tilt extension to fix startup bug
1 parent 0ec3c31 commit 60b7ea4

File tree

7 files changed

+28
-17
lines changed

7 files changed

+28
-17
lines changed

hack/boilerplate/boilerplate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def file_extension(filename):
152152
return os.path.splitext(filename)[1].split(".")[-1].lower()
153153

154154
skipped_dirs = ['Godeps', 'third_party', '_gopath', '_output', '.git', 'cluster/env.sh',
155-
"vendor", "hack/boilerplate/test"]
155+
"vendor", "hack/boilerplate/test", "tilt_modules"]
156156

157157
# list all the files contain 'DO NOT EDIT', but are not generated
158158
skipped_ungenerated_files = ['hack/lib/swagger.sh', 'hack/boilerplate/boilerplate.py']

hack/verify-shellcheck.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ fi
6464

6565
echo "Running shellcheck..."
6666
cd "${ROOT_PATH}" || exit
67-
IGNORE_FILES=$(find . -name "*.sh" | grep third_party)
67+
IGNORE_FILES=$(find . -name "*.sh" | grep "third_party\|tilt_modules")
6868
echo "Ignoring shellcheck on ${IGNORE_FILES}"
69-
FILES=$(find . -name "*.sh" | grep -v third_party)
69+
FILES=$(find . -name "*.sh" -not -path "./tilt_modules/*" -not -path "*third_party*")
7070
while read -r file; do
7171
"$SHELLCHECK" -x "$file" >> "${OUT}" 2>&1
7272
done <<< "$FILES"

tilt_modules/cert_manager/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ load('ext://cert_manager', 'deploy_cert_manager')
1212
deploy_cert_manager()
1313
```
1414

15-
This will deploy cert-manager to you cluster and checks it actually works.
15+
This will deploy cert-manager to your cluster and check that it actually works.
1616

17-
If working with Kind, its is possible to pass `load_to_kind=True` to `deploy_cert_manager` so
18-
all the cert-manager images will be pre-pulled to your local environment and then loaded into Kind before installing.
17+
If working with Kind, it's possible to pass `load_to_kind=True` to `deploy_cert_manager` so
18+
all the cert-manager images will be pre-pulled to your local environment and then loaded into Kind before installing.
1919
This speeds up your workflow if you're repeatedly destroying and recreating your kind cluster, as it doesn't
2020
have to pull the images over the network each time.
2121

2222
The full list of parameters accepted by `deploy_cert_manager` includes:
2323
- `registry` from which images should be pulled, defaults to `quay.io/jetstack`
24-
- `version` of cert-manager to install, defaults to `v1.1.0`
24+
- `version` of cert-manager to install, defaults to `v1.3.1`
2525
- `load_to_kind` (see above), defaults to `False`
2626
- `kind_cluster_name`, defaults to `kind`

tilt_modules/cert_manager/Tiltfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ spec:
2626
"""
2727

2828
# Deploys cert manager to your environment
29-
def deploy_cert_manager(registry="quay.io/jetstack", version="v1.1.0", load_to_kind=False, kind_cluster_name="kind"):
29+
def deploy_cert_manager(registry="quay.io/jetstack", version="v1.3.1", load_to_kind=False, kind_cluster_name="kind"):
3030
silent=True
3131
if version.startswith('v0'):
3232
cert_manager_test_resources_versioned = cert_manager_test_resources.format(cert_manager_api_version='v1alpha2')
@@ -59,6 +59,7 @@ def deploy_cert_manager(registry="quay.io/jetstack", version="v1.1.0", load_to_k
5959

6060
# 2. create a test certificate
6161
print("Testing cert-manager")
62-
local("cat << EOF | kubectl apply -f - " + cert_manager_test_resources_versioned + "EOF", quiet=silent, echo_off=silent)
62+
# The webhook may refuse connections initially (despite the deployment being Available), so try several times.
63+
local("for i in 1 2 3 4 5 6; do (kubectl apply -f - <<EOF" + cert_manager_test_resources_versioned + "EOF\n) && break || sleep 15; done", quiet=silent, echo_off=silent)
6364
local("kubectl wait --for=condition=Ready --timeout=300s -n cert-manager-test certificate/selfsigned-cert ", quiet=silent, echo_off=silent)
64-
local("cat << EOF | kubectl delete -f - " + cert_manager_test_resources_versioned + "EOF", quiet=silent, echo_off=silent)
65+
local("kubectl delete -f - <<EOF" + cert_manager_test_resources_versioned + "EOF", quiet=silent, echo_off=silent)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
load('../Tiltfile', 'deploy_cert_manager')
2+
3+
is_kind = k8s_context().startswith('kind-')
4+
deploy_cert_manager(load_to_kind=is_kind)
5+
6+
local_resource(
7+
name='verify-cert-manager',
8+
cmd='kubectl wait --for=condition=Available --timeout=300s -n cert-manager deployment/cert-manager')
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
cd $(dirname $0)
4+
5+
set -ex
6+
tilt ci
7+
tilt down --delete-namespaces

tilt_modules/extensions.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,7 @@
33
{
44
"Name": "cert_manager",
55
"ExtensionRegistry": "https://github.com/tilt-dev/tilt-extensions",
6-
"TimeFetched": "2020-10-13T10:04:11.507324896-07:00"
7-
},
8-
{
9-
"Name": "cert_manager",
10-
"ExtensionRegistry": "https://github.com/tilt-dev/tilt-extensions",
11-
"TimeFetched": "2021-02-03T16:29:09.695507+01:00"
6+
"TimeFetched": "2021-05-26T11:19:57.411132-06:00"
127
}
138
]
14-
}
9+
}

0 commit comments

Comments
 (0)