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

✨ add condition merge utils #3103

Merged

Conversation

fabriziopandini
Copy link
Member

What this PR does / why we need it:
This PR implements a utils for handling conditions according to the design patterns introduced by the condition CAEP (Mirror, Aggregate, Summarize)

/cc @gab-satchi

@k8s-ci-robot k8s-ci-robot requested a review from gab-satchi May 27, 2020 18:48
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 27, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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 May 27, 2020
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.

lgtm. just minor nits

conditions := from.GetConditions()

conditionsInScope := make([]localizedCondition, 0, len(conditions))
for i := range conditions {
Copy link
Member

Choose a reason for hiding this comment

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

can be for i, c := range conditions {

Copy link
Member Author

Choose a reason for hiding this comment

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

unfortunately not, because we are using &c down in the loop and the linter complains for:
Using a reference for the variable on range scope c``

util/conditions/merge.go Outdated Show resolved Hide resolved
util/conditions/merge_strategies.go Outdated Show resolved Hide resolved
@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 May 29, 2020
@k8s-ci-robot k8s-ci-robot merged commit 3622e71 into kubernetes-sigs:master May 29, 2020
@vincepri
Copy link
Member

I had comments on this PR but didn't make it in time, also we forgot to squash

@fabriziopandini
Copy link
Member Author

@vincepri I'm happy to pick up your comments and address in a new PR.
just wondering what is the best way to collect them...

@fabriziopandini fabriziopandini deleted the conditions-merge-utils branch June 4, 2020 13:40
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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants