Fix Docker sidecar volume names for registry refs with ports#87
Draft
jasonkeung wants to merge 1 commit into
Draft
Fix Docker sidecar volume names for registry refs with ports#87jasonkeung wants to merge 1 commit into
jasonkeung wants to merge 1 commit into
Conversation
The docker backend derives sidecar volume names from the image repo name, but only replaced '/' characters. Image refs that include a registry host with a port (e.g. localhost:5000/warp-agent:tag) kept the ':' and failed volume creation with: "localhost:5000-warp-agent-<digest>" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed Replace every character outside [a-zA-Z0-9_.-] instead, and add unit tests covering port-qualified registry refs. Found while validating warp-agent-docker#120 against a local docker-backend oz stack using a localhost:5000 registry for locally built sidecar images. Co-Authored-By: Oz <oz-agent@warp.dev>
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.
Description
The Docker backend derives sidecar volume names from the image repository name but only replaces
/characters. Image refs whose registry host includes a port (e.g.localhost:5000/warp-agent:pr120) keep the:and volume creation fails:This replaces every character outside
[a-zA-Z0-9_.-]when building the volume name, and adds unit tests covering port-qualified registry refs.Context
Found while validating warpdotdev/warp-agent-docker#120 end-to-end against a local docker-backend Oz stack (
warp-server/script/oz-local --worker-backend docker), where locally built sidecar images are served from alocalhost:5000registry. Any self-hosted worker pulling sidecars from a port-qualified private registry would hit the same failure.Validation
go test ./internal/worker/ -run TestSanitizeVolumeNamepasses.localhost:5000/warp-agent:pr120as the sidecar image create the volumelocalhost-5000-warp-agent-cdd2970ebf33and run to completion on the docker backend.Conversation: https://staging.warp.dev/conversation/b7db9360-e563-44c7-b2b2-a6c30dbc7645
Run: https://oz.staging.warp.dev/runs/019ebca1-59ed-7e05-8fa2-042278a8e219
This PR was generated with Oz.