Skip to content

Commit

Permalink
[BACKPORT 2.20.8][PLAT-15781] Add try/catch block for fetching access…
Browse files Browse the repository at this point in the history
… key

Summary:
Add try/catch block for fetching access key.
Original Commit - 0d4e6bc
Depends on - D39246

Test Plan:
Created a universe using YNP.
Performed shrink universe.
Verified that operation is successful.

Reviewers: anijhawan, nbhatia, skhilar

Reviewed By: nbhatia

Subscribers: yugaware

Differential Revision: https://phorge.dev.yugabyte.com/D40130
  • Loading branch information
Vars-07 committed Nov 21, 2024
1 parent edcc9bf commit c5b1f31
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1761,9 +1761,15 @@ protected void deleteNodeAgent(NodeDetails nodeDetails) {
Cluster cluster = getUniverse().getCluster(nodeDetails.placementUuid);
Provider provider = Provider.getOrBadRequest(UUID.fromString(cluster.userIntent.provider));
if (provider.getCloudCode() == CloudType.onprem) {
AccessKey accessKey =
AccessKey.getOrBadRequest(provider.getUuid(), cluster.userIntent.accessKeyCode);
if (accessKey.getKeyInfo().skipProvisioning) {
try {
AccessKey accessKey =
AccessKey.getOrBadRequest(provider.getUuid(), cluster.userIntent.accessKeyCode);
if (accessKey.getKeyInfo().skipProvisioning) {
return;
}
} catch (Exception e) {
// Access Key are optional for onprem providers. We can return in case it is not
// present as the nodes will be manually provisioned.
return;
}
}
Expand Down

0 comments on commit c5b1f31

Please sign in to comment.