@@ -17,11 +17,9 @@ limitations under the License.
1717package options
1818
1919import (
20- "fmt"
2120 "time"
2221
2322 "github.com/spf13/pflag"
24- utilerrors "k8s.io/apimachinery/pkg/util/errors"
2523)
2624
2725type MysqlControllerOptions struct {
@@ -43,7 +41,7 @@ type MysqlControllerOptions struct {
4341
4442const (
4543 defaultAPIServerHost = ""
46- defaultNamespace = "default "
44+ defaultNamespace = ""
4745
4846 defaultLeaderElect = true
4947 defaultLeaderElectionNamespace = "kube-system"
@@ -74,8 +72,8 @@ func (s *MysqlControllerOptions) AddFlags(fs *pflag.FlagSet) {
7472 "Optional apiserver host address to connect to. If not specified, autoconfiguration " +
7573 "will be attempted." )
7674 fs .StringVar (& s .Namespace , "namespace" , defaultNamespace , "" +
77- "Namespace to monitor resources within. If not specified, default " +
78- "namespace will be watched" )
75+ "Namespace to monitor resources within. If not specified, all " +
76+ "namespaces will be watched" )
7977
8078 fs .BoolVar (& s .LeaderElect , "leader-elect" , true , "" +
8179 "If true, mysql-controller will perform leader election between instances " +
@@ -106,11 +104,3 @@ func (s *MysqlControllerOptions) AddFlags(fs *pflag.FlagSet) {
106104 fs .BoolVar (& s .InstallCRDs , "install-crds" , defaultInstallCRDs , "Whether or not to install CRDs." )
107105
108106}
109-
110- func (o * MysqlControllerOptions ) Validate () error {
111- var errs []error
112- if len (o .Namespace ) == 0 {
113- errs = append (errs , fmt .Errorf ("no namespace specified" ))
114- }
115- return utilerrors .NewAggregate (errs )
116- }
0 commit comments