Skip to content

Commit

Permalink
fix oldest backup date update
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptobioz committed Mar 11, 2019
1 parent e9b4a93 commit e39f219
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/manager/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"
"os"
"strings"
"regexp"
"time"

log "github.com/Sirupsen/logrus"
Expand Down Expand Up @@ -173,8 +173,8 @@ func (m *Manager) updateBackupLogs(v *volume.Volume, agentOutput utils.MsgFormat
}

func (m *Manager) setOldestBackupDate(v *volume.Volume) (err error) {
// TODO: use regex
stdout := strings.Split(v.Logs["snapshots"], "]")[1]
r, err := regexp.Compile(`\S{3} (.*)`)
stdout := r.FindStringSubmatch(v.Logs["snapshots"])[1]

var snapshots []engine.Snapshot

Expand Down

0 comments on commit e39f219

Please sign in to comment.