-
Notifications
You must be signed in to change notification settings - Fork 23
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
✨Run status check on login errors #4325
Conversation
can you fix the linter issue? |
@imilchev done |
apps/cnquery/cmd/login.go
Outdated
err := register(token, annotations, timer, splay) | ||
if err != nil { | ||
defer func() { | ||
err := StatusCmd.RunE(cmd, args) |
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's a bit weird to run 1 command from another. Can you extract whatever is in the status command into a separate function and just call that function here and in StatusCmd.Run
. I don't think you need the args
at all for checking the status
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.
done
…ommand in login command
apps/cnquery/cmd/status.go
Outdated
// try to load config into credentials struct | ||
credentials := opts.GetServiceCredential() | ||
if credentials != nil && len(credentials.Mrn) > 0 { | ||
s.Client.ParentMrn = credentials.ScopeMrn |
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.
I am not sure if this breaks anything. What if I have an old service account that still has ParentMrn
instead of ScopeMrn
. My integration will be broken in that case and I would need to re-create my service account. I suggest not changing this now because we don't know what the impact will be for customers
Resolves mondoohq/cnspec#1342