1
0
mirror of https://github.com/rancher/os.git synced 2025-09-09 10:40:30 +00:00

Get all services via ros service list --all

This commit is contained in:
Jason-ZW
2018-10-08 10:46:11 +08:00
committed by niusmallnan
parent 1e931c0345
commit 1ffab0c1e1

View File

@@ -72,6 +72,12 @@ func serviceSubCommands() []cli.Command {
{
Name: "list",
Usage: "list services and state",
Flags: []cli.Flag{
cli.BoolFlag{
Name: "all, a",
Usage: "list all services and state",
},
},
Action: list,
},
{
@@ -175,6 +181,12 @@ func list(c *cli.Context) error {
services := availableService(cfg)
if c.Bool("all") {
for service := range cfg.Rancher.Services {
fmt.Printf("enabled %s\n", service)
}
}
for _, service := range services {
if enabled, ok := clone[service]; ok {
delete(clone, service)