Merge pull request #129862 from neolit123/automated-cherry-pick-of-#129859-origin-release-1.32

Automated cherry pick of #129859: kubeadm: use the v1beta4 EtcdAPICall timeout for etcd calls
This commit is contained in:
Kubernetes Prow Robot 2025-01-30 05:55:23 -08:00 committed by GitHub
commit faf35b4eac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -249,7 +249,7 @@ func (c *Client) Sync() error {
// Syncs the list of endpoints // Syncs the list of endpoints
var cli etcdClient var cli etcdClient
var lastError error var lastError error
err := wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, constants.EtcdAPICallTimeout, err := wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, kubeadmapi.GetActiveTimeouts().EtcdAPICall.Duration,
true, func(_ context.Context) (bool, error) { true, func(_ context.Context) (bool, error) {
var err error var err error
cli, err = c.newEtcdClient(c.Endpoints) cli, err = c.newEtcdClient(c.Endpoints)
@ -289,7 +289,7 @@ func (c *Client) listMembers(timeout time.Duration) (*clientv3.MemberListRespons
var lastError error var lastError error
var resp *clientv3.MemberListResponse var resp *clientv3.MemberListResponse
if timeout == 0 { if timeout == 0 {
timeout = constants.EtcdAPICallTimeout timeout = kubeadmapi.GetActiveTimeouts().EtcdAPICall.Duration
} }
err := wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, timeout, err := wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, timeout,
true, func(_ context.Context) (bool, error) { true, func(_ context.Context) (bool, error) {
@ -358,7 +358,7 @@ func (c *Client) RemoveMember(id uint64) ([]Member, error) {
lastError error lastError error
respMembers []*etcdserverpb.Member respMembers []*etcdserverpb.Member
) )
err = wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, constants.EtcdAPICallTimeout, err = wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, kubeadmapi.GetActiveTimeouts().EtcdAPICall.Duration,
true, func(_ context.Context) (bool, error) { true, func(_ context.Context) (bool, error) {
ctx, cancel := context.WithTimeout(context.Background(), etcdTimeout) ctx, cancel := context.WithTimeout(context.Background(), etcdTimeout)
defer cancel() defer cancel()
@ -447,7 +447,7 @@ func (c *Client) addMember(name string, peerAddrs string, isLearner bool) ([]Mem
respMembers []*etcdserverpb.Member respMembers []*etcdserverpb.Member
resp *clientv3.MemberAddResponse resp *clientv3.MemberAddResponse
) )
err = wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, constants.EtcdAPICallTimeout, err = wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, kubeadmapi.GetActiveTimeouts().EtcdAPICall.Duration,
true, func(_ context.Context) (bool, error) { true, func(_ context.Context) (bool, error) {
ctx, cancel := context.WithTimeout(context.Background(), etcdTimeout) ctx, cancel := context.WithTimeout(context.Background(), etcdTimeout)
defer cancel() defer cancel()
@ -571,7 +571,7 @@ func (c *Client) MemberPromote(learnerID uint64) error {
var ( var (
lastError error lastError error
) )
err = wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, constants.EtcdAPICallTimeout, err = wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, kubeadmapi.GetActiveTimeouts().EtcdAPICall.Duration,
true, func(_ context.Context) (bool, error) { true, func(_ context.Context) (bool, error) {
ctx, cancel := context.WithTimeout(context.Background(), etcdTimeout) ctx, cancel := context.WithTimeout(context.Background(), etcdTimeout)
defer cancel() defer cancel()
@ -604,7 +604,7 @@ func (c *Client) getClusterStatus() (map[string]*clientv3.StatusResponse, error)
// Gets the member status // Gets the member status
var lastError error var lastError error
var resp *clientv3.StatusResponse var resp *clientv3.StatusResponse
err := wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, constants.EtcdAPICallTimeout, err := wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, kubeadmapi.GetActiveTimeouts().EtcdAPICall.Duration,
true, func(_ context.Context) (bool, error) { true, func(_ context.Context) (bool, error) {
cli, err := c.newEtcdClient(c.Endpoints) cli, err := c.newEtcdClient(c.Endpoints)
if err != nil { if err != nil {