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

Allow setting a description on a derived CRD #1359

Merged
merged 3 commits into from
Dec 1, 2023

Conversation

sbernauer
Copy link
Contributor

@sbernauer sbernauer commented Nov 30, 2023

Motivation

While working on a website which shows our CRDs we noticed the sentence Auto-generated derived type for TrinoClusterSpec via CustomResource showing up prominently. We therefore would like to have it configurable.

Solution

Add support for a new kube(description = "xxx") attribute on the struct that is used to generate the CRD.

Fixup

Renamed to kube(doc = "xxx") in #1363 before release.

Signed-off-by: Sebastian Bernauer <sebastian.bernauer@stackable.de>
Signed-off-by: Sebastian Bernauer <sebastian.bernauer@stackable.de>
Copy link

codecov bot commented Nov 30, 2023

Codecov Report

Merging #1359 (a32e7cc) into main (4493297) will decrease coverage by 0.0%.
The diff coverage is 25.0%.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1359     +/-   ##
=======================================
- Coverage   72.1%   72.1%   -0.0%     
=======================================
  Files         75      75             
  Lines       6434    6436      +2     
=======================================
  Hits        4635    4635             
- Misses      1799    1801      +2     
Files Coverage Δ
kube-derive/src/lib.rs 0.0% <ø> (ø)
kube-derive/tests/crd_schema_test.rs 100.0% <100.0%> (ø)
kube-derive/src/custom_resource.rs 13.6% <0.0%> (-0.1%) ⬇️

@clux clux added the changelog-add changelog added category for prs label Nov 30, 2023
@clux clux added this to the 0.88.0 milestone Nov 30, 2023
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! Thanks a lot!

kube-derive/tests/crd_schema_test.rs Show resolved Hide resolved
Signed-off-by: Sebastian Bernauer <sebastian.bernauer@stackable.de>
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.

Thanks a lot!

@clux clux merged commit 289c501 into kube-rs:main Dec 1, 2023
17 checks passed
@nightkr
Copy link
Member

nightkr commented Dec 1, 2023

How about #[kube(doc = "foo")]? That way we're consistent with the built-in #[doc = "foo"] (which /// foo desugars to).

@sbernauer
Copy link
Contributor Author

Works for me. If @clux agrees I can raise a PR to fix it

@clux
Copy link
Member

clux commented Dec 1, 2023

Ah. 🤦 yeah that also sounds better to me.

sbernauer added a commit to sbernauer/kube that referenced this pull request Dec 1, 2023
Follow-up of kube-rs#1359

Signed-off-by: Sebastian Bernauer <sebastian.bernauer@stackable.de>
clux pushed a commit that referenced this pull request Dec 1, 2023
Follow-up of #1359

Signed-off-by: Sebastian Bernauer <sebastian.bernauer@stackable.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-add changelog added category for prs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants