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

✨ Improve clusterctl upgrade syntax. Don't require namespace #7376

Merged
merged 1 commit into from
Dec 12, 2022

Conversation

oscr
Copy link
Contributor

@oscr oscr commented Oct 8, 2022

What this PR does / why we need it:

Here is the shorted output of a script that creates a quickstart cluster and then performs a clusterctl upgrade with the improved syntax.

(... a new cluster )
+ ../bin/clusterctl upgrade plan
Checking cert-manager version...
Cert-Manager will be upgraded from "v1.5.3" to "v1.9.1"

Checking new release availability...

Latest release available for the v1beta1 API Version of Cluster API (contract):

NAME                    NAMESPACE                           TYPE                     CURRENT VERSION   NEXT VERSION
bootstrap-kubeadm       capi-kubeadm-bootstrap-system       BootstrapProvider        v1.0.5            v1.2.2
control-plane-kubeadm   capi-kubeadm-control-plane-system   ControlPlaneProvider     v1.0.5            v1.2.2
cluster-api             capi-system                         CoreProvider             v1.0.5            v1.2.2
infrastructure-docker   capd-system                         InfrastructureProvider   v1.0.5            v1.2.2

You can now apply the upgrade by executing the following command:

clusterctl upgrade apply --contract v1beta1

+ ../bin/clusterctl upgrade apply --infrastructure docker:v1.1.6
Checking cert-manager version...
Deleting cert-manager Version="v1.5.3"
Installing cert-manager Version="v1.9.1"
Waiting for cert-manager to be available...
Performing upgrade...
Scaling down Provider="infrastructure-docker" Version="" Namespace="capd-system"
Deleting Provider="infrastructure-docker" Version="" Namespace="capd-system"
Installing Provider="infrastructure-docker" Version="v1.1.6" TargetNamespace="capd-system"

If we try to upgrade docker again with the current (unmodified) clusterctl version:

clusterctl upgrade apply --infrastructure docker:v1.2.2
Checking cert-manager version...
Cert-manager is already up to date
Error: invalid provider name "docker:v1.2.2". Provider name should be in the form namespace/provider[:version]

I also sneaked in some spelling mistake fixes where I found them during development.

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 #7319

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 8, 2022
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 8, 2022
@oscr oscr force-pushed the clusterctl-upgrade-syntax branch from 5b6f09e to c3bc0b3 Compare October 8, 2022 11:43
@sbueringer
Copy link
Member

cc @ykakarap

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.

PR looks great, I will document new syntax in the clusterctl upgrade apply help as well in the book in https://cluster-api.sigs.k8s.io/clusterctl/commands/upgrade.html (not sure if there are other places as well)
I will also add a deprecation notice from the previous format in https://main.cluster-api.sigs.k8s.io/developer/providers/v1.2-to-v1.3.html

cmd/clusterctl/client/upgrade.go Outdated Show resolved Hide resolved
@oscr
Copy link
Contributor Author

oscr commented Oct 10, 2022

Awesome! Thank you @fabriziopandini for the review and fixing the docs part that I totally forgot about.

@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 18, 2022
@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 18, 2022
@oscr
Copy link
Contributor Author

oscr commented Oct 18, 2022

I had some downtime so I upgraded the documentation to cover this change.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 5, 2022
@oscr
Copy link
Contributor Author

oscr commented Nov 5, 2022

Since this change will earliest be in 1.4 due to the feature freeze, I will rebase it when there is a separate 1.3 branch and we have an v1.3-to-v1.4 document. But if there is any feedback before them I will of course fix it immediately.

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.

@oscr thanks for being so patient.
Changes seem ok to, I will only make this more visible to CLI users and to people using clusterctl as a library

cmd/clusterctl/client/upgrade.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 8, 2022
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 12, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 15, 2022
@oscr
Copy link
Contributor Author

oscr commented Nov 15, 2022

PR has now been rebased with main, changes added to a Cluster API v1.3 compared to v1.4 doc and fixed the documentation about the new clusterctl upgrade syntax .

@oscr oscr force-pushed the clusterctl-upgrade-syntax branch 2 times, most recently from 726cecf to 5c2cf0c Compare November 15, 2022 19:09
@sbueringer
Copy link
Member

@ykakarap @fabriziopandini When you have some time, what would be the next steps for this PR?

I think we lost a bit track of it.

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
This is ready to merge after the release IMO, but it will be great if @Jont828 @ykakarap can take a look in the new few days

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 28, 2022
@sbueringer
Copy link
Member

sbueringer commented Nov 29, 2022

This is ready to merge after the release IMO,

Sounds good to me. We can merge independent of the release when we're ready, but I wouldn't force it into v1.3.0.

We can discuss if the PR is eligible for cherry-pick after merge.

Copy link
Contributor

@ykakarap ykakarap 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. Just a couple comments.

docs/book/src/clusterctl/commands/upgrade.md Outdated Show resolved Hide resolved
cmd/clusterctl/cmd/upgrade_apply.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 6, 2022
Copy link
Contributor

@ykakarap ykakarap left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 7, 2022
@ykakarap
Copy link
Contributor

ykakarap commented Dec 8, 2022

/assign @fabriziopandini for approval.

@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 Dec 12, 2022
@k8s-ci-robot k8s-ci-robot merged commit 0ff1e8d into kubernetes-sigs:main Dec 12, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.4 milestone Dec 12, 2022
@oscr oscr deleted the clusterctl-upgrade-syntax branch December 12, 2022 12:32
@oscr
Copy link
Contributor Author

oscr commented Dec 12, 2022

@ykakarap @fabriziopandini @sbueringer Thank you once again for all your help and feedback with this pr 🙏

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. 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.

Simplify UX in clusterctl upgrades
5 participants