Repository navigation
fix(mounts): normalize volume field casing to lowercase with backward compatibility - #573
Open
madejackson wants to merge 1 commit into
Open
madejackson wants to merge 1 commit into
madejackson wants to merge 1 commit into
Conversation
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Cosmos Developer.
|
madejackson
force-pushed
the
fix/normalize-mount-casing
branch
from
August 24, 2026 08:55
13aa266 to
b91715d
Compare
madejackson
force-pushed
the
fix/normalize-mount-casing
branch
2 times, most recently
from
August 24, 2026 10:37
c6d5fb7 to
73d4993
Compare
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Cosmos Developer.
|
madejackson
force-pushed
the
fix/normalize-mount-casing
branch
from
August 24, 2026 11:02
73d4993 to
ca8dc24
Compare
This was referenced Sep 1, 2026
madejackson
added a commit
to aseracorp/Cosmos-Server
that referenced
this pull request
Sep 5, 2026
… - introduces the CosmosMount type this feature builds on)
madejackson
force-pushed
the
fix/normalize-mount-casing
branch
2 times, most recently
from
September 8, 2026 18:41
d7e6d5d to
0292ae2
Compare
madejackson
added a commit
to aseracorp/Cosmos-Server
that referenced
this pull request
Sep 8, 2026
…n-comments Both stacked PRs share mount/volume/export code and depend on the same dependency chain (azukaar#573 lowercase CosmosMount, azukaar#585 DurationStr). Resolve the additive conflicts: - mount.go: take azukaar#599's superset (SubPath/ReadOnly/NoCopy + helpers) - volumes.jsx / newServiceForm.jsx: azukaar#599's Subpath/Read-only/NoCopy columns and file-picker 'any' (for file subpaths) layered on azukaar#590's lowercase fields - api_blueprint.go: keep azukaar#590's omitempty tags (hide empty fields in the compose editor) + healthcheck nil-guard refactor; keep azukaar#599's ValidateMountConflicts + volume-subpath auto-create block - export.go: keep azukaar#590's FormatShmSize + healthcheck pointer alloc; take azukaar#599's HostConfig.Mounts/FromDockerMount volume export (subpath-preserving) - regenerate api-docs + go-sdk from merged code (CosmosMount fields, DurationStr healthcheck fields, mount readOnly/subpath/noCopy) Verified: go build ./... , go test ./src/..., vite client-build all pass.
madejackson
force-pushed
the
fix/normalize-mount-casing
branch
2 times, most recently
from
October 9, 2026 11:35
e2c072b to
00fb9d7
Compare
… compat Replace raw Docker SDK mount.Mount usage with CosmosMount type that uses lowercase JSON tags (type, source, target, read_only). This makes volume definitions consistent across market templates, imports, and runtime container management. Previously, market templates used lowercase (source, target) while runtime container volumes from the Docker SDK were serialized with uppercase (Source, Target, etc.) due to Go's exported-field naming. Changes: New CosmosMount in src/docker/mount.go with lowercase JSON tags and conversion helpers (ToDockerMount, FromDockerMount, etc.) ContainerCreateRequestContainer.Volumes: []mount.Mount -> []CosmosMount ContainerForm.Volumes: []mount.Mount -> []CosmosMount (tag Volumes->volumes) ExportContainer(): Convert Docker mount.Mount -> CosmosMount on output CreateService()/UpdateContainer(): Convert CosmosMount -> mount.Mount on input Frontend volumes.jsx: Use lowercase field names throughout Frontend docker-compose.jsx/newServiceForm.jsx: Map to lowercase Backward compatibility: Custom UnmarshalJSON on CosmosMount accepts both lowercase (canonical) and uppercase (legacy Docker SDK) field names on input. Serialization always outputs lowercase so clients gradually migrate. Fixes casing inconsistency in volume handling across compose import, container create, container update, and container export flows.
madejackson
force-pushed
the
fix/normalize-mount-casing
branch
from
October 12, 2026 07:18
00fb9d7 to
a671a82
Compare
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.
Disclaimer
This PR was written with the help of Plurality (using model kimi 2.6)
I manually checked the code. It seems legit and should not rise any new issues. Nevertheless I am running this version of Cosmos Cloud on my nodes to catch potential issues asap.
There is one line I'm not sure we should leave in the code or not:Cosmos-Server/client/src/pages/servapps/containers/volumes.jsx
Line 114 in be4c720
Update: this gets addressed here: #599
Summary
Fixes the inconsistency where Volume Target and Source were the only fields using uppercase (
Type,Source,Target) while every other runtime variable in Cosmos uses lowercase (type,source,target).Problem
source,target,type) — this is the Docker Compose spec convention.mount.Mountstruct, which serializes with uppercase Go exported fields (Source,Target,Type).Solution
Introduced a Cosmos-local
CosmosMounttype with lowercase JSON tags and bidirectional conversion helpers:[]mount.Mount({"Type":"bind","Source":"/x","Target":"/y"})[]CosmosMount({"type":"bind","source":"/x","target":"/y"})Key changes
src/docker/mount.go—CosmosMountwith lowercase tags and helper methods:ToDockerMount()/ToDockerMountSlice()— send to Docker SDKFromDockerMount()/FromDockerMountSlice()— receive from Docker SDKUnmarshalJSON()— accepts both lowercase and uppercase on inputContainerCreateRequestContainer.Volumes→[]CosmosMountContainerForm.Volumes→[]CosmosMount(JSON tag changed fromVolumes→volumes)CreateService(),UpdateContainerRoute(),ExportContainer()now convert at the Docker SDK boundary.volumes.jsx,docker-compose.jsx,newServiceForm.jsxuse lowercase fields exclusively.Backward Compatibility
The custom
UnmarshalJSONonCosmosMountaccepts both casing styles on input:Serialization always outputs lowercase, so clients and generated SDKs will gradually migrate without breaking.
Testing
go build ./src/docker/...andgo build ./src/...passChecklist
unstable