433
}
434
435
>
func (d *VersionWorkflowRunner) validateUpdateVersionComputeConfig(args *deploymentspb.UpdateComputeConfigArgs) error {
version_workflow.go
436
>
return d.ensureNotDeleted()
437
>
}
438
439
>
func (d *VersionWorkflowRunner) handleUpdateVersionComputeConfig(ctx workflow.Context, args *deploymentspb.UpdateComputeConfigArgs) (*deploymentspb.UpdateComputeConfigResponse, error) {
version_workflow.go
440
>
if err := d.preUpdateChecks(ctx); err != nil {
441
return nil, err
442
}
443
445
d.logger.Error("Could not acquire compute config lock in version workflow", "error", err)
446
return nil, err
447
}
449
>
450
>
// Update or delete the Worker Controller Instance based on the new config.
451
>
apiVersion := &deploymentpb.WorkerDeploymentVersion{
452
>
DeploymentName: d.VersionState.Version.DeploymentName,
453
>
BuildId: d.VersionState.Version.BuildId,
454
>
}
455
>
activityCtx := workflow.WithActivityOptions(ctx, defaultActivityOptions)
456
>
var computeConfigSummary *computepb.ComputeConfigSummary
457
>
err := workflow.ExecuteActivity(activityCtx, d.a.UpdateWorkerControllerInstance, &deploymentspb.UpdateWorkerControllerInstanceInput{
458
>
Version: apiVersion,
459
>
Identity: args.GetIdentity(),
460
>
UpsertScalingGroups: args.GetUpsertScalingGroups(),
461
>
RemoveScalingGroups: args.GetRemoveScalingGroups(),
462
>
}).Get(ctx, &computeConfigSummary)
463
>
if err != nil {
464
var appErr *temporal.ApplicationError
465
if errors.As(err, &appErr) && appErr.Type() == errInvalidComputeConfig {