Skip to content

Commit

Permalink
Merge branch 'fix-lint-issues' into 'main'
Browse files Browse the repository at this point in the history
fix issues reported by golint

See merge request nvidia/cloud-native/vgpu-device-manager!26
  • Loading branch information
tariq1890 committed Oct 17, 2023
2 parents aa43bc2 + 725831c commit 8c23c33
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions cmd/nvidia-vgpu-dm/apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ func CheckFlags(f *Flags) error {
// AssertVGPUConfig reuses calls from the 'assert' subcommand to check if the vGPU devices of a particular vGPU config are currently applied.
// The 'VGPUConfig' being checked is embedded in the 'Context' struct itself.
func (c *Context) AssertVGPUConfig() error {
return assert.AssertVGPUConfig(&c.Context)
return assert.VGPUConfig(&c.Context)
}

// ApplyVGPUConfig applies a particular vGPU config to the node.
// The 'VGPUConfig' being applied is embedded in the 'Context' struct itself.
func (c *Context) ApplyVGPUConfig() error {
return ApplyVGPUConfig(c)
return VGPUConfig(c)
}

func applyWrapper(c *cli.Context, f *Flags) error {
Expand Down
4 changes: 2 additions & 2 deletions cmd/nvidia-vgpu-dm/apply/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"gitlab.com/nvidia/cloud-native/vgpu-device-manager/pkg/vgpu"
)

// ApplyVGPUConfig applies the selected vGPU config to the node
func ApplyVGPUConfig(c *Context) error {
// VGPUConfig applies the selected vGPU config to the node
func VGPUConfig(c *Context) error {
return assert.WalkSelectedVGPUConfigForEachGPU(c.VGPUConfig, func(vc *v1.VGPUConfigSpec, i int, d types.DeviceID) error {
configManager := vgpu.NewNvlibVGPUConfigManager()
current, err := configManager.GetVGPUConfig(i)
Expand Down
2 changes: 1 addition & 1 deletion cmd/nvidia-vgpu-dm/assert/assert.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func assertWrapper(c *cli.Context, f *Flags) error {
}

log.Debugf("Asserting vGPU device configuration...")
err = AssertVGPUConfig(&context)
err = VGPUConfig(&context)
if err != nil {
log.Debug(err.Error())
return fmt.Errorf("Assertion failure: selected configuration not currently applied")
Expand Down
4 changes: 2 additions & 2 deletions cmd/nvidia-vgpu-dm/assert/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import (
"gitlab.com/nvidia/cloud-native/vgpu-device-manager/pkg/vgpu"
)

// AssertVGPUConfig asserts that the selected vGPU config is applied to the node
func AssertVGPUConfig(c *Context) error {
// VGPUConfig asserts that the selected vGPU config is applied to the node
func VGPUConfig(c *Context) error {
nvpci := nvpci.New()
gpus, err := nvpci.GetGPUs()
if err != nil {
Expand Down

0 comments on commit 8c23c33

Please sign in to comment.