-
Notifications
You must be signed in to change notification settings - Fork 167
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
Don't promise that Config#context is what acts on exec:/auth-provider: #400
Conversation
This was bad advice. Config::Context#api_version returns the apiVersion of the kubeconfig file itself. It is almost certainly 'v1' but has nothing to do with server API version you want use (depending on api group)!
Retracts promise made in 0cbf5db Motivation: I want to let Config and Config::Context expose the underlying data, because why not. Ideally for that, Config#context would become a passive function, moving the work to Config::Context#auth_options (?) There are open questions about this, and probably should figure out a plan around auth renewal (ManageIQ#393) first. Anyway, don't want my hands tied.
To be honest I'm not really following the problem here. But from what I think I understand here are some comments: Lazy auth sounds fine to me. It seems that would make renewal easier. Especially if the auth is checked on each API call and has a Regarding this:
This has been a persistent struggle for me, because the config includes the I like this solution (#393 (comment)):
And I agree that separating Are we conflating authentication and configuration here as well? Should those concepts be separated? |
Yes! That's the root issue. Now, in the future where Client will ask some "auth object" for valid auth, things are better, and the whole question when auth is obtained falls away (whenever necessary). I'm probably overthinking this. Renewing auth currently is impractically painful, and doubt anybody actually does it :) |
I would strongly support separating configuration and authentication. It was a struggle for me to understand/implement the GCP options because if the confusion between the two. I think that |
I agree with this as well. I like the idea of separating out the actual config with the details of a given client instance (e.g. As everyone correctly points out, the issue now is how to actually model these elements. On an intuitive level, I would expect Currently, I don't see a way of implementing this without breaking the API :( but the tradeoff does seem to be worth it. |
Before I release, I want to retract the promise I added in the last commit of #394 (0cbf5db), subsequently repeated in #396.
Motivation:
Following #392 (comment), I want to let
Config
andConfig::Context
expose the underlying data, because why not.Ideally for that,
Config#context
would become a passive function, and then the active work of executingexec:
command /auth-provider:
network calls would be delayed until you callConfig::Context#auth_options
(?)See below why that's not as simple, but I don't want to tie my hands now.
Plus this all is likely to change with auto auth renewal (#393).
Should figure that plan before making changes. Maybe reserving this freedom will help there too?
@motymichaely @timothysmith0609 @jeremywadsack @rhysm, do you think this is reasonable or am I inconveniencing people?
Why can't simply move the active work from
Config#context
toConfig::Context#auth_options
exec:
may return client certificate instead of token, and that goes intossl_options
.I think we don't support that now, but should. UPDATE: adding in Add support for client-type ExecCredentials #453
Might be problematic change with current usage patterns:
Users that need several
Client
objects (for different api groups), may well be doing:If I simply make
auth_options
do the work, it'll then obtain many tokens.however, could have Context obtain auth at most once, but delayed until auth_options / ssl_options are called?