Skip to content

v0.1.0-alpha.8

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 31 Oct 03:29
· 227 commits to main since this release
Immutable release. Only release title and notes can be modified.

Added

  • Each command now records a usage event in the telemetry directory of your config directory, on by default. An event holds the command's name and the names of the flags you typed, never their values, plus details such as the outcome, the exit code, the OS and the CLI version. --help, --version, completion and the telemetry commands record nothing. Nothing is recorded until your config directory exists. rancher auth login, for example, creates it. Events stay on your machine. To stop recording and delete what is recorded, run rancher telemetry off. To stop without deleting, set RANCHER_CLI_TELEMETRY=false.
  • Usage events now record the version, edition and install id of the Rancher server a command reached. After a command gets a response from Rancher, the CLI asks that server for its version and edition, with no token. Usage events of the commands you run later include the server's version and edition. With recording off, the CLI sends none of these requests.
  • Some commands also read Rancher's install-uuid setting, for the install id in usage events. These include access clusters, access projects, inspect cluster, auth status, auth login, and any command that names a cluster other than local with --cluster or a project by name with --project. auth login does not read it for a token you pasted with --no-verify. With recording on, the first auth login creates the config directory but records no usage event. It saves the server's version and edition, and the install id when it got one, under telemetry instead.
  • The kubectl plugin now reads Rancher's install-uuid setting when it creates a credential, for the install id in usage events. It uses the token you signed in with, or your stored login. When kubectl gets a cached credential, the plugin sends nothing. During a sign-in, the plugin also asks for the version and edition, and kubectl can wait up to 2 seconds longer. With recording on, the first plugin call that creates your config directory records no usage event. It saves the server's version and edition, and the install id when it got one.
  • Asking a server for its version, edition and install id can delay a command's exit by up to 2 seconds. The requests run after the command prints its output. After the server returns a value, the CLI asks it again in 24 hours. After a 403 or 404 it waits 6 hours. After any other failure it waits an hour.
  • New rancher telemetry commands turn recording on or off and show or delete the recorded usage events. status shows whether recording is on and what decides it: the RANCHER_CLI_TELEMETRY variable, the telemetry key in config.yaml, or the default. show lists the events, and show -o json prints every field. on sets the key to true. off sets it to false and deletes everything recorded. reset also deletes everything recorded, but keeps the key. A true or false in the variable overrides the key. config edit refuses an edit that turns recording on or off.
  • Each release now includes rancher-schema.json, the schema manifest of that build. It is the output of rancher schema --all -o json and lists every command and flag, the names a usage event can carry. It is listed in SHA256SUMS and has a build attestation like the binaries.
  • Requests the CLI sends to Rancher now carry a User-Agent that names the CLI, its version and how it was started. The value is cli.rancher.io/<version> (<os>/<arch>), plus exec-plugin when kubectl runs the CLI as its credential plugin, agent=<name> inside a recognized AI coding assistant's session, and ci in a CI run. When Rancher's audit log is on at level 1 or higher, it records the value.

Changed

  • The description of each token the CLI creates now starts with cli.rancher.io login @ <host>, where <host> is your machine's name. Before, it started with rancher-cli. Tokens created earlier keep their old description.
  • Every create, update and patch the CLI sends to a Kubernetes API now names cli.rancher.io as its field manager. Before, the token create behind a login or a kubectl plugin sign-in, and the access review requests, sent none. An object's managed fields (kubectl get <kind> <name> -o yaml --show-managed-fields) name the CLI for the fields it wrote. An ext Token still lists rancher as its manager, because Rancher's token API does not keep the request's field manager.
  • get <kind> <name> now waits when you give --for or --timeout on their own, as it does with --wait. Before, either flag without --wait failed with VALIDATION (exit 2). --timeout alone waits for the kind's default wait condition, and a kind with none refuses it and asks for --for. --wait=false together with --for or --timeout is refused.
  • An error that lists only the first 10 candidates now says how many there were. Before, nothing showed that the list was cut short. grant, revoke, inspect user, --as on the access commands and rancher schema <name> show candidates (10 of 37): ..., and the JSON error carries candidatesTotal with the size of the full list.
  • The display name column of get cluster, get project, get user, get roletemplate, get nodedriver and get cloud-credential is now headed DISPLAY NAME. Before, it read DISPLAY, or DISPLAYNAME for node drivers. get oidcclient now heads its expiry columns TOKEN-EXPIRATION and REFRESH-EXPIRATION, where it read TOKEN-TTL and REFRESH-TTL. The -o json output is unchanged.
  • The help of the generated get, patch and delete commands and several error messages now use plainer words. For each kind that has no delete, rancher schema now gives a reason that fits that kind. create resource with a management token manifest now says cannot create a management-token from a manifest and points to rancher create token.
  • create cluster now warns creatorId annotation not set when it cannot set the creatorId annotation. Before, the warning read creatorId not stamped. The help of create cluster and create machine-config now uses plainer words, and says that --apply stops when the server rejects the dry-run.
  • When a value is the id of one object and the display name of others, the warning now says which one the command uses. It uses the object with that id, and the warning says how to pick one of the others. This applies to --cloud-credential and to cluster and project names.
  • REFERENCE.md's sections on kinds, verbs and commands that combine several steps now use plain words. They also correct what happens when you delete several kinds, and use the column headers the CLI now prints.
  • README.md now uses plain words and states three facts correctly. It now says that the kubectl plugin asks you to log in to each cluster only when no rancher auth login credential is stored. It also says that delete exists only for kinds that can be deleted, and that most commands, not all, list a contract and a stability level in rancher schema.
  • The messages of create resource, get, patch, delete project and get --wait now use plainer words. For example, patch errors say patch operation instead of patch op, and an internal fault starts with internal error: instead of command bug:. Error codes and exit codes are unchanged.
  • The global flags, the skill commands, the completion scripts and several error messages now use plainer words. For example, the -o help says name prints the NAME column, the --read-only help says it applies to the run, and skill messages say what rancher-cli did or did not install. Error codes and exit codes are unchanged.
  • The cluster autoscaling and scale commands, get kubernetes-versions and the cluster registration token commands now use plainer words in their help and messages. Some texts were wrong and are fixed: delete provisioning-cluster local now gives the actual reason it refuses, and the etcd note in a patch provisioning-cluster preview now says that removing members can lose quorum, not that it always does.
  • The install scripts and the bug report form now use plainer words in their messages and fields. Before, install.sh printed (HTTP error) when its request for the release metadata got no HTTP status. It now prints no HTTP status in that case. The flags, exit codes and environment variables of both scripts are unchanged.
  • inspect, images, logs, usage and support-bundle now use plainer words in their help, text output and messages. The help of logs --container now says that without it the command reads the containers and init containers of each pod. Before, it said the main container. Error codes and JSON field names are unchanged.
  • create token, create kubeconfig, create user and create password-change-request now use plainer words in their help and messages. For example, the create token --ttl help now says token expiration. Error codes and exit codes are unchanged.
  • The command group titles, the global flag help and the usage errors now use plainer words. For example, rancher --help lists Auth commands instead of Auth operations, and a bad value for a bool flag before the command, as in rancher --debug=maybe, says the value must be true or false instead of parse error. Error codes and exit codes are unchanged.
  • The messages every command shares now use plainer words. For example, a dry-run preview in text output ends with dry-run preview - re-run with --apply to apply the change instead of dry run - re-run with --apply to execute. For a destructive change it says re-run with --apply --yes instead. Error codes and exit codes are unchanged.
  • When you give an unknown flag with no command, or with a command that takes a secret, the error now names its position. For example, rancher --bogus prints unknown flag at argument 1 after rancher. Before, the error quoted the flag as typed. On every other command the error still quotes it, for example rancher get --bogus pods.
  • --dry-run of every create command now lists the fields the command will set. Before, a create preview showed only the kind and the name, so create namespace n1 --project web --dry-run looked the same as without --project. Each field is an entry of data.diff with from null; secret values, such as a Secret's data or a password, show <redacted>.
  • When a hidden field has no value before the patch, or none after it, the preview now shows null for the empty side, not <redacted>. Before, adding or removing a Secret key showed <redacted> on both sides. In the text preview a map or list value now prints as JSON.
  • get -o json, -o yaml and -o template= now leave out the values a dry-run preview hides. Before, get still showed a machine config's password and key fields, and a hidden field written in another letter case. For kinds with hidden fields, get also leaves out the kubectl.kubernetes.io/last-applied-configuration annotation. get secret still shows data and stringData. To read a value the server returns, use kubectl with a kubeconfig from rancher create kubeconfig.
  • grant --role <TAB> at project and cluster scope no longer offers role templates that are locked. Before, it offered them, and Rancher refuses a new binding to a locked role template. revoke --role <TAB> still offers them: an existing binding to a locked role template can still be removed.
  • Shell completion no longer sends a --cluster value that matches no listed cluster to the server. Before, after reading the cluster list, completion asked the server for a cluster with that id. Completion now compares the value only with the ids and display names in the cluster list, and suggests nothing when none match. A value that is local or starts with c- is still used as a cluster id. Commands and the kubectl plugin still look up an unlisted cluster by id.

Security

  • Text output and the messages on stderr now remove control characters and escape sequences from server text. Before, some server values reached the terminal as they were, and an escape sequence in a value could move the cursor or change what the terminal showed. A line break inside a server value is still kept in the text of commands that print several sections, such as inspect. -o json, -o yaml, -o template=, rancher logs, completion and the output of kubeconfig and create kubeconfig still show server text as it is.
  • A token or client secret shown only once now prints in Go's quoted form when it holds a character a terminal cannot show. The line then says (quoted, it holds characters a terminal cannot show). This covers create token, create oidc-client, oidc-client add-secret and oidc-client rotate-secret. -o json and -o yaml print the value unchanged.
  • Error messages of commands that take a secret no longer show what you typed. Before, a mistake could print the secret: a --from-literal pair with no =, a value create resource -f could not read, an extra argument, or a flag given without a value, so that the next word was read as its value. This covers auth get-token, token, create secret, create resource, every patch, create machine-config, create user, create password-change-request, auth login, config add-server and config update-server. Their errors now name the flag or the word's position instead.
  • A server URL with a user name or password in it is now refused, and no message shows any part of it. Before, the password could appear in error messages and in config list-servers and logout output, and the kubectl plugin sent it to Rancher in a Basic auth header when it signed in. The check covers --server, --url, RANCHER_CLI_URL, a server entry saved in the config, and the kubectl plugin whether or not it has a cached credential; most commands fail with VALIDATION (exit 2).
  • rancher config update-server <name> --url <url> now fixes a saved server entry whose URL contains a user name or password. When the new URL differs only by dropping the user name and password, you stay logged in. config list-servers, auth logout and config delete-server keep working on such an entry and show its URL as scheme://host.
  • auth get-token and token no longer print the value you gave when they reject it. This covers an invalid --user-id or --auth-provider, a CA file that cannot be read, and an unknown credential store. auth login, config add-server and config update-server also never print the value in CA file and credential store errors. Their errors say which flag, environment variable or config setting was wrong.
  • From this release on, published releases are immutable: GitHub does not allow changes to their files or their tag. Earlier releases are not immutable. To check that a file you downloaded matches the file attached to this release, run gh release verify-asset v0.1.0-alpha.8 <file> -R rancher/rancher-cli with gh 2.81 or newer.
  • Text from the server can no longer be mistaken for a command the CLI suggests. Before, if server text had the invisible character U+2063 before rancher, an error of auth get-token or kubeconfig could show it as a command the CLI suggested, with your config directory added. The CLI now marks the commands it suggests with a random value, new on each run, so it can tell them from server text.

Fixed

  • Commands suggested in errors, warnings, text output, and -o json or -o yaml data now include --config <dir> when you use a config directory other than the default. Before, only auth get-token and kubeconfig included it, and a suggested command you pasted ran against the default directory. Commands also include it when RANCHER_CLI_CONFIG_DIR or XDG_CONFIG_HOME sets a directory other than the default. Table and wide rows, -o name and -o template= output, rancher logs, the recovery commands a failed revoke lists, and errors in how you typed the command still print commands without --config.
  • get --wait now stops at once when a request fails with AUTH (exit 3) or TLS_TRUST (exit 10). Before, it retried every error except NOT_FOUND until --timeout ran out, then reported a timeout without saying why. get --wait still retries other errors, a 403 included, and its timeout message now includes the last error it got. create oidc-client and oidc-client add-secret, rotate-secret and remove-secret stop the same way on AUTH and TLS_TRUST while they wait.
  • The --apply result of a create or a patch no longer shows the secret values its dry-run preview hides. Before, create machine-config digitaloceanconfig --set sshKeyContents=... --apply -o json printed the key in data, and create resource -f or patch could print a machine config's secret fields or the kubectl last-applied annotation. The result now leaves those fields out of data in -o json, -o yaml and -o template, in any letter case, as the preview does.
  • create kubeconfig on Rancher older than 2.15 now says the server cannot use this login's token, not that you lack permission. Before, it failed with RBAC (exit 6) when the login used a token the CLI created. It now fails with CAPABILITY_UNSUPPORTED (exit 11), names the server's version, and says to use Rancher 2.15 or later or an API token. With a saved login, the hint is rancher auth login <name> --token-stdin.
  • inspect cluster and the support bundle's cluster.json now show the cluster's state, for example active. Before, the state was empty on every Rancher version. A script that reads data.cluster.state from rancher inspect cluster -o json now gets the state Rancher's /v1 API serves for the cluster.
  • A patch preview no longer shows a Secret's values inside the kubectl last-applied annotation. Before, a patch preview could print that annotation, which holds a copy of the applied Secret. Hiding values in a preview now works whatever the letter case of the field name.

Compatibility

  • After upgrading, the CLI cannot read the login credentials it stored in the OS keychain. The keychain service name changed from rancher-cli to cli.rancher.io. Until you log in again with rancher auth login <name>, commands fail with NOT_LOGGED_IN (exit 2). Before upgrading, you can run rancher auth logout --all with the old version in each config directory you use: it removes the old keychain entries and revokes the tokens the CLI created. After the upgrade, no command removes those entries.
  • After upgrading, the kubectl plugin asks for a new sign-in once its cached cluster tokens expire. Until then, kubectl keeps working. In a terminal, the plugin asks you to sign in. With no terminal, as in CI, kubectl fails with AUTH (exit 3); log in again there with rancher auth login <name> --token-stdin.
  • The Vault credential helper now stores credentials under the cli.rancher.io path by default. Before, the default RANCHER_VAULT_PATH was rancher-cli. To keep using existing entries, set RANCHER_VAULT_PATH=rancher-cli. Otherwise, add <mount>/data/cli.rancher.io/* and <mount>/metadata/cli.rancher.io/* to your Vault policy, then log in again; the old entries stay under rancher-cli until you delete them.
  • Commands that take a secret now refuse a flag value that is itself a flag in --name=value form. These include auth get-token, token, auth login and create secret. For example, auth get-token --cluster --user-id=u-abc12 now fails with VALIDATION (exit 2) and a message that names both flags. Before, --cluster took --user-id=u-abc12 as its value and the command failed later. To pass a value that starts with -, join it to its flag with =.
  • A server URL that does not parse, or has no scheme or host, now fails with VALIDATION (exit 2). This covers RANCHER_CLI_URL and saved server URLs, on every command that connects or signs in with them. Before, the exit code depended on the command: 1, 2 or 3.
  • delete, patch and get clusterregistrationtoken no longer accept --wait, --for and --timeout, which they never used. A command that passes one of them now fails with an unknown-flag error, VALIDATION (exit 2). Remove the flag from scripts that pass it.
  • When the request that creates the token a login stores fails before Rancher answers, the error now shows the request URL with ?fieldManager=cli.rancher.io. A script that matches that error text must allow the query in the URL.
  • The text tables of get cluster, get project, get user, get roletemplate, get nodedriver, get cloud-credential and get oidcclient have new column headers. The new DISPLAY NAME header contains a space. A script that splits the header line on spaces or matches the old names must read -o json instead.
  • The text tables of images and usage have new column headers. In images the count column is now CONTAINERS, not COUNT. The first column of usage is now named after the grouping you chose, NAMESPACE, PROJECT, NODE or NAMESPACE/POD, not SCOPE. Update any script that reads these tables by header, or read -o json, which is unchanged.
  • The create cluster warning about the creatorId annotation now starts with creatorId annotation not set. A script that matches creatorId not stamped must match the new text.
  • create kubeconfig on Rancher older than 2.15 now exits 11 (CAPABILITY_UNSUPPORTED) where it exited 6 (RBAC). A script that checks the exit code of this command must accept 11 for that case.
  • create resource -f now refuses an ext.cattle.io Token or Kubeconfig manifest. Before, with --apply it created the object and printed its token or kubeconfig in -o json, -o yaml or -o template output. It now fails with VALIDATION (exit 2) before any request and names the command to use. Use rancher create token or rancher create kubeconfig, which show the value once.
  • A script that reads a machine config's password or key fields, or a Secret's last-applied annotation, from get -o json or -o yaml no longer finds them. Read them with kubectl and a kubeconfig from rancher create kubeconfig.
  • In -o json and -o yaml output, a U+2063 character before the word rancher in server text is now kept. Before, the CLI removed it. A script that compares server text byte for byte may now see this invisible character.