feat: expose scheduler-k3s autoscaling-auth state for read-back

Align autoscaling-auth:report with annotations and labels reporting so export tools can recover configured trigger auth via flat JSON keys and info flags, while stdout stays secret-safe unless --include-metadata is used.

Closes #8800
This commit is contained in:
Jose Diaz-Gonzalez
2026-07-07 18:07:39 -04:00
parent 25b1356435
commit b2c4f61387
10 changed files with 605 additions and 37 deletions

View File

@@ -18,6 +18,7 @@ Additional commands:`
helpContent = `
scheduler-k3s:autoscaling-auth:set <app|--global> <trigger> [<--metadata key=value>...], Set or clear a scheduler-k3s autoscaling keda trigger authentication resource for an app
scheduler-k3s:autoscaling-auth:report [<app>|--global] [--format stdout|json] [--include-metadata], Displays a scheduler-k3s autoscaling auth report for one or more apps
scheduler-k3s:annotations:set <app|--global> <property> (<value>) [--process-type PROCESS_TYPE] <--resource-type RESOURCE_TYPE>, Set or clear an annotation for a given app/process-type/resource-type combination
scheduler-k3s:annotations:report [<app>|--global] [--format stdout|json] [--process-type PROCESS_TYPE] [--resource-type RESOURCE_TYPE], Displays a scheduler-k3s annotations report for one or more apps
scheduler-k3s:charts:report [<chart>] [--format stdout|json], Displays a scheduler-k3s chart override report

View File

@@ -66,14 +66,19 @@ func main() {
case "autoscaling-auth:report":
args := flag.NewFlagSet("scheduler-k3s:autoscaling-auth:report", flag.ExitOnError)
global := args.Bool("global", false, "--global: show the global report")
includeMetadata := args.Bool("include-metadata", false, "--include-metadata: include metadata in the report")
includeMetadata := args.Bool("include-metadata", false, "--include-metadata: include metadata keys and values in the report")
format := args.String("format", "stdout", "format: [ stdout | json ]")
args.Parse(os.Args[2:])
passthroughArgs, infoFlag, flagErr := scheduler_k3s.ExtractReportInfoFlag("--scheduler-k3s-autoscaling-auth.", os.Args[2:])
if flagErr != nil {
err = flagErr
break
}
args.Parse(passthroughArgs)
appName := args.Arg(0)
if *global {
appName = "--global"
}
err = scheduler_k3s.CommandAutoscalingAuthReport(appName, *format, *includeMetadata)
err = scheduler_k3s.CommandAutoscalingAuthReport(appName, *format, *includeMetadata, infoFlag)
case "charts:set":
args := flag.NewFlagSet("scheduler-k3s:charts:set", flag.ExitOnError)
args.Parse(os.Args[2:])