diff options
author | John Cai <jcai@gitlab.com> | 2022-05-14 00:18:00 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2022-05-14 00:41:34 +0300 |
commit | 6ebecd3b8ab0606efd8d947d8deb9527cccf4164 (patch) | |
tree | 74881f5aae10eff5af31798d9fd7629c2455a963 | |
parent | 30c785812330b91df17f7068272c466cd6ab9ff7 (diff) |
cgroups: Add delimiter for keyjc-cgroups-repository-isolation
The cgroups key did not have a delimeter. This can potentially cause key
collisions between two different sets of storage/repository path. Add a
"/" as a delimeter in the key that gets hashed.
-rw-r--r-- | internal/cgroups/v1_linux.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/cgroups/v1_linux.go b/internal/cgroups/v1_linux.go index dcbf04256..0a462c01f 100644 --- a/internal/cgroups/v1_linux.go +++ b/internal/cgroups/v1_linux.go @@ -104,7 +104,7 @@ func (cg *CGroupV1Manager) AddCommand( repo repository.GitRepo, ) error { checksum := crc32.ChecksumIEEE( - []byte(strings.Join([]string{repo.GetStorageName(), repo.GetRelativePath()}, "")), + []byte(repo.GetStorageName() + "/" + repo.GetRelativePath()), ) groupID := uint(checksum) % cg.cfg.Repositories.Count cgroupPath := cg.repoPath(int(groupID)) |