Skip to content

Commit

Permalink
Change default listen-address from 0.0.0.0 to empty string to allow
Browse files Browse the repository at this point in the history
for default ipv6 support and keep backwards compat.

Signed-off-by: joshvanl <[email protected]>
  • Loading branch information
JoshVanL committed May 6, 2024
1 parent 105011f commit 522eb32
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions cmd/daprd/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ func New(origArgs []string) (*Options, error) {
fs.StringVar(&opts.DaprHTTPPort, "dapr-http-port", strconv.Itoa(runtime.DefaultDaprHTTPPort), "HTTP port for Dapr API to listen on")
fs.StringVar(&opts.DaprAPIListenAddresses, "dapr-listen-addresses", runtime.DefaultAPIListenAddress, "One or more addresses for the Dapr API to listen on, CSV limited")
fs.StringVar(&opts.DaprPublicPort, "dapr-public-port", "", "Public port for Dapr Health and Metadata to listen on")
fs.StringVar(&opts.DaprPublicListenAddress, "dapr-public-listen-address", "0.0.0.0", "Public listen address for Dapr Health and Metadata")
fs.StringVar(&opts.DaprPublicListenAddress, "dapr-public-listen-address", "", "Public listen address for Dapr Health and Metadata")
fs.StringVar(&opts.DaprAPIGRPCPort, "dapr-grpc-port", strconv.Itoa(runtime.DefaultDaprAPIGRPCPort), "gRPC port for the Dapr API to listen on")
fs.StringVar(&opts.DaprInternalGRPCPort, "dapr-internal-grpc-port", "", "gRPC port for the Dapr Internal API to listen on")
fs.StringVar(&opts.DaprInternalGRPCListenAddress, "dapr-internal-grpc-listen-address", "0.0.0.0", "gRPC listen address for the Dapr Internal API")
fs.StringVar(&opts.DaprInternalGRPCListenAddress, "dapr-internal-grpc-listen-address", "", "gRPC listen address for the Dapr Internal API")
fs.StringVar(&opts.AppPort, "app-port", "", "The port the application is listening on")
fs.StringVar(&opts.ProfilePort, "profile-port", strconv.Itoa(runtime.DefaultProfilePort), "The port for the profile server")
fs.StringVar(&opts.AppProtocol, "app-protocol", string(protocol.HTTPProtocol), "Protocol for the application: grpc, grpcs, http, https, h2c")
Expand Down
4 changes: 2 additions & 2 deletions cmd/injector/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ func New(origArgs []string) *Options {
fs.SortFlags = true

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

if home := homedir.HomeDir(); home != "" {
fs.StringVar(&opts.Kubeconfig, "kubeconfig", filepath.Join(home, ".kube", "config"), "(optional) absolute path to the kubeconfig file")
Expand Down
6 changes: 3 additions & 3 deletions cmd/operator/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ func New() *Options {
flag.StringVar(&opts.TrustAnchorsFile, "trust-anchors-file", securityConsts.ControlPlaneDefaultTrustAnchorsPath, "Filepath to the trust anchors for the Dapr control plane")

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

opts.Logger = logger.DefaultOptions()
opts.Logger.AttachCmdFlags(flag.StringVar, flag.BoolVar)
Expand Down
4 changes: 2 additions & 2 deletions cmd/placement/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ func New(origArgs []string) *Options {
fs.BoolVar(&opts.RaftInMemEnabled, "inmem-store-enabled", true, "Enable in-memory log and snapshot store unless --raft-logstore-path is set")
fs.StringVar(&opts.RaftLogStorePath, "raft-logstore-path", "", "raft log store path.")
fs.IntVar(&opts.PlacementPort, "port", defaultPlacementPort, "sets the gRPC port for the placement service")
fs.StringVar(&opts.PlacementListenAddress, "listen-address", "0.0.0.0", "The listening address for the placement service")
fs.StringVar(&opts.PlacementListenAddress, "listen-address", "", "The listening address for the placement service")
fs.IntVar(&opts.HealthzPort, "healthz-port", defaultHealthzPort, "sets the HTTP port for the healthz server")
fs.StringVar(&opts.HealthzListenAddress, "healthz-listen-address", "0.0.0.0", "The listening address for the healthz server")
fs.StringVar(&opts.HealthzListenAddress, "healthz-listen-address", "", "The listening address for the healthz server")
fs.BoolVar(&opts.TLSEnabled, "tls-enabled", false, "Should TLS be enabled for the placement gRPC server")
fs.BoolVar(&opts.MetadataEnabled, "metadata-enabled", opts.MetadataEnabled, "Expose the placement tables on the healthz server")
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")
Expand Down
4 changes: 2 additions & 2 deletions cmd/sentry/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ func New(origArgs []string) *Options {
fs.StringVar(&opts.IssuerKeyFilename, "issuer-key-filename", config.DefaultIssuerKeyFilename, "Issuer private key filename")
fs.StringVar(&opts.TrustDomain, "trust-domain", "localhost", "The CA trust domain")
fs.IntVar(&opts.Port, "port", config.DefaultPort, "The port for the sentry server to listen on")
fs.StringVar(&opts.ListenAddress, "listen-address", "0.0.0.0", "The listen address for the sentry server")
fs.StringVar(&opts.ListenAddress, "listen-address", "", "The listen address for the sentry server")
fs.IntVar(&opts.HealthzPort, "healthz-port", 8080, "The port for the healthz server to listen on")
fs.StringVar(&opts.HealthzListenAddress, "healthz-listen-address", "0.0.0.0", "The listening address for the healthz server")
fs.StringVar(&opts.HealthzListenAddress, "healthz-listen-address", "", "The listening address for the healthz server")

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

0 comments on commit 522eb32

Please sign in to comment.