Hide Forgot
Description of problem: When enabling API federation failed, now we need to delete crd manually, then we can re-enable API federation. Version-Release number of selected component (if applicable): kubefed2 version: version.Info{Version:"0.0.6", GitCommit:"de6a0a909418f5ddf2d04d232b0ca55aa9cffb49", GitTreeState:"clean", BuildDate:"2019-03-14T00:43:37Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"} Federation v2 controller-manager version: version.Info{Version:"0.0.6", GitCommit:"de6a0a909418f5ddf2d04d232b0ca55aa9cffb49", GitTreeState:"clean", BuildDate:"2019-03-14T00:43:37Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"} $ oc get clusterversion NAME VERSION AVAILABLE PROGRESSING SINCE STATUS version 4.0.0-0.nightly-2019-03-15-063749 True False 3h32m Cluster version is 4.0.0-0.nightly-2019-03-15-063749 How reproducible: 100% Steps to Reproduce: 1. Install federationv2 control plane under default namespace. 2. Create cluster federation with cmd: ./kubefed2 join cluster1 --host-cluster-context=admin ----cluster-context=admin --federation-namespace=default --registry-namespace=default --limited-scope --add-to-registry 3. Enable Service API federation with cmd: ./kubefed2 enable Service and get error: F0319 10:38:07.901777 5034 enable.go:109] error: Error creating FederatedTypeConfig "services": namespaces "federation-system" not found 4. Re-enable Service API federation with cmd: ./kubefed2 disable services --federation-namespace=default and get error: F0319 10:48:17.224579 5079 enable.go:109] error: Error creating CRD "federatedservices.types.federation.k8s.io": customresourcedefinitions.apiextensions.k8s.io "federatedservices.types.federation.k8s.io" already exists 5. Disable Service API federation, then re-enable, and get the same error. Actual results: If want to enable Service API federation successfully, need to do the following steps: 1. oc delete federatedservices.types.federation.k8s.io 2. ./kubefed2 disable services --federation-namespace=default Expected results: kubefed2 enable cmd can continue or kubefed2 disable cmd can delete the crd federatedservices.types.federation.k8s.io Additional info:
The problem of attempting to run `kubefed2 enable` against a non-existent namespace, this will be resolved by https://github.com/kubernetes-sigs/federation-v2/pull/659, which will ensure that the federation system namespace exists before attempting to perform any action. Regarding the problem of `kubefed2 enable` complaining that a crd already exists, this was resolved by https://github.com/kubernetes-sigs/federation-v2/pull/628 and the fix will appear in kubefed2 0.0.7. Regarding the problem of `kubefed2 disable` not being able to delete a crd without a federated type config being present, I think that is working as expected. kubefed2 is not intended to replace `kubectl delete`, so where a single resource needs to be deleted it will be up to the user to perform that operation manually.
Should be fixed in 0.0.7
Verified with: kubefed2 version: version.Info{Version:"v0.0.7", GitCommit:"83b778b6d92a7929efb7687d3d3d64bf0b3ad3bc", GitTreeState:"clean", BuildDate:"2019-03-19T18:40:46Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"linux/amd64"}
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:0758