Repository navigation
Conversation
|
|
|
Welcome @dgates82! |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The equivalent AOT configuration API does not expose the new overload.
Review effort: Balanced
Findings: 1
What changed in this PR
Adds context overrides when building default kubeconfig configurations, including merged KUBECONFIG files.
Changes:
- Adds
BuildDefaultConfig(string currentContext). - Tests context selection with multi-file configuration.
| File | Description |
|---|---|
src/KubernetesClient/KubernetesClientConfiguration.ConfigFile.cs |
Adds and delegates the context overload. |
tests/KubernetesClient.Tests/KubernetesClientConfigurationTests.cs |
Verifies the override against merged configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, dgates82 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
235ab00 to
743bf3b
Compare
|
New changes are detected. LGTM label has been removed. |
|
Rebased onto master after #1930. BuildDefaultConfig(string) now forwards to a new BuildDefaultConfig(string, ExecCredentialPluginPolicy), so a context override doesn’t bypass the exec plugin policy. The AOT copy is updated to match. Tests pass locally. |

Summary
Closes #1730. Adds
BuildDefaultConfig(string currentContext). The existing zero-argBuildDefaultConfig()already resolved a kubeconfig from KUBECONFIG (including multi-file merges), the default file location, or in-cluster config, but had no way to override which context got used, even though the object/file-based builders it delegates to already supported one. Follows the overload approach @brendandburns confirmed in the issue.@GaTTGeng mentioned interest in taking this earlier but no PR followed, happy to close this in favor of theirs if it's already in progress.
Validation
Added a test verifying the override is honored against a merged multi-file KUBECONFIG config specifically, since that's the scenario in the original issue. Full existing test suite passes alongside it.