Skip to content

Commit

Permalink
fix ident
Browse files Browse the repository at this point in the history
  • Loading branch information
simar7 committed Jan 31, 2025
1 parent e7b9002 commit d36f206
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions pkg/plugins/trivy/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ func (p *plugin) NewConfigForConfigAudit(ctx trivyoperator.PluginContext) (confi
return getConfig(ctx)
}


func (p *plugin) parseImageRef(imageRef, imageDigest string) (v1alpha1.Registry, v1alpha1.Artifact, error) {
ref, err := containerimage.ParseReference(imageRef)
if err != nil {
Expand Down Expand Up @@ -266,15 +265,15 @@ func ExcludeImage(excludeImagePattern []string, imageName string) bool {
}

// getImageDigest extracts the image digest from the report metadata, returns empty string if not available
func (p *plugin) getImageDigest(reports ty.Report) (string) {
if len(reports.Metadata.RepoDigests) == 0 {
return ""
}
func (p *plugin) getImageDigest(reports ty.Report) string {
if len(reports.Metadata.RepoDigests) == 0 {
return ""
}

split := strings.Split(reports.Metadata.RepoDigests[0], "@")
if len(split) < 2 {
return ""
}
split := strings.Split(reports.Metadata.RepoDigests[0], "@")
if len(split) < 2 {
return ""
}

return split[1]
return split[1]
}

0 comments on commit d36f206

Please sign in to comment.