From 2f4364bfcc088139e130525a27141e48adb822f1 Mon Sep 17 00:00:00 2001 From: Roey Berman Date: Wed, 17 Jul 2024 10:29:53 -0700 Subject: [PATCH] Remove search attribute registration before starting every workflow (#94) --- loadgen/scenario.go | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/loadgen/scenario.go b/loadgen/scenario.go index 27f62b9..663d094 100644 --- a/loadgen/scenario.go +++ b/loadgen/scenario.go @@ -10,8 +10,6 @@ import ( "time" "github.com/temporalio/omes/loadgen/kitchensink" - "go.temporal.io/api/enums/v1" - "go.temporal.io/api/operatorservice/v1" "go.temporal.io/sdk/client" "go.uber.org/zap" ) @@ -199,33 +197,6 @@ func (r *Run) ExecuteKitchenSinkWorkflow(ctx context.Context, options *KitchenSi return fmt.Errorf("failed to start kitchen sink workflow: %w", err) } - // Ensure custom search attributes are registered - _, err = r.Client.OperatorService().AddSearchAttributes(ctx, &operatorservice.AddSearchAttributesRequest{ - SearchAttributes: map[string]enums.IndexedValueType{ - "KS_Keyword": enums.INDEXED_VALUE_TYPE_KEYWORD, - "KS_Int": enums.INDEXED_VALUE_TYPE_INT, - }, - Namespace: r.Namespace, - }) - - // Throw an error if the attributes could not be registered, but ignore already exists errs - alreadyExistsStrings := []string{ - "already exists", - "attributes mapping unavailble", - } - if err != nil { - isAlreadyExistsErr := false - for _, s := range alreadyExistsStrings { - if strings.Contains(err.Error(), s) { - isAlreadyExistsErr = true - break - } - } - if !isAlreadyExistsErr { - return fmt.Errorf("failed to register search attributes: %w", err) - } - } - clientSeq := options.Params.ClientSequence cancelCtx, cancel := context.WithCancel(ctx) defer cancel()