Skip to content

Commit

Permalink
add repo not found clause
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnvdp committed Aug 18, 2023
1 parent 1a69c19 commit 04cbc0b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/lambda/check_digest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func Test_checkDigest(t *testing.T) {
"docker.io/nginx:1.23.3": {
name: "nginx",
tag: "1.23.3",
hash: "sha256:942ae2dfd73088b54d7151a3c3fd5af038a51c50029bfcfd21f1e650d9579967",
hash: "sha256:557c9ede65655e5a70e4a32f1651638ea3bfb0802edd982810884602f700ba25",
},
},
},
Expand Down
1 change: 1 addition & 0 deletions pkg/lambda/ecr.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ func (svc *ecrClient) getECRRepositories(inputRepositories []string) (repositori

if err != nil {
log.Printf("Error: %s", err)
return nil, err
}

return repositories, err
Expand Down
6 changes: 6 additions & 0 deletions pkg/lambda/lambda.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ func Start(ctx context.Context, event LambdaEvent) (response, error) {
repositories, err = svc.getinputRepositorysFromTags(names)

if err != nil {
if strings.Contains(err.Error(), "RepositoryNotFoundException") {
return response{
Message: "Repository not found",
Ok: true,
}, nil
}
return returnErr(err, environmentVars.slackOAuthToken, event.SlackChannelID, errSubject,
"Error getting input images from tags")
}
Expand Down

0 comments on commit 04cbc0b

Please sign in to comment.