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

Add a compile_error if setting selectable fields on K8s < 1.30 #1612

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

clux
Copy link
Member

@clux clux commented Oct 18, 2024

As it is not available on older Kubernetes versions.

Doing this now causes:

error: selectable fields require Kubernetes >= 1.30
  --> examples/crd_derive.rs:12:10
   |
12 | #[derive(CustomResource, Serialize, Deserialize, Default, Debug, PartialEq, Eq, Clone, JsonSchema)]
   |          ^^^^^^^^^^^^^^
   |
   = note: this error originates in the derive macro `CustomResource` (in Nightly builds, run with -Z macro-backtrace for more info)

(can be seen if hacking examples/cargo.toml to use earliest from k8s-openapi)

Follow-up to #1610

@clux clux added the changelog-fix changelog fix category for prs label Oct 18, 2024
@clux clux added this to the 0.97.0 milestone Oct 18, 2024
Copy link
Member

@Danil-Grigorev Danil-Grigorev left a comment

Choose a reason for hiding this comment

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

Thank you, LGTM

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.3%. Comparing base (7526539) to head (48ec7a0).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1612     +/-   ##
=======================================
+ Coverage   75.3%   75.3%   +0.1%     
=======================================
  Files         82      82             
  Lines       7340    7343      +3     
=======================================
+ Hits        5524    5527      +3     
  Misses      1816    1816             
Files with missing lines Coverage Δ
kube-derive/src/custom_resource.rs 81.5% <100.0%> (+0.4%) ⬆️

@clux clux marked this pull request as ready for review October 18, 2024 10:50
@clux clux merged commit ecbdafc into main Oct 18, 2024
18 checks passed
@clux clux deleted the compile-error-selectable129 branch October 18, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-fix changelog fix category for prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants