Skip to content

Commit

Permalink
Default TidbMonitor targetRef Namespace (#1834)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yisaer authored Mar 3, 2020
1 parent 80f129e commit 0a0c44c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/monitor/monitor/monitor_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ func (mm *MonitorManager) syncTidbMonitorDeployment(monitor *v1alpha1.TidbMonito
}

targetTcRef := monitor.Spec.Clusters[0]
if len(targetTcRef.Namespace) < 1 {
targetTcRef.Namespace = monitor.Namespace
}

tc, err := mm.tcLister.TidbClusters(targetTcRef.Namespace).Get(targetTcRef.Name)
if err != nil {
return err
Expand Down

0 comments on commit 0a0c44c

Please sign in to comment.