mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-23 19:08:44 +00:00
generated: run refactor
This commit is contained in:
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package gce
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os/exec"
|
||||
@@ -371,7 +372,7 @@ func GetGCECloud() (*gcecloud.Cloud, error) {
|
||||
|
||||
// GetClusterID returns cluster ID
|
||||
func GetClusterID(c clientset.Interface) (string, error) {
|
||||
cm, err := c.CoreV1().ConfigMaps(metav1.NamespaceSystem).Get(gcecloud.UIDConfigMapName, metav1.GetOptions{})
|
||||
cm, err := c.CoreV1().ConfigMaps(metav1.NamespaceSystem).Get(context.TODO(), gcecloud.UIDConfigMapName, metav1.GetOptions{})
|
||||
if err != nil || cm == nil {
|
||||
return "", fmt.Errorf("error getting cluster ID: %v", err)
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package gce
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/sha256"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
@@ -126,7 +127,7 @@ func (cont *IngressController) CleanupIngressControllerWithTimeout(timeout time.
|
||||
|
||||
func (cont *IngressController) getL7AddonUID() (string, error) {
|
||||
framework.Logf("Retrieving UID from config map: %v/%v", metav1.NamespaceSystem, uidConfigMap)
|
||||
cm, err := cont.Client.CoreV1().ConfigMaps(metav1.NamespaceSystem).Get(uidConfigMap, metav1.GetOptions{})
|
||||
cm, err := cont.Client.CoreV1().ConfigMaps(metav1.NamespaceSystem).Get(context.TODO(), uidConfigMap, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package gce
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
@@ -77,7 +78,7 @@ var _ = ginkgo.Describe("Recreate [Feature:Recreate]", func() {
|
||||
// Make sure that addon/system pods are running, so dump
|
||||
// events for the kube-system namespace on failures
|
||||
ginkgo.By(fmt.Sprintf("Collecting events from namespace %q.", systemNamespace))
|
||||
events, err := f.ClientSet.CoreV1().Events(systemNamespace).List(metav1.ListOptions{})
|
||||
events, err := f.ClientSet.CoreV1().Events(systemNamespace).List(context.TODO(), metav1.ListOptions{})
|
||||
framework.ExpectNoError(err)
|
||||
|
||||
for _, e := range events.Items {
|
||||
|
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package gce
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -84,7 +85,7 @@ func WaitForNodeBootIdsToChange(c clientset.Interface, nodes []v1.Node, timeout
|
||||
for i := range nodes {
|
||||
node := &nodes[i]
|
||||
if err := wait.Poll(30*time.Second, timeout, func() (bool, error) {
|
||||
newNode, err := c.CoreV1().Nodes().Get(node.Name, metav1.GetOptions{})
|
||||
newNode, err := c.CoreV1().Nodes().Get(context.TODO(), node.Name, metav1.GetOptions{})
|
||||
if err != nil {
|
||||
framework.Logf("Could not get node info: %s. Retrying in %v.", err, 30*time.Second)
|
||||
return false, nil
|
||||
|
Reference in New Issue
Block a user