@@ -30,6 +30,7 @@ import (
3030 meta "k8s.io/apimachinery/pkg/apis/meta/v1"
3131
3232 api "github.com/arangodb/kube-arangodb/pkg/apis/deployment/v1"
33+ "github.com/arangodb/kube-arangodb/pkg/apis/shared"
3334 "github.com/arangodb/kube-arangodb/pkg/deployment/agency"
3435 "github.com/arangodb/kube-arangodb/pkg/deployment/patch"
3536 "github.com/arangodb/kube-arangodb/pkg/metrics"
@@ -288,6 +289,23 @@ func (r *Resources) InspectPods(ctx context.Context, cachedStatus inspectorInter
288289 }
289290 }
290291
292+ if k8sutil .IsContainerStarted (pod , shared .ServerContainerName ) {
293+ if memberStatus .Conditions .Update (api .ConditionTypeActive , true , "Core Pod Container started" , "" ) {
294+ updateMemberStatusNeeded = true
295+ nextInterval = nextInterval .ReduceTo (recheckSoonPodInspectorInterval )
296+ }
297+ }
298+
299+ if memberStatus .Conditions .IsTrue (api .ConditionTypeActive ) {
300+ if v , ok := pod .Labels [k8sutil .LabelKeyArangoActive ]; ! ok || v != k8sutil .LabelValueArangoActive {
301+ pod .Labels [k8sutil .LabelKeyArangoActive ] = k8sutil .LabelValueArangoActive
302+ if err := r .context .ApplyPatchOnPod (ctx , pod , patch .ItemReplace (patch .NewPath ("metadata" , "labels" ), pod .Labels )); err != nil {
303+ log .Str ("pod-name" , pod .GetName ()).Err (err ).Error ("Unable to update labels" )
304+ }
305+ }
306+
307+ }
308+
291309 if k8sutil .IsPodReady (pod ) && k8sutil .AreContainersReady (pod , coreContainers ) {
292310 // Pod is now ready
293311 if anyOf (memberStatus .Conditions .Update (api .ConditionTypeReady , true , "Pod Ready" , "" ),
0 commit comments