Skip to content

v0.1.0-alpha.7

Pre-release
Pre-release

Choose a tag to compare

@pmatseykanets pmatseykanets released this 21 Oct 21:42
Immutable release. Only release title and notes can be modified.

Added

  • auth get-token, the kubectl plugin, now accepts --user-id without --name, the form Rancher v2.16 (main, not yet released) writes into kubeconfigs. Rancher writes it only when its kubeconfig-exec-get-token setting is true and kubeconfig-generate-token is false, and adds --cluster only for a cluster with an authorized cluster endpoint. The plugin uses a saved login of that user for the server. Without --cluster, it creates a token that is not tied to one cluster, and kubectl reaches the cluster through Rancher. It gives kubectl a token only if Rancher says the token belongs to that user.
  • With --user-id, the kubectl plugin now returns a token to kubectl only if it was created through the auth config you named with --auth-provider. The value must be the auth config's exact name, such as corp-ldap; without --auth-provider, only the user is checked. A value that is no auth config's name, such as the provider type openLdapProvider, fails with NOT_FOUND (exit 4) when the plugin has to sign in. When the saved login was made through another auth config, the plugin revokes the token it just created and the call fails with AUTH (exit 3).
  • A login now records the auth config its token was created through. config info shows it as tokenAuthConfig, auth status as authConfig, and the auth login result as tokenAuthConfig. A pasted token, including an API key from the Rancher UI, or a login from an earlier release has no auth config recorded. The first kubectl call with --user-id and --auth-provider records it when the saved login has a user id; you do not need to log in again.
  • rancher kubeconfig now writes --auth-provider beside --user-id when the login records its auth config.
  • auth login now warns when you log in to a server entry as a different user than the one saved for it. The login still works; the warning shows the old and the new user id.
  • auth login now warns when you log in to a server entry through a different auth config than the one saved for it. The login still works; the warning shows the old and the new auth config. It says nothing when the earlier login has no auth config recorded.
  • patch <kind> accepts -p as the short form of --patch, as kubectl does.
  • patch <kind> --type merge applies an RFC 7386 JSON merge patch. The default is still --type json, an RFC 6902 JSON array. A merge patch replaces each list it contains in full, and the dry-run warns when a list loses entries the object has.
  • Tab completion for --auth-provider now suggests the names of the server's enabled auth configs that the CLI can sign in with. It works on auth login, auth get-token and rancher token, without sending your token.
  • rancher delete project --delete-namespaces deletes every namespace in the project, even ones moved into it, then the project. Each namespace to be deleted is checked with a dry-run first, and nothing is deleted when one is refused. default, kube-system and kube-public, and local and fleet-local on the local cluster, are never deleted.
  • rancher get and rancher patch now complete role template and global role ids. Hidden and locked ones are offered too.

Changed

  • The CLI is now built against the Kubernetes 1.37 client libraries, the version Rancher v2.16 (main, not yet released) uses. Commands and output are unchanged.
  • With token reuse on (rancher config set-token-reuse on), a call with --user-id now saves one server entry for each server and user, named exec-login-<host>-<user id>. With --auth-provider there is one for each auth config too, and its name also ends in the auth config. The plugin never writes a login over an entry that holds another user's login or a login through another auth config.
  • With token reuse on, a kubectl call without --user-id now fails when the server has several exec-login- entries. The plugin looks at the exec-login- entries only when none of the server entries you created with auth login has a token it can use for the call. The error is AMBIGUOUS_SELECTION (exit 2) and shows how to log in to an entry instead.
  • auth logout, auth delete-token and config delete-server now report a certificate failure as TLS_TRUST. Before, a token they could not revoke because of the server's certificate showed Go's raw TLS error with no code. Now its notRevoked entry in the output has code: TLS_TRUST, a message that says how to fix it, and the certificate's details. Exit codes are unchanged.
  • When a revoke fails because the server's CA is unknown, the warning now tells you to save the CA before you log in again. Without the saved CA your next login fails on the same certificate and cannot retry the revoke. The warning gives the command: rancher config update-server <entry> --cacert <file>.
  • rancher auth login <entry> no longer suggests --cacert for a certificate error. That command refuses --cacert without --url. If the server's CA is unknown, the error now tells you to save it with rancher config update-server <entry> --cacert <file>. If the certificate names a different host, it tells you to check the server URL saved for the entry.
  • Certificate errors and the auth login trust prompt use plainer words. The error says to get the CA from a source you trust, and both say to confirm the fingerprint with the server's administrator, instead of "out of band" or "a trusted channel".
  • A positional argument is now used exactly as typed, spaces included. Before, the spaces around it were dropped: rancher get pod ' web' looked up the pod web. Now it looks up a pod named web.
  • A bool flag followed by a separate true or false, as in --dry-run false, now fails with VALIDATION (exit 2). Before, rancher schema --dry-run false failed with DRY_RUN_NOT_APPLICABLE (exit 2). The error shows the word that followed the flag, and 1, 0, t and f are refused the same way. Write the value joined with =, as in --dry-run=false; --dry-run=1 and --dry-run=t still work.
  • The error for words typed after a lone - now reads 'x' 'y' after a - on its own; a - on its own ends the command line. Before, it read a - on its own ends the command line, so the words after it would be ignored: 'x' 'y'. The command still fails with VALIDATION (exit 2); only the text changed.
  • A bool flag with only whitespace after =, typed as '--yes= ', is now refused even when --help or --version follows it. Before, '--yes= ' --help showed help, '--yes= ' --version showed the version, and '--yes= ' nosuch failed with the unknown-command error. Now all three fail with VALIDATION (exit 2): --yes= has an empty value; a bool flag typed with = takes true or false.
  • --auth-provider now takes an auth config name, such as corp-ldap. Without --user-id, a provider type such as openLdapProvider still works; if it matches more than one auth config, the CLI asks you to pick one or, when it cannot ask, lists them in the error. With --user-id, only the exact auth config name works. The sign-in menu lists auth configs. When a provider type has several, a password or OAuth sign-in says which one it uses.
  • Error, warning and help messages now give the fact first, then the rule, usually after a semicolon. Before, many of them joined the two with a comma and "so". The facts, flags and commands in each text are unchanged; a script that matches the old wording of one of these messages must match the new one.
  • Commands that take a user, project, role template, global role or node driver now take its id as the argument. That is get and patch for all five and delete for a user or project. The argument shows as <id> ([id] on get). If what you typed is the username or display name of exactly one object, the NOT_FOUND error gives that object's id, lists it in candidates and suggests rancher get <kind> '<id>'. A project member who types a project's display name gets the same, and the code stays RBAC.
  • When patch refuses a patch, the error now says in plain words why. Before, the VALIDATION (exit 2) message quoted Go's JSON decoder. If you give a JSON object without --type merge, the error now tells you to pass --type merge. patch now reads a patch file that starts with a UTF-8 byte-order mark.
  • rancher delete project now lists the namespaces Rancher deletes with the project and the ones it keeps. Before, its warning said namespaces created through Rancher are deleted with the project and namespaces moved into the project are kept. Rancher deletes the namespaces that carry the field.cattle.io/creatorId annotation and keeps the others. The dry-run and the result list them, and -o json has every one in data.objects.
  • A namespace is now part of a project only if its field.cattle.io/projectId annotation names it; the project label alone is no longer enough. This applies wherever --project narrows a command to a project's namespaces, and to usage --by project and project add-namespace. The one exception is project remove-namespace: it still accepts a namespace that has the project label but no annotation, and it removes the label.
  • Live completion now shows a user, project, cluster, role or node driver id with its name beside it. For example, rancher delete user <TAB> lists u-abc12 with alice (Alice Smith). The inserted value is still the id. bash shows names on the second TAB, on bash 4 and later only.
  • rancher get now prints built-in kinds with the same columns and cells as kubectl get. This covers nodes, pods, deployments, services and the other 13 Kubernetes kinds. The table comes from the cluster's API server, and a node shows NotReady, or Ready,SchedulingDisabled when cordoned, as kubectl does. -o wide adds the server's extra columns, and a list of a namespaced kind without --namespace shows a NAMESPACE column. If the server answers without a table, get warns and shows NAME and AGE. -o json, -o yaml and -o name are unchanged.
  • config use-server with an unknown name now lists the configured servers, as config delete-server does. Before, it said only server not found: <name>. The error is NOT_FOUND (exit 4) with the servers as candidates, and every error that lists servers now sorts them by name.
  • --as with an unknown or ambiguous user, and revoke --role with a role the subject does not have, now list the choices in candidates. Before, the --as error only pointed you to rancher get users, and the revoke --role error named the roles the subject has only in its message. --as is on access can, access clusters, access explain, access list and access projects. For --as, each candidate is a user id with its display name, and a name that matches several users lists every match.
  • REFERENCE.md's install, shell completion, cluster scope and project scope sections now use plainer words. Before, they used terms such as "taking over", "stale shell command hash" and "the per-TAB HTTP budget". Two headings have new names: "Defensive bootstrap" is now "Downloading and running the installer safely", and "Editor quirk" is now "Notepad on Windows 11". If you bookmarked either old section, update the link to the new heading.
  • Errors, warnings and help of project, grant, revoke, delete user, create secret and oidc-client now use plainer words and Rancher's own names. Before, they said things like "subject holds", "ordinary secret", "alias-matched binding" and "impossible secret shape". Secret names now print as a comma-separated list, not in Go's [a b] form, and oidc-client rotate-secret now reports secret <name> regenerated instead of rotated. This rewording changes no error code, exit code or hint; a script that matches the old text of one of these messages must match the new one.

Security

  • Text output now drops the control characters U+0080-U+009F and the line and paragraph separators U+2028 and U+2029 from server text. Before, only ASCII control characters and Unicode format characters were dropped.

Fixed

  • LDAP, Active Directory and Azure AD logins now work on Rancher v2.16 (main, not yet released). That version requires the login request to include the auth config name, which the CLI did not send.
  • A patch that removes kind no longer prints the whole object in its error. Before, the message held the patched object, Secret data included. A patch that removes the name or metadata now fails with VALIDATION (exit 2) naming metadata.name; it was GENERIC (exit 1) name is required.
  • The bash second TAB no longer takes seconds on a long list. Before, a list of 2000 ids took about 9 seconds to show; it now takes well under a second.

Compatibility

  • access can, access explain, access list and access who-can now fail with NOT_FOUND (exit 4) when --namespace names a namespace that does not exist. Before, they failed with VALIDATION (exit 2) and the message namespace <name> not found on cluster <id>. The error now reads namespace not found: <name> and its hint is list with: rancher get namespaces --cluster '<id>'. A script that checks for exit 2 on a missing namespace must check for exit 4.
  • patch <kind> takes the patch file as --patch-file, as kubectl does. Before, you passed the file with -f or --filename. Both now fail with VALIDATION (exit 2) as unknown flags. --patch-file - still reads the patch from stdin. Replace -f <file> with --patch-file <file> in scripts.
  • Error candidates for --auth-provider now list auth config names instead of provider types. This applies when the value matches no auth config, or when you pass none on a server with several. A script that looked for openLdapProvider there now finds names such as openldap.
  • patch <kind> now refuses a few patches it accepted. A key repeated in one JSON object, a test op without value, and a from that is not a string on any op now fail with VALIDATION (exit 2). Fix the patch: name each key once, and give test its value.
  • In rancher schema, the first argument of get, patch and delete is now id, not name, for the kinds that take an id. That is user, project, roletemplate, globalrole and nodedriver for get and patch, and user and project for delete. A tool that reads the argument by name must read id for those.