Skip to content

Commit 6f4184c

Browse files
author
Simon Emms
committed
[kots]: apply backup labels to all resources
1 parent f69360b commit 6f4184c

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2+
# Licensed under the MIT License. See License-MIT.txt in the project root for license information.
3+
4+
apiVersion: v1
5+
kind: ConfigMap
6+
metadata:
7+
name: gitpod-custom-labels
8+
labels:
9+
app: gitpod
10+
component: gitpod-installer
11+
data:
12+
customization.yaml: |
13+
- apiVersion: "*"
14+
kind: "*"
15+
metadata:
16+
name: "*"
17+
labels:
18+
"kots.io/app-slug": "{{repl LicenseFieldValue "appSlug" }}"
19+
"kots.io/backup": "velero"

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ spec:
3333
- mountPath: /config-patch
3434
name: config-patch
3535
readOnly: true
36+
- mountPath: /custom-labels
37+
name: custom-labels
38+
readOnly: true
3639
- mountPath: /mnt/node0
3740
name: node-fs0
3841
readOnly: true
@@ -49,6 +52,8 @@ spec:
4952
value: /run/containerd/io.containerd.runtime.v2.task/k8s.io
5053
- name: CONTAINERD_SOCKET_AL
5154
value: /run/containerd/containerd.sock
55+
- name: CUSTOM_LABELS_FILES
56+
value: /custom-labels/customization.yaml
5257
- name: GITPOD_OBJECTS
5358
value: /tmp/gitpod
5459
command:
@@ -273,6 +278,7 @@ spec:
273278
yq e -i ".components.proxy.service.serviceType = \"{{repl ConfigOption "component_proxy_service_serviceType" }}\"" "${CONFIG_FILE}"
274279
fi
275280
281+
yq e -i ".customization = []" "${CONFIG_FILE}"
276282
if [ '{{repl ConfigOptionNotEquals "customization_patch" "" }}' = "true" ];
277283
then
278284
CUSTOMIZATION='{{repl ConfigOptionData "customization_patch" | Base64Encode }}'
@@ -285,6 +291,9 @@ spec:
285291
echo "Gitpod: No advanced configuration applied"
286292
fi
287293
294+
echo "Gitpod: Apply the backup labels"
295+
yq e -i ".customization += $(yq '.' -o json "${CUSTOM_LABELS_FILES}")" "${CONFIG_FILE}"
296+
288297
echo "Gitpod: Update platform telemetry value"
289298
yq eval-all --inplace '.experimental.telemetry.data.platform = "{{repl Distribution }}"' "${CONFIG_FILE}"
290299
@@ -361,6 +370,9 @@ spec:
361370
- name: config-patch
362371
configMap:
363372
name: gitpod-config-patch
373+
- name: custom-labels
374+
configMap:
375+
name: gitpod-custom-labels
364376
- name: node-fs0
365377
hostPath:
366378
path: /

0 commit comments

Comments
 (0)