Skip to content

Commit

Permalink
expose build.shm_size as Build.ShmSize
Browse files Browse the repository at this point in the history
  • Loading branch information
lionello committed Dec 20, 2023
1 parent 81e1e90 commit 4a3ddbf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
17 changes: 15 additions & 2 deletions loader/loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -949,10 +949,23 @@ services:
image: db
build:
context: ./db
shm_size: 2gb
`
configDetails := buildConfigDetails(dict, nil)
_, err := Load(configDetails)
actual, err := Load(configDetails)
assert.NilError(t, err)

wd, _ := os.Getwd()
assert.DeepEqual(t, actual.Services["web"].Build, &types.BuildConfig{
Context: wd,
Dockerfile: "Dockerfile",
})

assert.DeepEqual(t, actual.Services["db"].Build, &types.BuildConfig{
Context: wd + "/db",
Dockerfile: "Dockerfile",
ShmSize: types.UnitBytes(2 * 1024 * 1024 * 1024),
})
}

func TestDeprecatedProperties(t *testing.T) {
Expand Down Expand Up @@ -2748,7 +2761,7 @@ services:
image: example/proxy
build: ./proxy
develop:
watch:
watch:
# rebuild image and recreate service
- path: ./proxy/proxy.conf
action: sync+restart
Expand Down
1 change: 1 addition & 0 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ type BuildConfig struct {
Network string `yaml:"network,omitempty" json:"network,omitempty"`
Target string `yaml:"target,omitempty" json:"target,omitempty"`
Secrets []ServiceSecretConfig `yaml:"secrets,omitempty" json:"secrets,omitempty"`
ShmSize UnitBytes `yaml:"shm_size,omitempty" json:"shm_size,omitempty"`
Tags StringList `yaml:"tags,omitempty" json:"tags,omitempty"`
Ulimits map[string]*UlimitsConfig `yaml:"ulimits,omitempty" json:"ulimits,omitempty"`
Platforms StringList `yaml:"platforms,omitempty" json:"platforms,omitempty"`
Expand Down

0 comments on commit 4a3ddbf

Please sign in to comment.