@@ -139,6 +139,7 @@ func (r *ReconcilePerconaServerMongoDB) reconcilePBMConfig(ctx context.Context,
139139 // Hashes can be equal even if the actual PBM configuration differs from the one that was hashed
140140 // For example, a restore can modify the PBM config
141141 // We should use `isResyncNeeded` to compare the current configuration with the one we need
142+ // Also, storage credentials are not hashed since they are excluded from JSON representation. `isResyncNeeded` will handle it.
142143 if cr .Status .BackupConfigHash == hash && ! isResyncNeeded (currentCfg , & main ) {
143144 return nil
144145 }
@@ -192,6 +193,15 @@ func isResyncNeeded(currentCfg *config.Config, newCfg *config.Config) bool {
192193 if currentCfg .Storage .S3 .Prefix != newCfg .Storage .S3 .Prefix {
193194 return true
194195 }
196+
197+ if currentCfg .Storage .S3 .Credentials .AccessKeyID != newCfg .Storage .S3 .Credentials .AccessKeyID {
198+ return true
199+ }
200+
201+ if currentCfg .Storage .S3 .Credentials .SecretAccessKey != newCfg .Storage .S3 .Credentials .SecretAccessKey {
202+ return true
203+ }
204+
195205 }
196206
197207 if currentCfg .Storage .GCS != nil && newCfg .Storage .GCS != nil {
@@ -202,6 +212,22 @@ func isResyncNeeded(currentCfg *config.Config, newCfg *config.Config) bool {
202212 if currentCfg .Storage .GCS .Prefix != newCfg .Storage .GCS .Prefix {
203213 return true
204214 }
215+
216+ if currentCfg .Storage .GCS .Credentials .ClientEmail != newCfg .Storage .GCS .Credentials .ClientEmail {
217+ return true
218+ }
219+
220+ if currentCfg .Storage .GCS .Credentials .PrivateKey != newCfg .Storage .GCS .Credentials .PrivateKey {
221+ return true
222+ }
223+
224+ if currentCfg .Storage .GCS .Credentials .HMACAccessKey != newCfg .Storage .GCS .Credentials .HMACAccessKey {
225+ return true
226+ }
227+
228+ if currentCfg .Storage .GCS .Credentials .HMACSecret != newCfg .Storage .GCS .Credentials .HMACSecret {
229+ return true
230+ }
205231 }
206232
207233 if currentCfg .Storage .Azure != nil && newCfg .Storage .Azure != nil {
@@ -216,6 +242,10 @@ func isResyncNeeded(currentCfg *config.Config, newCfg *config.Config) bool {
216242 if currentCfg .Storage .Azure .Account != newCfg .Storage .Azure .Account {
217243 return true
218244 }
245+
246+ if currentCfg .Storage .Azure .Credentials .Key != newCfg .Storage .Azure .Credentials .Key {
247+ return true
248+ }
219249 }
220250
221251 if currentCfg .Storage .Filesystem != nil && newCfg .Storage .Filesystem != nil {
0 commit comments