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:
@@ -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 == "" {
|
||||
|
||||
Reference in New Issue
Block a user