Skip to content

Commit 75682e9

Browse files
feat: system runtimes in git
1 parent 011b3f2 commit 75682e9

File tree

6 files changed

+45
-41
lines changed

6 files changed

+45
-41
lines changed

charts/cf-runtime/Chart.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,15 @@ annotations:
1818
# Supported kinds: `added`, `changed`, `deprecated`, `removed`, `fixed`, `security`:
1919
artifacthub.io/changes: |
2020
- kind: changed
21-
description: "Fix kubeconfigFilePath for agentless runtime"
21+
description: "(on-premise) Fix kubeconfigFilePath for agentless runtime"
22+
- kind: added
23+
description: "(on-premise) Add option to create extra agentless runtimes"
24+
- kind: added
25+
description: "Add cronjob to constantle patch runtime spec"
26+
- kind: fixed
27+
description: "Fix missing codefresh-dind-config ConfigMap in runtime spec"
28+
- kind: changed
29+
description: "Misc templates renaming"
2230
dependencies:
2331
- name: cf-common
2432
repository: oci://quay.io/codefresh/charts

charts/cf-runtime/files/patch-runtime.sh

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,41 +14,37 @@ else
1414
patch_type="sys-re"
1515
fi
1616

17+
modify_accounts() {
18+
local runtime_name_encoded
19+
runtime_name_encoded=$(yq '.metadata.name' "$1" | jq -r @uri)
20+
local accounts
21+
accounts=$(yq '.accounts' "$1")
22+
23+
if [[ -n $accounts ]]; then
24+
local payload
25+
payload=$(echo "$accounts" | jq '{accounts: .}')
26+
set +x
27+
curl -X PUT \
28+
-H "Content-Type: application/json" \
29+
-H "Authorization: $API_KEY" \
30+
-d "$payload" \
31+
"$API_HOST/api/admin/runtime-environments/account/modify/$runtime_name_encoded"
32+
else
33+
echo "No accounts to add for $1"
34+
fi
35+
}
36+
1737
for runtime in /opt/codefresh/*.yaml; do
1838
if [[ -f $runtime ]]; then
1939
codefresh patch $patch_type -f $runtime
20-
ACCOUNTS=$(yq '.accounts' $runtime)
21-
RUNTIME_NAME_ENCODED=$(yq '.metadata.name' $runtime | jq -r @uri)
22-
if [[ -n $ACCOUNTS ]]; then
23-
PAYLOAD=$(echo $ACCOUNTS | jq '{accounts: .}')
24-
set +x
25-
curl -X PUT \
26-
-H "Content-Type: application/json" \
27-
-H "Authorization: $API_KEY" \
28-
-d "$PAYLOAD" \
29-
"$API_HOST/api/admin/runtime-environments/account/modify/$RUNTIME_NAME_ENCODED"
30-
else
31-
echo "No accounts to add"
32-
fi
40+
modify_accounts "$runtime"
3341
fi
3442
done
3543

3644
for runtime in /opt/codefresh/runtime.d/system/*.yaml; do
3745
if [[ -f $runtime ]]; then
3846
cat $runtime
3947
codefresh patch sys-re -f $runtime
40-
ACCOUNTS=$(yq '.accounts' $runtime)
41-
RUNTIME_NAME_ENCODED=$(yq '.metadata.name' $runtime | jq -r @uri)
42-
if [[ -n $ACCOUNTS ]]; then
43-
PAYLOAD=$(echo $ACCOUNTS | jq '{accounts: .}')
44-
set +x
45-
curl -X PUT \
46-
-H "Content-Type: application/json" \
47-
-H "Authorization: $API_KEY" \
48-
-d "$PAYLOAD" \
49-
"$API_HOST/api/admin/runtime-environments/account/modify/$RUNTIME_NAME_ENCODED"
50-
else
51-
echo "No accounts to add"
52-
fi
48+
modify_accounts "$runtime"
5349
fi
5450
done

charts/cf-runtime/tests/private-registry/private_registry_test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ tests:
114114
name: codefresh-certs-server
115115
mountPath: /etc/ssl/cf
116116
readOnly: true
117-
codefresh-dind-config:
118-
name: codefresh-dind-config
117+
dind-config:
118+
name: dind-config
119119
mountPath: /etc/docker/daemon.json
120120
subPath: daemon.json
121121
readOnly: true
@@ -124,8 +124,8 @@ tests:
124124
name: codefresh-certs-server
125125
secret:
126126
secretName: codefresh-certs-server
127-
codefresh-dind-config:
128-
name: codefresh-dind-config
127+
dind-config:
128+
name: dind-config
129129
configMap:
130130
name: codefresh-dind-config
131131
extends:

charts/cf-runtime/tests/runtime/runtime_onprem_test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ tests:
175175
name: codefresh-certs-server
176176
mountPath: /etc/ssl/cf
177177
readOnly: true
178-
codefresh-dind-config:
179-
name: codefresh-dind-config
178+
dind-config:
179+
name: dind-config
180180
mountPath: /etc/docker/daemon.json
181181
subPath: daemon.json
182182
readOnly: true
@@ -185,8 +185,8 @@ tests:
185185
name: codefresh-certs-server
186186
secret:
187187
secretName: codefresh-certs-server
188-
codefresh-dind-config:
189-
name: codefresh-dind-config
188+
dind-config:
189+
name: dind-config
190190
configMap:
191191
name: codefresh-dind-config
192192
extends:

charts/cf-runtime/tests/runtime/runtime_test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ tests:
188188
name: codefresh-certs-server
189189
mountPath: /etc/ssl/cf
190190
readOnly: true
191-
codefresh-dind-config:
192-
name: codefresh-dind-config
191+
dind-config:
192+
name: dind-config
193193
mountPath: /etc/docker/daemon.json
194194
subPath: daemon.json
195195
readOnly: true
@@ -198,8 +198,8 @@ tests:
198198
name: codefresh-certs-server
199199
secret:
200200
secretName: codefresh-certs-server
201-
codefresh-dind-config:
202-
name: codefresh-dind-config
201+
dind-config:
202+
name: dind-config
203203
configMap:
204204
name: codefresh-dind-config
205205
extends:

charts/cf-runtime/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ runtime:
615615
# @default -- See below
616616
patch:
617617
enabled: true
618-
name: ""
618+
name: "" # e.g. "runtime-patch"
619619
hook:
620620
enabled: true
621621
image:
@@ -654,7 +654,7 @@ runtime:
654654
# @default -- See below
655655
gencerts:
656656
enabled: true
657-
name: dind-gencerts
657+
name: "" # e.g. "dind-gencerts"
658658
image:
659659
registry: quay.io
660660
repository: codefresh/kubectl

0 commit comments

Comments
 (0)