pasta

package
v0.61.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 11 Imported by: 6

Documentation

Index

Constants

View Source
const BinaryName = "pasta"

Variables

This section is empty.

Functions

This section is empty.

Types

type SetupOptions

type SetupOptions struct {
	// Config used to get pasta options and binary path via HelperBinariesDir
	Config *config.Config
	// Netns is the path to the container Netns
	Netns string
	// Ports that should be forwarded in the container
	Ports []types.PortMapping
	// ExtraOptions are pasta(1) cli options, these will be appended after the
	// pasta options from containers.conf to allow some form of overwrite.
	ExtraOptions []string
}

type SetupResult added in v0.58.1

type SetupResult struct {
	// IpAddresses configured by pasta
	IPAddresses []net.IP
	// DNSForwardIP is the ip used in --dns-forward, it should be added as first
	// entry to resolv.conf in the container.
	DNSForwardIPs []string
	// MapGuestIps are the ips used for the --map-guest-addr option which
	// we can use for the host.containers.internal entry.
	MapGuestAddrIPs []string
	// IPv6 says whenever pasta run with ipv6 support
	IPv6 bool
}

func Setup

func Setup(opts *SetupOptions) (*SetupResult, error)

Setup start the pasta process for the given netns. The pasta binary is looked up in the HelperBinariesDir and $PATH. Note that there is no need for any special cleanup logic, the pasta process will automatically exit when the netns path is deleted.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL