Skip to content

Commit

Permalink
ecr-credential-provider: Fix warning about no region in image ref
Browse files Browse the repository at this point in the history
  • Loading branch information
cartermckinnon committed Sep 26, 2024
1 parent d7e05d5 commit d6fad2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/ecr-credential-provider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ type ecrPlugin struct {
func defaultECRProvider(region string) (*ecr.ECR, error) {
cfg := aws.Config{}
if region != "" {
klog.Warningf("No region found in the image reference, the default region will be used. Please refer to AWS SDK documentation for configuration purpose.")
cfg.Region = aws.String(region)
} else {
klog.Warningf("No region found in the image reference, the default region will be used. Please refer to AWS SDK documentation for configuration purpose.")
}
sess, err := session.NewSessionWithOptions(session.Options{
Config: cfg,
Expand Down

0 comments on commit d6fad2f

Please sign in to comment.