Merge pull request #69279 from dtaniwaki/print-size-limit

Print SizeLimit of EmptyDir
pull/564/head
Kubernetes Prow Robot 2019-01-17 04:06:31 -08:00 committed by GitHub
commit 9cc39a5614
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -822,8 +822,16 @@ func printHostPathVolumeSource(hostPath *corev1.HostPathVolumeSource, w PrefixWr
} }
func printEmptyDirVolumeSource(emptyDir *corev1.EmptyDirVolumeSource, w PrefixWriter) { 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"+ 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) { func printGCEPersistentDiskVolumeSource(gce *corev1.GCEPersistentDiskVolumeSource, w PrefixWriter) {