aboutsummaryrefslogtreecommitdiff
path: root/pkg/domain/infra
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2021-11-19 09:58:26 +0100
committerMiloslav Trmač <mitr@redhat.com>2021-11-30 22:13:52 +0100
commita948ecbb9c7c90e249cded94a2239192a4ad766a (patch)
tree871597402d7fc75f50c8d66c437ee2fc4e285d05 /pkg/domain/infra
parentec686d68ddf326c8f4e50f2770be3ed7d250c6d0 (diff)
downloadpodman-a948ecbb9c7c90e249cded94a2239192a4ad766a.tar.gz
podman-a948ecbb9c7c90e249cded94a2239192a4ad766a.tar.bz2
podman-a948ecbb9c7c90e249cded94a2239192a4ad766a.zip
Allow containerPortsToServicePorts to fail
Add an error return to it and affected callers. Should not affect behavior, the function can't currently fail. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Diffstat (limited to 'pkg/domain/infra')
-rw-r--r--pkg/domain/infra/abi/generate.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/pkg/domain/infra/abi/generate.go b/pkg/domain/infra/abi/generate.go
index 0defa1923..68bb351bf 100644
--- a/pkg/domain/infra/abi/generate.go
+++ b/pkg/domain/infra/abi/generate.go
@@ -139,7 +139,11 @@ func (ic *ContainerEngine) GenerateKube(ctx context.Context, nameOrIDs []string,
podContent = append(podContent, b)
if options.Service {
- b, err := generateKubeYAML(libpod.GenerateKubeServiceFromV1Pod(po, []k8sAPI.ServicePort{}))
+ svc, err := libpod.GenerateKubeServiceFromV1Pod(po, []k8sAPI.ServicePort{})
+ if err != nil {
+ return nil, err
+ }
+ b, err := generateKubeYAML(svc)
if err != nil {
return nil, err
}
@@ -177,7 +181,11 @@ func getKubePods(ctx context.Context, pods []*libpod.Pod, getService bool) ([][]
pos = append(pos, b)
if getService {
- b, err := generateKubeYAML(libpod.GenerateKubeServiceFromV1Pod(po, sp))
+ svc, err := libpod.GenerateKubeServiceFromV1Pod(po, sp)
+ if err != nil {
+ return nil, nil, err
+ }
+ b, err := generateKubeYAML(svc)
if err != nil {
return nil, nil, err
}