tokers commented on a change in pull request #715:
URL: 
https://github.com/apache/apisix-ingress-controller/pull/715#discussion_r734176310



##########
File path: pkg/config/config.go
##########
@@ -191,3 +197,18 @@ func purifyAppNamespaces(namespaces []string) []string {
        }
        return ultimate
 }
+
+func (cfg *Config) verifyNamespaceSelector() (bool, error) {
+       labels := cfg.Kubernetes.NamespaceSelector
+       // default is [""]
+       if len(labels) == 1 && labels[0] == "" {
+               cfg.Kubernetes.NamespaceSelector = []string{}
+       }
+
+       for _, s := range cfg.Kubernetes.NamespaceSelector {
+               if len(strings.Split(s, "=")) != 2 {

Review comment:
       That's not enough as Kubernetes labels are made by characters conformed 
to DNS1123. So the label name should also be verified.
   
   Code written by us manually is not so reliable, I prefer to use an existing 
robust package to do this.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to