Changes for version 1.113 - 2026-12-01
- Exec credential plugins from a kubeconfig run on Windows. Kubernetes::REST::AuthExec started the plugin with a forking pipe open, which perl does not implement on Windows: it handed the command "-" to cmd.exe, and every exec block (aws eks get-token, kubelogin, gke-gcloud-auth-plugin) ended in "exited with status 1" without a token. On Windows the plugin now runs through system with its output in a temporary file, still without a shell, each argument quoted by the rules of the C runtime, so an argument holding spaces or double quotes arrives as one argv element; a command that cannot be started is reported as "could not be started". Other platforms run the plugin as before.
- The test suite runs through on Windows. t/13_io_backends.t skips its forked test server where fork is emulated (perlfork): a signal other than KILL never reaches a pseudo-process sitting in accept(), so the run hung until the smoker gave up, and no Windows report came back. The exec plugin tests start their plugins as "$^X script" instead of a shebang script, paths are compared the way Path::Tiny writes them, KUBECONFIG lists are joined with the platform path separator, t/34_token_rotation.t writes its token files in binary mode and runs its symlink case where a symlink can be created, and t/71_kubeconfig_exec_no_shell.t skips the /bin/sh case where there is no /bin/sh. t/82_auth_exec_spawn.t covers the Windows branch of AuthExec on every platform.
- t/71_kubeconfig_exec_no_shell.t runs its sh -c plugin without a shell startup file: it removes ENV and BASH_ENV for the test. NetBSD's sh reads the file named by ENV for sh -c too, and a startup file that sources something under $HOME failed under the test's temporary HOME.
- Requires IO::K8s 1.113. IO::K8s 1.109 serialized the JSONSchemaProps bounds minimum, maximum and multipleOf as JSON strings, and the API server refused every CRD carrying one, also through ensure() with a hash.
- Kubernetes::REST::AuthExec, and with it Kubernetes::REST::Kubeconfig, and Kubernetes::REST::CLI::Minikube load when a program overrides CORE::GLOBAL::exec or CORE::GLOBAL::system before loading them, as test guards and mocking modules do. The block forms exec {$cmd} ... and system { $cmd[0] } ... were a syntax error under such an override; they are spelled CORE::exec and CORE::system now and still run the program directly, without a shell.
- Test::Warn is declared as a test dependency, as the test suite loads it.
- New attribute field_validation (Strict, Warn or Ignore; anything else croaks listing the allowed values, never the value given), and a fieldValidation option on create, update, update_status, patch and patch_status, sent as the fieldValidation query parameter. A value given to the call wins over the client default; with neither, nothing is sent. create, update and update_status now take options and croak on unknown keys; patch and patch_status with an object accept patch, type and fieldValidation. ensure() passes no options on: its create sends only the client default.
- New attribute on_warning (a coderef). check_response hands every Warning header of the response to it as text, as on_warning->($text, $context), also on an error status and before the APIError is thrown; the RFC 7234 form 299 - "text" is unpacked to the text. This needs the new attribute headers of Kubernetes::REST::HTTPResponse, a hashref of lower-cased header name to arrayref of values (default empty), which LWPIO and HTTPTinyIO fill. A backend that does not fill headers yields no warnings. check_response is part of the public pipeline seam and the change is additive: Net::Async::Kubernetes has to pass the response headers into HTTPResponse for on_warning to work there.
- New public method $api->add_provider(@providers) registers IO::K8s providers on a live client. Each provider is what "with" takes: a provider class name (with new and resource_map), an object with resource_map, or a hashref { Kind => '+My::Class' }. They are appended to "with" and, when the inner IO::K8s is already built, merged into it at once; otherwise nothing is built and no request is sent. It returns the client. All providers are checked first; a bad one croaks at the call, naming its position and not its value ("add_provider: provider 2 is not a class name, an object with resource_map or a hashref", or "... is a class name that does not load as a provider (one with new and resource_map)"). Unlike an entry written into a built $api->resource_map, which is lost when discovery rebuilds the inner IO::K8s (invalidate_discovery and so ensure_crd, absorb_discovery, the openapi fetch) and then croaked "unknown resource" for a bare Kind or resolved to IO::K8s::Unstructured, a provider in "with" is merged again by every rebuild. The POD of with, resource_map, k8s, invalidate_discovery and absorb_discovery says so, and the recipes in Kubernetes::REST::Example use add_provider.
- Kubernetes::REST::Kubeconfig->api($context_name, %options) passes %options on to Kubernetes::REST->new, next to the server and credentials it builds from the kubeconfig, on the kubeconfig path and on the in-cluster fallback alike; api(undef, %options) keeps the current context. The options are not checked here. So api(undef, resource_map_from_cluster => 0) switches discovery off: the client never reads /api and /apis, and a failed discovery adds no "Falling back to the built-in resource map" warning to STDERR. server or credentials as an option croaks ("api() builds server from the kubeconfig, server is not an option"), as does an odd-length option list ("api() takes a context name and then key/value options, got an odd number of option elements"), both before the kubeconfig is read. Before, anything after the context name was ignored.
- A kubeconfig value that is the kubeconfig's content instead of a file name is refused. A value counts as a document when it contains a line break, CR or NUL, or when it or any entry of a path list starts with "{", "[" or "---" (after whitespace); this is checked per arrayref entry, for kubeconfig_path and for the KUBECONFIG default. kubeconfig_paths, api, contexts, current_context_name, context, cluster and user die at the caller's line with "kubeconfig expects a path, got a document in kubeconfig_path - pass the name of a kubeconfig file, not its content" (or "... in the environment variable KUBECONFIG ..."), quoting nothing of the value. Before, the document was stat'ed as a file name: it warned "Unsuccessful stat on filename containing newline" and died with "Kubeconfig not found: <the whole document> and not running in-cluster", tokens and client keys included, or silently fell back to an in-cluster client when a service account token was mounted. A document never falls back to in-cluster.
Documentation
Kubernetes CLI client using Kubernetes::REST
Generate IO::K8s classes from a CustomResourceDefinition
Run a command against a throwaway minikube cluster
Watch Kubernetes resources for changes
Modules
A Perl REST Client for the Kubernetes API
An HTTP error status answered by the Kubernetes API
Compatibility helper for deprecated v0 Admission Registration calls
Compatibility helper for deprecated v0 API Extensions calls
Compatibility helper for deprecated v0 API Registration calls
Compatibility helper for deprecated v0 Apps calls
Bearer token from an exec credential plugin, run again before it expires
Kubernetes API authentication token
Bearer token read from a file, re-read when the file changes
Compatibility helper for deprecated v0 Authentication calls
Compatibility helper for deprecated v0 Authorization calls
Compatibility helper for deprecated v0 Autoscaling calls
Compatibility helper for deprecated v0 Batch calls
CLI base class for Kubernetes::REST command-line tools
The create command of kube_client
The delete command of kube_client
The get command of kube_client
The raw command of kube_client
Generate IO::K8s classes from a CustomResourceDefinition
Bring up a minikube test cluster and run a command against it
Shared kubeconfig/auth options for CLI tools
CLI for watching Kubernetes resources
Compatibility helper for deprecated v0 Certificates calls
Compatibility helper for deprecated v0 Coordination calls
Compatibility helper for deprecated v0 Core calls
Compatibility helper for deprecated v0 error handling
Compatibility helper for deprecated v0 Events calls
Working examples for Kubernetes::REST with Minikube, K3s, and other clusters
HTTP request object
HTTP response object
HTTP client using HTTP::Tiny
Parse kubeconfig files and create Kubernetes::REST instances
HTTP client using LWP::UserAgent
A single log line from the Kubernetes Pod Log API
Compatibility helper for deprecated v0 Networking calls
Compatibility helper for deprecated v0 Policy calls
Compatibility helper for deprecated v0 RBAC calls
Compatibility helper for deprecated v0 remote errors
Interface role for HTTP backends
Compatibility helper for deprecated v0 Scheduling calls
Kubernetes API server connection configuration
Compatibility helper for deprecated v0 Storage calls
Base class for backwards-compatible v0 API group wrappers
A single event from the Kubernetes Watch API