Skip to content

Commit b14c4e8

Browse files
committed
optimization and bugfix
1 parent f8a4fef commit b14c4e8

7 files changed

Lines changed: 613 additions & 301 deletions

File tree

base/util.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,3 +318,11 @@ func Poll(describeFunc func(string, string, string, string) (interface{}, error)
318318
return done
319319
}
320320
}
321+
322+
//PickResourceID uhost-xxx/uhost-name => uhost-xxx
323+
func PickResourceID(str string) string {
324+
if strings.Index(str, "/") > -1 {
325+
return strings.SplitN(str, "/", 2)[0]
326+
}
327+
return str
328+
}

0 commit comments

Comments
 (0)