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

🌱 Implement Machine Deleting condition #11291

Merged
merged 5 commits into from
Oct 18, 2024

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Oct 15, 2024

What this PR does / why we need 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):
Part of #11105

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-area PR is missing an area label size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 15, 2024
@sbueringer sbueringer changed the title Implement Machine Deleting condition [WIP] 🌱 Implement Machine Deleting condition Oct 15, 2024
@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 Oct 15, 2024
@sbueringer sbueringer added area/machine Issues or PRs related to machine lifecycle management and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Oct 15, 2024
@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. and removed do-not-merge/needs-area PR is missing an area label labels Oct 15, 2024
@sbueringer sbueringer force-pushed the pr-machine-deleting branch 3 times, most recently from 6f8b05b to 4936d2e Compare October 15, 2024 17:30
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 15, 2024
@sbueringer sbueringer force-pushed the pr-machine-deleting branch 2 times, most recently from 610d500 to 8bd926d Compare October 16, 2024 19:43
@sbueringer sbueringer changed the title [WIP] 🌱 Implement Machine Deleting condition 🌱 Implement Machine Deleting condition Oct 16, 2024
@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 Oct 16, 2024
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

api/v1beta1/machine_types.go Outdated Show resolved Hide resolved
internal/controllers/machine/drain/drain.go Show resolved Hide resolved
internal/util/cache/cache.go Show resolved Hide resolved
internal/util/cache/cache.go Show resolved Hide resolved
main.go Show resolved Hide resolved
internal/controllers/machine/machine_controller.go Outdated Show resolved Hide resolved
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

case deletingCondition.Reason == clusterv1.MachineDeletingDrainingNodeV1Beta2Reason &&
machine.Status.Deletion != nil && machine.Status.Deletion.NodeDrainStartTime != nil &&
time.Since(machine.Status.Deletion.NodeDrainStartTime.Time) > 30*time.Minute:
msg = fmt.Sprintf("Machine deletion in progress, stage: %s (since more than 30m)", deletingCondition.Reason)
Copy link
Member

@enxebre enxebre Oct 17, 2024

Choose a reason for hiding this comment

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

why is 30m a threshold? why don't we always print duration?

Copy link
Member Author

Choose a reason for hiding this comment

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

The idea is to have a finite amount of messages, because the Ready conditions will be aggregated across all Machines of a MachineSet / MachineDeployment. If we use the exact duration the aggregation will never be able to de-duplicate messages from different Machines and the aggregated MachinesReady condition will be very verbose

I'll add a comment

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@chrischdi
Copy link
Member

Just one comment, otherwise lgtm :-)

@fabriziopandini
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 Oct 18, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 4e2462e819d050a33055a2cfabd30860a0b9d40d

@sbueringer sbueringer added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Oct 18, 2024
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 18, 2024
@sbueringer
Copy link
Member Author

@fabriziopandini @chrischdi @enxebre
All findings should be addressed, PTAL :)

@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@chrischdi
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 Oct 18, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 06874d23e56ed665229db087aaa6f7ae4ad21289

@fabriziopandini
Copy link
Member

/lgtm
/approve

@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 Oct 18, 2024
@k8s-ci-robot k8s-ci-robot merged commit 9f78457 into kubernetes-sigs:main Oct 18, 2024
19 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.9 milestone Oct 18, 2024
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. area/machine Issues or PRs related to machine lifecycle management 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants