Commit Graph

12 Commits

Author SHA1 Message Date
e25a81277d 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>
Upstream-commit: 2414166e1e38a4de8aa4af40b90c7e1bc90102b0
Component: engine
2017-04-26 19:39:16 -04:00
142883d5b3 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>
Upstream-commit: 6052f2b3969feadb01662d8e2f30337d9c7f61af
Component: engine
2017-04-14 12:03:21 -07:00
0b7785856b Merge pull request #32328 from duglin/fixEnvVars
Minor tweaks to quotes in env vars
Upstream-commit: df3c4254072d110ecfcefeda94279c25e6a9f334
Component: engine
2017-04-13 10:41:28 -04:00
e1a50e229d 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>
Upstream-commit: 2fb7c3c4f0b2fe15e279729a87c465df4fa70879
Component: engine
2017-04-12 12:20:14 -07:00
bc5cfcbd12 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>
Upstream-commit: 9b4aa7629c527bc2076de984e77627757f20db68
Component: engine
2017-04-07 17:57:47 -04:00
20ac55606f Fix --label being env var expanded.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 434d77bc0edf21b970e0414ee54112768a490aaa
Component: engine
2017-03-24 12:29:14 -04:00
7c2700ecf9 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>
Upstream-commit: 514adcf4580effa4820be8d5e6d2c0ea9825ceb2
Component: engine
2016-12-27 21:46:52 +08:00
f53ec9c3d1 Windows: Builder case insensitive env
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 49f392ff6b528d571eac538f5365bd51c4c83e5c
Component: engine
2016-11-28 10:30:45 -08:00
adbaf3869a Windows: Honour escape directive fully
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 912781841422363219e064a1df6df39dabf4cd81
Component: engine
2016-10-21 14:22:14 -07:00
81b8a4871f 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>
Upstream-commit: 6990f8c6162b5b05118ab54f155eb5d86c85f2d4
Component: engine
2015-11-09 12:42:56 -08:00
954f6f9002 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>
Upstream-commit: bb79b7eb9e1db83fd80121b088aa2e5a4c084ace
Component: engine
2015-10-21 10:10:10 -06:00
5d2ec8fed8 Move builder files to builder/dockerfile
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: f41230b93a77ca7f4d84718f39a4847b6117f694
Component: engine
2015-10-05 18:26:47 -04:00