@@ -121,7 +121,7 @@ func buildGateway(name, namespace, className string, listeners []string) (*gwv1.
121121 listenerName := fmt .Sprintf ("%s-%d" , name , port )
122122 gwListeners = append (gwListeners , gwv1.Listener {
123123 Name : gwv1 .SectionName (listenerName ),
124- Port : gwv1 . PortNumber ( port ) ,
124+ Port : port ,
125125 Protocol : gwv1 .ProtocolType (protocol ),
126126 AllowedRoutes : & gwv1.AllowedRoutes {
127127 Namespaces : & gwv1.RouteNamespaces {
@@ -133,7 +133,7 @@ func buildGateway(name, namespace, className string, listeners []string) (*gwv1.
133133
134134 return & gwv1.Gateway {
135135 TypeMeta : metav1.TypeMeta {
136- APIVersion : gwv1 .SchemeGroupVersion .String (),
136+ APIVersion : gwv1 .GroupVersion .String (),
137137 Kind : "Gateway" ,
138138 },
139139 ObjectMeta : metav1.ObjectMeta {
@@ -156,14 +156,13 @@ func buildHTTPRoute(routeName, gatewayName, serviceName, namespace string, servi
156156 rules := make ([]gwv1.HTTPRouteRule , 0 , len (servicePorts ))
157157
158158 for _ , p := range servicePorts {
159- port := gwv1 .PortNumber (p )
160159 rule := gwv1.HTTPRouteRule {
161160 BackendRefs : []gwv1.HTTPBackendRef {
162161 {
163162 BackendRef : gwv1.BackendRef {
164163 BackendObjectReference : gwv1.BackendObjectReference {
165164 Name : gwv1 .ObjectName (serviceName ),
166- Port : ptr .To (port ),
165+ Port : ptr .To (p ),
167166 },
168167 },
169168 },
@@ -175,7 +174,7 @@ func buildHTTPRoute(routeName, gatewayName, serviceName, namespace string, servi
175174
176175 return & gwv1.HTTPRoute {
177176 TypeMeta : metav1.TypeMeta {
178- APIVersion : gwv1 .SchemeGroupVersion .String (),
177+ APIVersion : gwv1 .GroupVersion .String (),
179178 Kind : "HTTPRoute" ,
180179 },
181180 ObjectMeta : metav1.ObjectMeta {
0 commit comments