feat: attach vector container to additional docker networks

Adds a new global `vector-networks` property on the logs plugin that takes a comma-separated list of Docker networks. When set, the rendered compose file declares each network plus `bridge` as external and joins them on the vector service, so `docker compose up` reconciles attachments on every `logs:vector-start`. When unset, the existing `network_mode: bridge` template is preserved unchanged. The value is validated against `docker network inspect` at set time, rejects the reserved `bridge` entry, and is surfaced in `dokku logs:report` via `--logs-vector-global-networks`.
This commit is contained in:
Jose Diaz-Gonzalez
2026-05-12 22:05:50 -04:00
parent b096d0f131
commit d00a7d741a
7 changed files with 262 additions and 10 deletions

View File

@@ -24,6 +24,7 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
"--logs-global-max-size": reportGlobalMaxSize,
"--logs-global-vector-sink": reportGlobalVectorSink,
"--logs-vector-global-image": reportVectorGlobalImage,
"--logs-vector-global-networks": reportVectorGlobalNetworks,
}
} else {
flags = map[string]common.ReportFunc{
@@ -35,6 +36,7 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
"--logs-app-label-alias": reportAppLabelAlias,
"--logs-max-size": reportMaxSize,
"--logs-vector-global-image": reportVectorGlobalImage,
"--logs-vector-global-networks": reportVectorGlobalNetworks,
"--logs-vector-sink": reportVectorSink,
}
}
@@ -84,6 +86,10 @@ func reportVectorGlobalImage(appName string) string {
return getComputedVectorImage()
}
func reportVectorGlobalNetworks(appName string) string {
return common.PropertyGet("logs", "--global", "vector-networks")
}
func reportGlobalVectorSink(appName string) string {
value := common.PropertyGet("logs", "--global", "vector-sink")
if value == "" {