Skip to content

Conversation

@project0
Copy link
Contributor

@project0 project0 commented Dec 3, 2025

The underlying k8s api that converts into the final CRD object is deduplicating versions.

With rehydrating the schemas we fix a problem with possible API incompatibility and the generated specs.

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

2. What is the scope of this PR (e.g. component or file name):

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

the underlying k8s package/method call apiextv1.Convert_v1_CustomResourceDefinition_To_apiextensions_CustomResourceDefinition(crdObj.(*apiextv1.CustomResourceDefinition), crd, nil)
is preventing export of schema versions with same properties.

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

CustomResourceDefinition of apiextensions.k8s.io/v1 now generates multiple files(version) instead of only the first, like all other CRD kinds.

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

@project0 project0 force-pushed the fix/multiple-version-crdext-v1 branch from 1897419 to 3f03522 Compare December 3, 2025 16:36
@Peefy
Copy link
Contributor

Peefy commented Dec 4, 2025

Thanks for the contribution. ♥ Could you help fix the test issue? May make regenerate can generate all test golden files.

The underlying k8s api that converts into the final CRD object is
deduplicating versions.

With rehydrating the schemas we fix a problem with possible API
incompatibility and the generated specs.

Signed-off-by: Richard Hillmann <richard@flowers-software.de>
@project0 project0 force-pushed the fix/multiple-version-crdext-v1 branch from 3f03522 to c161e1f Compare December 4, 2025 08:20
@project0
Copy link
Contributor Author

project0 commented Dec 4, 2025

@Peefy sorry, i thought i committed the tests as well 🙈

@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 19922282211

Details

  • 17 of 22 (77.27%) changed or added relevant lines in 1 file are covered.
  • 6 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.1%) to 66.171%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/kube_resource/generator/generator.go 17 22 77.27%
Files with Coverage Reduction New Missed Lines %
pkg/kube_resource/generator/generator.go 6 53.08%
Totals Coverage Status
Change from base Build 19659873416: 0.1%
Covered Lines: 2312
Relevant Lines: 3494

💛 - Coveralls

@project0
Copy link
Contributor Author

project0 commented Dec 4, 2025

looks like the tests are very flaky:

could not resolve schema: unexpected end of JSON input

@Peefy
Copy link
Contributor

Peefy commented Dec 4, 2025

Yes. I will merge this PR firstly. It's the CI issue.

@Peefy Peefy merged commit 313ffb2 into kcl-lang:main Dec 4, 2025
6 of 10 checks passed
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.

APi versions for CRDs are deduplicated and therefore missing newer versions

3 participants