NewSimpleClientset was marked as deprecated when NewClientset was
introduced. This has caused some confusion:
- Not all packages have NewClientset (https://github.com/kubernetes/kubernetes/issues/135980).
- Tests that work with NewSimpleClientset fail when
switched to NewClientset (https://github.com/kubernetes/kubernetes/issues/136327)
because of missing CRD support (https://github.com/kubernetes/kubernetes/issues/126850).
It doesn't seem burdensome to keep NewSimpleClientset around forever. Some unit
tests may even prefer to use it when they don't need server-side apply (less
overhead). Therefore there is no need to deprecate it.
This avoids churn in the eco system because contributors no longer create PRs
"because the linter complains about the usage of a deprecated function".
The len(endpoints) == 0 check is now redundant since the hasReadyEndpoints
check handles this case when the slice is empty, the loop executes zero
times, hasReadyEndpoints stays false, and returns "" via the same path.
When all endpoints are non-ready (ready=false, serving=false, terminating=false),
the topologyModeFromHints function was incorrectly logging "Ignoring same-zone
topology hints for service since no hints were provided for zone" because the
boolean flags remained at their initial values after the loop skipped all
non-ready endpoints.
This fix adds tracking for whether any ready endpoints were processed and
returns early if none exist, avoiding misleading log messages.
Also adds a test case covering this scenario.
Both repositories are archived on GitHub and were detected by the
new check-dependency-archived-periodical CI job.
Also add flynn/go-shlex to unwantedReferences (referenced by
github.com/coredns/caddy).
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
Signed-off-by: Alessio Attilio <attilio.alessio@protonmail.com>
fix: Update TestAuditLogMaxSizeZero to expect os.File when MaxSize is 0
fix: Update TestAuditValidOptions to handle MaxSize=0 case
Simplify testExtendedResource structure and add proper field validation:
- Rename tests to distinguish explicit vs implicit modes clearly
- Remove unnecessary nested sub-test to flatten test hierarchy
- Validate ExtendedResourceName is correctly stored or stripped
based on feature gate state to ensure proper API behavior
- Remove outdated comment that no longer applies
Co-Authored-By: Patrick Ohly <patrick.ohly@intel.com>
Simplified testExtendedResource by using the helper functions added
in the previous commit:
- Removed unused global test data (podWithExtendedResource,
classWithExtendedResource, etc.)
- Used createTestClassWithSpec to create DeviceClass with extended resources
- Used createPodWithExtendedResource to create test pods
- Removed manual class and pod creation boilerplate
Add helper functions to use for testing DRA extended resources:
- Add createTestClassWithSpec to support custom DeviceClassSpec
- Add createPodWithExtendedResource to create pods requesting extended resources