Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: confirm that the SpiderSubnet AutoPool feature is really disabled #3401

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions test/e2e/subnet/subnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2018,9 +2018,38 @@ var _ = Describe("test subnet", Label("subnet"), func() {
configmap.Data[configYamlStr] = string(marshal)
err = frame.KClient.Update(context.TODO(), configmap)
Expect(err).NotTo(HaveOccurred())
GinkgoWriter.Printf("succeeded to update ConfigMap spiderpool-conf EnableAutoPoolForApplication to be false")

Eventually(func() bool {
var newCmConfig types.SpiderpoolConfigmapConfig
configmap, err := frame.GetConfigmap(common.SpiderPoolConfigmapName, common.SpiderPoolConfigmapNameSpace)
GinkgoWriter.Printf("debug %v \n", configmap)
if err != nil {
return false
}
configStr, ok := configmap.Data[configYamlStr]
if !ok {
return false
}
err = yaml.Unmarshal([]byte(configStr), &newCmConfig)
if err != nil {
return false
}
GinkgoWriter.Println("newCmConfig.EnableAutoPoolForApplication:", newCmConfig.EnableAutoPoolForApplication)
if newCmConfig.EnableAutoPoolForApplication != false {
GinkgoWriter.Printf("enableAutoPoolForApplication is not false, but %v ,waiting...\n", newCmConfig.EnableAutoPoolForApplication)
return false
}
return true
}, common.ResourceDeleteTimeout, common.ForcedWaitingTime).Should(BeTrue())
}

DeferCleanup(func() {
if CurrentSpecReport().Failed() {
GinkgoWriter.Println("If the use case fails, the cleanup step will be skipped")
return
}

// change the configmap 'enableAutoPoolForApplication' back to be 'true'
configmap, err := frame.GetConfigmap(common.SpiderPoolConfigmapName, common.SpiderPoolConfigmapNameSpace)
Expect(err).NotTo(HaveOccurred())
Expand Down
4 changes: 4 additions & 0 deletions test/scripts/debugEnv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ elif [ "$TYPE"x == "detail"x ] ; then
echo "--------- kubectl get network-attachment-definitions.k8s.cni.cncf.io -A -o json"
kubectl get network-attachment-definitions.k8s.cni.cncf.io -o json --kubeconfig ${E2E_KUBECONFIG}

echo ""
echo "--------- kubectl get configmaps -n kube-system spiderpool-conf -ojson"
kubectl get configmaps -n kube-system spiderpool-conf -ojson --kubeconfig ${E2E_KUBECONFIG}

echo ""
echo "=============== IPAM log ============== "
KIND_CLUSTER_NAME=${KIND_CLUSTER_NAME:-"spider"}
Expand Down
Loading