argo-cd/resource_customizations/argoproj.io/Application/actions/discovery.lua
Vikas Rao 48f18e2905
feat: add toggle-auto-sync resource action for Application (#21564) (#26477)
Signed-off-by: vikasrao23 <vikasrao23@users.noreply.github.com>
Co-authored-by: vikasrao23 <vikasrao23@users.noreply.github.com>
2026-04-07 06:12:32 -04:00

11 lines
424 B
Lua

local actions = {}
local autoSyncEnabled = false
if obj.spec ~= nil and obj.spec.syncPolicy ~= nil and obj.spec.syncPolicy.automated ~= nil then
local enabled = obj.spec.syncPolicy.automated.enabled
autoSyncEnabled = (enabled == true or enabled == nil)
end
actions["toggle-auto-sync"] = {
["displayName"] = autoSyncEnabled and "Disable Auto-Sync" or "Enable Auto-Sync",
["disabled"] = false
}
return actions