-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[Fix 4124] Skip local resource until all transformations have completed. #4180
Conversation
@yuwenma: This PR has multiple commits, and the default merge method is: merge. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hi @yuwenma. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@natasha41575 @monopole @KnVerey PTAL The fix is a little bit complicated than I expect. Let me know if there's any better approach or existing functions we can use. |
/ok-to-test |
BTW, you can run |
/cc @monopole |
BTW, for merge conflicts we usually rebase and force-push. |
Resources annotated as "local-config" are expected to be ignored. This skip local resource happens in "accumulateResources" which happens before any transformation operations. However, the local resource may be needed in transformations. Thus, this change removes the "drop local resource" logic from accumulateResources and removes these local resource after all transformation operations and var operations are done. Note: None of the existing ResMap functions can drop the resource slice easily: "Clear" will ruin the resource order, "AppendAll" only adds non-existing resource, "AbsorbAll" only add or modify but not delete. Thus, we introduce a new func "Intersection" for resourceAccumulator that specificaly removes the resource by ID and keep the original order.
Ready for another look. :) @natasha41575 @monopole @KnVerey |
/lgtm |
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: monopole, yuwenma 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 |
Fix: #4124
Description
Resources annotated as
local-config
are expected to be filtered out from stdout. This filtering (in funcaccumulateResources
) happens before any transformation operations. This causes the issue sincethe local resources are needed in transformations. See #4124
This PR removes the "drop local resource" logic from "accumulateResources", and filter out the local resource after running transforms.
Open to discuss:
None of the existing ResMap functions can drop the resource slice easily:
Clear
will ruin the resource order,AppendAll
only adds non-existing resource,AbsorbAll
only add or modify but not delete.Thus, we introduce a new func "Intersection" in
resourceAccumulator
to specifically removes the resource by ID and keep the original order.