code: func getAPICfg(spec *volume.Spec, pod *v1.Pod, kubeClient clientset.Interface) (*storageosAPIConfig, error) {
  	if spec.PersistentVolume != nil {
  		source, _, err := getPersistentVolumeSource(spec)
  		if err != nil {
  			return nil, err
  		}
  		if source.SecretRef == nil {
  			return nil, nil
  		}
  		return parsePVSecret(source.SecretRef.Namespace, source.SecretRef.Name, kubeClient)
  	}
  
  	if spec.Volume != nil {
  		source, _, err := getVolumeSource(spec)
  		if err != nil {
  			return nil, err
  		}
  		if source.SecretRef == nil {
  			return nil, nil
  		}
  		return parsePodSecret(pod, source.SecretRef.Name, kubeClient)
  	}
  
  	return nil, fmt.Errorf("spec not Volume or PersistentVolume")
  }
docs: // Returns API config if secret set, otherwise empty struct so defaults can be
  // attempted.