github.com/k8snetworkplumbingwg/sriov-network-operator@v1.2.1-0.20240408194816-2d2e5a45d453/pkg/plugins/plugin.go (about)

     1  package plugin
     2  
     3  import (
     4  	sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1"
     5  )
     6  
     7  //go:generate ../../bin/mockgen -destination mock/mock_plugin.go -source plugin.go
     8  type VendorPlugin interface {
     9  	// Return the name of plugin
    10  	Name() string
    11  	// Return the SpecVersion followed by plugin
    12  	Spec() string
    13  	// Invoked when SriovNetworkNodeState CR is created or updated, return if need dain and/or reboot node
    14  	OnNodeStateChange(new *sriovnetworkv1.SriovNetworkNodeState) (bool, bool, error)
    15  	// Apply config change
    16  	Apply() error
    17  }