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 committed Dec 13, 2024
1 parent cc610c5 commit 1fc657a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -597,12 +597,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 1fc657a

Please sign in to comment.