Commit 84dc294a authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #52379 from dixudx/kubectl_describe_hostpathtype

Automatic merge from submit-queue (batch tested with PRs 50294, 50422, 51757, 52379, 52014). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.. print HostPathType for kubectl describe **What this PR does / why we need it**: Since #46597 has already added `HostPathType` for `HostPath`, we should print it when we describe it. **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: @thockin PTAL /assign @smarterclayton @liggitt @pwittrock **Release note**: ```release-note None ```
parents 8a638c6b f8211adf
...@@ -770,8 +770,14 @@ func describeVolumes(volumes []api.Volume, w PrefixWriter, space string) { ...@@ -770,8 +770,14 @@ func describeVolumes(volumes []api.Volume, w PrefixWriter, space string) {
} }
func printHostPathVolumeSource(hostPath *api.HostPathVolumeSource, w PrefixWriter) { 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"+ 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) { func printEmptyDirVolumeSource(emptyDir *api.EmptyDirVolumeSource, w PrefixWriter) {
......
...@@ -664,7 +664,7 @@ func TestPersistentVolumeDescriber(t *testing.T) { ...@@ -664,7 +664,7 @@ func TestPersistentVolumeDescriber(t *testing.T) {
ObjectMeta: metav1.ObjectMeta{Name: "bar"}, ObjectMeta: metav1.ObjectMeta{Name: "bar"},
Spec: api.PersistentVolumeSpec{ Spec: api.PersistentVolumeSpec{
PersistentVolumeSource: api.PersistentVolumeSource{ PersistentVolumeSource: api.PersistentVolumeSource{
HostPath: &api.HostPathVolumeSource{}, HostPath: &api.HostPathVolumeSource{Type: new(api.HostPathType)},
}, },
}, },
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment