Skip to content

Commit

Permalink
FMWK-603-xdr-backup-handler
Browse files Browse the repository at this point in the history
- removed unnecessary error
  • Loading branch information
filkeith committed Jan 5, 2025
1 parent 8d424c2 commit edb6d73
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions cmd/internal/app/asbackup.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ func NewASBackup(
return nil, err
}

secretAgent, err := getSecretAgent(backupConfig, backupXDRConfig)
if err != nil {
return nil, err
}
secretAgent := getSecretAgent(backupConfig, backupXDRConfig)

writer, err := initializeWriter(ctx, params, secretAgent)
if err != nil {
Expand Down Expand Up @@ -232,13 +229,13 @@ func (b *ASBackup) Run(ctx context.Context) error {
return nil
}

func getSecretAgent(b *backup.BackupConfig, bxdr *backup.ConfigBackupXDR) (*backup.SecretAgentConfig, error) {
func getSecretAgent(b *backup.BackupConfig, bxdr *backup.ConfigBackupXDR) *backup.SecretAgentConfig {
switch {
case b != nil:
return b.SecretAgentConfig, nil
return b.SecretAgentConfig
case bxdr != nil:
return bxdr.SecretAgentConfig, nil
return bxdr.SecretAgentConfig
default:
return nil, fmt.Errorf("no secret agent configuration found")
return nil
}
}

0 comments on commit edb6d73

Please sign in to comment.