diff --git a/go.mod b/go.mod index fcea7fa65f9..75dac1edc93 100644 --- a/go.mod +++ b/go.mod @@ -102,7 +102,7 @@ require ( github.com/kr/text v0.2.0 github.com/mitchellh/mapstructure v1.5.0 github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249 - github.com/slackhq/vitess-addons v0.19.0 + github.com/slackhq/vitess-addons v0.19.0-vtops github.com/slok/noglog v0.2.0 github.com/spf13/afero v1.11.0 github.com/spf13/jwalterweatherman v1.1.0 diff --git a/go/cmd/vtorc/cli/cli.go b/go/cmd/vtorc/cli/cli.go index 44d60c4dfd7..a51b61a3b46 100644 --- a/go/cmd/vtorc/cli/cli.go +++ b/go/cmd/vtorc/cli/cli.go @@ -18,6 +18,7 @@ package cli import ( "io" + "os" "os/exec" "time" @@ -75,7 +76,16 @@ func run(cmd *cobra.Command, args []string) { log.Info("sleeping for 30s...\n") time.Sleep(30 * time.Second) - vtopsCmd := exec.Command("/vt/v19/bin/vtops", "problems", "--hostname", "vtctld-dev-iad-wc2-jrda", "--raise", "--tablet", "tablet-iad-dev-loadtest-00-80-yq5s", "--problem", "orc-dead-tablet") + + vtopsCmd := exec.Command("/vt/v19/bin/vtops", "problems", "--raise", "--tablet", "tablet-iad-dev-loadtest-00-80-yq5s", "--problem", "orc-dead-tablet") + + vtopsCmd.Env = append(os.Environ(), + "HTTP_PROXY="+os.Getenv("VTOPS_HTTP_PROXY"), + "HTTPS_PROXY="+os.Getenv("VTOPS_HTTP_PROXY"), + "http_proxy="+os.Getenv("VTOPS_HTTP_PROXY"), + "https_proxy="+os.Getenv("VTOPS_HTTP_PROXY"), + ) + // out, err := vtopsCmd.CombinedOutput() // if err != nil { // log.Errorf("Error executing vtops command for vtorc: %+v", err) diff --git a/go/vt/vttablet/grpctmclient/cached_client.go b/go/vt/vttablet/grpctmclient/cached_client.go index c0dd751ec30..1aa04888639 100644 --- a/go/vt/vttablet/grpctmclient/cached_client.go +++ b/go/vt/vttablet/grpctmclient/cached_client.go @@ -334,5 +334,5 @@ func (dialer *cachedConnDialer) Close() { } func getTabletAddr(tablet *topodatapb.Tablet) string { - return netutil.JoinHostPort(tablet.Hostname, int32(tablet.PortMap["grpc"])) + return netutil.JoinHostPort(tablet.Hostname+tempTinyspeckSuffix, int32(tablet.PortMap["grpc"])) } diff --git a/go/vt/vttablet/grpctmclient/client.go b/go/vt/vttablet/grpctmclient/client.go index db00cafa2d6..d3c2aafced9 100644 --- a/go/vt/vttablet/grpctmclient/client.go +++ b/go/vt/vttablet/grpctmclient/client.go @@ -52,6 +52,8 @@ const ( dialPoolGroupVTOrc ) +const tempTinyspeckSuffix = ".nebula.tinyspeck.com" + type invalidatorFunc func() var ( @@ -152,7 +154,7 @@ func NewClient() *Client { // dial returns a client to use func (client *grpcClient) dial(ctx context.Context, tablet *topodatapb.Tablet) (tabletmanagerservicepb.TabletManagerClient, io.Closer, error) { - addr := netutil.JoinHostPort(tablet.Hostname, int32(tablet.PortMap["grpc"])) + addr := netutil.JoinHostPort(tablet.Hostname+tempTinyspeckSuffix, int32(tablet.PortMap["grpc"])) opt, err := grpcclient.SecureDialOption(cert, key, ca, crl, name) if err != nil { return nil, nil, err @@ -177,7 +179,7 @@ func (client *grpcClient) createTmc(addr string, opt grpc.DialOption) (*tmc, err } func (client *grpcClient) dialPool(ctx context.Context, tablet *topodatapb.Tablet) (tabletmanagerservicepb.TabletManagerClient, error) { - addr := netutil.JoinHostPort(tablet.Hostname, int32(tablet.PortMap["grpc"])) + addr := netutil.JoinHostPort(tablet.Hostname+tempTinyspeckSuffix, int32(tablet.PortMap["grpc"])) opt, err := grpcclient.SecureDialOption(cert, key, ca, crl, name) if err != nil { return nil, err @@ -210,7 +212,7 @@ func (client *grpcClient) dialPool(ctx context.Context, tablet *topodatapb.Table } func (client *grpcClient) dialDedicatedPool(ctx context.Context, dialPoolGroup DialPoolGroup, tablet *topodatapb.Tablet) (tabletmanagerservicepb.TabletManagerClient, invalidatorFunc, error) { - addr := netutil.JoinHostPort(tablet.Hostname, int32(tablet.PortMap["grpc"])) + addr := netutil.JoinHostPort(tablet.Hostname+tempTinyspeckSuffix, int32(tablet.PortMap["grpc"])) opt, err := grpcclient.SecureDialOption(cert, key, ca, crl, name) if err != nil { return nil, nil, err