diff --git a/pkg/controller/nodes/task/k8s/plugin_manager.go b/pkg/controller/nodes/task/k8s/plugin_manager.go index 998bbc42b0..42f6556a28 100644 --- a/pkg/controller/nodes/task/k8s/plugin_manager.go +++ b/pkg/controller/nodes/task/k8s/plugin_manager.go @@ -305,6 +305,8 @@ func (e PluginManager) Abort(ctx context.Context, tCtx pluginsCore.TaskExecution return nil } + AddObjectMetadata(tCtx.TaskExecutionMetadata(), o, config.GetK8sPluginConfig()) + err = e.kubeClient.GetClient().Delete(ctx, o) if err != nil && !IsK8sObjectNotExists(err) { logger.Warningf(ctx, "Failed to clear finalizers for Resource with name: %v/%v. Error: %v", diff --git a/pkg/controller/nodes/task/k8s/plugin_manager_test.go b/pkg/controller/nodes/task/k8s/plugin_manager_test.go index b1e0d4cbcd..6835e53e13 100644 --- a/pkg/controller/nodes/task/k8s/plugin_manager_test.go +++ b/pkg/controller/nodes/task/k8s/plugin_manager_test.go @@ -372,6 +372,7 @@ func TestPluginManager_Abort(t *testing.T) { // common setup code tctx := getMockTaskContext(PluginPhaseStarted, PluginPhaseStarted) fc := extendedFakeClient{Client: fake.NewFakeClientWithScheme(scheme.Scheme, res)} + // common setup code mockResourceHandler := &pluginsk8sMock.Plugin{} mockResourceHandler.OnBuildIdentityResourceMatch(mock.Anything, tctx.TaskExecutionMetadata()).Return(&v1.Pod{}, nil)