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

support v1_22 by feature gating crd v1beta1 #622

Merged
merged 4 commits into from
Sep 1, 2021
Merged

support v1_22 by feature gating crd v1beta1 #622

merged 4 commits into from
Sep 1, 2021

Conversation

clux
Copy link
Member

@clux clux commented Aug 10, 2021

slightly dodgy because we need to do one of:

  • pin k8s-openapi to v1_22 to test legacy features (tested in crd_api)
  • pin k8s-openapi to v1_21 and hope the legacy paths work (cant test)
  • build multiple k8s-openapi versions in CI

maybe the latter is the best. can pin latest everywhere, and have
examples lag behind as the only place to test legacy?

slightly dodgy because we need to do one of:

- pin k8s-openapi to v1_22 to test legacy features (tested in crd_api)
- pin k8s-openapi to v1_21 and hope the legacy paths work (cant test)
- build multiple k8s-openapi versions in CI

maybe the latter is the best. can pin latest everywhere, and have
examples lag behind as the only place to test legacy?

Signed-off-by: clux <[email protected]>
@nightkr
Copy link
Member

nightkr commented Aug 10, 2021

For the testing, maybe it'd be enough to add the following commands to the test suite:

  • cargo test --package kube --features k8s-openapi/v1_22
  • cargo test --package kube --features k8s-openapi/v1_21,deprecated-crd-v1beta1

@mattsre
Copy link

mattsre commented Aug 30, 2021

Hey there, is there any work that can be picked up here to help push this forward? I've looked a bit at the related issue and am currently running into the same issue on a project of mine when trying to upgrade to v1_22. I think being able to build/test against multiple versions of k8s_openapi in CI would be really nice.

@clux
Copy link
Member Author

clux commented Aug 30, 2021

Yeah sorry, a bit busy atm. Insofar as functionality is concerned this branch is done so you can use a cargo git pin to test. Otherwise, I'll be back for a bit on Tuesday evening and can probably make a few tweaks to the testing strategy and get this in then.

clux added 3 commits August 31, 2021 20:55
required a bit of re-jigging of re-exported features, but wont test
everything with older k8s-openapi, just that example

Signed-off-by: clux <[email protected]>
@clux
Copy link
Member Author

clux commented Aug 31, 2021

Decided on tracking latest version in master, so have fixed up unit tests in kube-core to point at non-deprecated endpoints, and bump to v1_22 everywhere.

Also added a deprecated feature re-export in examples and corr. feature gates around the crd_api example so that we can simply add one more test instruction in the ci job (similar to @teozkr 's suggestion) where we remove default features and test examples with a deprecated feature instead. However, this does need a disablable latest examples feature afaikt because the v1_22 feature must exist by default , and we can't just union in an older version (k8s-openapi only permits one feature), so this is the closest thing I could see working.

@clux clux marked this pull request as ready for review August 31, 2021 20:51
@clux
Copy link
Member Author

clux commented Sep 1, 2021

Ok, did some testing of this locally. The compile tests we run for crd_api is likely ok, just wanted to check. To actually check it we need to run an older cluster:

k3d cluster create --servers 1 --agents 1 --image rancher/k3s:v1.20.10-k3s1
# export kubeconfig correctly and maybe use it with KUBECONFIG
cargo run --example crd_api --no-default-features --features=deprecated,native-tls,kubederive

Satisfied that this at least works, so will merge this and leave the test to compile only on CI for now.

@clux clux merged commit c748690 into master Sep 1, 2021
@clux clux deleted the support-1_22 branch September 1, 2021 21:13
@clux
Copy link
Member Author

clux commented Sep 2, 2021

Released in 0.60.0 :-)

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.

Fails to compile against k8s-openapi with the 1_22 feature
3 participants