Skip to content

Commit

Permalink
fix: collectors cluster (#925)
Browse files Browse the repository at this point in the history
Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
  • Loading branch information
eddycharly authored Feb 19, 2024
1 parent d2201df commit 7373097
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/runner/kubectl/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
}
Expand Down
1 change: 1 addition & 0 deletions pkg/runner/kubectl/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
}
Expand Down
1 change: 1 addition & 0 deletions pkg/runner/kubectl/pod_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
}
Expand Down
2 changes: 2 additions & 0 deletions pkg/runner/processors/step.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,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,
Expand Down Expand Up @@ -270,6 +271,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,
Expand Down

0 comments on commit 7373097

Please sign in to comment.