Skip to content

Commit

Permalink
fix(scheduler): update lib-csi pkg to exclude cordoned nodes
Browse files Browse the repository at this point in the history
Signed-off-by: Abhilash Shetty <[email protected]>
  • Loading branch information
abhilashshetty04 committed Feb 25, 2025
1 parent 32a301a commit 26a721a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 15 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.27.4
github.com/openebs/google-analytics-4 v0.3.0
github.com/openebs/lib-csi v0.8.2
github.com/openebs/lib-csi v0.9.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.15.1
github.com/spf13/cobra v1.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ github.com/onsi/gomega v1.27.4 h1:Z2AnStgsdSayCMDiCU42qIz+HLqEPcgiOCXjAU/w+8E=
github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ=
github.com/openebs/google-analytics-4 v0.3.0 h1:rAv9BC476ennyGPWAy4D3vU7TlxEKiynbLUP3VgeBUc=
github.com/openebs/google-analytics-4 v0.3.0/go.mod h1:lKjvRs6HAYOlOTYjtOUp35iTutoXzRL0hOeVAvLAfZI=
github.com/openebs/lib-csi v0.8.2 h1:HmoiZX3VXFPglwqnRPnRus7K58ixDWBa19OpPZGk2Ws=
github.com/openebs/lib-csi v0.8.2/go.mod h1:4yc0Q1thH+oU80z73zGELfrOw2yeLdLNIRmcrxBxsBc=
github.com/openebs/lib-csi v0.9.0 h1:Yro5CN0cT3bRYOB1IdGPKXnBcPzxZnkxd4MLREAtFME=
github.com/openebs/lib-csi v0.9.0/go.mod h1:4yc0Q1thH+oU80z73zGELfrOw2yeLdLNIRmcrxBxsBc=
github.com/pborman/uuid v0.0.0-20170612153648-e790cca94e6c/go.mod h1:VyrYX9gd7irzKovcSS6BIIEwPRkP2Wm2m9ufcdFSJ34=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
1 change: 0 additions & 1 deletion tests/lvm_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ func removeVg(name string) {
if current_retry < retries {
vg_empty := vgEmpty(name)
if vg_empty {
fmt.Printf("No lv in vg before vg remove\n")
break
} else {
fmt.Printf("lv in vg during retry %d\n", current_retry)
Expand Down
2 changes: 1 addition & 1 deletion tests/provision_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func scheduleOnCordonedNodeTest() {
createAndVerifyPVC(false)
By("Uncordon the node", uncordonk8sNode)
By("Verify the PVC gets Bound")
verifyPVC(pvcName, true)
verifyPVCStatus(pvcName, true)
deleteAndVerifyPVC(pvcName)
By("Verifying that PV doesnt exists after PVC deletion")
verifyPVForPVC(false, pvcName)
Expand Down
12 changes: 2 additions & 10 deletions tests/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,14 +304,7 @@ func createAndVerifyPVC(expect_bound bool) {
pvcName,
OpenEBSNamespace,
)
ok := false
if !expect_bound {
ok = IsPVCPendingConsistently(pvcName)
} else {
ok = IsPVCBoundEventually(pvcName)
}
gomega.Expect(ok).To(gomega.Equal(true),
"while checking the pvc status")
verifyPVCStatus(pvcName, expect_bound)

pvcObj, err = PVCClient.WithNamespace(OpenEBSNamespace).Get(pvcObj.Name, metav1.GetOptions{})
gomega.Expect(err).To(
Expand All @@ -323,7 +316,7 @@ func createAndVerifyPVC(expect_bound bool) {
}

// Verifies state of already created pvc based on expect_bound.
func verifyPVC(pvc_name string, expect_bound bool) {
func verifyPVCStatus(pvc_name string, expect_bound bool) {
ok := false
if !expect_bound {
ok = IsPVCPendingConsistently(pvc_name)
Expand Down Expand Up @@ -872,7 +865,6 @@ func cordonk8sNode() {
"Could not cordon node",
)
}

}
}

Expand Down

0 comments on commit 26a721a

Please sign in to comment.