-
Notifications
You must be signed in to change notification settings - Fork 68
📖 WIP: OPRUN-4357: Add documentation URLs into CRD descriptions #2377
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2377 +/- ##
==========================================
+ Coverage 71.10% 74.51% +3.40%
==========================================
Files 95 96 +1
Lines 7323 7357 +34
==========================================
+ Hits 5207 5482 +275
+ Misses 1683 1442 -241
Partials 433 433
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
[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.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
These documentation URLs are templated, so that they can be updated downstream as needed. Added **quick-helm** utility to go template a file using helm-like semantics (i.e. everything is prefixed with `.Values`) This is used to update the docs/api-reference/olmv1-api-reference.md file, otherwise, Go templates are left in the file. Signed-off-by: Todd Short <[email protected]>
|
This looks really good! I don't know if we want to add the links to the docs of each of the CRDs. But, this would work perfectly for the .spec.config case. |
How hard would it be to add this logic into crd-ref-doc instead, in order to keep the number of utilities low? |
|
Perhaps we could rely on existing Godoc links? |
|
CRDs are based on OpenAPI 3.0 which has |
This PR is less about the format/content of the actual links, but on the ability to substitute different links for upstream and downstream. That is the part that really needs review. The text of the CRD is of secondary importance to the method. If we want to take that approach for the content, I'm fine with it. (Also, not sure how to get that field into the CRD from the golang definitions?) |
I don't think that will work, as the intent is to reference Openshift documentation (i.e. on redhat.com) downstream, not repository documentation. |
We don't own crd-ref-doc, and I'm not sure they'll want to support Helm-style templating within the documents themselves (although they do use go templating for generation). There doesn't seem to be much activity in that repo; the last merge activity was Sept 2025, and even the automated bot PRs have been sitting around for 3 weeks. AFAIK, there's some urgency here, and I don't think we can wait on that. I was going to try to use |
I swear I read something about |
|
We could extend controller-gen with additional markers like: or do some postprocessing of the generated CRD and extract links in Godoc link format and add needed |
In that case, why not do some quick solution downstream? |
|
@pedjak the ask is that we carry some documentation link around configuration specifically looking at how to determine the bundle configuration given that we don't yet have a way to get the bundle configuration schema out of the bundle. I think this makes sense for now even in the upstream, tbh. In which case we'd need a way to replace it downstream. We could also just do it downstream through some sed magic, but my worry there is that it will get forgotten. I think its better to have a single thread of maintenance for this particular thing. It's quite possible that in the future we remove it once we can better inspect the bundle configuration schema. Thinking about it a bit more as I write, let me come up with the actual documentation that would meet the bar and see if we can just insert it in the CRD directly and avoid this whole url thing all together. /hold on the basis described above |
In this case, we need something upstream that gives us the ability to customize the value both upstream and downstream. TL;DR: Downstream, we really can't modify anything outside the openshift directory. Meaning we can't modify the source of the CRDs downstream. But we can add configurables upstream that we then use downstream. A quick fix downstream would be to do some sort of The downstream manifests are deployed via helm template by cluster-olm-operator. So, whatever we do has to be helm compatible, or has to be done when the helm chart is copied to the containers. |
That's what I meant. I updated my comment. |
These documentation URLs are templated, so that they can be updated
downstream as needed.
Added quick-helm utility to go template a file using helm-like
semantics (i.e. everything is prefixed with
.Values), because the crd-ref-doc utility does not have a mechanism to template.Description
Reviewer Checklist