Skip to content

Commit f98e365

Browse files
authored
Merge branch 'main' into alert-autofix-13
2 parents 62b1e83 + 0c02025 commit f98e365

File tree

5 files changed

+36
-2
lines changed

5 files changed

+36
-2
lines changed

.github/workflows/publish-doc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
branches:
66
- main
77
- 'release-v*.*.*'
8+
permissions:
9+
contents: write
810
jobs:
911
publish-docs:
1012
runs-on: ubuntu-latest

docs/guides/deploy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ EOF
144144
3. Create the role:
145145

146146
```bash
147-
aws iam create-role --role-name VPCLatticeControllerIAMRole --assume-role-policy-document file://teks-pod-identity-trust-relationship.json --description "IAM Role for AWS Gateway API Controller for VPC Lattice"
147+
aws iam create-role --role-name VPCLatticeControllerIAMRole --assume-role-policy-document file://eks-pod-identity-trust-relationship.json --description "IAM Role for AWS Gateway API Controller for VPC Lattice"
148148
aws iam attach-role-policy --role-name VPCLatticeControllerIAMRole --policy-arn=$VPCLatticeControllerIAMPolicyArn
149149
export VPCLatticeControllerIAMRoleArn=$(aws iam list-roles --query 'Roles[?RoleName==`VPCLatticeControllerIAMRole`].Arn' --output text)
150150
```

pkg/controllers/accesslogpolicy_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func (r *accessLogPolicyReconciler) reconcileUpsert(ctx context.Context, alp *an
182182
targetRefNamespace := k8s.NamespaceOrDefault(alp.Spec.TargetRef.Namespace)
183183
if targetRefNamespace != alp.Namespace {
184184
message := fmt.Sprintf("The targetRef's namespace, \"%s\", does not match the Access Log Policy's"+
185-
" namespace, \"%s\"", string(*alp.Spec.TargetRef.Namespace), alp.Namespace)
185+
" namespace, \"%s\"", targetRefNamespace, alp.Namespace)
186186
r.eventRecorder.Event(alp, corev1.EventTypeWarning, k8s.FailedReconcileEvent, message)
187187
return r.updateAccessLogPolicyStatus(ctx, alp, gwv1alpha2.PolicyReasonInvalid, message)
188188
}

pkg/gateway/model_build_lattice_service.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ func (t *latticeServiceModelBuildTask) buildLatticeService(ctx context.Context)
111111
routeType = core.GrpcRouteType
112112
case *core.TLSRoute:
113113
routeType = core.TlsRouteType
114+
// VPC Lattice requires a custom domain name for TLS listeners
115+
if len(t.route.Spec().Hostnames()) == 0 {
116+
return nil, fmt.Errorf("TLSRoute %s/%s must specify at least one hostname as VPC Lattice requires a custom domain name",
117+
t.route.Namespace(), t.route.Name())
118+
}
114119
default:
115120
return nil, fmt.Errorf("unsupported route type: %T", t.route)
116121
}

pkg/gateway/model_build_lattice_service_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
1717
testclient "sigs.k8s.io/controller-runtime/pkg/client/fake"
1818
gwv1 "sigs.k8s.io/gateway-api/apis/v1"
19+
gwv1alpha2 "sigs.k8s.io/gateway-api/apis/v1alpha2"
1920
)
2021

2122
func Test_LatticeServiceModelBuild(t *testing.T) {
@@ -403,6 +404,31 @@ func Test_LatticeServiceModelBuild(t *testing.T) {
403404
ServiceNetworkNames: []string{vpcLatticeGateway.Name, "gateway2"},
404405
},
405406
},
407+
{
408+
name: "TLSRoute without hostname should fail",
409+
wantIsDeleted: false,
410+
wantErrIsNil: false,
411+
gwClass: vpcLatticeGatewayClass,
412+
gws: []gwv1.Gateway{
413+
vpcLatticeGateway,
414+
},
415+
route: core.NewTLSRoute(gwv1alpha2.TLSRoute{
416+
ObjectMeta: metav1.ObjectMeta{
417+
Name: "service1",
418+
Namespace: "default",
419+
},
420+
Spec: gwv1alpha2.TLSRouteSpec{
421+
CommonRouteSpec: gwv1.CommonRouteSpec{
422+
ParentRefs: []gwv1.ParentReference{
423+
{
424+
Name: gwv1.ObjectName(vpcLatticeGateway.Name),
425+
Namespace: namespacePtr(vpcLatticeGateway.Namespace),
426+
},
427+
},
428+
},
429+
},
430+
}),
431+
},
406432
{
407433
name: "Multiple service networks with one different controller",
408434
wantIsDeleted: false,
@@ -463,6 +489,7 @@ func Test_LatticeServiceModelBuild(t *testing.T) {
463489
k8sSchema := runtime.NewScheme()
464490
clientgoscheme.AddToScheme(k8sSchema)
465491
gwv1.Install(k8sSchema)
492+
gwv1alpha2.Install(k8sSchema)
466493
k8sClient := testclient.NewClientBuilder().WithScheme(k8sSchema).Build()
467494

468495
assert.NoError(t, k8sClient.Create(ctx, tt.gwClass.DeepCopy()))

0 commit comments

Comments
 (0)