Skip to content

Commit

Permalink
fix for sporadic porch crash during new package revision
Browse files Browse the repository at this point in the history
  • Loading branch information
sriharshabm authored and JamesMcDermott committed Dec 17, 2024
1 parent 3d1c40f commit 63471cc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -644,12 +644,12 @@ func (r *PackageVariantReconciler) deletePackageRevision(ctx context.Context, pr
// determine if the downstream PR needs to be updated
func (r *PackageVariantReconciler) isUpToDate(pv *api.PackageVariant, downstream *porchapi.PackageRevision) bool {
if downstream.Status.UpstreamLock == nil {
klog.Warningf("status.upstreamLock is nil for PackageRevision %s.", pv.ObjectMeta.Name)
klog.Warningf("status.upstreamLock field is empty/missing in downstream PackageRevision: %s", pv.ObjectMeta.Name)
return true
}
upstreamLock := downstream.Status.UpstreamLock
if upstreamLock.Git == nil || upstreamLock.Git.Ref == "" {
klog.Warningf("status.upstreamLock.git or status.upstreamLock.git.ref is nil for PackageRevision %s.", pv.ObjectMeta.Name)
klog.Warningf("status.upstreamLock.git or status.upstreamLock.git.ref field is empty/missing in downstream PackageRevision: %s", pv.ObjectMeta.Name)
return true
}
lastIndex := strings.LastIndex(upstreamLock.Git.Ref, "/")
Expand Down

0 comments on commit 63471cc

Please sign in to comment.