Skip to content

Add CRD API Documentation #506

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

Merged
merged 3 commits into from
Apr 18, 2022
Merged

Add CRD API Documentation #506

merged 3 commits into from
Apr 18, 2022

Conversation

ihcsim
Copy link
Contributor

@ihcsim ihcsim commented Mar 22, 2022

This PR adds the CRD API documentation to the doc site. It introduces a new script named hack/gen-api.sh that uses the gen-crd-api-reference-docs tool to parse the CRD Go types found in the external-snapshotter repository, and writes the generated documentation to the book/src/api.md file.

Fix kubernetes-csi/external-snapshotter#102.

Test output:

image

The hack/gen-api.sh script can be used to generate the documentation.
The configuration used by the tool is found in the hack/gen-api.json
file.

Signed-off-by: Ivan Sim <[email protected]>
@k8s-ci-robot k8s-ci-robot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 22, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @ihcsim!

It looks like this is your first PR to kubernetes-csi/docs 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-csi/docs has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Mar 22, 2022
@xing-yang
Copy link
Contributor

/assign

@xing-yang
Copy link
Contributor

/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Apr 13, 2022
@xing-yang
Copy link
Contributor

/assign @jingxu97

@ihcsim
Copy link
Contributor Author

ihcsim commented Apr 14, 2022

@xing-yang I added a new section called "API Reference", with "Volume Snapshot" as its subsection. This should allow us to extend the list in the future to include other CRDs/APIs. All the .md files are also moved to the src/api folder. Let me know if this matches what you have in mind.

image

Exactly one of its members must be set.
Members in VolumeSnapshotContentSource are immutable.
TODO(xiangqian): Add a webhook to ensure that VolumeSnapshotContentSource members
will be immutable once specified.</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you submit a PR in external-snapshotter to get rid of this TODO message? It is no longer needed.
https://github.com/kubernetes-csi/external-snapshotter/blob/master/client/apis/volumesnapshot/v1/types.go#L344-L345

After that, re-run the script to generate the doc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xing-yang I have re-generated the doc to include the changes in kubernetes-csi/external-snapshotter@b20011c. PTAL.

@xing-yang
Copy link
Contributor

/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 Apr 18, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ihcsim, xing-yang

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 18, 2022
@k8s-ci-robot k8s-ci-robot merged commit b2c9427 into kubernetes-csi:master Apr 18, 2022
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. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generating CRD API docs
4 participants