8000 [Improvement] Log pod names during inspection (#1555) · arangodb/kube-arangodb@d796697 · GitHub
[go: up one dir, main page]

Skip to content

Commit d796697

Browse files
[Improvement] Log pod names during inspection (#1555)
1 parent 73de8aa commit d796697

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pkg/deployment/resources/pod_inspector.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -115,10 +115,10 @@ func (r *Resources) InspectPods(ctx context.Context, cachedStatus inspectorInter
115115
if k8sutil.IsPodMarkedForDeletion(pod) && len(pod.GetFinalizers()) > 0 {
116116
// Strange, pod belongs to us, but we have no member for it.
117117
// Remove all finalizers, so it can be removed.
118-
log.Warn("Pod belongs to this deployment, but we don't know the member. Removing all finalizers")
118+
log.Str("pod", pod.GetName()).Warn("Pod belongs to this deployment, but we don't know the member. Removing all finalizers")
119119
_, err := k8sutil.RemovePodFinalizers(ctx, r.context.ACS().CurrentClusterCache(), cachedStatus.PodsModInterface().V1(), pod, pod.GetFinalizers(), false)
120120
if err != nil {
121-
log.Err(err).Debug("Failed to update pod (to remove all finalizers)")
121+
log.Str("pod", pod.GetName()).Err(err).Debug("Failed to update pod (to remove all finalizers)")
122122
return errors.WithStack(err)
123123
}
124124
}

pkg/deployment/resources/pvc_inspector.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// DISCLAIMER
33
//
4-
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
4+
// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany
55
//
66
// Licensed under the Apache License, Version 2.0 (the "License");
77
// you may not use this file except in compliance with the License.
@@ -76,10 +76,10 @@ func (r *Resources) InspectPVCs(ctx context.Context, cachedStatus inspectorInter
7676
if k8sutil.IsPersistentVolumeClaimMarkedForDeletion(pvc) && len(pvc.GetFinalizers()) > 0 {
7777
// Strange, pvc belongs to us, but we have no member for it.
7878
// Remove all finalizers, so it can be removed.
79-
log.Warn("PVC belongs to this deployment, but we don't know the member. Removing all finalizers")
79+
log.Str("pvc", pvc.GetName()).Warn("PVC belongs to this deployment, but we don't know the member. Removing all finalizers")
8080
_, err := k8sutil.RemovePVCFinalizers(ctx, r.context.ACS().CurrentClusterCache(), cachedStatus.PersistentVolumeClaimsModInterface().V1(), pvc, pvc.GetFinalizers(), false)
8181
if err != nil {
82-
log.Err(err).Debug("Failed to update PVC (to remove all finalizers)")
82+
log.Str("pvc", pvc.GetName()).Err(err).Debug("Failed to update PVC (to remove all finalizers)")
8383
return errors.WithStack(err)
8484
}
8585
}

0 commit comments

Comments
 (0)
0