Skip to content

Commit 522eb32

Browse files
committed
Change default listen-address from 0.0.0.0 to empty string to allow
for default ipv6 support and keep backwards compat. Signed-off-by: joshvanl <[email protected]>
1 parent 105011f commit 522eb32

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

cmd/daprd/options/options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ func New(origArgs []string) (*Options, error) {
119119
fs.StringVar(&opts.DaprHTTPPort, "dapr-http-port", strconv.Itoa(runtime.DefaultDaprHTTPPort), "HTTP port for Dapr API to listen on")
120120
fs.StringVar(&opts.DaprAPIListenAddresses, "dapr-listen-addresses", runtime.DefaultAPIListenAddress, "One or more addresses for the Dapr API to listen on, CSV limited")
121121
fs.StringVar(&opts.DaprPublicPort, "dapr-public-port", "", "Public port for Dapr Health and Metadata to listen on")
122-
fs.StringVar(&opts.DaprPublicListenAddress, "dapr-public-listen-address", "0.0.0.0", "Public listen address for Dapr Health and Metadata")
122+
fs.StringVar(&opts.DaprPublicListenAddress, "dapr-public-listen-address", "", "Public listen address for Dapr Health and Metadata")
123123
fs.StringVar(&opts.DaprAPIGRPCPort, "dapr-grpc-port", strconv.Itoa(runtime.DefaultDaprAPIGRPCPort), "gRPC port for the Dapr API to listen on")
124124
fs.StringVar(&opts.DaprInternalGRPCPort, "dapr-internal-grpc-port", "", "gRPC port for the Dapr Internal API to listen on")
125-
fs.StringVar(&opts.DaprInternalGRPCListenAddress, "dapr-internal-grpc-listen-address", "0.0.0.0", "gRPC listen address for the Dapr Internal API")
125+
fs.StringVar(&opts.DaprInternalGRPCListenAddress, "dapr-internal-grpc-listen-address", "", "gRPC listen address for the Dapr Internal API")
126126
fs.StringVar(&opts.AppPort, "app-port", "", "The port the application is listening on")
127127
fs.StringVar(&opts.ProfilePort, "profile-port", strconv.Itoa(runtime.DefaultProfilePort), "The port for the profile server")
128128
fs.StringVar(&opts.AppProtocol, "app-protocol", string(protocol.HTTPProtocol), "Protocol for the application: grpc, grpcs, http, https, h2c")

cmd/injector/options/options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ func New(origArgs []string) *Options {
5656
fs.SortFlags = true
5757

5858
fs.IntVar(&opts.HealthzPort, "healthz-port", 8080, "The port used for health checks")
59-
fs.StringVar(&opts.HealthzListenAddress, "healthz-listen-address", "0.0.0.0", "The listening address for the healthz server")
59+
fs.StringVar(&opts.HealthzListenAddress, "healthz-listen-address", "", "The listening address for the healthz server")
6060
fs.IntVar(&opts.Port, "port", 4000, "The port used for the injector service")
61-
fs.StringVar(&opts.ListenAddress, "listen-address", "0.0.0.0", "The listen address for the injector service")
61+
fs.StringVar(&opts.ListenAddress, "listen-address", "", "The listen address for the injector service")
6262

6363
if home := homedir.HomeDir(); home != "" {
6464
fs.StringVar(&opts.Kubeconfig, "kubeconfig", filepath.Join(home, ".kube", "config"), "(optional) absolute path to the kubeconfig file")

cmd/operator/options/options.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ func New() *Options {
8282
flag.StringVar(&opts.TrustAnchorsFile, "trust-anchors-file", securityConsts.ControlPlaneDefaultTrustAnchorsPath, "Filepath to the trust anchors for the Dapr control plane")
8383

8484
flag.IntVar(&opts.APIPort, "port", 6500, "The port for the operator API server to listen on")
85-
flag.StringVar(&opts.APIListenAddress, "listen-address", "0.0.0.0", "The listening address for the operator API server")
85+
flag.StringVar(&opts.APIListenAddress, "listen-address", "", "The listening address for the operator API server")
8686
flag.IntVar(&opts.HealthzPort, "healthz-port", 8080, "The port for the healthz server to listen on")
87-
flag.StringVar(&opts.HealthzListenAddress, "healthz-listen-address", "0.0.0.0", "The listening address for the healthz server")
87+
flag.StringVar(&opts.HealthzListenAddress, "healthz-listen-address", "", "The listening address for the healthz server")
8888
flag.IntVar(&opts.WebhookServerPort, "webhook-server-port", 19443, "The port for the webhook server to listen on")
89-
flag.StringVar(&opts.WebhookServerListenAddress, "webhook-server-listen-address", "0.0.0.0", "The listening address for the webhook server")
89+
flag.StringVar(&opts.WebhookServerListenAddress, "webhook-server-listen-address", "", "The listening address for the webhook server")
9090

9191
opts.Logger = logger.DefaultOptions()
9292
opts.Logger.AttachCmdFlags(flag.StringVar, flag.BoolVar)

cmd/placement/options/options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ func New(origArgs []string) *Options {
9898
fs.BoolVar(&opts.RaftInMemEnabled, "inmem-store-enabled", true, "Enable in-memory log and snapshot store unless --raft-logstore-path is set")
9999
fs.StringVar(&opts.RaftLogStorePath, "raft-logstore-path", "", "raft log store path.")
100100
fs.IntVar(&opts.PlacementPort, "port", defaultPlacementPort, "sets the gRPC port for the placement service")
101-
fs.StringVar(&opts.PlacementListenAddress, "listen-address", "0.0.0.0", "The listening address for the placement service")
101+
fs.StringVar(&opts.PlacementListenAddress, "listen-address", "", "The listening address for the placement service")
102102
fs.IntVar(&opts.HealthzPort, "healthz-port", defaultHealthzPort, "sets the HTTP port for the healthz server")
103-
fs.StringVar(&opts.HealthzListenAddress, "healthz-listen-address", "0.0.0.0", "The listening address for the healthz server")
103+
fs.StringVar(&opts.HealthzListenAddress, "healthz-listen-address", "", "The listening address for the healthz server")
104104
fs.BoolVar(&opts.TLSEnabled, "tls-enabled", false, "Should TLS be enabled for the placement gRPC server")
105105
fs.BoolVar(&opts.MetadataEnabled, "metadata-enabled", opts.MetadataEnabled, "Expose the placement tables on the healthz server")
106106
fs.IntVar(&opts.MaxAPILevel, "max-api-level", 10, "If set to >= 0, causes the reported 'api-level' in the cluster to never exceed this value")

cmd/sentry/options/options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ func New(origArgs []string) *Options {
7878
fs.StringVar(&opts.IssuerKeyFilename, "issuer-key-filename", config.DefaultIssuerKeyFilename, "Issuer private key filename")
7979
fs.StringVar(&opts.TrustDomain, "trust-domain", "localhost", "The CA trust domain")
8080
fs.IntVar(&opts.Port, "port", config.DefaultPort, "The port for the sentry server to listen on")
81-
fs.StringVar(&opts.ListenAddress, "listen-address", "0.0.0.0", "The listen address for the sentry server")
81+
fs.StringVar(&opts.ListenAddress, "listen-address", "", "The listen address for the sentry server")
8282
fs.IntVar(&opts.HealthzPort, "healthz-port", 8080, "The port for the healthz server to listen on")
83-
fs.StringVar(&opts.HealthzListenAddress, "healthz-listen-address", "0.0.0.0", "The listening address for the healthz server")
83+
fs.StringVar(&opts.HealthzListenAddress, "healthz-listen-address", "", "The listening address for the healthz server")
8484

8585
if home := homedir.HomeDir(); home != "" {
8686
fs.StringVar(&opts.Kubeconfig, "kubeconfig", filepath.Join(home, ".kube", "config"), "(optional) absolute path to the kubeconfig file")

0 commit comments

Comments
 (0)