func (profile *LXDProfile) ValidateConfigDevices() error {
	for _, val := range profile.Devices {
		goodDevs := set.NewStrings("unix-char", "unix-block", "gpu", "usb")
		if devType, ok := val["type"]; ok {
			if !goodDevs.Contains(devType) {
				return fmt.Errorf("invalid lxd-profile.yaml: contains device type %q", devType)
			}
		}
	}
	for key := range profile.Config {
		if strings.HasPrefix(key, "boot") ||
			strings.HasPrefix(key, "limits") ||
			strings.HasPrefix(key, "migration") {
			return fmt.Errorf("invalid lxd-profile.yaml: contains config value %q", key)
		}
	}
	return nil
}
// ValidateConfigDevices validates the Config and Devices properties of the LXDProfile.
// WhiteList devices: unix-char, unix-block, gpu, usb.
// BlackList config: boot*, limits* and migration*.
// An empty profile will not return an error.
ValidateConfigDevices validates the Config and Devices properties of the LXDProfile.
WhiteList devices: unix-char, unix-block, gpu, usb.
BlackList config: boot*, limits* and migration*.
An empty profile will not return an error.
// ValidateConfigDevices validates the Config and Devices properties of the LXDProfile . // WhiteList devices : unix - char unix - block gpu usb . // BlackList config : boot * limits * and migration * . // An empty profile will not return an error .
func (profile *LXDProfile) ValidateConfigDevices() error {
	for _, val := range profile.Devices {
		goodDevs := set.NewStrings("unix-char", "unix-block", "gpu", "usb")
		if devType, ok := val["type"]; ok {
			if !goodDevs.Contains(devType) {
				return fmt.Errorf("invalid lxd-profile.yaml: contains device type %q", devType)
			}
		}
	}
	for key := range profile.Config {
		if strings.HasPrefix(key, "boot") ||
			strings.HasPrefix(key, "limits") ||
			strings.HasPrefix(key, "migration") {
			return fmt.Errorf("invalid lxd-profile.yaml: contains config value %q", key)
		}
	}
	return nil
}
func ( profile * LXDProfile ) ValidateConfigDevices ( ) error { for _ , val := range profile . Devices { goodDevs := set . NewStrings ( " " , " " , " " , " " ) if devType , ok := val [ " " ] ; ok { if ! goodDevs . Contains ( devType ) { return fmt . Errorf ( " " , devType ) } } } for key := range profile . Config { if strings . HasPrefix ( key , " " ) || strings . HasPrefix ( key , " " ) || strings . HasPrefix ( key , " " ) { return fmt . Errorf ( " " , key ) } } return nil }
ValidateConfigDevices validates the Config and Devices properties of the LXDProfile.
ValidateConfigDevices validates the Config and Devices properties of the LXDProfile .