Skip to content

Commit

Permalink
Fix helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakraj1997 committed Feb 10, 2022
1 parent ece6dec commit abcef76
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/e2e/dpa_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,19 @@ func (v *dpaCustomResource) Build(backupRestoreType BackupRestoreType) error {
switch v.Provider {
case "gcp":
if v.OpenshiftCi {
dpa.Spec.BackupLocations[0].Velero.Config = map[string]string{
dpaInstance.Spec.BackupLocations[0].Velero.Config = map[string]string{
"credentialsFile": "bsl-cloud-credentials-gcp/cloud", // <secret_name>/<key>
}
} else {
dpa.Spec.BackupLocations[0].Velero.Credential = &corev1.SecretKeySelector{
dpaInstance.Spec.BackupLocations[0].Velero.Credential = &corev1.SecretKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Name: v.CredSecretRef,
},
Key: "cloud",
}
}
// dpa.Spec.Configuration.Velero.DefaultPlugins = append(dpa.Spec.Configuration.Velero.DefaultPlugins, oadpv1alpha1.DefaultPluginGCP)
// dpa.Spec.SnapshotLocations = []oadpv1alpha1.SnapshotLocation{
// dpaInstance.Spec.Configuration.Velero.DefaultPlugins = append(dpaInstance.Spec.Configuration.Velero.DefaultPlugins, oadpv1alpha1.DefaultPluginGCP)
// dpaInstance.Spec.SnapshotLocations = []oadpv1alpha1.SnapshotLocation{
// {
// Velero: &velero.VolumeSnapshotLocationSpec{
// Provider: v.Provider,
Expand All @@ -122,24 +122,24 @@ func (v *dpaCustomResource) Build(backupRestoreType BackupRestoreType) error {
// },
// }
case "azure":
dpa.Spec.BackupLocations[0].Velero.Config = map[string]string{
dpaInstance.Spec.BackupLocations[0].Velero.Config = map[string]string{
"subscriptionId": v.DpaAzureConfig.BslSubscriptionId,
"storageAccount": v.DpaAzureConfig.BslStorageAccount,
"resourceGroup": v.DpaAzureConfig.BslResourceGroup,
"storageAccountKeyEnvVar": v.DpaAzureConfig.BslStorageAccountKeyEnvVar,
}
if v.OpenshiftCi {
dpa.Spec.BackupLocations[0].Velero.Config["credentialsFile"] = "bsl-cloud-credentials-azure/cloud" // <secret_name>/<key>
dpaInstance.Spec.BackupLocations[0].Velero.Config["credentialsFile"] = "bsl-cloud-credentials-azure/cloud" // <secret_name>/<key>
} else {
dpa.Spec.BackupLocations[0].Velero.Credential = &corev1.SecretKeySelector{
dpaInstance.Spec.BackupLocations[0].Velero.Credential = &corev1.SecretKeySelector{
LocalObjectReference: corev1.LocalObjectReference{
Name: v.CredSecretRef,
},
Key: "cloud",
}
}
dpa.Spec.Configuration.Velero.DefaultPlugins = append(dpa.Spec.Configuration.Velero.DefaultPlugins, oadpv1alpha1.DefaultPluginMicrosoftAzure)
dpa.Spec.SnapshotLocations = []oadpv1alpha1.SnapshotLocation{
dpaInstance.Spec.Configuration.Velero.DefaultPlugins = append(dpaInstance.Spec.Configuration.Velero.DefaultPlugins, oadpv1alpha1.DefaultPluginMicrosoftAzure)
dpaInstance.Spec.SnapshotLocations = []oadpv1alpha1.SnapshotLocation{
{
Velero: &velero.VolumeSnapshotLocationSpec{
Provider: v.Provider,
Expand Down

0 comments on commit abcef76

Please sign in to comment.