Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(config): only set frontend HTTP port if not nil #561

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion internal/resource/config/configmap_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ func (b *ConfigmapBuilder) Update(object client.Object) error {
RPC: config.RPC{
GRPCPort: *b.instance.Spec.Services.Frontend.Port,
MembershipPort: *b.instance.Spec.Services.Frontend.MembershipPort,
HTTPPort: *b.instance.Spec.Services.Frontend.HTTPPort,
BindOnLocalHost: false,
BindOnIP: "0.0.0.0",
},
Expand Down Expand Up @@ -292,6 +291,16 @@ func (b *ConfigmapBuilder) Update(object client.Object) error {
}
}

// Temporal >= 1.22 provides HTTP endpoint for the frontend
if b.instance.Spec.Version.GreaterOrEqual(version.V1_22_0) &&
b.instance.Spec.Services.Frontend.HTTPPort != nil {
frontend, ok := temporalCfg.Services[string(primitives.FrontendService)]
if ok {
frontend.RPC.HTTPPort = *b.instance.Spec.Services.Frontend.HTTPPort
temporalCfg.Services[string(primitives.FrontendService)] = frontend
}
}

if b.instance.Spec.DynamicConfig != nil {
temporalCfg.DynamicConfigClient = &dynamicconfig.FileBasedClientConfig{
Filepath: "/etc/temporal/config/dynamic_config.yaml",
Expand Down
1 change: 1 addition & 0 deletions pkg/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ var (
V1_18_0 = MustNewVersionFromString("1.18.0") //nolint:stylecheck,revive
V1_20_0 = MustNewVersionFromString("1.20.0") //nolint:stylecheck,revive
V1_21_0 = MustNewVersionFromString("1.21.0") //nolint:stylecheck,revive
V1_22_0 = MustNewVersionFromString("1.22.0") //nolint:stylecheck,revive
)

// Version is a wrapper around semver.Version which supports correct
Expand Down