fix: only remove node status when the node is unavailable #516
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
场景:一个node被设置了bypass,但是我们只希望它不参与后续的部署,node上面的workloads还可以正常提供服务。
问题:agent启动后更新了node status,selfmon收到了变更信息,调用SetNode,打算把这个node设置成UP。但是因为它被bypass了,所以触发了
n.IsDown()
,node status又被删除。selfmon再次收到变更信息,然后调用SetNode把node设置为DOWN,并且将上面所有workload标记为not running。修复:修改一下判断条件,只有在非bypass且down的情况才会删除node status。