From 0795e33d6e86e8dc8ca906f2719e8cc4a7137fdd Mon Sep 17 00:00:00 2001 From: Oreon Lothamer Date: Thu, 7 Sep 2023 04:17:36 -1000 Subject: [PATCH] fix: switch to using splitN for handling annotation splitting Signed-off-by: Oreon Lothamer --- util/argo/resource_tracking.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/util/argo/resource_tracking.go b/util/argo/resource_tracking.go index 57a00cb8a2f46..175eb6f865fc2 100644 --- a/util/argo/resource_tracking.go +++ b/util/argo/resource_tracking.go @@ -178,12 +178,10 @@ func (rt *resourceTracking) BuildAppInstanceValue(value AppInstanceValue) string // ParseAppInstanceValue parse resource tracking id from format :/:/ to struct func (rt *resourceTracking) ParseAppInstanceValue(value string) (*AppInstanceValue, error) { var appInstanceValue AppInstanceValue - parts := strings.Split(value, ":") + parts := strings.SplitN(value, ":", 3) appInstanceValue.ApplicationName = parts[0] if len(parts) < 2 { return nil, WrongResourceTrackingFormat - } else if len(parts) > 3 { - parts = []string{parts[0], parts[1], strings.Join(parts[2:], ":")} } groupParts := strings.Split(parts[1], "/") if len(groupParts) != 2 {