Repository: prometheus/procfs (go)

Issue:
Cgroup paths containing ":" are not supported
Considering https://github.com/prometheus/procfs/blob/bc932d6aaa40fc66d46db859e9e03d954dc622c1/proc_cgroup.go#L52 it is clear that if the path contains additional ":" characters, the path will be truncated.

Colons may be inserted, for example when running kubernetes with containerd using a `systemd` cgroup-driver.

See:
* https://github.com/containerd/containerd/blob/c35b4cfed520bf4827737f294f9292ffa73bdf8b/pkg/cri/server/helpers_linux.go#L67

And how containerd parses the file: https://github.com/containerd/cgroups/blob/8a68de567b68b30602948417a7a8e99ccf00ee9b/utils.go#L305

Changing:
```
	fields := strings.Split(cgroupStr, ":")
```
to
```
	fields := strings.SplitN(cgroupStr, ":", 3)
```
should address this.

Pull request description:
Allow cgroup paths containing colons
This change adds support for cgroup paths containing colons in the /procs/<pid>/cgroup file.

This is prompted by the following:
* The spec specifies that the *three* fields are separated by colons and does not forbid them in the path
* Tools such as containerd joins path components with colons when using systemd as a cgroup provider

This closes #353  


Patch:
diff --git a/proc_cgroup.go b/proc_cgroup.go
index 4abd464..0094a13 100644
--- a/proc_cgroup.go
+++ b/proc_cgroup.go
@@ -49,7 +49,7 @@ type Cgroup struct {
 func parseCgroupString(cgroupStr string) (*Cgroup, error) {
 	var err error
 
-	fields := strings.Split(cgroupStr, ":")
+	fields := strings.SplitN(cgroupStr, ":", 3)
 	if len(fields) < 3 {
 		return nil, fmt.Errorf("at least 3 fields required, found %d fields in cgroup string: %s", len(fields), cgroupStr)
 	}


Test patch:
diff --git a/proc_cgroup_test.go b/proc_cgroup_test.go
index f530edb..00ab2b4 100644
--- a/proc_cgroup_test.go
+++ b/proc_cgroup_test.go
@@ -56,13 +56,13 @@ func TestParseCgroupString(t *testing.T) {
 			},
 		},
 		{
-			name:      "extra fields (such as those added by later kernel versions)",
-			s:         "0::/:foobar",
+			name:      "path containing colons",
+			s:         "0::/some/long/path:foobar",
 			shouldErr: false,
 			cgroup: &Cgroup{
 				HierarchyID: 0,
 				Controllers: nil,
-				Path:        "/",
+				Path:        "/some/long/path:foobar",
 			},
 		},
 		{