Skip to content

Commit e127d53

Browse files
authored
chore(clustering) early exit init/init_worker on non-hybrid modes (Kong#6786)
1 parent 2591f85 commit e127d53

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

kong/clustering.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,15 +712,21 @@ end
712712
function _M.init(conf)
713713
assert(conf, "conf can not be nil", 2)
714714

715-
if conf.role == "data_plane" or conf.role == "control_plane" then
716-
assert(init_mtls(conf))
715+
if conf.role ~= "data_plane" and conf.role ~= "control_plane" then
716+
return
717717
end
718+
719+
assert(init_mtls(conf))
718720
end
719721

720722

721723
function _M.init_worker(conf)
722724
assert(conf, "conf can not be nil", 2)
723725

726+
if conf.role ~= "data_plane" and conf.role ~= "control_plane" then
727+
return
728+
end
729+
724730
PLUGINS_LIST = assert(kong.db.plugins:get_handlers())
725731
table.sort(PLUGINS_LIST, function(a, b)
726732
return a.name:lower() < b.name:lower()

0 commit comments

Comments
 (0)