Skip to content

Commit 0d4e6bc

Browse files
author
Shubham
committed
[PLAT-15781] Add try/catch block for fetching access key
Summary: Add try/catch block for fetching access key. Test Plan: Created a universe using YNP. Performed shrink universe. Verified that operation is successful. Reviewers: anijhawan, nbhatia, skhilar Reviewed By: anijhawan Subscribers: yugaware Differential Revision: https://phorge.dev.yugabyte.com/D39246
1 parent 54a01ac commit 0d4e6bc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

managed/src/main/java/com/yugabyte/yw/commissioner/tasks/UniverseTaskBase.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2161,9 +2161,15 @@ protected void deleteNodeAgent(NodeDetails nodeDetails) {
21612161
Cluster cluster = getUniverse().getCluster(nodeDetails.placementUuid);
21622162
Provider provider = Provider.getOrBadRequest(UUID.fromString(cluster.userIntent.provider));
21632163
if (provider.getCloudCode() == CloudType.onprem) {
2164-
AccessKey accessKey =
2165-
AccessKey.getOrBadRequest(provider.getUuid(), cluster.userIntent.accessKeyCode);
2166-
if (accessKey.getKeyInfo().skipProvisioning) {
2164+
try {
2165+
AccessKey accessKey =
2166+
AccessKey.getOrBadRequest(provider.getUuid(), cluster.userIntent.accessKeyCode);
2167+
if (accessKey.getKeyInfo().skipProvisioning) {
2168+
return;
2169+
}
2170+
} catch (Exception e) {
2171+
// Access Key are optional for onprem providers. We can return in case it is not
2172+
// present as the nodes will be manually provisioned.
21672173
return;
21682174
}
21692175
}

0 commit comments

Comments
 (0)