Commit 90858c1
feat: automatic image updates via OCI registry digest polling (#8)
* feat: add automatic image update polling via OCI registry digest checks
When spec.image.autoUpdate.enabled is true, the operator periodically
queries the container registry for the current digest of the configured
tag. When a new digest is detected, it injects a pod annotation that
triggers a rolling StatefulSet update.
- AutoUpdateSpec on ImageSpec with enabled/interval fields
- AutoUpdateStatus tracking lastCheckTime, resolvedDigest, lastUpdateTime
- OCI registry client (internal/registry) with bearer token auth flow
- Supports GHCR, Docker Hub, and private registries via imagePullSecrets
- Pod annotation-based rollout (same mechanism as kubectl rollout restart)
- Requeue-based polling (idiomatic controller-runtime, leader-election safe)
- 11 new tests (registry client + StatefulSet annotation injection)
Usage:
spec:
image:
tag: latest
autoUpdate:
enabled: true
interval: 5m
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: remove unused nolint directives flagged by nolintlint
CI uses golangci-lint v2.1.0 which doesn't flag gosec G704 on these
lines, making the nolint:gosec directives unused.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add #nosec G704 for standalone gosec SSRF findings
The registry client makes HTTP requests to operator-configured registry
URLs (not untrusted user input). Add #nosec G704 directives for the
standalone gosec scanner used in CI security scan.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 34add3f commit 90858c1
10 files changed
Lines changed: 760 additions & 17 deletions
File tree
- api/v1alpha1
- charts/paperclip-operator/templates/crds
- cmd
- config/crd/bases
- internal
- controller
- registry
- resources
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
158 | 176 | | |
159 | 177 | | |
160 | 178 | | |
| |||
727 | 745 | | |
728 | 746 | | |
729 | 747 | | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
730 | 752 | | |
731 | 753 | | |
732 | 754 | | |
| |||
775 | 797 | | |
776 | 798 | | |
777 | 799 | | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
778 | 819 | | |
779 | 820 | | |
780 | 821 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3636 | 3636 | | |
3637 | 3637 | | |
3638 | 3638 | | |
| 3639 | + | |
| 3640 | + | |
| 3641 | + | |
| 3642 | + | |
| 3643 | + | |
| 3644 | + | |
| 3645 | + | |
| 3646 | + | |
| 3647 | + | |
| 3648 | + | |
| 3649 | + | |
| 3650 | + | |
| 3651 | + | |
| 3652 | + | |
| 3653 | + | |
| 3654 | + | |
3639 | 3655 | | |
3640 | 3656 | | |
3641 | 3657 | | |
| |||
7410 | 7426 | | |
7411 | 7427 | | |
7412 | 7428 | | |
| 7429 | + | |
| 7430 | + | |
| 7431 | + | |
| 7432 | + | |
| 7433 | + | |
| 7434 | + | |
| 7435 | + | |
| 7436 | + | |
| 7437 | + | |
| 7438 | + | |
| 7439 | + | |
| 7440 | + | |
| 7441 | + | |
| 7442 | + | |
| 7443 | + | |
| 7444 | + | |
| 7445 | + | |
| 7446 | + | |
| 7447 | + | |
| 7448 | + | |
| 7449 | + | |
| 7450 | + | |
| 7451 | + | |
7413 | 7452 | | |
7414 | 7453 | | |
7415 | 7454 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
203 | 204 | | |
204 | 205 | | |
205 | 206 | | |
206 | | - | |
207 | | - | |
208 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
209 | 211 | | |
210 | 212 | | |
211 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3630 | 3630 | | |
3631 | 3631 | | |
3632 | 3632 | | |
| 3633 | + | |
| 3634 | + | |
| 3635 | + | |
| 3636 | + | |
| 3637 | + | |
| 3638 | + | |
| 3639 | + | |
| 3640 | + | |
| 3641 | + | |
| 3642 | + | |
| 3643 | + | |
| 3644 | + | |
| 3645 | + | |
| 3646 | + | |
| 3647 | + | |
| 3648 | + | |
3633 | 3649 | | |
3634 | 3650 | | |
3635 | 3651 | | |
| |||
7404 | 7420 | | |
7405 | 7421 | | |
7406 | 7422 | | |
| 7423 | + | |
| 7424 | + | |
| 7425 | + | |
| 7426 | + | |
| 7427 | + | |
| 7428 | + | |
| 7429 | + | |
| 7430 | + | |
| 7431 | + | |
| 7432 | + | |
| 7433 | + | |
| 7434 | + | |
| 7435 | + | |
| 7436 | + | |
| 7437 | + | |
| 7438 | + | |
| 7439 | + | |
| 7440 | + | |
| 7441 | + | |
| 7442 | + | |
| 7443 | + | |
| 7444 | + | |
| 7445 | + | |
7407 | 7446 | | |
7408 | 7447 | | |
7409 | 7448 | | |
| |||
0 commit comments