Skip to content

Commit 448a8db

Browse files
author
Kate Osborn
committed
Use type in call to GetPointer where possible
1 parent 7e14069 commit 448a8db

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

internal/state/graph/gateway_test.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,12 @@ func TestBuildGateway(t *testing.T) {
148148
}
149149
listenerAllowedRoutes := v1beta1.Listener{
150150
Name: "listener-with-allowed-routes",
151-
Hostname: (*v1beta1.Hostname)(helpers.GetPointer("foo.example.com")),
151+
Hostname: helpers.GetPointer[v1beta1.Hostname]("foo.example.com"),
152152
Port: 80,
153153
Protocol: v1beta1.HTTPProtocolType,
154154
AllowedRoutes: &v1beta1.AllowedRoutes{
155155
Kinds: []v1beta1.RouteGroupKind{
156-
{Kind: "HTTPRoute", Group: helpers.GetPointer(v1beta1.Group(v1beta1.GroupName))},
156+
{Kind: "HTTPRoute", Group: helpers.GetPointer[v1beta1.Group](v1beta1.GroupName)},
157157
},
158158
Namespaces: &v1beta1.RouteNamespaces{
159159
From: helpers.GetPointer(v1beta1.NamespacesFromSelector),
@@ -173,9 +173,9 @@ func TestBuildGateway(t *testing.T) {
173173
Mode: helpers.GetPointer(v1beta1.TLSModeTerminate),
174174
CertificateRefs: []v1beta1.SecretObjectReference{
175175
{
176-
Kind: (*v1beta1.Kind)(helpers.GetPointer("Secret")),
176+
Kind: helpers.GetPointer[v1beta1.Kind]("Secret"),
177177
Name: "secret",
178-
Namespace: (*v1beta1.Namespace)(helpers.GetPointer("test")),
178+
Namespace: helpers.GetPointer[v1beta1.Namespace]("test"),
179179
},
180180
},
181181
}
@@ -184,9 +184,9 @@ func TestBuildGateway(t *testing.T) {
184184
Mode: helpers.GetPointer(v1beta1.TLSModeTerminate),
185185
CertificateRefs: []v1beta1.SecretObjectReference{
186186
{
187-
Kind: (*v1beta1.Kind)(helpers.GetPointer("Secret")),
187+
Kind: helpers.GetPointer[v1beta1.Kind]("Secret"),
188188
Name: "does-not-exist",
189-
Namespace: (*v1beta1.Namespace)(helpers.GetPointer("test")),
189+
Namespace: helpers.GetPointer[v1beta1.Namespace]("test"),
190190
},
191191
},
192192
}
@@ -195,9 +195,9 @@ func TestBuildGateway(t *testing.T) {
195195
Mode: helpers.GetPointer(v1beta1.TLSModeTerminate),
196196
CertificateRefs: []v1beta1.SecretObjectReference{
197197
{
198-
Kind: (*v1beta1.Kind)(helpers.GetPointer("Secret")),
198+
Kind: helpers.GetPointer[v1beta1.Kind]("Secret"),
199199
Name: "secret",
200-
Namespace: (*v1beta1.Namespace)(helpers.GetPointer("diff-ns")),
200+
Namespace: helpers.GetPointer[v1beta1.Namespace]("diff-ns"),
201201
},
202202
},
203203
}
@@ -408,7 +408,7 @@ func TestBuildGateway(t *testing.T) {
408408
{
409409
Group: "core",
410410
Kind: "Secret",
411-
Name: helpers.GetPointer(v1beta1.ObjectName("secret")),
411+
Name: helpers.GetPointer[v1beta1.ObjectName]("secret"),
412412
},
413413
},
414414
},

0 commit comments

Comments
 (0)