Skip to content

Commit

Permalink
Fix a bug in workloadmeta containerd collector (#15260)
Browse files Browse the repository at this point in the history
  • Loading branch information
L3n41c authored Jan 25, 2023
1 parent 8210e2b commit cb5c4e1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/workloadmeta/collectors/internal/containerd/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,7 @@ func (c *collector) notifyEventForImage(ctx context.Context, namespace string, i
imageName := img.Name()
registry := ""
shortName := ""
parsedImg, err := workloadmeta.NewContainerImage(imageName)
if err == nil {
// Don't set a short name. We know that some images handled here contain
// "sha256" in the name, and those don't have a short name.
} else {
if parsedImg, err := workloadmeta.NewContainerImage(imageName); err == nil {
registry = parsedImg.Registry
shortName = parsedImg.ShortName
}
Expand Down

0 comments on commit cb5c4e1

Please sign in to comment.