Skip to content

Commit

Permalink
e2e: pass context.TODO() to k8s.e2e functions
Browse files Browse the repository at this point in the history
Many Kubernetes test framework functions now require a context to be
passed. Use `context.TODO()` for this, just like is done for some of the
functions already.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
  • Loading branch information
nixpanic committed Jun 2, 2023
1 parent e15cadc commit 7b01ec1
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion e2e/cephfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ var _ = Describe(cephfsType, func() {
logsCSIPods("app=csi-cephfsplugin", c)

// log all details from the namespace where Ceph-CSI is deployed
e2edebug.DumpAllNamespaceInfo(c, cephCSINamespace)
e2edebug.DumpAllNamespaceInfo(context.TODO(), c, cephCSINamespace)
}
err := deleteConfigMap(cephFSDirPath)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion e2e/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func logsCSIPods(label string, c clientset.Interface) {
func kubectlLogPod(c clientset.Interface, pod *v1.Pod) {
container := pod.Spec.Containers
for i := range container {
logs, err := frameworkPod.GetPodLogs(c, pod.Namespace, pod.Name, container[i].Name)
logs, err := frameworkPod.GetPodLogs(context.TODO(), c, pod.Namespace, pod.Name, container[i].Name)
if err != nil {
logs, err = getPreviousPodLogs(c, pod.Namespace, pod.Name, container[i].Name)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion e2e/nfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ var _ = Describe("nfs", func() {
logsCSIPods("app=csi-nfsplugin", c)

// log all details from the namespace where Ceph-CSI is deployed
e2edebug.DumpAllNamespaceInfo(c, cephCSINamespace)
e2edebug.DumpAllNamespaceInfo(context.TODO(), c, cephCSINamespace)
}
err := deleteConfigMap(nfsDirPath)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion e2e/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func checkNodeHasLabel(c kubernetes.Interface, labelKey, labelValue string) erro
return fmt.Errorf("failed to list node: %w", err)
}
for i := range nodes.Items {
e2enode.ExpectNodeHasLabel(c, nodes.Items[i].Name, labelKey, labelValue)
e2enode.ExpectNodeHasLabel(context.TODO(), c, nodes.Items[i].Name, labelKey, labelValue)
}

return nil
Expand Down
1 change: 1 addition & 0 deletions e2e/pvc.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func createPVCAndvalidatePV(c kubernetes.Interface, pvc *v1.PersistentVolumeClai
return false, fmt.Errorf("failed to get pv: %w", err)
}
err = e2epv.WaitOnPVandPVC(
context.TODO(),
c,
&framework.TimeoutContext{ClaimBound: timeout, PVBound: timeout},
namespace,
Expand Down
4 changes: 2 additions & 2 deletions e2e/rbd.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ var _ = Describe("RBD", func() {
logsCSIPods("app=csi-rbdplugin", c)

// log all details from the namespace where Ceph-CSI is deployed
e2edebug.DumpAllNamespaceInfo(c, cephCSINamespace)
e2edebug.DumpAllNamespaceInfo(context.TODO(), c, cephCSINamespace)
}

err := deleteConfigMap(rbdDirPath)
Expand Down Expand Up @@ -596,7 +596,7 @@ var _ = Describe("RBD", func() {
validateRBDImageCount(f, 1, defaultRBDPool)
validateOmapCount(f, 1, rbdType, defaultRBDPool, volumesType)
// create namespace for reattach PVC, deletion will be taken care by framework
ns, err := f.CreateNamespace(reattachPVCNamespace, nil)
ns, err := f.CreateNamespace(context.TODO(), reattachPVCNamespace, nil)
if err != nil {
framework.Failf("failed to create namespace: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/upgrade-cephfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ var _ = Describe("CephFS Upgrade Testing", func() {
logsCSIPods("app=csi-cephfsplugin", c)

// log all details from the namespace where Ceph-CSI is deployed
e2edebug.DumpAllNamespaceInfo(c, cephCSINamespace)
e2edebug.DumpAllNamespaceInfo(context.TODO(), c, cephCSINamespace)
}
err = deleteConfigMap(cephFSDirPath)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion e2e/upgrade-rbd.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ var _ = Describe("RBD Upgrade Testing", func() {
logsCSIPods("app=csi-rbdplugin", c)

// log all details from the namespace where Ceph-CSI is deployed
e2edebug.DumpAllNamespaceInfo(c, cephCSINamespace)
e2edebug.DumpAllNamespaceInfo(context.TODO(), c, cephCSINamespace)
}

err := deleteConfigMap(rbdDirPath)
Expand Down

0 comments on commit 7b01ec1

Please sign in to comment.