From 34a23e75cc316670a1a6f071bed43a151df0f8e7 Mon Sep 17 00:00:00 2001 From: Hanamichi Date: Tue, 12 Dec 2023 15:06:32 +0800 Subject: [PATCH] fix AssumeYes not work when set flag (#684) Signed-off-by: x893675 --- pkg/cli/sudo/sudo.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/cli/sudo/sudo.go b/pkg/cli/sudo/sudo.go index 6eed287c..4be51169 100644 --- a/pkg/cli/sudo/sudo.go +++ b/pkg/cli/sudo/sudo.go @@ -135,8 +135,12 @@ func MultiNIC(name string, sshConfig *sshutils.SSH, streams options.IOStreams, a if err != nil { logger.Error(err) + if options.AssumeYes { + logger.Infof("skip this error,continue exec cmd") + return true + } logger.Errorf("===========>%s PRECHECK FAILED!", name) - if err == errorMultiNIC { + if errors.Is(err, errorMultiNIC) { _, _ = streams.Out.Write([]byte("node has multi nic,and --ip-detect flag not specified,default ip " + "detect method is 'first-found',which maybe chose a wrong one,you can add --ip-detect flag to specify it." + "\n")) }