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
fix(airgap): make push-images idempotent against tag-immutable registries (#5940)
* fix(airgap): skip pushing manifests that already exist on destination
Add a manifest precheck before each image copy and enable
OptimizeDestinationImageAlreadyExists on copy.Options. KOTS
push-images now succeeds against tag-immutable registries
(Artifactory, Harbor, JFrog, Quay, WORM-backed OCI) when
re-pushing a release whose tags are unchanged from a prior push.
The precheck opens the destination ref, fetches its current
manifest, and compares the digest against the source. If they
match, the copy is skipped — no PUT is issued, so the registry
never sees an overwrite attempt to reject. Destination errors
fall through to the normal push path; only source failures bubble
up. OptimizeDestinationImageAlreadyExists adds per-child coverage
in case the parent manifest list differs but children are present.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(airgap): log swallowed destination errors and document precheck gap
Greptile review feedback on #5940:
- Surface transient/auth/rate-limit failures on the destination side at
debug level so operators have a trail when the precheck isn't firing
as expected. Behavior is unchanged: these errors still fall through
to the normal push path.
- Document the known byte-level comparison gap on destinationManifestMatches:
if a prior push succeeded through the copy library and the library
silently mutated the manifest bytes, the digests will never match and
subsequent pushes to tag-immutable destinations still fail.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Changes
Signed-off-by: Evans Mungai <evans@replicated.com>
* Attempt comparison after library modifications of manifest
Signed-off-by: Evans Mungai <evans@replicated.com>
* fix(airgap): make idempotent-push behavior opt-in
The always-on precheck and OptimizeDestinationImageAlreadyExists short-circuited
the copy library's manifest write events, which the online smoke-test e2e
asserts on ("Writing manifest to image destination" never appears in the UI).
Gate both behind a new SkipExistingImages flag on CopyImageOptions /
PushImagesOptions / ProcessImageOptions / RewriteOptions. Wire it through:
- CLI: --skip-existing-images on `kots admin-console push-images`
- Admin Console: "Skip Pushing Images That Already Exist" checkbox in
AirgapRegistrySettings, plumbed via UpdateAppRegistryRequest →
registry.RewriteImages → rewrite.Rewrite → CopyOnlineImages.
Default behavior is unchanged; opt-in only when re-pushing to registries
that enforce tag immutability (Artifactory, Harbor, JFrog, Quay, WORM-backed
OCI).
Signed-off-by: Evans Mungai <evans@replicated.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Remove unwanted registry refs
Signed-off-by: Evans Mungai <evans@replicated.com>
* Log level comment fix
Signed-off-by: Evans Mungai <evans@replicated.com>
---------
Signed-off-by: Evans Mungai <evans@replicated.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cmd.Flags().String("registry-username", "", "user name to use to authenticate with the registry")
70
70
cmd.Flags().String("registry-password", "", "password to use to authenticate with the registry")
71
71
cmd.Flags().Bool("skip-registry-check", false, "skip the connectivity test and validation of the provided registry information")
72
+
cmd.Flags().Bool("skip-existing-images", false, "skip pushing images whose manifest is already present at the destination tag. Required when re-pushing to registries that enforce tag immutability.")
72
73
73
74
cmd.Flags().String("kotsadm-tag", "", "set to override the tag of kotsadm. this may create an incompatible deployment because the version of kots and kotsadm are designed to work together")
0 commit comments