Skip to content

Commit 3967255

Browse files
authored
fix: Checking the artifact cache only if the resource artifact status is set (#98)
Signed-off-by: Rashed Kamal <[email protected]> The MavenArtifact API status condition was set incorrectly during the artifact cache check. This PR adds a check for the resource `status.artifact` while verifying the artifact cache.
1 parent 40a035f commit 3967255

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

controllers/mavenartifact_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ func MavenArtifactDownloadSyncReconciler(httpRootDir, httpHost string, now func(
321321
return err
322322
}
323323

324-
// Compare checksum with cache
325-
if cache != nil {
324+
// Compare checksum with cache if the resource status.artifact is set
325+
if cache != nil && parent.Status.Artifact != nil {
326326
if cache.checksum == remoteChecksum && cache.source == artifactInfo.ArtifactDownloadURL {
327327
log.Info("download skipped", "checksum matched on disc", cache.checksum, "checksum from remote repository", remoteChecksum)
328328
return nil

0 commit comments

Comments
 (0)