Skip to content

fix: --update allow updating existing pinned digests#22

Merged
azu merged 2 commits intomainfrom
feature/update-existing-digests
Apr 1, 2026
Merged

fix: --update allow updating existing pinned digests#22
azu merged 2 commits intomainfrom
feature/update-existing-digests

Conversation

@azu
Copy link
Copy Markdown
Owner

@azu azu commented Apr 1, 2026

Summary

Allow --update to re-resolve and replace digests on images that are already pinned. Previously, images with an existing @sha256: digest were skipped during apply, making --update ineffective for already-pinned images.

Changes

  • Remove the inst.Digest != "" early-return guard in applyDockerfile and applyCompose (cmd/pin.go) so that existing digests are overwritten with the newly resolved value
  • Add TestApplyDockerfile_UpdateExistingDigest test to verify digest replacement
  • Update README to document the --update flag usage

Breaking Changes

None

Test Plan

  • go test ./... passes
  • TestApplyDockerfile_UpdateExistingDigest confirms that FROM node:20.11.1@sha256:olddigest is rewritten to the new digest

Open with Devin

Remove the `inst.Digest != ""` guard in applyDockerfile and applyCompose
so that images already pinned with a digest can have their digest
replaced when --update is used. Add test and document the --update flag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
devin-ai-integration[bot]

This comment was marked as resolved.

Without --update, images that already have a digest are now preserved
instead of being re-resolved. This prevents unintended digest changes
during normal pinning runs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@azu azu added the Type: Bug Bug or Bug fixes label Apr 1, 2026
@azu azu merged commit f8a9df2 into main Apr 1, 2026
3 checks passed
@azu azu deleted the feature/update-existing-digests branch April 1, 2026 13:55
@github-actions github-actions Bot mentioned this pull request Apr 1, 2026
azu pushed a commit that referenced this pull request Apr 1, 2026
<!-- Release notes generated using configuration in .github/release.yml
at main -->

## What's Changed
### Bug Fixes
* fix: `--update` allow updating existing pinned digests by @azu in
#22


**Full Changelog**:
v1.0.4...v1.0.5

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug Bug or Bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant