Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplicate command execution and logging code in Kanister functions #2334

Open
e-sumin opened this issue Sep 14, 2023 · 1 comment
Open

Comments

@e-sumin
Copy link
Contributor

e-sumin commented Sep 14, 2023

Describe the bug

We have multiple locations where we execute commands within a pod and log the command output:

[pkg/function/backup_data_stats.go]
		var stdout, stderr bytes.Buffer
		err = commandExecutor.Exec(ctx, cmd, nil, &stdout, &stderr)
		format.LogWithCtx(ctx, pod.Name, pod.Spec.Containers[0].Name, stdout.String())
		format.LogWithCtx(ctx, pod.Name, pod.Spec.Containers[0].Name, stderr.String())

It would be nice to refactor these places and reuse duplicated code.

@e-sumin e-sumin added the bug label Sep 14, 2023
@infraq infraq added this to To Be Triaged in Kanister Sep 14, 2023
@pavannd1 pavannd1 added enhancement and removed bug labels Sep 21, 2023
@pavannd1 pavannd1 changed the title [BUG] Deduplicate command execution and logging code in Kanister functions Sep 21, 2023
@ShivangShandilya
Copy link

I would like to work on this issue !!

@github-actions github-actions bot added the stale label Feb 11, 2024
@pavannd1 pavannd1 removed the stale label Feb 27, 2024
@kanisterio kanisterio deleted a comment from github-actions bot May 2, 2024
@kanisterio kanisterio deleted a comment from github-actions bot May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Kanister
To Be Triaged
Development

No branches or pull requests

4 participants