Skip to content

Commit

Permalink
e2e tests, libnode: only uncordon node once
Browse files Browse the repository at this point in the history
`libnode` is relying on `kubectl uncordon` to make the node
schedulable again - this fails on the conformance lanes executed on the
kubevirtci project, since the sonobuoy container where the conformance
tests are executed do **not** have the kubectl binary.

Uncordoning a node is, quite literaly, making it schedulable - something
which is achieved by setting the `node.Spec.Unschedulable` flag to
false, and is already done in the stategic-merge patch command being sent to
the API some lines below, in [0].

Thus, we just need to make sure we also send the strategic merge PATCH
opeation for uncordoning a node.

[0] - https://github.com/kubevirt/kubevirt/blob/cdbc0a94a93ec5a758cde487edc62499ae2ff84f/tests/libnode/node.go#L107

Signed-off-by: Miguel Duarte Barroso <[email protected]>
  • Loading branch information
maiqueb committed Aug 11, 2022
1 parent f6cd567 commit 142491b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
1 change: 0 additions & 1 deletion tests/libnode/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ go_library(
"//pkg/virt-controller/services:go_default_library",
"//staging/src/kubevirt.io/api/core/v1:go_default_library",
"//staging/src/kubevirt.io/client-go/kubecli:go_default_library",
"//tests/clientcmd:go_default_library",
"//tests/flags:go_default_library",
"//tests/framework/cleanup:go_default_library",
"//tests/util:go_default_library",
Expand Down
9 changes: 0 additions & 9 deletions tests/libnode/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import (
virtconfig "kubevirt.io/kubevirt/pkg/virt-config"
"kubevirt.io/kubevirt/pkg/virt-controller/services"

"kubevirt.io/kubevirt/tests/clientcmd"
"kubevirt.io/kubevirt/tests/flags"
"kubevirt.io/kubevirt/tests/framework/cleanup"
"kubevirt.io/kubevirt/tests/util"
Expand All @@ -60,18 +59,10 @@ func CleanNodes() {
clusterDrainKey := GetNodeDrainKey()

for _, node := range GetAllSchedulableNodes(virtCli).Items {

old, err := json.Marshal(node)
Expect(err).ToNot(HaveOccurred())
new := node.DeepCopy()

k8sClient := clientcmd.GetK8sCmdClient()
if k8sClient == "oc" {
_, _, _ = clientcmd.RunCommandWithNS("", k8sClient, "adm", "uncordon", node.Name)
} else {
_, _, _ = clientcmd.RunCommandWithNS("", k8sClient, "uncordon", node.Name)
}

found := false
taints := []k8sv1.Taint{}
for _, taint := range node.Spec.Taints {
Expand Down

0 comments on commit 142491b

Please sign in to comment.