Skip to content

Commit c140eb2

Browse files
raweber42ralf.weber
andauthored
fix: resolve argocd ui error for externalSecrets, fixes #23886 (#24232) (#24236)
Signed-off-by: ralf.weber <[email protected]> Co-authored-by: ralf.weber <[email protected]>
1 parent 70dde2c commit c140eb2

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

resource_customizations/external-secrets.io/ExternalSecret/actions/action_test.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@ actionTests:
22
- action: refresh
33
inputPath: testdata/external-secret.yaml
44
expectedOutputPath: testdata/external-secret-updated.yaml
5+
6+
discoveryTests:
7+
- inputPath: testdata/external-secret.yaml
8+
result:
9+
- name: "refresh"

resource_customizations/external-secrets.io/ExternalSecret/actions/discovery.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ local actions = {}
33
local disable_refresh = false
44
local time_units = {"ns", "us", "µs", "ms", "s", "m", "h"}
55
local digits = obj.spec.refreshInterval
6-
for _, time_unit in ipairs(time_units) do
7-
digits, _ = digits:gsub(time_unit, "")
8-
if tonumber(digits) == 0 then
9-
disable_refresh = true
10-
break
6+
if digits ~= nil then
7+
digits = tostring(digits)
8+
for _, time_unit in ipairs(time_units) do
9+
if digits == "0" or digits == "0" .. time_unit then
10+
disable_refresh = true
11+
break
12+
end
1113
end
1214
end
1315

resource_customizations/external-secrets.io/PushSecret/actions/action_test.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@ actionTests:
22
- action: push
33
inputPath: testdata/push-secret.yaml
44
expectedOutputPath: testdata/push-secret-updated.yaml
5+
6+
discoveryTests:
7+
- inputPath: testdata/push-secret.yaml
8+
result:
9+
- name: "push"

resource_customizations/external-secrets.io/PushSecret/actions/discovery.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ local actions = {}
33
local disable_push = false
44
local time_units = {"ns", "us", "µs", "ms", "s", "m", "h"}
55
local digits = obj.spec.refreshInterval
6-
for _, time_unit in ipairs(time_units) do
7-
digits, _ = digits:gsub(time_unit, "")
8-
if tonumber(digits) == 0 then
9-
disable_push = true
10-
break
6+
if digits ~= nil then
7+
digits = tostring(digits)
8+
for _, time_unit in ipairs(time_units) do
9+
if digits == "0" or digits == "0" .. time_unit then
10+
disable_push = true
11+
break
12+
end
1113
end
1214
end
1315

0 commit comments

Comments
 (0)