@@ -16,14 +16,14 @@ func rootlessEUIDConfig() *configs.Config {
1616 {Type : configs .NEWUSER },
1717 },
1818 ),
19- UidMappings : []configs.IDMap {
19+ UIDMappings : []configs.IDMap {
2020 {
2121 HostID : 1337 ,
2222 ContainerID : 0 ,
2323 Size : 1 ,
2424 },
2525 },
26- GidMappings : []configs.IDMap {
26+ GIDMappings : []configs.IDMap {
2727 {
2828 HostID : 7331 ,
2929 ContainerID : 0 ,
@@ -52,15 +52,15 @@ func TestValidateRootlessEUIDUserns(t *testing.T) {
5252
5353func TestValidateRootlessEUIDMappingUid (t * testing.T ) {
5454 config := rootlessEUIDConfig ()
55- config .UidMappings = nil
55+ config .UIDMappings = nil
5656 if err := Validate (config ); err == nil {
5757 t .Errorf ("Expected error to occur if no uid mappings provided" )
5858 }
5959}
6060
6161func TestValidateNonZeroEUIDMappingGid (t * testing.T ) {
6262 config := rootlessEUIDConfig ()
63- config .GidMappings = nil
63+ config .GIDMappings = nil
6464 if err := Validate (config ); err == nil {
6565 t .Errorf ("Expected error to occur if no gid mappings provided" )
6666 }
@@ -93,13 +93,13 @@ func TestValidateRootlessEUIDMountUid(t *testing.T) {
9393 }
9494
9595 config .Mounts [0 ].Data = "uid=2"
96- config .UidMappings [0 ].Size = 10
96+ config .UIDMappings [0 ].Size = 10
9797 if err := Validate (config ); err != nil {
9898 t .Errorf ("Expected error to not occur when setting uid=2 in mount options and UidMapping[0].size is 10" )
9999 }
100100
101101 config .Mounts [0 ].Data = "uid=20"
102- config .UidMappings [0 ].Size = 10
102+ config .UIDMappings [0 ].Size = 10
103103 if err := Validate (config ); err == nil {
104104 t .Errorf ("Expected error to occur when setting uid=20 in mount options and UidMapping[0].size is 10" )
105105 }
@@ -130,21 +130,21 @@ func TestValidateRootlessEUIDMountGid(t *testing.T) {
130130 }
131131
132132 config .Mounts [0 ].Data = "gid=5"
133- config .GidMappings [0 ].Size = 10
133+ config .GIDMappings [0 ].Size = 10
134134 if err := Validate (config ); err != nil {
135135 t .Errorf ("Expected error to not occur when setting gid=5 in mount options and GidMapping[0].size is 10" )
136136 }
137137
138138 config .Mounts [0 ].Data = "gid=11"
139- config .GidMappings [0 ].Size = 10
139+ config .GIDMappings [0 ].Size = 10
140140 if err := Validate (config ); err == nil {
141141 t .Errorf ("Expected error to occur when setting gid=11 in mount options and GidMapping[0].size is 10" )
142142 }
143143}
144144
145145func BenchmarkRootlessEUIDMount (b * testing.B ) {
146146 config := rootlessEUIDConfig ()
147- config .GidMappings [0 ].Size = 10
147+ config .GIDMappings [0 ].Size = 10
148148 config .Mounts = []* configs.Mount {
149149 {
150150 Source : "devpts" ,
0 commit comments