Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Job examples #124

Merged
merged 1 commit into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/getting_started/features/schedule/schedule.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The k8s-cleaner is able to accept the below schedule formats.
hs = {}
hs.matching = false
if obj.status ~= nil then
if obj.status.completionTime ~= nil and obj.status.succeeded > 0 and obj.status.active == 0 then
if obj.status.completionTime ~= nil and obj.status.succeeded > 0 then
hs.matching = true
end
end
Expand All @@ -77,7 +77,7 @@ kind: Cleaner
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"apps.projectsveltos.io/v1alpha1","kind":"Cleaner","metadata":{"annotations":{},"name":"completed-jobs"},"spec":{"action":"Delete","resourcePolicySet":{"resourceSelectors":[{"evaluate":"function evaluate()\n hs = {}\n hs.matching = false\n if obj.status ~= nil then\n if obj.status.completionTime ~= nil and obj.status.succeeded \u003e 0 and obj.status.active == 0 then\n hs.matching = true\n end\n end\n return hs\nend\n","group":"batch","kind":"Job","version":"v1"}]},"schedule":"@every 1h30m"}}
{"apiVersion":"apps.projectsveltos.io/v1alpha1","kind":"Cleaner","metadata":{"annotations":{},"name":"completed-jobs"},"spec":{"action":"Delete","resourcePolicySet":{"resourceSelectors":[{"evaluate":"function evaluate()\n hs = {}\n hs.matching = false\n if obj.status ~= nil then\n if obj.status.completionTime ~= nil and obj.status.succeeded \u003e 0 then\n hs.matching = true\n end\n end\n return hs\nend\n","group":"batch","kind":"Job","version":"v1"}]},"schedule":"@every 1h30m"}}
creationTimestamp: "2024-08-03T14:09:49Z"
finalizers:
- projectsveltos.io/cleaner-finalizer
Expand All @@ -94,7 +94,7 @@ spec:
hs = {}
hs.matching = false
if obj.status ~= nil then
if obj.status.completionTime ~= nil and obj.status.succeeded > 0 and obj.status.active == 0 then
if obj.status.completionTime ~= nil and obj.status.succeeded > 0 then
hs.matching = true
end
end
Expand Down
2 changes: 1 addition & 1 deletion examples-unused-resources/jobs/completed_jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
hs = {}
hs.matching = false
if obj.status ~= nil then
if obj.status.completionTime ~= nil and obj.status.succeeded > 0 and obj.status.active == 0 then
if obj.status.completionTime ~= nil and obj.status.succeeded > 0 then
hs.matching = true
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
hs = {}
hs.matching = false
if obj.status ~= nil then
if obj.status.completionTime ~= nil and obj.status.succeeded > 0 and obj.status.active == 0 then
if obj.status.completionTime ~= nil and obj.status.succeeded > 0 then
hs.matching = true
end
end
Expand Down
Loading