Skip to content

Commit

Permalink
[EV-5299] Move windows os check under the license check
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitri-nicolo committed Oct 24, 2024
1 parent 9b5aaeb commit 10ff273
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,17 @@ func (r *ReconcilePolicyRecommendation) Reconcile(ctx context.Context, request r
return reconcile.Result{RequeueAfter: utils.StandardRetry}, nil
}

// Render a Policy Recommendation component for Windows if the cluster has Windows nodes.
hasWindowsNodes, err := common.HasWindowsNodes(r.client)
if err != nil {
r.status.SetDegraded(operatorv1.ResourceNotReady, "OS not found", err, logc)
return reconcile.Result{}, err
}
if hasWindowsNodes {
r.status.SetDegraded(operatorv1.ResourceValidationError, "Unsupported OS (Windows)", err, logc)
return reconcile.Result{}, err
}

license, err := utils.FetchLicenseKey(ctx, r.client)
if err != nil {
if errors.IsNotFound(err) {
Expand Down Expand Up @@ -431,12 +442,6 @@ func (r *ReconcilePolicyRecommendation) Reconcile(ctx context.Context, request r
return reconcile.Result{}, nil
}

// Render a Policy Recommendation component for Windows if the cluster has Windows nodes.
hasWindowsNodes, err := common.HasWindowsNodes(r.client)
if err != nil {
return reconcile.Result{}, err
}

policyRecommendationCfg := &render.PolicyRecommendationConfiguration{
ClusterDomain: r.clusterDomain,
Installation: installation,
Expand Down

0 comments on commit 10ff273

Please sign in to comment.