mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-06 01:07:41 +08:00
set ingress gateway endpoint
This commit is contained in:
@@ -313,8 +313,14 @@ func createExtClient(w http.ResponseWriter, r *http.Request) {
|
|||||||
var extclient models.ExtClient
|
var extclient models.ExtClient
|
||||||
extclient.Network = networkName
|
extclient.Network = networkName
|
||||||
extclient.IngressGatewayID = macaddress
|
extclient.IngressGatewayID = macaddress
|
||||||
//get extclient from body of request
|
node, err := functions.GetNodeByMacAddress(networkName, macaddress)
|
||||||
err := json.NewDecoder(r.Body).Decode(&extclient)
|
if err != nil {
|
||||||
|
returnErrorResponse(w, r, formatError(err, "internal"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
extclient.IngressGatewayEndpoint = node.Endpoint + ":" + strconv.FormatInt(int64(node.ListenPort), 10)
|
||||||
|
|
||||||
|
err = json.NewDecoder(r.Body).Decode(&extclient)
|
||||||
if err != nil && !errors.Is(err, io.EOF) {
|
if err != nil && !errors.Is(err, io.EOF) {
|
||||||
returnErrorResponse(w, r, formatError(err, "internal"))
|
returnErrorResponse(w, r, formatError(err, "internal"))
|
||||||
return
|
return
|
||||||
|
BIN
models/.extclient.go.swp
Normal file
BIN
models/.extclient.go.swp
Normal file
Binary file not shown.
@@ -41,5 +41,5 @@ type ExtClient struct {
|
|||||||
Address string `json:"address" bson:"address"`
|
Address string `json:"address" bson:"address"`
|
||||||
LastModified int64 `json:"lastmodified" bson:"lastmodified"`
|
LastModified int64 `json:"lastmodified" bson:"lastmodified"`
|
||||||
IngressGatewayID string `json:"ingressgatewayid" bson:"ingressgatewayid"`
|
IngressGatewayID string `json:"ingressgatewayid" bson:"ingressgatewayid"`
|
||||||
IngressGatewayEnpoint string `json:"ingressgatewayendpoint" bson:"ingressgatewayendpoint"`
|
IngressGatewayEndpoint string `json:"ingressgatewayendpoint" bson:"ingressgatewayendpoint"`
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user