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

PMM-11714 Don't return an error if API key can't be created. #2469

Merged
merged 17 commits into from
Nov 13, 2023

Conversation

BupycHuk
Copy link
Member

@BupycHuk BupycHuk commented Sep 7, 2023

PMM-11714

Link to the Feature Build: SUBMODULES-3381

If this PR adds or removes or alters one or more API endpoints, please review and add or update the relevant API documents as well:

  • API Docs updated

If this PR is related to some other PRs in this or other repositories, please provide links to those PRs:

  • Links to related pull requests (optional).

@BupycHuk BupycHuk requested a review from a team as a code owner September 7, 2023 14:22
@BupycHuk BupycHuk requested review from idoqo and artemgavrilov and removed request for a team September 7, 2023 14:23
@codecov
Copy link

codecov bot commented Sep 7, 2023

Codecov Report

Merging #2469 (0c5521c) into main (80e4c8b) will decrease coverage by 0.05%.
The diff coverage is 59.45%.

@@            Coverage Diff             @@
##             main    #2469      +/-   ##
==========================================
- Coverage   42.76%   42.71%   -0.05%     
==========================================
  Files         391      391              
  Lines       49043    49173     +130     
==========================================
+ Hits        20971    21005      +34     
- Misses      26096    26189      +93     
- Partials     1976     1979       +3     
Flag Coverage Δ
admin 10.45% <0.00%> (-0.01%) ⬇️
agent 53.44% <ø> (-0.16%) ⬇️
managed 43.46% <61.11%> (-0.02%) ⬇️
vmproxy 68.57% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
managed/services/grafana/auth_server.go 53.14% <100.00%> (+0.70%) ⬆️
managed/services/grafana/client.go 44.70% <100.00%> (+0.11%) ⬆️
admin/commands/management/register.go 5.40% <0.00%> (+5.40%) ⬆️
managed/services/management/node.go 58.41% <36.36%> (-4.68%) ⬇️

... and 20 files with indirect coverage changes

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

// get authorization from headers.
md, ok := metadata.FromIncomingContext(ctx)
if !ok {
msg := "Couldn't create Admin API Key: cannot get headers from metadata"
Copy link
Contributor

Choose a reason for hiding this comment

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

was curious - is there anything fatal that can happen if we can't generate the admin role api key? and is there anything the user can do in such a case?

Copy link
Member Author

Choose a reason for hiding this comment

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

we discussed with GAS team and made decission that register shouldn't fail in case it's not possible to create an API key. So pmm-agent will keep using user credentials instead of API key.

docker-compose.yml Outdated Show resolved Hide resolved
managed/services/grafana/client.go Outdated Show resolved Hide resolved
@BupycHuk BupycHuk requested review from ademidoff and idoqo September 27, 2023 09:52
@BupycHuk BupycHuk changed the title PMM-11714-dont-return-error PMM-11714 Don't return an error if API key can't be created. Sep 27, 2023
@BupycHuk BupycHuk requested a review from ademidoff October 5, 2023 22:04
@BupycHuk BupycHuk enabled auto-merge (squash) November 13, 2023 10:14
@BupycHuk BupycHuk merged commit 9fa78dd into main Nov 13, 2023
31 checks passed
@BupycHuk BupycHuk deleted the PMM-11714-dont-return-error branch November 13, 2023 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants