runtime: hybrid-mode cause error in the latest nydusd

When update the nydusd to 2.2, the argument "--hybrid-mode" cause
the following error:

thread 'main' panicked at 'ArgAction::SetTrue / ArgAction::SetFalse is defaulted'

Maybe we should remove it to upgrad nydusd

Fixes: #6407
Signed-off-by: Jianyong Wu <jianyong.wu@arm.com>
This commit is contained in:
Jianyong Wu 2023-03-02 16:41:46 +08:00
parent 7201279647
commit 395645e1ce
2 changed files with 3 additions and 3 deletions

View File

@ -157,7 +157,7 @@ func (nd *nydusd) args() ([]string, error) {
logLevel = "debug" logLevel = "debug"
} }
args := []string{ args := []string{
"virtiofs", "--hybrid-mode", "virtiofs",
"--log-level", logLevel, "--log-level", logLevel,
"--apisock", nd.apiSockPath, "--apisock", nd.apiSockPath,
"--sock", nd.sockPath, "--sock", nd.sockPath,

View File

@ -99,13 +99,13 @@ func TestNydusdArgs(t *testing.T) {
apiSockPath: "/var/lib/api.sock", apiSockPath: "/var/lib/api.sock",
debug: true, debug: true,
} }
expected := "virtiofs --hybrid-mode --log-level debug --apisock /var/lib/api.sock --sock /var/lib/vhost-user.sock" expected := "virtiofs --log-level debug --apisock /var/lib/api.sock --sock /var/lib/vhost-user.sock"
args, err := nd.args() args, err := nd.args()
assert.NoError(err) assert.NoError(err)
assert.Equal(expected, strings.Join(args, " ")) assert.Equal(expected, strings.Join(args, " "))
nd.debug = false nd.debug = false
expected = "virtiofs --hybrid-mode --log-level info --apisock /var/lib/api.sock --sock /var/lib/vhost-user.sock" expected = "virtiofs --log-level info --apisock /var/lib/api.sock --sock /var/lib/vhost-user.sock"
args, err = nd.args() args, err = nd.args()
assert.NoError(err) assert.NoError(err)
assert.Equal(expected, strings.Join(args, " ")) assert.Equal(expected, strings.Join(args, " "))