cub serviceaccount rename
cub serviceaccount rename
Rename a serviceaccount
Synopsis
Rename a serviceaccount: change its slug. A display name that is the same as the slug changes with it; --display-name sets the display name instead.
A serviceaccount keeps its identity: everything that refers to it by ID keeps doing so. A where expression that names it by slug, such as "Slug = 'old-name'", stops matching it.
Its user is renamed with it. A credential keeps working, since it names the service account's user, not its name, but a script that names the service account by its old name no longer finds it.
--dry-run reports whether the rename would succeed without making it.
Examples:
# Rename a serviceaccount
cub serviceaccount rename my-serviceaccount my-new-serviceaccount
# Rename it and set its display name
cub serviceaccount rename my-serviceaccount my-new-serviceaccount --display-name "My new serviceaccount"
cub serviceaccount rename <serviceaccount> <new-slug> [flags]
Options
--display-name string display name to give the serviceaccount, instead of following the slug
--dry-run report what the command would write, and write nothing
-h, --help help for rename
-o, --output string Output format. One of: json, yaml, name, wide, mutations, jq=<expr>, yq=<expr>, custom-columns=<spec>
--quiet No default output.
Options inherited from parent commands
--context string The context to use for this command
--debug Debug output
SEE ALSO
- cub serviceaccount - Service account commands