From 95405d81e4c87c8113ccd7a95ba4d088b200a42a Mon Sep 17 00:00:00 2001 From: Steve Kuznetsov Date: Mon, 30 Oct 2023 15:11:37 -0600 Subject: [PATCH] registry/reconciler: allow current pods to be not ready 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 --- pkg/controller/registry/reconciler/grpc.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/controller/registry/reconciler/grpc.go b/pkg/controller/registry/reconciler/grpc.go index 4c1bca4c7d..80d49eccef 100644 --- a/pkg/controller/registry/reconciler/grpc.go +++ b/pkg/controller/registry/reconciler/grpc.go @@ -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