Skip to content

Commit 62f6fc6

Browse files
author
Simon Emms
committed
[kots]: apply backup labels to resources
1 parent 1613e01 commit 62f6fc6

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-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: apps/v1
14+
kind: StatefulSet
15+
metadata:
16+
name: db
17+
labels:
18+
"kots.io/app-slug": "{{repl LicenseFieldValue "appSlug" }}"
19+
"kots.io/backup": "velero"

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

Lines changed: 10 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
@@ -273,6 +276,7 @@ spec:
273276
yq e -i ".components.proxy.service.serviceType = \"{{repl ConfigOption "component_proxy_service_serviceType" }}\"" "${CONFIG_FILE}"
274277
fi
275278
279+
yq e -i ".customization = []" "${CONFIG_FILE}"
276280
if [ '{{repl ConfigOptionNotEquals "customization_patch" "" }}' = "true" ];
277281
then
278282
CUSTOMIZATION='{{repl ConfigOptionData "customization_patch" | Base64Encode }}'
@@ -285,6 +289,9 @@ spec:
285289
echo "Gitpod: No advanced configuration applied"
286290
fi
287291
292+
echo "Gitpod: Apply the backup labels"
293+
yq e -i '.customization += load("/custom-labels/customization.yaml")' "${CONFIG_FILE}"
294+
288295
echo "Gitpod: Update platform telemetry value"
289296
yq eval-all --inplace '.experimental.telemetry.data.platform = "{{repl Distribution }}"' "${CONFIG_FILE}"
290297
@@ -361,6 +368,9 @@ spec:
361368
- name: config-patch
362369
configMap:
363370
name: gitpod-config-patch
371+
- name: custom-labels
372+
configMap:
373+
name: gitpod-custom-labels
364374
- name: node-fs0
365375
hostPath:
366376
path: /

0 commit comments

Comments
 (0)