package netsh
import "k8s.io/kubernetes/pkg/util/netsh"
Package netsh provides an interface and implementations for running Windows netsh commands.
Index ¶
Types ¶
type Interface ¶
type Interface interface {
// EnsurePortProxyRule checks if the specified redirect exists, if not creates it
EnsurePortProxyRule(args []string) (bool, error)
// DeletePortProxyRule deletes the specified portproxy rule. If the rule did not exist, return error.
DeletePortProxyRule(args []string) error
// EnsureIPAddress checks if the specified IP Address is added to vEthernet (HNSTransparent) interface, if not, add it. If the address existed, return true.
EnsureIPAddress(args []string, ip net.IP) (bool, error)
// DeleteIPAddress checks if the specified IP address is present and, if so, deletes it.
DeleteIPAddress(args []string) error
// Restore runs `netsh exec` to restore portproxy or addresses using a file.
// TODO Check if this is required, most likely not
Restore(args []string) error
// GetInterfaceToAddIP returns the interface name where Service IP needs to be added
// IP Address needs to be added for netsh portproxy to redirect traffic
// Reads Environment variable INTERFACE_TO_ADD_SERVICE_IP, if it is not defined then "vEthernet (HNSTransparent)" is returned
GetInterfaceToAddIP() string
}
Interface is an injectable interface for running netsh commands. Implementations must be goroutine-safe.
func New ¶
New returns a new Interface which will exec netsh.
Source Files ¶
doc.go netsh.go
Directories ¶
| Path | Synopsis |
|---|---|
| pkg/util/netsh/testing |
- Version
- v1.18.0-alpha.2
- Published
- Jan 21, 2020
- Platform
- darwin/amd64
- Imports
- 8 packages
- Last checked
- 15 minutes ago –
Tools for package owners.