func (s *StatusReconciler) Reconcile(ctx context.Context, req *ctrl.Request) (ctrl.Result, error) {
	if err := s.PFacts.Collect(ctx, s.Vdb); err != nil {
		return ctrl.Result{}, err
	}
	finder := MakeSubclusterFinder(s.Client, s.Vdb)
	subclusters, err := finder.FindSubclusters(ctx, FindAll)
	if err != nil {
		return ctrl.Result{}, err
	}
	refreshStatus := func(vdbChg *vapi.VerticaDB) error {
		vdbChg.Status.Subclusters = []vapi.SubclusterStatus{}
		for i := range subclusters {
			if i == len(vdbChg.Status.Subclusters) {
				vdbChg.Status.Subclusters = append(vdbChg.Status.Subclusters, vapi.SubclusterStatus{})
			}
			if err := s.calculateSubclusterStatus(ctx, subclusters[i], &vdbChg.Status.Subclusters[i]); err != nil {
				return fmt.Errorf("failed to calculate subcluster status %s %w", subclusters[i].Name, err)
			}
		}
		s.calculateClusterStatus(&vdbChg.Status)
		return nil
	}
	if err := status.Update(ctx, s.Client, s.Vdb, refreshStatus); err != nil {
		return ctrl.Result{}, err
	}
	return ctrl.Result{}, nil
}
Reconcile will update the status of the Vdb based on the pod facts
package controllers
import (
	"context"
	"fmt"
	"github.com/go-logr/logr"
	vapi "github.com/vertica/vertica-kubernetes/api/v1beta1"
	"github.com/vertica/vertica-kubernetes/pkg/names"
	"github.com/vertica/vertica-kubernetes/pkg/status"
	appsv1 "k8s.io/api/apps/v1"
	"k8s.io/apimachinery/pkg/api/errors"
	"k8s.io/apimachinery/pkg/runtime"
	ctrl "sigs.k8s.io/controller-runtime"
	"sigs.k8s.io/controller-runtime/pkg/client"
)
type StatusReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	Log    logr.Logger
	Vdb    *vapi.VerticaDB  
	PFacts *PodFacts
}
func MakeStatusReconciler(cli client.Client, scheme *runtime.Scheme, log logr.Logger,
	vdb *vapi.VerticaDB, pfacts *PodFacts) ReconcileActor {
	return &StatusReconciler{Client: cli, Scheme: scheme, Log: log, Vdb: vdb, PFacts: pfacts}
}