Skip to content

Commit b3497fa

Browse files
authored
Merge pull request #682 from lsc2001/fix-failover-config
Fix #681: Enable failover-policy option only in Fusedev mode
2 parents badb6ef + 287ccb5 commit b3497fa

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

pkg/filesystem/fs.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,10 +669,13 @@ func (fs *Filesystem) createDaemon(fsManager *manager.Manager, daemonMode config
669669
daemon.WithLogToStdout(config.GetLogToStdout()),
670670
daemon.WithNydusdThreadNum(config.GetDaemonThreadsNumber()),
671671
daemon.WithFsDriver(fsManager.FsDriver),
672-
daemon.WithFailoverPolicy(config.GetDaemonFailoverPolicy()),
673672
daemon.WithDaemonMode(daemonMode),
674673
}
675674

675+
if fsManager.FsDriver == config.FsDriverFusedev {
676+
opts = append(opts, daemon.WithFailoverPolicy(config.GetDaemonFailoverPolicy()))
677+
}
678+
676679
// For fscache driver, no need to provide mountpoint to nydusd daemon.
677680
if mountpoint != "" {
678681
opts = append(opts, daemon.WithMountpoint(mountpoint))

pkg/manager/daemon_adaptor.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ func (m *Manager) BuildDaemonCommand(d *daemon.Daemon, bin string, upgrade bool)
200200
cmdOpts = append(cmdOpts, command.WithLogFile(d.LogFile()))
201201
}
202202

203-
cmdOpts = append(cmdOpts, command.WithFailoverPolicy(d.States.FailoverPolicy))
203+
if d.States.FsDriver == config.FsDriverFusedev {
204+
cmdOpts = append(cmdOpts, command.WithFailoverPolicy(d.States.FailoverPolicy))
205+
}
204206

205207
args, err := command.BuildCommand(cmdOpts)
206208
if err != nil {

0 commit comments

Comments
 (0)