Repository navigation
v0.1.0-alpha.8
Pre-release
Pre-release
·
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
telemetrydirectory 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,completionand thetelemetrycommands 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, runrancher telemetry off. To stop without deleting, setRANCHER_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-uuidsetting, for the install id in usage events. These includeaccess clusters,access projects,inspect cluster,auth status,auth login, and any command that names a cluster other thanlocalwith--clusteror a project by name with--project.auth logindoes not read it for a token you pasted with--no-verify. With recording on, the firstauth logincreates the config directory but records no usage event. It saves the server's version and edition, and the install id when it got one, undertelemetryinstead. - The kubectl plugin now reads Rancher's
install-uuidsetting 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 telemetrycommands turn recording on or off and show or delete the recorded usage events.statusshows whether recording is on and what decides it: theRANCHER_CLI_TELEMETRYvariable, thetelemetrykey in config.yaml, or the default.showlists the events, andshow -o jsonprints every field.onsets the key totrue.offsets it tofalseand deletes everything recorded.resetalso deletes everything recorded, but keeps the key. Atrueorfalsein the variable overrides the key.config editrefuses 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 ofrancher schema --all -o jsonand lists every command and flag, the names a usage event can carry. It is listed inSHA256SUMSand 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>), plusexec-pluginwhen kubectl runs the CLI as its credential plugin,agent=<name>inside a recognized AI coding assistant's session, andciin 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 withrancher-cli. Tokens created earlier keep their old description. - Every create, update and patch the CLI sends to a Kubernetes API now names
cli.rancher.ioas 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 listsrancheras its manager, because Rancher's token API does not keep the request's field manager. get <kind> <name>now waits when you give--foror--timeouton their own, as it does with--wait. Before, either flag without--waitfailed withVALIDATION(exit 2).--timeoutalone waits for the kind's default wait condition, and a kind with none refuses it and asks for--for.--wait=falsetogether with--foror--timeoutis 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,--ason theaccesscommands andrancher schema <name>showcandidates (10 of 37): ..., and the JSON error carriescandidatesTotalwith the size of the full list. - The display name column of
get cluster,get project,get user,get roletemplate,get nodedriverandget cloud-credentialis now headedDISPLAY NAME. Before, it readDISPLAY, orDISPLAYNAMEfor node drivers.get oidcclientnow heads its expiry columnsTOKEN-EXPIRATIONandREFRESH-EXPIRATION, where it readTOKEN-TTLandREFRESH-TTL. The-o jsonoutput is unchanged. - The help of the generated
get,patchanddeletecommands and several error messages now use plainer words. For each kind that has nodelete,rancher schemanow gives a reason that fits that kind.create resourcewith a management token manifest now sayscannot create a management-token from a manifestand points torancher create token. create clusternow warnscreatorId annotation not setwhen it cannot set the creatorId annotation. Before, the warning readcreatorId not stamped. The help ofcreate clusterandcreate machine-confignow uses plainer words, and says that--applystops 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-credentialand 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 logincredential is stored. It also says thatdeleteexists only for kinds that can be deleted, and that most commands, not all, list a contract and a stability level inrancher schema. - The messages of
create resource,get,patch,delete projectandget --waitnow use plainer words. For example,patcherrors saypatch operationinstead ofpatch op, and an internal fault starts withinternal error:instead ofcommand bug:. Error codes and exit codes are unchanged. - The global flags, the
skillcommands, the completion scripts and several error messages now use plainer words. For example, the-ohelp saysnameprints the NAME column, the--read-onlyhelp says it applies to the run, andskillmessages say what rancher-cli did or did not install. Error codes and exit codes are unchanged. - The
clusterautoscaling and scale commands,get kubernetes-versionsand the cluster registration token commands now use plainer words in their help and messages. Some texts were wrong and are fixed:delete provisioning-cluster localnow gives the actual reason it refuses, and the etcd note in apatch provisioning-clusterpreview 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.shprinted(HTTP error)when its request for the release metadata got no HTTP status. It now printsno HTTP statusin that case. The flags, exit codes and environment variables of both scripts are unchanged. inspect,images,logs,usageandsupport-bundlenow use plainer words in their help, text output and messages. The help oflogs --containernow 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 userandcreate password-change-requestnow use plainer words in their help and messages. For example, thecreate token --ttlhelp now saystoken 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 --helplistsAuth commandsinstead ofAuth operations, and a bad value for a bool flag before the command, as inrancher --debug=maybe, saysthe value must be true or falseinstead ofparse 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 changeinstead ofdry run - re-run with --apply to execute. For a destructive change it saysre-run with --apply --yesinstead. 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 --bogusprintsunknown flag at argument 1 after rancher. Before, the error quoted the flag as typed. On every other command the error still quotes it, for examplerancher get --bogus pods. --dry-runof every create command now lists the fields the command will set. Before, a create preview showed only the kind and the name, socreate namespace n1 --project web --dry-runlooked the same as without--project. Each field is an entry ofdata.diffwithfromnull; 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 yamland-o template=now leave out the values a dry-run preview hides. Before,getstill showed a machine config's password and key fields, and a hidden field written in another letter case. For kinds with hidden fields,getalso leaves out thekubectl.kubernetes.io/last-applied-configurationannotation.get secretstill showsdataandstringData. To read a value the server returns, use kubectl with a kubeconfig fromrancher 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
--clustervalue 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 islocalor starts withc-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 ofkubeconfigandcreate kubeconfigstill 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 coverscreate token,create oidc-client,oidc-client add-secretandoidc-client rotate-secret.-o jsonand-o yamlprint 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-literalpair with no=, a valuecreate resource -fcould not read, an extra argument, or a flag given without a value, so that the next word was read as its value. This coversauth get-token,token,create secret,create resource, everypatch,create machine-config,create user,create password-change-request,auth login,config add-serverandconfig 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-serversand 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 withVALIDATION(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 logoutandconfig delete-serverkeep working on such an entry and show its URL asscheme://host.auth get-tokenandtokenno longer print the value you gave when they reject it. This covers an invalid--user-idor--auth-provider, a CA file that cannot be read, and an unknown credential store.auth login,config add-serverandconfig update-serveralso 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-cliwith 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 ofauth get-tokenorkubeconfigcould 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 jsonor-o yamldata now include--config <dir>when you use a config directory other than the default. Before, onlyauth get-tokenandkubeconfigincluded it, and a suggested command you pasted ran against the default directory. Commands also include it whenRANCHER_CLI_CONFIG_DIRorXDG_CONFIG_HOMEsets a directory other than the default. Table and wide rows,-o nameand-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 --waitnow stops at once when a request fails withAUTH(exit 3) orTLS_TRUST(exit 10). Before, it retried every error exceptNOT_FOUNDuntil--timeoutran out, then reported a timeout without saying why.get --waitstill retries other errors, a 403 included, and its timeout message now includes the last error it got.create oidc-clientandoidc-client add-secret,rotate-secretandremove-secretstop the same way onAUTHandTLS_TRUSTwhile they wait.- The
--applyresult 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 jsonprinted the key indata, andcreate resource -forpatchcould print a machine config's secret fields or the kubectl last-applied annotation. The result now leaves those fields out ofdatain-o json,-o yamland-o template, in any letter case, as the preview does. create kubeconfigon Rancher older than 2.15 now says the server cannot use this login's token, not that you lack permission. Before, it failed withRBAC(exit 6) when the login used a token the CLI created. It now fails withCAPABILITY_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 israncher auth login <name> --token-stdin.inspect clusterand the support bundle'scluster.jsonnow show the cluster's state, for exampleactive. Before, the state was empty on every Rancher version. A script that readsdata.cluster.statefromrancher inspect cluster -o jsonnow gets the state Rancher's/v1API 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-clitocli.rancher.io. Until you log in again withrancher auth login <name>, commands fail withNOT_LOGGED_IN(exit 2). Before upgrading, you can runrancher auth logout --allwith 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 withrancher auth login <name> --token-stdin. - The Vault credential helper now stores credentials under the
cli.rancher.iopath by default. Before, the defaultRANCHER_VAULT_PATHwasrancher-cli. To keep using existing entries, setRANCHER_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 underrancher-cliuntil you delete them. - Commands that take a secret now refuse a flag value that is itself a flag in
--name=valueform. These includeauth get-token,token,auth loginandcreate secret. For example,auth get-token --cluster --user-id=u-abc12now fails withVALIDATION(exit 2) and a message that names both flags. Before,--clustertook--user-id=u-abc12as 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 coversRANCHER_CLI_URLand 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,patchandget clusterregistrationtokenno longer accept--wait,--forand--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-credentialandget oidcclienthave new column headers. The newDISPLAY NAMEheader contains a space. A script that splits the header line on spaces or matches the old names must read-o jsoninstead. - The text tables of
imagesandusagehave new column headers. Inimagesthe count column is nowCONTAINERS, notCOUNT. The first column ofusageis now named after the grouping you chose,NAMESPACE,PROJECT,NODEorNAMESPACE/POD, notSCOPE. Update any script that reads these tables by header, or read-o json, which is unchanged. - The
create clusterwarning about the creatorId annotation now starts withcreatorId annotation not set. A script that matchescreatorId not stampedmust match the new text. create kubeconfigon 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 -fnow refuses an ext.cattle.io Token or Kubeconfig manifest. Before, with--applyit created the object and printed its token or kubeconfig in-o json,-o yamlor-o templateoutput. It now fails withVALIDATION(exit 2) before any request and names the command to use. Userancher create tokenorrancher 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 jsonor-o yamlno longer finds them. Read them with kubectl and a kubeconfig fromrancher create kubeconfig. - In
-o jsonand-o yamloutput, a U+2063 character before the wordrancherin 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.