Просмотр исходного кода

doctor: add --skip-native-check flag

pull/488/head
dolonet 6 дней назад
Родитель
Сommit
49ac70066f
1 измененных файлов: 7 добавлений и 2 удалений
  1. 7
    2
      internal/cli/doctor.go

+ 7
- 2
internal/cli/doctor.go Просмотреть файл

69
 type Doctor struct {
69
 type Doctor struct {
70
 	conf *config.Config
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
 func (d *Doctor) Run(cli *CLI, version string) error {
76
 func (d *Doctor) Run(cli *CLI, version string) error {
106
 	)
107
 	)
107
 
108
 
108
 	fmt.Println("Validate native network connectivity")
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
 	for _, url := range conf.Network.Proxies {
116
 	for _, url := range conf.Network.Proxies {
112
 		value, err := network.NewProxyNetwork(base, url.Get(nil))
117
 		value, err := network.NewProxyNetwork(base, url.Get(nil))

Загрузка…
Отмена
Сохранить