diff options
author | Rin Kuryloski <kuryloskip@vmware.com> | 2023-03-16 17:24:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-16 17:24:28 +0100 |
commit | f73145bd93a107d1162f2d5648f2ccc229b9b0be (patch) | |
tree | e7149099105c287438cece561a5e1ed19692d657 | |
parent | 8e7113c7bf465f49d9c9fe50d7721aec4a3f280a (diff) | |
download | rabbitmq-server-git-f73145bd93a107d1162f2d5648f2ccc229b9b0be.tar.gz |
Fix rabbit_policy:match_all/2 (#7654)
When rabbit_policy:match_all/2 is called with a name of a queue
look up the queue type to correctly match the extra policy granularity
added in #7601
-rw-r--r-- | deps/rabbit/src/rabbit_policy.erl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/deps/rabbit/src/rabbit_policy.erl b/deps/rabbit/src/rabbit_policy.erl index f9b183c49b..7cf8a815a1 100644 --- a/deps/rabbit/src/rabbit_policy.erl +++ b/deps/rabbit/src/rabbit_policy.erl @@ -198,6 +198,9 @@ matches(Q, Policy) when ?is_amqqueue(Q) -> is_applicable(Q, pget(definition, Policy)) andalso match =:= re:run(Name, pget(pattern, Policy), [{capture, none}]) andalso VHost =:= pget(vhost, Policy); +matches(#resource{kind = queue} = Resource, Policy) -> + {ok, Q} = rabbit_amqqueue:lookup(Resource), + matches(Q, Policy); matches(#resource{name = Name, kind = Kind, virtual_host = VHost} = Resource, Policy) -> matches_type(Kind, pget('apply-to', Policy)) andalso is_applicable(Resource, pget(definition, Policy)) andalso |