Skip to content

Commit

Permalink
Merge pull request #1771 from manuelbuil/extensionIPV6
Browse files Browse the repository at this point in the history
Add IPv6 parameters in the extension backend
  • Loading branch information
manuelbuil authored May 12, 2023
2 parents 12f639c + 11ed1b6 commit e1f11f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions Documentation/extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@ This backend has the following configuration
* `SubnetAddCommand` (string): Command to run when a subnet is added
* stdin - The output from `PreStartupCommand` is passed in.
* The following environment variables are set
* SUBNET - The subnet of the remote host that was added.
* SUBNET - The ipv4 subnet of the remote host that was added.
* IPV6SUBNET - The ipv6 subnet of the remote host that was added.
* PUBLIC_IP - The public IP of the remote host.
* PUBLIC_IPV6 - The public IPv6 of the remote host.
* `SubnetRemoveCommand`(string): Command to run when a subnet is removed
* stdin - The output from `PreStartupCommand` is passed in.
* The following environment variables are set
* SUBNET - The subnet of the remote host that was removed.
* SUBNET - The ipv4 subnet of the remote host that was removed.
* IPV6SUBNET - The ipv6 subnet of the remote host that was removed.
* PUBLIC_IP - The public IP of the remote host.
* PUBLIC_IPV6 - The public IPv6 of the remote host.

All commands are run through the `sh` shell and are run with the same permissions as the flannel daemon.

Expand Down
4 changes: 3 additions & 1 deletion pkg/backend/extension/extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ func (be *ExtensionBackend) RegisterNetwork(ctx context.Context, wg *sync.WaitGr
cmd_output, err := runCmd([]string{
fmt.Sprintf("NETWORK=%s", config.Network),
fmt.Sprintf("SUBNET=%s", lease.Subnet),
fmt.Sprintf("PUBLIC_IP=%s", attrs.PublicIP)},
fmt.Sprintf("IPV6SUBNET=%s", lease.IPv6Subnet),
fmt.Sprintf("PUBLIC_IP=%s", attrs.PublicIP),
fmt.Sprintf("PUBLIC_IPV6=%s", attrs.PublicIPv6)},
"", "sh", "-c", n.postStartupCommand)
if err != nil {
return nil, fmt.Errorf("failed to run command: %s Err: %v Output: %s", n.postStartupCommand, err, cmd_output)
Expand Down

0 comments on commit e1f11f2

Please sign in to comment.