Adding default StorageClass annotation printout for resource_printer

This commit is contained in:
Scott Creeley
2016-10-12 15:49:16 -04:00
parent f39e86c0a5
commit 86f1a94be5
16 changed files with 274 additions and 164 deletions

View File

@@ -41,6 +41,7 @@ import (
"k8s.io/kubernetes/pkg/apis/certificates"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/apis/storage"
storageutil "k8s.io/kubernetes/pkg/apis/storage/util"
clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset"
client "k8s.io/kubernetes/pkg/client/unversioned"
deploymentutil "k8s.io/kubernetes/pkg/controller/deployment/util"
@@ -734,6 +735,7 @@ func (d *PersistentVolumeDescriber) Describe(namespace, name string, describerSe
return tabbedString(func(out io.Writer) error {
fmt.Fprintf(out, "Name:\t%s\n", pv.Name)
printLabelsMultiline(out, "Labels", pv.Labels)
fmt.Fprintf(out, "StorageClass:\t%s\n", storageutil.GetStorageClassAnnotation(pv.ObjectMeta))
fmt.Fprintf(out, "Status:\t%s\n", pv.Status.Phase)
if pv.Spec.ClaimRef != nil {
fmt.Fprintf(out, "Claim:\t%s\n", pv.Spec.ClaimRef.Namespace+"/"+pv.Spec.ClaimRef.Name)
@@ -803,6 +805,7 @@ func (d *PersistentVolumeClaimDescriber) Describe(namespace, name string, descri
return tabbedString(func(out io.Writer) error {
fmt.Fprintf(out, "Name:\t%s\n", pvc.Name)
fmt.Fprintf(out, "Namespace:\t%s\n", pvc.Namespace)
fmt.Fprintf(out, "StorageClass:\t%s\n", storageutil.GetStorageClassAnnotation(pvc.ObjectMeta))
fmt.Fprintf(out, "Status:\t%v\n", pvc.Status.Phase)
fmt.Fprintf(out, "Volume:\t%s\n", pvc.Spec.VolumeName)
printLabelsMultiline(out, "Labels", pvc.Labels)
@@ -2365,6 +2368,7 @@ func (s *StorageClassDescriber) Describe(namespace, name string, describerSettin
}
return tabbedString(func(out io.Writer) error {
fmt.Fprintf(out, "Name:\t%s\n", sc.Name)
fmt.Fprintf(out, "IsDefaultClass:\t%s\n", storageutil.IsDefaultAnnotationText(sc.ObjectMeta))
fmt.Fprintf(out, "Annotations:\t%s\n", labels.FormatLabels(sc.Annotations))
fmt.Fprintf(out, "Provisioner:\t%s\n", sc.Provisioner)
fmt.Fprintf(out, "Parameters:\t%s\n", labels.FormatLabels(sc.Parameters))