Skip to content

Commit e5d805e

Browse files
Cluster tags: set unconditionally
Otherwise once set, it would not be possible to change them by updating rabbitmq.conf
1 parent eeea517 commit e5d805e

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

deps/rabbit/src/rabbit.erl

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,18 +1150,13 @@ pg_local_scope(Prefix) ->
11501150
-spec maybe_set_cluster_tags() -> 'ok'.
11511151

11521152
maybe_set_cluster_tags() ->
1153-
maybe
1154-
not_found ?= rabbit_runtime_parameters:lookup_global(cluster_tags),
1155-
Tags = application:get_env(rabbit, cluster_tags, []),
1156-
false ?= Tags == [],
1157-
?LOG_INFO("Setting cluster tags...",
1158-
#{domain => ?RMQLOG_DOMAIN_GLOBAL}),
1159-
rabbit_runtime_parameters:set_global(cluster_tags, Tags, <<"internal_user">>)
1160-
else
1161-
_ ->
1162-
% Cluster tags are either already set (Other node, earlier start, CLI)
1163-
% Do nothing?
1164-
ok
1153+
Tags = application:get_env(rabbit, cluster_tags, []),
1154+
case Tags of
1155+
[] -> ok;
1156+
Value ->
1157+
?LOG_DEBUG("Seeding cluster tags from application environment key...",
1158+
#{domain => ?RMQLOG_DOMAIN_GLOBAL}),
1159+
rabbit_runtime_parameters:set_global(cluster_tags, Value, <<"internal_user">>)
11651160
end.
11661161

11671162
-spec maybe_insert_default_data() -> 'ok'.

0 commit comments

Comments
 (0)