Merge pull request #5913 from rhatdan/v2

More fixes for podman create tests
This commit is contained in:
OpenShift Merge Robot
2020-04-21 07:54:39 -04:00
committed by GitHub
3 changed files with 25 additions and 12 deletions

View File

@ -268,6 +268,8 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string
var command []string var command []string
s.Entrypoint = entrypoint
// Build the command // Build the command
// If we have an entry point, it goes first // If we have an entry point, it goes first
if len(entrypoint) > 0 { if len(entrypoint) > 0 {

View File

@ -84,10 +84,14 @@ func inspect(cmd *cobra.Command, args []string) error {
} }
} }
var lastErr error
for id, e := range results.Errors { 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 { func inspectFormat(row string) string {

View File

@ -64,6 +64,16 @@ func CompleteSpec(ctx context.Context, r *libpod.Runtime, s *specgen.SpecGenerat
} }
// annotations // 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 // 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 // we will want to configure it as a type "container" instead defaulting to
// the behavior of a "sandbox" container // 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 // VM, which is the default behavior
// - "container" denotes the container should join the VM of the SandboxID // - "container" denotes the container should join the VM of the SandboxID
// (the infra container) // (the infra container)
s.Annotations = make(map[string]string)
if len(s.Pod) > 0 { if len(s.Pod) > 0 {
s.Annotations[ann.SandboxID] = s.Pod annotations[ann.SandboxID] = s.Pod
s.Annotations[ann.ContainerType] = ann.ContainerTypeContainer annotations[ann.ContainerType] = ann.ContainerTypeContainer
} }
//
// Next, add annotations from the image // now pass in the values from client
annotations, err := newImage.Annotations(ctx) for k, v := range s.Annotations {
if err != nil {
return err
}
for k, v := range annotations {
annotations[k] = v annotations[k] = v
} }
s.Annotations = annotations
// entrypoint // entrypoint
entrypoint, err := newImage.Entrypoint(ctx) entrypoint, err := newImage.Entrypoint(ctx)