Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pkg/controllers/nodeclass/status/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ func (c *Controller) Reconcile(ctx context.Context, nodeClass *v1alpha1.ECSNodeC
errs = multierr.Append(errs, client.IgnoreNotFound(err))
}
}

if errs != nil {
return reconcile.Result{}, errs
if result.Min(results...).RequeueAfter > 0 {
return result.Min(results...), nil
}
return result.Min(results...), nil

return reconcile.Result{}, errs
}

func (c *Controller) Register(_ context.Context, m manager.Manager) error {
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/nodeclass/status/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (i *Image) Reconcile(ctx context.Context, nodeClass *v1alpha1.ECSNodeClass)
images, err := i.imageProvider.List(ctx, nodeClass)
if err != nil {
log.FromContext(ctx).Error(err, "failed to list images")
return reconcile.Result{}, err
return reconcile.Result{RequeueAfter: time.Second * 30}, err
}

if len(images) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/nodeclass/status/securitygroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type SecurityGroup struct {
func (sg *SecurityGroup) Reconcile(ctx context.Context, nodeClass *v1alpha1.ECSNodeClass) (reconcile.Result, error) {
securityGroups, err := sg.securityGroupProvider.List(ctx, nodeClass)
if err != nil {
return reconcile.Result{}, fmt.Errorf("getting security groups, %w", err)
return reconcile.Result{RequeueAfter: time.Second * 30}, fmt.Errorf("getting security groups, %w", err)
}
if len(securityGroups) == 0 && len(nodeClass.Spec.SecurityGroupSelectorTerms) > 0 {
nodeClass.Status.SecurityGroups = nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/nodeclass/status/vswitch.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type VSwitch struct {
func (v *VSwitch) Reconcile(ctx context.Context, nodeClass *v1alpha1.ECSNodeClass) (reconcile.Result, error) {
vSwitches, err := v.vSwitchProvider.List(ctx, nodeClass)
if err != nil {
return reconcile.Result{}, fmt.Errorf("getting vSwitches, %w", err)
return reconcile.Result{RequeueAfter: time.Second * 30}, fmt.Errorf("getting vSwitches, %w", err)
}
if len(vSwitches) == 0 {
nodeClass.Status.VSwitches = nil
Expand Down