Skip to content

Commit

Permalink
[IMP] 修改cert-manager状态同步
Browse files Browse the repository at this point in the history
  • Loading branch information
李浩 committed Oct 20, 2022
1 parent 3ea76a8 commit e165e82
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions pkg/agent/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,22 +172,18 @@ func (w *workerManager) runWorker() {
//监听cert-mgr的pod运行情况
func (w *workerManager) monitorCertMgr() {

//临时存储pod status 每过10s判断pod状态是否更改,若更改则发送消息。
podStatusTmp := " "
for {
time.Sleep(10 * time.Second)
podStatusInfo, err := w.getPodStatus()
if err != nil {
glog.Error(err)
return
}
if podStatusInfo.Status != podStatusTmp {
podStatusTmp = podStatusInfo.Status
respB, _ := json.Marshal(podStatusInfo)
w.chans.ResponseChan <- &model.Packet{
Key: "cluster:" + model.ClusterId,
Type: model.CertManagerStatus,
Payload: string(respB),
}
respB, _ := json.Marshal(podStatusInfo)
w.chans.ResponseChan <- &model.Packet{
Key: "cluster:" + model.ClusterId,
Type: model.CertManagerStatus,
Payload: string(respB),
}
}
}
Expand Down

0 comments on commit e165e82

Please sign in to comment.