// Validate is the main entry point for Engine configuration validation
// It returns an `error` on validation failure, otherwise
// `nil`.
Validate is the main entry point for Engine configuration validation
It returns an `error` on validation failure, otherwise
`nil`.
// Validate is the main entry point for Engine configuration validation // It returns an ` error ` on validation failure otherwise // ` nil ` .
func (c *EngineConfig) Validate() error {
	if c.StaticDir != "" && !filepath.IsAbs(c.StaticDir) {
		return fmt.Errorf("static directory must be an absolute path - instead got %q", c.StaticDir)
	}
	if c.TmpDir != "" && !filepath.IsAbs(c.TmpDir) {
		return fmt.Errorf("temporary directory must be an absolute path - instead got %q", c.TmpDir)
	}
	if c.VolumePath != "" && !filepath.IsAbs(c.VolumePath) {
		return fmt.Errorf("volume path must be an absolute path - instead got %q", c.VolumePath)
	}
	pullPolicy := strings.ToLower(c.PullPolicy)
	if _, err := ValidatePullPolicy(pullPolicy); err != nil {
		return errors.Wrapf(err, "invalid pull type from containers.conf %q", c.PullPolicy)
	}
	return nil
}
func ( c * EngineConfig ) Validate ( ) error { if c . StaticDir != " " && ! filepath . IsAbs ( c . StaticDir ) { return fmt . Errorf ( " " , c . StaticDir ) } if c . TmpDir != " " && ! filepath . IsAbs ( c . TmpDir ) { return fmt . Errorf ( " " , c . TmpDir ) } if c . VolumePath != " " && ! filepath . IsAbs ( c . VolumePath ) { return fmt . Errorf ( " " , c . VolumePath ) } pullPolicy := strings . ToLower ( c . PullPolicy ) if _ , err := ValidatePullPolicy ( pullPolicy ) ; err != nil { return errors . Wrapf ( err , " " , c . PullPolicy ) } return nil }
Validate is the main entry point for Engine configuration validation
It returns an `error` on validation failure, otherwise
`nil`.
Validate is the main entry point for Engine configuration validation It returns an ` error ` on validation failure otherwise ` nil ` .
// Relative paths can cause nasty bugs, because core paths we use could // shift between runs (or even parts of the program - the OCI runtime // uses a different working directory than we do, for example. // Check if the pullPolicy from containers.conf is valid // if it is invalid returns the error