Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"encoding/json"
"fmt"
applyoperatorv1 "github.com/openshift/client-go/operator/applyconfigurations/operator/v1"
"net/http"
"sort"
"strings"
Expand All @@ -17,6 +16,7 @@ import (
corev1client "k8s.io/client-go/kubernetes/typed/core/v1"

operatorv1 "github.com/openshift/api/operator/v1"
applyoperatorv1 "github.com/openshift/client-go/operator/applyconfigurations/operator/v1"

"github.com/openshift/library-go/pkg/controller/factory"
"github.com/openshift/library-go/pkg/operator/condition"
Expand Down Expand Up @@ -226,7 +226,7 @@ func (c *ResourceSyncController) Sync(ctx context.Context, syncCtx factory.SyncC
}

_, _, err := resourceapply.SyncPartialConfigMap(ctx, c.configMapGetter, syncCtx.Recorder(), source.Namespace, source.Name, destination.Namespace, destination.Name, source.syncedKeys, []metav1.OwnerReference{})
if err != nil {
if err != nil && !apierrors.IsConflict(err) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this PR handling conflicts gracefully? 🙂

In my opinion, we should not hide errors.

A conflict error is still an error.
For example, it might indicate a conflict with a different actor in the system.

What we could do instead (if we aren’t already) is consider retrying certain types of requests when a conflict error occurs.

errors = append(errors, errorWithProvider(source.Provider, err))
}
}
Expand Down Expand Up @@ -254,7 +254,7 @@ func (c *ResourceSyncController) Sync(ctx context.Context, syncCtx factory.SyncC
}

_, _, err := resourceapply.SyncPartialSecret(ctx, c.secretGetter, syncCtx.Recorder(), source.Namespace, source.Name, destination.Namespace, destination.Name, source.syncedKeys, []metav1.OwnerReference{})
if err != nil {
if err != nil && !apierrors.IsConflict(err) {
errors = append(errors, errorWithProvider(source.Provider, err))
}
}
Expand Down