From de7cabacba9a95e1b58e65d4edc7962aea7e81be Mon Sep 17 00:00:00 2001 From: abhishek9686 Date: Thu, 17 Oct 2024 19:55:58 +0400 Subject: [PATCH] update tags on extclient update call --- logic/extpeers.go | 1 + models/extclient.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/logic/extpeers.go b/logic/extpeers.go index 24ee787fe..542f98b56 100644 --- a/logic/extpeers.go +++ b/logic/extpeers.go @@ -329,6 +329,7 @@ func UpdateExtClient(old *models.ExtClient, update *models.CustomExtClient) mode // replace any \r\n with \n in postup and postdown from HTTP request new.PostUp = strings.Replace(update.PostUp, "\r\n", "\n", -1) new.PostDown = strings.Replace(update.PostDown, "\r\n", "\n", -1) + new.Tags = update.Tags return new } diff --git a/models/extclient.go b/models/extclient.go index d76ef2970..b84a7c8d9 100644 --- a/models/extclient.go +++ b/models/extclient.go @@ -19,8 +19,8 @@ type ExtClient struct { DeniedACLs map[string]struct{} `json:"deniednodeacls" bson:"acls,omitempty"` RemoteAccessClientID string `json:"remote_access_client_id"` // unique ID (MAC address) of RAC machine PostUp string `json:"postup" bson:"postup"` - Tags map[TagID]struct{} `json:"tags"` PostDown string `json:"postdown" bson:"postdown"` + Tags map[TagID]struct{} `json:"tags"` } // CustomExtClient - struct for CustomExtClient params @@ -34,4 +34,5 @@ type CustomExtClient struct { RemoteAccessClientID string `json:"remote_access_client_id"` // unique ID (MAC address) of RAC machine PostUp string `json:"postup" bson:"postup" validate:"max=1024"` PostDown string `json:"postdown" bson:"postdown" validate:"max=1024"` + Tags map[TagID]struct{} `json:"tags"` }