Skip to content

Commit e165e82

Browse files
author
李浩
committed
[IMP] 修改cert-manager状态同步
1 parent 3ea76a8 commit e165e82

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

pkg/agent/worker.go

+6-10
Original file line numberDiff line numberDiff line change
@@ -172,22 +172,18 @@ func (w *workerManager) runWorker() {
172172
//监听cert-mgr的pod运行情况
173173
func (w *workerManager) monitorCertMgr() {
174174

175-
//临时存储pod status 每过10s判断pod状态是否更改,若更改则发送消息。
176-
podStatusTmp := " "
177175
for {
178176
time.Sleep(10 * time.Second)
179177
podStatusInfo, err := w.getPodStatus()
180178
if err != nil {
179+
glog.Error(err)
181180
return
182181
}
183-
if podStatusInfo.Status != podStatusTmp {
184-
podStatusTmp = podStatusInfo.Status
185-
respB, _ := json.Marshal(podStatusInfo)
186-
w.chans.ResponseChan <- &model.Packet{
187-
Key: "cluster:" + model.ClusterId,
188-
Type: model.CertManagerStatus,
189-
Payload: string(respB),
190-
}
182+
respB, _ := json.Marshal(podStatusInfo)
183+
w.chans.ResponseChan <- &model.Packet{
184+
Key: "cluster:" + model.ClusterId,
185+
Type: model.CertManagerStatus,
186+
Payload: string(respB),
191187
}
192188
}
193189
}

0 commit comments

Comments
 (0)