Skip to content

fix: skip kubeconfig update for in-cluster contexts#110

Merged
basebandit merged 3 commits intofeat/in-cluster-supportfrom
copilot/sub-pr-109
Feb 1, 2026
Merged

fix: skip kubeconfig update for in-cluster contexts#110
basebandit merged 3 commits intofeat/in-cluster-supportfrom
copilot/sub-pr-109

Conversation

Copy link

Copilot AI commented Feb 1, 2026

  • Understand the issue: SetCurrentContext tries to update kubeconfig file even for in-cluster configs with empty ConfigPath
  • Add check in SetCurrentContext to skip kubeconfig file update when ConfigPath is empty
  • Add unit tests to verify the fix works correctly
  • Run tests to ensure no regressions
  • Reply to the comment with the fix
  • Code review completed - no issues found
  • Security scan completed - no vulnerabilities found
  • Fix gofmt linting error (trailing whitespace)

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Add check in SetCurrentContext to skip kubeconfig file update when ConfigPath is empty (in-cluster configurations). This prevents errors when switching to in-cluster contexts that don't have an associated kubeconfig file.

Co-authored-by: basebandit <8973567+basebandit@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 1, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: /tmp/go-build1657329062/b001/cluster.test /tmp/go-build1657329062/b001/cluster.test -test.testlogfile=/tmp/go-build1657329062/b001/testlog.txt -test.paniconexit0 -test.timeout=10m0s -test.v=true -test.run=TestInClusterConfig d/policy/v1/fake-ifaceassert ux_amd64/compile-nilfunc -p (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Address feedback on in-cluster support PR fix: skip kubeconfig update for in-cluster contexts Feb 1, 2026
Copilot AI requested a review from basebandit February 1, 2026 12:34
@basebandit basebandit marked this pull request as ready for review February 1, 2026 14:22
Copy link
Owner

@basebandit basebandit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@basebandit
Copy link
Owner

@copilot the run lint job is failing with a gofmt error.

Fix gofmt linting error by removing trailing whitespace on lines 122 and 132 in cluster/manager_test.go.

Co-authored-by: basebandit <8973567+basebandit@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 1, 2026

@copilot the run lint job is failing with a gofmt error.

Fixed the gofmt error by removing trailing whitespace in cluster/manager_test.go. Commit: 9df4a36

Copilot AI requested a review from basebandit February 1, 2026 14:28
@basebandit basebandit merged commit 4a2c802 into feat/in-cluster-support Feb 1, 2026
2 checks passed
@basebandit basebandit deleted the copilot/sub-pr-109 branch February 1, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants