ensure netclient version is compatible

This commit is contained in:
Matthew R. Kasun
2022-11-14 14:41:34 -05:00
parent 07eb6e3e6c
commit b453897e65
5 changed files with 80 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ package controller
import (
"encoding/json"
"errors"
"fmt"
"net/http"
"strings"
@@ -574,6 +575,12 @@ func createNode(w http.ResponseWriter, r *http.Request) {
return
}
if !logic.IsVersionComptatible(node.Version) {
err := errors.New("incomatible netclient version")
logic.ReturnErrorResponse(w, r, logic.FormatError(err, "badrequest"))
return
}
node.Network = networkName
network, err := logic.GetNetworkByNode(&node)