Skip to content

Commit

Permalink
add const string
Browse files Browse the repository at this point in the history
Signed-off-by: nithyatsu <[email protected]>
  • Loading branch information
nithyatsu committed Jul 25, 2024
1 parent 1eb91ad commit dcf38fc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/ucp/aws/ucpcredentialprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ const (
awsSTSGlobalEndPointSigningRegion = "us-east-1"
// AWS IRSA session name prefix
sessionPrefix = "radius-ucp-"
// Credential source
credentialSource = "radiusucp"
)

// UCPCredentialProvider is the implementation of aws.CredentialsProvider
Expand Down Expand Up @@ -99,7 +101,7 @@ func (c *UCPCredentialProvider) Retrieve(ctx context.Context) (aws.Credentials,
value = aws.Credentials{
AccessKeyID: s.AccessKeyCredential.AccessKeyID,
SecretAccessKey: s.AccessKeyCredential.SecretAccessKey,
Source: "radiusucp",
Source: credentialSource,
CanExpire: true,
Expires: time.Now().UTC().Add(c.options.Duration),
}
Expand Down Expand Up @@ -142,7 +144,7 @@ func (c *UCPCredentialProvider) Retrieve(ctx context.Context) (aws.Credentials,
logger.Info(fmt.Sprintf("Failed to retrieve AWS Credential IRSA - %s", err.Error()))
return aws.Credentials{}, err
}
value.Source = "radiusucp"
value.Source = credentialSource
value.CanExpire = true
value.Expires = time.Now().UTC().Add(c.options.Duration)
default:
Expand Down

0 comments on commit dcf38fc

Please sign in to comment.