Merge pull request #636 from skriss/restic-set-hostname
set --hostname flag for restic backupspull/628/head
commit
5ce92adff0
|
@ -23,13 +23,18 @@ import (
|
||||||
|
|
||||||
// BackupCommand returns a Command for running a restic backup.
|
// BackupCommand returns a Command for running a restic backup.
|
||||||
func BackupCommand(repoIdentifier, passwordFile, path string, tags map[string]string) *Command {
|
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{
|
return &Command{
|
||||||
Command: "backup",
|
Command: "backup",
|
||||||
RepoIdentifier: repoIdentifier,
|
RepoIdentifier: repoIdentifier,
|
||||||
PasswordFile: passwordFile,
|
PasswordFile: passwordFile,
|
||||||
Dir: path,
|
Dir: path,
|
||||||
Args: []string{"."},
|
Args: []string{"."},
|
||||||
ExtraFlags: backupTagFlags(tags),
|
ExtraFlags: append(backupTagFlags(tags), "--hostname=ark"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue