Skip to content

Commit

Permalink
Update property value from "host" to "device".
Browse files Browse the repository at this point in the history
  • Loading branch information
vikas-goel committed Jan 24, 2024
1 parent 8e6d8a5 commit cc7021f
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/containers.conf.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ the `--init` for podman-create and podman-run is set.
Default way to set interface names inside containers. Defaults to legacy pattern
of ethX, where X is an integer, when left undefined.
Options are:
`host` Uses the network_interface name from the network config as interface name. Falls back to the ethX pattern if the network_interface is not set.
`device` Uses the network_interface name from the network config as interface name. Falls back to the ethX pattern if the network_interface is not set.

**ipcns**="shareable"

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ type ContainersConfig struct {

// InterfaceName tells container runtimes how to set interface names
// inside containers.
// The only valid value at the moment is "host" that indicates the
// The only valid value at the moment is "device" that indicates the
// interface name should be set as the network_interface name from
// the network config.
InterfaceName string `toml:"interface_name,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (c *ContainersConfig) validateDevices() error {
}

func (c *ContainersConfig) validateInterfaceName() error {
if c.InterfaceName == "host" || c.InterfaceName == "" {
if c.InterfaceName == "device" || c.InterfaceName == "" {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config_local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ var _ = Describe("Config Local", func() {
gomega.Expect(defConf).NotTo(gomega.BeNil())

// Given
defConf.Containers.InterfaceName = "host"
defConf.Containers.InterfaceName = "device"

// When
err = defConf.Containers.Validate()
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/containers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ default_sysctls = [
# Default way to set an interface name inside container. Defaults to legacy
# pattern of ethX, where X is a integer, when left undefined.
# Options are:
# "host" Uses the network_interface name from the network config as interface name. Falls back to the ethX pattern if the network_interface is not set.
# "device" Uses the network_interface name from the network config as interface name. Falls back to the ethX pattern if the network_interface is not set.
#interface_name = ""

# keyring tells the container engine whether to create
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/testdata/containers_override.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[containers]

apparmor_profile = "overridden-default"
interface_name = "host"
interface_name = "device"
log_driver = "journald"
log_tag="{{.Name}}|{{.ID}}"
log_size_max = 100000
Expand Down

0 comments on commit cc7021f

Please sign in to comment.