diff --git a/cmd/server/main.go b/cmd/server/main.go index a00c04131a03..1c572afec20f 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -33,6 +33,7 @@ import ( _ "time/tzdata" // embed tzdata as a fallback "github.com/urfave/cli/v2" + "golang.org/x/exp/slices" "go.temporal.io/server/common/authorization" "go.temporal.io/server/common/build" @@ -45,6 +46,7 @@ import ( _ "go.temporal.io/server/common/persistence/sql/sqlplugin/mysql" // needed to load mysql plugin _ "go.temporal.io/server/common/persistence/sql/sqlplugin/postgresql" // needed to load postgresql plugin _ "go.temporal.io/server/common/persistence/sql/sqlplugin/sqlite" // needed to load sqlite plugin + "go.temporal.io/server/common/primitives" "go.temporal.io/server/temporal" ) @@ -139,6 +141,15 @@ func buildCLI() *cli.App { return cli.Exit(fmt.Sprintf("Unable to load configuration: %v.", err), 1) } + if !c.IsSet("service") && !c.IsSet("services") { + if _, ok := cfg.Services[string(primitives.InternalFrontendService)]; !ok { + // --services is using default value (all services) but internal-frontend + // is missing from config. in that case, remove it. + i := slices.Index(services, string(primitives.InternalFrontendService)) + services = slices.Delete(services, i, i+1) + } + } + logger := log.NewZapLogger(log.BuildZapLogger(cfg.Log)) logger.Info("Build info.", tag.NewTimeTag("git-time", build.InfoData.GitTime),