Skip to content

Commit

Permalink
Merge pull request #69279 from dtaniwaki/print-size-limit
Browse files Browse the repository at this point in the history
Print SizeLimit of EmptyDir
  • Loading branch information
k8s-ci-robot authored Jan 17, 2019
2 parents 54dc9db + deeb4c1 commit 9cc39a5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/kubectl/describe/versioned/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -822,8 +822,16 @@ func printHostPathVolumeSource(hostPath *corev1.HostPathVolumeSource, w PrefixWr
}

func printEmptyDirVolumeSource(emptyDir *corev1.EmptyDirVolumeSource, w PrefixWriter) {
var sizeLimit string
if emptyDir.SizeLimit != nil && emptyDir.SizeLimit.Cmp(resource.Quantity{}) > 0 {
sizeLimit = fmt.Sprintf("%v", emptyDir.SizeLimit)
} else {
sizeLimit = "<unset>"
}
w.Write(LEVEL_2, "Type:\tEmptyDir (a temporary directory that shares a pod's lifetime)\n"+
" Medium:\t%v\n", emptyDir.Medium)
" Medium:\t%v\n"+
" SizeLimit:\t%v\n",
emptyDir.Medium, sizeLimit)
}

func printGCEPersistentDiskVolumeSource(gce *corev1.GCEPersistentDiskVolumeSource, w PrefixWriter) {
Expand Down

0 comments on commit 9cc39a5

Please sign in to comment.