Skip to content

Commit

Permalink
pao:hypershift: add management client
Browse files Browse the repository at this point in the history
Adding a management client to be used on a hypershift platform.

Signed-off-by: Talor Itzhak <[email protected]>
  • Loading branch information
Tal-or committed May 15, 2024
1 parent 911eab4 commit be1e986
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions cmd/cluster-node-tuning-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ func operatorRun() {
}
if err = (&paocontroller.PerformanceProfileReconciler{
Client: mgr.GetClient(),
ManagementClient: mgr.GetClient(),
Recorder: mgr.GetEventRecorderFor("performance-profile-controller"),
FeatureGate: fg,
ComponentsHandler: handler.NewHandler(mgr.GetClient(), mgr.GetScheme()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const finalizer = "foreground-deletion"
// PerformanceProfileReconciler reconciles a PerformanceProfile object
type PerformanceProfileReconciler struct {
client.Client
ManagementClient client.Client
Recorder record.EventRecorder
FeatureGate featuregates.FeatureGate
ComponentsHandler components.Handler
Expand Down Expand Up @@ -424,8 +425,6 @@ func (r *PerformanceProfileReconciler) Reconcile(ctx context.Context, req ctrl.R
return ctrl.Result{}, nil
}

func (r *PerformanceProfileReconciler) isMixedCPUsEnabled(profile *performancev2.PerformanceProfile) bool {
if !r.FeatureGate.Enabled(apiconfigv1.FeatureGateMixedCPUsAllocation) {
func (r *PerformanceProfileReconciler) isMixedCPUsEnabled(object client.Object) bool {
if ntoconfig.InHyperShift() {
return false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,7 @@ func newFakeReconciler(profile client.Object, initObjects ...runtime.Object) *Pe
fg, _ := fakeFeatureGateAccessor.CurrentFeatureGates()
return &PerformanceProfileReconciler{
Client: fakeClient,
ManagementClient: fakeClient,
Recorder: fakeRecorder,
FeatureGate: fg,
ComponentsHandler: handler.NewHandler(fakeClient, scheme.Scheme),
Expand Down

0 comments on commit be1e986

Please sign in to comment.