Skip to content

Commit

Permalink
Fix empty storage secret issue
Browse files Browse the repository at this point in the history
Signed-off-by: Md. Ishtiaq Islam <[email protected]>
  • Loading branch information
ishtiaqhimel committed Sep 18, 2023
1 parent 8970e83 commit a48be51
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions pkg/restic/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,12 +409,16 @@ func (w *ResticWrapper) setBackupStorageVariables() error {
return nil
}

ss, err := w.getSecret(&kmapi.ObjectReference{
Name: secret,
Namespace: bs.Namespace,
})
if err != nil {
return fmt.Errorf("failed to get storage Secret %s/%s: %w", bs.Namespace, secret, err)
ss := &core.Secret{}
if secret != "" {
var err error
ss, err = w.getSecret(&kmapi.ObjectReference{
Name: secret,
Namespace: bs.Namespace,
})
if err != nil {
return fmt.Errorf("failed to get storage Secret %s/%s: %w", bs.Namespace, secret, err)
}
}

es, err := w.getSecret(w.config.EncryptionSecret)
Expand Down

0 comments on commit a48be51

Please sign in to comment.