summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorJason T. Greene <jason.greene@redhat.com>2022-04-21 15:37:34 -0500
committerJason T. Greene <jason.greene@redhat.com>2022-04-25 13:52:27 -0500
commit3b6ffcd290978f5e0110e925c212d6396accee10 (patch)
treedd0241bb9b058f6eecd7504361b9a5bb64a6cb25 /libpod
parent6984a0f35704204fa15374aa2c133c4e6e0b366f (diff)
downloadpodman-3b6ffcd290978f5e0110e925c212d6396accee10.tar.gz
podman-3b6ffcd290978f5e0110e925c212d6396accee10.tar.bz2
podman-3b6ffcd290978f5e0110e925c212d6396accee10.zip
Update to use new common machine API
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/networking_linux.go3
-rw-r--r--libpod/networking_machine.go5
2 files changed, 5 insertions, 3 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go
index 3cfe19517..c168b7eca 100644
--- a/libpod/networking_linux.go
+++ b/libpod/networking_linux.go
@@ -23,6 +23,7 @@ import (
"github.com/containers/common/libnetwork/etchosts"
"github.com/containers/common/libnetwork/types"
"github.com/containers/common/pkg/config"
+ "github.com/containers/common/pkg/machine"
"github.com/containers/common/pkg/netns"
"github.com/containers/podman/v4/libpod/define"
"github.com/containers/podman/v4/libpod/events"
@@ -62,7 +63,7 @@ const (
// This is need because a HostIP of 127.0.0.1 would now allow the gvproxy forwarder to reach to open ports.
// For machine the HostIP must only be used by gvproxy and never in the VM.
func (c *Container) convertPortMappings() []types.PortMapping {
- if !c.runtime.config.Engine.MachineEnabled || len(c.config.PortMappings) == 0 {
+ if !machine.IsPodmanMachine() || len(c.config.PortMappings) == 0 {
return c.config.PortMappings
}
// if we run in a machine VM we have to ignore the host IP part
diff --git a/libpod/networking_machine.go b/libpod/networking_machine.go
index d2a6b7cfa..73089c474 100644
--- a/libpod/networking_machine.go
+++ b/libpod/networking_machine.go
@@ -14,6 +14,7 @@ import (
"time"
"github.com/containers/common/libnetwork/types"
+ "github.com/containers/common/pkg/machine"
"github.com/sirupsen/logrus"
)
@@ -117,7 +118,7 @@ func annotateGvproxyResponseError(r io.Reader) error {
// exposeMachinePorts exposes the ports for podman machine via gvproxy
func (r *Runtime) exposeMachinePorts(ports []types.PortMapping) error {
- if !r.config.Engine.MachineEnabled {
+ if !machine.IsGvProxyBased() {
return nil
}
return requestMachinePorts(true, ports)
@@ -125,7 +126,7 @@ func (r *Runtime) exposeMachinePorts(ports []types.PortMapping) error {
// unexposeMachinePorts closes the ports for podman machine via gvproxy
func (r *Runtime) unexposeMachinePorts(ports []types.PortMapping) error {
- if !r.config.Engine.MachineEnabled {
+ if !machine.IsGvProxyBased() {
return nil
}
return requestMachinePorts(false, ports)