Commit eca922f
committed
image/copy: Add guards for unsupported digest forcing scenarios
Add guards and limitations for cases where digest forcing is not yet
supported or incompatible with certain features:
1. Multi-arch images (multiple.go):
- Not yet implemented; needs per-instance config digest updates
- Fail cleanly with clear error message
- See #552 (comment)
2. Docker schema1 manifests (single.go):
- Lack separate config descriptor, only support sha256
- Fail early when forcing non-sha256 algorithms
3. zstd:chunked compression (single.go):
- Uses sha256 for internal TOC and chunk digests
- Fall back to plain zstd when forcing non-sha256
- Fail if requireCompressionFormatMatch is set
4. PutBlobPartial optimization (single.go):
- Incompatible with forcing different digest (needs full layer)
- Disable partial pull when algorithms don't match
5. Blob reuse optimization (single.go):
- Skip blob reuse when digest algorithms don't match
- Future: could support cross-digest reuse via BlobInfoCache
These guards ensure clean failures and fallbacks rather than silent
corruption or confusing errors.
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>1 parent f167c0d commit eca922f
2 files changed
Lines changed: 34 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
211 | 217 | | |
212 | 218 | | |
213 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
783 | 783 | | |
784 | 784 | | |
785 | 785 | | |
786 | | - | |
787 | | - | |
788 | | - | |
789 | | - | |
790 | | - | |
791 | | - | |
792 | | - | |
793 | | - | |
794 | | - | |
795 | | - | |
796 | | - | |
797 | | - | |
798 | | - | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
799 | 814 | | |
800 | 815 | | |
801 | 816 | | |
| |||
0 commit comments