1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
Commit graph

12 commits

Author SHA1 Message Date
Daniel Nephin
2414166e1e Create a new ShellLex struct which provides the expected interface to Builder.
Remove b.escapeToken from builder

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-04-26 19:39:16 -04:00
Aaron Lehmann
6052f2b396 Remove pkg/testutil/assert in favor of testify
I noticed that we're using a homegrown package for assertions. The
functions are extremely similar to testify, but with enough slight
differences to be confusing (for example, Equal takes its arguments in a
different order). We already vendor testify, and it's used in a few
places by tests.

I also found some problems with pkg/testutil/assert. For example, the
NotNil function seems to be broken. It checks the argument against
"nil", which only works for an interface. If you pass in a nil map or
slice, the equality check will fail.

In the interest of avoiding NIH, I'm proposing replacing
pkg/testutil/assert with testify. The test code looks almost the same,
but we avoid the confusion of having two similar but slightly different
assertion packages, and having to maintain our own package instead of
using a commonly-used one.

In the process, I found a few places where the tests should halt if an
assertion fails, so I've made those cases (that I noticed) use "require"
instead of "assert", and I've vendored the "require" package from
testify alongside the already-present "assert" package.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-14 12:03:21 -07:00
Daniel Nephin
df3c425407 Merge pull request #32328 from duglin/fixEnvVars
Minor tweaks to quotes in env vars
2017-04-13 10:41:28 -04:00
Doug Davis
2fb7c3c4f0 Minor tweaks to quotes in env vars
Addresses part of #32140, in particular:
- this will make it so that double backslashes in double-quoted
strings will result in a single backslash. While in single quotes it remains
a double backslash.
- missing closing " and ' will now generate an error

Signed-off-by: Doug Davis <dug@us.ibm.com>
2017-04-12 12:20:14 -07:00
Daniel Nephin
9b4aa7629c Fix arg in from when arg is not defined
Add mock builder backend
Add tests for ARG in FROM

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-04-07 17:57:47 -04:00
Daniel Nephin
434d77bc0e Fix --label being env var expanded.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-03-24 12:29:14 -04:00
Ke Li
514adcf458 Remove redundant format
Signed-off-by: Ke Li <kel@splunk.com>

Add missing changes

Signed-off-by: Ke Li <kel@splunk.com>

User errors.New to create error

Signed-off-by: Ke Li <kel@splunk.com>
2016-12-27 21:46:52 +08:00
John Howard
49f392ff6b Windows: Builder case insensitive env
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-11-28 10:30:45 -08:00
John Howard
9127818414 Windows: Honour escape directive fully
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-10-21 14:22:14 -07:00
Doug Davis
6990f8c616 Allow for env vars to have spaces in some cases
Closes #17781

This allows for env vars in EXPOSE to be parsed for spaces so that each
"word" is then treated independently instead of as a single word/arg.

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-11-09 12:42:56 -08:00
Daehyeok Mun
bb79b7eb9e ProcessWord support UTF-8
modified PorcessWord to working normally for UTF-8 strings and added test cases

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2015-10-21 10:10:10 -06:00
Tibor Vass
f41230b93a Move builder files to builder/dockerfile
Signed-off-by: Tibor Vass <tibor@docker.com>
2015-10-05 18:26:47 -04:00
Renamed from builder/shell_parser_test.go (Browse further)