From 40172c07219814dd30d73656e0771073a7718867 Mon Sep 17 00:00:00 2001 From: kreedom <60944649+kreedom@users.noreply.github.com> Date: Wed, 28 Oct 2020 20:09:10 +0200 Subject: [PATCH] vmbackup fix panic when no origin fs given (#859) * use fsnil when no origin fs --- CHANGELOG.md | 2 +- app/vmbackup/main.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 310f90ba1b..8701866c02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ * BUGFIX: vmagent: properly handle OpenStack endpoint ending with `v3.0` such as `https://ostack.example.com:5000/v3.0` in the same way as Prometheus does. See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/728#issuecomment-709914803 * BUGFIX: Drop trailing data points for time series with a single raw sample. See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/748 - +* BUGFIX: fix panic in vmbackup when no origin fs is specified. See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/856 # [v1.44.0](https://github.com/VictoriaMetrics/VictoriaMetrics/releases/tag/v1.44.0) diff --git a/app/vmbackup/main.go b/app/vmbackup/main.go index 49bb728748..bbaa2a77a0 100644 --- a/app/vmbackup/main.go +++ b/app/vmbackup/main.go @@ -10,6 +10,7 @@ import ( "github.com/VictoriaMetrics/VictoriaMetrics/lib/backup/actions" "github.com/VictoriaMetrics/VictoriaMetrics/lib/backup/common" "github.com/VictoriaMetrics/VictoriaMetrics/lib/backup/fslocal" + "github.com/VictoriaMetrics/VictoriaMetrics/lib/backup/fsnil" "github.com/VictoriaMetrics/VictoriaMetrics/lib/buildinfo" "github.com/VictoriaMetrics/VictoriaMetrics/lib/cgroup" "github.com/VictoriaMetrics/VictoriaMetrics/lib/envflag" @@ -146,9 +147,9 @@ func newDstFS() (common.RemoteFS, error) { return fs, nil } -func newOriginFS() (common.RemoteFS, error) { +func newOriginFS() (common.OriginFS, error) { if len(*origin) == 0 { - return nil, nil + return &fsnil.FS{}, nil } fs, err := actions.NewRemoteFS(*origin) if err != nil {