Chore: (deps): Bump sigs.k8s.io/gateway-api from 0.4.3 to 0.6.2 (#5829)

* Chore: (deps): Bump sigs.k8s.io/gateway-api from 0.4.3 to 0.6.2

Bumps [sigs.k8s.io/gateway-api](https://github.com/kubernetes-sigs/gateway-api) from 0.4.3 to 0.6.2.
- [Release notes](https://github.com/kubernetes-sigs/gateway-api/releases)
- [Changelog](https://github.com/kubernetes-sigs/gateway-api/blob/main/CHANGELOG.md)
- [Commits](https://github.com/kubernetes-sigs/gateway-api/compare/v0.4.3...v0.6.2)

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---
updated-dependencies:
- dependency-name: sigs.k8s.io/gateway-api
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix gateway related api

Signed-off-by: Somefive <yd219913@alibaba-inc.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Somefive <yd219913@alibaba-inc.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Somefive <yd219913@alibaba-inc.com>
This commit is contained in:
dependabot[bot]
2023-04-26 10:48:17 +08:00
committed by GitHub
parent 5df0aa055c
commit 479221f49f
12 changed files with 4736 additions and 1625 deletions

View File

@@ -31,7 +31,7 @@ import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/klog/v2"
"sigs.k8s.io/controller-runtime/pkg/client"
gatewayv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
gatewayv1beta1 "sigs.k8s.io/gateway-api/apis/v1beta1"
monitorContext "github.com/kubevela/pkg/monitor/context"
wfContext "github.com/kubevela/workflow/pkg/context"
@@ -151,7 +151,7 @@ func getServiceEndpoints(ctx context.Context, cli client.Client, gvk schema.Grou
}
serviceEndpoints = append(serviceEndpoints, generatorFromService(service, cachedSelectorNodeIP, cluster, component, fmt.Sprintf("/seldon/%s/%s", namespace, name))...)
case "HTTPRoute":
var route gatewayv1alpha2.HTTPRoute
var route gatewayv1beta1.HTTPRoute
route.SetGroupVersionKind(gvk)
if err := findResource(ctx, cli, &route, name, namespace, cluster); err != nil {
klog.Error(err, fmt.Sprintf("find HTTPRoute %s/%s from cluster %s failure", name, namespace, cluster))
@@ -298,10 +298,10 @@ func generatorFromIngress(ingress v1.Ingress, cluster, component string) (servic
return serviceEndpoints
}
func getGatewayPortAndProtocol(ctx context.Context, cli client.Client, defaultNamespace, cluster string, parents []gatewayv1alpha2.ParentRef) (string, int) {
func getGatewayPortAndProtocol(ctx context.Context, cli client.Client, defaultNamespace, cluster string, parents []gatewayv1beta1.ParentReference) (string, int) {
for _, parent := range parents {
if parent.Kind != nil && *parent.Kind == "Gateway" {
var gateway gatewayv1alpha2.Gateway
var gateway gatewayv1beta1.Gateway
namespace := defaultNamespace
if parent.Namespace != nil {
namespace = string(*parent.Namespace)
@@ -309,7 +309,7 @@ func getGatewayPortAndProtocol(ctx context.Context, cli client.Client, defaultNa
if err := findResource(ctx, cli, &gateway, string(parent.Name), namespace, cluster); err != nil {
klog.Errorf("query the Gateway %s/%s/%s failure %s", cluster, namespace, string(parent.Name), err.Error())
}
var listener *gatewayv1alpha2.Listener
var listener *gatewayv1beta1.Listener
if parent.SectionName != nil {
for i, lis := range gateway.Spec.Listeners {
if lis.Name == *parent.SectionName {
@@ -322,7 +322,7 @@ func getGatewayPortAndProtocol(ctx context.Context, cli client.Client, defaultNa
}
if listener != nil {
var protocol = querytypes.HTTP
if listener.Protocol == gatewayv1alpha2.HTTPSProtocolType {
if listener.Protocol == gatewayv1beta1.HTTPSProtocolType {
protocol = querytypes.HTTPS
}
var port = int(listener.Port)
@@ -348,7 +348,7 @@ func getGatewayPortAndProtocol(ctx context.Context, cli client.Client, defaultNa
return querytypes.HTTP, 80
}
func generatorFromHTTPRoute(ctx context.Context, cli client.Client, route gatewayv1alpha2.HTTPRoute, cluster, component string) []querytypes.ServiceEndpoint {
func generatorFromHTTPRoute(ctx context.Context, cli client.Client, route gatewayv1beta1.HTTPRoute, cluster, component string) []querytypes.ServiceEndpoint {
existPath := make(map[string]bool)
var serviceEndpoints []querytypes.ServiceEndpoint
for _, rule := range route.Spec.Rules {
@@ -356,7 +356,7 @@ func generatorFromHTTPRoute(ctx context.Context, cli client.Client, route gatewa
appProtocol, appPort := getGatewayPortAndProtocol(ctx, cli, route.Namespace, cluster, route.Spec.ParentRefs)
for _, match := range rule.Matches {
path := ""
if match.Path != nil && (match.Path.Type == nil || string(*match.Path.Type) == string(gatewayv1alpha2.PathMatchPathPrefix)) {
if match.Path != nil && (match.Path.Type == nil || string(*match.Path.Type) == string(gatewayv1beta1.PathMatchPathPrefix)) {
path = *match.Path.Value
}
if !existPath[path] {

View File

@@ -574,7 +574,7 @@ options: {
{
Cluster: "",
ObjectReference: corev1.ObjectReference{
APIVersion: "gateway.networking.k8s.io/v1alpha2",
APIVersion: "gateway.networking.k8s.io/v1beta1",
Kind: "HTTPRoute",
Namespace: "default",
Name: "http-test-route",
@@ -583,7 +583,7 @@ options: {
{
Cluster: "",
ObjectReference: corev1.ObjectReference{
APIVersion: "gateway.networking.k8s.io/v1alpha2",
APIVersion: "gateway.networking.k8s.io/v1beta1",
Kind: "HTTPRoute",
Namespace: "default",
Name: "velaux-ssl",

View File

@@ -1,4 +1,4 @@
apiVersion: gateway.networking.k8s.io/v1alpha2
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
annotations:

View File

@@ -1,4 +1,4 @@
apiVersion: gateway.networking.k8s.io/v1alpha2
apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
name: traefik-gateway

View File

@@ -1,4 +1,4 @@
apiVersion: gateway.networking.k8s.io/v1alpha2
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
name: http-test-route

View File

@@ -1,4 +1,4 @@
apiVersion: gateway.networking.k8s.io/v1alpha2
apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
annotations:

View File

@@ -157,10 +157,10 @@ func init() {
ResourceType: ResourceType{APIVersion: "networking.k8s.io/v1", Kind: "Ingress"},
},
{
ResourceType: ResourceType{APIVersion: "gateway.networking.k8s.io/v1alpha2", Kind: "HTTPRoute"},
ResourceType: ResourceType{APIVersion: "gateway.networking.k8s.io/v1beta1", Kind: "HTTPRoute"},
},
{
ResourceType: ResourceType{APIVersion: "gateway.networking.k8s.io/v1alpha2", Kind: "Gateway"},
ResourceType: ResourceType{APIVersion: "gateway.networking.k8s.io/v1beta1", Kind: "Gateway"},
},
{
ResourceType: ResourceType{APIVersion: "v1", Kind: "ServiceAccount"},
@@ -200,10 +200,10 @@ func init() {
ResourceType: ResourceType{APIVersion: "networking.k8s.io/v1", Kind: "Ingress"},
},
{
ResourceType: ResourceType{APIVersion: "gateway.networking.k8s.io/v1alpha2", Kind: "HTTPRoute"},
ResourceType: ResourceType{APIVersion: "gateway.networking.k8s.io/v1beta1", Kind: "HTTPRoute"},
},
{
ResourceType: ResourceType{APIVersion: "gateway.networking.k8s.io/v1alpha2", Kind: "Gateway"},
ResourceType: ResourceType{APIVersion: "gateway.networking.k8s.io/v1beta1", Kind: "Gateway"},
},
{
ResourceType: ResourceType{APIVersion: "v1", Kind: "ServiceAccount"},