mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #85789 from ZP-AlwaysWin/dev-1202
Remove unnecessary nil check in if statement in nodelease controller
This commit is contained in:
commit
6db550d1db
@ -213,7 +213,7 @@ func (c *controller) newLease(base *coordinationv1.Lease) *coordinationv1.Lease
|
||||
// kubelet.nodeRef.UID. When lease is initially created, it is possible that
|
||||
// the connection between master and node is not ready yet. So try to set
|
||||
// owner reference every time when renewing the lease, until successful.
|
||||
if lease.OwnerReferences == nil || len(lease.OwnerReferences) == 0 {
|
||||
if len(lease.OwnerReferences) == 0 {
|
||||
if node, err := c.client.CoreV1().Nodes().Get(c.holderIdentity, metav1.GetOptions{}); err == nil {
|
||||
lease.OwnerReferences = []metav1.OwnerReference{
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user