Skip to content

Commit

Permalink
fix: re-queue if failed to rollout (#2402)
Browse files Browse the repository at this point in the history
Co-authored-by: Amir Blum <[email protected]>
  • Loading branch information
RonFed and blumamir authored Feb 7, 2025
1 parent f1be20d commit 12e8942
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions instrumentor/controllers/agentenabled/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package agentenabled

import (
"context"
"errors"
"fmt"

"github.com/hashicorp/go-version"
Expand Down Expand Up @@ -40,22 +39,20 @@ type agentInjectedStatusCondition struct {
}

func reconcileAll(ctx context.Context, c client.Client) (ctrl.Result, error) {

allInstrumentationConfigs := odigosv1.InstrumentationConfigList{}
listErr := c.List(ctx, &allInstrumentationConfigs)
if listErr != nil {
return ctrl.Result{}, listErr
}

var err error
for _, ic := range allInstrumentationConfigs.Items {
_, workloadErr := reconcileWorkload(ctx, c, ic.Name, ic.Namespace)
if workloadErr != nil {
err = errors.Join(err, workloadErr)
res, err := reconcileWorkload(ctx, c, ic.Name, ic.Namespace)
if err != nil || !res.IsZero() {
return res, err
}
}

return ctrl.Result{}, err
return ctrl.Result{}, nil
}

func reconcileWorkload(ctx context.Context, c client.Client, icName string, namespace string) (ctrl.Result, error) {
Expand Down

0 comments on commit 12e8942

Please sign in to comment.