Skip to content

Conversation

jpbetz
Copy link
Contributor

@jpbetz jpbetz commented Sep 10, 2025

I discovered in k/k that #563 is not fully backward compatible. Before migrating sample-apiserver to use the new model names approach, it's openapi serving was broken.

The problem was once OpenAPIModelName() functions were generated for the core types, sample-apiserver's openapi had a mix of types with OpenAPIModelName() functions (the core types) and without (the sample-apiserver types).

So to be fully compatible, this PR detects OpenAPIModelName() functions and always uses them when available so that projects that import types from core or other projects continue to work even when not using +k8s:openapi-model-package for their own types.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 10, 2025
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 10, 2025
@jpbetz jpbetz force-pushed the backward-compat-model-names branch from 398aeff to ad5ab13 Compare September 10, 2025 16:43
@jpbetz
Copy link
Contributor Author

jpbetz commented Sep 10, 2025

@Jefftree @thockin I missed an edge and need a fast follow.

@Jefftree
Copy link
Member

Looks like the CI failure is legitimate. Do the golden files need to be updated?

@jpbetz
Copy link
Contributor Author

jpbetz commented Sep 10, 2025

Looks like the CI failure is legitimate. Do the golden files need to be updated?

Ah, yes, I added some comments last minute and they show up as description fields.

Fixed.

@jpbetz jpbetz force-pushed the backward-compat-model-names branch from 7088feb to 87d33b5 Compare September 10, 2025 17:29
@jpbetz jpbetz force-pushed the backward-compat-model-names branch from 87d33b5 to 62a9a4e Compare September 10, 2025 17:34
@jpbetz jpbetz force-pushed the backward-compat-model-names branch from 62a9a4e to 2a895cc Compare September 10, 2025 17:45
@Jefftree
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 10, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Jefftree, jpbetz

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

@k8s-ci-robot k8s-ci-robot merged commit 589584f into kubernetes:master Sep 10, 2025
6 checks passed
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

3 participants