mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-02-14 10:00:11 +00:00
using mw finalizer instead of resource finalizer (#1211)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 32s
Post / coverage (push) Failing after 25s
Post / images (amd64, addon-manager) (push) Failing after 30s
Post / images (amd64, placement) (push) Failing after 15s
Post / images (amd64, registration) (push) Failing after 20s
Post / images (amd64, registration-operator) (push) Failing after 27s
Post / images (amd64, work) (push) Failing after 14s
Post / images (arm64, addon-manager) (push) Failing after 15s
Post / images (arm64, placement) (push) Failing after 19s
Post / images (arm64, registration) (push) Failing after 18s
Post / images (arm64, registration-operator) (push) Failing after 19s
Post / images (arm64, work) (push) Failing after 17s
Post / image manifest (addon-manager) (push) Has been skipped
Post / image manifest (placement) (push) Has been skipped
Post / image manifest (registration) (push) Has been skipped
Post / image manifest (registration-operator) (push) Has been skipped
Post / image manifest (work) (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Failing after 34s
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 32s
Post / coverage (push) Failing after 25s
Post / images (amd64, addon-manager) (push) Failing after 30s
Post / images (amd64, placement) (push) Failing after 15s
Post / images (amd64, registration) (push) Failing after 20s
Post / images (amd64, registration-operator) (push) Failing after 27s
Post / images (amd64, work) (push) Failing after 14s
Post / images (arm64, addon-manager) (push) Failing after 15s
Post / images (arm64, placement) (push) Failing after 19s
Post / images (arm64, registration) (push) Failing after 18s
Post / images (arm64, registration-operator) (push) Failing after 19s
Post / images (arm64, work) (push) Failing after 17s
Post / image manifest (addon-manager) (push) Has been skipped
Post / image manifest (placement) (push) Has been skipped
Post / image manifest (registration) (push) Has been skipped
Post / image manifest (registration-operator) (push) Has been skipped
Post / image manifest (work) (push) Has been skipped
Post / trigger clusteradm e2e (push) Has been skipped
Close stale issues and PRs / stale (push) Failing after 34s
Signed-off-by: Wei Liu <liuweixa@redhat.com>
This commit is contained in:
@@ -126,7 +126,7 @@ func (w *WorkService) HandleStatusUpdate(ctx context.Context, evt *cloudevents.E
|
||||
case types.UpdateRequestAction:
|
||||
// the work was deleted by agent, remove its finalizers
|
||||
if meta.IsStatusConditionTrue(work.Status.Conditions, common.ResourceDeleted) {
|
||||
return workPatcher.RemoveFinalizer(ctx, last, common.ResourceFinalizer)
|
||||
return workPatcher.RemoveFinalizer(ctx, last, workv1.ManifestWorkFinalizer)
|
||||
}
|
||||
|
||||
if last.Generation > int64(resourceVersion) {
|
||||
@@ -134,8 +134,8 @@ func (w *WorkService) HandleStatusUpdate(ctx context.Context, evt *cloudevents.E
|
||||
return nil
|
||||
}
|
||||
|
||||
// the work was handled by agent, ensure it has the resource finalizer
|
||||
if _, err := workPatcher.AddFinalizer(ctx, last, common.ResourceFinalizer); err != nil {
|
||||
// the work was handled by agent, ensure it has the manifestwork finalizer
|
||||
if _, err := workPatcher.AddFinalizer(ctx, last, workv1.ManifestWorkFinalizer); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -274,7 +274,7 @@ func TestHandleStatusUpdate(t *testing.T) {
|
||||
Name: "test-work",
|
||||
Namespace: "test-cluster",
|
||||
Generation: 1,
|
||||
Finalizers: []string{common.ResourceFinalizer},
|
||||
Finalizers: []string{workv1.ManifestWorkFinalizer},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user