From d6fad2fd324d9b82ab54b0c251ee8ab950e70ee0 Mon Sep 17 00:00:00 2001 From: Carter McKinnon Date: Thu, 26 Sep 2024 00:44:34 +0000 Subject: [PATCH] ecr-credential-provider: Fix warning about no region in image ref --- cmd/ecr-credential-provider/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/ecr-credential-provider/main.go b/cmd/ecr-credential-provider/main.go index d6b745e572..ab0f313594 100644 --- a/cmd/ecr-credential-provider/main.go +++ b/cmd/ecr-credential-provider/main.go @@ -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,