feat: automatic image updates via OCI registry digest polling - #8
Merged
Conversation
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>
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds automatic image update support to the operator. When enabled, the operator periodically polls the container registry for new image digests and triggers rolling updates automatically.
Usage
When a new image is pushed to
ghcr.io/paperclipinc/paperclip:latest, the operator detects the digest change within the polling interval and triggers a rolling restart of the StatefulSet.How it works
HEAD /v2/{name}/manifests/{tag})Docker-Content-Digestheader against the last known digestpaperclip.inc/resolved-digest)Implementation
AutoUpdateSpec(enabled, interval) onImageSpec,AutoUpdateStatusonInstanceStatusinternal/registry): OCI registry client with bearer token auth flow, supports GHCR, Docker Hub, and private registries viaimagePullSecretsreconcileAutoUpdatemethod using requeue-based polling (leader-election safe, no background goroutines)kubectl rollout restart)Test plan
🤖 Generated with Claude Code