Skip to content

Commit

Permalink
prevent change node type from bare metal to VM
Browse files Browse the repository at this point in the history
  • Loading branch information
Eslam-Nawara committed Nov 6, 2023
1 parent 89999e3 commit 5824ff6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/registrar/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ func registerNode(

if !real.Eq(onChain) {
log.Debug().Msgf("node data have changing, issuing an update node: %+v", real)

if !onChain.Virtualized && real.Virtualized {
return 0, 0, errors.Wrapf(err, "failed to update node data with id: %d, tried to tag bare metal as VM", nodeID)
}

_, err := sub.UpdateNode(id, real)
if err != nil {
return 0, 0, errors.Wrapf(err, "failed to update node data with id: %d", nodeID)
Expand Down

0 comments on commit 5824ff6

Please sign in to comment.