1package config // import "github.com/docker/docker/daemon/config"
2
3import (
4	"github.com/docker/docker/api/types/swarm"
5	"github.com/docker/docker/daemon/cluster/convert"
6	"github.com/docker/swarmkit/api/genericresource"
7)
8
9// ParseGenericResources parses and validates the specified string as a list of GenericResource
10func ParseGenericResources(value []string) ([]swarm.GenericResource, error) {
11	if len(value) == 0 {
12		return nil, nil
13	}
14
15	resources, err := genericresource.Parse(value)
16	if err != nil {
17		return nil, err
18	}
19
20	obj := convert.GenericResourcesFromGRPC(resources)
21	return obj, nil
22}
23