@@ -285,12 +285,14 @@ func (r *DPAReconciler) buildRegistryDeployment(registryDeployment *appsv1.Deplo
285285
286286 // attach gcp secret volume if provider is gcp
287287 if bsl .Spec .Provider == GCPProvider {
288+ // check for secret name
289+ secretName , _ := r .getSecretNameAndKey (bsl .Spec .Credential , oadpv1alpha1 .DefaultPluginGCP )
288290 registryDeployment .Spec .Template .Spec .Volumes = []corev1.Volume {
289291 {
290- Name : credentials . PluginSpecificFields [ oadpv1alpha1 . DefaultPluginGCP ]. SecretName ,
292+ Name : secretName ,
291293 VolumeSource : corev1.VolumeSource {
292294 Secret : & corev1.SecretVolumeSource {
293- SecretName : credentials . PluginSpecificFields [ oadpv1alpha1 . DefaultPluginGCP ]. SecretName ,
295+ SecretName : secretName ,
294296 },
295297 },
296298 },
@@ -376,9 +378,11 @@ func (r *DPAReconciler) buildRegistryContainer(bsl *velerov1.BackupStorageLocati
376378
377379 // append secret volumes if the BSL provider is GCP
378380 if bsl .Spec .Provider == GCPProvider {
381+ // check for secret name
382+ secretName , _ := r .getSecretNameAndKey (bsl .Spec .Credential , oadpv1alpha1 .DefaultPluginGCP )
379383 containers [0 ].VolumeMounts = []corev1.VolumeMount {
380384 {
381- Name : credentials . PluginSpecificFields [ oadpv1alpha1 . DefaultPluginGCP ]. SecretName ,
385+ Name : secretName ,
382386 MountPath : credentials .PluginSpecificFields [oadpv1alpha1 .DefaultPluginGCP ].MountPath ,
383387 },
384388 }
@@ -511,7 +515,9 @@ func (r *DPAReconciler) getGCPRegistryEnvVars(bsl *velerov1.BackupStorageLocatio
511515 }
512516
513517 if gcpEnvVars [i ].Name == RegistryStorageGCSKeyfile {
514- gcpEnvVars [i ].Value = credentials .PluginSpecificFields [oadpv1alpha1 .DefaultPluginGCP ].MountPath + "/" + credentials .PluginSpecificFields [oadpv1alpha1 .DefaultPluginGCP ].PluginSecretKey
518+ // check for secret key
519+ _ , secretKey := r .getSecretNameAndKey (bsl .Spec .Credential , oadpv1alpha1 .DefaultPluginGCP )
520+ gcpEnvVars [i ].Value = credentials .PluginSpecificFields [oadpv1alpha1 .DefaultPluginGCP ].MountPath + "/" + secretKey
515521 }
516522 }
517523 return gcpEnvVars , nil
@@ -1061,6 +1067,10 @@ func (r *DPAReconciler) ReconcileRegistrySecrets(log logr.Logger) (bool, error)
10611067
10621068 // Now for each of these bsl instances, create a registry secret
10631069 for _ , bsl := range bslList .Items {
1070+ // skip for GCP as nothing is directly exposed in env vars
1071+ if bsl .Spec .Provider == GCPProvider {
1072+ continue
1073+ }
10641074 secret := corev1.Secret {
10651075 ObjectMeta : metav1.ObjectMeta {
10661076 Name : "oadp-" + bsl .Name + "-" + bsl .Spec .Provider + "-registry-secret" ,
0 commit comments