Skip to content

Commit

Permalink
Introduce VolumeSnapshot APIs (#772)
Browse files Browse the repository at this point in the history
  • Loading branch information
Md. Emruz Hossain authored and tamalsaha committed May 8, 2019
1 parent 2265c79 commit eaa16de
Show file tree
Hide file tree
Showing 13 changed files with 816 additions and 109 deletions.
1 change: 1 addition & 0 deletions api/api-rules/violation_exceptions.list
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
API rule violation: names_match,github.com/appscode/go/encoding/json/types,IntHash,generation
API rule violation: names_match,github.com/appscode/go/encoding/json/types,IntHash,hash
API rule violation: names_match,github.com/appscode/stash/apis/stash/v1beta1,BackupTarget,VolumeSnapshotClassName
API rule violation: names_match,k8s.io/api/core/v1,AzureDiskVolumeSource,DataDiskURI
API rule violation: names_match,k8s.io/api/core/v1,ContainerStatus,LastTerminationState
API rule violation: names_match,k8s.io/api/core/v1,DaemonEndpoint,Port
Expand Down
13 changes: 11 additions & 2 deletions api/crds/v1beta1/backupconfiguration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,11 @@ spec:
type: string
spec:
properties:
driver:
description: Driver indicates the name of the agent to use to backup
the target. Supported values are "Restic", "VolumeSnapshotter". Default
value is "Restic".
type: string
paused:
description: Indicates that the BackupConfiguration is paused from taking
backup. Default value is 'false'
Expand Down Expand Up @@ -1672,6 +1677,12 @@ spec:
type: string
name:
type: string
snapshotClassName:
description: Name of the VolumeSnapshotClass used by the VolumeSnapshot.
If not specified, a default snapshot class will be used if it
is available. Use this field only if the "driver" field is set
to "volumeSnapshotter".
type: string
volumeMounts:
description: VolumeMounts specifies the volumes to mount inside
stash sidecar/init container Specify the volumes that contains
Expand Down Expand Up @@ -1763,8 +1774,6 @@ spec:
This format is intended to make it difficult to use these numbers without writing some sort of special handling code in the hopes that that will cause implementors to also use a fixed point implementation.
type: string
required:
- repository
version: v1beta1
versions:
- name: v1beta1
Expand Down
505 changes: 500 additions & 5 deletions api/crds/v1beta1/restoresession.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion apis/repositories/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apis/stash/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 16 additions & 3 deletions apis/stash/v1beta1/backup_configuration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,21 @@ type BackupConfiguration struct {
}

type BackupConfigurationSpec struct {
Schedule string `json:"schedule,omitempty"`
// Driver indicates the name of the agent to use to backup the target.
// Supported values are "Restic", "VolumeSnapshotter".
// Default value is "Restic".
// +optional
Driver Snapshotter `json:"driver,omitempty"`
// Repository refer to the Repository crd that holds backend information
Repository core.LocalObjectReference `json:"repository"`
Schedule string `json:"schedule,omitempty"`
// +optional
Repository core.LocalObjectReference `json:"repository,omitempty"`
// Task specify the Task crd that specifies the steps to take backup
// +optional
Task TaskRef `json:"task,omitempty"`
// Target specify the backup target
// +optional
Target *Target `json:"target,omitempty"`
Target *BackupTarget `json:"target,omitempty"`
// RetentionPolicy indicates the policy to follow to clean old backup snapshots
RetentionPolicy v1alpha1.RetentionPolicy `json:"retentionPolicy,omitempty"`
// Indicates that the BackupConfiguration is paused from taking backup. Default value is 'false'
Expand Down Expand Up @@ -62,3 +68,10 @@ type BackupConfigurationList struct {
metav1.ListMeta `json:"metadata,omitempty"`
Items []BackupConfiguration `json:"items,omitempty"`
}

type Snapshotter string

const (
ResticSnapshotter Snapshotter = "Restic"
VolumeSnapshotter Snapshotter = "VolumeSnapshotter"
)
191 changes: 132 additions & 59 deletions apis/stash/v1beta1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit eaa16de

Please sign in to comment.