-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure ServiceIntentions aren't resynced
Consul will internally sort the array of ServiceIntention sources by precedence. For example, if it receives: ``` sources: - name: "*" action: allow - name: bar action: allow ``` It will return it in precedence sorted order: ``` sources: - name: bar action: allow - name: "*" action: allow ``` This sorting breaks our MatchesConsul function because we think the resource has changed and so we will update it continually since it will never match. This change uses gocmp's SortSlices to re-sort the sources array so that both the Kube resource and the Consul resource can be compared despite Consul's sorting. We use a JSON encoded representation of the source element with the fields that Consul set automatically zero'd out.
- Loading branch information
Showing
3 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters