summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/container_create.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/specgen/generate/container_create.go')
-rw-r--r--pkg/specgen/generate/container_create.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go
index 1d724ffb0..ef9975021 100644
--- a/pkg/specgen/generate/container_create.go
+++ b/pkg/specgen/generate/container_create.go
@@ -364,6 +364,17 @@ func createContainerOptions(ctx context.Context, rt *libpod.Runtime, s *specgen.
if len(s.Secrets) != 0 {
options = append(options, libpod.WithSecrets(s.Secrets))
}
+ if len(s.DependencyContainers) > 0 {
+ deps := make([]*libpod.Container, 0, len(s.DependencyContainers))
+ for _, ctr := range s.DependencyContainers {
+ depCtr, err := rt.LookupContainer(ctr)
+ if err != nil {
+ return nil, errors.Wrapf(err, "%q is not a valid container, cannot be used as a dependency", ctr)
+ }
+ deps = append(deps, depCtr)
+ }
+ options = append(options, libpod.WithDependencyCtrs(deps))
+ }
return options, nil
}