Skip to content

Commit

Permalink
Fixed lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamsugara22 committed Nov 13, 2024
1 parent fd6f03c commit 4f36ed6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/patch/patch.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func patchWithContext(ctx context.Context, ch chan error, image, reportFile, pat
log.Warnf("Image name has no tag or digest, using latest as tag")
imageName = reference.TagNameOnly(imageName)
}
var tag string
var tag string
var digest string
if taggedName, ok := imageName.(reference.Tagged); ok {
tag = taggedName.Tag()
Expand All @@ -94,7 +94,7 @@ func patchWithContext(ctx context.Context, ch chan error, image, reportFile, pat
imageName, err = reference.WithDigest(imageName, digest)

Check failure on line 94 in pkg/patch/patch.go

View workflow job for this annotation

GitHub Actions / lint

cannot use digest (variable of type string) as "github.com/opencontainers/go-digest".Digest value in argument to reference.WithDigest

Check failure on line 94 in pkg/patch/patch.go

View workflow job for this annotation

GitHub Actions / lint

cannot use digest (variable of type string) as "github.com/opencontainers/go-digest".Digest value in argument to reference.WithDigest

Check failure on line 94 in pkg/patch/patch.go

View workflow job for this annotation

GitHub Actions / Build (ubuntu-latest)

cannot use digest (variable of type string) as "github.com/opencontainers/go-digest".Digest value in argument to reference.WithDigest

Check failure on line 94 in pkg/patch/patch.go

View workflow job for this annotation

GitHub Actions / vuln-check

cannot use digest (variable of type string) as "github.com/opencontainers/go-digest".Digest value in argument to reference.WithDigest

Check failure on line 94 in pkg/patch/patch.go

View workflow job for this annotation

GitHub Actions / Unit Test

cannot use digest (variable of type string) as "github.com/opencontainers/go-digest".Digest value in argument to reference.WithDigest

Check failure on line 94 in pkg/patch/patch.go

View workflow job for this annotation

GitHub Actions / Analyze (go)

cannot use digest (variable of type string) as "github.com/opencontainers/go-digest".Digest value in argument to reference.WithDigest
if err != nil {
return err
}
}
} else {
log.Warnf("Image name has no tag")
}
Expand All @@ -111,10 +111,10 @@ func patchWithContext(ctx context.Context, ch chan error, image, reportFile, pat
return fmt.Errorf("%w with patched tag %s", err, patchedTag)
}
// Make sure the digest was successfully fetched earlier and is valid
if digest == "" {
return fmt.Errorf("failed to fetch digest for image %s", imageName)
}
if digest == "" {
return fmt.Errorf("failed to fetch digest for image %s", imageName)
}

patchedImageName := fmt.Sprintf("%s@sha256:%s", imageName.Name(), digest)

// Ensure working folder exists for call to InstallUpdates
Expand Down

0 comments on commit 4f36ed6

Please sign in to comment.