Skip to content

Commit

Permalink
trim \n
Browse files Browse the repository at this point in the history
  • Loading branch information
shuijing198799 committed Mar 31, 2020
1 parent 1ad8548 commit 65c0b3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmd/backup-manager/app/backup/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (bo *Options) backupData(backup *v1alpha1.Backup) (string, error) {
}
err = cmd.Start()
if err != nil {
return remotePath, fmt.Errorf("cluster %s, execute br command failed, output: %s, err: %v", bo, fullArgs, err)
return remotePath, fmt.Errorf("cluster %s, execute br command failed, args: %s, err: %v", bo, fullArgs, err)
}
var tmpOutput, errMsg string
for {
Expand All @@ -82,7 +82,7 @@ func (bo *Options) backupData(backup *v1alpha1.Backup) (string, error) {
if strings.Contains(tmpOutput, "[ERROR]") {
errMsg += tmpOutput
}
klog.Infof(tmpOutput)
klog.Infof(strings.Replace(tmpOutput, "\n", "", -1))
if err != nil {
break
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/backup-manager/app/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (ro *Options) restoreData(restore *v1alpha1.Restore) error {
}
err = cmd.Start()
if err != nil {
return fmt.Errorf("cluster %s, execute br command failed, output: %s, err: %v", ro, fullArgs, err)
return fmt.Errorf("cluster %s, execute br command failed, args: %s, err: %v", ro, fullArgs, err)
}
var tmpOutput, errMsg string
for {
Expand All @@ -76,7 +76,7 @@ func (ro *Options) restoreData(restore *v1alpha1.Restore) error {
if strings.Contains(tmpOutput, "[ERROR]") {
errMsg += tmpOutput
}
klog.Infof(tmpOutput)
klog.Infof(strings.Replace(tmpOutput, "\n", "", -1))
if err != nil {
break
}
Expand Down

0 comments on commit 65c0b3d

Please sign in to comment.