package providers import ( "context" v1 "k8s.io/api/core/v1" ) // NodeProvider is the interface used for registering a node and updating its // status in Kubernetes. // // Note: Implementers can choose to manage a node themselves, in which case // it is not needed to provide an implementation for this interface. type NodeProvider interface { // Ping checks if the node is still active. // This is intended to be lightweight as it will be called periodically as a // heartbeat to keep the node marked as ready in Kubernetes. Ping(context.Context) error // NotifyNodeStatus is used to asynchronously monitor the node. // The passed in callback should be called any time there is a change to the // node's status. // This will generally trigger a call to the Kubernetes API server to update // the status. // // NotifyNodeStatus should not block callers. NotifyNodeStatus(ctx context.Context, cb func(*v1.Node)) }