Skip to content

Commit

Permalink
registry/reconciler: allow current pods to be not ready
Browse files Browse the repository at this point in the history
A good chunk of this logic is fatally flawed - it would be much more
simple to manage a Deployment and use server-side apply to ensure that
the current server state always matched the desired state, but that
would be a large refactor and who knows how many other things are
loosely coupled here. This is the smallest change that allows for the
current serving pod to not yet have a running catalog server.

Signed-off-by: Steve Kuznetsov <[email protected]>
  • Loading branch information
stevekuznetsov committed Oct 30, 2023
1 parent 2a90171 commit 95405d8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/controller/registry/reconciler/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,15 @@ func (c *GrpcRegistryReconciler) createUpdatePod(source grpcCatalogSourceDecorat
func imageChanged(updatePod *corev1.Pod, servingPods []*corev1.Pod) bool {
updatedCatalogSourcePodImageID := imageID(updatePod)
if updatedCatalogSourcePodImageID == "" {
logrus.WithField("CatalogSource", updatePod.GetName()).Warn("pod status unknown, cannot get the pod's imageID")
logrus.WithField("CatalogSource", updatePod.GetName()).Warn("pod status unknown, cannot get the updated pod's imageID")
return false
}
for _, servingPod := range servingPods {
servingCatalogSourcePodImageID := imageID(servingPod)
if servingCatalogSourcePodImageID == "" {
logrus.WithField("CatalogSource", servingPod.GetName()).Warn("pod status unknown, cannot get the current pod's imageID")
return false
}
if updatedCatalogSourcePodImageID != servingCatalogSourcePodImageID {
logrus.WithField("CatalogSource", servingPod.GetName()).Infof("catalog image changed: serving pod %s update pod %s", servingCatalogSourcePodImageID, updatedCatalogSourcePodImageID)
return true
Expand Down

0 comments on commit 95405d8

Please sign in to comment.