File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,11 +112,14 @@ func (c *collectorSet) Set(value string) error {
112112 s := * c
113113 cols := strings .Split (value , "," )
114114 for _ , col := range cols {
115- _ , ok := availableCollectors [col ]
116- if ! ok {
117- glog .Fatalf ("Collector \" %s\" does not exist" , col )
115+ col = strings .TrimSpace (col )
116+ if len (col ) != 0 {
117+ _ , ok := availableCollectors [col ]
118+ if ! ok {
119+ glog .Fatalf ("Collector \" %s\" does not exist" , col )
120+ }
121+ s [col ] = struct {}{}
118122 }
119- s [col ] = struct {}{}
120123 }
121124 return nil
122125}
@@ -149,12 +152,17 @@ func (n *namespaceList) IsAllNamespaces() bool {
149152
150153func (n * namespaceList ) Set (value string ) error {
151154 splittedNamespaces := strings .Split (value , "," )
152- * n = append (* n , splittedNamespaces ... )
155+ for _ , ns := range splittedNamespaces {
156+ ns = strings .TrimSpace (ns )
157+ if len (ns ) != 0 {
158+ * n = append (* n , ns )
159+ }
160+ }
153161 return nil
154162}
155163
156164func (n * namespaceList ) Type () string {
157- return "namespaceList "
165+ return "string "
158166}
159167
160168type options struct {
You can’t perform that action at this time.
0 commit comments