Skip to content

Commit

Permalink
Fix linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
woblerr committed Jun 2, 2024
1 parent 4b04858 commit c87c32e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions cmd/backup_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,17 +450,17 @@ func backupDeleteFileLocalFunc(backupData gpbckpconfig.BackupConfig, parseHData
// If backup type is not "metadata-only", we should delete files on segments and master.
// If backup type is "metadata-only", we should not delete files only on master.
if backupType != gpbckpconfig.BackupTypeMetadataOnly {
segConfig, err := getSegmentConfigurationClusterInfo(backupData.DatabaseName)
var errSeg error
segConfig, errSeg := getSegmentConfigurationClusterInfo(backupData.DatabaseName)
if err != nil {
gplog.Error(textmsg.ErrorTextUnableGetBackupPath("segment configuration", backupName, err))
return err
gplog.Error(textmsg.ErrorTextUnableGetBackupPath("segment configuration", backupName, errSeg))
return errSeg
}
fmt.Print(segConfig)
// Execute on segments.
err = executeDeleteBackupOnSegments(backupDir, backupData.BackupDir, backupName, segPrefix, isSingleBackupDir, segConfig, maxParallelProcesses)
if err != nil {
gplog.Error(textmsg.ErrorTextUnableDeleteBackup(backupName, err))
return err
errSeg = executeDeleteBackupOnSegments(backupDir, backupData.BackupDir, backupName, segPrefix, isSingleBackupDir, segConfig, maxParallelProcesses)
if errSeg != nil {
gplog.Error(textmsg.ErrorTextUnableDeleteBackup(backupName, errSeg))
return errSeg
}
}
// Delete files on master.
Expand Down Expand Up @@ -618,6 +618,9 @@ func getSSHConfig() (*ssh.ClientConfig, error) {
Auth: []ssh.AuthMethod{
ssh.PublicKeys(signer),
},
// Disable known_hosts check.
// This check also disables in gpbackup utility.
// #nosec G106
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
Timeout: 30 * time.Second,
}
Expand Down

0 comments on commit c87c32e

Please sign in to comment.