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)
| 306 | // updates annotations of corresponding deployments with the new organization name |
| 307 | // NOTE : this does not trigger reconcile. |
| 308 | func (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. |
no test coverage detected