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

🐛 bugfix function aggregateFromMachinesToKCP #8132

Merged
merged 1 commit into from
Mar 2, 2023

Conversation

wm775825
Copy link
Contributor

@wm775825 wm775825 commented Feb 19, 2023

What this PR does / why we need it:

When aggregating from machine conditions to kcp condition, the priority is:

  • false conditions with error reason
  • false conditions with warning reason
  • false conditions with info reason
  • true conditions
  • unknown conditions

However, when dealing with "false conditions with info conditions", there is a bug in source codes.

In Line 562, having checked warning reasons, we should check info reasons next. That is, to check "kcpMachinesWithInfo" rather than "kcpMachinesWithWarnings". However, there is a duplicate "kcpMachinesWithWarnings" in line 556 and line 662.

Maybe this is not a common scene, so it didn't lead to serious problems and was neglected.

As a beginner of cluster-api, i found it when i read source codes, so i fix it.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

no issues.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 19, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: wm775825 / name: faxii (61082f2)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Feb 19, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @wm775825!

It looks like this is your first PR to kubernetes-sigs/cluster-api 🎉. 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/cluster-api 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. 😃

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Feb 19, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @wm775825. 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 k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Feb 19, 2023
@wm775825
Copy link
Contributor Author

/test pull-cluster-api-build-main

@k8s-ci-robot
Copy link
Contributor

@wm775825: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/test pull-cluster-api-build-main

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.

@oscr
Copy link
Contributor

oscr commented Feb 20, 2023

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 20, 2023
@wm775825
Copy link
Contributor Author

/test pull-cluster-api-build-main

@wm775825
Copy link
Contributor Author

/test all

@oscr
Copy link
Contributor

oscr commented Feb 20, 2023

/retest

@wm775825
Copy link
Contributor Author

/lint

@wm775825
Copy link
Contributor Author

/help

@wm775825
Copy link
Contributor Author

how to invoke lint? anyone can help?

@killianmuldoon
Copy link
Contributor

/ok-to-test

(Not sure why lint isn't running) 🤔

@oscr
Copy link
Contributor

oscr commented Feb 20, 2023

In the warning it says: "This workflow requires approval from a maintainer." So I assume I'm not allowed to trigger it for none Kubernetes org members.

@sbueringer
Copy link
Member

It cannot be done via ok-to-test (I think there is a long-standing issue for that in test-infra)

Someone with at least write access to the repo has to push a button

@wm775825
Copy link
Contributor Author

/cc

@k8s-ci-robot
Copy link
Contributor

@wm775825: GitHub didn't allow me to request PR reviews from the following users: wm775825.

Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/cc

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.

@wm775825
Copy link
Contributor Author

/auto-cc

Copy link
Contributor

@g-gaston g-gaston left a comment

Choose a reason for hiding this comment

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

The fix looks good, thanks for finding this!
Could we add a unit test to make sure this doesn't break again?

@wm775825 wm775825 requested review from g-gaston and removed request for fabriziopandini and JoelSpeed March 1, 2023 17:53
@wm775825
Copy link
Contributor Author

wm775825 commented Mar 1, 2023

/auto-cc

@wm775825
Copy link
Contributor Author

wm775825 commented Mar 1, 2023

sorry, it seems that i removed some reviewers by mistake?

@jackfrancis
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 1, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 0f1f7187a178a18f32097223141cad6de83ee811

@g-gaston
Copy link
Contributor

g-gaston commented Mar 1, 2023

/lgtm
thanks a lot!

@sbueringer
Copy link
Member

@jackfrancis I'll try to take a look soon'ish. If it's a bugfix and pretty safe would be good to cherry-pick in both

@sbueringer
Copy link
Member

Thank you very much!!

/lgtm
/approve

@sbueringer
Copy link
Member

/cherry-pick release-1.3

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

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-infra-cherrypick-robot

@sbueringer: once the present PR merges, I will cherry-pick it on top of release-1.3 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.3

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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 2, 2023
@sbueringer
Copy link
Member

/cherry-pick release-1.2

@k8s-infra-cherrypick-robot

@sbueringer: once the present PR merges, I will cherry-pick it on top of release-1.2 in a new PR and assign it to you.

In response to this:

/cherry-pick release-1.2

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 k8s-ci-robot merged commit 7ee0cd4 into kubernetes-sigs:main Mar 2, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.4 milestone Mar 2, 2023
@k8s-infra-cherrypick-robot

@sbueringer: #8132 failed to apply on top of branch "release-1.3":

Applying: bugfix function aggregateFromMachinesToKCP
Using index info to reconstruct a base tree...
M	controlplane/kubeadm/internal/workload_cluster_conditions.go
Falling back to patching base and 3-way merge...
Auto-merging controlplane/kubeadm/internal/workload_cluster_conditions.go
CONFLICT (content): Merge conflict in controlplane/kubeadm/internal/workload_cluster_conditions.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 bugfix function aggregateFromMachinesToKCP
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.3

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-infra-cherrypick-robot

@sbueringer: #8132 failed to apply on top of branch "release-1.2":

Applying: bugfix function aggregateFromMachinesToKCP
Using index info to reconstruct a base tree...
M	controlplane/kubeadm/internal/workload_cluster_conditions.go
Falling back to patching base and 3-way merge...
Auto-merging controlplane/kubeadm/internal/workload_cluster_conditions.go
CONFLICT (content): Merge conflict in controlplane/kubeadm/internal/workload_cluster_conditions.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 bugfix function aggregateFromMachinesToKCP
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.2

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.

@sbueringer
Copy link
Member

@wm775825 Do you have time to open (manual) cherry-pick PRs for release-1.3 and release-1.2?

@wm775825
Copy link
Contributor Author

wm775825 commented Mar 3, 2023

it seems there has been two manual cherrypicks merged.

@jackfrancis
Copy link
Contributor

@wm775825 I went ahead and took the liberty, thanks again for doing all the real work here :) 💪

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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

10 participants