Skip to content

Commit 9695686

Browse files
authored
Merge pull request #1581 from FloatXD/e2e-up-21
[Test] Update the K8S version in upgrade test && Cilium pod check
2 parents 550b29d + d5ea61a commit 9695686

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

hack/run-nightly-cluster-e2e.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,26 +146,26 @@ func_prepare_config_yaml "${SOURCE_CONFIG_PATH}" "${dest_config_path}"
146146
CLUSTER_OPERATION_NAME1="cluster1-install-"`date "+%H-%M-%S"`
147147

148148
# set vars-conf-cm.yml
149-
sed -i "s/1.31.6/1.31.0/" "${dest_config_path}"/vars-conf-cm.yml
149+
sed -i "s/1.31.6/1.31.6/" "${dest_config_path}"/vars-conf-cm.yml
150150

151151
sed -i "s/e2e-cluster1-install/${CLUSTER_OPERATION_NAME1}/" "${dest_config_path}"/kubeanClusterOps.yml
152152

153153

154-
## prepare cluster upgrade job yml --> upgrade from v1.31.0 to v1.31.2
154+
## prepare cluster upgrade job yml --> upgrade from v1.31.6 to v1.31.9
155155
dest_config_path="${REPO_ROOT}"/test/kubean_sonobouy_nightlye2e/e2e-upgrade-cluster-y/
156156
func_prepare_config_yaml "${SOURCE_CONFIG_PATH}" "${dest_config_path}"
157157
CLUSTER_OPERATION_NAME2="cluster1-upgrade-y"
158158
sed -i "s/e2e-cluster1-install/${CLUSTER_OPERATION_NAME2}/" "${dest_config_path}"/kubeanClusterOps.yml
159159
sed -i "s/cluster.yml/upgrade-cluster.yml/" "${dest_config_path}"/kubeanClusterOps.yml
160-
sed -i "s/1.31.6/1.31.2/" "${dest_config_path}"/vars-conf-cm.yml
160+
sed -i "s/1.31.6/1.31.9/" "${dest_config_path}"/vars-conf-cm.yml
161161

162-
## prepare cluster upgrade job yml --> upgrade from v1.31.2 to v1.31.6
162+
## prepare cluster upgrade job yml --> upgrade from v1.31.9 to v1.32.1
163163
dest_config_path="${REPO_ROOT}"/test/kubean_sonobouy_nightlye2e/e2e-upgrade-cluster-z/
164164
func_prepare_config_yaml "${SOURCE_CONFIG_PATH}" "${dest_config_path}"
165165
CLUSTER_OPERATION_NAME3="cluster1-upgrade-z"
166166
sed -i "s/e2e-cluster1-install/${CLUSTER_OPERATION_NAME3}/" "${dest_config_path}"/kubeanClusterOps.yml
167167
sed -i "s/cluster.yml/upgrade-cluster.yml/" "${dest_config_path}"/kubeanClusterOps.yml
168-
sed -i "s/1.31.6/1.31.6/" "${dest_config_path}"/vars-conf-cm.yml
168+
sed -i "s/1.31.6/1.32.1/" "${dest_config_path}"/vars-conf-cm.yml
169169

170170
ginkgo -v -race -timeout=6h --fail-fast ./test/kubean_sonobouy_nightlye2e/ -- --kubeconfig="${KUBECONFIG_FILE}" \
171171
--clusterOperationName="${CLUSTER_OPERATION_NAME1}" --vmipaddr="${vm_ip_addr1}" --vmipaddr2="${vm_ip_addr2}" \

test/kubean_cilium_cluster_e2e/create_cilium_cluster_test.go

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,27 @@ var _ = ginkgo.Describe("create cilium clusters one master and one worker", func
8585
gomega.ExpectWithOffset(2, err).NotTo(gomega.HaveOccurred(), "Failed new cluster1Client")
8686

8787
podList, _ := cluster1Client.CoreV1().Pods("kube-system").List(context.TODO(), metav1.ListOptions{})
88-
ciliumPodNumber := 0
88+
deploymentList, _ := cluster1Client.AppsV1().Deployments("kube-system").List(context.TODO(), metav1.ListOptions{})
89+
daemonsetList, _ := cluster1Client.AppsV1().DaemonSets("kube-system").List(context.TODO(), metav1.ListOptions{})
90+
8991
for _, pod := range podList.Items {
9092
if strings.Contains(pod.ObjectMeta.Name, "cilium") {
9193
gomega.Expect(string(pod.Status.Phase)).To(gomega.Equal("Running"))
92-
ciliumPodNumber += 1
9394
}
9495
}
95-
gomega.Expect(ciliumPodNumber).To(gomega.Equal(4))
96+
for _, dm := range deploymentList.Items {
97+
if strings.Contains(dm.ObjectMeta.Name, "cilium") {
98+
fmt.Println(dm.Name, "======>", dm.Status.Replicas)
99+
gomega.Expect(dm.Status.ReadyReplicas).To(gomega.Equal(dm.Status.AvailableReplicas))
100+
}
101+
}
102+
for _, ds := range daemonsetList.Items {
103+
if strings.Contains(ds.ObjectMeta.Name, "cilium") {
104+
fmt.Println(ds.Name, "======>", ds.Status.CurrentNumberScheduled, "===", ds.Status.DesiredNumberScheduled)
105+
gomega.Expect(ds.Status.DesiredNumberScheduled).To(gomega.Equal(ds.Status.CurrentNumberScheduled))
106+
}
107+
}
108+
96109
})
97110

98111
ginkgo.It("create pod1, pod2, pod3", func() {

test/tools/config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ const (
3232
)
3333

3434
const (
35-
OriginK8Version = "v1.31.0"
36-
UpgradeK8Version_Y = "v1.31.2"
37-
UpgradeK8Version_Z = "v1.31.6"
35+
OriginK8Version = "v1.31.6"
36+
UpgradeK8Version_Y = "v1.31.9"
37+
UpgradeK8Version_Z = "v1.32.1"
3838
NginxAlpha = "release-ci.daocloud.io/kubean/nginx:alpine"
3939
E2eInstallClusterYamlFolder = "e2e-install-cluster"
4040
)

0 commit comments

Comments
 (0)