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:
@@ -20,24 +20,33 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
|
||||
if appName == "--global" {
|
||||
flags = map[string]common.ReportFunc{
|
||||
"--ps-computed-procfile-path": reportComputedProcfilePath,
|
||||
"--ps-computed-skip-deploy": reportComputedSkipDeploy,
|
||||
"--ps-computed-stop-timeout-seconds": reportComputedStopTimeoutSeconds,
|
||||
"--ps-global-procfile-path": reportGlobalProcfilePath,
|
||||
"--ps-global-skip-deploy": reportGlobalSkipDeploy,
|
||||
"--ps-global-stop-timeout-seconds": reportGlobalStopTimeoutSeconds,
|
||||
}
|
||||
} else {
|
||||
flags = map[string]common.ReportFunc{
|
||||
"--deployed": reportDeployed,
|
||||
"--processes": reportProcesses,
|
||||
"--ps-can-scale": reportCanScale,
|
||||
"--ps-restart-policy": reportRestartPolicy,
|
||||
"--ps-computed-procfile-path": reportComputedProcfilePath,
|
||||
"--ps-global-procfile-path": reportGlobalProcfilePath,
|
||||
"--ps-procfile-path": reportProcfilePath,
|
||||
"--restore": reportRestore,
|
||||
"--running": reportRunningState,
|
||||
"--ps-global-stop-timeout-seconds": reportGlobalStopTimeoutSeconds,
|
||||
"--ps-computed-stop-timeout-seconds": reportComputedStopTimeoutSeconds,
|
||||
"--ps-stop-timeout-seconds": reportStopTimeoutSeconds,
|
||||
"--deployed": reportDeployed,
|
||||
"--processes": reportProcesses,
|
||||
"--ps-can-scale": reportCanScale,
|
||||
"--ps-computed-dockerfile-start-cmd": reportComputedDockerfileStartCmd,
|
||||
"--ps-computed-procfile-path": reportComputedProcfilePath,
|
||||
"--ps-computed-skip-deploy": reportComputedSkipDeploy,
|
||||
"--ps-computed-start-cmd": reportComputedStartCmd,
|
||||
"--ps-computed-stop-timeout-seconds": reportComputedStopTimeoutSeconds,
|
||||
"--ps-dockerfile-start-cmd": reportDockerfileStartCmd,
|
||||
"--ps-global-procfile-path": reportGlobalProcfilePath,
|
||||
"--ps-global-skip-deploy": reportGlobalSkipDeploy,
|
||||
"--ps-global-stop-timeout-seconds": reportGlobalStopTimeoutSeconds,
|
||||
"--ps-procfile-path": reportProcfilePath,
|
||||
"--ps-restart-policy": reportRestartPolicy,
|
||||
"--ps-skip-deploy": reportSkipDeploy,
|
||||
"--ps-start-cmd": reportStartCmd,
|
||||
"--ps-stop-timeout-seconds": reportStopTimeoutSeconds,
|
||||
"--restore": reportRestore,
|
||||
"--running": reportRunningState,
|
||||
}
|
||||
|
||||
extraFlags := addStatusFlags(appName, infoFlag)
|
||||
@@ -99,6 +108,14 @@ func reportCanScale(appName string) string {
|
||||
return canScale
|
||||
}
|
||||
|
||||
func reportComputedDockerfileStartCmd(appName string) string {
|
||||
return reportDockerfileStartCmd(appName)
|
||||
}
|
||||
|
||||
func reportDockerfileStartCmd(appName string) string {
|
||||
return common.PropertyGet("ps", appName, "dockerfile-start-cmd")
|
||||
}
|
||||
|
||||
func reportComputedProcfilePath(appName string) string {
|
||||
value := reportProcfilePath(appName)
|
||||
if value == "" {
|
||||
@@ -150,6 +167,34 @@ func reportRestore(appName string) string {
|
||||
return common.PropertyGetDefault("ps", appName, "restore", "true")
|
||||
}
|
||||
|
||||
func reportComputedSkipDeploy(appName string) string {
|
||||
value := reportSkipDeploy(appName)
|
||||
if value == "" {
|
||||
value = reportGlobalSkipDeploy(appName)
|
||||
}
|
||||
if value == "" {
|
||||
value = "false"
|
||||
}
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
func reportGlobalSkipDeploy(appName string) string {
|
||||
return common.PropertyGet("ps", "--global", "skip-deploy")
|
||||
}
|
||||
|
||||
func reportSkipDeploy(appName string) string {
|
||||
return common.PropertyGet("ps", appName, "skip-deploy")
|
||||
}
|
||||
|
||||
func reportComputedStartCmd(appName string) string {
|
||||
return reportStartCmd(appName)
|
||||
}
|
||||
|
||||
func reportStartCmd(appName string) string {
|
||||
return common.PropertyGet("ps", appName, "start-cmd")
|
||||
}
|
||||
|
||||
func reportRunningState(appName string) string {
|
||||
return getRunningState(appName)
|
||||
}
|
||||
|
||||
@@ -332,11 +332,3 @@ func TriggerPsGetProperty(appName string, property string) error {
|
||||
fmt.Println(fn(appName))
|
||||
return nil
|
||||
}
|
||||
|
||||
func reportComputedSkipDeploy(appName string) string {
|
||||
value := common.PropertyGet("ps", appName, "skip-deploy")
|
||||
if value == "" {
|
||||
value = common.PropertyGet("ps", "--global", "skip-deploy")
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user