Skip to content

Commit a34f1c1

Browse files
robcaozroubalik
andauthored
temporal: always set temporal-namespace header on requests (#7079) (#7080)
* temporal: always set temporal-namespace header on requests (#7079) Signed-off-by: Robert Cao <robert.cao@relativity.com> * changelog Signed-off-by: Robert Cao <robert.cao@relativity.com> * fix: reorder changelog Signed-off-by: Robert Cao <robert.cao@relativity.com> --------- Signed-off-by: Robert Cao <robert.cao@relativity.com> Signed-off-by: Zbynek Roubalik <zroubalik@gmail.com> Co-authored-by: Zbynek Roubalik <zroubalik@gmail.com>
1 parent 8094e26 commit a34f1c1

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ To learn more about active deprecations, we recommend checking [GitHub Discussio
9292
- **Github Scaler**: Add support to control unlabeled job/runner matching ([#6900](https://github.com/kedacore/keda/issues/6900))
9393
- **Metrics API Scaler**: Support AuthParams for authMode ([#6939](https://github.com/kedacore/keda/issues/6939))
9494
- **Metrics API Scaler**: Support multiple auth methods simultaneously ([#6642](https://github.com/kedacore/keda/issues/6642))
95+
- **Temporal Scaler**: Always set `temporal-namespace` header on requests([#7079](https://github.com/kedacore/keda/issues/7079))
9596
- **Temporal Scaler**: Support custom tlsServerName ([#6820](https://github.com/kedacore/keda/pull/6820))
9697

9798
### Fixes

‎pkg/scalers/temporal_scaler.go‎

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -210,23 +210,24 @@ func getTemporalClient(ctx context.Context, meta *temporalMetadata, log logr.Log
210210
}),
211211
}
212212

213+
dialOptions = append(dialOptions, grpc.WithUnaryInterceptor(
214+
func(ctx context.Context, method string, req any, reply any,
215+
cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption,
216+
) error {
217+
return invoker(
218+
metadata.AppendToOutgoingContext(ctx, "temporal-namespace", meta.Namespace),
219+
method,
220+
req,
221+
reply,
222+
cc,
223+
opts...,
224+
)
225+
},
226+
))
227+
213228
var tlsConfig *tls.Config
214229

215230
if meta.APIKey != "" {
216-
dialOptions = append(dialOptions, grpc.WithUnaryInterceptor(
217-
func(ctx context.Context, method string, req any, reply any,
218-
cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption,
219-
) error {
220-
return invoker(
221-
metadata.AppendToOutgoingContext(ctx, "temporal-namespace", meta.Namespace),
222-
method,
223-
req,
224-
reply,
225-
cc,
226-
opts...,
227-
)
228-
},
229-
))
230231
options.Credentials = sdk.NewAPIKeyStaticCredentials(meta.APIKey)
231232
tlsConfig = &tls.Config{
232233
MinVersion: kedautil.GetMinTLSVersion(),

0 commit comments

Comments
 (0)