Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDumpStateVer ¶
IsDumpStateVer checks if the CNI executable is a version that has the dump state command required to initialize CNS from CNI state and returns the result of that test or an error. Will always return false when there is an error unless the error was caused by the CNI not being a semver, in which case we'll assume we can use the command.
func MigrateCNISate ¶ added in v1.5.21
func MigrateCNISate() (map[string]*restserver.EndpointInfo, error)
MigrateCNISate returns an endpoint state of CNS by reading the CNI state file
func NewCNIPodInfoProvider ¶
func NewCNIPodInfoProvider() (cns.PodInfoByIPProvider, error)
NewCNIPodInfoProvider returns an implementation of cns.PodInfoByIPProvider that execs out to the CNI and uses the response to build the PodInfo map.
func NewCNSPodInfoProvider ¶
func NewCNSPodInfoProvider(endpointStore store.KeyValueStore) (cns.PodInfoByIPProvider, error)
func WriteObjectToCNIStatefile ¶
func WriteObjectToCNIStatefile() error
WriteObjectToCNIStatefile checks for a file at the CNI statefile path, and checks if it is empty. If it is empty, writes an empty JSON object to it so older CNI can execute. Does nothing and returns no error if the file does not exist.
This is a hack to get older CNI to run when CNS has mounted the statefile path, but the statefile wasn't written by CNI yet. Kubelet will stub an empty file on the host filesystem, crashing older CNI because it doesn't know how to handle empty statefiles.
Types ¶
This section is empty.