diff --git a/.github/workflows/k8s_apis_sync.yaml b/.github/workflows/k8s_apis_sync.yaml new file mode 100644 index 000000000..527c75ff4 --- /dev/null +++ b/.github/workflows/k8s_apis_sync.yaml @@ -0,0 +1,86 @@ +name: k8s_apis_sync + +on: + workflow_dispatch: + inputs: + release: + type: string + required: true + description: '' + +jobs: + k8s_apis_sync: + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@v3 + + - name: 'Install crdoc' + run: |- + curl -LO https://github.com/fybrik/crdoc/releases/download/v0.6.3/crdoc_Linux_x86_64.tar.gz + tar -xvzf crdoc_Linux_x86_64.tar.gz + sudo mv crdoc /bin/crdoc + + - name: 'Fetch release' + run: |- + RELEASE="${{ github.event.inputs.release }}" + aws s3 cp s3://redislabs-k8s/${RELEASE}/ --no-sign-request . --recursive --region us-east-1 + + tar xf redis-enterprise-operator-*.tar.gz + + - name: 'Generate READMEs' + run: |- + mkdir artifacts + mkdir templates + cp content/operate/kubernetes/reference/kubernetes-api-reference-template.tmpl templates/template.tmpl + + crdoc --resources crds/reaadb_crd.yaml --output artifacts/redis_enterprise_active_active_database_api.md --template templates/template.tmpl + sed -E -i 's/^### RedisEnterpriseActiveActiveDatabase\./### /g' artifacts/redis_enterprise_active_active_database_api.md + sed -E -i 's/^\[↩ Parent\]\(#redisenterpriseactiveactivedatabase/\[↩ Parent\]\(#/g' artifacts/redis_enterprise_active_active_database_api.md + sed -E -i 's/\[↩ Parent\]\(#redisenterprisecluster/\[↩ Parent\]\(#/g' artifacts/redis_enterprise_cluster_api.md + sed -E -i 's/\[↩ Parent\]\(#redisenterprisedatabase/\[↩ Parent\]\(#/g' artifacts/redis_enterprise_database_api.md + sed -E -i 's/\[↩ Parent\]\(#redisenterpriseremotecluster/\[↩ Parent\]\(#/g' artifacts/redis_enterprise_remote_cluster.md + sed -E -i 's/[↩ Parent](#{{.ParentKey}}){{end}} +{{end}} +{{.Description}} + + + + + + + + + + + + {{- if .IsTopLevel -}} + + + + + + + + + + + + + + + + + + + {{- end -}} + {{- range .Fields -}} + + + + + + + {{- end -}} + +
NameTypeDescriptionRequired
apiVersionstring{{$group.Group}}/{{$group.Version}}true
kindstring{{$kind.Name}}true
metadataobjectRefer to the Kubernetes API documentation for the fields of the `metadata` field.true
{{if .TypeKey}}{{.Name}}{{else}}{{.Name}}{{end}}{{.Type}} + {{.Description}}
+ {{- if or .Schema.XValidations .Schema.Format .Schema.Enum .Schema.Default .Schema.Minimum .Schema.Maximum }} +
+ {{- end}} + {{- if .Schema.XValidations }} + Validations: + {{- range .Schema.XValidations -}} +
  • {{ .Rule }}: {{ .Message }}
  • + {{- end -}} + {{- end }} + {{- if .Schema.Format }} + Format: {{ .Schema.Format }}
    + {{- end }} + {{- if .Schema.Enum }} + Enum: {{ .Schema.Enum | toStrings | join ", " }}
    + {{- end }} + {{- if .Schema.Default }} + Default: {{ .Schema.Default }}
    + {{- end }} + {{- if .Schema.Minimum }} + Minimum: {{ .Schema.Minimum }}
    + {{- end }} + {{- if .Schema.Maximum }} + Maximum: {{ .Schema.Maximum }}
    + {{- end }} +
    {{.Required}}
    + +{{- end}}{{/* range .Types */}} +{{- end}}{{/* range .Kinds */}}