Skip to content
Open
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
23 changes: 14 additions & 9 deletions agent/consul/config_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,23 @@ func (c *ConfigEntry) ResolveServiceConfig(args *structs.ServiceConfigRequest, r
return err
}

// Compute the resolved service config.
// This merges together all relevant config entries.
// After this we compare the config with the old hash
// to see if anything changed.
thisReply, err := configentry.ComputeResolvedServiceConfig(
args,
entries,
c.logger,
)
if err != nil {
return err
}

// Generate a hash of the config entry content driving this
// response. Use it to determine if the response is identical to a
// prior wakeup.
newHash, err := hashstructure_v2.Hash(entries, hashstructure_v2.FormatV2, nil)
newHash, err := hashstructure_v2.Hash(thisReply, hashstructure_v2.FormatV2, nil)
if err != nil {
return fmt.Errorf("error hashing reply for spurious wakeup suppression: %w", err)
}
Expand All @@ -500,14 +513,6 @@ func (c *ConfigEntry) ResolveServiceConfig(args *structs.ServiceConfigRequest, r
ranOnce = true
}

thisReply, err := configentry.ComputeResolvedServiceConfig(
args,
entries,
c.logger,
)
if err != nil {
return err
}
thisReply.Index = index

*reply = *thisReply
Expand Down
Loading