Skip to content

Commit 2b0bcaa

Browse files
minhtuleekampf
andauthored
fix: Fix pre-delete-cleanup job (#788)
## Changes Unlike the `bitnami/kubectl` image (replaced in #768), `rancher/kubectl` image doesn't include a shell so we need to run `kubectl` directly. Currently, the `pre-delete-cleanup` job fails with the following error ``` Failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "/bin/sh": stat /bin/sh: no such file or directory: unknown ``` --------- Co-authored-by: Eran Kampf <205185+ekampf@users.noreply.github.com>
1 parent 685e7eb commit 2b0bcaa

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

deploy/twingate-operator/templates/pre-delete-cleanup.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,15 @@ spec:
2525
{{- toYaml .Values.securityContext | nindent 12 }}
2626
image: rancher/kubectl:v1.34.0
2727
command:
28-
- /bin/sh
29-
- -c
30-
- |
31-
kubectl delete svc --cascade=foreground --timeout=30s --ignore-not-found -n {{ .Release.Namespace }} {{ $kubernetesAccessGatewayName }}
28+
- kubectl
29+
- delete
30+
- svc
31+
- --cascade=foreground
32+
- --timeout=30s
33+
- --ignore-not-found
34+
- -n
35+
- {{ .Release.Namespace }}
36+
- {{ $kubernetesAccessGatewayName }}
3237
{{- with .Values.nodeSelector }}
3338
nodeSelector:
3439
{{- toYaml . | nindent 8 }}

deploy/twingate-operator/tests/__snapshot__/pre-delete-cleanup_test.yaml.snap

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,15 @@ should enable pre-delete cleanup job:
1919
spec:
2020
containers:
2121
- command:
22-
- /bin/sh
23-
- -c
24-
- |
25-
kubectl delete svc --cascade=foreground --timeout=30s --ignore-not-found -n NAMESPACE RELEASE-NAME-kubernetes-access-gateway
22+
- kubectl
23+
- delete
24+
- svc
25+
- --cascade=foreground
26+
- --timeout=30s
27+
- --ignore-not-found
28+
- -n
29+
- NAMESPACE
30+
- RELEASE-NAME-kubernetes-access-gateway
2631
image: rancher/kubectl:v1.34.0
2732
name: cleanup
2833
securityContext:

0 commit comments

Comments
 (0)