GoogleContainerTools/skaffold

Refactor code and remove duplication

开放

#7,318 创建于 2022年4月15日

 (0 条评论) (0 个反应) (0 位负责人)Go (1,416 个派生)batch import
help wantedkind/starter-projectkind/todopriority/p3

仓库指标

星标
 (12,822 个星标)
PR 合并指标
 (平均合并 3天 6小时) (30 天内合并 16 个 PR)

描述

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 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 and runCtx.runner.RunContext.TransformDenyList

The new Filter method will additionally execute the runFilter in here

贡献者指南