MCPcopy Create free account
hub / github.com/cloudnative-pg/cloudnative-pg / printPVCDiagnostics

Function printPVCDiagnostics

tests/utils/utils.go:186–205  ·  view source on GitHub ↗
(clusterInfo *tabby.Tabby, pvc *corev1.PersistentVolumeClaim)

Source from the content-addressed store, hash-verified

184}
185
186func printPVCDiagnostics(clusterInfo *tabby.Tabby, pvc *corev1.PersistentVolumeClaim) {
187 clusterInfo.AddLine("PVC name", pvc.Name)
188 clusterInfo.AddLine("PVC phase", pvc.Status.Phase)
189 if pvc.Spec.StorageClassName != nil {
190 clusterInfo.AddLine("PVC storage class", *pvc.Spec.StorageClassName)
191 }
192 if pvc.Spec.VolumeName != "" {
193 clusterInfo.AddLine("PVC volume", pvc.Spec.VolumeName)
194 }
195 if node, ok := pvc.Annotations["volume.kubernetes.io/selected-node"]; ok {
196 clusterInfo.AddLine("PVC selected node", node)
197 }
198 for _, cond := range pvc.Status.Conditions {
199 clusterInfo.AddLine(
200 fmt.Sprintf("PVC condition %s", cond.Type),
201 fmt.Sprintf("%s: %s", cond.Reason, cond.Message),
202 )
203 }
204 clusterInfo.AddLine("---", "---")
205}
206
207func printNamespaceEvents(clusterInfo *tabby.Tabby, eventList *eventsv1.EventList) {
208 if len(eventList.Items) == 0 {

Callers 1

PrintClusterResourcesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected