From 0e3927418982661fe99732b87e4fcfe9980ba640 Mon Sep 17 00:00:00 2001 From: Nikita Vaniasin Date: Mon, 16 Oct 2023 15:28:38 +0200 Subject: [PATCH 1/2] Print assigned node name to log when pod is scheduled --- CHANGELOG.md | 3 ++- pkg/deployment/resources/pod_inspector.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eab5c5ede..33a6ade24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Change Log ## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A) +- (Maintenance) Update go-driver to v1.6.0, update IsNotFound() checks +- (Improvement) Print assigned node name to log when pod is scheduled ## [1.2.34](https://github.com/arangodb/kube-arangodb/tree/1.2.34) (2023-10-16 - (Bugfix) Fix make manifests-crd-file command @@ -16,7 +18,6 @@ - (Maintenance) Make scale_down_candidate annotation obsolete - (Bugfix) Fix ResignJob ID propagation - (Bugfix) Allow shards with RF1 in EnforcedResignLeadership action -- (Maintenance) Update go-driver to v1.6.0, update IsNotFound() checks ## [1.2.33](https://github.com/arangodb/kube-arangodb/tree/1.2.33) (2023-09-27) - (Maintenance) Bump golang.org/x/net to v0.13.0 diff --git a/pkg/deployment/resources/pod_inspector.go b/pkg/deployment/resources/pod_inspector.go index 0eebbde2f..289234856 100644 --- a/pkg/deployment/resources/pod_inspector.go +++ b/pkg/deployment/resources/pod_inspector.go @@ -381,6 +381,7 @@ func (r *Resources) InspectPods(ctx context.Context, cachedStatus inspectorInter if k8sutil.IsPodScheduled(pod) { if memberStatus.Conditions.Update(api.ConditionTypeScheduled, true, "Pod is scheduled", "") { + log.Str("pod-name", pod.GetName()).Str("node", pod.Spec.NodeName).Debug("Member has been scheduled") updateMemberStatusNeeded = true nextInterval = nextInterval.ReduceTo(recheckSoonPodInspectorInterval) } From a21547dd321fff1c14e64a1dd329570dd0ce1abe Mon Sep 17 00:00:00 2001 From: Nikita Vaniasin Date: Tue, 17 Oct 2023 14:37:23 +0200 Subject: [PATCH 2/2] Use info, add to condition msg, fix changelog after auto-merge --- CHANGELOG.md | 2 +- pkg/deployment/resources/pod_inspector.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33a6ade24..cb711f034 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## [master](https://github.com/arangodb/kube-arangodb/tree/master) (N/A) - (Maintenance) Update go-driver to v1.6.0, update IsNotFound() checks -- (Improvement) Print assigned node name to log when pod is scheduled +- (Improvement) Print assigned node name to log and condition message when pod is scheduled ## [1.2.34](https://github.com/arangodb/kube-arangodb/tree/1.2.34) (2023-10-16 - (Bugfix) Fix make manifests-crd-file command diff --git a/pkg/deployment/resources/pod_inspector.go b/pkg/deployment/resources/pod_inspector.go index 289234856..607cd2776 100644 --- a/pkg/deployment/resources/pod_inspector.go +++ b/pkg/deployment/resources/pod_inspector.go @@ -380,8 +380,9 @@ func (r *Resources) InspectPods(ctx context.Context, cachedStatus inspectorInter } if k8sutil.IsPodScheduled(pod) { - if memberStatus.Conditions.Update(api.ConditionTypeScheduled, true, "Pod is scheduled", "") { - log.Str("pod-name", pod.GetName()).Str("node", pod.Spec.NodeName).Debug("Member has been scheduled") + msg := fmt.Sprintf("Assigned to node %s", pod.Spec.NodeName) + if memberStatus.Conditions.Update(api.ConditionTypeScheduled, true, "Pod is scheduled", msg) { + log.Str("pod-name", pod.GetName()).Str("node", pod.Spec.NodeName).Info("Member has been scheduled") updateMemberStatusNeeded = true nextInterval = nextInterval.ReduceTo(recheckSoonPodInspectorInterval) }