Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
k8s: Add capability flag for watching metav1.POM
The ability to watch metav1.PartialObjectMetadata (or POM) and metav1.Table was introduced in K8s 1.15. [1] This is relevant because our CRD controller attempts to fetch CRDs in the cluster efficiently by requesting the CRD in a POM object. The CRD controller does this in order to avoid requesting the full object, which may contain a large validation schema and other irrelevant fields. This is important because in large-scale environments, all agents will request all the CRDs at once which will put unnecessary load on the apiserver. However, we cannot perform this request at all on versions of K8s 1.14 and below. Therefore, we must fullback to requesting the full CRD object. Hence, this commit allows us to check whether the apiserver supports this action, so that we can efficiently request CRDs on versions that do support it. [1]: KEP: https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/20190322-server-side-get-to-ga.md#goals [1]: PR: kubernetes/kubernetes#71548 Signed-off-by: Chris Tarazi <chris@isovalent.com>
- Loading branch information