Skip to content

Commit 4e47f2c

Browse files
authored
Merge pull request #35864 from pohly/dra-e2e-kind-jobs-config
DRA: promote kind.yaml handling from canary to production jobs
2 parents 642a7bd + 9e63b18 commit 4e47f2c

File tree

4 files changed

+150
-161
lines changed

4 files changed

+150
-161
lines changed

config/jobs/kubernetes/sig-node/dra-canary.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ presubmits:
6565
6666
mkdir -p "${ARTIFACTS}/kind"
6767
cp /tmp/kind.yaml "${ARTIFACTS}/kind"
68-
6968
cat /tmp/kind.yaml
69+
7070
kind create cluster --retain --config /tmp/kind.yaml --image dra/node:latest
7171
atexit () {
7272
kind export logs "${ARTIFACTS}/kind"
@@ -152,8 +152,8 @@ presubmits:
152152
153153
mkdir -p "${ARTIFACTS}/kind"
154154
cp /tmp/kind.yaml "${ARTIFACTS}/kind"
155-
156155
cat /tmp/kind.yaml
156+
157157
kind create cluster --retain --config /tmp/kind.yaml --image dra/node:latest
158158
atexit () {
159159
kind export logs "${ARTIFACTS}/kind"
@@ -239,8 +239,8 @@ presubmits:
239239
240240
mkdir -p "${ARTIFACTS}/kind"
241241
cp /tmp/kind.yaml "${ARTIFACTS}/kind"
242-
243242
cat /tmp/kind.yaml
243+
244244
kind create cluster --retain --config /tmp/kind.yaml --image dra/node:latest
245245
atexit () {
246246
kind export logs "${ARTIFACTS}/kind"
@@ -324,8 +324,8 @@ presubmits:
324324
325325
mkdir -p "${ARTIFACTS}/kind"
326326
cp /tmp/kind.yaml "${ARTIFACTS}/kind"
327-
328327
cat /tmp/kind.yaml
328+
329329
kind create cluster --retain --config /tmp/kind.yaml --image dra/node:latest
330330
atexit () {
331331
kind export logs "${ARTIFACTS}/kind"
@@ -454,8 +454,8 @@ presubmits:
454454
455455
mkdir -p "${ARTIFACTS}/kind"
456456
cp /tmp/kind.yaml "${ARTIFACTS}/kind"
457-
458457
cat /tmp/kind.yaml
458+
459459
kind create cluster --retain --config /tmp/kind.yaml --image dra/node:latest
460460
atexit () {
461461
kind export logs "${ARTIFACTS}/kind"
@@ -584,8 +584,8 @@ presubmits:
584584
585585
mkdir -p "${ARTIFACTS}/kind"
586586
cp /tmp/kind.yaml "${ARTIFACTS}/kind"
587-
588587
cat /tmp/kind.yaml
588+
589589
kind create cluster --retain --config /tmp/kind.yaml --image dra/node:latest
590590
atexit () {
591591
kind export logs "${ARTIFACTS}/kind"

config/jobs/kubernetes/sig-node/dra-ci.yaml

Lines changed: 65 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,21 @@ periodics:
5454
5555
# Additional features are not in kind.yaml, but they can be added at the end.
5656
for feature in ${features[@]}; do echo " ${feature}: true"; done
57-
58-
# Append ClusterConfiguration which causes etcd to use /tmp
59-
# (https://github.com/kubernetes-sigs/kind/issues/845#issuecomment-1261248420).
60-
# There's no kubeadmConfigPatches in any kind.yaml, so we can append at the end.
61-
cat <<EOF
62-
kubeadmConfigPatches:
63-
- |
64-
kind: ClusterConfiguration
65-
etcd:
66-
local:
67-
dataDir: /tmp/etcd
68-
EOF
6957
) >/tmp/kind.yaml
58+
59+
# Add or extend kubeadmConfigPatches with a ClusterConfiguration which causes etcd to use /tmp
60+
# (https://github.com/kubernetes-sigs/kind/issues/845#issuecomment-1261248420).
61+
# kind.yaml may or may not have a `kubeadmConfigPatches`, so we have to be
62+
# careful.
63+
if ! grep -q '^kubeadmConfigPatches:$' /tmp/kind.yaml; then
64+
echo "kubeadmConfigPatches:" >>/tmp/kind.yaml
65+
fi
66+
sed -i -e '/^kubeadmConfigPatches:$/a\' -e ' - |\n kind: ClusterConfiguration\n etcd:\n local:\n dataDir: /tmp/etcd\n' /tmp/kind.yaml
67+
68+
mkdir -p "${ARTIFACTS}/kind"
69+
cp /tmp/kind.yaml "${ARTIFACTS}/kind"
7070
cat /tmp/kind.yaml
71+
7172
kind create cluster --retain --config /tmp/kind.yaml --image dra/node:latest
7273
atexit () {
7374
kind export logs "${ARTIFACTS}/kind"
@@ -140,20 +141,21 @@ periodics:
140141
141142
# Additional features are not in kind.yaml, but they can be added at the end.
142143
for feature in ${features[@]}; do echo " ${feature}: true"; done
143-
144-
# Append ClusterConfiguration which causes etcd to use /tmp
145-
# (https://github.com/kubernetes-sigs/kind/issues/845#issuecomment-1261248420).
146-
# There's no kubeadmConfigPatches in any kind.yaml, so we can append at the end.
147-
cat <<EOF
148-
kubeadmConfigPatches:
149-
- |
150-
kind: ClusterConfiguration
151-
etcd:
152-
local:
153-
dataDir: /tmp/etcd
154-
EOF
155144
) >/tmp/kind.yaml
145+
146+
# Add or extend kubeadmConfigPatches with a ClusterConfiguration which causes etcd to use /tmp
147+
# (https://github.com/kubernetes-sigs/kind/issues/845#issuecomment-1261248420).
148+
# kind.yaml may or may not have a `kubeadmConfigPatches`, so we have to be
149+
# careful.
150+
if ! grep -q '^kubeadmConfigPatches:$' /tmp/kind.yaml; then
151+
echo "kubeadmConfigPatches:" >>/tmp/kind.yaml
152+
fi
153+
sed -i -e '/^kubeadmConfigPatches:$/a\' -e ' - |\n kind: ClusterConfiguration\n etcd:\n local:\n dataDir: /tmp/etcd\n' /tmp/kind.yaml
154+
155+
mkdir -p "${ARTIFACTS}/kind"
156+
cp /tmp/kind.yaml "${ARTIFACTS}/kind"
156157
cat /tmp/kind.yaml
158+
157159
kind create cluster --retain --config /tmp/kind.yaml --image dra/node:latest
158160
atexit () {
159161
kind export logs "${ARTIFACTS}/kind"
@@ -227,20 +229,21 @@ periodics:
227229
228230
# Additional features are not in kind.yaml, but they can be added at the end.
229231
for feature in ${features[@]}; do echo " ${feature}: true"; done
230-
231-
# Append ClusterConfiguration which causes etcd to use /tmp
232-
# (https://github.com/kubernetes-sigs/kind/issues/845#issuecomment-1261248420).
233-
# There's no kubeadmConfigPatches in any kind.yaml, so we can append at the end.
234-
cat <<EOF
235-
kubeadmConfigPatches:
236-
- |
237-
kind: ClusterConfiguration
238-
etcd:
239-
local:
240-
dataDir: /tmp/etcd
241-
EOF
242232
) >/tmp/kind.yaml
233+
234+
# Add or extend kubeadmConfigPatches with a ClusterConfiguration which causes etcd to use /tmp
235+
# (https://github.com/kubernetes-sigs/kind/issues/845#issuecomment-1261248420).
236+
# kind.yaml may or may not have a `kubeadmConfigPatches`, so we have to be
237+
# careful.
238+
if ! grep -q '^kubeadmConfigPatches:$' /tmp/kind.yaml; then
239+
echo "kubeadmConfigPatches:" >>/tmp/kind.yaml
240+
fi
241+
sed -i -e '/^kubeadmConfigPatches:$/a\' -e ' - |\n kind: ClusterConfiguration\n etcd:\n local:\n dataDir: /tmp/etcd\n' /tmp/kind.yaml
242+
243+
mkdir -p "${ARTIFACTS}/kind"
244+
cp /tmp/kind.yaml "${ARTIFACTS}/kind"
243245
cat /tmp/kind.yaml
246+
244247
kind create cluster --retain --config /tmp/kind.yaml --image dra/node:latest
245248
atexit () {
246249
kind export logs "${ARTIFACTS}/kind"
@@ -344,20 +347,21 @@ periodics:
344347
345348
# Additional features are not in kind.yaml, but they can be added at the end.
346349
for feature in ${features[@]}; do echo " ${feature}: true"; done
347-
348-
# Append ClusterConfiguration which causes etcd to use /tmp
349-
# (https://github.com/kubernetes-sigs/kind/issues/845#issuecomment-1261248420).
350-
# There's no kubeadmConfigPatches in any kind.yaml, so we can append at the end.
351-
cat <<EOF
352-
kubeadmConfigPatches:
353-
- |
354-
kind: ClusterConfiguration
355-
etcd:
356-
local:
357-
dataDir: /tmp/etcd
358-
EOF
359350
) >/tmp/kind.yaml
351+
352+
# Add or extend kubeadmConfigPatches with a ClusterConfiguration which causes etcd to use /tmp
353+
# (https://github.com/kubernetes-sigs/kind/issues/845#issuecomment-1261248420).
354+
# kind.yaml may or may not have a `kubeadmConfigPatches`, so we have to be
355+
# careful.
356+
if ! grep -q '^kubeadmConfigPatches:$' /tmp/kind.yaml; then
357+
echo "kubeadmConfigPatches:" >>/tmp/kind.yaml
358+
fi
359+
sed -i -e '/^kubeadmConfigPatches:$/a\' -e ' - |\n kind: ClusterConfiguration\n etcd:\n local:\n dataDir: /tmp/etcd\n' /tmp/kind.yaml
360+
361+
mkdir -p "${ARTIFACTS}/kind"
362+
cp /tmp/kind.yaml "${ARTIFACTS}/kind"
360363
cat /tmp/kind.yaml
364+
361365
kind create cluster --retain --config /tmp/kind.yaml --image dra/node:latest
362366
atexit () {
363367
kind export logs "${ARTIFACTS}/kind"
@@ -461,20 +465,21 @@ periodics:
461465
462466
# Additional features are not in kind.yaml, but they can be added at the end.
463467
for feature in ${features[@]}; do echo " ${feature}: true"; done
464-
465-
# Append ClusterConfiguration which causes etcd to use /tmp
466-
# (https://github.com/kubernetes-sigs/kind/issues/845#issuecomment-1261248420).
467-
# There's no kubeadmConfigPatches in any kind.yaml, so we can append at the end.
468-
cat <<EOF
469-
kubeadmConfigPatches:
470-
- |
471-
kind: ClusterConfiguration
472-
etcd:
473-
local:
474-
dataDir: /tmp/etcd
475-
EOF
476468
) >/tmp/kind.yaml
469+
470+
# Add or extend kubeadmConfigPatches with a ClusterConfiguration which causes etcd to use /tmp
471+
# (https://github.com/kubernetes-sigs/kind/issues/845#issuecomment-1261248420).
472+
# kind.yaml may or may not have a `kubeadmConfigPatches`, so we have to be
473+
# careful.
474+
if ! grep -q '^kubeadmConfigPatches:$' /tmp/kind.yaml; then
475+
echo "kubeadmConfigPatches:" >>/tmp/kind.yaml
476+
fi
477+
sed -i -e '/^kubeadmConfigPatches:$/a\' -e ' - |\n kind: ClusterConfiguration\n etcd:\n local:\n dataDir: /tmp/etcd\n' /tmp/kind.yaml
478+
479+
mkdir -p "${ARTIFACTS}/kind"
480+
cp /tmp/kind.yaml "${ARTIFACTS}/kind"
477481
cat /tmp/kind.yaml
482+
478483
kind create cluster --retain --config /tmp/kind.yaml --image dra/node:latest
479484
atexit () {
480485
kind export logs "${ARTIFACTS}/kind"

0 commit comments

Comments
 (0)