Kill operator if the namespace to watch does not exist

This commit is contained in:
Sergey Dudoladov 2018-02-08 14:24:47 +01:00
parent 794feee3e1
commit 86807d21ba
1 changed files with 1 additions and 1 deletions

View File

@ -148,7 +148,7 @@ func (c *Controller) initController() {
if c.opConfig.WatchedNamespace != v1.NamespaceAll {
_, err := c.KubeClient.Namespaces().Get(c.opConfig.WatchedNamespace, metav1.GetOptions{})
if err != nil {
c.logger.Warnf("Operator was told to watch the %q namespace but was unable to confirm it existense via Kubernetes API. Falling back to watching all namespaces instead (done automatically by k8s)", c.opConfig.WatchedNamespace)
c.logger.Fatalf("Operator was told to watch the %q namespace but was unable to find it via Kubernetes API.", c.opConfig.WatchedNamespace)
}
}