mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 21:12:07 +00:00
fix: use the getContext() method for evicting pods
This commit is contained in:
parent
beb696c2c9
commit
cc244e8d1d
@ -159,7 +159,7 @@ func (d *Helper) EvictPod(pod corev1.Pod, evictionGroupVersion schema.GroupVersi
|
||||
},
|
||||
DeleteOptions: &delOpts,
|
||||
}
|
||||
return d.Client.PolicyV1().Evictions(eviction.Namespace).Evict(context.TODO(), eviction)
|
||||
return d.Client.PolicyV1().Evictions(eviction.Namespace).Evict(d.getContext(), eviction)
|
||||
|
||||
default:
|
||||
// otherwise, fall back to policy/v1beta1, supported by all servers that support the eviction subresource
|
||||
@ -170,7 +170,7 @@ func (d *Helper) EvictPod(pod corev1.Pod, evictionGroupVersion schema.GroupVersi
|
||||
},
|
||||
DeleteOptions: &delOpts,
|
||||
}
|
||||
return d.Client.PolicyV1beta1().Evictions(eviction.Namespace).Evict(context.TODO(), eviction)
|
||||
return d.Client.PolicyV1beta1().Evictions(eviction.Namespace).Evict(d.getContext(), eviction)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user