feat: expose whether a network was created by dokku

`network:list` and `network:info` now expose a `DokkuManaged` boolean derived from the `com.dokku.network-name` label that `network:create` applies, and `network:list` gains a `--dokku-managed` flag to restrict output to dokku-created networks. This lets tooling distinguish networks dokku created from Docker built-ins and networks created by other tooling such as compose.
This commit is contained in:
Jose Diaz-Gonzalez
2026-07-08 00:03:29 -04:00
parent 24e3809a34
commit ac4b86fd8e
6 changed files with 113 additions and 23 deletions

View File

@@ -22,7 +22,7 @@ Additional commands:`
network:destroy <network>, Destroys a docker network
network:exists <network>, Checks if a docker network exists
network:info <network> [--format text|json], Outputs information about a docker network
network:list [--format text|json], Lists all docker networks
network:list [--format text|json] [--dokku-managed], Lists all docker networks
network:rebuild <app>, Rebuilds network settings for an app
network:rebuildall, Rebuild network settings for all apps
network:report [<app>] [<flag>], Displays a network report for one or more apps

View File

@@ -43,8 +43,9 @@ func main() {
case "list":
args := flag.NewFlagSet("network:list", flag.ExitOnError)
format := args.String("format", "text", "format: [ text | json ]")
dokkuManaged := args.Bool("dokku-managed", false, "show only dokku-managed networks")
args.Parse(os.Args[2:])
err = network.CommandList(*format)
err = network.CommandList(*format, *dokkuManaged)
case "rebuild":
args := flag.NewFlagSet("network:rebuild", flag.ExitOnError)
args.Parse(os.Args[2:])