From 9f9501aeee34f5e08ae15df8668cad0c414ccdc1 Mon Sep 17 00:00:00 2001 From: Dhiraj Bokde Date: Thu, 7 Nov 2024 14:15:02 -0800 Subject: [PATCH] fix: fixed unexpected error logs from reading grpc container when it hasn't started, fixes RHOAIENG-15573 (#159) Signed-off-by: Dhiraj Bokde --- internal/controller/modelregistry_controller_status.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/controller/modelregistry_controller_status.go b/internal/controller/modelregistry_controller_status.go index 2247448..e0c0aef 100644 --- a/internal/controller/modelregistry_controller_status.go +++ b/internal/controller/modelregistry_controller_status.go @@ -65,7 +65,8 @@ const ( ReasonResourcesAvailable = "ResourcesAvailable" ReasonResourcesUnavailable = "ResourcesUnavailable" - grpcContainerName = "grpc-container" + grpcContainerName = "grpc-container" + containerCreatingReason = "ContainerCreating" ) // errRegexp is based on the CHECK_EQ macro output used by mlmd container. @@ -231,8 +232,8 @@ func (r *ModelRegistryReconciler) CheckPodStatus(ctx context.Context, req ctrl.R failedContainers := make(map[string]string) for _, s := range p.Status.ContainerStatuses { if !s.Ready { - // look for MLMD container errors - if s.Name == grpcContainerName { + // look for MLMD container errors, make sure it has also been created + if s.Name == grpcContainerName && s.State.Waiting != nil && s.State.Waiting.Reason != containerCreatingReason { // check container log for MLMD errors dbError, err := r.getGrpcContainerDBerror(ctx, p) if err != nil {