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

expose kubeconfig hash #522

Closed

Conversation

mindovermiles262
Copy link

Sometimes you need to access the raw kube_config hash. This PR adds a method to do so

@cben
Copy link
Collaborator

cben commented Dec 14, 2021

Thanks. Generally makes sense, I don't think the instance var was deliberately private 👍

Note that this exposes the original data from kubeconfig file, before all the work done by .context() to resolve data:

If you have use case for it with these caveats, LGTM, but please add documentation in README.

Is .kube_config clear name for the as-is parsed yaml?
What do you think of something like .to_hash, or maybe .parsed_data / .parsed / .as_parsed to be similar to Client's as: :parsed mode? (not sure these are better, just throwing out ideas...)

@cben cben closed this Jan 15, 2023
@cben cben reopened this Jan 15, 2023
@cben
Copy link
Collaborator

cben commented Jan 15, 2023

@mindovermiles262 The question still stands — do you think this will be useful with the caveats listed above?

  • One change since then: we've implemented bearer_token_file auto-reloading in Client (but not an inline bearer_token).
    IIRC, bearer_token_file reloading happens just before making a request, so you'll not see it reflected in Config's hash. You'll see a static file path there, because as I said this returns the parsed yaml as-is, before resolving external file references.

Or should we close this? What's is your use case for accessing the raw config?

@mindovermiles262
Copy link
Author

I do not remember why I needed the raw kube config. You're OK to do as you wish with this PR.

@cben cben closed this Jan 18, 2023
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.

2 participants