Skip to content

Commit

Permalink
Merge pull request #17 from armosec/skip-emp
Browse files Browse the repository at this point in the history
skip empty repositories
  • Loading branch information
refaelm92 authored Dec 22, 2024
2 parents cbaffac + 41811a6 commit 2d033e1
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions registryclients/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ func (a *AWSRegistryClient) GetImagesToScan(_ context.Context) (map[string]strin
tag, err := getImageLatestTag(repository, iRegistry)
if err != nil {
return nil, err
} else if tag == "" {
return nil, fmt.Errorf("failed to find latest tag for repository %s", repository)
}
images[fmt.Sprintf("%s/%s", a.registryURI, repository)] = tag
if tag != "" {
images[fmt.Sprintf("%s/%s", a.registryURI, repository)] = tag
}
}
return images, nil
}
Expand Down
6 changes: 3 additions & 3 deletions registryclients/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ func (a *AzureRegistryClient) GetImagesToScan(_ context.Context) (map[string]str
tag, err := getImageLatestTag(repository, iRegistry)
if err != nil {
return nil, err
} else if tag == "" {
return nil, fmt.Errorf("failed to find latest tag for repository %s", repository)
}
images[fmt.Sprintf("%s/%s", a.Registry.LoginServer, repository)] = tag
if tag != "" {
images[fmt.Sprintf("%s/%s", a.Registry.LoginServer, repository)] = tag
}
}
return images, nil
}
Expand Down
6 changes: 3 additions & 3 deletions registryclients/google.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ func (g *GoogleArtifactRegistryClient) GetImagesToScan(_ context.Context) (map[s
tag, err := getImageLatestTag(repository, iRegistry)
if err != nil {
return nil, err
} else if tag == "" {
return nil, fmt.Errorf("failed to find latest tag for repository %s", repository)
}
images[fmt.Sprintf("%s/%s", g.Registry.RegistryURI, repository)] = tag
if tag != "" {
images[fmt.Sprintf("%s/%s", g.Registry.RegistryURI, repository)] = tag
}
}
return images, nil
}
Expand Down
6 changes: 3 additions & 3 deletions registryclients/harbor.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ func (h *HarborRegistryClient) GetImagesToScan(_ context.Context) (map[string]st
tag, err := getImageLatestTag(repository, iRegistry)
if err != nil {
return nil, err
} else if tag == "" {
return nil, fmt.Errorf("failed to find latest tag for repository %s", repository)
}
images[fmt.Sprintf("%s/%s", h.Registry.InstanceURL, repository)] = tag
if tag != "" {
images[fmt.Sprintf("%s/%s", h.Registry.InstanceURL, repository)] = tag
}
}
return images, nil
}
Expand Down
6 changes: 3 additions & 3 deletions registryclients/nexus.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ func (n *NexusRegistryClient) GetImagesToScan(_ context.Context) (map[string]str
tag, err := getImageLatestTag(repository, iRegistry)
if err != nil {
return nil, err
} else if tag == "" {
return nil, fmt.Errorf("failed to find latest tag for repository %s", repository)
}
images[fmt.Sprintf("%s/%s", n.Registry.RegistryURL, repository)] = tag
if tag != "" {
images[fmt.Sprintf("%s/%s", n.Registry.RegistryURL, repository)] = tag
}
}
return images, nil
}
Expand Down
6 changes: 3 additions & 3 deletions registryclients/quay.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ func (q *QuayRegistryClient) GetImagesToScan(_ context.Context) (map[string]stri
tag, err := getImageLatestTag(repository, iRegistry)
if err != nil {
return nil, err
} else if tag == "" {
return nil, fmt.Errorf("failed to find latest tag for repository %s", repository)
}
images[fmt.Sprintf("%s/%s", q.Registry.ContainerRegistryName, repository)] = tag
if tag != "" {
images[fmt.Sprintf("%s/%s", q.Registry.ContainerRegistryName, repository)] = tag
}
}
return images, nil
}
Expand Down

0 comments on commit 2d033e1

Please sign in to comment.