forked from toolshed/abra
@ -9,7 +9,7 @@ import (
|
||||
"coopcloud.tech/abra/pkg/autocomplete"
|
||||
"coopcloud.tech/abra/pkg/client"
|
||||
"coopcloud.tech/abra/pkg/log"
|
||||
stack "coopcloud.tech/abra/pkg/upstream/stack"
|
||||
"coopcloud.tech/abra/pkg/upstream/stack"
|
||||
"github.com/AlecAivazis/survey/v2"
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/spf13/cobra"
|
||||
@ -78,6 +78,22 @@ flag.`,
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
configs, err := client.GetConfigs(cl, context.Background(), app.Server, fs)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
configNames := client.GetConfigNames(configs)
|
||||
|
||||
if len(configNames) > 0 {
|
||||
if err := client.RemoveConfigs(cl, context.Background(), configNames, internal.Force); err != nil {
|
||||
log.Fatalf("removing configs failed: %s", err)
|
||||
}
|
||||
|
||||
log.Infof("%d config(s) removed successfully", len(configNames))
|
||||
} else {
|
||||
log.Info("no configs to remove")
|
||||
}
|
||||
|
||||
secretList, err := cl.SecretList(context.Background(), types.SecretListOptions{Filters: fs})
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
@ -120,7 +136,7 @@ flag.`,
|
||||
log.Fatalf("removing volumes failed: %s", err)
|
||||
}
|
||||
|
||||
log.Infof("%d volumes removed successfully", len(volumeNames))
|
||||
log.Infof("%d volume(s) removed successfully", len(volumeNames))
|
||||
} else {
|
||||
log.Info("no volumes to remove")
|
||||
}
|
||||
|
Reference in New Issue
Block a user