summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/podman/containers/ps.go8
-rw-r--r--cmd/podman/root.go15
-rw-r--r--docs/source/markdown/podman.1.md4
-rw-r--r--go.mod2
-rw-r--r--go.sum2
-rw-r--r--test/e2e/ps_test.go11
-rw-r--r--vendor/github.com/onsi/ginkgo/CHANGELOG.md8
-rw-r--r--vendor/github.com/onsi/ginkgo/config/config.go4
-rw-r--r--vendor/github.com/onsi/ginkgo/extensions/table/table_entry.go6
-rw-r--r--vendor/github.com/onsi/ginkgo/ginkgo/watch/dependencies.go3
-rw-r--r--vendor/github.com/onsi/ginkgo/go.mod1
-rw-r--r--vendor/github.com/onsi/ginkgo/go.sum2
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/global/init.go4
-rw-r--r--vendor/github.com/onsi/ginkgo/internal/suite/suite.go54
-rw-r--r--vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go5
-rw-r--r--vendor/modules.txt2
16 files changed, 105 insertions, 26 deletions
diff --git a/cmd/podman/containers/ps.go b/cmd/podman/containers/ps.go
index 77732266a..7c84cbae1 100644
--- a/cmd/podman/containers/ps.go
+++ b/cmd/podman/containers/ps.go
@@ -309,7 +309,13 @@ func (l psReporter) Status() string {
// Command returns the container command in string format
func (l psReporter) Command() string {
- return strings.Join(l.ListContainer.Command, " ")
+ command := strings.Join(l.ListContainer.Command, " ")
+ if !noTrunc {
+ if len(command) > 17 {
+ return command[0:17] + "..."
+ }
+ }
+ return command
}
// Size returns the rootfs and virtual sizes in human duration in
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index 7c54da91a..eccca3d11 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -128,6 +128,21 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
return err
}
+ for _, env := range cfg.Engine.Env {
+ splitEnv := strings.SplitN(env, "=", 2)
+ if len(splitEnv) != 2 {
+ return fmt.Errorf("invalid environment variable for engine %s, valid configuration is KEY=value pair", env)
+ }
+ // skip if the env is already defined
+ if _, ok := os.LookupEnv(splitEnv[0]); ok {
+ logrus.Debugf("environment variable %s is already defined, skip the settings from containers.conf", splitEnv[0])
+ continue
+ }
+ if err := os.Setenv(splitEnv[0], splitEnv[1]); err != nil {
+ return err
+ }
+ }
+
if cmd.Flag("cpu-profile").Changed {
f, err := os.Create(cfg.CPUProfile)
if err != nil {
diff --git a/docs/source/markdown/podman.1.md b/docs/source/markdown/podman.1.md
index ce02ef3a7..c45c10243 100644
--- a/docs/source/markdown/podman.1.md
+++ b/docs/source/markdown/podman.1.md
@@ -123,6 +123,10 @@ NOTE --tmpdir is not used for the temporary storage of downloaded images. Use t
Print the version
+## Environment Variables
+
+Podman can set up environment variables from env of [engine] table in containers.conf. These variables can be overridden by passing environment variables before the `podman` commands.
+
## Exit Status
The exit code from `podman` gives information about why the container
diff --git a/go.mod b/go.mod
index 241ecedfe..4f93131e1 100644
--- a/go.mod
+++ b/go.mod
@@ -35,7 +35,7 @@ require (
github.com/hpcloud/tail v1.0.0
github.com/json-iterator/go v1.1.10
github.com/mrunalp/fileutils v0.0.0-20171103030105-7d4729fb3618
- github.com/onsi/ginkgo v1.13.0
+ github.com/onsi/ginkgo v1.14.0
github.com/onsi/gomega v1.10.1
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.0.2-0.20190823105129-775207bd45b6
diff --git a/go.sum b/go.sum
index 7e827b079..e4d14069c 100644
--- a/go.sum
+++ b/go.sum
@@ -308,6 +308,8 @@ github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
github.com/onsi/ginkgo v1.13.0 h1:M76yO2HkZASFjXL0HSoZJ1AYEmQxNJmY41Jx1zNUq1Y=
github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0=
+github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA=
+github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
github.com/onsi/gomega v0.0.0-20190113212917-5533ce8a0da3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
diff --git a/test/e2e/ps_test.go b/test/e2e/ps_test.go
index 3d583bb8c..152c85704 100644
--- a/test/e2e/ps_test.go
+++ b/test/e2e/ps_test.go
@@ -466,4 +466,15 @@ var _ = Describe("Podman ps", func() {
Expect(ps.ExitCode()).To(Equal(0))
Expect(ps.OutputToString()).To(ContainSubstring("0.0.0.0:8080->80/tcp"))
})
+
+ It("podman ps truncate long create commad", func() {
+ session := podmanTest.Podman([]string{"run", ALPINE, "echo", "very", "long", "create", "command"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.ExitCode()).To(Equal(0))
+
+ session = podmanTest.Podman([]string{"ps", "-a"})
+ session.WaitWithDefaultTimeout()
+ Expect(session.OutputToString()).To(ContainSubstring("echo very long cr..."))
+ })
+
})
diff --git a/vendor/github.com/onsi/ginkgo/CHANGELOG.md b/vendor/github.com/onsi/ginkgo/CHANGELOG.md
index 03ce58a46..bdf18327e 100644
--- a/vendor/github.com/onsi/ginkgo/CHANGELOG.md
+++ b/vendor/github.com/onsi/ginkgo/CHANGELOG.md
@@ -1,3 +1,11 @@
+## 1.14.0
+
+### Features
+- Defer running top-level container nodes until RunSpecs is called [d44dedf]
+- [Document Ginkgo lifecycle](http://onsi.github.io/ginkgo/#understanding-ginkgos-lifecycle)
+- Add `extensions/globals` package (#692) [3295c8f] - this can be helpful in contexts where you are test-driving your test-generation code (see [#692](https://github.com/onsi/ginkgo/pull/692))
+- Print Skip reason in JUnit reporter if one was provided [820dfab]
+
## 1.13.0
### Features
diff --git a/vendor/github.com/onsi/ginkgo/config/config.go b/vendor/github.com/onsi/ginkgo/config/config.go
index cf22a8e44..2ae48b804 100644
--- a/vendor/github.com/onsi/ginkgo/config/config.go
+++ b/vendor/github.com/onsi/ginkgo/config/config.go
@@ -1,7 +1,7 @@
/*
Ginkgo accepts a number of configuration options.
-These are documented [here](http://onsi.github.io/ginkgo/#the_ginkgo_cli)
+These are documented [here](http://onsi.github.io/ginkgo/#the-ginkgo-cli)
You can also learn more via
@@ -20,7 +20,7 @@ import (
"fmt"
)
-const VERSION = "1.13.0"
+const VERSION = "1.14.0"
type GinkgoConfigType struct {
RandomSeed int64
diff --git a/vendor/github.com/onsi/ginkgo/extensions/table/table_entry.go b/vendor/github.com/onsi/ginkgo/extensions/table/table_entry.go
index 783e7964a..4d9c237ad 100644
--- a/vendor/github.com/onsi/ginkgo/extensions/table/table_entry.go
+++ b/vendor/github.com/onsi/ginkgo/extensions/table/table_entry.go
@@ -21,12 +21,6 @@ type TableEntry struct {
}
func (t TableEntry) generateIt(itBody reflect.Value) {
- if t.codeLocation == (types.CodeLocation{}) {
- // The user created the TableEntry struct directly instead of having used the (F/P/X)Entry constructors.
- // Therefore default to the code location of the surrounding DescribeTable.
- t.codeLocation = codelocation.New(5)
- }
-
var description string
descriptionValue := reflect.ValueOf(t.Description)
switch descriptionValue.Kind() {
diff --git a/vendor/github.com/onsi/ginkgo/ginkgo/watch/dependencies.go b/vendor/github.com/onsi/ginkgo/ginkgo/watch/dependencies.go
index b7f756777..f5ddff30f 100644
--- a/vendor/github.com/onsi/ginkgo/ginkgo/watch/dependencies.go
+++ b/vendor/github.com/onsi/ginkgo/ginkgo/watch/dependencies.go
@@ -6,6 +6,7 @@ import (
)
var ginkgoAndGomegaFilter = regexp.MustCompile(`github\.com/onsi/ginkgo|github\.com/onsi/gomega`)
+var ginkgoIntegrationTestFilter = regexp.MustCompile(`github\.com/onsi/ginkgo/integration`) //allow us to integration test this thing
type Dependencies struct {
deps map[string]int
@@ -77,7 +78,7 @@ func (d Dependencies) resolveAndAdd(deps []string, depth int) {
if err != nil {
continue
}
- if !pkg.Goroot && !ginkgoAndGomegaFilter.Match([]byte(pkg.Dir)) {
+ if !pkg.Goroot && (!ginkgoAndGomegaFilter.Match([]byte(pkg.Dir)) || ginkgoIntegrationTestFilter.Match([]byte(pkg.Dir))) {
d.addDepIfNotPresent(pkg.Dir, depth)
}
}
diff --git a/vendor/github.com/onsi/ginkgo/go.mod b/vendor/github.com/onsi/ginkgo/go.mod
index 212b2454c..1f7125228 100644
--- a/vendor/github.com/onsi/ginkgo/go.mod
+++ b/vendor/github.com/onsi/ginkgo/go.mod
@@ -4,7 +4,6 @@ require (
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/nxadm/tail v1.4.4
github.com/onsi/gomega v1.10.1
- github.com/sclevine/agouti v3.0.0+incompatible // indirect
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299
golang.org/x/text v0.3.2 // indirect
)
diff --git a/vendor/github.com/onsi/ginkgo/go.sum b/vendor/github.com/onsi/ginkgo/go.sum
index beb29b3e6..2b774f3e8 100644
--- a/vendor/github.com/onsi/ginkgo/go.sum
+++ b/vendor/github.com/onsi/ginkgo/go.sum
@@ -25,8 +25,6 @@ github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE=
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
-github.com/sclevine/agouti v3.0.0+incompatible h1:8IBJS6PWz3uTlMP3YBIR5f+KAldcGuOeFkFbUWfBgK4=
-github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
diff --git a/vendor/github.com/onsi/ginkgo/internal/global/init.go b/vendor/github.com/onsi/ginkgo/internal/global/init.go
index 711443200..109f617a5 100644
--- a/vendor/github.com/onsi/ginkgo/internal/global/init.go
+++ b/vendor/github.com/onsi/ginkgo/internal/global/init.go
@@ -13,6 +13,10 @@ var Suite *suite.Suite
var Failer *failer.Failer
func init() {
+ InitializeGlobals()
+}
+
+func InitializeGlobals() {
Failer = failer.New()
Suite = suite.New(Failer)
}
diff --git a/vendor/github.com/onsi/ginkgo/internal/suite/suite.go b/vendor/github.com/onsi/ginkgo/internal/suite/suite.go
index 34f639ee4..e75da1f89 100644
--- a/vendor/github.com/onsi/ginkgo/internal/suite/suite.go
+++ b/vendor/github.com/onsi/ginkgo/internal/suite/suite.go
@@ -22,25 +22,37 @@ type ginkgoTestingT interface {
Fail()
}
+type deferredContainerNode struct {
+ text string
+ body func()
+ flag types.FlagType
+ codeLocation types.CodeLocation
+}
+
type Suite struct {
topLevelContainer *containernode.ContainerNode
currentContainer *containernode.ContainerNode
- containerIndex int
- beforeSuiteNode leafnodes.SuiteNode
- afterSuiteNode leafnodes.SuiteNode
- runner *specrunner.SpecRunner
- failer *failer.Failer
- running bool
+
+ deferredContainerNodes []deferredContainerNode
+
+ containerIndex int
+ beforeSuiteNode leafnodes.SuiteNode
+ afterSuiteNode leafnodes.SuiteNode
+ runner *specrunner.SpecRunner
+ failer *failer.Failer
+ running bool
+ expandTopLevelNodes bool
}
func New(failer *failer.Failer) *Suite {
topLevelContainer := containernode.New("[Top Level]", types.FlagTypeNone, types.CodeLocation{})
return &Suite{
- topLevelContainer: topLevelContainer,
- currentContainer: topLevelContainer,
- failer: failer,
- containerIndex: 1,
+ topLevelContainer: topLevelContainer,
+ currentContainer: topLevelContainer,
+ failer: failer,
+ containerIndex: 1,
+ deferredContainerNodes: []deferredContainerNode{},
}
}
@@ -53,6 +65,11 @@ func (suite *Suite) Run(t ginkgoTestingT, description string, reporters []report
panic("ginkgo.parallel.node is one-indexed and must be <= ginkgo.parallel.total")
}
+ suite.expandTopLevelNodes = true
+ for _, deferredNode := range suite.deferredContainerNodes {
+ suite.PushContainerNode(deferredNode.text, deferredNode.body, deferredNode.flag, deferredNode.codeLocation)
+ }
+
r := rand.New(rand.NewSource(config.RandomSeed))
suite.topLevelContainer.Shuffle(r)
iterator, hasProgrammaticFocus := suite.generateSpecsIterator(description, config)
@@ -137,6 +154,23 @@ func (suite *Suite) SetSynchronizedAfterSuiteNode(bodyA interface{}, bodyB inter
}
func (suite *Suite) PushContainerNode(text string, body func(), flag types.FlagType, codeLocation types.CodeLocation) {
+ /*
+ We defer walking the container nodes (which immediately evaluates the `body` function)
+ until `RunSpecs` is called. We do this by storing off the deferred container nodes. Then, when
+ `RunSpecs` is called we actually go through and add the container nodes to the test structure.
+
+ This allows us to defer calling all the `body` functions until _after_ the top level functions
+ have been walked, _after_ func init()s have been called, and _after_ `go test` has called `flag.Parse()`.
+
+ This allows users to load up configuration information in the `TestX` go test hook just before `RunSpecs`
+ is invoked and solves issues like #693 and makes the lifecycle easier to reason about.
+
+ */
+ if !suite.expandTopLevelNodes {
+ suite.deferredContainerNodes = append(suite.deferredContainerNodes, deferredContainerNode{text, body, flag, codeLocation})
+ return
+ }
+
container := containernode.New(text, flag, codeLocation)
suite.currentContainer.PushContainerNode(container)
diff --git a/vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go b/vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go
index d76e2fe77..963caaaff 100644
--- a/vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go
+++ b/vendor/github.com/onsi/ginkgo/reporters/junit_reporter.go
@@ -50,7 +50,7 @@ type JUnitFailureMessage struct {
}
type JUnitSkipped struct {
- XMLName xml.Name `xml:"skipped"`
+ Message string `xml:",chardata"`
}
type JUnitReporter struct {
@@ -132,6 +132,9 @@ func (reporter *JUnitReporter) SpecDidComplete(specSummary *types.SpecSummary) {
}
if specSummary.State == types.SpecStateSkipped || specSummary.State == types.SpecStatePending {
testCase.Skipped = &JUnitSkipped{}
+ if specSummary.Failure.Message != "" {
+ testCase.Skipped.Message = failureMessage(specSummary.Failure)
+ }
}
testCase.Time = specSummary.RunTime.Seconds()
reporter.suite.TestCases = append(reporter.suite.TestCases, testCase)
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 64d9a3a18..12f44afea 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -362,7 +362,7 @@ github.com/nxadm/tail/ratelimiter
github.com/nxadm/tail/util
github.com/nxadm/tail/watch
github.com/nxadm/tail/winfile
-# github.com/onsi/ginkgo v1.13.0
+# github.com/onsi/ginkgo v1.14.0
github.com/onsi/ginkgo
github.com/onsi/ginkgo/config
github.com/onsi/ginkgo/extensions/table