Skip to content

Conversation

@xrstf
Copy link
Contributor

@xrstf xrstf commented Mar 11, 2025

Summary

When refactoring the CRD discovery to use OpenAPI schemas, I decided Kraft meiner Wassersuppe (viel Spaß beim Googlen) that we do not need the CRD-based discovery anymore, because why have 2 mechanisms that both result in a CRD?

Well, CRDs contain more useful data than the OpenAPI schema. This begins with the custom path expression on subresources (like the scale subresource) and ends at additional printer columns. Also, loads of other validation rules would get lost when relying only on the OpenAPI schema:

2025-03-11_10-46-25

To fix this, I aligned the code more with kcp, which already has a "prefer CRD, fallback to OpenAPI" mentality. Our code here is still a bit but noticeably different from kcp because we do not export the storage version necessarily, but whatever version is defined in the PublishedResource. That means when we find a CRD, we also drop all other versions from it, including conversion rules, which kcp would not do.

Related issue(s)

Fixes #38

Release Notes

Fix CRD discovery: prefer CRDs over OpenAPI schema to include more useful data in kcp.

@kcp-ci-bot kcp-ci-bot added dco-signoff: yes Indicates the PR's author has signed the DCO. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 11, 2025
Copy link
Member

@embik embik left a comment

Choose a reason for hiding this comment

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

/approve

@kcp-ci-bot kcp-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 11, 2025
@kcp-ci-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: b742176c7938124801851f2c871abbd3ea0df148

@kcp-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: embik

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kcp-ci-bot kcp-ci-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 11, 2025
@kcp-ci-bot kcp-ci-bot merged commit 5c1c7e3 into main Mar 11, 2025
12 checks passed
@kcp-ci-bot kcp-ci-bot deleted the fix-discovery branch March 11, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Regression in syncing

3 participants