@@ -13,6 +13,7 @@ import (
13
13
"github.com/apex/log"
14
14
"github.com/buildpacks/lifecycle/buildpack"
15
15
"github.com/docker/docker/api/types"
16
+ "github.com/docker/docker/api/types/container"
16
17
"github.com/golang/mock/gomock"
17
18
"github.com/heroku/color"
18
19
"github.com/sclevine/spec"
@@ -102,6 +103,11 @@ func testBuildDockerfiles(t *testing.T, when spec.G, it spec.S) {
102
103
mockDockerClient .EXPECT ().ImageBuild (gomock .Any (), gomock .Any (), gomock .Any ()).Do (func (_ context.Context , buildContext io.Reader , buildOptions types.ImageBuildOptions ) {
103
104
compBuildOptions (t , expectedBuildOptions , buildOptions )
104
105
}).Return (mockResponse , nil ).Times (1 )
106
+ mockDockerClient .EXPECT ().ImageInspectWithRaw (gomock .Any (), gomock .Any ()).Return (types.ImageInspect {
107
+ Config : & container.Config {
108
+ User : "root" ,
109
+ },
110
+ }, nil , nil ).Times (1 )
105
111
err := lifecycle .ExtendBuildByDaemon (context .Background ())
106
112
h .AssertNil (t , err )
107
113
})
@@ -115,6 +121,10 @@ func testBuildDockerfiles(t *testing.T, when spec.G, it spec.S) {
115
121
OSType : "linux" ,
116
122
}
117
123
mockDockerClient .EXPECT ().ImageBuild (gomock .Any (), gomock .Any (), gomock .Any ()).Return (mockResponse , nil ).Times (2 )
124
+ mockDockerClient .EXPECT ().ImageInspectWithRaw (gomock .Any (), gomock .Any ()).Return (types.ImageInspect {
125
+ Config : & container.Config {
126
+ User : "root" ,
127
+ }}, nil , nil ).Times (2 )
118
128
err := lifecycle .ExtendBuildByDaemon (context .Background ())
119
129
h .AssertNil (t , err )
120
130
})
0 commit comments