Skip to content

Commit df22407

Browse files
committed
Label the deployment workers as worker-cnf and use them in the
machine pool Signed-off-by: Federico Paolinelli <[email protected]>
1 parent ede2620 commit df22407

File tree

5 files changed

+21
-19
lines changed

5 files changed

+21
-19
lines changed

feature-configs/base/sctp/is_ready.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/sh
22

33
# no output means that the new machine config wasn't picked by MCO yet
4-
if [ -z "$(oc get mcp test-pool -o jsonpath='{.spec.configuration.source[?(@.name=="load-sctp-module")].name}')" ]; then
4+
if [ -z "$(oc get mcp worker-cnf -o jsonpath='{.spec.configuration.source[?(@.name=="load-sctp-module")].name}')" ]; then
55
exit 1
66
fi
77

8-
oc wait mcp/test-pool --for condition=updated --timeout 1s
8+
oc wait mcp/worker-cnf --for condition=updated --timeout 1s

feature-configs/base/sctp/sctp_module_mc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: machineconfiguration.openshift.io/v1
22
kind: MachineConfig
33
metadata:
44
labels:
5-
machineconfiguration.openshift.io/role: worker-sctp
5+
machineconfiguration.openshift.io/role: worker-cnf
66
name: load-sctp-module
77
spec:
88
config:

feature-configs/e2e-gcp/sctp/sctp_module_mc_patch.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: machineconfiguration.openshift.io/v1
22
kind: MachineConfig
33
metadata:
44
labels:
5-
machineconfiguration.openshift.io/role: worker-sctp
5+
machineconfiguration.openshift.io/role: worker-cnf
66
name: load-sctp-module

functests/sctp/sctp.go

+9-2
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,22 @@ import (
2121
const mcYaml = "../sctp/sctp_module_mc.yaml"
2222
const hostnameLabel = "kubernetes.io/hostname"
2323
const testNamespace = "sctptest"
24-
const sctpNodeSelector = "node-role.kubernetes.io/worker-sctp="
2524

26-
var testerImage string
25+
var (
26+
testerImage string
27+
sctpNodeSelector string
28+
)
2729

2830
func init() {
2931
testerImage = os.Getenv("SCTPTEST_IMAGE")
3032
if testerImage == "" {
3133
testerImage = "fedepaol/sctptest:v1.1"
3234
}
35+
36+
sctpNodeSelector = os.Getenv("SCTPTEST_NODE_SELECTOR")
37+
if sctpNodeSelector == "" {
38+
sctpNodeSelector = "node-role.kubernetes.io/worker-cnf="
39+
}
3340
}
3441

3542
var _ = Describe("sctp", func() {

hack/setup-test-cluster.sh

+8-13
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,12 @@ set -e
55
# expect oc to be in PATH by default
66
export OC_TOOL="${OC_TOOL:-oc}"
77

8-
# Label 1 worker node as worker-rt
9-
echo "[INFO]: Labeling 1 worker node with worker-rt"
10-
node=$(${OC_TOOL} get nodes --selector='node-role.kubernetes.io/worker' -o name | head -1)
11-
${OC_TOOL} label $node node-role.kubernetes.io/worker-rt=""
12-
13-
# Label 2 worker node as worker-sctp
14-
echo "[INFO]: Labeling 2 worker node with worker-sctp"
15-
nodes=$(${OC_TOOL} get nodes --selector='node-role.kubernetes.io/worker' -o name | sed -n 2,3p)
8+
# Label 2 worker nodes as worker-cnf
9+
echo "[INFO]: Labeling 2 worker nodes with worker-cnf"
10+
nodes=$(${OC_TOOL} get nodes --selector='node-role.kubernetes.io/worker' -o name | sed -n 1,2p)
1611
for node in $nodes
1712
do
18-
${OC_TOOL} label $node node-role.kubernetes.io/worker-sctp=""
13+
${OC_TOOL} label $node node-role.kubernetes.io/worker-cnf=""
1914
done
2015

2116

@@ -25,22 +20,22 @@ cat <<EOF | ${OC_TOOL} apply -f -
2520
apiVersion: machineconfiguration.openshift.io/v1
2621
kind: MachineConfigPool
2722
metadata:
28-
name: test-pool
23+
name: worker-cnf
2924
labels:
30-
test-pool: ""
25+
worker-cnf: ""
3126
spec:
3227
machineConfigSelector:
3328
matchExpressions:
3429
- {
3530
key: machineconfiguration.openshift.io/role,
3631
operator: In,
37-
values: [worker-sctp, worker],
32+
values: [worker-cnf, worker],
3833
}
3934
maxUnavailable: null
4035
paused: false
4136
nodeSelector:
4237
matchLabels:
43-
node-role.kubernetes.io/worker-sctp: ""
38+
node-role.kubernetes.io/worker-cnf: ""
4439
---
4540
EOF
4641

0 commit comments

Comments
 (0)