Skip to content

Commit

Permalink
feat: support PVC based backup repo (#5177)
Browse files Browse the repository at this point in the history
  • Loading branch information
zjx20 authored Sep 21, 2023
1 parent 51c3704 commit 90fad10
Show file tree
Hide file tree
Showing 7 changed files with 375 additions and 62 deletions.
11 changes: 10 additions & 1 deletion apis/storage/v1alpha1/storageprovider_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,19 @@ type StorageProviderSpec struct {
// The template will be rendered with the following variables:
// - Parameters: a map of parameters defined in the ParametersSchema.
// - CSIDriverSecretRef: the reference of the secret created by the CSIDriverSecretTemplate.
// +kubebuilder:validation:Required
// +optional
StorageClassTemplate string `json:"storageClassTemplate,omitempty"`

// A Go template for rendering a PersistentVolumeClaim.
// The template will be rendered with the following variables:
// - Parameters: a map of parameters defined in the ParametersSchema.
// - GeneratedStorageClassName: the name of the storage class generated with the StorageClassTemplate.
// +optional
PersistentVolumeClaimTemplate string `json:"persistentVolumeClaimTemplate,omitempty"`

// The schema describes the parameters required by this StorageProvider,
// when rendering the templates.
// +optional
ParametersSchema *ParametersSchema `json:"parametersSchema,omitempty"`
}

Expand All @@ -52,6 +60,7 @@ type ParametersSchema struct {
// +kubebuilder:validation:Type=object
// +kubebuilder:pruning:PreserveUnknownFields
// +k8s:conversion-gen=false
// +optional
OpenAPIV3Schema *apiextensionsv1.JSONSchemaProps `json:"openAPIV3Schema,omitempty"`

// credentialFields are the fields used to generate the secret.
Expand Down
6 changes: 6 additions & 0 deletions config/crd/bases/storage.kubeblocks.io_storageproviders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ spec:
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
persistentVolumeClaimTemplate:
description: 'A Go template for rendering a PersistentVolumeClaim.
The template will be rendered with the following variables: - Parameters:
a map of parameters defined in the ParametersSchema. - GeneratedStorageClassName:
the name of the storage class generated with the StorageClassTemplate.'
type: string
storageClassTemplate:
description: 'A Go template for rendering a storage class which will
be used by the CSI driver. The template will be rendered with the
Expand Down
Loading

0 comments on commit 90fad10

Please sign in to comment.