e2e: pass context.TODO() to k8s.e2e functions

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>
This commit is contained in:
Niels de Vos 2023-06-02 17:25:01 +02:00 committed by mergify[bot]
parent 92d9785166
commit e6627198d4
8 changed files with 9 additions and 8 deletions

View File

@ -227,7 +227,7 @@ var _ = Describe(cephfsType, func() {
logsCSIPods("app=csi-cephfsplugin", c) logsCSIPods("app=csi-cephfsplugin", c)
// log all details from the namespace where Ceph-CSI is deployed // log all details from the namespace where Ceph-CSI is deployed
e2edebug.DumpAllNamespaceInfo(c, cephCSINamespace) e2edebug.DumpAllNamespaceInfo(context.TODO(), c, cephCSINamespace)
} }
err := deleteConfigMap(cephFSDirPath) err := deleteConfigMap(cephFSDirPath)
if err != nil { if err != nil {

View File

@ -46,7 +46,7 @@ func logsCSIPods(label string, c clientset.Interface) {
func kubectlLogPod(c clientset.Interface, pod *v1.Pod) { func kubectlLogPod(c clientset.Interface, pod *v1.Pod) {
container := pod.Spec.Containers container := pod.Spec.Containers
for i := range container { 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 { if err != nil {
logs, err = getPreviousPodLogs(c, pod.Namespace, pod.Name, container[i].Name) logs, err = getPreviousPodLogs(c, pod.Namespace, pod.Name, container[i].Name)
if err != nil { if err != nil {

View File

@ -294,7 +294,7 @@ var _ = Describe("nfs", func() {
logsCSIPods("app=csi-nfsplugin", c) logsCSIPods("app=csi-nfsplugin", c)
// log all details from the namespace where Ceph-CSI is deployed // log all details from the namespace where Ceph-CSI is deployed
e2edebug.DumpAllNamespaceInfo(c, cephCSINamespace) e2edebug.DumpAllNamespaceInfo(context.TODO(), c, cephCSINamespace)
} }
err := deleteConfigMap(nfsDirPath) err := deleteConfigMap(nfsDirPath)
if err != nil { if err != nil {

View File

@ -60,7 +60,7 @@ func checkNodeHasLabel(c kubernetes.Interface, labelKey, labelValue string) erro
return fmt.Errorf("failed to list node: %w", err) return fmt.Errorf("failed to list node: %w", err)
} }
for i := range nodes.Items { 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 return nil

View File

@ -89,6 +89,7 @@ func createPVCAndvalidatePV(c kubernetes.Interface, pvc *v1.PersistentVolumeClai
return false, fmt.Errorf("failed to get pv: %w", err) return false, fmt.Errorf("failed to get pv: %w", err)
} }
err = e2epv.WaitOnPVandPVC( err = e2epv.WaitOnPVandPVC(
context.TODO(),
c, c,
&framework.TimeoutContext{ClaimBound: timeout, PVBound: timeout}, &framework.TimeoutContext{ClaimBound: timeout, PVBound: timeout},
namespace, namespace,

View File

@ -355,7 +355,7 @@ var _ = Describe("RBD", func() {
logsCSIPods("app=csi-rbdplugin", c) logsCSIPods("app=csi-rbdplugin", c)
// log all details from the namespace where Ceph-CSI is deployed // log all details from the namespace where Ceph-CSI is deployed
e2edebug.DumpAllNamespaceInfo(c, cephCSINamespace) e2edebug.DumpAllNamespaceInfo(context.TODO(), c, cephCSINamespace)
} }
err := deleteConfigMap(rbdDirPath) err := deleteConfigMap(rbdDirPath)
@ -596,7 +596,7 @@ var _ = Describe("RBD", func() {
validateRBDImageCount(f, 1, defaultRBDPool) validateRBDImageCount(f, 1, defaultRBDPool)
validateOmapCount(f, 1, rbdType, defaultRBDPool, volumesType) validateOmapCount(f, 1, rbdType, defaultRBDPool, volumesType)
// create namespace for reattach PVC, deletion will be taken care by framework // 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 { if err != nil {
framework.Failf("failed to create namespace: %v", err) framework.Failf("failed to create namespace: %v", err)
} }

View File

@ -125,7 +125,7 @@ var _ = Describe("CephFS Upgrade Testing", func() {
logsCSIPods("app=csi-cephfsplugin", c) logsCSIPods("app=csi-cephfsplugin", c)
// log all details from the namespace where Ceph-CSI is deployed // log all details from the namespace where Ceph-CSI is deployed
e2edebug.DumpAllNamespaceInfo(c, cephCSINamespace) e2edebug.DumpAllNamespaceInfo(context.TODO(), c, cephCSINamespace)
} }
err = deleteConfigMap(cephFSDirPath) err = deleteConfigMap(cephFSDirPath)
if err != nil { if err != nil {

View File

@ -130,7 +130,7 @@ var _ = Describe("RBD Upgrade Testing", func() {
logsCSIPods("app=csi-rbdplugin", c) logsCSIPods("app=csi-rbdplugin", c)
// log all details from the namespace where Ceph-CSI is deployed // log all details from the namespace where Ceph-CSI is deployed
e2edebug.DumpAllNamespaceInfo(c, cephCSINamespace) e2edebug.DumpAllNamespaceInfo(context.TODO(), c, cephCSINamespace)
} }
err := deleteConfigMap(rbdDirPath) err := deleteConfigMap(rbdDirPath)