mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #82464 from cwdsuzhou/Sep/add_apigroup_to_datasource
Add apigroup to the data source of pvc description
This commit is contained in:
commit
bd62a85624
@ -1549,8 +1549,11 @@ func describePersistentVolumeClaim(pvc *corev1.PersistentVolumeClaim, events *co
|
||||
}
|
||||
if pvc.Spec.DataSource != nil {
|
||||
w.Write(LEVEL_0, "DataSource:\n")
|
||||
w.Write(LEVEL_1, "Name:\t%v\n", pvc.Spec.DataSource.Name)
|
||||
if pvc.Spec.DataSource.APIGroup != nil {
|
||||
w.Write(LEVEL_1, "APIGroup:\t%v\n", *pvc.Spec.DataSource.APIGroup)
|
||||
}
|
||||
w.Write(LEVEL_1, "Kind:\t%v\n", pvc.Spec.DataSource.Kind)
|
||||
w.Write(LEVEL_1, "Name:\t%v\n", pvc.Spec.DataSource.Name)
|
||||
}
|
||||
printPodsMultiline(w, "Mounted By", mountPods)
|
||||
|
||||
|
@ -1595,7 +1595,7 @@ func TestPersistentVolumeClaimDescriber(t *testing.T) {
|
||||
},
|
||||
Status: corev1.PersistentVolumeClaimStatus{},
|
||||
},
|
||||
expectedElements: []string{"\nDataSource:\n Name: srcpvc\n Kind: PersistentVolumeClaim"},
|
||||
expectedElements: []string{"\nDataSource:\n Kind: PersistentVolumeClaim\n Name: srcpvc"},
|
||||
},
|
||||
{
|
||||
name: "snapshot-datasource",
|
||||
@ -1615,7 +1615,7 @@ func TestPersistentVolumeClaimDescriber(t *testing.T) {
|
||||
},
|
||||
Status: corev1.PersistentVolumeClaimStatus{},
|
||||
},
|
||||
expectedElements: []string{"DataSource:\n Name: src-snapshot\n Kind: VolumeSnapshot\n"},
|
||||
expectedElements: []string{"DataSource:\n APIGroup: snapshot.storage.k8s.io\n Kind: VolumeSnapshot\n Name: src-snapshot\n"},
|
||||
},
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user