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

✨ Update machine with v1beta2 status #11276

Conversation

fabriziopandini
Copy link
Member

What this PR does / why we need it:
This PR adds code for updating machine with v1beta2 status.

In order to do so, reconcile bootstrap config, infrastructure and node will now always run, ensuring info from those resources are always surfaced (before only a small subset of those were run on reconcile delete, and only after drain and wait for volume detatch actually completed).

Notably, v1beta2 conditions will also provide visibility on several issues before visible only by checking logs, e.g.

  • BootstrapConfigReady condition will surface when the bootstrap config object is not found or accidentally deleted
  • InfrastructureReady condition will surface when the infrastructure machine object is not found or accidentally deleted
  • NodeHealthy and NodeReady conditions will surface when the K8s node corresponding to machine object is not found or accidentally deleted

Note: this PR is not setting the deleting condition (this is deferred to after node drain proposal is going to merge)

Which issue(s) this PR fixes:
Rif #11105

Area example:
/area api

@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. area/api Issues or PRs related to the APIs labels Oct 8, 2024
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 8, 2024
@fabriziopandini fabriziopandini force-pushed the update-v1beta2-status-machine-controller branch 2 times, most recently from a82e73b to f3e1d84 Compare October 10, 2024 17:08
api/v1beta1/machine_types.go Show resolved Hide resolved
api/v1beta1/machine_types.go Outdated Show resolved Hide resolved
api/v1beta1/machine_types.go Outdated Show resolved Hide resolved
api/v1beta1/machine_types.go Outdated Show resolved Hide resolved
api/v1beta1/machine_types.go Outdated Show resolved Hide resolved
internal/controllers/machine/machine_controller.go Outdated Show resolved Hide resolved
internal/controllers/machine/machine_controller.go Outdated Show resolved Hide resolved
internal/controllers/machine/machine_controller.go Outdated Show resolved Hide resolved
internal/controllers/machine/machine_controller_noderef.go Outdated Show resolved Hide resolved
util/conditions/v1beta2/getter.go Outdated Show resolved Hide resolved
api/v1beta1/machine_types.go Outdated Show resolved Hide resolved
api/v1beta1/machine_types.go Outdated Show resolved Hide resolved
api/v1beta1/machine_types.go Outdated Show resolved Hide resolved
api/v1beta1/machine_types.go Outdated Show resolved Hide resolved
api/v1beta1/machine_types.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 11, 2024
@fabriziopandini fabriziopandini changed the title [WIP] ✨ Update machine with v1beta2 status ✨ Update machine with v1beta2 status Oct 11, 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 11, 2024
@fabriziopandini fabriziopandini force-pushed the update-v1beta2-status-machine-controller branch from f0ac8d1 to 82ee71d Compare October 11, 2024 16:06
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 11, 2024
@k8s-ci-robot
Copy link
Contributor

@fabriziopandini: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-apidiff-main 7278f4a link false /test pull-cluster-api-apidiff-main

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-sigs/prow repository. I understand the commands that are listed here.

@sbueringer
Copy link
Member

Thx! Really nice work

/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 14, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 518c2c7a92f708847f831e4f84fb69629a10382c

@sbueringer
Copy link
Member

/test pull-cluster-api-e2e-main

// Return early if the object or Cluster is paused.
if annotations.IsPaused(cluster, m) {
log.Info("Reconciliation is paused for this object")
return ctrl.Result{}, nil
return ctrl.Result{}, setPausedCondition(ctx, r.Client, s)
Copy link
Member

@chrischdi chrischdi Oct 14, 2024

Choose a reason for hiding this comment

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

Note: this does not work together with the above predicate because a paused object only eventually enters this code here (e.g. only when paused is set on the cluster object).

Ok to fix in a follow-up though.

@chrischdi
Copy link
Member

chrischdi commented Oct 14, 2024

/approve

/hold

For your convenience. We can fix the paused condition in

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chrischdi

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 14, 2024
@sbueringer
Copy link
Member

Sounds good!

/hold cancel

@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 Oct 14, 2024
@k8s-ci-robot k8s-ci-robot merged commit 74d34e3 into kubernetes-sigs:main Oct 14, 2024
19 of 20 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.9 milestone Oct 14, 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/api Issues or PRs related to the APIs 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants