Fix components crash before crds creation (#602)

* Wait for CRDs creation for 30 sec when component start
* Fix ensureCRD return nil while the error is not empty
This commit is contained in:
Ta-Ching Chen
2018-04-04 15:40:55 +08:00
committed by GitHub
parent 9406720e8a
commit 1dbf8f9243
10 changed files with 67 additions and 24 deletions
+8
View File
@@ -17,6 +17,8 @@ limitations under the License.
package kubewatcher
import (
"log"
"github.com/fission/fission/crd"
"github.com/fission/fission/publisher"
)
@@ -26,6 +28,12 @@ func Start(routerUrl string) error {
if err != nil {
return err
}
err = fissionClient.WaitForCRDs()
if err != nil {
log.Fatalf("Error waiting for CRDs: %v", err)
}
poster := publisher.MakeWebhookPublisher(routerUrl)
kubeWatch := MakeKubeWatcher(kubeClient, poster)
MakeWatchSync(fissionClient, kubeWatch)