updateProjectConfig updates the project config for the given instance. This does the same operation as ProjectParserReconciler's reconcileProjectConfig and is done before starting the controller to ensure that when controller first starts, it doesn’t immediately restart due to changed variables
(iwc *instanceWithController)
| 613 | // This does the same operation as ProjectParserReconciler's reconcileProjectConfig and is done before starting the controller |
| 614 | // to ensure that when controller first starts, it doesn’t immediately restart due to changed variables |
| 615 | func (r *registryCache) updateProjectConfig(iwc *instanceWithController) error { |
| 616 | repo, release, err := r.rt.Repo(iwc.ctx, iwc.instanceID) |
| 617 | if err != nil { |
| 618 | return err |
| 619 | } |
| 620 | defer release() |
| 621 | |
| 622 | instance, err := r.get(iwc.instanceID) |
| 623 | if err != nil { |
| 624 | return err |
| 625 | } |
| 626 | |
| 627 | cfg, err := instance.Config() |
| 628 | if err != nil { |
| 629 | return err |
| 630 | } |
| 631 | p, err := parser.Parse(iwc.ctx, repo, iwc.instanceID, instance.Environment, instance.OLAPConnector, cfg.StrictResolverProps) |
| 632 | if err != nil { |
| 633 | return err |
| 634 | } |
| 635 | |
| 636 | if p.RillYAML == nil { |
| 637 | // Empty project |
| 638 | return nil |
| 639 | } |
| 640 | |
| 641 | return r.rt.UpdateInstanceWithRillYAML(iwc.ctx, iwc.instanceID, p, false) |
| 642 | } |
| 643 | |
| 644 | func sizeOfDir(path string) int64 { |
| 645 | var size int64 |
no test coverage detected