Skip to content

Commit 524ee57

Browse files
committed
Fix issue where a custom config overrides the provided image ref
On container create, if someone supplies a custom config, it totally overrides the fact that we set the image ref already. Move where the image ref is set to after all the opts are run. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
1 parent ff7e721 commit 524ee57

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

container/create.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ func (s *Service) Create(ctx context.Context, img string, opts ...CreateOption)
4545
o(&c)
4646
}
4747

48+
if c.Spec.Config.Image == "" {
49+
c.Spec.Config.Image = img
50+
}
51+
4852
withName := func(req *http.Request) error { return nil }
4953
if c.Name != "" {
5054
withName = func(req *http.Request) error {

0 commit comments

Comments
 (0)