Skip to content

deps(test): update dependency kubernetesclient to 21.0.41 - #1349

Merged
renovate[bot] merged 1 commit into
mainfrom
renovate/kubernetesclient-21.x
Nov 25, 2026
Merged

renovate[bot] merged 1 commit into
mainfrom
renovate/kubernetesclient-21.x

Conversation

@renovate

@renovate renovate Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
KubernetesClient 21.0.8 → 21.0.41 age confidence

Release Notes

kubernetes-client/csharp (KubernetesClient)

v21.0.41

What's Changed

New Contributors

Full Changelog: kubernetes-client/csharp@v21.0.7...v21.0.41


Configuration

📅 Schedule: (in timezone Europe/Zurich)

  • Branch creation
    • "after 9pm,before 6am"
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added the dependencies Pull requests that update a dependency file label Nov 25, 2026
@renovate
renovate Bot enabled auto-merge (squash) November 25, 2026 21:24
@renovate
renovate Bot merged commit 11528d1 into main Nov 25, 2026
6 checks passed
@renovate
renovate Bot deleted the renovate/kubernetesclient-21.x branch November 25, 2026 21:32
kimpenhaus added a commit that referenced this pull request Nov 28, 2026
## What

The operator identifies itself to the Kubernetes API server with its own
name instead of the generic user agent of the C# client:

```text
# before
kubernetes-csharp/21.0.8+75f253d651

# after
my-operator/1.2.0 kubeops/15.0.0 kubernetes-csharp/21.0.8+75f253d651
```

Build metadata (`+<commit>`) is dropped from the operator and KubeOps
versions; the C# client token stays as the client sends it.

The API server records the user agent in its audit logs, so requests of
an operator can now be told apart from those of other clients built on
the C# client. This complements the explicit field manager from #1346:
the API server derives the field manager of a write without
`fieldManager` from the part of the user agent before the first `/`. The
operator always sends an explicit field manager, so `managedFields` do
not change.

## How

- **`KubernetesUserAgent`** (public static class in
`KubeOps.KubernetesClient`) with two members:
- `Create(product, version)` returns `<product>[/<version>]
kubeops/<version> <client default>`. Characters that are not allowed in
an HTTP product token (RFC 9110 `tchar`), e.g. spaces, `/` or CR/LF, are
replaced by `-`. An empty version is left out, build metadata is
dropped.
- `Apply(config, product, version)` sets that user agent on a
`KubernetesClientConfiguration` unless it already carries an own one. An
empty user agent and the client default count as not configured.
- **`OperatorBuilder`**: the default `IKubernetes` applies the user
agent from the operator name and the informational version of the entry
assembly to the configuration before it creates the client. This also
covers a `KubernetesClientConfiguration` registered by the user, as long
as it has no own user agent; the registered configuration is changed in
place (documented). The user agent always starts with the operator name,
independent of `WithFieldManager`. With an empty operator name the
client default is kept.
- **KubeOps CLI** identifies itself as `kubeops-cli/<version>`.

No new setting: an own user agent is set through
`KubernetesClientConfiguration.UserAgent`, which already exists.

## Behavioural changes for users

No public API is removed or changed. Visible differences:

- The `User-Agent` header of the operator and the CLI changes, e.g. in
API server audit logs. Anything that matches on `kubernetes-csharp` in
the user agent still matches, because the client token stays at the end.
- An `IKubernetes` registered by the user keeps the user agent of its
configuration; `KubernetesUserAgent` can be used to set it (documented).
- `KubernetesClient` constructed directly (outside the operator) is
unchanged.

## Docs

- New page `docs/docs/operator/configuration/user-agent.mdx`, linked
from the Advanced Configuration index and from the Field Manager page
- `KubeOps.KubernetesClient` README
- CLI page
- Migration guide ("New in v15 (non-breaking)")

## Tests

- Unit tests (`Area` `KubernetesClient` / `Configuration` / `Cli`):
- format, omitted version, dropped build metadata, token sanitisation
(incl. CR/LF), empty product
- `Apply`: replaces a missing, empty and default user agent, keeps an
own one
- `OperatorBuilder` wiring: operator name independent of the field
manager, own configured user agent, empty operator name
  - CLI factory
- `dotnet build -c Release`, `dotnet format --verify-no-changes` and the
unit tests of `KubeOps.KubernetesClient.Test`, `KubeOps.Operator.Test`
and `KubeOps.Cli.Test` pass locally, and the docs build (`npm run
build`, `onBrokenLinks: throw`) succeeds. I did not run the integration
tests locally.

## Reviews

Run before merge: `/code-review`, `/simplify`, `/security-review`, docs
sync.

- **`/code-review`**: fixed
- an empty operator name with an explicit field manager made resolving
`IKubernetes` throw, because the product is required; the user agent is
now skipped in that case
- build metadata (`+<sha>`) ended up in the user agent, unlike the
documented format; it is now dropped
- an empty `UserAgent` counted as configured; it now counts as not
configured
- the in-place change of a user-registered configuration is now
documented
- **`/simplify`**: public surface reduced from four members
(`ClientDefault`, `Create`, `CreateFromAssembly`, `SetIfNotConfigured`)
to `Create` and `Apply`; string building simplified; redundant tests
(incl. a wire-level test of upstream behaviour) and duplicated docs
removed. Efficiency: no findings.
- Skipped: changing the existing public `KubernetesClient(config,
fieldManager)` constructor to also set the user agent. It was released
in 14.1.0, and mutating the caller's configuration from a constructor
would be a surprising behaviour change; tools call
`KubernetesUserAgent.Apply` instead.
- Skipped: sharing `BuildProvider` / the stub API server between test
classes (small, test-only duplication).
- **`/security-review`**: no findings. Product and version pass through
the token sanitiser, so no header/CRLF injection; only `UserAgent` of
the configuration is changed, never TLS or credentials.
- **Docs**: synced with the final API (user-agent page, README,
migration guide).


## Kubernetes client 21.0.41

`main` moved to `KubernetesClient` 21.0.41 (#1349) while this PR was
open. Docs only:

- The user agent example shows `kubernetes-csharp/21.0.41+d05b908e20`.
- `migration.mdx` (v15): the client now rejects an API server
certificate that does not match the server address when a CA from the
kubeconfig is used
([kubernetes-client/csharp#1964](kubernetes-client/csharp#1964)),
with how to fix a kubeconfig (`server` or `tls-server-name`). Our code
has no own certificate validation and needs no change.
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 15.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants