Skip to content

Commit

Permalink
nodemanager: don't return ErrNoVMFound if nodeID is empty
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
  • Loading branch information
andrewsykim committed Aug 25, 2020
1 parent 2d4bde6 commit 6937c1f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/cloudprovider/vsphere/instances_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ func TestInvalidInstance(t *testing.T) {
}

exists, err := instances.InstanceExistsByProviderID(ctx, providerID)
if err != nil {
t.Errorf("InstanceExistsByProviderID unexpected failure but err=%s", err)
if err == nil {
t.Errorf("InstanceExistsByProviderID expected failure, but err=nil")
}
if exists {
t.Error("InstanceExistsByProviderID excepted not exists")
Expand Down
3 changes: 2 additions & 1 deletion pkg/common/connectionmanager/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package connectionmanager

import (
"context"
"errors"
"strings"
"sync"
"time"
Expand Down Expand Up @@ -46,7 +47,7 @@ func (f FindVM) String() string {
func (cm *ConnectionManager) WhichVCandDCByNodeID(ctx context.Context, nodeID string, searchBy FindVM) (*VMDiscoveryInfo, error) {
if nodeID == "" {
klog.V(3).Info("WhichVCandDCByNodeID called but nodeID is empty")
return nil, vclib.ErrNoVMFound
return nil, errors.New("nodeID is empty")
}
type vmSearch struct {
tenantRef string
Expand Down

0 comments on commit 6937c1f

Please sign in to comment.