Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure reauthenticate calls exec again #307

Merged
merged 2 commits into from
Feb 8, 2024

Conversation

jacobtomlinson
Copy link
Member

@jacobtomlinson jacobtomlinson commented Feb 8, 2024

KubeAuth.server was being used to store both the user specified url kwarg and also the url loaded from the kube config.

When loading the kubeconfig we check that the server hasn't been set because we don't want to overwrite a url set by the user. However after the first authentication from kubeconfig that attribute is set, so when we call reauthenticate it looks like a user has specified the url and we never refresh it, so we aren't actually reauthenticating at all.

This PR creates a new _url attribute to store the user specified url which allows us to differentiate between them.

Updated a couple of tests to ensure that a user specified URL doesn't get overwritten, but a kubectl specified url (and other attributes) get reloaded when we reauthenticate.

Closes #306

Copy link

codecov bot commented Feb 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a602e53) 95.06% compared to head (2ec9335) 95.08%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #307      +/-   ##
==========================================
+ Coverage   95.06%   95.08%   +0.02%     
==========================================
  Files          27       27              
  Lines        2875     2887      +12     
==========================================
+ Hits         2733     2745      +12     
  Misses        142      142              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jacobtomlinson jacobtomlinson merged commit 14a3507 into kr8s-org:main Feb 8, 2024
12 checks passed
@jacobtomlinson jacobtomlinson deleted the reauth-exec branch February 8, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Api.reauthenticate does not work
1 participant