Skip to content

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

Merged
clux merged 1 commit into
mainfrom
compile-error-selectable129
Oct 18, 2024
Merged

Add a compile_error if setting selectable fields on K8s < 1.30#1612
clux merged 1 commit into
mainfrom
compile-error-selectable129

Conversation

@clux
Copy link
Copy Markdown
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
@clux clux requested a review from Danil-Grigorev October 18, 2024 10:39
Copy link
Copy Markdown
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

@codecov
Copy link
Copy Markdown

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
@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