The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/7888
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Fixes some discrepancies between the code and the doc
From 99dcd5b14eb4def5101893cc985eb77c759766c3 Mon Sep 17 00:00:00 2001 From: Simon Deziel <si...@sdeziel.info> Date: Thu, 17 Sep 2020 19:13:54 -0400 Subject: [PATCH 1/2] proxy bind= should accept host|instance as the doc says Keep accepting guest|container as synonyms of instance. Signed-off-by: Simon Deziel <si...@sdeziel.info> --- lxd/device/proxy.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lxd/device/proxy.go b/lxd/device/proxy.go index e2e7d604a3..d169a4671e 100644 --- a/lxd/device/proxy.go +++ b/lxd/device/proxy.go @@ -57,11 +57,11 @@ func (d *proxy) validateConfig(instConf instance.ConfigReader) error { return err } - // Supported bind types are: "host" or "guest" (and "container", a legacy option equivalent to "guest"). + // Supported bind types are: "host" or "instance" (or "guest" or "container", legacy options equivalent to "instance"). // If an empty value is supplied the default behavior is to assume "host" bind mode. validateBind := func(input string) error { - if !shared.StringInSlice(d.config["bind"], []string{"", "host", "guest", "container"}) { - return fmt.Errorf("Invalid binding side given. Must be \"host\" or \"guest\"") + if !shared.StringInSlice(d.config["bind"], []string{"", "host", "instance", "guest", "container"}) { + return fmt.Errorf("Invalid binding side given. Must be \"host\" or \"instance\"") } return nil @@ -505,7 +505,7 @@ func (d *proxy) setupProxyProcInfo() (*proxyProcInfo, error) { connectPidFd = fmt.Sprintf("%d", containerPidFd) listenAddr = d.rewriteHostAddr(listenAddr) - case "guest", "container": + case "instance", "guest", "container": listenPid = containerPid listenPidFd = fmt.Sprintf("%d", containerPidFd) @@ -514,7 +514,7 @@ func (d *proxy) setupProxyProcInfo() (*proxyProcInfo, error) { connectAddr = d.rewriteHostAddr(connectAddr) default: - return nil, fmt.Errorf("Invalid binding side given. Must be \"host\" or \"guest\"") + return nil, fmt.Errorf("Invalid binding side given. Must be \"host\" or \"instance\"") } listenAddrMode := "0644" From e741c6e18db1fdbc9d77d18ef7192a82bd7382b8 Mon Sep 17 00:00:00 2001 From: Simon Deziel <si...@sdeziel.info> Date: Thu, 17 Sep 2020 19:17:02 -0400 Subject: [PATCH 2/2] Valid proxy type= values are all lower case so fix doc Signed-off-by: Simon Deziel <si...@sdeziel.info> --- doc/instances.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/instances.md b/doc/instances.md index 31a25be210..39fcf231a2 100644 --- a/doc/instances.md +++ b/doc/instances.md @@ -723,15 +723,15 @@ addresses to an address inside the instance or to do the reverse and have an address in the instance connect through the host. The supported connection types are: -* `TCP <-> TCP` -* `UDP <-> UDP` -* `UNIX <-> UNIX` -* `TCP <-> UNIX` -* `UNIX <-> TCP` -* `UDP <-> TCP` -* `TCP <-> UDP` -* `UDP <-> UNIX` -* `UNIX <-> UDP` +* `tcp <-> tcp` +* `udp <-> udp` +* `unix <-> unix` +* `tcp <-> unix` +* `unix <-> tcp` +* `udp <-> tcp` +* `tcp <-> udp` +* `udp <-> unix` +* `unix <-> udp` The proxy device also supports a `nat` mode where packets are forwarded using NAT rather than being proxied through a separate connection. This has benefit that the client address is maintained without the need for the target @@ -749,8 +749,8 @@ In order to define a static IPv6 address, the parent managed network needs to ha In NAT mode the supported connection types are: -* `TCP <-> TCP` -* `UDP <-> UDP` +* `tcp <-> tcp` +* `udp <-> udp` When defining IPv6 addresses use square bracket notation, e.g.
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel