Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.
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 .changelog/308.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
Fix intentions syncing for multiple gateways bound to a single route.
```
7 changes: 2 additions & 5 deletions internal/commands/server/k8s_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2000,12 +2000,9 @@ func TestRouteParentRefChange(t *testing.T) {
Body: serviceOne.Name,
}, nil, "service one not routable from first gateway in allotted time")

// TODO: Routing from multiple gateways is not yet supported.
// When implemented, this check should be updated to wait for
// http.StatusOK and serviceOne.Name as the body content prefix.
checkRoute(t, secondGatewayCheckPort, "/", httpResponse{
StatusCode: http.StatusServiceUnavailable,
Body: "no healthy upstream",
StatusCode: http.StatusOK,
Body: serviceOne.Name,
}, nil, "service one not returning expected error from second gateway in allotted time")

// Update httpRoute from remote, then remove first gateway ParentRef
Expand Down
4 changes: 2 additions & 2 deletions internal/consul/intentions.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,10 @@ func (r *IntentionsReconciler) updateIntentionSources(name api.CompoundServiceNa
}

func (r *IntentionsReconciler) getOrInitIntention(name api.CompoundServiceName) (intention *api.ServiceIntentionsConfigEntry, idx uint64, err error) {
entry, meta, err := r.consulConfig.Get(api.ServiceIntentions, name.Name, &api.QueryOptions{Namespace: name.Namespace})
entry, _, err := r.consulConfig.Get(api.ServiceIntentions, name.Name, &api.QueryOptions{Namespace: name.Namespace})
if err == nil {
intention = entry.(*api.ServiceIntentionsConfigEntry)
return intention, meta.LastIndex, nil
return intention, entry.GetModifyIndex(), nil
}

if strings.Contains(err.Error(), "Unexpected response code: 404") {
Expand Down