From c72f1063fbcbe63646fd93c9aadce370fc0b24e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Mon, 19 Feb 2024 14:08:38 +0100 Subject: [PATCH] fix: collectors cluster MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- pkg/runner/kubectl/describe.go | 1 + pkg/runner/kubectl/get.go | 1 + pkg/runner/kubectl/pod_logs.go | 1 + pkg/runner/processors/step.go | 2 ++ 4 files changed, 5 insertions(+) diff --git a/pkg/runner/kubectl/describe.go b/pkg/runner/kubectl/describe.go index 7f4d2af50..a87eead78 100644 --- a/pkg/runner/kubectl/describe.go +++ b/pkg/runner/kubectl/describe.go @@ -18,6 +18,7 @@ func Describe(collector *v1alpha1.Describe) (*v1alpha1.Command, error) { return nil, errors.New("name cannot be provided when a selector is specified") } cmd := v1alpha1.Command{ + Cluster: collector.Cluster, Entrypoint: "kubectl", Args: []string{"describe", collector.Resource}, } diff --git a/pkg/runner/kubectl/get.go b/pkg/runner/kubectl/get.go index bc475a3c7..02eaf000f 100644 --- a/pkg/runner/kubectl/get.go +++ b/pkg/runner/kubectl/get.go @@ -17,6 +17,7 @@ func Get(collector *v1alpha1.Get) (*v1alpha1.Command, error) { return nil, errors.New("name cannot be provided when a selector is specified") } cmd := v1alpha1.Command{ + Cluster: collector.Cluster, Entrypoint: "kubectl", Args: []string{"get", collector.Resource}, } diff --git a/pkg/runner/kubectl/pod_logs.go b/pkg/runner/kubectl/pod_logs.go index 0ed551970..b5b9f388d 100644 --- a/pkg/runner/kubectl/pod_logs.go +++ b/pkg/runner/kubectl/pod_logs.go @@ -18,6 +18,7 @@ func Logs(collector *v1alpha1.PodLogs) (*v1alpha1.Command, error) { return nil, errors.New("name cannot be provided when a selector is specified") } cmd := v1alpha1.Command{ + Cluster: collector.Cluster, Entrypoint: "kubectl", Args: []string{"logs", "--prefix"}, } diff --git a/pkg/runner/processors/step.go b/pkg/runner/processors/step.go index fe2b78918..403866639 100644 --- a/pkg/runner/processors/step.go +++ b/pkg/runner/processors/step.go @@ -209,6 +209,7 @@ func (p *stepProcessor) catchOperations(ctx context.Context, handlers ...v1alpha register(p.commandOperation(ctx, *cmd)) } else if handler.Events != nil { cmd, err := kubectl.Get(&v1alpha1.Get{ + Cluster: handler.Events.Cluster, Timeout: handler.Events.Timeout, Resource: "events", ObjectLabelsSelector: handler.Events.ObjectLabelsSelector, @@ -266,6 +267,7 @@ func (p *stepProcessor) finallyOperations(ctx context.Context, handlers ...v1alp register(p.commandOperation(ctx, *cmd)) } else if handler.Events != nil { cmd, err := kubectl.Get(&v1alpha1.Get{ + Cluster: handler.Events.Cluster, Timeout: handler.Events.Timeout, Resource: "events", ObjectLabelsSelector: handler.Events.ObjectLabelsSelector,