fix: add OpenAPIModelName for all types referenced in OpenAPI schemas#476
fix: add OpenAPIModelName for all types referenced in OpenAPI schemas#476jianzhangbjz wants to merge 1 commit intooperator-framework:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #476 +/- ##
==========================================
+ Coverage 37.86% 38.62% +0.75%
==========================================
Files 57 59 +2
Lines 4563 4619 +56
==========================================
+ Hits 1728 1784 +56
Misses 2678 2678
Partials 157 157 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
093bd05 to
ab66946
Compare
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ |
There was a problem hiding this comment.
We do not add license in this project
So I think we should keep all as it is in the other files.
Could you please remove from all? And keep the current standards
There was a problem hiding this comment.
The root Apache license should be sufficient. As pointed out, there's no copyright/licensing in individual files.
camilamacedo86
left a comment
There was a problem hiding this comment.
@pedjak did a PR which I understand that would address this one in the right place : controller-gen, see: kubernetes-sigs/controller-tools#1335
So, can we not wait that lands?
It may take some time for that to land. |
|
After looking it properly I got better the issue Anyway, It does not seems the right way to fix it. So, seems that @tmshort found the right way to address the need: https://redhat-internal.slack.com/archives/C06KP34REFJ/p1771002335868269?thread_ts=1770960532.333679&cid=C06KP34REFJ We need to use the right marker |
|
This uses the manual approach. I chose this method because it works immediately and doesn’t require any tooling changes, especially since it’s currently blocking the Hive operator team. That said, I agree it would increase the maintenance burden in the long run. I’ve closed it in favor of PR #477. |
To address the issue of openshift/operator-framework-olm#1230.
Description of the change:
This PR adds
OpenAPIModelName()methods to all types in theoperator-framework/apipackage that are referenced in OpenAPI schema definitions.When Kubernetes serves OpenAPI schemas, the "/" character in type references gets URL-encoded to "~1". If the schema definition keys use the raw Go import path format
(e.g.,
github.com/operator-framework/api/...) but references are URL-encoded (e.g.,github.com~1operator-framework~1api~1...), lookups fail with errors like:error getting OpenAPISchema: SchemaError(...CSVDescription.apiservicedefinitions):
unknown model in reference: "github.com
1operator-framework1api1pkg1operators~1v1alpha1.APIServiceDefinitions"Adding
OpenAPIModelName()makesopenapi-genuse the canonicalcom.github...format for both definition keys and references, ensuring they match.Motivation for the change:
This is a prerequisite fix for https://issues.redhat.com/browse/OCPBUGS-76460
PR operator-framework/operator-lifecycle-manager#3765 added
OpenAPIModelName()for types defined in the OLM package-server, but operators likeHive still fail because
CSVDescriptionreferences types from this package (operator-framework/api) that don't have the method.Types updated:
pkg/lib/version:OperatorVersionpkg/operators/v1alpha1:APIResourceReference,APIServiceDefinitions,APIServiceDescriptionActionDescriptor,AppLink,CRDDescriptionCleanupSpec,CleanupStatus,ClusterServiceVersionConditionClusterServiceVersionSpec,ClusterServiceVersionStatusCustomResourceDefinitions,DependentStatus,Icon,InstallModeMaintainer,NamedInstallStrategy,RelatedImage,RequirementStatusResourceInstance,ResourceList,SpecDescriptor,StatusDescriptorStrategyDeploymentPermissions,StrategyDeploymentSpecStrategyDetailsDeployment,WebhookDescriptionRelated to operator-framework/operator-lifecycle-manager#3765
Assisted-By: Claude-Code