Skip to content

Commit

Permalink
chore: add e2e tests
Browse files Browse the repository at this point in the history
Signed-off-by: Arjun Raja Yogidas <arjunry@amazon.com>
  • Loading branch information
coderbirju committed Jan 13, 2025
1 parent bd295b0 commit 8a25c03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions api/handlers/container/create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -685,15 +685,15 @@ var _ = Describe("Container Create API ", func() {
body := []byte(`{
"Image": "test-image",
"HostConfig": {
"MemoryReservation": 209715200,
"MemoryReservation": 209710,
"MemorySwap": 514288000,
"MemorySwappiness": 25
}
}`)
req, _ := http.NewRequest(http.MethodPost, "/containers/create", bytes.NewReader(body))

// expected create options
createOpt.MemoryReservation = "209715200"
createOpt.MemoryReservation = "209710"
createOpt.MemorySwap = "514288000"
createOpt.MemorySwappiness64 = 25
service.EXPECT().Create(gomock.Any(), "test-image", nil, equalTo(createOpt), equalTo(netOpt)).Return(
Expand Down
6 changes: 3 additions & 3 deletions api/types/container_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,17 +271,17 @@ type DeviceMapping struct {
CgroupPermissions string
}

// CgroupnsMode represents the cgroup namespace mode of the container
// CgroupnsMode represents the cgroup namespace mode of the container.
type CgroupnsMode string

// cgroup namespace modes for containers
// cgroup namespace modes for containers.
const (
CgroupnsModeEmpty CgroupnsMode = ""
CgroupnsModePrivate CgroupnsMode = "private"
CgroupnsModeHost CgroupnsMode = "host"
)

// Valid indicates whether the cgroup namespace mode is valid
// Valid indicates whether the cgroup namespace mode is valid.
func (c CgroupnsMode) Valid() bool {
return c == CgroupnsModePrivate || c == CgroupnsModeHost
}

0 comments on commit 8a25c03

Please sign in to comment.