Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Commit

Permalink
Do not include UUID in get class|plan output (#1977)
Browse files Browse the repository at this point in the history
* Do not include UUID in get class|plan output

The --uuid flag is still there, but to save space and make room for
displaying broker + namespace, hide this ugly (mostly ignored) column.

* Remove unused functions
  • Loading branch information
carolynvs authored and MHBauer committed Apr 26, 2018
1 parent 3fbe0ed commit 7796611
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 43 deletions.
20 changes: 0 additions & 20 deletions cmd/svcat/output/class.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ limitations under the License.
package output

import (
"encoding/json"
"fmt"
"io"
"strings"

"github.com/ghodss/yaml"
"github.com/kubernetes-incubator/service-catalog/pkg/apis/servicecatalog/v1beta1"
)

Expand All @@ -38,34 +36,16 @@ func writeClassListTable(w io.Writer, classes []v1beta1.ClusterServiceClass) {
t.SetHeader([]string{
"Name",
"Description",
"UUID",
})
for _, class := range classes {
t.Append([]string{
class.Spec.ExternalName,
class.Spec.Description,
class.Name,
})
}
t.Render()
}

func writeClassListJSON(w io.Writer, classes []v1beta1.ClusterServiceClass) {
classList := v1beta1.ClusterServiceClassList{
Items: classes,
}
j, _ := json.MarshalIndent(classList, "", " ")
w.Write(j)
}

func writeClassListYAML(w io.Writer, classes []v1beta1.ClusterServiceClass) {
classList := v1beta1.ClusterServiceClassList{
Items: classes,
}
y, _ := yaml.Marshal(classList)
w.Write(y)
}

// WriteClassList prints a list of classes in the specified output format.
func WriteClassList(w io.Writer, outputFormat string, classes ...v1beta1.ClusterServiceClass) {
classList := v1beta1.ClusterServiceClassList{
Expand Down
4 changes: 2 additions & 2 deletions cmd/svcat/output/plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ func writePlanListTable(w io.Writer, plans []v1beta1.ClusterServicePlan, classNa
"Name",
"Class",
"Description",
"UUID"})
})
for _, plan := range plans {
t.Append([]string{
plan.Spec.ExternalName,
classNames[plan.Spec.ClusterServiceClassRef.Name],
plan.Spec.Description,
plan.Name})
})
}
t.Render()
}
Expand Down
6 changes: 3 additions & 3 deletions cmd/svcat/testdata/output/get-class.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NAME DESCRIPTION UUID
+-----------------------+-------------------------+--------------------------------------+
user-provided-service A user provided service 4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468
NAME DESCRIPTION
+-----------------------+-------------------------+
user-provided-service A user provided service
8 changes: 4 additions & 4 deletions cmd/svcat/testdata/output/get-classes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NAME DESCRIPTION UUID
+--------------------------+--------------------------+--------------------------------------+
user-provided-service A user provided service 4f6e6cf6-ffdd-425f-a2c7-3c9258ad2468
another-provided-service Another provided service f1a80068-e366-494e-92d6-a0782337945b
NAME DESCRIPTION
+--------------------------+--------------------------+
user-provided-service A user provided service
another-provided-service Another provided service
6 changes: 3 additions & 3 deletions cmd/svcat/testdata/output/get-plan.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
NAME CLASS DESCRIPTION UUID
+---------+-----------------------+-------------------------+--------------------------------------+
default user-provided-service Sample plan description 86064792-7ea2-467b-af93-ac9694d96d52
NAME CLASS DESCRIPTION
+---------+-----------------------+-------------------------+
default user-provided-service Sample plan description
8 changes: 4 additions & 4 deletions cmd/svcat/testdata/output/get-plans-by-class.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NAME CLASS DESCRIPTION UUID
+---------+-----------------------+-------------------------+--------------------------------------+
default user-provided-service Sample plan description 86064792-7ea2-467b-af93-ac9694d96d52
premium user-provided-service Premium plan cc0d7529-18e8-416d-8946-6f7456acd589
NAME CLASS DESCRIPTION
+---------+-----------------------+-------------------------+
default user-provided-service Sample plan description
premium user-provided-service Premium plan
14 changes: 7 additions & 7 deletions cmd/svcat/testdata/output/get-plans.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NAME CLASS DESCRIPTION UUID
+---------+--------------------------+--------------------------------+--------------------------------------+
default user-provided-service Sample plan description 86064792-7ea2-467b-af93-ac9694d96d52
premium user-provided-service Premium plan cc0d7529-18e8-416d-8946-6f7456acd589
default another-provided-service Another sample plan 25b9b299-b0b3-4e14-aa1a-242eeb788aca
description
premium another-provided-service Another premium plan c1dbdafe-f987-4d36-8c9b-2aaaff740d4a
NAME CLASS DESCRIPTION
+---------+--------------------------+--------------------------------+
default user-provided-service Sample plan description
premium user-provided-service Premium plan
default another-provided-service Another sample plan
description
premium another-provided-service Another premium plan

0 comments on commit 7796611

Please sign in to comment.