Skip to content

Commit b0a7ba9

Browse files
Address comments
1 parent 727a0fd commit b0a7ba9

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

cmd/clusterctl/cmd/upgrade.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ var upgradePlanCmd = &cobra.Command{
5050
in order to guarantee the proper functioning of the management cluster.
5151
5252
Then, for each provider in a management group, the following upgrade options are provided:
53-
- The last available version within the current cluster API version.
54-
- The last available version within the next cluster API version, if available.`),
53+
- The latest patch release for the current Cluster API version.
54+
- The latest patch release for the next Cluster API version, if available.`),
5555

5656
Example: Examples(`
5757
# Gets the recommended target versions for upgrading Cluster API providers.
@@ -78,7 +78,7 @@ func runUpgradePlan() error {
7878

7979
//TODO: switch to klog as soon as https://github.com/kubernetes-sigs/cluster-api/pull/2150 merge
8080
fmt.Println("Checking new release availability...")
81-
upgradePlans, err := c.UpgradePlan(client.UpgradePlanOptions{
81+
upgradePlans, err := c.PlanUpgrade(client.PlanUpgradeOptions{
8282
Kubeconfig: up.kubeconfig,
8383
})
8484
if err != nil {

cmd/clusterctl/pkg/client/client.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ type MoveOptions struct {
120120
Namespace string
121121
}
122122

123-
// UpgradePlanOptions carries the options supported by upgrade plan.
124-
type UpgradePlanOptions struct {
123+
// PlanUpgradeOptions carries the options supported by upgrade plan.
124+
type PlanUpgradeOptions struct {
125125
// Kubeconfig file to use for accessing the management cluster. If empty, default rules for kubeconfig discovery will be used.
126126
Kubeconfig string
127127
}
@@ -146,12 +146,12 @@ type Client interface {
146146
// Move moves all the Cluster API objects existing in a namespace (or from all the namespaces if empty) to a target management cluster.
147147
Move(options MoveOptions) error
148148

149-
// Plan returns a set of suggested Upgrade plans for the cluster, and more specifically:
149+
// PlanUpgrade returns a set of suggested Upgrade plans for the cluster, and more specifically:
150150
// - Each management group gets separated upgrade plans.
151-
// - For each management group, an upgrade plan will be generated for each ClusterAPIVersion available, e.g.
151+
// - For each management group, an upgrade plan is generated for each ClusterAPIVersion available, e.g.
152152
// - Upgrade to the latest version in the the v1alpha2 series: ....
153153
// - Upgrade to the latest version in the the v1alpha3 series: ....
154-
UpgradePlan(options UpgradePlanOptions) ([]UpgradePlan, error)
154+
PlanUpgrade(options PlanUpgradeOptions) ([]UpgradePlan, error)
155155
}
156156

157157
// clusterctlClient implements Client.

cmd/clusterctl/pkg/client/client_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func (f fakeClient) Move(options MoveOptions) error {
8888
return f.internalClient.Move(options)
8989
}
9090

91-
func (f fakeClient) UpgradePlan(options UpgradePlanOptions) ([]UpgradePlan, error) {
91+
func (f fakeClient) UpgradePlan(options PlanUpgradeOptions) ([]UpgradePlan, error) {
9292
return f.internalClient.UpgradePlan(options)
9393
}
9494

cmd/clusterctl/pkg/client/cluster/client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ type Client interface {
6969
// from one management cluster to another management cluster.
7070
ObjectMover() ObjectMover
7171

72-
// ProviderUpgrader returns an ObjectMover that implements support upgrading ClusterAPI providers.
72+
// ProviderUpgrader returns a ProviderUpgrader that supports upgrading Cluster API providers.
7373
ProviderUpgrader() ProviderUpgrader
7474
}
7575

cmd/clusterctl/pkg/client/cluster/upgrader.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ type UpgradePlan struct {
4141
Providers []UpgradeItem
4242
}
4343

44-
// UgradeRef returns a string identifying the upgrade plan; this string is derived by the core provider which is
44+
// UpgradeRef returns a string identifying the upgrade plan; this string is derived by the core provider which is
4545
// unique for each management group.
46-
func (u *UpgradePlan) UgradeRef() string {
46+
func (u *UpgradePlan) UpgradeRef() string {
4747
return fmt.Sprintf("%s/%s", u.CoreProvider.Namespace, u.CoreProvider.Name)
4848
}
4949

@@ -53,8 +53,8 @@ type UpgradeItem struct {
5353
NextVersion string
5454
}
5555

56-
// UgradeRef returns a string identifying the upgrade item; this string is derived by the provider.
57-
func (u *UpgradeItem) UgradeRef() string {
56+
// UpgradeRef returns a string identifying the upgrade item; this string is derived by the provider.
57+
func (u *UpgradeItem) UpgradeRef() string {
5858
return fmt.Sprintf("%s/%s", u.Namespace, u.Name)
5959
}
6060

cmd/clusterctl/pkg/client/upgrade.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ limitations under the License.
1616

1717
package client
1818

19-
func (c *clusterctlClient) UpgradePlan(options UpgradePlanOptions) ([]UpgradePlan, error) {
19+
func (c *clusterctlClient) PlanUpgrade(options PlanUpgradeOptions) ([]UpgradePlan, error) {
2020
// Get the client for interacting with the management cluster.
2121
cluster, err := c.clusterClientFactory(options.Kubeconfig)
2222
if err != nil {

0 commit comments

Comments
 (0)