-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Refactor ensureConfigurationConfigMapsExist to reduce duplicate code #5508
Refactor ensureConfigurationConfigMapsExist to reduce duplicate code #5508
Conversation
ensureConfigurationConfigMapsExist is used in pipelinerun, taskrun, run test files to ensure the test data contains needed configmap and they all share the same code. This commit move this function to a test package and can be used accross different files.
/kind cleanup |
The function cannot be moved to pkg/reconciler/testing due to import cycle. |
The following is the coverage report on the affected files.
|
/retest |
/remove kind/misc |
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abayer The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
@@ -323,3 +325,55 @@ var _ ktesting.Reactor = (*ResourceVersionReactor)(nil) | |||
func PrependResourceVersionReactor(f *ktesting.Fake) { | |||
f.ReactionChain = append([]ktesting.Reactor{&ResourceVersionReactor{}}, f.ReactionChain...) | |||
} | |||
|
|||
// EnsureConfigurationConfigMapsExist makes sure all the configmaps exists. | |||
func EnsureConfigurationConfigMapsExist(d *Data) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Yongxuan, shall we also refactor for the following file https://github.com/tektoncd/pipeline/blob/99226de6ef1c3f14e38e9b8cbc1fe0e60753a079/pkg/resolution/resolver/framework/testing/fakecontroller.go/#L123?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No - that's specifically for the resolver config maps in the tekton-pipelines-resolvers
namespace.
Changes
ensureConfigurationConfigMapsExist is used in pipelinerun, taskrun, run test files to ensure the test data contains needed configmap and they all share the same code. This commit move this function to a test package and can be used accross different files.
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes