Update dependencies client-go to release-11.0 and kubernetes-1.14.0

This commit is contained in:
Manuel Alejandro de Brito Fontes 2019-03-28 20:43:18 -03:00
parent 7e21a2ddfb
commit 14a9e9f3fa
No known key found for this signature in database
GPG key ID: 786136016A8BA02A
10 changed files with 116 additions and 33 deletions

View file

@ -23,7 +23,7 @@ import (
"github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/config"
"github.com/onsi/gomega"
"k8s.io/apiserver/pkg/util/logs"
"k8s.io/component-base/logs"
// required
_ "k8s.io/client-go/plugin/pkg/client/auth"

View file

@ -19,8 +19,8 @@ package framework
import (
. "github.com/onsi/gomega"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
)
@ -68,12 +68,12 @@ func (f *Framework) NewDeployment(name, image string, port int32, replicas int32
},
}
deployment := &extensions.Deployment{
deployment := &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: f.Namespace,
},
Spec: extensions.DeploymentSpec{
Spec: appsv1.DeploymentSpec{
Replicas: NewInt32(replicas),
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{

View file

@ -19,8 +19,8 @@ package framework
import (
. "github.com/onsi/gomega"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/util/intstr"
@ -35,12 +35,12 @@ func (f *Framework) NewGRPCFortuneTellerDeployment() {
// NewNewGRPCFortuneTellerDeploymentWithReplicas creates a new deployment of the
// fortune teller image in a particular namespace. Number of replicas is configurable
func (f *Framework) NewNewGRPCFortuneTellerDeploymentWithReplicas(replicas int32) {
deployment := &extensions.Deployment{
deployment := &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: "fortune-teller",
Namespace: f.Namespace,
},
Spec: extensions.DeploymentSpec{
Spec: appsv1.DeploymentSpec{
Replicas: NewInt32(replicas),
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{

View file

@ -19,8 +19,8 @@ package framework
import (
. "github.com/onsi/gomega"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
)
@ -73,12 +73,12 @@ func (f *Framework) NewInfluxDBDeployment() {
Expect(cm).NotTo(BeNil(), "expected a configmap but none returned")
deployment := &extensions.Deployment{
deployment := &appsv1.Deployment{
ObjectMeta: metav1.ObjectMeta{
Name: "influxdb-svc",
Namespace: f.Namespace,
},
Spec: extensions.DeploymentSpec{
Spec: appsv1.DeploymentSpec{
Replicas: NewInt32(1),
Selector: &metav1.LabelSelector{
MatchLabels: map[string]string{

View file

@ -23,6 +23,7 @@ import (
. "github.com/onsi/gomega"
appsv1 "k8s.io/api/apps/v1"
api "k8s.io/api/core/v1"
core "k8s.io/api/core/v1"
extensions "k8s.io/api/extensions/v1beta1"
@ -108,11 +109,11 @@ func (f *Framework) EnsureService(service *core.Service) *core.Service {
}
// EnsureDeployment creates a Deployment object or returns it if it already exists.
func (f *Framework) EnsureDeployment(deployment *extensions.Deployment) (*extensions.Deployment, error) {
d, err := f.KubeClientSet.Extensions().Deployments(deployment.Namespace).Update(deployment)
func (f *Framework) EnsureDeployment(deployment *appsv1.Deployment) (*appsv1.Deployment, error) {
d, err := f.KubeClientSet.AppsV1().Deployments(deployment.Namespace).Update(deployment)
if err != nil {
if k8sErrors.IsNotFound(err) {
return f.KubeClientSet.Extensions().Deployments(deployment.Namespace).Create(deployment)
return f.KubeClientSet.AppsV1().Deployments(deployment.Namespace).Create(deployment)
}
return nil, err
}

View file

@ -43,7 +43,7 @@ var _ = framework.IngressNginxDescribe("[Serial] Pod Security Policies", func()
BeforeEach(func() {
psp := createPodSecurityPolicy()
_, err := f.KubeClientSet.Extensions().PodSecurityPolicies().Create(psp)
_, err := f.KubeClientSet.ExtensionsV1beta1().PodSecurityPolicies().Create(psp)
if !k8sErrors.IsAlreadyExists(err) {
Expect(err).NotTo(HaveOccurred(), "creating Pod Security Policy")
}

View file

@ -87,11 +87,11 @@ var _ = framework.IngressNginxDescribe("Status Update [Status]", func() {
err = cmd.Process.Kill()
Expect(err).NotTo(HaveOccurred(), "unexpected error terminating kubectl proxy")
ing, err = f.KubeClientSet.Extensions().Ingresses(f.Namespace).Get(host, metav1.GetOptions{})
ing, err = f.KubeClientSet.ExtensionsV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{})
Expect(err).NotTo(HaveOccurred(), "unexpected error getting %s/%v Ingress", f.Namespace, host)
ing.Status.LoadBalancer.Ingress = []apiv1.LoadBalancerIngress{}
_, err = f.KubeClientSet.Extensions().Ingresses(f.Namespace).UpdateStatus(ing)
_, err = f.KubeClientSet.ExtensionsV1beta1().Ingresses(f.Namespace).UpdateStatus(ing)
Expect(err).NotTo(HaveOccurred(), "unexpected error cleaning Ingress status")
time.Sleep(10 * time.Second)
@ -110,7 +110,7 @@ var _ = framework.IngressNginxDescribe("Status Update [Status]", func() {
}()
err = wait.Poll(10*time.Second, framework.DefaultTimeout, func() (done bool, err error) {
ing, err = f.KubeClientSet.Extensions().Ingresses(f.Namespace).Get(host, metav1.GetOptions{})
ing, err = f.KubeClientSet.ExtensionsV1beta1().Ingresses(f.Namespace).Get(host, metav1.GetOptions{})
if err != nil {
return false, nil
}