You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# description: Fast linters runner for Go. Note that only modified files are linted, so linters like 'unused' that need to scan all files won't work as expected.
19
-
# entry: golangci-lint run --fix
20
-
# types: [go]
21
-
# language: golang
22
-
# require_serial: true
23
-
# pass_filenames: false
24
-
# - id: golangci-lint-fmt
25
-
# name: golangci-lint-fmt
26
-
# description: Fast linters runner for Go. Note that only modified files are linted, so linters like 'unused' that need to scan all files won't work as expected.
27
-
# entry: golangci-lint fmt
28
-
# types: [go]
29
-
# language: golang
30
-
# require_serial: true
31
-
# pass_filenames: false
15
+
16
+
- repo: local
17
+
hooks:
18
+
- id: shellcheck
19
+
name: Shellcheck
20
+
entry: shellcheck -x
21
+
language: system
22
+
files: ^(scripts/|run.sh$|.*\.sh$)
23
+
24
+
- id: gitleaks
25
+
name: Gitleaks (secrets scanner)
26
+
entry: gitleaks detect
27
+
pass_filenames: false
28
+
always_run: true
29
+
language: system
30
+
31
+
- id: codespell
32
+
name: Codespell (spell check docs)
33
+
entry: codespell
34
+
language: system
35
+
# Only run on docs and README to avoid noisy suggestions in tests/code
Copy file name to clipboardExpand all lines: README.md
+66-1Lines changed: 66 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,9 @@ This project implements a Kubernetes operator that allows you to specify a TTL (
13
13
## Features
14
14
- Deploys as an operator.
15
15
- Dynamically deploys a controller for each configured GVK.
16
-
- Controllers are only managing one GVK each, increasing scaleability.
16
+
- Controllers are only managing one GVK each, increasing scalability.
17
17
- Leader election support for high availability.
18
+
- Custom cleanup scripts via Kubernetes Jobs before object deletion.
18
19
19
20
## Architecture
20
21
The operator is designed to be highly extensible and scalable. Once deployed, the operator looks for CRDs and for each GVK specified in a CRD, a dedicated controller is launched.
@@ -134,6 +135,64 @@ Set by the controller. RFC3339 UTC timestamp for when the object will expire. Sa
134
135
135
136
Set by the controller. Human readable status or validation errors.
136
137
138
+
### Cleanup Job Annotations
139
+
140
+
The controller supports running custom cleanup scripts via Kubernetes Jobs before deleting expired objects. This is useful for backing up data, notifying external systems, or cleaning up related resources.
**Optional** (default: `default`). ServiceAccount to run the cleanup Job as. Use this to grant the cleanup script access to necessary permissions and secrets.
154
+
155
+
#### object-lease-controller.ullberg.io/job-image
156
+
157
+
**Optional** (default: `bitnami/kubectl:latest`). Container image for running the cleanup script.
158
+
159
+
#### object-lease-controller.ullberg.io/job-wait
160
+
161
+
**Optional** (default: `false`). If `true`, the controller waits for the Job to complete before deleting the object. If `false`, the Job runs in fire-and-forget mode.
**Optional** (default: `5m`). Maximum time to wait for Job completion when `job-wait` is `true`. Supports flexible duration format (e.g., `10m`, `1h`, `30s`).
166
+
167
+
#### object-lease-controller.ullberg.io/job-ttl
168
+
169
+
**Optional** (default: `300`). TTL in seconds for Job cleanup via `ttlSecondsAfterFinished`.
0 commit comments