// Resource doesn't exist yet - this is normal during initial creation when Grove is still creating the resources asynchronously
logger.V(1).Info("Grove resource not found yet, skipping scaling for now - will retry on next reconciliation","gvr",gvr,"name",resourceName,"namespace",namespace)
returnnil
}
}
returnerr
}
// reconcileGroveScaling handles scaling operations for Grove resources based on service replica changes
logger.Error(err,"Failed to get current scale - resource may not support scale subresource","gvr",gvr,"name",name,"namespace",namespace,"groupResource",gvr.GroupResource())
returnfmt.Errorf("failed to get current scale for %s %s (resource may not support scale subresource): %w",gvr.Resource,name,err)
}
ifreplicas<0{
returnfmt.Errorf("replicas must be >= 0, got %d",replicas)
}
ifcurrentScale.Spec.Replicas==replicas{
logger.V(1).Info("Resource already at desired replica count","gvr",gvr,"name",name,"replicas",replicas)