cluster-api icon indicating copy to clipboard operation
cluster-api copied to clipboard

✨ Improve clusterctl upgrade syntax. Don't require namespace

Open oscr opened this issue 3 years ago • 3 comments

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

oscr avatar Oct 08 '22 11:10 oscr

cc @ykakarap

sbueringer avatar Oct 10 '22 10:10 sbueringer

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

oscr avatar Oct 10 '22 17:10 oscr

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign timothysc for approval by writing /assign @timothysc in a comment. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 avatar Oct 18 '22 11:10 k8s-ci-robot

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

oscr avatar Oct 18 '22 12:10 oscr

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.

oscr avatar Nov 05 '22 14:11 oscr

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 avatar Nov 15 '22 17:11 oscr

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

sbueringer avatar Nov 25 '22 05:11 sbueringer

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.

sbueringer avatar Nov 29 '22 02:11 sbueringer

/assign @fabriziopandini for approval.

ykakarap avatar Dec 08 '22 22:12 ykakarap

/lgtm /approve

fabriziopandini avatar Dec 12 '22 09:12 fabriziopandini

[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:
  • ~~OWNERS~~ [fabriziopandini]

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 avatar Dec 12 '22 09:12 k8s-ci-robot

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

oscr avatar Dec 12 '22 12:12 oscr