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:
parent
34fb8d8967
commit
dbef1d56d7
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user