mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-17 07:39:22 +00:00
print HostPathType for kubectl describe
This commit is contained in:
parent
01a4a600ac
commit
f8211adf42
@ -770,8 +770,14 @@ func describeVolumes(volumes []api.Volume, w PrefixWriter, space string) {
|
||||
}
|
||||
|
||||
func printHostPathVolumeSource(hostPath *api.HostPathVolumeSource, w PrefixWriter) {
|
||||
hostPathType := "<none>"
|
||||
if hostPath.Type != nil {
|
||||
hostPathType = string(*hostPath.Type)
|
||||
}
|
||||
w.Write(LEVEL_2, "Type:\tHostPath (bare host directory volume)\n"+
|
||||
" Path:\t%v\n", hostPath.Path)
|
||||
" Path:\t%v\n"+
|
||||
" HostPathType:\t%v\n",
|
||||
hostPath.Path, hostPathType)
|
||||
}
|
||||
|
||||
func printEmptyDirVolumeSource(emptyDir *api.EmptyDirVolumeSource, w PrefixWriter) {
|
||||
|
@ -664,7 +664,7 @@ func TestPersistentVolumeDescriber(t *testing.T) {
|
||||
ObjectMeta: metav1.ObjectMeta{Name: "bar"},
|
||||
Spec: api.PersistentVolumeSpec{
|
||||
PersistentVolumeSource: api.PersistentVolumeSource{
|
||||
HostPath: &api.HostPathVolumeSource{},
|
||||
HostPath: &api.HostPathVolumeSource{Type: new(api.HostPathType)},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user