Skip to content

Commit

Permalink
Get HCP before Valid Release Image status patch
Browse files Browse the repository at this point in the history
This commit gets the latest HCP into memory before we update the Valid
Release Image status.

Signed-off-by: Bryan Cox <brcox@redhat.com>
  • Loading branch information
bryan-cox committed Dec 18, 2024
1 parent 6c125ab commit 92a0917
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -949,6 +949,11 @@ func (r *HostedControlPlaneReconciler) update(ctx context.Context, hostedControl
}
}

// Get the latest HCP in memory before we patch the status
if err = r.Client.Get(ctx, client.ObjectKeyFromObject(hostedControlPlane), hostedControlPlane); err != nil {
return reconcile.Result{}, err
}

originalHostedControlPlane := hostedControlPlane.DeepCopy()
missingImages := sets.New(releaseImageProvider.GetMissingImages()...).Insert(userReleaseImageProvider.GetMissingImages()...)
if missingImages.Len() == 0 {
Expand Down

0 comments on commit 92a0917

Please sign in to comment.