feat: add ability to set global properties
Not all properties can be set globally, and the "appName" in the global case is currently defaulted to `--global`. This is okay because domain label names cannot start with hyphens, and all app names must be valid domain label names.
This commit is contained in:
@@ -11,6 +11,9 @@ var (
|
||||
DefaultProperties = map[string]string{
|
||||
"vector-sink": "",
|
||||
}
|
||||
|
||||
// GlobalProperties is a map of all valid global logs properties
|
||||
GlobalProperties = map[string]bool{}
|
||||
)
|
||||
|
||||
const VectorImage = "timberio/vector:0.11.X-debian"
|
||||
|
||||
@@ -75,7 +75,7 @@ func CommandSet(appName string, property string, value string) error {
|
||||
}
|
||||
}
|
||||
|
||||
common.CommandPropertySet("logs", appName, property, value, DefaultProperties)
|
||||
common.CommandPropertySet("logs", appName, property, value, DefaultProperties, GlobalProperties)
|
||||
if property == "vector-sink" {
|
||||
common.LogVerboseQuiet(fmt.Sprintf("Writing updated vector config to %s", filepath.Join(common.MustGetEnv("DOKKU_LIB_ROOT"), "data", "logs", "vector.json")))
|
||||
return writeVectorConfig()
|
||||
|
||||
Reference in New Issue
Block a user