@@ -299,13 +299,14 @@ func (r *DPAReconciler) buildRegistryDeployment(registryDeployment *appsv1.Deplo
299
299
)
300
300
}
301
301
} else if bsl .Spec .Provider == GCPProvider {
302
- cloudProviderMap := credentials .PluginSpecificFields [oadpv1alpha1 .DefaultPluginGCP ]
302
+ // check for secret name
303
+ secretName , _ := r .getSecretNameAndKey (& bsl .Spec , oadpv1alpha1 .DefaultPluginGCP )
303
304
registryDeployment .Spec .Template .Spec .Volumes = []corev1.Volume {
304
305
{
305
- Name : cloudProviderMap . SecretName ,
306
+ Name : secretName ,
306
307
VolumeSource : corev1.VolumeSource {
307
308
Secret : & corev1.SecretVolumeSource {
308
- SecretName : cloudProviderMap . SecretName ,
309
+ SecretName : secretName ,
309
310
},
310
311
},
311
312
},
@@ -391,9 +392,11 @@ func (r *DPAReconciler) buildRegistryContainer(bsl *velerov1.BackupStorageLocati
391
392
392
393
// append secret volumes if the BSL provider is GCP
393
394
if bsl .Spec .Provider == GCPProvider {
395
+ // check for secret name
396
+ secretName , _ := r .getSecretNameAndKey (& bsl .Spec , oadpv1alpha1 .DefaultPluginGCP )
394
397
containers [0 ].VolumeMounts = []corev1.VolumeMount {
395
398
{
396
- Name : credentials . PluginSpecificFields [ oadpv1alpha1 . DefaultPluginGCP ]. SecretName ,
399
+ Name : secretName ,
397
400
MountPath : credentials .PluginSpecificFields [oadpv1alpha1 .DefaultPluginGCP ].MountPath ,
398
401
},
399
402
}
@@ -526,7 +529,9 @@ func (r *DPAReconciler) getGCPRegistryEnvVars(bsl *velerov1.BackupStorageLocatio
526
529
}
527
530
528
531
if gcpEnvVars [i ].Name == RegistryStorageGCSKeyfile {
529
- gcpEnvVars [i ].Value = credentials .PluginSpecificFields [oadpv1alpha1 .DefaultPluginGCP ].MountPath + "/" + credentials .PluginSpecificFields [oadpv1alpha1 .DefaultPluginGCP ].PluginSecretKey
532
+ // check for secret name
533
+ _ , secretKey := r .getSecretNameAndKey (& bsl .Spec , oadpv1alpha1 .DefaultPluginGCP )
534
+ gcpEnvVars [i ].Value = credentials .PluginSpecificFields [oadpv1alpha1 .DefaultPluginGCP ].MountPath + "/" + secretKey
530
535
}
531
536
}
532
537
return gcpEnvVars , nil
@@ -1086,6 +1091,10 @@ func (r *DPAReconciler) ReconcileRegistrySecrets(log logr.Logger) (bool, error)
1086
1091
1087
1092
// Now for each of these bsl instances, create a registry secret
1088
1093
for _ , bsl := range bslList .Items {
1094
+ // skip for GCP as nothing is directly exposed in env vars
1095
+ if bsl .Spec .Provider == GCPProvider {
1096
+ continue
1097
+ }
1089
1098
secret := corev1.Secret {
1090
1099
ObjectMeta : metav1.ObjectMeta {
1091
1100
Name : "oadp-" + bsl .Name + "-" + bsl .Spec .Provider + "-registry-secret" ,
0 commit comments