From 7995f5d8764c10cdae5ecebc9db843b83e6fbd61 Mon Sep 17 00:00:00 2001 From: Shivam Kumar Singh Date: Mon, 12 Jun 2023 08:05:11 +0000 Subject: [PATCH 1/2] Add default ports for HTTP and gRPC Signed-off-by: Shivam Kumar Singh --- pkg/standalone/run.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/standalone/run.go b/pkg/standalone/run.go index 2e6d1ccd3..d4317a59f 100644 --- a/pkg/standalone/run.go +++ b/pkg/standalone/run.go @@ -50,8 +50,8 @@ type RunConfig struct { AppID string `env:"APP_ID" arg:"app-id" yaml:"appID"` AppChannelAddress string `env:"APP_CHANNEL_ADDRESS" arg:"app-channel-address" ifneq:"127.0.0.1" yaml:"appChannelAddress"` AppPort int `env:"APP_PORT" arg:"app-port" yaml:"appPort" default:"-1"` - HTTPPort int `env:"DAPR_HTTP_PORT" arg:"dapr-http-port" yaml:"daprHTTPPort" default:"-1"` - GRPCPort int `env:"DAPR_GRPC_PORT" arg:"dapr-grpc-port" yaml:"daprGRPCPort" default:"-1"` + HTTPPort int `env:"DAPR_HTTP_PORT" arg:"dapr-http-port" yaml:"daprHTTPPort" default:"3500"` + GRPCPort int `env:"DAPR_GRPC_PORT" arg:"dapr-grpc-port" yaml:"daprGRPCPort" default:"50001"` ProfilePort int `arg:"profile-port" yaml:"profilePort" default:"-1"` Command []string `yaml:"command"` MetricsPort int `env:"DAPR_METRICS_PORT" arg:"metrics-port" yaml:"metricsPort" default:"-1"` From 46fdf204bc202d984b2853fb8929d06104fa3f0f Mon Sep 17 00:00:00 2001 From: Shivam Kumar Singh Date: Tue, 6 Jun 2023 04:52:12 +0000 Subject: [PATCH 2/2] Add test Signed-off-by: Shivam Kumar Singh --- pkg/runexec/runexec_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/runexec/runexec_test.go b/pkg/runexec/runexec_test.go index 377124e62..fb93995fc 100644 --- a/pkg/runexec/runexec_test.go +++ b/pkg/runexec/runexec_test.go @@ -301,8 +301,8 @@ func TestRun(t *testing.T) { basicConfig.SetDefaultFromSchema() assert.Equal(t, -1, basicConfig.AppPort) - assert.True(t, basicConfig.HTTPPort == -1) - assert.True(t, basicConfig.GRPCPort == -1) + assert.True(t, basicConfig.HTTPPort == 3500) + assert.True(t, basicConfig.GRPCPort == 50001) assert.True(t, basicConfig.MetricsPort == -1) assert.True(t, basicConfig.ProfilePort == -1) assert.True(t, basicConfig.EnableProfiling)