@@ -14,6 +14,7 @@ import (
1414
1515 "connectrpc.com/connect"
1616 semver "github.com/Masterminds/semver/v3"
17+ "github.com/flyteorg/flyte/v2/gen/go/flyteidl2/settings"
1718 "golang.org/x/sync/errgroup"
1819 "google.golang.org/protobuf/proto"
1920 "google.golang.org/protobuf/types/known/timestamppb"
@@ -40,6 +41,7 @@ import (
4041// RunService implements the RunServiceHandler interface
4142type RunService struct {
4243 repo interfaces.Repository
44+ settingsRepo interfaces.SettingsRepo
4345 actionsClient actionsconnect.ActionsServiceClient
4446 projectClient projectconnect.ProjectServiceClient
4547 storagePrefix string
@@ -143,6 +145,7 @@ func (s *RunService) WatchGroups(ctx context.Context, req *connect.Request[workf
143145// NewRunService creates a new RunService instance
144146func NewRunService (
145147 repo interfaces.Repository ,
148+ settingsRepo interfaces.SettingsRepo ,
146149 actionsClient actionsconnect.ActionsServiceClient ,
147150 projectClient projectconnect.ProjectServiceClient ,
148151 storagePrefix string ,
@@ -154,6 +157,7 @@ func NewRunService(
154157) * RunService {
155158 return & RunService {
156159 repo : repo ,
160+ settingsRepo : settingsRepo ,
157161 actionsClient : actionsClient ,
158162 projectClient : projectClient ,
159163 storagePrefix : storagePrefix ,
@@ -276,6 +280,19 @@ func (s *RunService) CreateRun(
276280 }
277281 request .RunSpec = runSpec
278282
283+ // Settings sit between an explicit request value and the static config defaults
284+ // applied below. Org is empty when the caller passed a ProjectId rather than a
285+ // RunId; the storage key encoder normalizes that to the default org.
286+ resolved , err := resolveSettings (ctx , s .settingsRepo , & settings.SettingsKey {
287+ Org : runId .GetOrg (),
288+ Domain : runId .GetDomain (),
289+ Project : runId .GetProject (),
290+ })
291+ if err != nil {
292+ return nil , connect .NewError (connect .CodeInternal , err )
293+ }
294+ applyRunSettings (runSpec , resolved )
295+
279296 // Stamp the run start time, but only for SDKs that understand it (>= 2.3.6) — older task
280297 // templates have no {{.runStartTime}} placeholder, so leaving it unset keeps the executor from
281298 // substituting anything. The scheduler sets CreateRunRequest.run_start_time to a trigger's
0 commit comments