Skip to content

Commit

Permalink
control-service: force aws cred provider refresh (#2879)
Browse files Browse the repository at this point in the history
what: Forced the AWS credentials service to refresh credentials before
passing them to the data job builder task.

why: Users of the control-service noticed that the job builder task
would occasionally fail with 401 unauthorized when attempting to push
images to aws ecr repository. Since some builders take longer to build
the images, it is possible that a passed valid credential expired during
build. As per the aws documentation: "This credentials provider uses a
background thread to refresh credentials." though it is unclear when
credentials are rotated. Note this behaviour of the provider was changed
in a aws update, previously the credentials were generated before every
request.

testing: existing tests should cover this.

Signed-off-by: mrMoZ1 <[email protected]>
  • Loading branch information
Momchil Z authored Nov 6, 2023
1 parent bcdc43d commit 74cd3ab
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public AWSCredentialsDTO createTemporaryCredentials() {
"",
awsCredentialsServiceConfig.getRegion());
}
credentialsProvider.refresh();
AWSSessionCredentials serviceAccountCredentials = credentialsProvider.getCredentials();
var accessKeyId = serviceAccountCredentials.getAWSAccessKeyId();
var secretAccessKey = serviceAccountCredentials.getAWSSecretKey();
Expand Down

0 comments on commit 74cd3ab

Please sign in to comment.