triggerDeploymentReconcileJob triggers a reconcile deployment job for the given deployment ID. For more details, see the comments in the ReconcileDeployment job.
(ctx context.Context, deploymentID string)
| 727 | // triggerDeploymentReconcileJob triggers a reconcile deployment job for the given deployment ID. |
| 728 | // For more details, see the comments in the ReconcileDeployment job. |
| 729 | func (s *Service) triggerDeploymentReconcileJob(ctx context.Context, deploymentID string) error { |
| 730 | // Trigger reconcile deployment job |
| 731 | _, err := s.Jobs.ReconcileDeployment(ctx, deploymentID) |
| 732 | if err != nil { |
| 733 | // If the job fails to be added, we update the deployment status to error. |
| 734 | ctx, cancel := context.WithTimeout(ctx, 10*time.Second) |
| 735 | defer cancel() |
| 736 | _, err2 := s.DB.UpdateDeploymentStatus(ctx, deploymentID, database.DeploymentStatusErrored, fmt.Sprintf("Failed to Trigger reconcile deployment job: %v", err)) |
| 737 | s.Logger.Error("failed to schedule reconcile deployment job", zap.String("deployment_id", deploymentID), zap.Error(err), observability.ZapCtx(ctx)) |
| 738 | return errors.Join(err, err2) |
| 739 | } |
| 740 | return nil |
| 741 | } |
| 742 | |
| 743 | func (s *Service) provisionRuntime(ctx context.Context, opts *provisionRuntimeOptions) (*database.ProvisionerResource, error) { |
| 744 | // Use default if no provisioner is specified. |
no test coverage detected