code: func ValidateConfig(config *api.Config) []Error {
  	allErrs := []Error{}
  	if len(config.BuilderImage) == 0 {
  		allErrs = append(allErrs, NewFieldRequired("builderImage"))
  	}
  	switch config.BuilderPullPolicy {
  	case api.PullNever, api.PullAlways, api.PullIfNotPresent:
  	default:
  		allErrs = append(allErrs, NewFieldInvalidValue("builderPullPolicy"))
  	}
  	if config.DockerConfig == nil || len(config.DockerConfig.Endpoint) == 0 {
  		allErrs = append(allErrs, NewFieldRequired("dockerConfig.endpoint"))
  	}
  	if config.DockerNetworkMode != "" && !validateDockerNetworkMode(config.DockerNetworkMode) {
  		allErrs = append(allErrs, NewFieldInvalidValue("dockerNetworkMode"))
  	}
  	if config.Labels != nil {
  		for k := range config.Labels {
  			if len(k) == 0 {
  				allErrs = append(allErrs, NewFieldInvalidValue("labels"))
  			}
  		}
  	}
  	if config.Tag != "" {
  		if err := validateDockerReference(config.Tag); err != nil {
  			allErrs = append(allErrs, NewFieldInvalidValueWithReason("tag", err.Error()))
  		}
  	}
  	return allErrs
  }
docs: // ValidateConfig returns a list of error from validation.