From ca00149032dd733eaec91ea5f21b1918c937da2d Mon Sep 17 00:00:00 2001 From: Filipe Regadas Date: Tue, 9 Mar 2021 10:45:20 +0000 Subject: [PATCH] Add support for custom KubeClient Signed-off-by: Filipe Regadas --- go/tasks/pluginmachinery/k8s/plugin.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/go/tasks/pluginmachinery/k8s/plugin.go b/go/tasks/pluginmachinery/k8s/plugin.go index 957aa88c3..719c13526 100644 --- a/go/tasks/pluginmachinery/k8s/plugin.go +++ b/go/tasks/pluginmachinery/k8s/plugin.go @@ -32,6 +32,14 @@ type PluginEntry struct { // support the same task type. This must be a subset of RegisteredTaskTypes and at most one default per task type // is supported. DefaultForTaskTypes []pluginsCore.TaskType + // Returns a new KubeClient to be used instead of the internal controller-runtime client. + NewKubeClient func(ctx context.Context) (pluginsCore.KubeClient, error) + // Boolean that indicates if kubernetes resources that this plugin is responsible for should include OwnerReferences. + // Ingoring is only useful if resources will be created in a remote cluster. + OverrideInjectOwnerReferences *bool + // Boolean flag that indicates if a finalizer should be injected. + // This will override the `inject-finalizer` set under k8s config. + OverrideInjectFinalizer *bool } // Special context passed in to plugins when checking task phase