apache / rocketmq-operator

Apache RocketMQ Operator
https://rocketmq.apache.org/
Apache License 2.0
314 stars 127 forks source link

Environment variable WATCH_NAMESPACE does not take effect #137

Closed himao closed 1 year ago

himao commented 1 year ago

Environment variable WATCH_NAMESPACE does not take effect.

BUG REPORT

  1. Please describe the issue you observed:
  1. Please tell us about your environment: Kubernetes 1.20

  2. Other information (e.g. detailed explanation, logs, related issues, suggestions how to fix, etc): operator log in gray namespace:

2022-10-25T06:04:28.238Z INFO controller_nameservice Share variables {"Request.Namespace": "prod", "Request.Name": "name-service", "GroupNum": 1, "NameServersStr": "172.16.0.18:9876;", "IsNameServersStrUpdated": false, "IsNameServersStrInitialized": true, "BrokerClusterName": "broker"} 2022-10-25T06:04:29.222Z INFO controller_broker Reconciling Broker. {"Request.Namespace": "prod", "Request.Name": "broker"} 2022-10-25T06:04:29.222Z INFO controller_broker brokerGroupNum=1, replicaPerGroup=1 {"Request.Namespace": "prod", "Request.Name": "broker"} 2022-10-25T06:04:29.222Z INFO controller_broker Check Broker cluster 1/1 {"Request.Namespace": "prod", "Request.Name": "broker"} 2022-10-25T06:04:29.222Z INFO controller_broker Check Replica Broker of cluster-0 1/1 {"Request.Namespace": "prod", "Request.Name": "broker"} 2022-10-25T06:04:29.222Z INFO controller_broker broker.Status.Nodes length = 2

caigy commented 1 year ago

@himao What's the operator image you previously used?

himao commented 1 year ago

@caigy The image used by the operator originally deployed in the prod namespace is apacherocketmq/rocketmq-operator:0.3.0-snapshot. Now the image used by the operator deployed in the gray namespace is apache/rocketmq-operator:0.3.0. Other information to note:

caigy commented 1 year ago

@himao By default, operator-sdk generates a cluster-scoped operator(https://sdk.operatorframework.io/docs/building-operators/golang/operator-scope/). So the operator can watch CRDs in all namespace. I'll check whether this operator was namespace-scoped in previous versions.