diff --git a/commands/describe.go b/commands/describe.go index 9094c140d..3e31330d4 100644 --- a/commands/describe.go +++ b/commands/describe.go @@ -96,6 +96,8 @@ func runDescribe(cmd *cobra.Command, args []string) error { EnvProcess: function.EnvProcess, URL: url, AsyncURL: asyncURL, + Labels: function.Labels, + Annotations: function.Annotations, } printFunctionDescription(funcDesc) @@ -119,5 +121,19 @@ func printFunctionDescription(funcDesc schema.FunctionDescription) { fmt.Fprintln(w, "Function process:\t "+funcDesc.EnvProcess) fmt.Fprintln(w, "URL:\t "+funcDesc.URL) fmt.Fprintln(w, "Async URL:\t "+funcDesc.AsyncURL) + + if funcDesc.Labels != nil { + fmt.Fprintf(w, "Labels:") + for key, value := range *funcDesc.Labels { + fmt.Fprintln(w, " \t "+key+" : "+value) + } + } + + if funcDesc.Annotations != nil { + fmt.Fprintf(w, "Annotations:") + for key, value := range *funcDesc.Annotations { + fmt.Fprintln(w, " \t "+key+" : "+value) + } + } w.Flush() } diff --git a/schema/describe.go b/schema/describe.go index 67920ea29..354b57ffc 100644 --- a/schema/describe.go +++ b/schema/describe.go @@ -14,4 +14,6 @@ type FunctionDescription struct { EnvProcess string URL string AsyncURL string + Labels *map[string]string + Annotations *map[string]string }