SREP-2441: Return the body of the error when backplane-api is unable to assume role#825
Conversation
|
@ratnam915: This pull request references SREP-2441 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #825 +/- ##
==========================================
+ Coverage 52.85% 53.18% +0.33%
==========================================
Files 86 86
Lines 6421 6430 +9
==========================================
+ Hits 3394 3420 +26
+ Misses 2576 2554 -22
- Partials 451 456 +5
🚀 New features to boost your workflow:
|
|
/test images |
|
@ratnam915: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/label tide/merge-method-squash |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ratnam915, samanthajayasinghe The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This PR has been created to address the issue of backplane-cli gets an error from backplane-api while it is assuming a role
and only the status code 500 is displayed, this PR address the issue by printing the response body along with the error.
Changes made to common.go
Unit test coverage for code changes carried out in common_test.go
As part of testing below is the change:
Error before:
ERRO[0015] failed to get cloud console for cluster 2mbm2lqoknnr4sn73utv5ar93a61dhb3: failed to assume role with isolated backplane flow: failed to fetch arn sequence: 500 Internal Server Error
Error after code change:
ERRO[0015] failed to get cloud console for cluster 2mbm2lqoknnr4sn73utv5ar93a61dhb3: failed to assume role with isolated backplane flow: failed to fetch arn sequence: error from backplane:
Status Code: 500
Message: error occurred for type assume-role-sequence, error: failed to assume orgrole: AccessDenied: User is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::123456789012:role/TestRole
(response body: {"statusCode":500,"message":"error occurred for type assume-role-sequence, error: failed to assume orgrole: AccessDenied: User is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::123456789012:role/TestRole","reason":"InternalError","details":{"error":"AWS STS AssumeRole failed","roleArn":"arn:aws:iam::123456789012:role/TestRole"}})