Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSIVolumeRPC ¶ added in v0.12.2
type CSIVolumeRPC interface {
Unpublish(args *structs.CSIVolumeUnpublishRequest, reply *structs.CSIVolumeUnpublishResponse) error
}
CSIVolumeRPC is a minimal interface of the Server, intended as an aid for testing logic surrounding server-to-server or server-to-client RPC calls and to avoid circular references between the nomad package and the volumewatcher
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher is used to watch volumes and their allocations created by the scheduler and trigger the scheduler when allocation health transitions.
func NewVolumesWatcher ¶
func NewVolumesWatcher(logger log.Logger, rpc CSIVolumeRPC, leaderAcl string) *Watcher
NewVolumesWatcher returns a volumes watcher that is used to watch volumes and trigger the scheduler as needed.
func (*Watcher) SetEnabled ¶
func (w *Watcher) SetEnabled(enabled bool, state *state.StateStore, leaderAcl string)
SetEnabled is used to control if the watcher is enabled. The watcher should only be enabled on the active leader. When being enabled the state and leader's ACL is passed in as it is no longer valid once a leader election has taken place.