Skip to content

Commit

Permalink
fix: use vm name to get vmi
Browse files Browse the repository at this point in the history
Signed-off-by: PoAn Yang <[email protected]>
  • Loading branch information
FrankYang0529 committed Mar 8, 2024
1 parent d64b2a0 commit 86465fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cloud-controller-manager/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (i *instanceManager) InstanceMetadata(ctx context.Context, node *v1.Node) (
ProviderID: ProviderName + "://" + string(vm.UID),
}

vmi, err := i.vmiClient.Get(i.namespace, node.Name, metav1.GetOptions{})
vmi, err := i.vmiClient.Get(i.namespace, vm.Name, metav1.GetOptions{})
if err != nil {
if errors.IsNotFound(err) {
return meta, nil
Expand Down
1 change: 1 addition & 0 deletions pkg/controller/virtualmachineinstance/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ func Register(
restClient: restClient,
kubevirtClient: kubevirtClient,
nodeToVMName: nodeToVMName,
namespace: namespace,
}
vmis.OnChange(ctx, vmiControllerName, handler.OnVmiChanged)
}
Expand Down

0 comments on commit 86465fd

Please sign in to comment.