Skip to content

Commit

Permalink
packagevariant controller should unpropose deletion when needed (#3759)
Browse files Browse the repository at this point in the history
  • Loading branch information
natasha41575 committed Jan 27, 2023
1 parent 13c3683 commit 1cb21f9
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,14 @@ func (r *PackageVariantReconciler) findAndUpdateExistingRevisions(ctx context.Co
var err error
for i, downstream := range downstreams {
if r.isUpToDate(pv, downstream) {
if downstream.Spec.Lifecycle == porchapi.PackageRevisionLifecycleDeletionProposed {
// We proposed this package revision for deletion in the past, but now it
// matches our target, so we no longer want it to be deleted.
downstream.Spec.Lifecycle = porchapi.PackageRevisionLifecyclePublished
if err := r.Client.Update(ctx, downstream); err != nil {
klog.Errorf("error updating package revision lifecycle: %v", err)
}
}
continue
}
if porchapi.LifecycleIsPublished(downstream.Spec.Lifecycle) {
Expand Down

0 comments on commit 1cb21f9

Please sign in to comment.