Skip to content

Commit

Permalink
cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnvdp committed Mar 6, 2023
1 parent 37b47a5 commit 991d0cd
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions pkg/lambda/lambda.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,9 @@ func Start(ctx context.Context, event LambdaEvent) (response, error) {
"Error creating ECR client:")
}

switch {
// if Repositories is set, get sync options from tags for the specified repositories arns
case len(event.Repositories) > 0:
names := ecrRepoNamesFromAWSARNs(event.Repositories, environmentVars.awsRegion, environmentVars.awsAccount)
repositories, err = svc.getinputRepositorysFromTags(names)
// default case, lookup all configured repositories
default:
repositories, err = svc.getinputRepositorysFromTags(nil)
}
names := ecrRepoNamesFromAWSARNs(event.Repositories, environmentVars.awsRegion, environmentVars.awsAccount)
repositories, err = svc.getinputRepositorysFromTags(names)

if err != nil {
return returnErr(err, environmentVars.slackOAuthToken, event.SlackChannelID, errSubject,
"Error getting input images from tags")
Expand Down

0 comments on commit 991d0cd

Please sign in to comment.