Skip to content

Commit eb2ce5d

Browse files
author
Simon Emms
committed
[installer]: remove jobs from the gitpod-app config map
These are deleted after 60 seconds which causes the uninstallation script not to delete anything that comes after jobs in the ordering, such as cron jobs.
1 parent aa47428 commit eb2ce5d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

installer/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ kubectl get configmaps gitpod-app -o jsonpath='{.data.app\.yaml}' \
118118
cluster. This will include `Secrets` generated from internal `Certificates`
119119
and `PersistentVolumeClaims`. These will need to be manually deleted.
120120

121+
[Batch jobs](https://kubernetes.io/docs/concepts/workloads/controllers/job/) are
122+
not included in this ConfigMap by design. These have `ttlSecondsAfterFinished`
123+
defined in the spec and so will be deleted shortly after the jobs have run.
124+
121125
# Advanced topics
122126

123127
## Post-processing the YAML

installer/pkg/common/display.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
package common
66

77
import (
8-
corev1 "k8s.io/api/core/v1"
98
"regexp"
109
"sort"
1110
"strings"
1211

12+
corev1 "k8s.io/api/core/v1"
13+
1314
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1415
"sigs.k8s.io/yaml"
1516
)
@@ -84,7 +85,8 @@ func GenerateInstallationConfigMap(ctx *RenderContext, objects []RuntimeObject)
8485

8586
// Convert to a simplified object that allows us to access the objects
8687
for _, c := range objects {
87-
if c.Kind != "" {
88+
// Jobs are excluded as they break uninstallation if they've been cleaned up
89+
if c.Kind != "" && !(c.APIVersion == TypeMetaBatchJob.APIVersion && c.Kind == TypeMetaBatchJob.Kind) {
8890
marshal, err := yaml.Marshal(c)
8991
if err != nil {
9092
return nil, err

0 commit comments

Comments
 (0)