Skip to content

Commit af5bd10

Browse files
authored
Merge pull request #17228 from justinsb/automated-cherry-pick-of-#17152-release-1.31
Automated cherry pick of #17152: tests: use reconcile command for kOps 1.31+
2 parents 0244b37 + ee7c6a1 commit af5bd10

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

tests/e2e/scenarios/upgrade-ab/run-test.sh

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,24 +121,37 @@ else
121121
"${KOPS_B}" edit cluster "${CLUSTER_NAME}" "--set=cluster.spec.kubernetesVersion=${K8S_VERSION_B}"
122122
fi
123123

124-
"${KOPS_B}" update cluster
125-
"${KOPS_B}" update cluster --admin --yes
126-
# Verify no additional changes
127-
"${KOPS_B}" update cluster
124+
if [[ "${KOPS_VERSION_B}" =~ 1.(20|21|22|23|24|25|26|27|28|29|30). ]]; then
125+
# kOps introduced the reconcile command in 1.31
126+
# TODO: remove this block once we stop testing upgrades to kops <1.31
127+
"${KOPS_B}" update cluster
128+
"${KOPS_B}" update cluster --admin --yes
129+
# Verify no additional changes
130+
"${KOPS_B}" update cluster
128131

129-
# Verify kubeconfig-a still works
130-
kubectl get nodes -owide --kubeconfig "${KUBECONFIG_A}"
132+
# Verify kubeconfig-a still works
133+
kubectl get nodes -owide --kubeconfig "${KUBECONFIG_A}"
134+
135+
# Sleep to ensure channels has done its thing
136+
sleep 120s
131137

132-
# Sleep to ensure channels has done its thing
133-
sleep 120s
138+
# Make sure configuration B has been applied (e.g. new load balancer is ready)
139+
"${KOPS_B}" validate cluster --wait=10m
134140

135-
# Make sure configuration B has been applied (e.g. new load balancer is ready)
136-
"${KOPS_B}" validate cluster --wait=10m
141+
${CHANNELS} apply channel "$KOPS_STATE_STORE"/"${CLUSTER_NAME}"/addons/bootstrap-channel.yaml --yes -v4
137142

138-
${CHANNELS} apply channel "$KOPS_STATE_STORE"/"${CLUSTER_NAME}"/addons/bootstrap-channel.yaml --yes -v4
143+
"${KOPS_B}" rolling-update cluster
144+
"${KOPS_B}" rolling-update cluster --yes --validation-timeout 30m
145+
else
146+
# Preview changes
147+
"${KOPS_B}" reconcile cluster
139148

140-
"${KOPS_B}" rolling-update cluster
141-
"${KOPS_B}" rolling-update cluster --yes --validation-timeout 30m
149+
# Apply changes
150+
"${KOPS_B}" reconcile cluster --yes
151+
152+
# Verify no additional changes
153+
"${KOPS_B}" update cluster
154+
fi
142155

143156
"${KOPS_B}" validate cluster
144157

0 commit comments

Comments
 (0)