Skip to content
Closed
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
1 change: 0 additions & 1 deletion agent/proxycfg/api_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,6 @@ func (h *handlerAPIGateway) handleRouteConfigUpdate(ctx context.Context, u Updat
}
snap.APIGateway.UpstreamsSet.set(ref, seenUpstreamIDs)
// snap.APIGateway.Hosts = TODO
snap.APIGateway.AreHostsSet = true

// Stop watching any upstreams and discovery chains that have become irrelevant
for upstreamID, cancelDiscoChain := range snap.APIGateway.WatchedDiscoveryChains {
Expand Down
16 changes: 8 additions & 8 deletions agent/proxycfg/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,10 @@ func (r routeUpstreamSet) delete(route structs.ResourceReference) {
delete(r, route)
}

type listenerUpstreamMap map[APIGatewayListenerKey]structs.Upstreams
type listenerRouteUpstreams map[structs.ResourceReference]listenerUpstreamMap
type (
listenerUpstreamMap map[APIGatewayListenerKey]structs.Upstreams
listenerRouteUpstreams map[structs.ResourceReference]listenerUpstreamMap
)

func (l listenerRouteUpstreams) set(route structs.ResourceReference, listener APIGatewayListenerKey, upstreams structs.Upstreams) {
if _, ok := l[route]; !ok {
Expand Down Expand Up @@ -706,12 +708,11 @@ type configSnapshotAPIGateway struct {
BoundGatewayConfig *structs.BoundAPIGatewayConfigEntry

// Hosts is the list of extra host entries to add to our leaf cert's DNS SANs
Hosts []string
AreHostsSet bool
Hosts []string

// LeafCertWatchCancel is a CancelFunc to use when refreshing this gateway's
// leaf cert watch with different parameters.
//LeafCertWatchCancel context.CancelFunc
// LeafCertWatchCancel context.CancelFunc

// Upstreams is a list of upstreams this ingress gateway should serve traffic
// to. This is constructed from the ingress-gateway config entry, and uses
Expand Down Expand Up @@ -1079,7 +1080,6 @@ func (s *ConfigSnapshot) Valid() bool {
s.APIGateway.Leaf != nil &&
s.APIGateway.GatewayConfigLoaded &&
s.APIGateway.BoundGatewayConfigLoaded &&
s.APIGateway.AreHostsSet &&
s.APIGateway.MeshConfigSet
default:
return false
Expand Down Expand Up @@ -1121,8 +1121,8 @@ func (s *ConfigSnapshot) Clone() *ConfigSnapshot {
snap.APIGateway.WatchedDiscoveryChains = nil

// only api-gateway
//snap.APIGateway.LeafCertWatchCancel = nil
//snap.APIGateway.
// snap.APIGateway.LeafCertWatchCancel = nil
// snap.APIGateway.
}

return snap
Expand Down