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

⚠️ Refactor clusterctl alpha rollout #7988

Merged
merged 1 commit into from
Jan 30, 2023

Conversation

hiromu-a5a
Copy link
Contributor

What this PR does / why we need it:

A tiny refactoring of the RolloutOptions structure used by clusterctl alpha rollout. Defined RolloutOptions for each command.

The current codes for rollout reuses a common RolloutOptions structure among all kinds of rollout commands, i.e., undo, resume, restart and pause. However, the required inputs for those commands might be different in the future extension. From this perspective, the structure should be defined separately for each 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):

Tracking Issue:
#3439

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 24, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @hiromu-a5a. 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 requested a review from ykakarap January 24, 2023 16:14
@hiromu-a5a
Copy link
Contributor Author

hiromu-a5a commented Jan 24, 2023

Following the other cluster alpha rollout patches, I didn't create a specific issue for this PR also because it's a small PR. If I have to create an issue, please kindly let me know.

@fabriziopandini
Copy link
Member

/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 Jan 25, 2023
@fabriziopandini fabriziopandini added the area/clusterctl Issues or PRs related to clusterctl label Jan 25, 2023
Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

I'm generally +1 for the change, but let's wait for a pass from clusterctl reviewers first.

Copy link
Contributor

@Jont828 Jont828 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! I think it makes sense to make the roll out options more fine-grained.

/lgtm

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

LGTM label has been added.

Git tree hash: 8d309115c279eea1e6424f31c05bd1e5be57c1c4

@Jont828
Copy link
Contributor

Jont828 commented Jan 25, 2023

Only thing seems to be that the main test is failing btw.

@fabriziopandini
Copy link
Member

/retest
seems a flake

@fabriziopandini
Copy link
Member

fabriziopandini commented Jan 27, 2023

last nits from my side assuming test failures are flakes.
Given that this PR changes our API let's use ⚠️ instead of 🌱 in the title.
Also, let's add a note for this change in https://main.cluster-api.sigs.k8s.io/developer/providers/v1.3-to-v1.4.html#api-changes

@hiromu-a5a hiromu-a5a changed the title 🌱 Refactor clusterctl alpha rollout ⚠️ Refactor clusterctl alpha rollout Jan 30, 2023
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 30, 2023
@k8s-ci-robot k8s-ci-robot requested a review from Jont828 January 30, 2023 09:46
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 30, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 30, 2023
@hiromu-a5a
Copy link
Contributor Author

Thank you for your prompt reply!

I added note.

I have one question. The failing test pull-cluster-api-apidiff-main shows the changes are incompatible as follows. Any appropriate ways to solve this?
According to the past discussion and the Contributing Guideline, clusterctl is not required to provide any backward compatible guarantees but should be checked by approvers/maintainers if the change is acceptable.

 Incompatible changes:
  - (*clusterctlClient).RolloutRestart: changed from func(RolloutOptions) error to func(RolloutRestartOptions) error
  - (*clusterctlClient).RolloutResume: changed from func(RolloutOptions) error to func(RolloutResumeOptions) error
  - (*clusterctlClient).RolloutUndo: changed from func(RolloutOptions) error to func(RolloutUndoOptions) error
  - AlphaClient.RolloutRestart: changed from func(RolloutOptions) error to func(RolloutRestartOptions) error
  - AlphaClient.RolloutResume: changed from func(RolloutOptions) error to func(RolloutResumeOptions) error
  - AlphaClient.RolloutUndo: changed from func(RolloutOptions) error to func(RolloutUndoOptions) error

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jan 30, 2023

@hiromu-a5a: 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 efe3728 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/test-infra repository. I understand the commands that are listed here.

Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

I have one question. The failing test pull-cluster-api-apidiff-main shows the changes are incompatible as follows. Any appropriate ways to solve this?

You're right that the guarantees for clusterclt are different 🙂. The test will fail, but that won't block this PR getting merged. In this case it acts more as a signal to reviewers to consider what is being changed in the API.

/lgtm

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

LGTM label has been added.

Git tree hash: fdbdd037ae87775fe04e122b4d9e73b3cfffb4eb

Copy link
Member

@fabriziopandini fabriziopandini 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

@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 Jan 30, 2023
@fabriziopandini
Copy link
Member

/hold
checking the lint job

@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 Jan 30, 2023
@fabriziopandini
Copy link
Member

/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 Jan 30, 2023
@k8s-ci-robot k8s-ci-robot merged commit 008e32c into kubernetes-sigs:main Jan 30, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.4 milestone Jan 30, 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. area/clusterctl Issues or PRs related to clusterctl 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.

5 participants