From dbef1d56d7ebc05bc4553d72c419ed5ce025b05d Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 14 Jul 2021 23:24:31 +0200 Subject: [PATCH] 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 --- runtime/v2/runc/v2/service.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/runtime/v2/runc/v2/service.go b/runtime/v2/runc/v2/service.go index 317c3f8f0..83a250a7e 100644 --- a/runtime/v2/runc/v2/service.go +++ b/runtime/v2/runc/v2/service.go @@ -257,9 +257,6 @@ func (s *service) StartShim(ctx context.Context, opts shim.StartOpts) (_ string, if opts, ok := v.(*options.Options); ok { if opts.ShimCgroup != "" { 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) if err != nil { return "", errors.Wrapf(err, "failed to load cgroup %s", opts.ShimCgroup)