code: func getSubresourcesForVersion(crd *apiextensions.CustomResourceDefinitionSpec, version string) *apiextensions.CustomResourceSubresources {
  	if !hasPerVersionSubresources(crd.Versions) {
  		return crd.Subresources
  	}
  	for _, v := range crd.Versions {
  		if version == v.Name {
  			return v.Subresources
  		}
  	}
  	return nil
  }
docs: // getSubresourcesForVersion returns the subresources for given version in given CRD spec.
  // NOTE That this function assumes version always exist since it's used by the validation process
  // that iterates through the existing versions.