-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '1632-generate-stackgres-crds-reference-docs-automatical…
…ly' into 'main' Resolve "Generate StackGres CRDs reference docs automatically" Closes #1632 See merge request ongresinc/stackgres!1424
- Loading branch information
Showing
51 changed files
with
1,482 additions
and
2,843 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
{{- range .Groups }} | ||
{{- $group := . }} | ||
{{- range .Kinds}} | ||
{{- $kind := .}} | ||
{{- $levelTypes := dict }} | ||
{{- $hiddenTypes := dict }} | ||
{{- $onlyOnCreationTypes := dict }} | ||
{{- $requireRestartTypes := dict }} | ||
{{- range .Types}} | ||
{{- $key := regexReplaceAll "\\[index\\]" .Name "" }} | ||
{{- range .Fields -}} | ||
{{- $description := .Description }} | ||
{{- $fieldKey := (print $key "." .Name) }} | ||
{{- if (and $key (get $levelTypes $key)) }} | ||
{{- $levelTypes = merge $levelTypes (dict $fieldKey (add (get $levelTypes $key) 1)) }} | ||
{{- else }} | ||
{{- $levelTypes = merge $levelTypes (dict $fieldKey 2) }} | ||
{{- end }} | ||
{{- if or ($description | regexMatch "See: http[^ ]+$") (and $key (get $hiddenTypes $key)) }} | ||
{{- $hiddenTypes = merge $hiddenTypes (dict $fieldKey true) }} | ||
{{- end }} | ||
{{- if or ($description | regexMatch "\\*\\*This field can only be set on creation\\.\\*\\*") (and $key (get $onlyOnCreationTypes $key)) }} | ||
{{- $onlyOnCreationTypes = merge $onlyOnCreationTypes (dict $fieldKey true) }} | ||
{{- end }} | ||
{{- if or ($description | regexMatch "\\*\\*Changing this field may require a restart\\.\\*\\*") (and $key (get $requireRestartTypes $key)) }} | ||
{{- $requireRestartTypes = merge $requireRestartTypes (dict $fieldKey true) }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} | ||
{{- range .Types}} | ||
{{- $key := regexReplaceAll "\\[index\\]" .Name "" }} | ||
{{- if not (get $hiddenTypes $key) }} | ||
{{- if not .IsTopLevel}} | ||
|
||
{{range $i, $e := until (min 5 (get $levelTypes $key) | int)}}#{{end}} {{.Name}} | ||
{{ if .ParentKey}}<sup><sup>[↩ Parent](#{{.ParentKey}})</sup></sup>{{end}} | ||
{{- end}} | ||
|
||
{{.Description}} | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th><div style="width:12rem">Property</div></th> | ||
<th><div style="width:5rem">Required</div></th> | ||
<th><div style="width:5rem">Updatable</div></th> | ||
<th><div style="width:5rem">May Require Restart</div></th> | ||
<th><div style="width:5rem">Type</div></th> | ||
<th>Description</th> | ||
</tr> | ||
</thead> | ||
<tbody><tr style="display:none;"> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td> | ||
|
||
Workaround for hugo bug not rendering first table row | ||
<br/> | ||
</td> | ||
</tr> | ||
{{- if .IsTopLevel -}} | ||
<tr> | ||
<td><b>apiVersion</b></td> | ||
<td>✓</td> | ||
<td></td> | ||
<td></td> | ||
<td>string</td> | ||
<td>{{$group.Group}}/{{$group.Version}}</td> | ||
</tr> | ||
<tr> | ||
<td><b>kind</b></td> | ||
<td>✓</td> | ||
<td></td> | ||
<td></td> | ||
<td>string</td> | ||
<td>{{$kind.Name}}</td> | ||
</tr> | ||
<tr> | ||
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#objectmeta-v1-meta">metadata</a></b></td> | ||
<td>✓</td> | ||
<td>✓</td> | ||
<td></td> | ||
<td>object</td> | ||
<td>Refer to the Kubernetes API documentation for the fields of the `metadata` field.</td> | ||
</tr> | ||
{{- end -}} | ||
{{- range .Fields -}} | ||
{{- $fieldKey := (print $key "." .Name) }} | ||
<tr> | ||
<td><b>{{if and .TypeKey (not (get $hiddenTypes $fieldKey))}}<a href="#{{.TypeKey}}">{{.Name}}</a>{{else}}{{.Name}}{{end}}</b></td> | ||
<td>{{if .Required}}✓{{end}}</td> | ||
<td>{{if not (get $onlyOnCreationTypes $fieldKey)}}✓{{end}}</td> | ||
<td>{{if get $requireRestartTypes $fieldKey}}✓{{end}}</td> | ||
<td>{{.Type}}</td> | ||
<td> | ||
{{.Description}}<br/> | ||
{{- if or .Schema.XValidations .Schema.Format .Schema.Enum .Schema.Default .Schema.Minimum .Schema.Maximum }} | ||
<br/> | ||
{{- end}} | ||
{{- if .Schema.XValidations }} | ||
<i>Validations</i>: | ||
{{- range .Schema.XValidations -}} | ||
<li>{{ .Rule }}: {{ .Message }}</li> | ||
{{- end -}} | ||
{{- end }} | ||
{{- if .Schema.Format }} | ||
<i>Format</i>: {{ .Schema.Format }}<br/> | ||
{{- end }} | ||
{{- if .Schema.Enum }} | ||
<i>Enum</i>: {{ .Schema.Enum | toStrings | join ", " }}<br/> | ||
{{- end }} | ||
{{- if .Schema.Minimum }} | ||
<i>Minimum</i>: {{ .Schema.Minimum }}<br/> | ||
{{- end }} | ||
{{- if .Schema.Maximum }} | ||
<i>Maximum</i>: {{ .Schema.Maximum }}<br/> | ||
{{- end }} | ||
{{- if .Schema.Default }} | ||
<i>Default</i>: {{ .Schema.Default }}<br/> | ||
{{- end }} | ||
</td> | ||
</tr> | ||
{{- end -}} | ||
</tbody> | ||
</table> | ||
|
||
{{- end}}{{/* hidden type check */}} | ||
{{- end}}{{/* range .Types */}} | ||
{{- end}}{{/* range .Kinds */}} | ||
{{- end}}{{/* range .Groups */}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.