Add namespace column for docker stack ls command while targeting Kubernetes orchestrator
Signed-off-by: Silvin Lubecki <silvin.lubecki@docker.com>
This commit is contained in:
committed by
Mathieu Champlon
parent
31dccfffb5
commit
65526a201f
@ -16,12 +16,12 @@ func RunList(dockerCli *KubeCli, opts options.List) error {
|
||||
return err
|
||||
}
|
||||
format := opts.Format
|
||||
if len(format) == 0 {
|
||||
format = formatter.TableFormatKey
|
||||
if format == "" || format == formatter.TableFormatKey {
|
||||
format = formatter.KubernetesStackTableFormat
|
||||
}
|
||||
stackCtx := formatter.Context{
|
||||
Output: dockerCli.Out(),
|
||||
Format: formatter.NewStackFormat(format),
|
||||
Format: formatter.Format(format),
|
||||
}
|
||||
sort.Sort(byName(stacks))
|
||||
return formatter.StackWrite(stackCtx, stacks)
|
||||
@ -51,6 +51,7 @@ func getStacks(kubeCli *KubeCli) ([]*formatter.Stack, error) {
|
||||
Name: stack.name,
|
||||
Services: len(stack.getServices()),
|
||||
Orchestrator: "Kubernetes",
|
||||
Namespace: stack.namespace,
|
||||
})
|
||||
}
|
||||
return formattedStacks, nil
|
||||
|
||||
Reference in New Issue
Block a user