Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ kubectl apply -f config/crds/bases/multicluster.x-k8s.io_serviceimports.yaml

# Run the controller against the Kubernetes cluster pointed to by `kubectl config current-context`
make run

# or run it in debug mode
GATEWAY_API_CONTROLLER_LOGLEVEL=debug make run
```

## End-to-End Testing
Expand Down
3 changes: 3 additions & 0 deletions pkg/gateway/model_build_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ func (t *latticeServiceModelBuildTask) buildListener(ctx context.Context) error
if string(*httpBackendRef.Kind) == "ServiceImport" {
is_import = true
targetgroupNamespace = "default"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not related to this change:

should the default namespace be "default" or the HTTPRoute's namespace?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, this is to build the default rule for listener. It needs to pick one target group.
In this case, if 1st one is a service import, it needs to make sure the namespace is set

if httpBackendRef.BackendObjectReference.Namespace != nil {
targetgroupNamespace = string(*httpBackendRef.BackendObjectReference.Namespace)
}
targetgroupName = string(httpBackendRef.BackendObjectReference.Name)

}
Expand Down
3 changes: 3 additions & 0 deletions pkg/gateway/model_build_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ func (t *latticeServiceModelBuildTask) buildRules(ctx context.Context) error {
*/
ruleTG.Name = string(httpBackendRef.BackendObjectReference.Name)
ruleTG.Namespace = "default"
if httpBackendRef.BackendObjectReference.Namespace != nil {
ruleTG.Namespace = string(*httpBackendRef.BackendObjectReference.Namespace)
}
ruleTG.IsServiceImport = true

if httpBackendRef.Weight != nil {
Expand Down