Fix go imports
This commit is contained in:
parent
a2009484f7
commit
004d0c8214
8 changed files with 22 additions and 18 deletions
|
@ -20,9 +20,10 @@ import (
|
|||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"k8s.io/ingress-nginx/internal/nginx"
|
||||
"os"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -23,7 +23,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"k8s.io/api/core/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/kubernetes/fake"
|
||||
|
@ -48,7 +48,7 @@ func TestHandleSigterm(t *testing.T) {
|
|||
defer deleteConfigMap(cm, ns, clientSet, t)
|
||||
|
||||
name := "test"
|
||||
pod := v1.Pod{
|
||||
pod := corev1.Pod{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: name,
|
||||
Namespace: ns,
|
||||
|
@ -110,7 +110,7 @@ func createConfigMap(clientSet kubernetes.Interface, ns string, t *testing.T) st
|
|||
t.Helper()
|
||||
t.Log("Creating temporal config map")
|
||||
|
||||
configMap := &v1.ConfigMap{
|
||||
configMap := &corev1.ConfigMap{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "config",
|
||||
SelfLink: fmt.Sprintf("/api/v1/namespaces/%s/configmaps/config", ns),
|
||||
|
|
|
@ -20,6 +20,7 @@ import (
|
|||
"crypto/sha1"
|
||||
"encoding/hex"
|
||||
"io/ioutil"
|
||||
|
||||
"k8s.io/klog"
|
||||
)
|
||||
|
||||
|
|
|
@ -18,11 +18,12 @@ package annotations
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
|
||||
"github.com/parnurzeal/gorequest"
|
||||
|
||||
"k8s.io/ingress-nginx/test/e2e/framework"
|
||||
|
|
|
@ -17,11 +17,12 @@ limitations under the License.
|
|||
package annotations
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
. "github.com/onsi/ginkgo"
|
||||
. "github.com/onsi/gomega"
|
||||
"github.com/parnurzeal/gorequest"
|
||||
"k8s.io/ingress-nginx/test/e2e/framework"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
var _ = framework.IngressNginxDescribe("Annotations - X-Forwarded-Prefix", func() {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue