Support 'networking.k8s.io/v1beta1' ingress apiVersion

This commit is contained in:
Ludovic Fernandez 2020-01-16 10:14:06 +01:00 committed by Traefiker Bot
parent 6b7be462b8
commit 72e702a15a
47 changed files with 190 additions and 161 deletions

View file

@ -8,8 +8,6 @@ import (
"github.com/containous/traefik/v2/pkg/provider/kubernetes/crd/traefik/v1alpha1"
"github.com/containous/traefik/v2/pkg/provider/kubernetes/k8s"
corev1 "k8s.io/api/core/v1"
extensionsv1beta1 "k8s.io/api/extensions/v1beta1"
v1beta12 "k8s.io/api/extensions/v1beta1"
"k8s.io/client-go/kubernetes/scheme"
)
@ -24,15 +22,13 @@ func init() {
}
type clientMock struct {
ingresses []*extensionsv1beta1.Ingress
services []*corev1.Service
secrets []*corev1.Secret
endpoints []*corev1.Endpoints
apiServiceError error
apiSecretError error
apiEndpointsError error
apiIngressStatusError error
apiServiceError error
apiSecretError error
apiEndpointsError error
ingressRoutes []*v1alpha1.IngressRoute
ingressRouteTCPs []*v1alpha1.IngressRouteTCP
@ -69,8 +65,6 @@ func newClientMock(paths ...string) clientMock {
c.traefikServices = append(c.traefikServices, o)
case *v1alpha1.TLSOption:
c.tlsOptions = append(c.tlsOptions, o)
case *v1beta12.Ingress:
c.ingresses = append(c.ingresses, o)
case *corev1.Secret:
c.secrets = append(c.secrets, o)
default:
@ -122,10 +116,6 @@ func (c clientMock) GetTLSOption(namespace, name string) (*v1alpha1.TLSOption, b
return nil, false, nil
}
func (c clientMock) GetIngresses() []*extensionsv1beta1.Ingress {
return c.ingresses
}
func (c clientMock) GetService(namespace, name string) (*corev1.Service, bool, error) {
if c.apiServiceError != nil {
return nil, false, c.apiServiceError
@ -169,7 +159,3 @@ func (c clientMock) GetSecret(namespace, name string) (*corev1.Secret, bool, err
func (c clientMock) WatchAll(namespaces []string, stopCh <-chan struct{}) (<-chan interface{}, error) {
return c.watchChan, nil
}
func (c clientMock) UpdateIngressStatus(namespace, name, ip, hostname string) error {
return c.apiIngressStatusError
}