Remove UID from CLI output (#1361)

This commit is contained in:
Ta-Ching Chen
2019-10-28 19:34:02 +08:00
committed by GitHub
parent bc5c181fc2
commit 52b5cb0902
3 changed files with 11 additions and 12 deletions
+3 -3
View File
@@ -49,9 +49,9 @@ func (opts *GetSubCommand) do(flags cli.Input) error {
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0) w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
fmt.Fprintf(w, "%v\t%v\t%v\n", "NAME", "UID", "IMAGE") fmt.Fprintf(w, "%v\t%v\n", "NAME", "IMAGE")
fmt.Fprintf(w, "%v\t%v\t%v\n", fmt.Fprintf(w, "%v\t%v\n",
env.Metadata.Name, env.Metadata.UID, env.Spec.Runtime.Image) env.Metadata.Name, env.Spec.Runtime.Image)
w.Flush() w.Flush()
return nil return nil
+3 -3
View File
@@ -45,10 +45,10 @@ func (opts *ListSubCommand) do(flags cli.Input) error {
util.CheckErr(err, "list environments") util.CheckErr(err, "list environments")
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0) w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
fmt.Fprintf(w, "%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\n", "NAME", "UID", "IMAGE", "BUILDER_IMAGE", "POOLSIZE", "MINCPU", "MAXCPU", "MINMEMORY", "MAXMEMORY", "EXTNET", "GRACETIME") fmt.Fprintf(w, "%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\n", "NAME", "IMAGE", "BUILDER_IMAGE", "POOLSIZE", "MINCPU", "MAXCPU", "MINMEMORY", "MAXMEMORY", "EXTNET", "GRACETIME")
for _, env := range envs { for _, env := range envs {
fmt.Fprintf(w, "%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\n", fmt.Fprintf(w, "%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\n",
env.Metadata.Name, env.Metadata.UID, env.Spec.Runtime.Image, env.Spec.Builder.Image, env.Spec.Poolsize, env.Metadata.Name, env.Spec.Runtime.Image, env.Spec.Builder.Image, env.Spec.Poolsize,
env.Spec.Resources.Requests.Cpu(), env.Spec.Resources.Limits.Cpu(), env.Spec.Resources.Requests.Cpu(), env.Spec.Resources.Limits.Cpu(),
env.Spec.Resources.Requests.Memory(), env.Spec.Resources.Limits.Memory(), env.Spec.Resources.Requests.Memory(), env.Spec.Resources.Limits.Memory(),
env.Spec.AllowAccessToExternalNetwork, env.Spec.TerminationGracePeriod) env.Spec.AllowAccessToExternalNetwork, env.Spec.TerminationGracePeriod)
+5 -6
View File
@@ -464,9 +464,8 @@ func fnGetMeta(c *cli.Context) error {
util.CheckErr(err, "get function") util.CheckErr(err, "get function")
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0) w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
fmt.Fprintf(w, "%v\t%v\t%v\n", "NAME", "UID", "ENV") fmt.Fprintf(w, "%v\t%v\n", "NAME", "ENV")
fmt.Fprintf(w, "%v\t%v\t%v\n", fmt.Fprintf(w, "%v\t%v\n", f.Metadata.Name, f.Spec.Environment.Name)
f.Metadata.Name, f.Metadata.UID, f.Spec.Environment.Name)
w.Flush() w.Flush()
return err return err
} }
@@ -707,12 +706,12 @@ func fnList(c *cli.Context) error {
w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0) w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', 0)
fmt.Fprintf(w, "%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\n", "NAME", "UID", "ENV", "EXECUTORTYPE", "MINSCALE", "MAXSCALE", "MINCPU", "MAXCPU", "MINMEMORY", "MAXMEMORY", "TARGETCPU") fmt.Fprintf(w, "%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\n", "NAME", "ENV", "EXECUTORTYPE", "MINSCALE", "MAXSCALE", "MINCPU", "MAXCPU", "MINMEMORY", "MAXMEMORY", "TARGETCPU")
for _, f := range fns { for _, f := range fns {
mincpu := f.Spec.Resources.Requests.Cpu mincpu := f.Spec.Resources.Requests.Cpu
mincpu().Value() mincpu().Value()
fmt.Fprintf(w, "%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\n", fmt.Fprintf(w, "%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\t%v\n",
f.Metadata.Name, f.Metadata.UID, f.Spec.Environment.Name, f.Metadata.Name, f.Spec.Environment.Name,
f.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType, f.Spec.InvokeStrategy.ExecutionStrategy.ExecutorType,
f.Spec.InvokeStrategy.ExecutionStrategy.MinScale, f.Spec.InvokeStrategy.ExecutionStrategy.MinScale,
f.Spec.InvokeStrategy.ExecutionStrategy.MaxScale, f.Spec.InvokeStrategy.ExecutionStrategy.MaxScale,