Commit Graph

7 Commits

Author SHA1 Message Date
Patrick Ohly
3db82856dc client-go features: ignore contextual logging
The client-go feature gates implementation logs information about feature
states at V(1). Changing that would imply changing the Enabled method, which is
very intrusive because there are many callers which are not expected to log and
thus don't have access to a contextual logger.

The code is not active in Kubernetes components, those use the clientAdapter to
make client-go use the normal feature gate implementation, which doesn't log
anything. Therefore the code doesn't get changed and only annotated so that
logcheck won't complain.

Kubernetes-commit: ee9d998d6e0c89bcf2b39fc011bfbc916060d451
2024-12-09 13:00:47 +01:00
Michael Aspinwall
c752307a85 Add SetForTesting for testing feature gates
Kubernetes-commit: 8099c570428806404b1a400143156c2ed0c67658
2026-02-03 21:49:09 +00:00
Patrick Ohly
b0c7207279 Revert "apimachinery: contextual logging in network util code"
Kubernetes-commit: 9d65b9be20e5ee0a4ef34f0ba071d35987da4ab0
2026-01-27 17:21:02 +01:00
Patrick Ohly
5da30e54b3 client-go features: ignore contextual logging
The client-go feature gates implementation logs information about feature
states at V(1). Changing that would imply changing the Enabled method, which is
very intrusive because there are many callers which are not expected to log and
thus don't have access to a contextual logger.

The code is not active in Kubernetes components, those use the clientAdapter to
make client-go use the normal feature gate implementation, which doesn't log
anything. Therefore the code doesn't get changed and only annotated so that
logcheck won't complain.

Kubernetes-commit: e47b186e6ba3cbc9c732409ef9037e883ea80da1
2024-12-09 13:00:47 +01:00
Lukasz Szaszkiewicz
98df4f79ac client-go/features: add Set method to envvar impl
Kubernetes-commit: a07654baa54d53d7649e981c0c65eb8d1210e4af
2024-05-22 15:42:47 +02:00
Lukasz Szaszkiewicz
e8a81a3a43 client-go/features: warn when ordering initialization issue
ReplaceFeatureGates logs a warning when the default env var
implementation has been already used.
Such a situation indicates a potential ordering issue and usually is unwanted.

Kubernetes-commit: 04bbd3481f70825eea54b4b154a04d2496dcf652
2024-01-10 17:15:01 +01:00
Lukasz Szaszkiewicz
ca4f3a73f7 client-go/features: introduce feature gates
This PR add a feature gates mechanisim to client-go
as described in https://docs.google.com/document/d/1g9BGCRw-7ucUxO6OtCWbb3lfzUGA_uU9178wLdXAIfs

In particular:
  - Adds a default feature gate implementation based on environment variables.
  - Adds a set of methods for reading, overwriting the default implementation, and adding features to an external registry.

Co-authored-by: deads2k <deads@redhat.com>
Co-authored-by: Ben Luddy <bluddy@redhat.com>

Kubernetes-commit: d74c57d4f592d20a992afb54b1ee64f56215210e
2024-01-02 12:46:15 +01:00