1
0
mirror of https://github.com/minio/docs.git synced 2025-08-06 14:42:56 +03:00

DOCS-1007: Create sync pattern to pull in the CRD during releases (#1025)

Closes #1007
This commit is contained in:
Ravind Kumar
2023-10-10 16:45:06 -04:00
committed by GitHub
parent d96f3ee959
commit 69e291fa6e
8 changed files with 1691 additions and 1 deletions

View File

@@ -236,6 +236,9 @@ sync-minio-version:
sync-sdks:
@(./sync-docs.sh)
sync-operator-crd:
@(./sync-minio-operator-crd.sh)
# Can probably safely remove this at some point
sync-deps:
# C++ and Rust repos do not have any releases yet.

View File

@@ -9,7 +9,7 @@ MinIO uses [Sphinx](https://www.sphinx-doc.org/en/master/index.html) to generate
- Any GNU/Linux Operating System, or macOS 12.3 or later.
- python 3.10.x and python-pip
- python3.10-venv
- sphinx 4.3.2
- sphinx 6.2.1
- nodejs 14.5.0 or later
- npm 16.19.1 or later
- `git` or a git-compatible client
@@ -69,6 +69,27 @@ Does the following:
1. Check that the `build/GITDIR/linux` folder exists
2. Copies the contents of `build/GITDIR/linux/html/*` to `docs-staging/staging/GITDIR/linux`
# Syncing Operator CRD Docs
For importing the Operator CRD Docs specifically, you must have:
- pandoc (latest stable)
- asciidoc (latest stable)
In addition to all other prerequisites.
Run
```
make sync-operator-crd
```
This downloads and converts the `tenant-crd.adoc` from the MinIO Operator github repository.
It converts it to XML, then to markdown.
Finally, it does some `sed` find/replace to tidy up the file for Sphinx ingest.
You can run this when we have a new Operator release being documented, assuming there are changes to the CRD as part of that release.
# License
This project is licensed under a [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/legalcode). See [CONTRIBUTING.md](https://github.com/minio/docs/tree/master/CONTRIBUTING.md) guide for more information on contributing to the MinIO Documentation project.

View File

@@ -371,3 +371,13 @@ figcaption {
font-weight: bold;
}
}
// ---------------------------------------
// Fixing table issues from asciidoc -> md
// ---------------------------------------
table thead tr.header {
background-color: lightgray;
box-shadow: none;
}

File diff suppressed because it is too large Load Diff

View File

@@ -209,6 +209,7 @@ Any file uploaded to ``play`` should be considered public and non-protected.
MinIO Admin Client <https://min.io/docs/minio/linux/reference/minio-mc-admin.html?ref=docs>
Integrations <https://min.io/docs/minio/linux/integrations/integrations.html?ref=docs>
/reference/kubectl-minio-plugin
/reference/operator-crd
.. toctree::
:titlesonly:

View File

@@ -0,0 +1,21 @@
.. _minio-operator-crd:
================================
MinIO Custom Resource Definition
================================
.. default-domain:: minio
.. contents:: Table of Contents
:local:
:depth: 2
The MinIO Operator installs a :kube-docs:`Custom Resource Definition (CRD) <concepts/extend-kubernetes/api-extension/custom-resources>` that describes a MinIO Tenant object.
The Operator uses this CRD for provisioning and managing Tenant resources within a Kubernetes cluster.
This page documents the CRD reference for use in customizing Operator-deployed Tenants.
This documentation assumes familiarity with all referenced Kubernetes concepts, utilities, and procedures.
.. include:: /includes/k8s/ext-tenant-crd.md
:parser: myst_parser.sphinx_

View File

@@ -23,6 +23,7 @@ excludes:
- 'reference/kubectl-minio-plugin/kubectl-minio-tenant-upgrade.rst'
- 'reference/kubectl-minio-plugin/kubectl-minio-tenant.rst'
- 'reference/kubectl-minio-plugin/kubectl-minio-version.rst'
- 'reference/operator-crd.rst'
---
tag: macos
excludes:
@@ -39,6 +40,7 @@ excludes:
- 'reference/minio-server*'
- 'reference/minio-mc*'
- 'reference/deprecated/*'
- 'reference/operator-crd.rst'
- 'developers/*'
- 'integrations/*'
---
@@ -67,6 +69,7 @@ excludes:
- 'reference/minio-server*'
- 'reference/minio-mc*'
- 'reference/deprecated/*'
- 'reference/operator-crd.rst'
- 'developers/*'
- 'integrations/*'
---
@@ -89,6 +92,7 @@ excludes:
- 'reference/minio-server*'
- 'reference/minio-mc*'
- 'reference/deprecated/*'
- 'reference/operator-crd.rst'
- 'developers/*'
- 'integrations/*'
---

27
sync-minio-operator-crd.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
set -e
function main() {
OPERATOR=$(curl --retry 10 -Ls -o /dev/null -w "%{url_effective}" https://github.com/minio/operator/releases/latest | sed "s/https:\/\/github.com\/minio\/operator\/releases\/tag\///" | sed "s/v//");
curl --retry 10 -Ls https://raw.githubusercontent.com/minio/operator/v${OPERATOR}/docs/tenant_crd.adoc | asciidoc -b docbook - | pandoc -f docbook -t markdown_strict - -o source/includes/k8s/ext-tenant-crd.md
# To make the include nicer, this strips out the top H1 and reorders all headers thereafter
KNAME=$(uname -s)
case "${KNAME}" in
"Darwin")
sed -i '' 's%# API Reference%%g' source/includes/k8s/ext-tenant-crd.md
sed -i '' 's%minio.min.io/v2%Operator CRD v2 Reference%g' source/includes/k8s/ext-tenant-crd.md
sed -i '' 's%k8s-api-github-com-minio-operator-pkg-apis-minio-min-io-v2-%%g' source/includes/k8s/ext-tenant-crd.md
sed -i '' 's%# % %g' source/includes/k8s/ext-tenant-crd.md;;
*)
sed -i 's%# API Reference%%g' source/includes/k8s/ext-tenant-crd.md
sed -i 's%minio.min.io/v2%Operator CRD v2 Reference%g' source/includes/k8s/ext-tenant-crd.md
sed -i 's%k8s-api-github-com-minio-operator-pkg-apis-minio-min-io-v2-%%g' source/includes/k8s/ext-tenant-crd.md
sed -i 's%# % %g' source/includes/k8s/ext-tenant-crd.md;;
esac
}
main