Fix go imports

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-06-30 18:58:18 -04:00
parent a2009484f7
commit 004d0c8214
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
8 changed files with 22 additions and 18 deletions

View file

@ -25,7 +25,7 @@ import (
"strconv"
"strings"
"k8s.io/api/core/v1"
corev1 "k8s.io/api/core/v1"
)
// ExecIngressPod executes a command inside the first container in ingress controller running pod
@ -39,7 +39,7 @@ func (f *Framework) ExecIngressPod(command string) (string, error) {
}
// ExecCommand executes a command inside a the first container in a running pod
func (f *Framework) ExecCommand(pod *v1.Pod, command string) (string, error) {
func (f *Framework) ExecCommand(pod *corev1.Pod, command string) (string, error) {
var (
execOut bytes.Buffer
execErr bytes.Buffer

View file

@ -21,11 +21,11 @@ import (
"fmt"
"os/exec"
"k8s.io/api/core/v1"
corev1 "k8s.io/api/core/v1"
)
// Logs returns the log entries of a given Pod.
func Logs(pod *v1.Pod) (string, error) {
func Logs(pod *corev1.Pod) (string, error) {
var (
execOut bytes.Buffer
execErr bytes.Buffer

View file

@ -23,7 +23,7 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
v1 "k8s.io/api/core/v1"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/uuid"
@ -92,13 +92,13 @@ var RunID = uuid.NewUUID()
// CreateKubeNamespace creates a new namespace in the cluster
func CreateKubeNamespace(baseName string, c kubernetes.Interface) (string, error) {
ts := time.Now().UnixNano()
ns := &v1.Namespace{
ns := &corev1.Namespace{
ObjectMeta: metav1.ObjectMeta{
GenerateName: fmt.Sprintf("e2e-tests-%v-%v-", baseName, ts),
},
}
// Be robust about making the namespace creation call.
var got *v1.Namespace
var got *corev1.Namespace
var err error
err = wait.PollImmediate(Poll, DefaultTimeout, func() (bool, error) {
@ -171,8 +171,8 @@ func noPodsInNamespace(c kubernetes.Interface, namespace string) wait.ConditionF
// WaitForPodRunningInNamespace waits a default amount of time (PodStartTimeout) for the specified pod to become running.
// Returns an error if timeout occurs first, or pod goes in to failed state.
func WaitForPodRunningInNamespace(c kubernetes.Interface, pod *v1.Pod) error {
if pod.Status.Phase == v1.PodRunning {
func WaitForPodRunningInNamespace(c kubernetes.Interface, pod *corev1.Pod) error {
if pod.Status.Phase == corev1.PodRunning {
return nil
}
return waitTimeoutForPodRunningInNamespace(c, pod.Name, pod.Namespace, DefaultTimeout)
@ -279,9 +279,9 @@ func podRunning(c kubernetes.Interface, podName, namespace string) wait.Conditio
return false, nil
}
switch pod.Status.Phase {
case v1.PodRunning:
case corev1.PodRunning:
return true, nil
case v1.PodFailed, v1.PodSucceeded:
case corev1.PodFailed, corev1.PodSucceeded:
return false, fmt.Errorf("pod ran to completion")
}
return false, nil