You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ProviderInstaller defines methods for enforcing consistency rules for provider installation.
@@ -53,6 +58,8 @@ type ProviderInstaller interface {
53
58
// The following checks are performed in order to ensure a fully operational cluster:
54
59
// - There must be only one instance of the same provider
55
60
// - All the providers in must support the same API Version of Cluster API (contract)
61
+
// - All provider CRDs that are referenced in core Cluster API CRDs must comply with the CRD naming scheme,
62
+
// otherwise a warning is logged.
56
63
Validate() error
57
64
58
65
// Images returns the list of images required for installing the providers ready in the install queue.
@@ -209,9 +216,75 @@ func (i *providerInstaller) Validate() error {
209
216
returnerrors.Errorf("installing provider %q can lead to a non functioning management cluster: the target version for the provider supports the %s API Version of Cluster API (contract), while the management cluster is using %s", components.ManifestLabel(), providerContract, managementClusterContract)
210
217
}
211
218
}
219
+
220
+
// Validate if provider CRDs comply with the naming scheme.
221
+
for_, components:=rangei.installQueue {
222
+
componentObjects:=components.Objs()
223
+
224
+
for_, obj:=rangecomponentObjects {
225
+
// Continue if object is not a CRD.
226
+
ifobj.GetKind() !=customResourceDefinitionKind {
227
+
continue
228
+
}
229
+
230
+
gk, err:=getCRDGroupKind(obj)
231
+
iferr!=nil {
232
+
returnerrors.Wrap(err, "Failed to read group and kind from CustomResourceDefinition")
returnerrors.Errorf("WARNING: CRD name %q is invalid for a CRD referenced in a core Cluster API CRD,"+
283
+
"it should be %q. Support for CRDs that are referenced in core Cluster API resources with invalid names will be "+
284
+
"dropped in a future Cluster API release. Note: Please check if this CRD is actually referenced in core Cluster API "+
285
+
"CRDs. If not, this warning can be hidden by setting the %q' annotation.", obj.GetName(), correctCRDName, clusterctlv1.SkipCRDNamePreflightCheckAnnotation)
286
+
}
287
+
215
288
// getProviderContract returns the API Version of Cluster API (contract) for a provider instance.
Copy file name to clipboardExpand all lines: docs/book/src/developer/providers/v1.2-to-v1.3.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,9 @@ The default value is 0, meaning that the volume can be detached without any time
45
45
46
46
### Other
47
47
48
+
- clusterctl now emits a warning for provider CRDs which don't comply with the CRD naming conventions. This warning can be skipped for resources not referenced by Cluster API
49
+
core resources via the `clusterctl.cluster.x-k8s.io/skip-crd-name-preflight-check` annotation. The contracts specify:
50
+
> The CRD name must have the format produced by sigs.k8s.io/cluster-api/util/contract.CalculateCRDName(Group, Kind)
48
51
- The Kubernetes default registry has been changed from `k8s.gcr.io` to `registry.k8s.io`. Kubernetes image promotion currently publishes to both registries. Please
49
52
consider publishing manifests which reference the controller images from the new registry (for reference [Cluster API PR](https://github.com/kubernetes-sigs/cluster-api/pull/7478)).
50
53
- e2e tests are upgraded to use Ginkgo v2 (v2.4.0) and Gomega v1.22.1. Providers who use the test framework from this release will also need to upgrade, because Ginkgo v2 can't be imported alongside v1. Please see the [Ginkgo upgrade guide](https://onsi.github.io/ginkgo/MIGRATING_TO_V2), and note:
Copy file name to clipboardExpand all lines: docs/book/src/reference/labels_and_annotations.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,7 @@
20
20
21
21
| Annotation | Note |
22
22
|:--------|:--------|
23
+
| clusterctl.cluster.x-k8s.io/skip-crd-name-preflight-check | Can be placed on provider CRDs, so that clusterctl doesn't emit a warning if the CRD doesn't comply with Cluster APIs naming scheme. Only CRDs that are referenced by core Cluster API CRDs have to comply with the naming scheme. |
23
24
| unsafe.topology.cluster.x-k8s.io/disable-update-class-name-check | It can be used to disable the webhook check on update that disallows a pre-existing Cluster to be populated with Topology information and Class. |
24
25
| cluster.x-k8s.io/cluster-name | It is set on nodes identifying the name of the cluster the node belongs to. |
25
26
|cluster.x-k8s.io/cluster-namespace | It is set on nodes identifying the namespace of the cluster the node belongs to. |
@@ -45,4 +46,4 @@
45
46
| machinedeployment.clusters.x-k8s.io/max-replicas | It is the maximum replicas a deployment can have at a given point, which is machinedeployment.spec.replicas + maxSurge. Used by the underlying machine sets to estimate their proportions in case the deployment has surge replicas. |
46
47
| controlplane.cluster.x-k8s.io/skip-coredns | It explicitly skips reconciling CoreDNS if set. |
47
48
|controlplane.cluster.x-k8s.io/skip-kube-proxy | It explicitly skips reconciling kube-proxy if set.|
48
-
| controlplane.cluster.x-k8s.io/kubeadm-cluster-configuration| It is a machine annotation that stores the json-marshalled string of KCP ClusterConfiguration. This annotation is used to detect any changes in ClusterConfiguration and trigger machine rollout in KCP.|
49
+
| controlplane.cluster.x-k8s.io/kubeadm-cluster-configuration| It is a machine annotation that stores the json-marshalled string of KCP ClusterConfiguration. This annotation is used to detect any changes in ClusterConfiguration and trigger machine rollout in KCP.|
0 commit comments