Skip to content

Commit 6e82553

Browse files
More feedback
1 parent 5c83fc6 commit 6e82553

File tree

8 files changed

+33
-32
lines changed

8 files changed

+33
-32
lines changed

cmd/clusterctl/client/cluster/client.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@ var (
3838
)
3939

4040
// GetCompatibleContractVersions return the list of contract version compatible with a given contract version.
41-
// NOTE: A contract version might be compatible with older contract versions e.g. to allow users time to transition to the new API.
41+
// NOTE: A contract version might be temporarily compatible with older contract versions e.g. to allow users time to transition to the new API.
4242
// NOTE: The return value must include also the contract version received in input.
4343
func GetCompatibleContractVersions(contract string) sets.Set[string] {
4444
compatibleContracts := sets.New(contract)
45+
// v1beta2 contract is temporarily be compatible with v1beta1 (until v1beta1 is EOL).
4546
if contract == "v1beta2" {
4647
compatibleContracts.Insert("v1beta1")
4748
}

cmd/clusterctl/client/cluster/installer.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ type ProviderInstaller interface {
5656
// Validate performs steps to validate a management cluster by looking at the current state and the providers in the queue.
5757
// The following checks are performed in order to ensure a fully operational cluster:
5858
// - There must be only one instance of the same provider
59-
// - All the providers in must support contract version or compatible version
59+
// - All providers must support the contract version or one of its compatible versions
6060
// - All provider CRDs that are referenced in core Cluster API CRDs must comply with the CRD naming scheme,
6161
// otherwise a warning is logged.
6262
Validate(context.Context) error
@@ -200,10 +200,10 @@ func (i *providerInstaller) Validate(ctx context.Context) error {
200200
coreProvider := coreProviders[0]
201201

202202
managementClusterContract, err := i.getProviderContract(ctx, providerInstanceContracts, coreProvider)
203-
compatibleContracts := i.getCompatibleContractVersions(managementClusterContract)
204203
if err != nil {
205204
return err
206205
}
206+
compatibleContracts := i.getCompatibleContractVersions(managementClusterContract)
207207

208208
// Checks if all the providers supports the same Cluster API contract or compatible contracts.
209209
for _, components := range i.installQueue {
@@ -325,7 +325,7 @@ func (i *providerInstaller) getProviderContract(ctx context.Context, providerIns
325325

326326
compatibleContracts := i.getCompatibleContractVersions(i.currentContractVersion)
327327
if !compatibleContracts.Has(releaseSeries.Contract) {
328-
return "", errors.Errorf("current version of clusterctl is only compatible with providers implementing the %s contract version, detected contract version %s for provider %s", strings.Join(compatibleContracts.UnsortedList(), ", "), releaseSeries.Contract, provider.ManifestLabel())
328+
return "", errors.Errorf("current version of clusterctl is only compatible with providers implementing the %s contract versions, detected contract version %s for provider %s", strings.Join(compatibleContracts.UnsortedList(), ", "), releaseSeries.Contract, provider.ManifestLabel())
329329
}
330330

331331
providerInstanceContracts[provider.InstanceName()] = releaseSeries.Contract

cmd/clusterctl/client/cluster/installer_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ func Test_providerInstaller_Validate(t *testing.T) {
167167
proxy: test.NewFakeProxy(), // empty cluster
168168
installQueue: []repository.Components{
169169
newFakeComponents("cluster-api", clusterctlv1.CoreProviderType, "v1.0.0", "cluster-api-system"),
170-
newFakeComponents("infra3", clusterctlv1.InfrastructureProviderType, "v1.0.0", "infra1-system"),
170+
newFakeComponents("infra3", clusterctlv1.InfrastructureProviderType, "v1.0.0", "infra3-system"),
171171
},
172172
},
173173
wantErr: false,
@@ -191,7 +191,7 @@ func Test_providerInstaller_Validate(t *testing.T) {
191191
WithProviderInventory("cluster-api", clusterctlv1.CoreProviderType, "v1.0.0", "cluster-api-system").
192192
WithProviderInventory("infra1", clusterctlv1.InfrastructureProviderType, "v1.0.0", "infra1-system"),
193193
installQueue: []repository.Components{
194-
newFakeComponents("infra3", clusterctlv1.InfrastructureProviderType, "v1.0.0", "infra2-system"),
194+
newFakeComponents("infra3", clusterctlv1.InfrastructureProviderType, "v1.0.0", "infra3-system"),
195195
},
196196
},
197197
wantErr: false,

cmd/clusterctl/client/cluster/upgrader.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func (u *providerUpgrader) createCustomPlan(ctx context.Context, upgradeItems []
290290
}
291291

292292
if !compatibleContracts.Has(contract) {
293-
return nil, errors.Errorf("unable to perform upgrade: the target version for the provider %s implements the %s contract version, while the core provider supports %s contract version", upgradeItem.InstanceName(), contract, strings.Join(compatibleContracts.UnsortedList(), ", "))
293+
return nil, errors.Errorf("unable to perform upgrade: the target version for the provider %s implements the %s contract version, while the core provider supports %s contract versions", upgradeItem.InstanceName(), contract, strings.Join(compatibleContracts.UnsortedList(), ", "))
294294
}
295295

296296
upgradePlan.Providers = append(upgradePlan.Providers, upgradeItem)
@@ -311,7 +311,7 @@ func (u *providerUpgrader) createCustomPlan(ctx context.Context, upgradeItems []
311311
}
312312

313313
if !compatibleContracts.Has(contract) {
314-
return nil, errors.Errorf("unable to perform upgrade: the provider %s implements the %s contract version, while the core provider to a version that supports %s contract version. Please include the %[1]s provider in the upgrade", provider.InstanceName(), contract, strings.Join(compatibleContracts.UnsortedList(), ", "))
314+
return nil, errors.Errorf("unable to perform upgrade: the provider %s implements the %s contract version, while the core provider is getting updated to a version that supports %s contract versions. Please include the %[1]s provider in the upgrade", provider.InstanceName(), contract, strings.Join(compatibleContracts.UnsortedList(), ", "))
315315
}
316316
}
317317
return upgradePlan, nil

cmd/clusterctl/client/generate_provider.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func (c *clusterctlClient) GenerateProvider(ctx context.Context, provider string
6363

6464
compatibleContracts := c.getCompatibleContractVersions(c.currentContractVersion)
6565
if !compatibleContracts.Has(releaseSeries.Contract) {
66-
return nil, errors.Errorf("current version of clusterctl is only compatible with provider implementing %s conctract version, detected %s for provider %s", strings.Join(compatibleContracts.UnsortedList(), ", "), releaseSeries.Contract, providerName)
66+
return nil, errors.Errorf("current version of clusterctl is only compatible with provider implementing %s conctract versions, detected %s for provider %s", strings.Join(compatibleContracts.UnsortedList(), ", "), releaseSeries.Contract, providerName)
6767
}
6868

6969
return c.GetProviderComponents(ctx, provider, providerType, options)

cmd/clusterctl/cmd/upgrade_apply.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ var upgradeApplyCmd = &cobra.Command{
5757
Specifying the provider using namespace/name:version is deprecated and will be dropped in a future release.`),
5858
Example: templates.Examples(`
5959
# Upgrades all the providers in the management cluster to the latest version available which is compliant
60-
# to the v1alpha4 Cluster API contract version.
61-
clusterctl upgrade apply --contract v1alpha4
60+
# to the v1beta2 Cluster API contract version.
61+
clusterctl upgrade apply --contract v1beta2
6262
6363
# Upgrades only the aws provider to the v2.0.1 version.
6464
clusterctl upgrade apply --infrastructure aws:v2.0.1`),
@@ -74,7 +74,7 @@ func init() {
7474
upgradeApplyCmd.Flags().StringVar(&ua.kubeconfigContext, "kubeconfig-context", "",
7575
"Context to be used within the kubeconfig file. If empty, current context will be used.")
7676
upgradeApplyCmd.Flags().StringVar(&ua.contract, "contract", "",
77-
"The Cluster API contract version (e.g. v1alpha4) the management cluster should upgrade to")
77+
"The Cluster API contract version (e.g. v1beta2) the management cluster should upgrade to")
7878

7979
upgradeApplyCmd.Flags().StringVar(&ua.coreProvider, "core", "",
8080
"Core provider instance version (e.g. cluster-api:v1.1.5) to upgrade to. This flag can be used as alternative to --contract.")

docs/book/src/clusterctl/commands/upgrade.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ You can now apply the upgrade by executing the following command:
3434
clusterctl upgrade apply --contract v1beta1
3535
```
3636

37-
The output contains the latest release available for each cluster API contract version.
37+
The output contains the latest release available for each Cluster API contract version.
3838
available at the moment.
3939

4040
<aside class="note">

docs/book/src/reference/versions.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,17 @@ An API version is considered deprecated when a new API version is published.
118118
API deprecation and removal follow the [Kubernetes Deprecation Policy](https://kubernetes.io/docs/reference/using-api/deprecation-policy/);
119119
Cluster API maintainers might decide to support API versions longer than what is defined in the Kubernetes policy.
120120

121-
| API Version | Status | Supported Until |
122-
|-------------|----------------|----------------------------------------------------------------------------------|
123-
| v1beta2 | Supported | at least 9 months or 3 minor releases after a newer API version will be released |
124-
| v1beta1 | Deprecated | Deprecated since CAPI v1.11, EOL planned for v1.14, Aug 26 |
125-
| v1alpha4 | Not served (*) | EOL since 2023-12-05 - v1.6.0 release date; removal planned for v1.13, Apr 26 |
126-
| v1alpha3 | Not served (*) | EOL since 2023-07-25 - v1.5.0 release date; removal planned for v1.13, Apr 26 |
127-
128-
See [11920](https://github.com/kubernetes-sigs/cluster-api/issues/11920) for details about the v1beta14 removal plan.
121+
| API Version | Status | Supported Until |
122+
|-------------|-------------|----------------------------------------------------------------------------------|
123+
| v1beta2 | Supported | at least 9 months or 3 minor releases after a newer API version will be released |
124+
| v1beta1 | Deprecated | Deprecated since CAPI v1.11; in v1.14, Aug 26 v1beta1 will stop to be served |
125+
| v1alpha4 | Not served | EOL since 2023-12-05 - v1.6.0 release date; removal planned for v1.13, Apr 26 |
126+
| v1alpha3 | Not served | EOL since 2023-07-25 - v1.5.0 release date; removal planned for v1.13, Apr 26 |
127+
128+
See [11920](https://github.com/kubernetes-sigs/cluster-api/issues/11920) for details about the v1beta1 removal plan.
129129
See [11919](https://github.com/kubernetes-sigs/cluster-api/issues/11919) for details about the v1alpha3/v1alpha4 removal plan.
130-
- (*) Cluster API stopped to serve v1alpha3 API types from the v1.5 release and v1alpha4 types starting from the v1.6 release.
131-
Those types still exist in Cluster API while we work to a fix (or a workaround) for [10051](https://github.com/kubernetes-sigs/cluster-api/issues/10051).
130+
Note: Cluster API stopped to serve v1alpha3 API types from the v1.5 release and v1alpha4 types starting from the v1.6 release.
131+
Those types still exist in Cluster API while we work to a fix (or a workaround) for [10051](https://github.com/kubernetes-sigs/cluster-api/issues/10051).
132132

133133
<aside class="note warning">
134134

@@ -156,17 +156,17 @@ See [provider contracts](../developer/providers/contracts/overview.md)
156156
Each Cluster API release supports one contract version, and by convention the supported contract version matches
157157
the newest API version in the same Cluster API release.
158158

159-
A contract version might be compatible with older contract versions; compatibility for older contract versions will
160-
be dropped when the older contract version will be considered EOL.
159+
A contract version might be temporarily compatible with older contract versions to ease transition of providers to
160+
a new supported version; compatibility for older contract versions will be dropped when the older contract version is EOL.
161161

162-
| Contract Version | Compatible with contract versions | Status | Supported Until |
163-
|------------------|-----------------------------------|-------------|------------------------------------------------------------|
164-
| v1beta2 | v1beta1 | Supported | After a newer API contract will be released |
165-
| v1beta1 | | Deprecated | Deprecated since CAPI v1.11, EOL planned for v1.14, Aug 26 |
166-
| v1alpha4 | | EOL | EOL since 2023-12-05 - v1.6.0 release date |
167-
| v1alpha3 | | EOL | EOL since 2023-07-25 - v1.5.0 release date |
162+
| Contract Version | Compatible with contract versions | Status | Supported Until |
163+
|------------------|-----------------------------------|-------------|---------------------------------------------------------------------------------------------|
164+
| v1beta2 | v1beta1 (temporarily) | Supported | After a newer API contract will be released |
165+
| v1beta1 | | Deprecated | Deprecated since CAPI v1.11; in v1.14, Aug 26 v1beta1 will no more be considered compatible |
166+
| v1alpha4 | | EOL | EOL since 2023-12-05 - v1.6.0 release date |
167+
| v1alpha3 | | EOL | EOL since 2023-07-25 - v1.5.0 release date |
168168

169-
See [11920](https://github.com/kubernetes-sigs/cluster-api/issues/11920) for details about the v1beta14 removal plan.
169+
See [11920](https://github.com/kubernetes-sigs/cluster-api/issues/11920) for details about the v1beta1 removal plan.
170170

171171
#### Supported Cluster API - Cluster API provider version Skew
172172

0 commit comments

Comments
 (0)