Merge current branch v2.4 into master
This commit is contained in:
commit
cb4fb973b2
41 changed files with 1857 additions and 1424 deletions
|
@ -16,9 +16,9 @@ import (
|
|||
"k8s.io/client-go/kubernetes"
|
||||
"k8s.io/client-go/rest"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
"sigs.k8s.io/service-apis/apis/v1alpha1"
|
||||
"sigs.k8s.io/service-apis/pkg/client/clientset/versioned"
|
||||
"sigs.k8s.io/service-apis/pkg/client/informers/externalversions"
|
||||
"sigs.k8s.io/gateway-api/apis/v1alpha1"
|
||||
"sigs.k8s.io/gateway-api/pkg/client/clientset/versioned"
|
||||
"sigs.k8s.io/gateway-api/pkg/client/informers/externalversions"
|
||||
)
|
||||
|
||||
const resyncPeriod = 10 * time.Minute
|
||||
|
@ -236,7 +236,7 @@ func (c *clientWrapper) GetHTTPRoutes(namespace string, selector labels.Selector
|
|||
}
|
||||
|
||||
if len(httpRoutes) == 0 {
|
||||
return nil, fmt.Errorf("failed to get HTTPRoute %s with labels selector %s: namespace is not within watched namespaces", namespace, selector)
|
||||
log.WithoutContext().Debugf("No HTTPRoute found in %q namespace with labels selector %s", namespace, selector)
|
||||
}
|
||||
|
||||
return httpRoutes, nil
|
||||
|
|
|
@ -10,7 +10,7 @@ import (
|
|||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"k8s.io/client-go/kubernetes/scheme"
|
||||
"sigs.k8s.io/service-apis/apis/v1alpha1"
|
||||
"sigs.k8s.io/gateway-api/apis/v1alpha1"
|
||||
)
|
||||
|
||||
var _ Client = (*clientMock)(nil)
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
|
||||
"github.com/stretchr/testify/assert"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"sigs.k8s.io/service-apis/apis/v1alpha1"
|
||||
"sigs.k8s.io/gateway-api/apis/v1alpha1"
|
||||
)
|
||||
|
||||
func TestStatusEquals(t *testing.T) {
|
||||
|
|
|
@ -25,7 +25,7 @@ import (
|
|||
corev1 "k8s.io/api/core/v1"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/labels"
|
||||
"sigs.k8s.io/service-apis/apis/v1alpha1"
|
||||
"sigs.k8s.io/gateway-api/apis/v1alpha1"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -809,12 +809,12 @@ func loadServices(client Client, namespace string, targets []v1alpha1.HTTPRouteF
|
|||
return nil, nil, errors.New("service not found")
|
||||
}
|
||||
|
||||
if len(service.Spec.Ports) > 1 && forwardTo.Port == 0 {
|
||||
if len(service.Spec.Ports) > 1 && forwardTo.Port == nil {
|
||||
// If the port is unspecified and the backend is a Service
|
||||
// object consisting of multiple port definitions, the route
|
||||
// must be dropped from the Gateway. The controller should
|
||||
// raise the "ResolvedRefs" condition on the Gateway with the
|
||||
// "DroppedRoutes" reason. The gateway status for this route
|
||||
// "DroppedRoutes" reason. The gateway status for this route
|
||||
// should be updated with a condition that describes the error
|
||||
// more specifically.
|
||||
log.WithoutContext().Errorf("A multiple ports Kubernetes Service cannot be used if unspecified forwardTo.Port")
|
||||
|
@ -826,7 +826,7 @@ func loadServices(client Client, namespace string, targets []v1alpha1.HTTPRouteF
|
|||
var match bool
|
||||
|
||||
for _, p := range service.Spec.Ports {
|
||||
if forwardTo.Port == 0 || p.Port == int32(forwardTo.Port) {
|
||||
if forwardTo.Port == nil || p.Port == int32(*forwardTo.Port) {
|
||||
portName = p.Name
|
||||
portSpec = p
|
||||
match = true
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"github.com/traefik/traefik/v2/pkg/config/dynamic"
|
||||
"github.com/traefik/traefik/v2/pkg/provider"
|
||||
"github.com/traefik/traefik/v2/pkg/tls"
|
||||
"sigs.k8s.io/service-apis/apis/v1alpha1"
|
||||
"sigs.k8s.io/gateway-api/apis/v1alpha1"
|
||||
)
|
||||
|
||||
var _ provider.Provider = (*Provider)(nil)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue