Skip to content
This repository was archived by the owner on Apr 25, 2023. It is now read-only.

Commit 3485e93

Browse files
authored
Merge pull request #1207 from mesosphere/hectorj2f/fix_enable_cmd_for_crds
fix: enable command for crd resources
2 parents 97505c9 + 1f33c75 commit 3485e93

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

docs/userguide.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,12 @@ See the [Cluster Registration documentation](./cluster-registration.md) for more
111111
You can enable federation of any Kubernetes API type (including CRDs) by using the
112112
`kubefedctl` command as follows.
113113

114-
**NOTE:** Federation of a CRD requires that the CRD be installed on all member clusters. If
115-
the CRD is not installed on a member cluster, propagation to that cluster will fail.
114+
**NOTE:** Federation of a CRD requires that the CRD Kubernetes type (`customresourcedefinitions`) to be enabled, to then
115+
federate any custom CRD on the member clusters. If the CRD Kubernetes type is not enabled and its Federated equivalent CRD is not federated, the propagation to that cluster will fail.
116116

117117
```bash
118-
kubefedctl enable <target kubernetes API type>
118+
kubefedctl enable customresourcedefinitions
119+
kubefedctl federate crd <target kubernetes API type> # <target kubernetes API type> = mytype.mygroup.mydomain.io
119120
```
120121

121122
The `<target kubernetes API type>` can be any of the following

pkg/kubefedctl/enable/schema.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ func (v *jsonSchemaVistor) VisitReference(r proto.Reference) {
189189
// Short-circuit the recursive definition of JSONSchemaProps (used for CRD validation)
190190
//
191191
// TODO(marun) Implement proper support for recursive schema
192-
if r.Reference() == "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps" {
192+
if r.Reference() == "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps" ||
193+
r.Reference() == "io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.JSONSchemaProps" {
193194
v.collect(apiextv1b1.JSONSchemaProps{Type: "object"})
194195
return
195196
}

0 commit comments

Comments
 (0)