summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-09-22 13:39:18 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2021-09-22 15:10:37 -0400
commit45ee5c5db2d67e17f4271fab5f61b7cafb6aea10 (patch)
tree71200634486aee02e2733ebe3f1d31581433ca11 /pkg
parent420ff1da921e284b80ac3724408a21bba102a533 (diff)
downloadpodman-45ee5c5db2d67e17f4271fab5f61b7cafb6aea10.tar.gz
podman-45ee5c5db2d67e17f4271fab5f61b7cafb6aea10.tar.bz2
podman-45ee5c5db2d67e17f4271fab5f61b7cafb6aea10.zip
podman generate kube should not include images command
If the command came from the underlying image, then we should not include it in the generate yaml file. Fixes: https://github.com/containers/podman/issues/11672 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg')
-rw-r--r--pkg/domain/infra/abi/generate.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/domain/infra/abi/generate.go b/pkg/domain/infra/abi/generate.go
index 1e614ce58..081a2464b 100644
--- a/pkg/domain/infra/abi/generate.go
+++ b/pkg/domain/infra/abi/generate.go
@@ -107,7 +107,7 @@ func (ic *ContainerEngine) GenerateKube(ctx context.Context, nameOrIDs []string,
// Generate kube pods and services from pods.
if len(pods) >= 1 {
- pos, svcs, err := getKubePods(pods, options.Service)
+ pos, svcs, err := getKubePods(ctx, pods, options.Service)
if err != nil {
return nil, err
}
@@ -120,7 +120,7 @@ func (ic *ContainerEngine) GenerateKube(ctx context.Context, nameOrIDs []string,
// Generate the kube pods from containers.
if len(ctrs) >= 1 {
- po, err := libpod.GenerateForKube(ctrs)
+ po, err := libpod.GenerateForKube(ctx, ctrs)
if err != nil {
return nil, err
}
@@ -153,12 +153,12 @@ func (ic *ContainerEngine) GenerateKube(ctx context.Context, nameOrIDs []string,
}
// getKubePods returns kube pod and service YAML files from podman pods.
-func getKubePods(pods []*libpod.Pod, getService bool) ([][]byte, [][]byte, error) {
+func getKubePods(ctx context.Context, pods []*libpod.Pod, getService bool) ([][]byte, [][]byte, error) {
pos := [][]byte{}
svcs := [][]byte{}
for _, p := range pods {
- po, sp, err := p.GenerateForKube()
+ po, sp, err := p.GenerateForKube(ctx)
if err != nil {
return nil, nil, err
}