From eec257b827c067b000635db45b52f0359f5cdef0 Mon Sep 17 00:00:00 2001 From: Agnis Mateuss Date: Fri, 15 Sep 2023 16:56:08 +0300 Subject: [PATCH] fixed ECR login command --- cmd/ciImageLogin.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/ciImageLogin.go b/cmd/ciImageLogin.go index 9680508..702700c 100644 --- a/cmd/ciImageLogin.go +++ b/cmd/ciImageLogin.go @@ -132,8 +132,10 @@ Available flags and environment variables: if err != nil { log.Fatal("Error:", err) } + //Remove newline + awsAccountId = []byte(strings.TrimSuffix(string(awsAccountId), "\n")) // ECR login - command = fmt.Sprintf("aws ecr get-login-password --region %q | docker login --username AWS --password-stdin %s.dkr.ecr.%q.amazonaws.com", awsRegion, awsAccountId, awsRegion) + command = fmt.Sprintf("aws ecr get-login-password --region %s | docker login --username AWS --password-stdin %s.dkr.ecr.%s.amazonaws.com", awsRegion, awsAccountId, awsRegion) // TODO: use aws cli v2 // command = fmt.Sprintf("echo %q | docker login --username AWS --password-stdin %s", awsSecretAccessKey, imageRepoHost)