mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	change log line to print actual pod uid instead of address of the pod uid
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user