Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
daemon: Use LastSuccessInteraction instead of LastInteraction
cilium-agent periodically checks the connectivity to the k8s api-server by "kubernetes" probe. cachedVersion() returns a cached value of the k8s version to the probe if not expired or invalid. The logic for evaluating the validity of the cache is as follows: 1. check if the api-server connectivity is healthy. If the last check was more than k8sMinimumEventHeartbeat(default: 1m) ago, then valid=false is returned. 2. if the api-server connectivity is given, returns valid=false if the last check was more than k8sVersionCheckInterval(default: 15m) ago. 3. otherwise returns the cached value and valid=true. Currently 'k8smetrics.LastInteraction.Time()' is used in the step 1, which is updated periodically regardless of whether the api-server connectivity is alive or not. This commit fixes it to use 'k8smetrics.LastSuccessInteraction.Time()' instead. Signed-off-by: naoki-take <naoki-take@cybozu.co.jp>
- Loading branch information