Merge pull request #17789 from duglin/Issue17781
Allow for env vars to have spaces in some cases Upstream-commit: 014bab03efd67367d13231c08cc43e2e73578824 Component: engine
This commit is contained in:
@@ -151,6 +151,8 @@ func (s *DockerSuite) TestBuildEnvironmentReplacementExpose(c *check.C) {
|
||||
FROM scratch
|
||||
ENV port 80
|
||||
EXPOSE ${port}
|
||||
ENV ports " 99 100 "
|
||||
EXPOSE ${ports}
|
||||
`, true)
|
||||
if err != nil {
|
||||
c.Fatal(err)
|
||||
@@ -167,8 +169,13 @@ func (s *DockerSuite) TestBuildEnvironmentReplacementExpose(c *check.C) {
|
||||
c.Fatal(err)
|
||||
}
|
||||
|
||||
if _, ok := exposedPorts["80/tcp"]; !ok {
|
||||
c.Fatal("Exposed port 80 from environment not in Config.ExposedPorts on image")
|
||||
exp := []int{80, 99, 100}
|
||||
|
||||
for _, p := range exp {
|
||||
tmp := fmt.Sprintf("%d/tcp", p)
|
||||
if _, ok := exposedPorts[tmp]; !ok {
|
||||
c.Fatalf("Exposed port %d from environment not in Config.ExposedPorts on image", p)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user