From e7f9a0f06d7169c27b3329a7fda385512c8c0548 Mon Sep 17 00:00:00 2001 From: "Cuong. Duong Manh" Date: Fri, 30 Aug 2024 16:31:45 +0700 Subject: [PATCH] [chore][fix] update system tags --- vngcloud/services/loadbalancer/v2/tag.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vngcloud/services/loadbalancer/v2/tag.go b/vngcloud/services/loadbalancer/v2/tag.go index 99da37c..5b7f524 100644 --- a/vngcloud/services/loadbalancer/v2/tag.go +++ b/vngcloud/services/loadbalancer/v2/tag.go @@ -40,11 +40,19 @@ func (s *LoadBalancerServiceV2) CreateTags(popts ICreateTagsRequest) lserr.IErro } func (s *LoadBalancerServiceV2) UpdateTags(popts IUpdateTagsRequest) lserr.IError { - tags, sdkErr := s.ListTags(NewListTagsRequest(popts.GetLoadBalancerId())) + tmpTags, sdkErr := s.ListTags(NewListTagsRequest(popts.GetLoadBalancerId())) if sdkErr != nil { return sdkErr } + // Do not update system tags + tags := new(lsentity.ListTags) + for _, tag := range tmpTags.Items { + if !tag.SystemTag { + tags.Items = append(tags.Items, tag) + } + } + url := updateTagsUrl(s.VServerClient, popts) errResp := lserr.NewErrorResponse(lserr.NormalErrorType) req := lsclient.NewRequest().