-
Notifications
You must be signed in to change notification settings - Fork 3k
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
login: support login when there are no subscriptions #2929
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2929 +/- ##
==========================================
+ Coverage 63.11% 63.33% +0.21%
==========================================
Files 466 466
Lines 26273 26536 +263
Branches 4027 4069 +42
==========================================
+ Hits 16583 16806 +223
- Misses 8601 8617 +16
- Partials 1089 1113 +24
Continue to review full report at Codecov.
|
if not allow_no_subscriptions and not subscriptions: | ||
raise CLIError("No subscriptions were found for '{}'. If this is expected, use " | ||
"'--allow-no-subscriptions' to have a tenant level account".format( | ||
username)) |
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.
Why do we need an explicit flag for this? If there are subscriptions but --allow-no-subscriptions is specified, what happens? If the behavior isn't changed, then why wouldn't we just issue a warning and proceed with the --allow-no-subcriptions
logic?
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.
It is a bit subtle.
--allow-no-subscriptions
can be used even if you have subscriptions. The story is, login
will visit every tenants you are member of. Let us say you have [t1,t2]
, and there is a subscription s1
in t1
, but not any in the t2
. W/o this flag, the login will only build an account for t1\s1
, which makes sense because almost all commands need to have subscriptions. But for a few commands which doesn't need subscriptions, say those ad
ones, users have opened the issue saying they like to run them on t2
.
I don't like to build up the tenant level accounts by default, because more likely people don't want it. That is particularly true for RBAC scenarios, that it is common people by mistake forgot to create the role assignment, causing subscription access is not built up. I am open to incoming user voices though, and can switch if needed.
Also, let me know if you have suggestions for a better arg name.
This is not a common thing, so users should use a flag of
--allow-no-subscriptions
to opt-inFix #2560
General Guidelines
Command Guidelines
- [ ] Each new command has a test.(see Authoring Command Modules)