Skip to content

Commit

Permalink
small tweaks for generatebundlefile (#574)
Browse files Browse the repository at this point in the history
Signed-off-by: jonahjon <jonahjones094@gmail.com>

Signed-off-by: jonahjon <jonahjones094@gmail.com>
  • Loading branch information
jonahjon authored Oct 20, 2022
1 parent a2d76d9 commit 9a4085a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions generatebundlefile/ecr.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (c *ecrClient) GetShaForInputs(project Project) ([]api.SourceVersion, error
if *images.ImageManifestMediaType != "application/vnd.oci.image.manifest.v1+json" || len(images.ImageTags) == 0 {
continue
}
if len(images.ImageTags) == 1 {
if len(images.ImageTags) > 0 {
v := &api.SourceVersion{Name: tag.Name, Digest: *images.ImageDigest}
sourceVersion = append(sourceVersion, *v)
continue
Expand Down Expand Up @@ -115,7 +115,7 @@ func (c *ecrClient) GetShaForInputs(project Project) ([]api.SourceVersion, error
continue
}
//
if strings.Contains(tag.Name, "-latest") {
if strings.HasSuffix(tag.Name, "-latest") {
regex := regexp.MustCompile(`-latest`)
splitVersion := regex.Split(tag.Name, -1) //extract out the version without the latest
ImageDetails, err := c.Describe(&ecr.DescribeImagesInput{
Expand Down
2 changes: 1 addition & 1 deletion generatebundlefile/ecr_public.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (c *ecrPublicClient) GetShaForPublicInputs(project Project) ([]api.SourceVe
continue
}
//
if strings.Contains(tag.Name, "-latest") {
if strings.HasSuffix(tag.Name, "-latest") {
regex := regexp.MustCompile(`-latest`)
splitVersion := regex.Split(tag.Name, -1) //extract out the version without the latest
ImageDetails, err := c.DescribePublic(&ecrpublic.DescribeImagesInput{
Expand Down

0 comments on commit 9a4085a

Please sign in to comment.