Add flag to disable creation of VSL on install

Fixes #1453

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
This commit is contained in:
Nolan Brubaker
2019-05-09 15:04:42 -04:00
parent 58d34700da
commit e0bc14d56b
5 changed files with 42 additions and 28 deletions
+16 -12
View File
@@ -175,16 +175,17 @@ func appendUnstructured(list *unstructured.UnstructuredList, obj runtime.Object)
}
type VeleroOptions struct {
Namespace string
Image string
ProviderName string
Bucket string
Prefix string
SecretData []byte
RestoreOnly bool
UseRestic bool
BSLConfig map[string]string
VSLConfig map[string]string
Namespace string
Image string
ProviderName string
Bucket string
Prefix string
SecretData []byte
RestoreOnly bool
UseRestic bool
UseVolumeSnapshots bool
BSLConfig map[string]string
VSLConfig map[string]string
}
// AllResources returns a list of all resources necessary to install Velero, in the appropriate order, into a Kubernetes cluster.
@@ -213,8 +214,11 @@ func AllResources(o *VeleroOptions) (*unstructured.UnstructuredList, error) {
bsl := BackupStorageLocation(o.Namespace, o.ProviderName, o.Bucket, o.Prefix, o.BSLConfig)
appendUnstructured(resources, bsl)
vsl := VolumeSnapshotLocation(o.Namespace, o.ProviderName, o.VSLConfig)
appendUnstructured(resources, vsl)
// A snapshot location may not be desirable for users relying on restic
if o.UseVolumeSnapshots {
vsl := VolumeSnapshotLocation(o.Namespace, o.ProviderName, o.VSLConfig)
appendUnstructured(resources, vsl)
}
deploy := Deployment(o.Namespace,
WithImage(o.Image),