Skip to content

Conversation

Danil-Grigorev
Copy link
Member

@Danil-Grigorev Danil-Grigorev commented Apr 20, 2025

Motivation

Fixes issue with using associated methods for serde default in a CELSchema macro.

Fixes #1746

Solution

Provide a suffix to the generated structure to avoid conflicts with outer block struct name, causing implementation overrides.

Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
Copy link
Member

@clux clux left a comment

Choose a reason for hiding this comment

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

This seems sensible to me. Maybe it's worth testing in crd_derive_schema.rs or crd_schema_test?

In either case, this makes sense to me.

@clux clux added the changelog-fix changelog fix category for prs label Apr 20, 2025
Signed-off-by: Danil-Grigorev <danil.grigorev@suse.com>
@clux clux added this to the 0.100.0 milestone Apr 21, 2025
Copy link

codecov bot commented Apr 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.2%. Comparing base (d171d26) to head (340ccf0).
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1747     +/-   ##
=======================================
+ Coverage   76.2%   76.2%   +0.1%     
=======================================
  Files         84      84             
  Lines       7852    7855      +3     
=======================================
+ Hits        5977    5980      +3     
  Misses      1875    1875             
Files with missing lines Coverage Δ
kube-derive/src/cel_schema.rs 93.0% <100.0%> (+0.4%) ⬆️
kube-derive/tests/crd_schema_test.rs 96.9% <100.0%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@clux clux left a comment

Choose a reason for hiding this comment

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

LGTM. Happy to merge if you are happy!

@clux clux merged commit 8c29549 into kube-rs:main Apr 21, 2025
17 checks passed
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.

associated functions are not accessible by serde under CELSchema context
2 participants