builder: fix a situation where entrypoint was improperly set in stringform

If the value is [], we provide a special case that unsets any values.

The default value is nil, and runconfig rolls with that.

-Erik

On Oct 6, 2014, at 5:59 PM, Michael Crosby <notifications@github.com> wrote:

> In builder/dispatchers.go:
> 
> > @@ -259,8 +259,10 @@ func cmd(b *Builder, args []string, attributes map[string]bool) error {
> >  func entrypoint(b *Builder, args []string, attributes map[string]bool) error {
> >  	b.Config.Entrypoint = handleJsonArgs(args, attributes)
> >  
> > -	if len(b.Config.Entrypoint) == 0 && len(b.Config.Cmd) == 0 {
> There are way too many ifs here. The logic should be that if the user passes json to entrypoint then you just set it. If they don't and it's a string, prepend sh -c. Why do we have these len checks? I seems like this is not needed at all considering that this func would not be called unless someone set the entrypoint in their dockerfile.
> 
> —
> Reply to this email directly or view it on GitHub.
>