mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 18:54:06 +00:00
Merge pull request #126838 from zou2699/fix-126836
fix: use the getContext() method for evicting pods
This commit is contained in:
commit
b60e01f881
@ -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