mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-21 13:50:20 +00:00
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:
parent
92d9785166
commit
e6627198d4
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
@ -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)
|
||||
}
|
||||
|
@ -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 {
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user