-
Notifications
You must be signed in to change notification settings - Fork 44
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: ResourceGroup conflicts #1575
base: main
Are you sure you want to change the base?
fix: ResourceGroup conflicts #1575
Conversation
kpt is primarily used for its ResourceGroup inventory client (InventoryResourceGroup), which is used by cli-utils' Applier. This change copies the existing kpt code into the internal/third_party directory of this repo, allowing us to make local Config Sync specific changes, without needing to depend on kpt as an upstream dependency. This is a temporary solution to allow modifications until the inventory client is rewritten from scratch with a new cleaner interface. Using internal/third_party allows preserving the upstream copyright and license headers, at least until the rewrite. To facilitate this, the internal/third_party directory is now ignored by make lint-license, and a rewrite was added to go.mod.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The ResourceGroup controller reconciles after each ResourceGroup update to spec or status. This was causing the ResourceGroup controller to try to make status updates after the applier made its initial spec update, without waiting for the applier to do the status update immediately afterwards. This caused a conflict between the concurrent status updates. To avoid this, the applier inventory client now correctly updates the status.observedGeneration and the ResourceGroup controller now waits for the status.observedGeneration to match the metadata.generation.
4c2e503
to
75b1302
Compare
Looks like this will require e2e test changes to simulate the applier setting the observedGeneration in the tests that create the ResourceGroup manually. |
Update the ResourceGroup controller tests to set the status.observedGeneration after updating the spec. This simulates the applier inventory client and unblocks the ResourceGroup controller, which now waits for that signal to avoid update conflicts. Since the ResourceGroup controller is already disabled for kpt-managed ResorceGroups, this will not affect that scenario.
} | ||
|
||
func TestResourceGroupControllerInKptGroup(t *testing.T) { | ||
nt := nomostest.New(t, nomostesting.ACMController) | ||
|
||
// increase logging |
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.
TODO: remove logging change after tests pass
@karlkfi: The following tests failed, say
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. I understand the commands that are listed here. |
The ResourceGroup controller reconciles after each ResourceGroup
update to spec or status. This was causing the ResourceGroup
controller to try to make status updates after the applier made its
initial spec update, without waiting for the applier to do the
status update immediately afterwards. This caused a conflict between
the concurrent status updates.
To avoid this, the applier inventory client now correctly updates the
status.observedGeneration and the ResourceGroup controller now waits
for the status.observedGeneration to match the metadata.generation.
Depends on #1566