diff options
author | Valerij Fredriksen <valerijf@yahooinc.com> | 2021-11-08 14:58:52 +0100 |
---|---|---|
committer | Valerij Fredriksen <valerijf@yahooinc.com> | 2021-11-08 14:58:52 +0100 |
commit | a2992d6a7d6432854cf920a19d6e2f20dbe3d58a (patch) | |
tree | 4c9cce446be5cb77de07a92dc4351250533c64bc /jdisc-cloud-aws/src | |
parent | 757e30efaec1783c0feea9b6735cc3aa855d11d9 (diff) |
Only read the new AWS credentials file
Diffstat (limited to 'jdisc-cloud-aws/src')
-rw-r--r-- | jdisc-cloud-aws/src/main/java/com/yahoo/jdisc/cloud/aws/VespaAwsCredentialsProvider.java | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/jdisc-cloud-aws/src/main/java/com/yahoo/jdisc/cloud/aws/VespaAwsCredentialsProvider.java b/jdisc-cloud-aws/src/main/java/com/yahoo/jdisc/cloud/aws/VespaAwsCredentialsProvider.java index 4424b63dcc4..1991ff3ad88 100644 --- a/jdisc-cloud-aws/src/main/java/com/yahoo/jdisc/cloud/aws/VespaAwsCredentialsProvider.java +++ b/jdisc-cloud-aws/src/main/java/com/yahoo/jdisc/cloud/aws/VespaAwsCredentialsProvider.java @@ -13,24 +13,19 @@ import com.yahoo.slime.SlimeUtils; import java.io.IOException; import java.io.UncheckedIOException; import java.nio.file.Files; -import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.util.concurrent.atomic.AtomicReference; public class VespaAwsCredentialsProvider implements AWSCredentialsProvider { private static final String DEFAULT_CREDENTIALS_PATH = "/opt/vespa/var/vespa/aws/credentials.json"; - // TODO (freva): Remove when host-admin writes to the new path above - private static final String DEFAULT_CREDENTIALS_PATH_OLD = "/opt/vespa/var/container-data/opt/vespa/conf/vespa/credentials.json"; private final AtomicReference<AWSCredentials> credentials = new AtomicReference<>(); private final Path credentialsPath; - private final Path credentialsPathOld; public VespaAwsCredentialsProvider() { this.credentialsPath = Path.of(DEFAULT_CREDENTIALS_PATH); - this.credentialsPathOld = Path.of(DEFAULT_CREDENTIALS_PATH_OLD); refresh(); } @@ -50,12 +45,7 @@ public class VespaAwsCredentialsProvider implements AWSCredentialsProvider { private AWSSessionCredentials readCredentials() { try { - Slime slime; - try { - slime = SlimeUtils.jsonToSlime(Files.readAllBytes(credentialsPath)); - } catch (NoSuchFileException ignored) { - slime = SlimeUtils.jsonToSlime(Files.readAllBytes(credentialsPathOld)); - } + Slime slime = SlimeUtils.jsonToSlime(Files.readAllBytes(credentialsPath)); Cursor cursor = slime.get(); String accessKey = cursor.field("awsAccessKey").asString(); String secretKey = cursor.field("awsSecretKey").asString(); |