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 conditions to MachinePool #3627

Conversation

srm09
Copy link
Contributor

@srm09 srm09 commented Sep 10, 2020

What this PR does / why we need it:
Adds conditions to machinepool controllers

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

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 10, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @srm09. 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 the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 10, 2020
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 10, 2020
@vincepri
Copy link
Member

/assign @CecileRobertMichon @fabriziopandini

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

overall lgtm, is there a reason this is still a draft PR @srm09 ?

api/v1alpha3/condition_consts.go Outdated Show resolved Hide resolved
@CecileRobertMichon
Copy link
Contributor

/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 Sep 15, 2020
@srm09
Copy link
Contributor Author

srm09 commented Sep 16, 2020

@CecileRobertMichon I was working on a condition to report the status of the replicas managed by the machine pool, the one I was talking about in #3497 (comment)

@srm09 srm09 force-pushed the feature/add-conditions-to-machinepool branch from fc42837 to 84cf008 Compare September 22, 2020 16:17
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 22, 2020
@srm09 srm09 force-pushed the feature/add-conditions-to-machinepool branch from 84cf008 to 251afad Compare September 22, 2020 17:27
@srm09 srm09 marked this pull request as ready for review September 22, 2020 17:42
@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 Sep 22, 2020
@srm09
Copy link
Contributor Author

srm09 commented Sep 22, 2020

Waiting to manually verify.
/do-not-merge

@ncdc
Copy link
Contributor

ncdc commented Sep 22, 2020

@srm09 if you want this held, use the Prow command /hold

@srm09
Copy link
Contributor Author

srm09 commented Sep 22, 2020

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 22, 2020
@srm09 srm09 force-pushed the feature/add-conditions-to-machinepool branch from 251afad to 150b0a7 Compare September 22, 2020 22:19
Copy link
Contributor Author

@srm09 srm09 left a comment

Choose a reason for hiding this comment

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

explanations and thoughts

Comment on lines 102 to 104
} else {
conditions.MarkTrue(mp, expv1.ReplicasReadyCondition)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe I should avoid this one, since the pre-reqs to mark the machinepool ready is as described on line 56. Any thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Seems like 56 covers the case where we have already reconciled these machines, but in case we need to do it again, we should definitely recalculate the final state

@@ -29,10 +29,10 @@ import (
"k8s.io/utils/pointer"
clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha3"
expv1 "sigs.k8s.io/cluster-api/exp/api/v1alpha3"
"sigs.k8s.io/cluster-api/test/helpers"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed this to use the helpers package, since patching the conditions requires the ResourceVersion to be set.

@srm09
Copy link
Contributor Author

srm09 commented Sep 22, 2020

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 22, 2020
@srm09
Copy link
Contributor Author

srm09 commented Sep 22, 2020

/test pull-cluster-api-test

@srm09
Copy link
Contributor Author

srm09 commented Sep 23, 2020

/test pull-cluster-api-verify-external-links

@srm09 srm09 force-pushed the feature/add-conditions-to-machinepool branch from 150b0a7 to 59e71b0 Compare September 24, 2020 22:27
@srm09
Copy link
Contributor Author

srm09 commented Sep 24, 2020

@CecileRobertMichon @fabriziopandini PTAL at your convenience.
Adding some tests to assert the conditions.

api/v1alpha3/condition_consts.go Outdated Show resolved Hide resolved
api/v1alpha3/condition_consts.go Outdated Show resolved Hide resolved
Comment on lines 102 to 104
} else {
conditions.MarkTrue(mp, expv1.ReplicasReadyCondition)
}
Copy link
Member

Choose a reason for hiding this comment

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

Seems like 56 covers the case where we have already reconciled these machines, but in case we need to do it again, we should definitely recalculate the final state

@vincepri
Copy link
Member

/assign @CecileRobertMichon

@kubernetes-sigs kubernetes-sigs deleted a comment from k8s-ci-robot Sep 28, 2020
@CecileRobertMichon
Copy link
Contributor

@srm09 please squash the commits

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Sep 28, 2020

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

Test name Commit Details Rerun command
pull-cluster-api-verify-external-links 150b0a7 link /test pull-cluster-api-verify-external-links

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.

This patch adds the conditions to the machinepool object.

Signed-off-by: Sagar Muchhal <muchhals@vmware.com>
Co-authored-by: Vince Prignano <vince@vincepri.com>
@srm09 srm09 force-pushed the feature/add-conditions-to-machinepool branch from 8eb2ed7 to aeae5c3 Compare September 28, 2020 17:45
@srm09
Copy link
Contributor Author

srm09 commented Sep 28, 2020

@CecileRobertMichon PTAL

@vincepri
Copy link
Member

/retitle 🌱 Add conditions to MachinePool

@k8s-ci-robot k8s-ci-robot changed the title ✨ Add conditions to machinepool 🌱 Add conditions to MachinePool Sep 28, 2020
@CecileRobertMichon
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon

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 Sep 28, 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
/milestone v0.3.10

@k8s-ci-robot k8s-ci-robot added this to the v0.3.10 milestone Sep 29, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 29, 2020
@k8s-ci-robot k8s-ci-robot merged commit 863a791 into kubernetes-sigs:master Sep 29, 2020
@srm09 srm09 deleted the feature/add-conditions-to-machinepool branch September 29, 2020 17:01
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.

Add conditions for MachinePool object
6 participants