-
Notifications
You must be signed in to change notification settings - Fork 593
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
Allow setting a preconfigured execRunner for cf authentication #1760
Conversation
in order to have the opertunity to set an already preconfigured runner from the outside, e.g. having additional environment variables.
Without looking at the code, this sounds like something where errors can be made easily and not spotted without knowing this context.
Good approach. I wonder why you did not start with the "2.) Extend the signatures of the functions" variant, that sounds less invasive to me. |
Well, each approach comes with pros and cons (eg. #1 is more invasive, but you have to do it only once ...). I don't say that approach #1 is better compared to #2 or worth. Basically I more the less thew the coin ... And I think it is good to have all options on the table before making a decission. |
Other approach sketched with PR #1766 |
@fwilhe @DanielMieg @dominiklendle : also the approach with the environment variables provided via signature (sketched in #1766) does not fully convince since we have to reset the environment in this case (... we can't know who else is using Maybe we should think about a third approach. Having
We can discuss if we should default to a new |
@dominiklendle @DanielMieg : |
Regarding the Login Check - I don't think it is necessary. @dominiklendle What do you think? Was there a specific reason for this check? |
The Login Check in Just an info: I wouldn't mind changing the implementation if there is any other known way besides polling the login status with |
Why should it do that?
Why is it important for our use cases to know if a user has been logged in already?
We have basically two situations (resulting in these calls):
This means:
Are you talking about server side logs (... remote end) or about logs on our side? I wouldn't care about logs on our end since we can control that. Regarding logs on the remote end: is Beside logging: I don't know how expensive a My point is: the less code we have the easier it is to maintain. Here we have to find a way how we can deal with additional properties set on a I don't say we have to remove that |
For a way without a global instance of |
The reason behind this is due to the outsourcing of cf helper functions to Your call stack would make perfect sense for a single usage of these helper methods. With more than one call of these helper functions, IMO: logs from cf api login check < logs and load from cf login (both are logs on our side that are currently produced/retrained by cf cli) I totally get your points, the less code the easier the easier it is to maintain. For me, both options are valid:
Let's discuss this in todays call! Either ways, even with leaving the login check function out there should be appropriate logs coming with the Login function that we should also discuss about. |
@dominiklendle : In case we agree on not having a "global" |
I think this would be the best option. This even avoids subsequent To answer your original question: After hearing and discussing this, let's drop the LoginCheck and use your idea mentioned above. You convinced me. Also makes life easier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me, although as discussed yesterday I would propose to rather use the changes from PR #1771 . Sounds more promising to me. Is this PR obsolete then?
superseded by #1771 |
This pull request is not ready to merge, but I would like to start a discussion about the issue adressed here
The cf cli can be configured environment variables (e.g.
CF_TRACE
). The current approach used here is to have a non-public instance ofcommand.ExecRunner
. With that approach it is not possible to set additional environment variables from outside controlling the behaviour of cf cli.We have at least two options for fixing this.
1.) Provide the option to set an execRunner from outside. This is basically the approach sketched here.
2.) Extend the signatures of the functions so that we can hand over environment variables. These environment variables needs to be set on the non-public instance of
command.ExecRunner
.3.) Switch to a receiver approach. The instance for
command.Command
is defined in the receiver.4.) ...
Reason why this PR is not ready for being merged: When we use the approach sketched here we need to ensure that there is not status change of the exec runner after returning from the functions here. E.g. currently we set the
stdout
stream in order to be able to scan the output of the command. This needs to be set back via adefer
. In order to get this we need to enhance the execRunner so that we can obtain a currently set output stream handle in order to be able to set it back afterwards.I would like to suggest to add other approaches here in this PR so that we can discuss the pros and the cons.