diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-04-21 07:54:39 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-21 07:54:39 -0400 |
commit | 08823e738381a64952580e08188f6edc7bb9e3f0 (patch) | |
tree | 511f67b86baa3748e3e6551b48aeb04958504718 | |
parent | 47d99fb6253238e7603fc96d5b9bbb14f1e8c948 (diff) | |
parent | 75fdb753ddb47d51df1f9781d5db0748edd738da (diff) | |
download | podman-08823e738381a64952580e08188f6edc7bb9e3f0.tar.gz podman-08823e738381a64952580e08188f6edc7bb9e3f0.tar.bz2 podman-08823e738381a64952580e08188f6edc7bb9e3f0.zip |
Merge pull request #5913 from rhatdan/v2
More fixes for podman create tests
-rw-r--r-- | cmd/podman/common/specgen.go | 2 | ||||
-rw-r--r-- | cmd/podman/images/inspect.go | 8 | ||||
-rw-r--r-- | pkg/specgen/generate/container.go | 27 |
3 files changed, 25 insertions, 12 deletions
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go index 1eb8fc0bd..4e2ce1e34 100644 --- a/cmd/podman/common/specgen.go +++ b/cmd/podman/common/specgen.go @@ -268,6 +268,8 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string var command []string + s.Entrypoint = entrypoint + // Build the command // If we have an entry point, it goes first if len(entrypoint) > 0 { diff --git a/cmd/podman/images/inspect.go b/cmd/podman/images/inspect.go index 11bef02ba..3190ab725 100644 --- a/cmd/podman/images/inspect.go +++ b/cmd/podman/images/inspect.go @@ -84,10 +84,14 @@ func inspect(cmd *cobra.Command, args []string) error { } } + var lastErr error for id, e := range results.Errors { - fmt.Fprintf(os.Stderr, "%s: %s\n", id, e.Error()) + if lastErr != nil { + fmt.Fprintf(os.Stderr, "%s: %s\n", id, lastErr.Error()) + } + lastErr = e } - return nil + return lastErr } func inspectFormat(row string) string { diff --git a/pkg/specgen/generate/container.go b/pkg/specgen/generate/container.go index 31465d8bf..d8d3bf11d 100644 --- a/pkg/specgen/generate/container.go +++ b/pkg/specgen/generate/container.go @@ -64,6 +64,16 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat } // annotations + + // Add annotations from the image + annotations, err := newImage.Annotations(ctx) + if err != nil { + return err + } + for k, v := range annotations { + annotations[k] = v + } + // in the event this container is in a pod, and the pod has an infra container // we will want to configure it as a type "container" instead defaulting to // the behavior of a "sandbox" container @@ -72,20 +82,17 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat // VM, which is the default behavior // - "container" denotes the container should join the VM of the SandboxID // (the infra container) - s.Annotations = make(map[string]string) + if len(s.Pod) > 0 { - s.Annotations[ann.SandboxID] = s.Pod - s.Annotations[ann.ContainerType] = ann.ContainerTypeContainer - } - // - // Next, add annotations from the image - annotations, err := newImage.Annotations(ctx) - if err != nil { - return err + annotations[ann.SandboxID] = s.Pod + annotations[ann.ContainerType] = ann.ContainerTypeContainer } - for k, v := range annotations { + + // now pass in the values from client + for k, v := range s.Annotations { annotations[k] = v } + s.Annotations = annotations // entrypoint entrypoint, err := newImage.Entrypoint(ctx) |