forked from k8snetworkplumbingwg/sriov-network-operator
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request k8snetworkplumbingwg#690 from ykulazhenkov/pr-repo…
…rt-representor [software-bridges 2/x] report VF representor name in SriovNetworkNodeState.Status field
- Loading branch information
Showing
38 changed files
with
2,815 additions
and
79 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,29 @@ | ||
package ghw | ||
|
||
import ( | ||
"github.com/jaypipes/ghw" | ||
) | ||
|
||
func New() GHWLib { | ||
return &libWrapper{} | ||
} | ||
|
||
//go:generate ../../../../../bin/mockgen -destination mock/mock_ghw.go -source ghw.go | ||
type GHWLib interface { | ||
// PCI returns a pointer to an Info that provide methods to access info about devices | ||
PCI() (Info, error) | ||
} | ||
|
||
// Info interface provide methods to access info about devices | ||
type Info interface { | ||
// ListDevices returns a list of pointers to Device structs present on the | ||
// host system | ||
ListDevices() []*ghw.PCIDevice | ||
} | ||
|
||
type libWrapper struct{} | ||
|
||
// PCI returns a pointer to an Info that provide methods to access info about devices | ||
func (w *libWrapper) PCI() (Info, error) { | ||
return ghw.PCI() | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,22 @@ | ||
package sriovnet | ||
|
||
import ( | ||
"github.com/k8snetworkplumbingwg/sriovnet" | ||
) | ||
|
||
func New() SriovnetLib { | ||
return &libWrapper{} | ||
} | ||
|
||
//go:generate ../../../../../bin/mockgen -destination mock/mock_sriovnet.go -source sriovnet.go | ||
type SriovnetLib interface { | ||
// GetVfRepresentor returns representor name for VF device | ||
GetVfRepresentor(uplink string, vfIndex int) (string, error) | ||
} | ||
|
||
type libWrapper struct{} | ||
|
||
// GetVfRepresentor returns representor name for VF device | ||
func (w *libWrapper) GetVfRepresentor(pfName string, vfIndex int) (string, error) { | ||
return sriovnet.GetVfRepresentor(pfName, vfIndex) | ||
} |
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
Oops, something went wrong.