From 547625c3336f974b976430737ff495cd47da5f26 Mon Sep 17 00:00:00 2001 From: Steve Kriss Date: Mon, 2 Jul 2018 10:52:32 -0700 Subject: [PATCH] set --hostname flag for restic backups Signed-off-by: Steve Kriss --- pkg/restic/command_factory.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/restic/command_factory.go b/pkg/restic/command_factory.go index e460911ca..591d6f9d3 100644 --- a/pkg/restic/command_factory.go +++ b/pkg/restic/command_factory.go @@ -23,13 +23,18 @@ import ( // BackupCommand returns a Command for running a restic backup. func BackupCommand(repoIdentifier, passwordFile, path string, tags map[string]string) *Command { + // --hostname flag is provided with a generic value because restic uses the hostname + // to find a parent snapshot, and by default it will be the name of the daemonset pod + // where the `restic backup` command is run. If this pod is recreated, we want to continue + // taking incremental backups rather than triggering a full one due to a new pod name. + return &Command{ Command: "backup", RepoIdentifier: repoIdentifier, PasswordFile: passwordFile, Dir: path, Args: []string{"."}, - ExtraFlags: backupTagFlags(tags), + ExtraFlags: append(backupTagFlags(tags), "--hostname=ark"), } }