Skip to content
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

🌱 Allow incremental condition patch #3261

Conversation

fabriziopandini
Copy link
Member

What this PR does / why we need it:
This PR allows incremental condition patching within the same controller.

In order to do so, in the final defer patch, it is required to declare the list of conditions the controller owns, and for which, a conflict between after and latest value of the condition should not generate errors (after value should always be used instead)

Which issue(s) this PR fixes:
Fixes #3260

/assign @vincepri
/assign @gab-satchi

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 26, 2020
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 26, 2020
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 26, 2020
util/patch/options.go Outdated Show resolved Hide resolved
@fabriziopandini fabriziopandini force-pushed the allow-incremental-condition-patch branch from c704c98 to d668e5b Compare June 26, 2020 16:44
@fabriziopandini
Copy link
Member Author

As a reminder pull-cluster-api-apidiff output

sigs.k8s.io/cluster-api/util/patch
  Incompatible changes:
  - HelperOptions: old is comparable, new is not
  Compatible changes:
  - HelperOptions.OwnedConditions: added
  - WithOwnedConditions: added

sigs.k8s.io/cluster-api/util/conditions
  Incompatible changes:
  - Patch.Apply: changed from func(Setter) error to func(Setter, ...ApplyOption) error
  - PatchOperation.Base: removed
  - PatchOperation.Target: removed
  Compatible changes:
  - ApplyOption: added
  - PatchOperation.After: added
  - PatchOperation.Before: added
  - WithOwnedConditions: added

Above changes are ok because those methods where not part of a release (they were included in v0.3.7 alpha 0, but this is fine)

@vincepri
Copy link
Member

/milestone v0.3.7

@fabriziopandini fabriziopandini changed the title [WIP] 🌱 Allow incremental condition patch 🌱 Allow incremental condition patch Jun 26, 2020
@k8s-ci-robot k8s-ci-robot added this to the v0.3.7 milestone Jun 26, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 26, 2020
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/assign @detiber

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 26, 2020
@vincepri
Copy link
Member

vincepri commented Jun 26, 2020

/assign @ncdc

for final approval

Copy link
Member

@gab-satchi gab-satchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes. just minor nits

util/conditions/patch.go Outdated Show resolved Hide resolved
util/conditions/patch.go Outdated Show resolved Hide resolved
util/conditions/patch.go Outdated Show resolved Hide resolved
util/conditions/patch.go Outdated Show resolved Hide resolved
@fabriziopandini fabriziopandini force-pushed the allow-incremental-condition-patch branch from ea7b0e0 to 2fb80bf Compare June 29, 2020 10:09
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 29, 2020
@fabriziopandini
Copy link
Member Author

@gab-satchi comment addressed, PTAL

@k8s-ci-robot
Copy link
Contributor

@fabriziopandini: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-cluster-api-apidiff 2fb80bf link /test pull-cluster-api-apidiff

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@gab-satchi
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 29, 2020
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vincepri

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 29, 2020
@k8s-ci-robot k8s-ci-robot merged commit e57b366 into kubernetes-sigs:master Jun 29, 2020
@fabriziopandini fabriziopandini deleted the allow-incremental-condition-patch branch June 29, 2020 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incremental conditions patching leads to reconciliation errors
6 participants