Skip to content

Commit e863569

Browse files
committed
fix
1 parent 42e7ad1 commit e863569

File tree

2 files changed

+16
-22
lines changed

2 files changed

+16
-22
lines changed

api/v1beta1/v1beta2_condition_consts.go

-6
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,6 @@ const (
8383
// Please use object specific variants of this condition which provides more details for each context where
8484
// the same condition type exists.
8585
PausedV1Beta2Condition = "Paused"
86-
87-
// ResourceNotPausedV1Beta2Reason surfaces when a resource has been paused.
88-
ResourceNotPausedV1Beta2Reason = "ResourceNotPaused"
89-
90-
// ResourcePausedV1Beta2Reason surfaces when a resource is not paused.
91-
ResourcePausedV1Beta2Reason = "ResourcePaused"
9286
)
9387

9488
// Reasons that are used across different objects.

internal/controllers/machineset/machineset_controller.go

+16-16
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,22 @@ func patchMachineSet(ctx context.Context, patchHelper *patch.Helper, machineSet
309309
return patchHelper.Patch(ctx, machineSet, options...)
310310
}
311311

312+
func (r *Reconciler) getOwningMachineDeployment(ctx context.Context, s *scope) (ctrl.Result, error) {
313+
if !isDeploymentChild(s.machineSet) {
314+
// If the MachineSet is not in a MachineDeployment, return immediately.
315+
return ctrl.Result{}, nil
316+
}
317+
318+
// Otherwise get the owning MachineDeployment
319+
var err error
320+
s.owningMachineDeployment, err = r.getOwnerMachineDeployment(ctx, s.machineSet)
321+
if err != nil {
322+
return ctrl.Result{}, err
323+
}
324+
325+
return ctrl.Result{}, nil
326+
}
327+
312328
func (r *Reconciler) reconcileMachineSetOwnerAndLabels(_ context.Context, s *scope) (ctrl.Result, error) {
313329
// Reconcile and retrieve the Cluster object.
314330
if s.machineSet.Labels == nil {
@@ -342,22 +358,6 @@ func (r *Reconciler) reconcileMachineSetOwnerAndLabels(_ context.Context, s *sco
342358
return ctrl.Result{}, nil
343359
}
344360

345-
func (r *Reconciler) getOwningMachineDeployment(ctx context.Context, s *scope) (ctrl.Result, error) {
346-
if !isDeploymentChild(s.machineSet) {
347-
// If the MachineSet is not in a MachineDeployment, return immediately.
348-
return ctrl.Result{}, nil
349-
}
350-
351-
// Otherwise get the owning MachineDeployment
352-
var err error
353-
s.owningMachineDeployment, err = r.getOwnerMachineDeployment(ctx, s.machineSet)
354-
if err != nil {
355-
return ctrl.Result{}, err
356-
}
357-
358-
return ctrl.Result{}, nil
359-
}
360-
361361
func (r *Reconciler) reconcileInfrastructure(ctx context.Context, s *scope) (ctrl.Result, error) {
362362
// Make sure to reconcile the external infrastructure reference.
363363
var err error

0 commit comments

Comments
 (0)