Skip to content

Commit

Permalink
Fix issue for checking if app is running in an OCI instance which cau…
Browse files Browse the repository at this point in the history
…ses Instance Principal auth to fail
  • Loading branch information
klustria committed Jan 5, 2024
1 parent 69748a2 commit 51cfddf
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 Oracle and/or its affiliates.
* Copyright (c) 2023, 2024 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -46,7 +46,7 @@ static boolean runningOnOci(OciConfig ociConfig) {
return false;
}

return (Region.getRegionFromImds() != null);
return (Region.getRegionFromImds("http://" + ociConfig.imdsHostName() + "/opc/v2/") != null);
}

static boolean canReach(String address,
Expand Down

0 comments on commit 51cfddf

Please sign in to comment.