From c92a6b93cb9b4d3a779343bdd1b54d1e8dd3e5e6 Mon Sep 17 00:00:00 2001 From: Tommy Chen Date: Tue, 2 Apr 2024 14:30:23 +0800 Subject: [PATCH] feat(envoygateway): Bind V1 gateway structs to v1beta1 --- internal/envoygateway/scheme.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/internal/envoygateway/scheme.go b/internal/envoygateway/scheme.go index 911ae7083513..04545c3e08e4 100644 --- a/internal/envoygateway/scheme.go +++ b/internal/envoygateway/scheme.go @@ -35,9 +35,17 @@ func init() { panic(err) } // Add Gateway API types. - if err := gwapiv1.AddToScheme(scheme); err != nil { - panic(err) - } + //if err := gwapiv1.AddToScheme(scheme); err != nil { + // panic(err) + //} + scheme.AddKnownTypes(gwapiv1b1.SchemeGroupVersion, + &gwapiv1.Gateway{}, + &gwapiv1.GatewayClass{}, + &gwapiv1.GatewayClassList{}, + &gwapiv1.GatewayList{}, + &gwapiv1.HTTPRoute{}, + &gwapiv1.HTTPRouteList{}, + ) if err := gwapiv1b1.AddToScheme(scheme); err != nil { panic(err) }