microsoft / hcsshim

Windows - Host Compute Service Shim
MIT License
564 stars 253 forks source link

Adding state attribute to the HNSEndpoint struct to support hyperv #2177

Closed ritikaguptams closed 2 months ago

ritikaguptams commented 2 months ago

The struct HNSEndpoint is used by CNIs like calico to validate the state of an endpoint. In order to support Hyperv containers on k8s we need to expose the State attribute. This attribute can be used by CNIs to determine the state of the endpoint.

HNS API versions: Hcsshim supports both APIS v1 and v2 via the HCN folder (documented way) or via hns files in the root which expose internal/hns apis

CodeFlow:
Calico::endpoint_mgr.go::RefreshHnsEndpointCache --> hns.HNSListEndpointRequest() which lands at hcsshim/hnsendpoint.go which calls into the internal HNS package at /hcsshim/internal/hns which runs a get call into HNS OS code.

ritikaguptams commented 2 months ago

cc @jsturtevant @sbangari