MCPcopy Create free account
hub / github.com/rilldata/rill / UpdateOrgDeploymentAnnotations

Method UpdateOrgDeploymentAnnotations

admin/projects.go:308–332  ·  view source on GitHub ↗

UpdateOrgDeploymentAnnotations iterates over projects of the given org and updates annotations of corresponding deployments with the new organization name NOTE : this does not trigger reconcile.

(ctx context.Context, org *database.Organization)

Source from the content-addressed store, hash-verified

306// updates annotations of corresponding deployments with the new organization name
307// NOTE : this does not trigger reconcile.
308func (s *Service) UpdateOrgDeploymentAnnotations(ctx context.Context, org *database.Organization) error {
309 limit := 10
310 afterProjectName := ""
311 for {
312 projs, err := s.DB.FindProjectsForOrganization(ctx, org.ID, afterProjectName, limit)
313 if err != nil {
314 return err
315 }
316
317 for _, proj := range projs {
318 err := s.UpdateDeploymentsForProject(ctx, proj)
319 if err != nil {
320 return err
321 }
322
323 afterProjectName = proj.Name
324 }
325
326 if len(projs) < limit {
327 break
328 }
329 }
330
331 return nil
332}
333
334// RedeployProject de-provisions and re-provisions a project's deployment.
335// If prevDepl is nil, it provisions a new prod deployment based on primary_branch.

Callers 2

UpdateOrganizationMethod · 0.80

Tested by

no test coverage detected