structured-merge-diff icon indicating copy to clipboard operation
structured-merge-diff copied to clipboard

Add test to verify that apply after update should work with no conflict

Open redbaron opened this issue 3 years ago • 14 comments

While investigating https://github.com/kubernetes/kubernetes/issues/107417 , I found that at least at the level of structured merge diff, Apply doesn't cause conflict with Update if manager name is the same. This PR adds test for it.

redbaron avatar Jan 09 '22 13:01 redbaron

Welcome @redbaron!

It looks like this is your first PR to kubernetes-sigs/structured-merge-diff 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/structured-merge-diff has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Jan 09 '22 13:01 k8s-ci-robot

Hi @redbaron. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

k8s-ci-robot avatar Jan 09 '22 13:01 k8s-ci-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: redbaron To complete the pull request process, please assign apelisse after the PR has been reviewed. You can assign the PR to them by writing /assign @apelisse in a comment when ready.

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 /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Jan 09 '22 13:01 k8s-ci-robot

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Apr 09 '22 13:04 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar May 09 '22 13:05 k8s-triage-robot

/remove-lifecycle rotten

redbaron avatar May 09 '22 17:05 redbaron

/ok-to-test

That test should fail right?

apelisse avatar Jun 06 '22 22:06 apelisse

That test should fail right?

No, it should succeed

redbaron avatar Jun 13 '22 20:06 redbaron

Can you explain your rational?

apelisse avatar Jun 13 '22 21:06 apelisse

Sorry, I was in a meeting when I wrote that. Apply and Update have been implemented/designed as being incompatible because they don't have the same mechanisms of owning fields, which means that they can't be converted from one to another. I don't understand how this test passes.

apelisse avatar Jun 14 '22 15:06 apelisse

As described in the https://github.com/kubernetes/kubernetes/issues/107417 Apply and Update are deliberately made incompatible in kube apiserver, which I didn't agree with. This test case demonstrates that, for the structured merge purposes these operations are not in conflict same field manager can use both without introducing conflict with it's own doings.

Kubernetes Apiserver introduces conflict between Apply and Update by adding operation name to the field manager string. So it is a higher level decision. Low level structured merging (which is this repo) is fully supporting both, hence this test.

redbaron avatar Jun 14 '22 17:06 redbaron

Ah yeah, you're right, smd doesn't differentiate and just overrides everything. Why don't you add more tests here to verify that the behavior would work as you expect? You can maybe convince me that this would be better?

apelisse avatar Jun 14 '22 17:06 apelisse

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Sep 12 '22 18:09 k8s-triage-robot

/remove-lifecycle stale

redbaron avatar Sep 12 '22 18:09 redbaron

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Dec 11 '22 19:12 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Jan 10 '23 20:01 k8s-triage-robot

I don't know what to do with this, I think we know this is how it works, but we don't rely on this behavior so I don't want to enforce that we keep it forever. /close We can re-open if we have stronger arguments.

apelisse avatar Jan 11 '23 03:01 apelisse

@apelisse: Closed this PR.

In response to this:

I don't know what to do with this, I think we know this is how it works, but we don't rely on this behavior so I don't want to enforce that we keep it forever. /close We can re-open if we have stronger arguments.

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.

k8s-ci-robot avatar Jan 11 '23 03:01 k8s-ci-robot