diff --git a/Taskfile.yml b/Taskfile.yml index 8469ad3..ff36d39 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -58,6 +58,7 @@ tasks: desc: Check for uncommitted changes deps: - manifest-main + - apidoc env: # renovate: datasource=git-refs depName=uncommitted lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main DAGGER_UNCOMMITTED_SHA: db65290569cb7723a32e72fcfb134668e7b998c8 @@ -68,17 +69,26 @@ tasks: apidoc: desc: Update the API Reference section of the documentation + deps: + - controller-gen env: - # renovate: datasource=git-refs depName=genref lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main - DAGGER_APIDOC_SHA: db65290569cb7723a32e72fcfb134668e7b998c8 + # renovate: datasource=git-refs depName=crd-gen-refs lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main + DAGGER_CRDGENREF_SHA: ba865842d907910c469d016c3ecfa009e4c66915 cmds: - - GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/genref@${DAGGER_APIDOC_SHA} genref --source . - --args "-c=config.yaml" --args "-o=src" --args "-include=plugin-barman-cloud" - file --path src/plugin-barman-cloud.v1.md + - > + GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/crd-ref-docs@${DAGGER_CRDGENREF_SHA} generate + --src . + --source-path api/v1 + --config-file docs/config.yaml + --renderer markdown + --templates-dir docs/markdown + file --path out.md export --path docs/src/plugin-barman-cloud.v1.md sources: - ./api/**/*.go - ./docs/config.yaml + - ./docs/markdown/**/*.tpl + - ./Taskfile.yml generates: - ./docs/src/plugin-barman-cloud.v1.md @@ -338,6 +348,7 @@ tasks: controller-gen: desc: Run controller-gen + run: once env: # renovate: datasource=git-refs depName=controller-gen lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main DAGGER_CONTROLLER_GEN_SHA: db65290569cb7723a32e72fcfb134668e7b998c8 diff --git a/api/v1/groupversion_info.go b/api/v1/groupversion_info.go index 8807c5a..228b87e 100644 --- a/api/v1/groupversion_info.go +++ b/api/v1/groupversion_info.go @@ -14,9 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// Package v1 contains API Schema definitions for the barmancloud v1 API group -// +kubebuilder:object:generate=true -// +groupName=barmancloud.cnpg.io package v1 import ( diff --git a/docs/config.yaml b/docs/config.yaml index 4195d1a..146bfcc 100644 --- a/docs/config.yaml +++ b/docs/config.yaml @@ -1,24 +1,20 @@ -hiddenMemberFields: - - "TypeMeta" +processor: + ignoreGroupVersions: + - "GVK" + customMarkers: + - name: "optional" + target: field + ignoreFields: +# - "status$" + - "TypeMeta$" + ignoreTypes: + - "ObjectStoreList$" -externalPackages: - - match: ^k8s\.io/(api|apimachinery/pkg/apis)/ - target: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#{{- lower .TypeIdentifier -}}-{{- arrIndex .PackageSegments -1 -}}-{{- arrIndex .PackageSegments -2 -}} - - match: ^github\.com/cloudnative-pg/barman-cloud - target: https://pkg.go.dev/github.com/cloudnative-pg/barman-cloud/pkg/api/#{{- .TypeIdentifier }} - -hideTypePatterns: - - "ParseError$" - - "\\.ObjectStoreList$" - -markdownDisabled: false - -stripPrefix: - - k8s.io/api/ - - k8s.io/apimachinery/pkg/apis/ - -apis: - - name: plugin-barman-cloud - title: API Reference - package: github.com/cloudnative-pg/plugin-barman-cloud - path: api/v1 +render: + # Version of Kubernetes to use when generating links to Kubernetes API documentation. + # renovate: datasource=git-refs depName=kubernetes/kubernetes lookupName=https://github.com/kubernetes/kubernetes + kubernetesVersion: 1.31 + knownTypes: + - name: BarmanObjectStoreConfiguration + package: github.com/cloudnative-pg/barman-cloud/pkg/api + link: https://pkg.go.dev/github.com/cloudnative-pg/barman-cloud/pkg/api#BarmanObjectStoreConfiguration diff --git a/docs/markdown/gv_details.tpl b/docs/markdown/gv_details.tpl new file mode 100644 index 0000000..30ad0d7 --- /dev/null +++ b/docs/markdown/gv_details.tpl @@ -0,0 +1,19 @@ +{{- define "gvDetails" -}} +{{- $gv := . -}} + +## {{ $gv.GroupVersionString }} + +{{ $gv.Doc }} + +{{- if $gv.Kinds }} +### Resource Types +{{- range $gv.SortedKinds }} +- {{ $gv.TypeForKind . | markdownRenderTypeLink }} +{{- end }} +{{ end }} + +{{ range $gv.SortedTypes }} +{{ template "type" . }} +{{ end }} + +{{- end -}} diff --git a/docs/markdown/gv_list.tpl b/docs/markdown/gv_list.tpl new file mode 100644 index 0000000..a4d3dad --- /dev/null +++ b/docs/markdown/gv_list.tpl @@ -0,0 +1,15 @@ +{{- define "gvList" -}} +{{- $groupVersions := . -}} + +# API Reference + +## Packages +{{- range $groupVersions }} +- {{ markdownRenderGVLink . }} +{{- end }} + +{{ range $groupVersions }} +{{ template "gvDetails" . }} +{{ end }} + +{{- end -}} diff --git a/docs/markdown/members.tpl b/docs/markdown/members.tpl deleted file mode 100644 index d3bacd1..0000000 --- a/docs/markdown/members.tpl +++ /dev/null @@ -1,34 +0,0 @@ -{{ define "members" }} - {{- /* . is a apiType */ -}} - {{- range .GetMembers -}} - {{- /* . is a apiMember */ -}} - {{- if not .Hidden }} -
{{ .FieldName }}
- {{- if and (not .IsOptional) (not .IsInline) }} [Required]{{- end -}}
-{{ .FieldName }} are embedded into this type.)
- {{- end }}
- {{ if .GetComment -}}
- {{ .GetComment }}
- {{- else -}}
- No description provided.
- {{- end }}
- {{- if and (eq (.GetType.Name.Name) "ObjectMeta") -}}
-Refer to the Kubernetes API documentation for the fields of the metadata field.
- {{- end -}}
-| Field | Description |
|---|---|
apiVersion [Required]string | {{- .APIGroup -}} |
kind [Required]string | {{- .Name.Name -}} |
Package v1 contains API Schema definitions for the barmancloud v1 API group
+## Packages +- [barmancloud.cnpg.io/v1](#barmancloudcnpgiov1) -## Resource Types +## barmancloud.cnpg.io/v1 +Package v1 contains API Schema definitions for the barmancloud v1 API group -- [ObjectStore](#barmancloud-cnpg-io-v1-ObjectStore) - -## ObjectStore {#barmancloud-cnpg-io-v1-ObjectStore} +### Resource Types +- [ObjectStore](#objectstore) -ObjectStore is the Schema for the objectstores API.
+#### InstanceSidecarConfiguration -| Field | Description |
|---|---|
apiVersion [Required]string | barmancloud.cnpg.io/v1 |
kind [Required]string | ObjectStore |
metadata [Required]-meta/v1.ObjectMeta - |
-
- No description provided.Refer to the Kubernetes API documentation for the fields of the metadata field. |
-
spec [Required]-ObjectStoreSpec - |
-
- Specification of the desired behavior of the ObjectStore. -More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - |
-
status-ObjectStoreStatus - |
-
- Most recently observed status of the ObjectStore. This data may not be up to -date. Populated by the system. Read-only. -More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - |
-
InstanceSidecarConfiguration defines the configuration for the sidecar that runs in the instance pods.
+#### ObjectStore -| Field | Description |
|---|---|
env-[]core/v1.EnvVar - |
-
- The environment to be explicitly passed to the sidecar - |
-
retentionPolicyIntervalSeconds-int - |
-
- The retentionCheckInterval defines the frequency at which the -system checks and enforces retention policies. - |
-
ObjectStoreSpec defines the desired state of ObjectStore.
+ +| Field | Description | Required | Default | Validation | +| --- | --- | --- | --- | --- | +| `apiVersion` _string_ | `barmancloud.cnpg.io/v1` | True | | | +| `kind` _string_ | `ObjectStore` | True | | | +| `metadata` _[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#objectmeta-v1-meta)_ | Refer to Kubernetes API documentation for fields of `metadata`. | True | | | +| `spec` _[ObjectStoreSpec](#objectstorespec)_ | Specification of the desired behavior of the ObjectStore.| Field | Description |
|---|---|
configuration [Required]-github.com/cloudnative-pg/barman-cloud/pkg/api.BarmanObjectStoreConfiguration - |
-
- The configuration for the barman-cloud tool suite - |
-
retentionPolicy-string - |
-
- RetentionPolicy is the retention policy to be used for backups
-and WALs (i.e. '60d'). The retention policy is expressed in the form
-of |
-
instanceSidecarConfiguration-InstanceSidecarConfiguration - |
-
- The configuration for the sidecar that runs in the instance pods - |
-
ObjectStoreStatus defines the observed state of ObjectStore.
+ +_Appears in:_ +- [ObjectStore](#objectstore) + +| Field | Description | Required | Default | Validation | +| --- | --- | --- | --- | --- | +| `configuration` _[BarmanObjectStoreConfiguration](https://pkg.go.dev/github.com/cloudnative-pg/barman-cloud/pkg/api#BarmanObjectStoreConfiguration)_ | The configuration for the barman-cloud tool suite | True | | | +| `retentionPolicy` _string_ | RetentionPolicy is the retention policy to be used for backups| Field | Description |
|---|---|
serverRecoveryWindow [Required]-map[string]RecoveryWindow - |
-
- ServerRecoveryWindow maps each server to its recovery window - |
-
RecoveryWindow represents the time span between the first + +_Appears in:_ +- [ObjectStore](#objectstore) + +| Field | Description | Required | Default | Validation | +| --- | --- | --- | --- | --- | +| `serverRecoveryWindow` _object (keys:string, values:[RecoveryWindow](#recoverywindow))_ | ServerRecoveryWindow maps each server to its recovery window | True | | | + + +#### RecoveryWindow + + + +RecoveryWindow represents the time span between the first recoverability point and the last successful backup of a PostgreSQL -server, defining the period during which data can be restored.
+server, defining the period during which data can be restored. + + + +_Appears in:_ +- [ObjectStoreStatus](#objectstorestatus) + +| Field | Description | Required | Default | Validation | +| --- | --- | --- | --- | --- | +| `firstRecoverabilityPoint` _[Time](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#time-v1-meta)_ | The first recoverability point in a PostgreSQL server refers to| Field | Description |
|---|---|
firstRecoverabilityPoint [Required]-meta/v1.Time - |
-
- The first recoverability point in a PostgreSQL server refers to -the earliest point in time to which the database can be -restored. - |
-
lastSuccussfulBackupTime [Required]-meta/v1.Time - |
-
- The last successful backup time - |
-