@@ -111,6 +111,20 @@ func (r *Resources) InspectPods(ctx context.Context, cachedStatus inspector.Insp
111111 // Pod has terminated with at least 1 container with a non-zero exit code.
112112 wasTerminated := memberStatus .Conditions .IsTrue (api .ConditionTypeTerminated )
113113 if memberStatus .Conditions .Update (api .ConditionTypeTerminated , true , "Pod Failed" , "" ) {
114+ if c , ok := k8sutil .GetContainerStatusByName (pod , k8sutil .ServerContainerName ); ok {
115+ if t := c .State .Terminated ; t != nil {
116+ log .Warn ().Str ("member" , memberStatus .ID ).
117+ Str ("pod" , pod .GetName ()).
118+ Str ("uid" , string (pod .GetUID ())).
119+ Int32 ("exit-code" , t .ExitCode ).
120+ Str ("reason" , t .Reason ).
121+ Str ("message" , t .Message ).
122+ Int32 ("signal" , t .Signal ).
123+ Time ("started" , t .StartedAt .Time ).
124+ Time ("finished" , t .FinishedAt .Time ).
125+ Msgf ("Pod failed in unexpected way" )
126+ }
127+ }
114128 log .Debug ().Str ("pod-name" , pod .GetName ()).Msg ("Updating member condition Terminated to true: Pod Failed" )
115129 updateMemberStatusNeeded = true
116130 nextInterval = nextInterval .ReduceTo (recheckSoonPodInspectorInterval )
0 commit comments