Skip to content
Snippets Groups Projects
Commit 8d17b163 authored by Vineet Reddy Rajula's avatar Vineet Reddy Rajula
Browse files

Merge branch 'schedule-backup-loc' into 'master'

Add backup storage location to velero schedule

See merge request !189
parents 0e6843ba 6504fb44
Branches 88-set-lifecycle-for-test-sites
No related tags found
1 merge request!189Add backup storage location to velero schedule
Pipeline #5766150 passed
...@@ -33,6 +33,7 @@ spec: ...@@ -33,6 +33,7 @@ spec:
- --cluster-name={{.Values.drupalsiteOperator.clusterName}} - --cluster-name={{.Values.drupalsiteOperator.clusterName}}
- --easystart-backup-name={{.Values.drupalsiteOperator.easystartBackupName}} - --easystart-backup-name={{.Values.drupalsiteOperator.easystartBackupName}}
- --supported-drupal-version-name={{.Values.drupalsiteOperator.supportedDrupalVersionName}} - --supported-drupal-version-name={{.Values.drupalsiteOperator.supportedDrupalVersionName}}
- --velero-backup-storage-location={{.Values.drupalsiteOperator.veleroBackupStorageLocation}}
command: command:
- /manager - /manager
image: {{ .Values.image | quote }} image: {{ .Values.image | quote }}
......
...@@ -30,3 +30,4 @@ drupalsiteOperator: ...@@ -30,3 +30,4 @@ drupalsiteOperator:
enableTopologySpread: false enableTopologySpread: false
clusterName: {} clusterName: {}
easystartBackupName: "" easystartBackupName: ""
veleroBackupStorageLocation: "default"
...@@ -72,6 +72,8 @@ var ( ...@@ -72,6 +72,8 @@ var (
EasystartBackupName string EasystartBackupName string
// SupportedDrupalVersion Name // SupportedDrupalVersion Name
SupportedDrupalVersionName string SupportedDrupalVersionName string
// VeleroBackupStorageLocation refers to the name of the Velero backupStorageLocation to be used
VeleroBackupStorageLocation string
) )
// DrupalSiteReconciler reconciles a DrupalSite object // DrupalSiteReconciler reconciles a DrupalSite object
......
...@@ -1655,6 +1655,7 @@ func scheduledBackupsForDrupalSite(currentobject *velerov1.Schedule, d *webservi ...@@ -1655,6 +1655,7 @@ func scheduledBackupsForDrupalSite(currentobject *velerov1.Schedule, d *webservi
TTL: metav1.Duration{ TTL: metav1.Duration{
Duration: 14 * 24 * time.Hour, Duration: 14 * 24 * time.Hour,
}, },
StorageLocation: VeleroBackupStorageLocation,
} }
// Set UseOwnerReferencesInBackup to False since we do not want the Backups to be deleted when Schedule object is deleted or modified // Set UseOwnerReferencesInBackup to False since we do not want the Backups to be deleted when Schedule object is deleted or modified
currentobject.Spec.UseOwnerReferencesInBackup = pointer.BoolPtr(false) currentobject.Spec.UseOwnerReferencesInBackup = pointer.BoolPtr(false)
......
...@@ -84,6 +84,7 @@ var _ = BeforeSuite(func(done Done) { ...@@ -84,6 +84,7 @@ var _ = BeforeSuite(func(done Done) {
ClusterName = "test" ClusterName = "test"
EasystartBackupName = "easystart-backup" EasystartBackupName = "easystart-backup"
SupportedDrupalVersionName = "supported-drupal-versions" SupportedDrupalVersionName = "supported-drupal-versions"
VeleroBackupStorageLocation = "default"
By("bootstrapping test environment") By("bootstrapping test environment")
testEnv = &envtest.Environment{ testEnv = &envtest.Environment{
......
...@@ -87,6 +87,7 @@ func main() { ...@@ -87,6 +87,7 @@ func main() {
flag.StringVar(&controllers.EasystartBackupName, "easystart-backup-name", "", "The name of the easy-start backup") flag.StringVar(&controllers.EasystartBackupName, "easystart-backup-name", "", "The name of the easy-start backup")
// The variable name is set here: https://gitlab.cern.ch/drupal/paas/cern-drupal-distribution/-/blob/master/supporteddrupalversions/chart/templates/supported-drupal-versions.yaml // The variable name is set here: https://gitlab.cern.ch/drupal/paas/cern-drupal-distribution/-/blob/master/supporteddrupalversions/chart/templates/supported-drupal-versions.yaml
flag.StringVar(&controllers.SupportedDrupalVersionName, "supported-drupal-version-name", "supported-drupal-versions", "The name of the resource used cluster-wide for supported drupal versions") flag.StringVar(&controllers.SupportedDrupalVersionName, "supported-drupal-version-name", "supported-drupal-versions", "The name of the resource used cluster-wide for supported drupal versions")
flag.StringVar(&controllers.VeleroBackupStorageLocation, "velero-backup-storage-location", "default", "The name of the backupStorageLocation to be used for Velero Schedules created by the controller")
opts := zap.Options{ opts := zap.Options{
Development: false, Development: false,
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment