mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-09-30 16:27:28 +02:00
Kill operator if the namespace to watch does not exist
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user