Преглед изворни кода

Merge pull request #488 from dolonet/doctor/skip-native-check-v2

doctor: add --skip-native-check flag
pull/474/merge
Sergei Arkhipov пре 2 дана
родитељ
комит
b0923a51d2
No account linked to committer's email address
1 измењених фајлова са 7 додато и 2 уклоњено
  1. 7
    2
      internal/cli/doctor.go

+ 7
- 2
internal/cli/doctor.go Прегледај датотеку

@@ -69,7 +69,8 @@ var (
69 69
 type Doctor struct {
70 70
 	conf *config.Config
71 71
 
72
-	ConfigPath string `kong:"arg,required,type='existingfile',help='Path to the configuration file.',name='config-path'"` //nolint: lll
72
+	ConfigPath      string `kong:"arg,required,type='existingfile',help='Path to the configuration file.',name='config-path'"` //nolint: lll
73
+	SkipNativeCheck bool   `kong:"help='Skip the native network connectivity check (useful when proxy chaining is configured and direct egress is not expected to work).',name='skip-native-check'"` //nolint: lll
73 74
 }
74 75
 
75 76
 func (d *Doctor) Run(cli *CLI, version string) error {
@@ -106,7 +107,11 @@ func (d *Doctor) Run(cli *CLI, version string) error {
106 107
 	)
107 108
 
108 109
 	fmt.Println("Validate native network connectivity")
109
-	everythingOK = d.checkNetwork(base) && everythingOK
110
+	if d.SkipNativeCheck {
111
+		fmt.Println("  ⏭ Skipped (--skip-native-check)")
112
+	} else {
113
+		everythingOK = d.checkNetwork(base) && everythingOK
114
+	}
110 115
 
111 116
 	for _, url := range conf.Network.Proxies {
112 117
 		value, err := network.NewProxyNetwork(base, url.Get(nil))

Loading…
Откажи
Сачувај