mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Merge pull request #102232 from MadhavJivrajani/mirror-client-log-line-fix
Change log line to print actual pod uid and not address of the pod uid
This commit is contained in:
commit
e5b54d0769
@ -42,7 +42,7 @@ type MirrorClient interface {
|
||||
DeleteMirrorPod(podFullName string, uid *types.UID) (bool, error)
|
||||
}
|
||||
|
||||
// nodeGetter is a subset a NodeLister, simplified for testing.
|
||||
// nodeGetter is a subset of NodeLister, simplified for testing.
|
||||
type nodeGetter interface {
|
||||
// Get retrieves the Node for a given name.
|
||||
Get(name string) (*v1.Node, error)
|
||||
@ -122,7 +122,13 @@ func (mc *basicMirrorClient) DeleteMirrorPod(podFullName string, uid *types.UID)
|
||||
klog.ErrorS(err, "Failed to parse a pod full name", "podFullName", podFullName)
|
||||
return false, err
|
||||
}
|
||||
klog.V(2).InfoS("Deleting a mirror pod", "pod", klog.KRef(namespace, name), "podUID", uid)
|
||||
|
||||
var uidValue types.UID
|
||||
if uid != nil {
|
||||
uidValue = *uid
|
||||
}
|
||||
klog.V(2).InfoS("Deleting a mirror pod", "pod", klog.KRef(namespace, name), "podUID", uidValue)
|
||||
|
||||
var GracePeriodSeconds int64
|
||||
if err := mc.apiserverClient.CoreV1().Pods(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{GracePeriodSeconds: &GracePeriodSeconds, Preconditions: &metav1.Preconditions{UID: uid}}); err != nil {
|
||||
// Unfortunately, there's no generic error for failing a precondition
|
||||
|
Loading…
Reference in New Issue
Block a user