Skip to content

Commit c092761

Browse files
authored
cli: align on apigroup for backendtlspolicy (#1500)
**Description** Fixes a small issue that happened in standalone mode and the discovery of BackendTLS policies for the MCPRoute security configuration. In the controller code we're using `gwapiv1` in all reconcilers and the controller-runtime Client. That client is typed and works with the specific version. The fakeClient used in standalone mode, populated the BackendTLSPolicy as `gwapiv1alpha3`, causing the controller code to not find it. We could change the controller code and make sure all operations that use the `client.Client` from teh controller runtime account for all versions, but that would be a lot of repeated code, and the controller consistently uses `gwapiv1` everywhere, so I think it is OK to jsut fix the standalone mode to initialize its fakeClient with the right version (note that we can still "read any version from the YAML file", as we generically unmarshal to `Unstructured`; it's just a matter of how we populate the data in the fakeClient).. **Related Issues/PRs (if applicable)** N/A **Special notes for reviewers (if applicable)** N/A Signed-off-by: Ignasi Barrera <[email protected]>
1 parent bfb8b54 commit c092761

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cmd/aigw/translate.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
"sigs.k8s.io/controller-runtime/pkg/event"
3131
"sigs.k8s.io/controller-runtime/pkg/reconcile"
3232
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
33-
gwapiv1a3 "sigs.k8s.io/gateway-api/apis/v1alpha3"
3433
kyaml "sigs.k8s.io/yaml"
3534

3635
aigv1a1 "github.com/envoyproxy/ai-gateway/api/v1alpha1"
@@ -110,7 +109,7 @@ func collectObjects(yamlInput string, out io.Writer, logger *slog.Logger) (
110109
mcpRoutes []*aigv1a1.MCPRoute,
111110
aigwBackends []*aigv1a1.AIServiceBackend,
112111
backendSecurityPolicies []*aigv1a1.BackendSecurityPolicy,
113-
backendTLSConfigs []*gwapiv1a3.BackendTLSPolicy,
112+
backendTLSConfigs []*gwapiv1.BackendTLSPolicy,
114113
gws []*gwapiv1.Gateway,
115114
secrets []*corev1.Secret,
116115
envoyProxies []*egv1a1.EnvoyProxy,
@@ -184,7 +183,7 @@ func translateCustomResourceObjects(
184183
mcpRoutes []*aigv1a1.MCPRoute,
185184
aigwBackends []*aigv1a1.AIServiceBackend,
186185
backendSecurityPolicies []*aigv1a1.BackendSecurityPolicy,
187-
backendTLSPolicies []*gwapiv1a3.BackendTLSPolicy,
186+
backendTLSPolicies []*gwapiv1.BackendTLSPolicy,
188187
gws []*gwapiv1.Gateway,
189188
usedDefinedSecrets []*corev1.Secret,
190189
logger *slog.Logger,

0 commit comments

Comments
 (0)