Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ stackctl is a Go CLI tool (Cobra) for managing Kubernetes stack deployments. It
| `config` | set, get, list, use-context, current-context, delete-context | config.go |
| `login`/`logout`/`whoami` | top-level; supports password + OIDC loopback flow | login.go |
| `auth` | register | login.go |
| `stack` | list, get, create, update, deploy, stop, clean, delete, status, logs, clone, extend, values, compare, history, rollback, history-values, watch, preview, pods, recent, follow, unfollow | stack.go; preview/pods/recent: stack_inspect.go; follow/unfollow: stack_followers.go; TTL and stop-time helpers: ttl.go |
| `stack` | list, get, create, update, deploy, stop, clean, delete, status, logs, clone, extend, values, compare, history, rollback, history-values, watch, preview, pods, recent, follow, unfollow, action (list, run, log) | stack.go; preview/pods/recent: stack_inspect.go; follow/unfollow: stack_followers.go; action: stack_action.go; TTL and stop-time helpers: ttl.go |
| `template` | list, get, create, update, delete, clone, instantiate, quick-deploy, publish, unpublish, update-chart, versions (list, get, diff) | template.go |
| `definition` | list, get, create, update, delete, export, import, update-chart | definition.go |
| `override` | list, get, set, unset, delete, branch (list/set/delete), quota (get/set/delete) | override.go |
Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ cli/ # Go module root (github.com/omattsson/stackctl/cl
token.go # Token helpers (save/load/delete session, fresh token for plugins)
stack.go # stack list/get/create/update/deploy/stop/clean/delete/status/logs/clone/extend/values/compare/history/rollback/history-values/watch
stack_inspect.go # stack preview/pods/recent (deploy-preview, live pods and events, recent)
stack_action.go # stack action list/run/log (custom actions of the hooks config; job log polling with backoff)
stack_followers.go # stack follow/unfollow (in-app notifications; not the --follow log flag)
ttl.go # --ttl/--stop-at/--until parsing, TTL limit check (GET /api/v1/ui-config, 30-day fallback), expiry text
server.go # server info (ping, ui-config; public routes, no credentials)
Expand Down
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@ stackctl stack recent # your 5 most recently updated stacks
stackctl stack preview my-app
stackctl stack preview my-app --chart backend > backend-values.yaml

# Custom actions of the hooks config (for example a database refresh)
stackctl stack action list my-app
stackctl stack action run my-app refresh-db --param market=dk --yes --wait
stackctl stack action log my-app refresh-db <job-id> --follow

# Get the in-app notifications of a stack (not the --follow flag, which streams a log)
stackctl stack follow my-app
stackctl stack unfollow my-app
Expand Down Expand Up @@ -280,6 +285,22 @@ stackctl stack rollback my-app --target-log <log-id>

`stack get` shows `Following` and `Followers` (k8s-stack-manager v0.8.0 or later). `stack preview -q` prints the names of the charts whose values differ from the last deploy. `stack preview` writes the values-drift warning to stderr, so the YAML on stdout stays valid.

`stack action run`:

- Checks the declared parameters before the request: a `bool` takes `true` or `false`, an `enum` takes one of its options, and a required parameter needs a value.
- Gives a declared parameter without `--param` its default. Undeclared parameters go to the subscriber as strings.
- Asks for confirmation when the action has a confirmation text. `--yes` skips the question.
- Exits with code 1 when the subscriber answers with status 400 or higher.

`--wait` (and `stack action log --follow`) follows the job log of an asynchronous action:

- It writes the job ID to stderr first. The job continues on the server when the command stops.
- It polls every 3 s and prints the new log text.
- On 429, 502, 503, 504 and network errors it writes a note to stderr and waits longer: `Retry-After` (at most 5 minutes), else a doubling delay up to 30 s.
- It stops with exit code 1 on a failed final status (a status other than `succeeded`, `success`, `completed`, `done`, `ok` and similar), on other errors (for example 401, 403 or 404), and after `--timeout` (default 60m).
- With `-o json|yaml`, the log text goes to stderr and the result has `job_status`.
- In log text, a line feed and a tab stay. A carriage return and a bidi control are removed. Other control characters (for example ESC) become a space.

`stack update --name` must be a DNS label (lowercase a-z, 0-9 and `-`, at most 50 characters). The namespace does not change. When another stack on the cluster has the name, stackctl prints the server message and the free names, for example `Conflict: A stack named "my-app" already exists on this cluster (owner: alice). Free names: my-app-2, my-app-3`. `stack create`, `clone` and `template quick-deploy` print the same message for a name conflict.

`--reset-ttl M` (deprecated) keeps the old behaviour: the TTL becomes M minutes and the expiry now + M minutes, which can be earlier. `--yes` has no effect and is accepted for older scripts.
Expand Down Expand Up @@ -652,7 +673,7 @@ cli/
cmd/ # Cobra commands, one file per command group
root.go resolve.go paging.go plugins.go browser.go token.go values.go
config.go login.go version.go completion.go server.go
stack.go stack_inspect.go stack_followers.go ttl.go
stack.go stack_inspect.go stack_followers.go stack_action.go ttl.go
template.go definition.go override.go bulk.go
cluster.go git.go orphaned.go user.go apikey.go audit.go
analytics.go cleanup_policy.go favorite.go notification.go
Expand Down
Loading
Loading