in config/flags.go [24:47]
func ValidateFlags() {
if ClusterScoped && WatchNamespace != "" {
// Ignore WatchNamespace if operator is cluster-scoped
klog.Warning("Ignoring option 'watch-namespace' as 'cluster-scoped' is enabled")
WatchNamespace = ""
}
runningInsideK8s := helpers.IsAppRunningInsideK8s()
if !runningInsideK8s {
if Kubeconfig == "" && MasterURL == "" {
// Operator is running out of K8s Cluster but kubeconfig/masterURL are not specified.
klog.Fatal("Ndb operator cannot connect to the Kubernetes Server.\n" +
"Please specify kubeconfig or masterURL.")
}
// WatchNamespace is required for operator running in namespace-scoped mode out-of-cluster.
if !ClusterScoped && WatchNamespace == "" {
klog.Fatal("For operator running in namespace-scoped mode out-of-cluster, " +
"'-watch-namespace' argument needs to be provided.")
}
}
}