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

add cmd-drop-env to AuthProviderConfig #1074

Merged
merged 1 commit into from
Nov 20, 2022

Conversation

aviramha
Copy link
Contributor

@aviramha aviramha commented Nov 5, 2022

This is a follow up after #1059 . We found out that AuthProviderConfig does pretty much the same (leaking env vars) but in a different implementation.
This is pretty much a draft in my opinion, not sure if cleanest approach. I'm thinking maybe Config should have this as a field instead and it is shared among all implementations that use Command..

@codecov-commenter
Copy link

codecov-commenter commented Nov 5, 2022

Codecov Report

Merging #1074 (852fcc9) into main (61f2f32) will increase coverage by 0.04%.
The diff coverage is 100.00%.

❗ Current head 852fcc9 differs from pull request most recent head e3eb17c. Consider uploading reports for the commit e3eb17c to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1074      +/-   ##
==========================================
+ Coverage   72.43%   72.47%   +0.04%     
==========================================
  Files          65       65              
  Lines        4759     4763       +4     
==========================================
+ Hits         3447     3452       +5     
+ Misses       1312     1311       -1     
Impacted Files Coverage Δ
kube-client/src/client/auth/mod.rs 56.98% <100.00%> (+0.94%) ⬆️
kube-runtime/src/wait.rs 77.35% <0.00%> (+1.88%) ⬆️

@kazk kazk requested a review from a team November 19, 2022 06:11
@@ -360,9 +360,14 @@ fn token_from_gcp_provider(provider: &AuthProviderConfig) -> Result<ProviderToke
// Command-based token source
if let Some(cmd) = provider.config.get("cmd-path") {
let params = provider.config.get("cmd-args").cloned().unwrap_or_default();

let drop_env = provider.config.get("cmd-drop-env").cloned().unwrap_or_default();
Copy link
Member

@clux clux Nov 19, 2022

Choose a reason for hiding this comment

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

This is basically just a freestyle property through the upstream map: https://github.com/kubernetes/client-go/blob/7697067af71046b18e03dbda04e01a5bb17f9809/tools/clientcmd/api/types.go#L167-L172 right?

I'm OK with it, but would add a comment that it's a non-standard property that's not used in client-go/kubectl if there's no upstream equivalent for it.

@clux clux added the changelog-add changelog added category for prs label Nov 19, 2022
@clux
Copy link
Member

clux commented Nov 19, 2022

I think this is OK. It's kind of a hidden property that's impossible to detect if we break it, and if upstream adds it we will likely want to conform, but I guess if that happens we can always throw in a warning message for half a year to try to help.

@aviramha
Copy link
Contributor Author

Thank you. Added a note.

@clux
Copy link
Member

clux commented Nov 19, 2022

Minor nit, plus DCO needs to be fixed then happy to merge!

@clux clux added this to the 0.77.0 milestone Nov 19, 2022
Co-authored-by: Eirik A <sszynrae@gmail.com>
Signed-off-by: Aviram Hassan <aviramyhassan@gmail.com>
@aviramha
Copy link
Contributor Author

Minor nit, plus DCO needs to be fixed then happy to merge!

Fixed
Thank you!

@clux clux merged commit be07824 into kube-rs:main Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-add changelog added category for prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants