-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test non latest NodeState generation are ingored
In case of two (or more) SriovNetworkNodeState objects land on the config daemon while it is already working on something, only the latest is considered. Removed the nodeStateSyncHandler's key parameter as it is used only for logging and log the right generation value. Add a specific unit test. Signed-off-by: Andrea Panattoni <[email protected]>
- Loading branch information
Showing
3 changed files
with
83 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package fake | ||
|
||
import ( | ||
sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" | ||
) | ||
|
||
// This plugin is used in Daemon unit tests | ||
type FakePlugin struct{} | ||
|
||
func (f *FakePlugin) Name() string { | ||
return "fake_plugin" | ||
} | ||
|
||
func (f *FakePlugin) Spec() string { | ||
return "1.0" | ||
} | ||
|
||
func (f *FakePlugin) OnNodeStateChange(new *sriovnetworkv1.SriovNetworkNodeState) (bool, bool, error) { | ||
return false, false, nil | ||
} | ||
|
||
func (f *FakePlugin) Apply() error { | ||
return nil | ||
} |