feat: support SPDY subprotocol version v5 (K8s API >= v1.29.0) (#1185)

This commit is contained in:
Francesco Torta
2024-01-19 19:31:38 +01:00
committed by GitHub
parent d6a4e8ee09
commit a9ce60e19d
5 changed files with 209 additions and 159 deletions

View File

@@ -30,7 +30,7 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
coordclientset "k8s.io/client-go/kubernetes/typed/coordination/v1"
"k8s.io/utils/clock"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
)
// Code heavily borrowed from: https://github.com/kubernetes/kubernetes/blob/v1.18.13/pkg/kubelet/nodelease/controller.go
@@ -275,8 +275,8 @@ func (c *leaseController) newLease(ctx context.Context, node *corev1.Node, base
Namespace: corev1.NamespaceNodeLease,
},
Spec: coordinationv1.LeaseSpec{
HolderIdentity: pointer.String(node.Name),
LeaseDurationSeconds: pointer.Int32(c.leaseDurationSeconds),
HolderIdentity: ptr.To(node.Name),
LeaseDurationSeconds: ptr.To(c.leaseDurationSeconds),
},
}
} else {