Skip to content

fix(docker): sanitize inherited runtime config when recreating a container for rollback - #1132

Merged
scttbnsn merged 2 commits into
dev/v1.8from
fix/v1.8-rollback-runtime-config
Sep 8, 2026
Merged

scttbnsn merged 2 commits into
dev/v1.8from
fix/v1.8-rollback-runtime-config

Conversation

@scttbnsn

@scttbnsn scttbnsn commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Roadmap DR-126, found by the DR-93 audit verification.

Docker.recreateContainer passed the log container where the update path passes runtime-config options, so on the auto-rollback (HealthMonitor) and manual restore (backup API) paths the source image was unknown and the UNKNOWN-origin sanitization never fired. An entrypoint or command the newer image introduced was cloned verbatim onto the older image, which lacks the file, and the rolled-back container failed to start.

  • recreateContainer now resolves clone options through getCloneRuntimeConfigOptions with the current spec's image as source and the rollback image as target, the same shape the update path uses.
  • Tests: an Entrypoint materialized from the pre-rollback image is dropped when the target image does not define it; a field the target image also defines is preserved.
  • CHANGELOG Fixed entry.

Port to v1.7 follows.

Changelog

  • 🐛 Fixed rollback container recreation by sanitizing inherited runtime configuration.
  • 🔧 Updated Docker.recreateContainer to use getCloneRuntimeConfigOptions.
  • ✨ Added regression tests for removing stale Entrypoint values and preserving target-image values.
  • ✨ Added a changelog entry.

Concerns

  • Add regression coverage for stale Command values.
  • Port the fix to v1.7.

…ainer for rollback

DR-126: Docker.recreateContainer passed logContainer as cloneContainer's
runtime-config options instead of resolving them through
getCloneRuntimeConfigOptions, the way the update path does. sourceImageConfig,
targetImageConfig and runtimeFieldOrigins were always undefined on rollback,
so sourceImageKnown was false and the UNKNOWN-origin sanitization never
dropped a runtime field the daemon materialized from the newer image (e.g.
Entrypoint), cloning it verbatim onto the older image on auto-rollback and
manual restore.
@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

Deployment failed for project drydock-website with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/codeswhat?upgradeToPro=build-rate-limit

@coderabbitai

coderabbitai Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 30 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 6432d02e-2cec-421d-99f1-e4aa19f2ee7a

📥 Commits

Reviewing files that changed from the base of the PR and between 761f217 and 53993f0.

📒 Files selected for processing (1)
  • app/triggers/providers/docker/Docker.test.ts

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 39238160-a2bb-4a1a-a319-7bfd912278e9

📥 Commits

Reviewing files that changed from the base of the PR and between 916a843 and 761f217.

⛔ Files ignored due to path filters (1)
  • CHANGELOG.md is excluded by !CHANGELOG.md
📒 Files selected for processing (2)
  • app/triggers/providers/docker/Docker.test.ts
  • app/triggers/providers/docker/Docker.ts

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

recreateContainer now uses getCloneRuntimeConfigOptions before rollback cloning. This supplies image configuration and runtime field origins to cloneContainer. Regression tests verify that an origin-unknown Entrypoint is removed when absent from the target image and retained when defined by the target image.

Merge Risk: ⚪ Minimal · up to 761f2

Rollback container recreation now removes runtime Entrypoint values inherited from a newer image when absent from the rollback image, while preserving target-defined values. The covered behavior is ready to merge.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/v1.8-rollback-runtime-config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown

Deployment failed for project drydockdemo-website with the following error:

Resource is limited - try again in 24 hours (more than 100, code: "api-deployments-free-per-day").

Learn More: https://vercel.com/codeswhat?upgradeToPro=build-rate-limit

@biggest-littlest biggest-littlest left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix(docker): sanitize inherited runtime config when recreating a container for rollback (#1132)

@ALARGECOMPANY ALARGECOMPANY left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix(docker): sanitize inherited runtime config when recreating a container for rollback (#1132)

@scttbnsn
scttbnsn merged commit 22e9f6f into dev/v1.8 Sep 8, 2026
29 of 32 checks passed
@scttbnsn
scttbnsn deleted the fix/v1.8-rollback-runtime-config branch September 8, 2026 02:08
scttbnsn added a commit that referenced this pull request Sep 8, 2026
…xes (#1134)

* fix(docker): sanitize inherited runtime config when recreating a container for rollback (#1132)

* fix(docker): sanitize inherited runtime config when recreating a container for rollback

DR-126: Docker.recreateContainer passed logContainer as cloneContainer's
runtime-config options instead of resolving them through
getCloneRuntimeConfigOptions, the way the update path does. sourceImageConfig,
targetImageConfig and runtimeFieldOrigins were always undefined on rollback,
so sourceImageKnown was false and the UNKNOWN-origin sanitization never
dropped a runtime field the daemon materialized from the newer image (e.g.
Entrypoint), cloning it verbatim onto the older image on auto-rollback and
manual restore.

* test(docker): prove rollback keeps only runtime fields the target image defines

(cherry picked from commit 22e9f6f)

* fix(watcher): require an exact variant suffix match when climbing tag families (#1133)

* fix(watcher): require an exact variant suffix match when climbing tag families

* test(watcher): cover loose family matching with include filters and digit precision suffixes

(cherry picked from commit 378a705)

* fix(watcher): require a digit placeholder in precision-only suffix extensions

(cherry picked from commit 5717239)
scttbnsn added a commit that referenced this pull request Oct 29, 2026