// Validate is the main entry point for containers configuration validation
// It returns an `error` on validation failure, otherwise
// `nil`.
Validate is the main entry point for containers configuration validation
It returns an `error` on validation failure, otherwise
`nil`.
// Validate is the main entry point for containers configuration validation // It returns an ` error ` on validation failure otherwise // ` nil ` .
func (c *ContainersConfig) Validate() error {
	for _, u := range c.DefaultUlimits {
		ul, err := units.ParseUlimit(u)
		if err != nil {
			return fmt.Errorf("unrecognized ulimit %s: %v", u, err)
		}
		_, err = ul.GetRlimit()
		if err != nil {
			return err
		}
	}
	for _, d := range c.Devices {
		_, _, _, err := Device(d)
		if err != nil {
			return err
		}
	}
	if c.LogSizeMax >= 0 && c.LogSizeMax < OCIBufSize {
		return fmt.Errorf("log size max should be negative or >= %d", OCIBufSize)
	}
	if _, err := units.FromHumanSize(c.ShmSize); err != nil {
		return fmt.Errorf("invalid --shm-size %s, %q", c.ShmSize, err)
	}
	return nil
}
func ( c * ContainersConfig ) Validate ( ) error { for _ , u := range c . DefaultUlimits { ul , err := units . ParseUlimit ( u ) if err != nil { return fmt . Errorf ( " " , u , err ) } _ , err = ul . GetRlimit ( ) if err != nil { return err } } for _ , d := range c . Devices { _ , _ , _ , err := Device ( d ) if err != nil { return err } } if c . LogSizeMax >= 0 && c . LogSizeMax < OCIBufSize { return fmt . Errorf ( " " , OCIBufSize ) } if _ , err := units . FromHumanSize ( c . ShmSize ) ; err != nil { return fmt . Errorf ( " " , c . ShmSize , err ) } return nil }
Validate is the main entry point for containers configuration validation
It returns an `error` on validation failure, otherwise
`nil`.
Validate is the main entry point for containers configuration validation It returns an ` error ` on validation failure otherwise ` nil ` .