Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update authentication for Kubernetes
A user can now authenticate using their own k8s config file.
When a user logs in for the first time and there is no config file in the default path
~/.kube/config
a new one is created from a template with their credentials.Logging out removes the most recent username and token from the config file.
If a user tries to log in again the config file is checked for if they have logged in before by searching for the user's server address.
The username and token are appended to the config file.
All methods that used
config.load_kube_config()
have been updated to check if a user has already specified their own config file so it isn't overriden.How to test the new authentication methods
git pull https://github.com/Bobbins228/codeflare-sdk.git
git checkout k8s-support
Run
poetry build
within the codeflare-sdk folder to build your own wheel.Install the sdk with
pip install codeflare_sdk-0.0.0.dev0-py3-none-any.whl
Import the necessary classes.
Loading a user's own config file
Removing the user's config file (Deletes the file)
auth.remove_config()
Authenticating with token + server
Authenticating with certificate
Authenticating by skipping tls verification
Logging out
auth.logout()