kubernetes: k8s.io/kubernetes/pkg/util/netsh Index | Files | Directories

package netsh

import "k8s.io/kubernetes/pkg/util/netsh"

Package netsh provides an interface and implementations for running Windows netsh commands.


Package Files

doc.go netsh.go

type Interface Uses

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 Uses

func New(exec utilexec.Interface) Interface

New returns a new Interface which will exec netsh.



Package netsh imports 8 packages (graph) and is imported by 7 packages. Updated 2019-07-26. Refresh now. Tools for package owners.