Documentation ¶
Index ¶
- func AddHcnEndpoint(epName string, expectedNetworkId string, namespace string, ...) (*hcn.HostComputeEndpoint, error)
- func ConstructEndpointName(containerID string, netNs string, networkName string) string
- func ConstructHcnResult(hcnNetwork *hcn.HostComputeNetwork, hcnEndpoint *hcn.HostComputeEndpoint) (*current.Result, error)
- func ConstructResult(hnsNetwork *hcsshim.HNSNetwork, hnsEndpoint *hcsshim.HNSEndpoint) (*current.Result, error)
- func DeprovisionEndpoint(epName string, netns string, containerID string) error
- func GenerateHcnEndpoint(epInfo *EndpointInfo, n *NetConf) (*hcn.HostComputeEndpoint, error)
- func GenerateHnsEndpoint(epInfo *EndpointInfo, n *NetConf) (*hcsshim.HNSEndpoint, error)
- func GetIpString(ip *net.IP) string
- func GetSandboxContainerID(containerID string, netNs string) string
- func ProvisionEndpoint(epName string, expectedNetworkId string, containerID string, netns string, ...) (*hcsshim.HNSEndpoint, error)
- func RemoveHcnEndpoint(epName string) error
- type EndpointInfo
- type EndpointMakerFunc
- type HcnEndpointMakerFunc
- type NetConf
- type RuntimeConfig
- type RuntimeDNS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddHcnEndpoint ¶
func AddHcnEndpoint(epName string, expectedNetworkId string, namespace string, makeEndpoint HcnEndpointMakerFunc) (*hcn.HostComputeEndpoint, error)
func ConstructEndpointName ¶
ConstructEndpointName constructs enpointId which is used to identify an endpoint from HNS There is a special consideration for netNs name here, which is required for Windows Server 1709 containerID is the Id of the container on which the endpoint is worked on
func ConstructHcnResult ¶
func ConstructHcnResult(hcnNetwork *hcn.HostComputeNetwork, hcnEndpoint *hcn.HostComputeEndpoint) (*current.Result, error)
func ConstructResult ¶
func ConstructResult(hnsNetwork *hcsshim.HNSNetwork, hnsEndpoint *hcsshim.HNSEndpoint) (*current.Result, error)
ConstructResult constructs the CNI result for the endpoint
func DeprovisionEndpoint ¶
DeprovisionEndpoint removes an endpoint from the container by sending a Detach request to HNS For shared endpoint, ContainerDetach is used for removing the endpoint completely, HotDetachEndpoint is used
func GenerateHcnEndpoint ¶
func GenerateHcnEndpoint(epInfo *EndpointInfo, n *NetConf) (*hcn.HostComputeEndpoint, error)
func GenerateHnsEndpoint ¶
func GenerateHnsEndpoint(epInfo *EndpointInfo, n *NetConf) (*hcsshim.HNSEndpoint, error)
func GetIpString ¶
short function so we know when to return "" for a string
func GetSandboxContainerID ¶
GetSandboxContainerID returns the sandbox ID of this pod
func ProvisionEndpoint ¶
func ProvisionEndpoint(epName string, expectedNetworkId string, containerID string, netns string, makeEndpoint EndpointMakerFunc) (*hcsshim.HNSEndpoint, error)
ProvisionEndpoint provisions an endpoint to a container specified by containerID. If an endpoint already exists, the endpoint is reused. This call is idempotent
func RemoveHcnEndpoint ¶
This version follows the v2 workflow of removing the endpoint from the namespace and deleting it
Types ¶
type EndpointInfo ¶
type EndpointMakerFunc ¶
type EndpointMakerFunc func() (*hcsshim.HNSEndpoint, error)
type HcnEndpointMakerFunc ¶
type HcnEndpointMakerFunc func() (*hcn.HostComputeEndpoint, error)
type NetConf ¶
type NetConf struct { types.NetConf HcnPolicyArgs []hcn.EndpointPolicy `json:"HcnPolicyArgs,omitempty"` Policies []policy `json:"policies,omitempty"` RuntimeConfig RuntimeConfig `json:"runtimeConfig"` }
NetConf is the CNI spec
func (*NetConf) ApplyDefaultPAPolicy ¶
ApplyDefaultPAPolicy is used to configure a endpoint PA policy in HNS
func (*NetConf) ApplyOutboundNatPolicy ¶
ApplyOutboundNatPolicy applies NAT Policy in VFP using HNS Simultaneously an exception is added for the network that has to be Nat'd
func (*NetConf) MarshalPolicies ¶
func (n *NetConf) MarshalPolicies() []json.RawMessage
MarshalPolicies converts the Endpoint policies in Policies to HNS specific policies as Json raw bytes
type RuntimeConfig ¶
type RuntimeConfig struct {
DNS RuntimeDNS `json:"dns"`
}