Skip to content

Commit

Permalink
oadp-1.0 mtc operator type restic credential mount (#725)
Browse files Browse the repository at this point in the history
* mtc operator type restic credential mount

* mount secret volume if has backup location or mtc context.
  • Loading branch information
kaovilai authored Jun 3, 2022
1 parent c5f772f commit 0ae96ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/credentials/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,9 @@ func AppendCloudProviderVolumes(dpa *oadpv1alpha1.DataProtectionApplication, ds
// pattern from https://golang.org/doc/effective_go#maps
// this replaces the need to iterate through the `pluginSpecificFields` O(n) -> O(1)
if cloudProviderMap, ok := PluginSpecificFields[plugin]; ok &&
cloudProviderMap.IsCloudProvider &&
!dpa.Spec.Configuration.Velero.NoDefaultBackupLocation {
cloudProviderMap.IsCloudProvider && //if plugin is a cloud provider plugin, and one of the following condition is true
(!dpa.Spec.Configuration.Velero.NoDefaultBackupLocation || // it has a backup location in OADP/velero context OR
dpa.Spec.UnsupportedOverrides[oadpv1alpha1.OperatorTypeKey] == oadpv1alpha1.OperatorTypeMTC) { // OADP is installed via MTC

pluginNeedsCheck, foundProviderPlugin := providerNeedsDefaultCreds[string(plugin)]
if !foundProviderPlugin && !hasCloudStorage {
Expand Down

0 comments on commit 0ae96ae

Please sign in to comment.