Skip to content

Commit f8af370

Browse files
committed
docs(cli): list valid --privilege values in service-account help
The --privilege flag is required and validated only server-side, so a typo (e.g. --privilege membr) failed with a round-trip error giving no hint of the accepted values. List them in the flag help, mirroring the --type flag's validEnvTypesList pattern: a single-source-of-truth constant (validServiceAccountPrivilegesList = "admin, member, snapshotter, reader") embedded as "One of: [...]". Shared by create and update service-account. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SWQ362qtJBoP3ncxRck9qu
1 parent 0b564fc commit f8af370

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cmd/kosli/root.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ The ^.kosli_ignore^ will be treated as part of the artifact like any other file,
9494
// the server is the authority on which types are actually accepted
9595
validEnvTypesList = "K8S, ECS, S3, lambda, server, docker, azure-apps, cloud-run, logical"
9696

97+
// single source of truth for the service account privilege list shown in
98+
// flag help texts; the server is the authority on which privileges are
99+
// actually accepted
100+
validServiceAccountPrivilegesList = "admin, member, snapshotter, reader"
101+
97102
// flags
98103
apiTokenFlag = "The Kosli API token."
99104
artifactName = "[optional] Artifact display name, if different from file, image or directory name."
@@ -121,7 +126,7 @@ The ^.kosli_ignore^ will be treated as part of the artifact like any other file,
121126
ignoreCaseFlag = "[optional] Perform case-insensitive matching for --name. By default matching is case sensitive."
122127
serviceAccountNameFlag = "The name of the service account whose API keys are managed."
123128
serviceAccountDescriptionFlag = "[optional] A description for the service account."
124-
serviceAccountPrivilegeFlag = "The privilege granted to the service account."
129+
serviceAccountPrivilegeFlag = "The privilege granted to the service account. One of: [" + validServiceAccountPrivilegesList + "]."
125130
serviceAccountAssumeYesFlag = "[optional] Skip the confirmation prompt and delete the service account without asking. (alias: --yes)"
126131
apiKeyDescriptionFlag = "A description for the API key."
127132
apiKeyExpiresAtFlag = "[optional] When the API key expires. Accepts an epoch timestamp or a date like '2026-06-04', '2026-06-04 15:04:05', or an RFC3339 timestamp. Defaults to no expiry."

0 commit comments

Comments
 (0)