Description of problem: Unjoin a cluster which not exists in the federation gives an unclear err msg 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"} How reproducible: Always Steps to Reproduce: 1. Install federationV2 control plane with marketplace undernamespace: federation-llng 2. Join "cluster1" to federation with cmd: kubefed2 join cluster1 --host-cluster-context=host-admin --cluster-context=cluster1-admin --federation-namespace=federation-llng --registry-namespace=federation-llng --add-to-registry 3. Unjoin "cluster1" with cmd: kubefed2 unjoin cluster1 --cluster-context=cluster1-admin --host-cluster-context=host-admin --federation-namespace=federation-llng --registry-namespace=federation-llng --remove-from-registry 4. Unjoin "cluster1" again. Actual results: E0315 09:13:07.474598 2572 unjoin.go:308] Error deleting service account: cluster1-host-admin in unjoining cluster. serviceaccounts "cluster1-host-admin" not found Expected results: cluster1 not found. Additional info:
I think it's right for repeat invocations of 'unjoin' to attempt to delete the associated resources, _but_ it shouldn't be an error if they don't exist (since they may have already been deleted). WDYT?
Return an error message is ok for me, but I think we should give an message to tell people, he already unjoined the cluster from the federation, he does not need to try creating serviceaccout then try unjoining again. For exampla: $ oc delete federatedsecrets test-secret Error from server (NotFound): federatedsecrets.types.federation.k8s.io "test-secret" not found.
I've filed an upstream bug: https://github.com/kubernetes-sigs/federation-v2/issues/745
The upstream issue was resolved 3 weeks ago and the fix will appear in subsequent releases (0.1.0-rc2 and greater).
The fix should appear in releases rc2 and greater.
Verified with kubefedctl version: version.Info{Version:"v4.2.0", GitCommit:"ee84d241d0d8038640f9dad7cbeb0ea8cce58b6c", GitTreeState:"clean", BuildDate:"2019-08-06T18:27:54Z", GoVersion:"go1.12.6", Compiler:"gc", Platform:"linux/amd64"} $ kubefedctl unjoin cluster1 --host-cluster-context=admin --cluster-context=admin --kubefed-namespace=federation-system $ kubefedctl unjoin cluster1 --host-cluster-context=admin --cluster-context=admin --kubefed-namespace=federation-system F0808 16:51:58.317988 5271 unjoin.go:95] Error: Failed to get kubefed cluster "federation-system/cluster1": kubefedclusters.core.kubefed.io "cluster1" not found
Does this bug require doc text? The Doc Type/Text field is not currently set. Thanks!