diff --git a/cmd/kubeadm/app/discovery/file/file.go b/cmd/kubeadm/app/discovery/file/file.go index 4a5cf3801cb..c3a8c176c55 100644 --- a/cmd/kubeadm/app/discovery/file/file.go +++ b/cmd/kubeadm/app/discovery/file/file.go @@ -94,7 +94,7 @@ func ValidateConfigInfo(config *clientcmdapi.Config, discoveryTimeout time.Durat err = wait.PollUntilContextTimeout(context.Background(), constants.DiscoveryRetryInterval, discoveryTimeout, true, func(_ context.Context) (bool, error) { - clusterinfoCM, lastError = client.CoreV1().ConfigMaps(metav1.NamespacePublic).Get(context.TODO(), bootstrapapi.ConfigMapClusterInfo, metav1.GetOptions{}) + clusterinfoCM, lastError = client.CoreV1().ConfigMaps(metav1.NamespacePublic).Get(context.Background(), bootstrapapi.ConfigMapClusterInfo, metav1.GetOptions{}) if lastError != nil { if apierrors.IsForbidden(lastError) { // If the request fails with a forbidden error, the cluster admin has not granted access to the cluster info configmap for anonymous clients. diff --git a/cmd/kubeadm/app/util/apiclient/wait.go b/cmd/kubeadm/app/util/apiclient/wait.go index af8fa7e9f41..af8fbf7f6b5 100644 --- a/cmd/kubeadm/app/util/apiclient/wait.go +++ b/cmd/kubeadm/app/util/apiclient/wait.go @@ -327,7 +327,7 @@ func (w *KubeWaiter) WaitForPodsWithLabel(kvLabel string) error { constants.KubernetesAPICallRetryInterval, w.timeout, true, func(_ context.Context) (bool, error) { listOpts := metav1.ListOptions{LabelSelector: kvLabel} - pods, err := w.client.CoreV1().Pods(metav1.NamespaceSystem).List(context.TODO(), listOpts) + pods, err := w.client.CoreV1().Pods(metav1.NamespaceSystem).List(context.Background(), listOpts) if err != nil { _, _ = fmt.Fprintf(w.writer, "[apiclient] Error getting Pods with label selector %q [%v]\n", kvLabel, err) return false, nil @@ -493,7 +493,7 @@ func (w *KubeWaiter) WaitForStaticPodHashChange(nodeName, component, previousHas func getStaticPodSingleHash(client clientset.Interface, nodeName string, component string) (string, error) { staticPodName := fmt.Sprintf("%s-%s", component, nodeName) - staticPod, err := client.CoreV1().Pods(metav1.NamespaceSystem).Get(context.TODO(), staticPodName, metav1.GetOptions{}) + staticPod, err := client.CoreV1().Pods(metav1.NamespaceSystem).Get(context.Background(), staticPodName, metav1.GetOptions{}) if err != nil { return "", errors.Wrapf(err, "failed to obtain static Pod hash for component %s on Node %s", component, nodeName) }