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

Provide cluster info to exec plugins #1331

Merged
merged 4 commits into from
Nov 23, 2023
Merged

Conversation

aviramha
Copy link
Contributor

@aviramha aviramha commented Oct 28, 2023

Closes #1328

@codecov
Copy link

codecov bot commented Oct 28, 2023

Codecov Report

Merging #1331 (5f67daa) into main (bdda76e) will decrease coverage by 0.0%.
The diff coverage is 60.9%.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1331     +/-   ##
=======================================
- Coverage   72.1%   72.1%   -0.0%     
=======================================
  Files         75      75             
  Lines       6390    6434     +44     
=======================================
+ Hits        4606    4635     +29     
- Misses      1784    1799     +15     
Files Coverage Δ
kube-client/src/config/file_loader.rs 86.3% <100.0%> (+1.2%) ⬆️
kube-client/src/config/mod.rs 45.4% <ø> (ø)
kube-client/src/client/auth/mod.rs 50.3% <0.0%> (-0.4%) ⬇️
kube-client/src/config/file_config.rs 75.5% <63.2%> (-2.0%) ⬇️

@aviramha aviramha force-pushed the auth_cluster_info branch 2 times, most recently from 166c808 to a702f2e Compare October 29, 2023 06:49
@aviramha aviramha marked this pull request as ready for review October 29, 2023 06:49
@aviramha
Copy link
Contributor Author

Hey @clux - I believe this is ready for review - I haven't tested it properly (nor written tests) - I plan to test it manually soon, then write some tests when you thumbs up the implementation as I took some decisions that can be controversial (how we store the cluster info, how we translate it, when we do it, etc.)

@clux
Copy link
Member

clux commented Oct 29, 2023

is the controversial bit the extra struct stored on ExecConfig (the ExecAuthCluster part?)

if this is deviating from the upstream ExecConfig (which it looks like it does), it might be worth considering storing this in the preferences section of the kubeconfig if that is possible (because it allows arbitrary data storage in there without breaking support for kubectl).

@aviramha
Copy link
Contributor Author

@clux I don't think it belongs into the preferences as it's not serialized/deserialized and it'd be weird to pass it that way.
Note that I borrowed the idea that I didn't like from upstream Go implementation:
https://github.com/kubernetes/client-go/blob/30eba26adb82c17a65cb10dbd9534c742a496404/tools/clientcmd/api/types.go#L206

@aviramha
Copy link
Contributor Author

Regarding tests, I think the best thing would to incorporate the code change in file_loader as well but it's not exposed to the crate (so we can see data is being set correctly in auth_info).
Any suggestion?

@aviramha
Copy link
Contributor Author

Short update - the impacted user tested my changed and it worked :)

Copy link
Member

@clux clux left a comment

Choose a reason for hiding this comment

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

i think this in general makes sense.
some questions initially

kube-client/src/config/file_config.rs Show resolved Hide resolved
kube-client/src/config/file_config.rs Outdated Show resolved Hide resolved
@clux clux added the changelog-add changelog added category for prs label Oct 30, 2023
@clux clux mentioned this pull request Oct 31, 2023
@clux clux added this to the 0.88.0 milestone Oct 31, 2023
@clux
Copy link
Member

clux commented Nov 3, 2023

The one thing i would like to have here before merging is a serialization test case; some yaml that users have that is passed to the deserialize impl for the struct (just so we know what we are dealing with down the line during inevitable refactorings).

@aviramha
Copy link
Contributor Author

aviramha commented Nov 6, 2023

The one thing i would like to have here before merging is a serialization test case; some yaml that users have that is passed to the deserialize impl for the struct (just so we know what we are dealing with down the line during inevitable refactorings).

Done! :)

Signed-off-by: Aviram Hassan <[email protected]>
Copy link
Member

@clux clux left a comment

Choose a reason for hiding this comment

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

Thank you!

@clux clux enabled auto-merge (squash) November 23, 2023 13:27
@clux clux merged commit 4493297 into kube-rs:main Nov 23, 2023
17 checks passed
@clux
Copy link
Member

clux commented Nov 23, 2023

Forgot to merge this in during the release setup for 0.87, but it's in now - for 0.88.
Thanks again!

@aviramha aviramha deleted the auth_cluster_info branch November 23, 2023 18:03
@aviramha
Copy link
Contributor Author

Thank you @clux for the great maintenance!! ❤️

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.

Support for ProvideClusterInfo in exec
2 participants