fix: expose remaining settable properties via :report

Adds the missing raw/global/computed report keys for ten settable properties across the ps, builder, scheduler, proxy, openresty, nginx, and scheduler-k3s plugins so external tooling can verify drift through `:report --format json`. The scheduler-k3s `token` is masked as `*******` in default stdout output and only unmasked when the report is requested via `--format json` or when the flag is queried explicitly by name; the same explicit-query unmasking rule is extended to the existing traefik `dns-provider-<env_var>` keys.
This commit is contained in:
Jose Diaz-Gonzalez
2026-05-27 04:26:12 -04:00
parent fd9e06d56b
commit 2b5d2e10ea
28 changed files with 734 additions and 50 deletions

View File

@@ -23,3 +23,50 @@ func getComputedProxyType(appName string) string {
func getGlobalProxyType() string {
return common.PropertyGet("proxy", "--global", "type")
}
func getAppProxyPort(appName string) string {
return common.PropertyGet("proxy", appName, "proxy-port")
}
func getGlobalProxyPort() string {
return common.PropertyGet("proxy", "--global", "proxy-port")
}
func getComputedProxyPort(appName string) string {
value := getAppProxyPort(appName)
if value == "" {
value = getGlobalProxyPort()
}
return value
}
func getAppProxySSLPort(appName string) string {
return common.PropertyGet("proxy", appName, "proxy-ssl-port")
}
func getGlobalProxySSLPort() string {
return common.PropertyGet("proxy", "--global", "proxy-ssl-port")
}
func getComputedProxySSLPort(appName string) string {
value := getAppProxySSLPort(appName)
if value == "" {
value = getGlobalProxySSLPort()
}
return value
}
func getAppDisabled(appName string) string {
return common.PropertyGet("proxy", appName, "disabled")
}
func getComputedDisabled(appName string) string {
value := getAppDisabled(appName)
if value == "" {
value = "false"
}
return value
}

View File

@@ -15,15 +15,27 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
var flags map[string]common.ReportFunc
if appName == "--global" {
flags = map[string]common.ReportFunc{
"--proxy-computed-type": reportComputedType,
"--proxy-global-type": reportGlobalType,
"--proxy-computed-proxy-port": reportComputedProxyPort,
"--proxy-computed-proxy-ssl-port": reportComputedProxySSLPort,
"--proxy-computed-type": reportComputedType,
"--proxy-global-proxy-port": reportGlobalProxyPort,
"--proxy-global-proxy-ssl-port": reportGlobalProxySSLPort,
"--proxy-global-type": reportGlobalType,
}
} else {
flags = map[string]common.ReportFunc{
"--proxy-enabled": reportEnabled,
"--proxy-computed-type": reportComputedType,
"--proxy-global-type": reportGlobalType,
"--proxy-type": reportType,
"--proxy-computed-disabled": reportComputedDisabled,
"--proxy-computed-proxy-port": reportComputedProxyPort,
"--proxy-computed-proxy-ssl-port": reportComputedProxySSLPort,
"--proxy-computed-type": reportComputedType,
"--proxy-disabled": reportDisabled,
"--proxy-enabled": reportEnabled,
"--proxy-global-proxy-port": reportGlobalProxyPort,
"--proxy-global-proxy-ssl-port": reportGlobalProxySSLPort,
"--proxy-global-type": reportGlobalType,
"--proxy-proxy-port": reportProxyPort,
"--proxy-proxy-ssl-port": reportProxySSLPort,
"--proxy-type": reportType,
}
}
@@ -58,3 +70,35 @@ func reportGlobalType(appName string) string {
func reportType(appName string) string {
return getAppProxyType(appName)
}
func reportDisabled(appName string) string {
return getAppDisabled(appName)
}
func reportComputedDisabled(appName string) string {
return getComputedDisabled(appName)
}
func reportProxyPort(appName string) string {
return getAppProxyPort(appName)
}
func reportGlobalProxyPort(appName string) string {
return getGlobalProxyPort()
}
func reportComputedProxyPort(appName string) string {
return getComputedProxyPort(appName)
}
func reportProxySSLPort(appName string) string {
return getAppProxySSLPort(appName)
}
func reportGlobalProxySSLPort(appName string) string {
return getGlobalProxySSLPort()
}
func reportComputedProxySSLPort(appName string) string {
return getComputedProxySSLPort(appName)
}