From 66bcfbd1edefac34b68de1c041bb3bdff261b23c Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 8 Aug 2026 01:43:40 -0400 Subject: [PATCH] fix: document --global on scheduler-k3s report and set The usage strings for `scheduler-k3s:report` and `scheduler-k3s:set` omitted the `--global` option, which is the only way to reach the scheduler-wide report since a bare `scheduler-k3s:report` iterates every app, and `:report` also omitted `--format stdout|json`. The command listing in the k3s documentation is resynced with the help output, which additionally restores flags that had been dropped from `scheduler-k3s:cluster:add`, `scheduler-k3s:cluster:list`, and `scheduler-k3s:initialize`. --- docs/deployment/schedulers/k3s.md | 50 +++++++++++++------ .../scheduler-k3s/src/commands/commands.go | 8 +-- tests/unit/scheduler-k3s-help.bats | 28 +++++++++++ 3 files changed, 68 insertions(+), 18 deletions(-) create mode 100644 tests/unit/scheduler-k3s-help.bats diff --git a/docs/deployment/schedulers/k3s.md b/docs/deployment/schedulers/k3s.md index 06bc6b0bb..9f03685fa 100644 --- a/docs/deployment/schedulers/k3s.md +++ b/docs/deployment/schedulers/k3s.md @@ -4,29 +4,29 @@ > New as of 0.33.0 ``` -scheduler-k3s:annotations:set () [--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:set () [--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 [|--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:autoscaling-auth:set [<--metadata key=value>...], Set or clear a scheduler-k3s autoscaling keda trigger authentication resource for an app +scheduler-k3s:autoscaling-auth:set [<--metadata key=value>...] # Set or clear a scheduler-k3s autoscaling keda trigger authentication resource for an app scheduler-k3s:autoscaling-auth:report [|--global] [--format stdout|json] [--include-metadata] # Displays a scheduler-k3s autoscaling auth report for one or more apps scheduler-k3s:charts:report [] [--format stdout|json] # Displays a scheduler-k3s chart override report scheduler-k3s:charts:set () # Set or clear a chart-specific helm value -scheduler-k3s:cluster:add [ssh://user@host:port] # Adds a server node to a Dokku-managed cluster -scheduler-k3s:cluster:list # Lists all nodes in a Dokku-managed cluster -scheduler-k3s:cluster:remove [node-id] # Removes client node to a Dokku-managed cluster -scheduler-k3s:ensure-charts # Ensures the k3s charts are installed -scheduler-k3s:initialize # Initializes a cluster +scheduler-k3s:cluster:add [--profile PROFILE] [--role ROLE] [--insecure-allow-unknown-hosts] [--server-ip SERVER_IP] [--taint-scheduling] [--kubelet-args KUBELET_ARGS] # Adds a server node to a Dokku-managed cluster +scheduler-k3s:cluster:list [--format json|stdout] # Lists all nodes in a Dokku-managed cluster +scheduler-k3s:cluster:remove [node-id] # Removes client node to a Dokku-managed cluster +scheduler-k3s:ensure-charts # Ensures the k3s charts are installed +scheduler-k3s:initialize [--server-ip SERVER_IP] [--taint-scheduling] [--kubelet-args KUBELET_ARGS] # Initializes a cluster scheduler-k3s:labels:set () [--process-type PROCESS_TYPE] <--resource-type RESOURCE_TYPE> # Set or clear a label for a given app/process-type/resource-type combination scheduler-k3s:labels:report [|--global] [--format stdout|json] [--process-type PROCESS_TYPE] [--resource-type RESOURCE_TYPE] # Displays a scheduler-k3s labels report for one or more apps scheduler-k3s:node-sysctls:set () [--global|--profile PROFILE] # Set or clear a node-level kernel sysctl for unprofiled nodes or a single node profile scheduler-k3s:node-sysctls:report [--format stdout|json] # Displays the node-level kernel sysctls applied to each scope scheduler-k3s:preview [--context N] [--show-secrets] [--show-secrets-decoded] # Displays a diff between the current and next deployment for an app -scheduler-k3s:profiles:add [--role ROLE] [--insecure-allow-unknown-hosts] [--taint-scheduling] [--kubelet-args KUBELET_ARGS] Adds a node profile to the k3s cluster -scheduler-k3s:profiles:list [--format json|stdout] # Lists all node profiles in the k3s cluster -scheduler-k3s:profiles:remove # Removes a node profile from the k3s cluster -scheduler-k3s:report [] [] # Displays a scheduler-k3s report for one or more apps -scheduler-k3s:set [|--global] () # Set or clear a scheduler-k3s property for an app or the scheduler -scheduler-k3s:show-kubeconfig # Displays the kubeconfig for remote usage -scheduler-k3s:uninstall # Uninstalls k3s from the Dokku server +scheduler-k3s:profiles:add [--role ROLE] [--insecure-allow-unknown-hosts] [--taint-scheduling] [--kubelet-args KUBELET_ARGS] # Adds a node profile to the k3s cluster +scheduler-k3s:profiles:list [--format json|stdout] # Lists all node profiles in the k3s cluster +scheduler-k3s:profiles:remove # Removes a node profile from the k3s cluster +scheduler-k3s:report [|--global] [--format stdout|json] [] # Displays a scheduler-k3s report for one or more apps +scheduler-k3s:set () # Set or clear a scheduler-k3s property for an app or globally +scheduler-k3s:show-kubeconfig # Displays the kubeconfig for remote usage +scheduler-k3s:uninstall # Uninstalls k3s from the Dokku server ``` > [!NOTE] @@ -268,6 +268,28 @@ The global default value may be set by passing an empty value for the option. dokku scheduler-k3s:set --global deploy-timeout ``` +### Displaying the scheduler report + +Configured properties can be inspected with the `scheduler-k3s:report` command. Without arguments, it iterates every app. Passing an app name scopes the report to that app, while `--global` reports the scheduler-wide properties on their own: + +```shell +dokku scheduler-k3s:report +dokku scheduler-k3s:report node-js-app +dokku scheduler-k3s:report --global +``` + +The output can be emitted as JSON for programmatic consumption: + +```shell +dokku scheduler-k3s:report --global --format json +``` + +A single value can also be read directly by passing its report flag, as listed in the [settable properties](#settable-properties) table: + +```shell +dokku scheduler-k3s:report node-js-app --scheduler-k3s-computed-deploy-timeout +``` + ### Previewing deployment changes Before triggering a deploy, the `scheduler-k3s:preview` command can be used to display a unified diff between the manifests currently stored in the live Helm release for an app and the manifests that the next deploy would roll out: diff --git a/plugins/scheduler-k3s/src/commands/commands.go b/plugins/scheduler-k3s/src/commands/commands.go index f3cf658f2..8c7d33678 100644 --- a/plugins/scheduler-k3s/src/commands/commands.go +++ b/plugins/scheduler-k3s/src/commands/commands.go @@ -17,10 +17,10 @@ Manage scheduler-k3s settings for an app Additional commands:` helpContent = ` - scheduler-k3s:autoscaling-auth:set [<--metadata key=value>...], Set or clear a scheduler-k3s autoscaling keda trigger authentication resource for an app - scheduler-k3s:autoscaling-auth:report [|--global] [--format stdout|json] [--include-metadata], Displays a scheduler-k3s autoscaling auth report for one or more apps scheduler-k3s:annotations:set () [--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 [|--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:autoscaling-auth:set [<--metadata key=value>...], Set or clear a scheduler-k3s autoscaling keda trigger authentication resource for an app + scheduler-k3s:autoscaling-auth:report [|--global] [--format stdout|json] [--include-metadata], Displays a scheduler-k3s autoscaling auth report for one or more apps scheduler-k3s:charts:report [] [--format stdout|json], Displays a scheduler-k3s chart override report scheduler-k3s:charts:set (), Set or clear a chart-specific helm value scheduler-k3s:cluster:add [--profile PROFILE] [--role ROLE] [--insecure-allow-unknown-hosts] [--server-ip SERVER_IP] [--taint-scheduling] [--kubelet-args KUBELET_ARGS] , Adds a server node to a Dokku-managed cluster @@ -36,8 +36,8 @@ Additional commands:` scheduler-k3s:profiles:add [--role ROLE] [--insecure-allow-unknown-hosts] [--taint-scheduling] [--kubelet-args KUBELET_ARGS], Adds a node profile to the k3s cluster scheduler-k3s:profiles:list [--format json|stdout], Lists all node profiles in the k3s cluster scheduler-k3s:profiles:remove , Removes a node profile from the k3s cluster - scheduler-k3s:report [] [], Displays a scheduler-k3s report for one or more apps - scheduler-k3s:set (), Set or clear a scheduler-k3s property for an app + scheduler-k3s:report [|--global] [--format stdout|json] [], Displays a scheduler-k3s report for one or more apps + scheduler-k3s:set (), Set or clear a scheduler-k3s property for an app or globally scheduler-k3s:show-kubeconfig, Displays the kubeconfig for remote usage scheduler-k3s:uninstall, Uninstalls k3s from the Dokku server` ) diff --git a/tests/unit/scheduler-k3s-help.bats b/tests/unit/scheduler-k3s-help.bats new file mode 100644 index 000000000..af39e6b10 --- /dev/null +++ b/tests/unit/scheduler-k3s-help.bats @@ -0,0 +1,28 @@ +#!/usr/bin/env bats + +load test_helper + +setup() { + global_setup +} + +teardown() { + global_teardown +} + +@test "(scheduler-k3s) scheduler-k3s:help" { + run /bin/bash -c "dokku scheduler-k3s" + echo "output: $output" + echo "status: $status" + assert_output_contains "Manage scheduler-k3s settings for an app" + help_output="$output" + + run /bin/bash -c "dokku scheduler-k3s:help" + echo "output: $output" + echo "status: $status" + assert_output_contains "Manage scheduler-k3s settings for an app" + assert_output "$help_output" + + assert_output_contains "scheduler-k3s:report [|--global] [--format stdout|json] []" + assert_output_contains "scheduler-k3s:set ()" +}