Skip to content

Commit

Permalink
gatewayapi_v1alpha2 -> v1 where possible
Browse files Browse the repository at this point in the history
Signed-off-by: Sunjay Bhatia <sunjayb@vmware.com>
  • Loading branch information
sunjayBhatia committed May 8, 2024
1 parent f870596 commit 5b88d5a
Show file tree
Hide file tree
Showing 16 changed files with 253 additions and 254 deletions.
260 changes: 130 additions & 130 deletions internal/dag/builder_test.go

Large diffs are not rendered by default.

80 changes: 40 additions & 40 deletions internal/dag/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ func TestKubernetesCacheInsert(t *testing.T) {
},
Spec: gatewayapi_v1alpha3.BackendTLSPolicySpec{
Validation: gatewayapi_v1alpha3.BackendTLSPolicyValidation{
CACertificateRefs: []gatewayapi_v1alpha2.LocalObjectReference{
CACertificateRefs: []gatewayapi_v1.LocalObjectReference{
{
Kind: "Secret",
Name: "ca",
Expand Down Expand Up @@ -428,7 +428,7 @@ func TestKubernetesCacheInsert(t *testing.T) {
},
Spec: gatewayapi_v1alpha3.BackendTLSPolicySpec{
Validation: gatewayapi_v1alpha3.BackendTLSPolicyValidation{
CACertificateRefs: []gatewayapi_v1alpha2.LocalObjectReference{
CACertificateRefs: []gatewayapi_v1.LocalObjectReference{
{
Kind: "ConfigMap",
Name: "ca",
Expand Down Expand Up @@ -811,8 +811,8 @@ func TestKubernetesCacheInsert(t *testing.T) {
Namespace: "default",
},
Spec: gatewayapi_v1alpha2.TLSRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef("projectcontour", "contour"),
},
},
Expand Down Expand Up @@ -840,8 +840,8 @@ func TestKubernetesCacheInsert(t *testing.T) {
Namespace: "tlsroute",
},
Spec: gatewayapi_v1alpha2.TLSRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef("projectcontour", "contour"),
},
},
Expand Down Expand Up @@ -869,8 +869,8 @@ func TestKubernetesCacheInsert(t *testing.T) {
Namespace: "default",
},
Spec: gatewayapi_v1alpha2.TLSRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef("projectcontour", "contour"),
},
},
Expand Down Expand Up @@ -1022,8 +1022,8 @@ func TestKubernetesCacheInsert(t *testing.T) {
Namespace: "default",
},
Spec: gatewayapi_v1alpha2.TLSRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef("gateway-namespace", "gateway-name"),
},
},
Expand Down Expand Up @@ -1055,8 +1055,8 @@ func TestKubernetesCacheInsert(t *testing.T) {
Namespace: "default",
},
Spec: gatewayapi_v1.GRPCRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef("gateway-namespace", "gateway-name"),
},
},
Expand Down Expand Up @@ -1088,8 +1088,8 @@ func TestKubernetesCacheInsert(t *testing.T) {
Namespace: "default",
},
Spec: gatewayapi_v1alpha2.TCPRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef("gateway-namespace", "gateway-name"),
},
},
Expand Down Expand Up @@ -1131,8 +1131,8 @@ func TestKubernetesCacheInsert(t *testing.T) {
Namespace: "default",
},
Spec: gatewayapi_v1.HTTPRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef("projectcontour", "contour"),
},
},
Expand Down Expand Up @@ -1375,8 +1375,8 @@ func TestKubernetesCacheRemove(t *testing.T) {
Namespace: "default",
},
Spec: gatewayapi_v1alpha2.TLSRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef("projectcontour", "contour"),
},
},
Expand Down Expand Up @@ -1410,8 +1410,8 @@ func TestKubernetesCacheRemove(t *testing.T) {
Namespace: "default",
},
Spec: gatewayapi_v1alpha2.TLSRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef("projectcontour", "contour"),
},
},
Expand Down Expand Up @@ -1653,8 +1653,8 @@ func TestKubernetesCacheRemove(t *testing.T) {
Namespace: "default",
},
Spec: gatewayapi_v1alpha2.TLSRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef("default", "gateway"),
},
},
Expand All @@ -1667,8 +1667,8 @@ func TestKubernetesCacheRemove(t *testing.T) {
Namespace: "default",
},
Spec: gatewayapi_v1alpha2.TLSRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef("default", "gateway"),
},
},
Expand Down Expand Up @@ -1710,8 +1710,8 @@ func TestKubernetesCacheRemove(t *testing.T) {
Namespace: "default",
},
Spec: gatewayapi_v1.GRPCRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef("default", "gateway"),
},
},
Expand All @@ -1724,8 +1724,8 @@ func TestKubernetesCacheRemove(t *testing.T) {
Namespace: "default",
},
Spec: gatewayapi_v1.GRPCRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef("default", "gateway"),
},
},
Expand Down Expand Up @@ -1767,8 +1767,8 @@ func TestKubernetesCacheRemove(t *testing.T) {
Namespace: "default",
},
Spec: gatewayapi_v1alpha2.TCPRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef("default", "gateway"),
},
},
Expand All @@ -1781,8 +1781,8 @@ func TestKubernetesCacheRemove(t *testing.T) {
Namespace: "default",
},
Spec: gatewayapi_v1alpha2.TCPRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef("default", "gateway"),
},
},
Expand Down Expand Up @@ -2236,8 +2236,8 @@ func TestServiceTriggersRebuild(t *testing.T) {
Namespace: namespace,
},
Spec: gatewayapi_v1alpha2.TLSRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef("projectcontour", "contour"),
},
},
Expand All @@ -2255,8 +2255,8 @@ func TestServiceTriggersRebuild(t *testing.T) {
Namespace: namespace,
},
Spec: gatewayapi_v1alpha2.TCPRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef("projectcontour", "contour"),
},
},
Expand Down Expand Up @@ -2774,8 +2774,8 @@ func TestRouteTriggersRebuild(t *testing.T) {
Namespace: namespace,
},
Spec: gatewayapi_v1alpha2.TLSRouteSpec{
CommonRouteSpec: gatewayapi_v1alpha2.CommonRouteSpec{
ParentRefs: []gatewayapi_v1alpha2.ParentReference{
CommonRouteSpec: gatewayapi_v1.CommonRouteSpec{
ParentRefs: []gatewayapi_v1.ParentReference{
gatewayapi.GatewayParentRef(parentRefNamespace, parentRefName),
},
},
Expand Down Expand Up @@ -3004,9 +3004,9 @@ func TestLookupBackendTLSPolicyByTargetRef(t *testing.T) {
}
return gatewayapi_v1alpha2.LocalPolicyTargetReferenceWithSectionName{
LocalPolicyTargetReference: gatewayapi_v1alpha2.LocalPolicyTargetReference{
Group: gatewayapi_v1alpha2.Group(group),
Group: gatewayapi_v1.Group(group),
Kind: gatewayapi_v1alpha2.Kind(kind),
Name: gatewayapi_v1alpha2.ObjectName(name),
Name: gatewayapi_v1.ObjectName(name),
},
SectionName: sn,
}
Expand Down
2 changes: 1 addition & 1 deletion internal/dag/gatewayapi_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2136,7 +2136,7 @@ func (p *GatewayAPIProcessor) computeBackendTLSPolicies(routeNamespace string, b
var upstreamValidation *PeerValidationContext
var upstreamTLS *UpstreamTLS

var backendRefGroup gatewayapi_v1alpha2.Group
var backendRefGroup gatewayapi_v1.Group
if backendRef.Group != nil {
backendRefGroup = *backendRef.Group
}
Expand Down
Loading

0 comments on commit 5b88d5a

Please sign in to comment.