Skip to content

Commit

Permalink
[chore][fix] update system tags
Browse files Browse the repository at this point in the history
  • Loading branch information
cuongpiger committed Aug 30, 2024
1 parent cbf52fa commit e7f9a0f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion vngcloud/services/loadbalancer/v2/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down

0 comments on commit e7f9a0f

Please sign in to comment.