Skip to content

Commit

Permalink
Merge pull request #1743 from jparrill/bug/HOSTEDCP-528
Browse files Browse the repository at this point in the history
bug: Fixes HOSTEDCP-528, OIDCConfigurationInvalidReason should be always present
  • Loading branch information
openshift-merge-robot authored Oct 17, 2022
2 parents 6fe25bb + 2597a6c commit a426817
Showing 1 changed file with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1340,17 +1340,15 @@ func (r *HostedClusterReconciler) reconcile(ctx context.Context, req ctrl.Reques
}
return ctrl.Result{}, fmt.Errorf("failed to reconcile the AWS OIDC documents: %w", err)
}
if meta.IsStatusConditionFalse(hcluster.Status.Conditions, string(hyperv1.ValidOIDCConfiguration)) {
meta.SetStatusCondition(&hcluster.Status.Conditions, metav1.Condition{
Type: string(hyperv1.ValidOIDCConfiguration),
Status: metav1.ConditionTrue,
Reason: hyperv1.AsExpectedReason,
ObservedGeneration: hcluster.Generation,
Message: "OIDC configuration is valid",
})
if err := r.Client.Status().Update(ctx, hcluster); err != nil {
return ctrl.Result{}, fmt.Errorf("failed to update status: %w", err)
}
meta.SetStatusCondition(&hcluster.Status.Conditions, metav1.Condition{
Type: string(hyperv1.ValidOIDCConfiguration),
Status: metav1.ConditionTrue,
Reason: hyperv1.AsExpectedReason,
ObservedGeneration: hcluster.Generation,
Message: "OIDC configuration is valid",
})
if err := r.Client.Status().Update(ctx, hcluster); err != nil {
return ctrl.Result{}, fmt.Errorf("failed to update status: %w", err)
}
}

Expand Down Expand Up @@ -1868,13 +1866,13 @@ func (r *HostedClusterReconciler) reconcileAutoscaler(ctx context.Context, creat
// image based on the following order of precedence (from most to least
// preferred):
//
// 1. The image specified by the ControlPlaneOperatorImageAnnotation on the
// HostedCluster resource itself
// 2. The hypershift image specified in the release payload indicated by the
// HostedCluster's release field
// 3. The hypershift-operator's own image for release versions 4.9 and 4.10
// 4. The registry.ci.openshift.org/hypershift/hypershift:4.8 image for release
// version 4.8
// 1. The image specified by the ControlPlaneOperatorImageAnnotation on the
// HostedCluster resource itself
// 2. The hypershift image specified in the release payload indicated by the
// HostedCluster's release field
// 3. The hypershift-operator's own image for release versions 4.9 and 4.10
// 4. The registry.ci.openshift.org/hypershift/hypershift:4.8 image for release
// version 4.8
//
// If no image can be found according to these rules, an error is returned.
func GetControlPlaneOperatorImage(ctx context.Context, hc *hyperv1.HostedCluster, releaseProvider releaseinfo.Provider, hypershiftOperatorImage string, pullSecret []byte) (string, error) {
Expand Down

0 comments on commit a426817

Please sign in to comment.