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

Use clusterctlv1.DeleteForMoveAnnotation on last systempool validation #3426

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

pkbhowmick
Copy link
Contributor

@pkbhowmick pkbhowmick commented Apr 14, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:
this PR fixed a bug in clusterctl move command
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 #

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

N/A

@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. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 14, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @pkbhowmick. 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 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 Apr 14, 2023
@pkbhowmick
Copy link
Contributor Author

pkbhowmick commented Apr 14, 2023

#2774 can be handled in a better way now as there is a move annotation available at capi. Ref: kubernetes-sigs/cluster-api#8322

The annotation will be available in capi next release i.e. v1.5.0

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 14, 2023
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 13, 2023
@nawazkh
Copy link
Member

nawazkh commented Aug 9, 2023

Hey @pkbhowmick , How is this PR coming along?

@pkbhowmick
Copy link
Contributor Author

Hey @pkbhowmick , How is this PR coming along?

Hey @nawazkh, the PR needs CAPI v1.5, so waiting for #3707

Signed-off-by: Pulak Kanti Bhowmick <pkbhowmick007@gmail.com>
@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 28, 2023
@pkbhowmick pkbhowmick changed the title [WIP] Use clusterctl move annotation on last systempool validation Use clusterctl move annotation on last systempool validation Sep 28, 2023
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Sep 28, 2023
@nawazkh
Copy link
Member

nawazkh commented Oct 2, 2023

Hey @pkbhowmick, I guess this PR is a "work in progress" state. If not, please feel free to remove the work-in-progress label.

@nawazkh nawazkh added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 2, 2023
@pkbhowmick
Copy link
Contributor Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 2, 2023
@pkbhowmick
Copy link
Contributor Author

Hi @nawazkh , this PR is ready for review/test

@nawazkh nawazkh removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 2, 2023
@Jont828
Copy link
Contributor

Jont828 commented Oct 12, 2023

Thanks for the contribution! Does anyone know if this is covered in an e2e test already (so we can validate that this is working)?

@mboersma
Copy link
Contributor

/ok-to-test
/test pull-cluster-api-provider-azure-capi-e2e

The CAPI tests that CAPZ runs include clusterctl move, so I think that will cover it:

Ensure API servers are stable before doing move @ 10/12/23 17:41:30.728
Moving the cluster to self hosted @ 10/12/23 17:41:40.73
Moving workload clusters @ 10/12/23 17:41:40.73
  INFO: clusterctl move --from-kubeconfig /root/.kube/config --to-kubeconfig /tmp/e2e-kubeconfig1923033913 --namespace self-hosted
  Oct 12 17:41:47.231: INFO: Waiting for the cluster to be reconciled after moving to self hosted
Waiting for cluster to enter the provisioned phase @ 10/12/23 17:41:47.299
PASSED! @ 10/12/23 17:42:07.474
Ensure API servers are stable before doing move @ 10/12/23 17:42:09.177
Moving the cluster back to bootstrap @ 10/12/23 17:42:19.182
Moving workload clusters @ 10/12/23 17:42:19.182
  INFO: clusterctl move --from-kubeconfig /tmp/e2e-kubeconfig1923033913 --to-kubeconfig /root/.kube/config --namespace self-hosted
  Oct 12 17:42:30.966: INFO: Waiting for the cluster to be reconciled after moving back to booststrap

I think there should also be a unit test case in azuremanagedmachinepool_webhook_test.go.

@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 Oct 12, 2023
@mboersma
Copy link
Contributor

I think that will cover it

Nope, I forgot this was just for AMMP, and I don't think the CAPI test is using a managed cluster. So AFAICT we don't have e2e coverage for this.

@codecov
Copy link

codecov bot commented Oct 12, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (ff21c16) 56.65% compared to head (cf10241) 56.64%.
Report is 98 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3426      +/-   ##
==========================================
- Coverage   56.65%   56.64%   -0.02%     
==========================================
  Files         187      187              
  Lines       19139    19139              
==========================================
- Hits        10844    10842       -2     
- Misses       7666     7668       +2     
  Partials      629      629              
Files Coverage Δ
api/v1beta1/azuremanagedmachinepool_webhook.go 84.29% <0.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -316,7 +317,8 @@ func (m *AzureManagedMachinePool) validateLastSystemNodePool(cli client.Client)
return nil
}

if ownerCluster.Spec.Paused {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the DeleteForMoveAnnotation supercede this entirely? Wouldn't we still want to check for both conditions?

Copy link
Contributor Author

@pkbhowmick pkbhowmick Oct 18, 2023

Choose a reason for hiding this comment

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

Yes, we don't need this. Move annotation confirms that object is being deleted because of clusterctl move operation.

@Jont828
Copy link
Contributor

Jont828 commented Oct 18, 2023

/rename Use clusterctlv1.DeleteForMoveAnnotation on last systempool validation

@pkbhowmick pkbhowmick changed the title Use clusterctl move annotation on last systempool validation Use clusterctlv1.DeleteForMoveAnnotation on last systempool validation Oct 19, 2023
@jackfrancis
Copy link
Contributor

/assign @CecileRobertMichon

feel free to loop me in as well

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.

/lgtm
/approve

Let's see if we can add a self-hosted AKS cluster test to validate move in e2e. Opened #4157.

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

LGTM label has been added.

Git tree hash: 6c0d11c3f371c9fb68dd07b8ef154418d48af433

@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 Oct 19, 2023
@k8s-ci-robot k8s-ci-robot merged commit 1b6df41 into kubernetes-sigs:main Oct 19, 2023
21 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.12 milestone Oct 19, 2023
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. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

8 participants