You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/11/15 01:46:02 UTC

[GitHub] [apisix-ingress-controller] tokers commented on a change in pull request #742: fix: ingress do not watching any namespace when namespaceSelector is empty

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



##########
File path: pkg/ingress/compare.go
##########
@@ -42,7 +43,7 @@ func (c *Controller) CompareResources(ctx context.Context) error {
 		consumerMapA6    = make(map[string]string)
 	)
 	// watchingNamespace == nil means to monitor all namespaces
-	if c.watchingNamespace == nil {
+	if !validation.HasValueInSyncMap(c.watchingNamespace) {

Review comment:
       This check is not safe. The result is only correct at a very specific point-in-time, which means the map might contains some elements after you check it. Please assess the impacts. If necessary, use a mutex.




-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org