mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
ci: log pvc events
incase if the pvc is not bound yet, log the pvc events to check what is happening. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
5c621d2e82
commit
744b8e1c1c
13
e2e/pvc.go
13
e2e/pvc.go
@ -75,6 +75,19 @@ func createPVCAndvalidatePV(c kubernetes.Interface, pvc *v1.PersistentVolumeClai
|
|||||||
}
|
}
|
||||||
|
|
||||||
if pvc.Spec.VolumeName == "" {
|
if pvc.Spec.VolumeName == "" {
|
||||||
|
var events *v1.EventList
|
||||||
|
// Log the events for the PVC if its not bound yet
|
||||||
|
events, err = c.CoreV1().Events(namespace).List(ctx, metav1.ListOptions{
|
||||||
|
FieldSelector: "involvedObject.kind=PersistentVolumeClaim,involvedObject.name=" + name,
|
||||||
|
})
|
||||||
|
if err == nil {
|
||||||
|
for i := range events.Items {
|
||||||
|
framework.Logf("PVC %s Event: %s - %s", name, events.Items[i].Reason, events.Items[i].Message)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
framework.Logf("error getting events for PVC %s: %v", name, err)
|
||||||
|
}
|
||||||
|
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user