@@ -13,7 +13,6 @@ import (
1313 mounttypes "github.com/docker/docker/api/types/mount"
1414 "github.com/docker/docker/api/types/network"
1515 "github.com/docker/docker/api/types/swarm"
16- "github.com/docker/go-units"
1716 "gotest.tools/v3/assert"
1817 is "gotest.tools/v3/assert/cmp"
1918)
@@ -1600,66 +1599,66 @@ func TestUpdateUlimits(t *testing.T) {
16001599
16011600 tests := []struct {
16021601 name string
1603- spec []* units .Ulimit
1602+ spec []* container .Ulimit
16041603 rm []string
16051604 add []string
1606- expected []* units .Ulimit
1605+ expected []* container .Ulimit
16071606 }{
16081607 {
16091608 name : "from scratch" ,
16101609 add : []string {"nofile=512:1024" , "core=1024:1024" },
1611- expected : []* units .Ulimit {
1610+ expected : []* container .Ulimit {
16121611 {Name : "core" , Hard : 1024 , Soft : 1024 },
16131612 {Name : "nofile" , Hard : 1024 , Soft : 512 },
16141613 },
16151614 },
16161615 {
16171616 name : "append new" ,
1618- spec : []* units .Ulimit {
1617+ spec : []* container .Ulimit {
16191618 {Name : "nofile" , Hard : 1024 , Soft : 512 },
16201619 },
16211620 add : []string {"core=1024:1024" },
1622- expected : []* units .Ulimit {
1621+ expected : []* container .Ulimit {
16231622 {Name : "core" , Hard : 1024 , Soft : 1024 },
16241623 {Name : "nofile" , Hard : 1024 , Soft : 512 },
16251624 },
16261625 },
16271626 {
16281627 name : "remove and append new should append" ,
1629- spec : []* units .Ulimit {
1628+ spec : []* container .Ulimit {
16301629 {Name : "core" , Hard : 1024 , Soft : 1024 },
16311630 {Name : "nofile" , Hard : 1024 , Soft : 512 },
16321631 },
16331632 rm : []string {"nofile=512:1024" },
16341633 add : []string {"nofile=512:1024" },
1635- expected : []* units .Ulimit {
1634+ expected : []* container .Ulimit {
16361635 {Name : "core" , Hard : 1024 , Soft : 1024 },
16371636 {Name : "nofile" , Hard : 1024 , Soft : 512 },
16381637 },
16391638 },
16401639 {
16411640 name : "update existing" ,
1642- spec : []* units .Ulimit {
1641+ spec : []* container .Ulimit {
16431642 {Name : "nofile" , Hard : 2048 , Soft : 1024 },
16441643 },
16451644 add : []string {"nofile=512:1024" },
1646- expected : []* units .Ulimit {
1645+ expected : []* container .Ulimit {
16471646 {Name : "nofile" , Hard : 1024 , Soft : 512 },
16481647 },
16491648 },
16501649 {
16511650 name : "update existing twice" ,
1652- spec : []* units .Ulimit {
1651+ spec : []* container .Ulimit {
16531652 {Name : "nofile" , Hard : 2048 , Soft : 1024 },
16541653 },
16551654 add : []string {"nofile=256:512" , "nofile=512:1024" },
1656- expected : []* units .Ulimit {
1655+ expected : []* container .Ulimit {
16571656 {Name : "nofile" , Hard : 1024 , Soft : 512 },
16581657 },
16591658 },
16601659 {
16611660 name : "remove all" ,
1662- spec : []* units .Ulimit {
1661+ spec : []* container .Ulimit {
16631662 {Name : "core" , Hard : 1024 , Soft : 1024 },
16641663 {Name : "nofile" , Hard : 1024 , Soft : 512 },
16651664 },
@@ -1668,23 +1667,23 @@ func TestUpdateUlimits(t *testing.T) {
16681667 },
16691668 {
16701669 name : "remove by key" ,
1671- spec : []* units .Ulimit {
1670+ spec : []* container .Ulimit {
16721671 {Name : "core" , Hard : 1024 , Soft : 1024 },
16731672 {Name : "nofile" , Hard : 1024 , Soft : 512 },
16741673 },
16751674 rm : []string {"core" },
1676- expected : []* units .Ulimit {
1675+ expected : []* container .Ulimit {
16771676 {Name : "nofile" , Hard : 1024 , Soft : 512 },
16781677 },
16791678 },
16801679 {
16811680 name : "remove by key and different value" ,
1682- spec : []* units .Ulimit {
1681+ spec : []* container .Ulimit {
16831682 {Name : "core" , Hard : 1024 , Soft : 1024 },
16841683 {Name : "nofile" , Hard : 1024 , Soft : 512 },
16851684 },
16861685 rm : []string {"core=1234:5678" },
1687- expected : []* units .Ulimit {
1686+ expected : []* container .Ulimit {
16881687 {Name : "nofile" , Hard : 1024 , Soft : 512 },
16891688 },
16901689 },
0 commit comments