refactor: rename computed-* helpers, expose computed vector and network keys
Addresses review feedback on #8640. fn-archive-max-size, fn-archive-max-files, fn-git-deploy-branch, and fn-git-keep-git-dir are renamed with `computed` in the function name so the names match the resolved-with-default semantic they implement, and every caller is updated in lockstep. logs:report renames the misordered --logs-vector-global-image and --logs-vector-global-networks to --logs-global-vector-image and --logs-global-vector-networks, makes the global getters return the raw stored value, and adds --logs-computed-vector-image, --logs-computed-vector-networks, and --logs-computed-vector-sink. network:report --global gains the computed-* keys for attach-post-create, attach-post-deploy, initial-network, and tld so external tooling can read the resolved value at global scope. The --quiet flag is dropped from every :report --format json | jq invocation across the PR's bats files; the report's --format json output is the only stdout and the flag is redundant.
This commit is contained in:
@@ -22,23 +22,29 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
|
||||
flags = map[string]common.ReportFunc{
|
||||
"--logs-computed-app-label-alias": reportComputedAppLabelAlias,
|
||||
"--logs-computed-max-size": reportComputedMaxSize,
|
||||
"--logs-computed-vector-image": reportComputedVectorImage,
|
||||
"--logs-computed-vector-networks": reportComputedVectorNetworks,
|
||||
"--logs-computed-vector-sink": reportComputedVectorSink,
|
||||
"--logs-global-app-label-alias": reportGlobalAppLabelAlias,
|
||||
"--logs-global-max-size": reportGlobalMaxSize,
|
||||
"--logs-global-vector-image": reportGlobalVectorImage,
|
||||
"--logs-global-vector-networks": reportGlobalVectorNetworks,
|
||||
"--logs-global-vector-sink": reportGlobalVectorSink,
|
||||
"--logs-vector-global-image": reportVectorGlobalImage,
|
||||
"--logs-vector-global-networks": reportVectorGlobalNetworks,
|
||||
}
|
||||
} else {
|
||||
flags = map[string]common.ReportFunc{
|
||||
"--logs-app-label-alias": reportAppLabelAlias,
|
||||
"--logs-computed-app-label-alias": reportComputedAppLabelAlias,
|
||||
"--logs-computed-max-size": reportComputedMaxSize,
|
||||
"--logs-computed-vector-image": reportComputedVectorImage,
|
||||
"--logs-computed-vector-networks": reportComputedVectorNetworks,
|
||||
"--logs-computed-vector-sink": reportComputedVectorSink,
|
||||
"--logs-global-app-label-alias": reportGlobalAppLabelAlias,
|
||||
"--logs-global-max-size": reportGlobalMaxSize,
|
||||
"--logs-global-vector-image": reportGlobalVectorImage,
|
||||
"--logs-global-vector-networks": reportGlobalVectorNetworks,
|
||||
"--logs-global-vector-sink": reportGlobalVectorSink,
|
||||
"--logs-app-label-alias": reportAppLabelAlias,
|
||||
"--logs-max-size": reportMaxSize,
|
||||
"--logs-vector-global-image": reportVectorGlobalImage,
|
||||
"--logs-vector-global-networks": reportVectorGlobalNetworks,
|
||||
"--logs-vector-sink": reportVectorSink,
|
||||
}
|
||||
}
|
||||
@@ -90,14 +96,30 @@ func reportGlobalMaxSize(appName string) string {
|
||||
return common.PropertyGet("logs", "--global", "max-size")
|
||||
}
|
||||
|
||||
func reportVectorGlobalImage(appName string) string {
|
||||
func reportGlobalVectorImage(appName string) string {
|
||||
return common.PropertyGet("logs", "--global", "vector-image")
|
||||
}
|
||||
|
||||
func reportComputedVectorImage(appName string) string {
|
||||
return getComputedVectorImage()
|
||||
}
|
||||
|
||||
func reportVectorGlobalNetworks(appName string) string {
|
||||
func reportGlobalVectorNetworks(appName string) string {
|
||||
return common.PropertyGet("logs", "--global", "vector-networks")
|
||||
}
|
||||
|
||||
func reportComputedVectorNetworks(appName string) string {
|
||||
return reportGlobalVectorNetworks(appName)
|
||||
}
|
||||
|
||||
func reportComputedVectorSink(appName string) string {
|
||||
value := reportVectorSink(appName)
|
||||
if value == "" {
|
||||
value = reportGlobalVectorSink(appName)
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
func reportGlobalVectorSink(appName string) string {
|
||||
value := common.PropertyGet("logs", "--global", "vector-sink")
|
||||
if value == "" {
|
||||
|
||||
Reference in New Issue
Block a user