GoogleContainerTools / GoogleContainerTools/skaffold

Refactor code and remove duplication

Open
#7,318 0 comments 0 reactions 0 assignees View on GitHub
help wanted kind/starter-project kind/todo priority/p3
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

This task is about remove code duplication.

The `skaffold filter` command was added to apply debug transformations to configure container images for debugging.
See here -> https://skaffold.dev/docs/workflows/debug/#configuring-container-images-for-debugging

When `skaffold filter` command was added it did not need any information from the run context.

However, after @aaron-prindle added the [Resource Selector ](https://skaffold.dev/docs/references/yaml/#resourceSelector)config where users can configure which resource types to transform.
These list now needs to be passed to Filter command. In #7317, @tejal29 duplicated the functionality in `getTransformList`

The right way to do this is, Add `Filter()` method to the `SkaffoldRunner` which has access to the [runner.RunContext.TransformAllowList](https://github.com/GoogleContainerTools/skaffold/blob/88a27ab9f81f337fa0fe4207aa829f632a01787e/pkg/skaffold/runner/runcontext/context.go#L111) and `runCtx.runner.RunContext.TransformDenyList`

The new `Filter` method will additionally execute the `runFilter` in [here](https://github.com/GoogleContainerTools/skaffold/blob/88a27ab9f81f337fa0fe4207aa829f632a01787e/cmd/skaffold/app/cmd/filter.go#L59)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.