MCPcopy
hub / github.com/NVIDIA/k8s-device-plugin / Split

Method Split

internal/rm/devices.go:254–261  ·  view source on GitHub ↗

Split splits a AnnotatedID into its ID and replica number parts.

()

Source from the content-addressed store, hash-verified

252
253// Split splits a AnnotatedID into its ID and replica number parts.
254func (r AnnotatedID) Split() (string, int) {
255 split := strings.SplitN(string(r), "::", 2)
256 if len(split) != 2 {
257 return string(r), 0
258 }
259 replica, _ := strconv.ParseInt(split[1], 10, 0)
260 return split[0], int(replica)
261}
262
263// GetID returns just the ID part of the replicated ID
264func (r AnnotatedID) GetID() string {

Callers 10

GetIDMethod · 0.95
TestNewHealthCheckXIDsFunction · 0.45
getPluginSocketPathFunction · 0.45
newVersionLabelerFunction · 0.45
buildLabelMapFromOutputFunction · 0.45
checkResultFunction · 0.45
cleanupNodeFunction · 0.45

Calls

no outgoing calls

Tested by 4

TestNewHealthCheckXIDsFunction · 0.36
buildLabelMapFromOutputFunction · 0.36
checkResultFunction · 0.36
cleanupNodeFunction · 0.36