diff --git a/main.go b/main.go index 0b0df7f..2f1c760 100644 --- a/main.go +++ b/main.go @@ -307,12 +307,12 @@ func (d *ofsDriver) Mount(r *volume.MountRequest) (*volume.MountResponse, error) var fs string if v.Backup { log.WithFields(log.Fields{"name": r.Name}).Info("Going to create a backup snapshot") - if snapshotTextB, err := applyEnv(exec.Command("/sbin/mount.objectivefs", "snapshot", v.Fs), v.Env).CombinedOutput(); err == nil { + if snapshotTextB, err := applyEnv(exec.Command("/sbin/mount.objectivefs", "snapshot", v.Fs), v.Env).CombinedOutput(); err != nil { log.WithFields(log.Fields{"name": v.Volume.Name, "output": string(snapshotTextB[:])}).Info("Failed to create a new backup snapshot") return &volume.MountResponse{}, err } else { // Format: NOTE: Successfully created snapshot: snapshotId () - const okPrefix = "NOTE: Successfully created snapshot:" + const okPrefix = "NOTE: Successfully created snapshot: " snapshotText := string(snapshotTextB[:]) if snapshotIdWithSuffix, isOk := strings.CutPrefix(snapshotText, okPrefix); !isOk { log.WithFields(log.Fields{"name": v.Volume.Name, "snapshot": v.BackupSnapshot}).Info("Failed to create a new backup snapshot")