runtime: runc v2: remove redundant validation

cgroupsv2.LoadManager() already performs VerifyGroupPath(), and returns
an error if the path is invalid, so this check is redundant.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2021-07-14 23:24:31 +02:00
parent 34fb8d8967
commit dbef1d56d7
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C

View File

@ -257,9 +257,6 @@ func (s *service) StartShim(ctx context.Context, opts shim.StartOpts) (_ string,
if opts, ok := v.(*options.Options); ok { if opts, ok := v.(*options.Options); ok {
if opts.ShimCgroup != "" { if opts.ShimCgroup != "" {
if cgroups.Mode() == cgroups.Unified { if cgroups.Mode() == cgroups.Unified {
if err := cgroupsv2.VerifyGroupPath(opts.ShimCgroup); err != nil {
return "", errors.Wrapf(err, "failed to verify cgroup path %q", opts.ShimCgroup)
}
cg, err := cgroupsv2.LoadManager("/sys/fs/cgroup", opts.ShimCgroup) cg, err := cgroupsv2.LoadManager("/sys/fs/cgroup", opts.ShimCgroup)
if err != nil { if err != nil {
return "", errors.Wrapf(err, "failed to load cgroup %s", opts.ShimCgroup) return "", errors.Wrapf(err, "failed to load cgroup %s", opts.ShimCgroup)