kubernetes源码之watch包until.go阅读理解四

本文详细解析Kubernetes源码中watch包的Until函数,通过逐步剖析,帮助读者深入理解其工作原理和实现细节。
摘要由CSDN通过智能技术生成

一步一步来理解

until.go    until单词的意思conj. 在…以前;直到…时  prep. 在…以前;到…为止。那这个函数到执行到什么时候为止呢?
原文代码量几十行,内容较少,先看原始注释 
// ConditionFunc returns true if the condition has been reached, false if it has not been reached yet,
// or an error if the condition cannot be checked and should terminate. In general, it is better to define
// level driven conditions over edge driven conditions (pod has ready=true, vs pod modified and ready changed
// from false to true).
//条件:如果条件已达到,则返回true;如果尚未到达,则返回false;或错误,如果条件不能被检查,并且应该终止。
//一般来说,最好是定义水平驱动条件超过边缘驱动条件(pod状态  ready = true,对pod进行了修改,状态已经改变从false改为true)。

//有道翻译,看翻译越看越迷糊,还不如根据代码来看
type ConditionFunc func(event Event) (bool, error)

// errWatchClosed is returned when the watch channel is closed before timeout in Until.
// 当watch通道在超时之前关闭时,将返回errWatchClosed。
var errWatchClosed = errors.New("watch closed before Un
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值