1
0
Fork 0
mirror of https://github.com/arangodb/kube-arangodb.git synced 2024-12-14 11:57:37 +00:00

[Improvement] Log pod names during inspection (#1555)

This commit is contained in:
Nikita Vaniasin 2024-01-09 18:23:26 +01:00 committed by GitHub
parent 73de8aa7b2
commit d796697314
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -1,7 +1,7 @@
//
// DISCLAIMER
//
// Copyright 2016-2023 ArangoDB GmbH, Cologne, Germany
// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// 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
if k8sutil.IsPodMarkedForDeletion(pod) && len(pod.GetFinalizers()) > 0 {
// Strange, pod belongs to us, but we have no member for it.
// Remove all finalizers, so it can be removed.
log.Warn("Pod belongs to this deployment, but we don't know the member. Removing all finalizers")
log.Str("pod", pod.GetName()).Warn("Pod belongs to this deployment, but we don't know the member. Removing all finalizers")
_, err := k8sutil.RemovePodFinalizers(ctx, r.context.ACS().CurrentClusterCache(), cachedStatus.PodsModInterface().V1(), pod, pod.GetFinalizers(), false)
if err != nil {
log.Err(err).Debug("Failed to update pod (to remove all finalizers)")
log.Str("pod", pod.GetName()).Err(err).Debug("Failed to update pod (to remove all finalizers)")
return errors.WithStack(err)
}
}

View file

@ -1,7 +1,7 @@
//
// DISCLAIMER
//
// Copyright 2016-2022 ArangoDB GmbH, Cologne, Germany
// Copyright 2016-2024 ArangoDB GmbH, Cologne, Germany
//
// Licensed under the Apache License, Version 2.0 (the "License");
// 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
if k8sutil.IsPersistentVolumeClaimMarkedForDeletion(pvc) && len(pvc.GetFinalizers()) > 0 {
// Strange, pvc belongs to us, but we have no member for it.
// Remove all finalizers, so it can be removed.
log.Warn("PVC belongs to this deployment, but we don't know the member. Removing all finalizers")
log.Str("pvc", pvc.GetName()).Warn("PVC belongs to this deployment, but we don't know the member. Removing all finalizers")
_, err := k8sutil.RemovePVCFinalizers(ctx, r.context.ACS().CurrentClusterCache(), cachedStatus.PersistentVolumeClaimsModInterface().V1(), pvc, pvc.GetFinalizers(), false)
if err != nil {
log.Err(err).Debug("Failed to update PVC (to remove all finalizers)")
log.Str("pvc", pvc.GetName()).Err(err).Debug("Failed to update PVC (to remove all finalizers)")
return errors.WithStack(err)
}
}