Skip to content

Commit

Permalink
clean pdk/vault.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Oct 16, 2024
1 parent 507c578 commit 0df05a4
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions kong/pdk/vault.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,16 @@ local function new(self)
end


local function should_register_crud_event()
local conf = self.configuration

local not_dbless = conf.database ~= "off" -- postgres
local dp_with_inc_sync = conf.role == "data_plane" and
conf.cluster_incremental_sync

return not_dbless or dp_with_inc_sync
end

local initialized
---
-- Initializes vault.
Expand All @@ -1455,9 +1465,7 @@ local function new(self)

initialized = true

if self.configuration.database ~= "off" or -- postgres
self.configuration.role == "data_plane" and self.configuration.cluster_incremental_sync -- incremental dp
then
if should_register_crud_event() then
self.worker_events.register(handle_vault_crud_event, "crud", "vaults")
end

Expand Down

0 comments on commit 0df05a4

Please sign in to comment.