-
Notifications
You must be signed in to change notification settings - Fork 166
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
Handle Prometheus OAuth Issue #831
Handle Prometheus OAuth Issue #831
Conversation
ebddefc
to
86d8cf7
Compare
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.
lgtm
7cb9d4a
to
86d8cf7
Compare
if (errorMessage.includes('Unexpected token < in JSON')) { | ||
reject({ code: 422, response: 'Unprocessable prometheus response' }); | ||
return; | ||
} | ||
fastify.log.error(`Unparsed Prometheus data. ${rawData}`); | ||
reject({ code: 500, response: rawData }); |
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.
Out of curiosity, do we ever really want to do a 500 here?
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.
The server ran into an error that shouldn't happen. It's a 500 by definition, no?
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.
well, I guess I was on the fence since in this case we were trying to look up something and failed to find it, perhaps we could have justified a 4XX. I guess 500 or 502 is probably more appropriate.
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.
Well, the reason could be anything... but I suppose it's likely 502 in this case as the target of the call is misbehaving so it likely is having issues.
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED Approval requirements bypassed by manually added approval. This pull-request has been approved by: cfchase, DaoDaoNoCode, lucferbux The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Resolves: #832
Description
When the OAuth token expires, it triggers a 500 error from a prometheus call for DS Projects when it tries to get the fill-size of the PVCs that are created.
How Has This Been Tested?
I tested this by suffixing the Authorization header with extra characters -- thus mimicking an invalid token.
Merge criteria: