Skip to content

Commit

Permalink
Merge branch 'main' into hotrod
Browse files Browse the repository at this point in the history
  • Loading branch information
hellspawn679 authored Jul 14, 2024
2 parents 0ef8541 + 882ae45 commit 45c96a3
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 39 deletions.
2 changes: 1 addition & 1 deletion cmd/query/app/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ func TestServerInUseHostPort(t *testing.T) {
func TestServerSinglePort(t *testing.T) {
flagsSvc := flags.NewService(ports.QueryAdminHTTP)
flagsSvc.Logger = zaptest.NewLogger(t, zaptest.WrapOptions(zap.AddCaller()))
hostPort := ports.GetAddressFromCLIOptions(ports.QueryHTTP, "")
hostPort := ports.PortToHostPort(ports.QueryHTTP)
querySvc := makeQuerySvc()
telset := initTelSet(flagsSvc.Logger, jtracer.NoOp(), flagsSvc.HC())
server, err := NewServer(querySvc.qs, nil,
Expand Down
1 change: 0 additions & 1 deletion plugin/storage/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ const (
memoryStorageType = "memory"
kafkaStorageType = "kafka"
grpcStorageType = "grpc"
grpcPluginDeprecated = "grpc-plugin"
badgerStorageType = "badger"
blackholeStorageType = "blackhole"

Expand Down
7 changes: 0 additions & 7 deletions plugin/storage/factory_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,6 @@ func FactoryConfigFromEnvAndCLI(args []string, log io.Writer) FactoryConfig {
if spanStorageType == "" {
spanStorageType = cassandraStorageType
}
if spanStorageType == grpcPluginDeprecated {
fmt.Fprintf(log,
"WARNING: `%s` storage type is deprecated and will be remove from v1.60. Use `%s`.\n\n",
grpcPluginDeprecated, grpcStorageType,
)
spanStorageType = grpcStorageType
}
spanWriterTypes := strings.Split(spanStorageType, ",")
if len(spanWriterTypes) > 1 {
fmt.Fprintf(log,
Expand Down
9 changes: 0 additions & 9 deletions ports/ports.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,6 @@ func PortToHostPort(port int) string {
return ":" + strconv.Itoa(port)
}

// GetAddressFromCLIOptions gets listening address based on port (deprecated flags) or host:port (new flags)
func GetAddressFromCLIOptions(port int, hostPort string) string {
if port != 0 {
return PortToHostPort(port)
}

return FormatHostPort(hostPort)
}

// FormatHostPort returns hostPort in a usable format (host:port) if it wasn't already
func FormatHostPort(hostPort string) string {
if hostPort == "" {
Expand Down
21 changes: 0 additions & 21 deletions ports/ports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package ports

import (
"fmt"
"testing"

"github.com/stretchr/testify/assert"
Expand All @@ -27,26 +26,6 @@ func TestPortToHostPort(t *testing.T) {
assert.Equal(t, ":42", PortToHostPort(42))
}

func TestGetAddressFromCLIOptionsLegacy(t *testing.T) {
tests := []struct {
port int
hostPort string
out string
}{
{port: 123, hostPort: "", out: ":123"},
{port: 0, hostPort: "127.0.0.1:123", out: "127.0.0.1:123"},
{port: 0, hostPort: ":123", out: ":123"},
{port: 123, hostPort: "567", out: ":123"},
{port: 0, hostPort: "123", out: ":123"},
{port: 0, hostPort: "", out: ""},
}
for _, test := range tests {
t.Run(fmt.Sprintf("%+v", test), func(t *testing.T) {
assert.Equal(t, test.out, GetAddressFromCLIOptions(test.port, test.hostPort))
})
}
}

func TestFormatHostPort(t *testing.T) {
assert.Equal(t, ":42", FormatHostPort("42"))
assert.Equal(t, ":831", FormatHostPort(":831"))
Expand Down

0 comments on commit 45c96a3

Please sign in to comment.