fix(talosctl): always use default GRPC dial options

When run in "normal" mode, `talosctl` takes into account proxy
configuration, such as the `https_proxy` and `no_proxy` environment
variables; but when invoked with `--insecure`, those would be ignored,
which results in `talosctl` being unable to interact with nodes in
maintenance mode if they're only reachable through a proxy.

This commit adds the `WithDefaultGRPCDialOptions()` option to the
client created by `WithClientMaintenance()`, same as `WithClient()`.

Signed-off-by: Benoît Knecht <benoit.knecht@proton.ch>
This commit is contained in:
Benoît Knecht 2026-04-08 20:00:25 +02:00 committed by Mateusz Urbanek
parent ca208e5149
commit 21f459aab5
No known key found for this signature in database
GPG Key ID: F16F84591E26D77F

View File

@ -152,7 +152,7 @@ func (c *Args) WithClientMaintenance(enforceFingerprints []string, action func(c
tlsConfig.VerifyConnection = x509.MatchSPKIFingerprints(fingerprints...)
}
c, err := client.New(ctx, client.WithTLSConfig(tlsConfig), client.WithEndpoints(c.Nodes...))
c, err := client.New(ctx, client.WithDefaultGRPCDialOptions(), client.WithTLSConfig(tlsConfig), client.WithEndpoints(c.Nodes...))
if err != nil {
return err
}