summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi/generate.go
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2021-11-19 09:58:26 +0100
committerMatthew Heon <mheon@redhat.com>2021-12-06 15:48:44 -0500
commitbb1293133d18c95223362e6202e4eee967ab43e4 (patch)
treeadd5668dfa82d94b4319b873e88517cdbe1a1ce1 /pkg/domain/infra/abi/generate.go
parent25e5e8f89ecbc7a56c1bb893aa5b26ed854bd091 (diff)
downloadpodman-bb1293133d18c95223362e6202e4eee967ab43e4.tar.gz
podman-bb1293133d18c95223362e6202e4eee967ab43e4.tar.bz2
podman-bb1293133d18c95223362e6202e4eee967ab43e4.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/abi/generate.go')
-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
}