Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

detect if the cluster has endpoint slices #2049

Merged
merged 1 commit into from Feb 16, 2021
Merged

detect if the cluster has endpoint slices #2049

merged 1 commit into from Feb 16, 2021

Conversation

aojea
Copy link
Contributor

@aojea aojea commented Feb 16, 2021

The detection of the kubernetes version fails in the CI, because the library doesn't parse minors versions that are not only numbers, i.e v1.21.0-alpha.1, that are typically all the clusters that run in the CI.
We really don't need to check the kubernetes version, because the controller can work without dual-stack , it only needs that the cluster has endpoint slices enabled.

the endpoint slice controller was checking if the kubernetes
version was greater than 1.20 in order to run, so it can verify
the dual-stack api was implemented.

Since the endpoint slice controller in ovn can run with or without
the dualstack api, we only need to check that the API for slices
is enabled.

Signed-off-by: Antonio Ojea <aojea@redhat.com>
Copy link
Contributor

@trozet trozet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

func UseEndpointSlices(kubeClient kubernetes.Interface) bool {
endpointSlicesEnabled := false
if _, err := kubeClient.Discovery().ServerResourcesForGroupVersion(discovery.SchemeGroupVersion.String()); err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just so I remember in the future. This works because it pulls the client's scheme version and then queries the server to check if it supports whats in the client's schema (and obviously our client has support for endpoint slices).

@coveralls
Copy link

coveralls commented Feb 16, 2021

Coverage Status

Coverage increased (+0.03%) to 54.875% when pulling 4e7c6df on aojea:slicedetection into 05e94c0 on ovn-org:master.

@trozet
Copy link
Contributor

trozet commented Feb 16, 2021

hmm some network policy flakes and this flaked 5x:
deployment [It] should run the lifecycle of a Deployment [Conformance]

https://github.com/ovn-org/ovn-kubernetes/pull/2049/checks?check_run_id=1912398180

@trozet
Copy link
Contributor

trozet commented Feb 16, 2021

/retest

@aojea
Copy link
Contributor Author

aojea commented Feb 16, 2021

hmm some network policy flakes and this flaked 5x:
deployment [It] should run the lifecycle of a Deployment [Conformance]

IIRC that is a very resource intensive and complex test,

@trozet trozet merged commit a538127 into ovn-org:master Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants