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

✨Run status check on login errors #4325

Merged
merged 5 commits into from
Jul 10, 2024
Merged

Conversation

slntopp
Copy link
Member

@slntopp slntopp commented Jul 9, 2024

@slntopp slntopp requested review from imilchev and jaym July 9, 2024 12:10
Copy link
Contributor

github-actions bot commented Jul 9, 2024

Test Results

3 073 tests  ±0   3 072 ✅ ±0   1m 31s ⏱️ +8s
  363 suites ±0       1 💤 ±0 
   27 files   ±0       0 ❌ ±0 

Results for commit 032eb47. ± Comparison against base commit bc3c52d.

♻️ This comment has been updated with latest results.

@imilchev
Copy link
Member

imilchev commented Jul 9, 2024

can you fix the linter issue?

@slntopp
Copy link
Member Author

slntopp commented Jul 9, 2024

@imilchev done

err := register(token, annotations, timer, splay)
if err != nil {
defer func() {
err := StatusCmd.RunE(cmd, args)
Copy link
Member

@imilchev imilchev Jul 9, 2024

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

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@slntopp slntopp requested a review from imilchev July 9, 2024 15:47
// try to load config into credentials struct
credentials := opts.GetServiceCredential()
if credentials != nil && len(credentials.Mrn) > 0 {
s.Client.ParentMrn = credentials.ScopeMrn
Copy link
Member

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

@slntopp slntopp requested a review from imilchev July 10, 2024 10:51
@slntopp slntopp merged commit 11d6311 into main Jul 10, 2024
15 checks passed
@slntopp slntopp deleted the mik/check-api-status-on-login-errors branch July 10, 2024 10:51
@github-actions github-actions bot locked and limited conversation to collaborators Jul 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cnspec login clock screw, wrong error message
2 participants