Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1690211 - [RFE] Can fix enabling API federation failure with kubefed2 cmd
Summary: [RFE] Can fix enabling API federation failure with kubefed2 cmd
Keywords:
Status: VERIFIED
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Federation
Version: 4.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.1.0
Assignee: Maru Newby
QA Contact: Qin Ping
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-19 02:52 UTC by Qin Ping
Modified: 2019-04-04 03:09 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)

Description Qin Ping 2019-03-19 02:52:25 UTC
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:

Comment 1 Maru Newby 2019-03-19 18:25:38 UTC
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.

Comment 2 Paul Morie 2019-04-02 11:56:57 UTC
Should be fixed in 0.0.7

Comment 4 Qin Ping 2019-04-04 03:09:34 UTC
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"}


Note You need to log in before you can comment on or make changes to this bug.