code: func CreateResource(tx Tx, r *api.Resource) error {
  	if err := confirmExtension(tx, r); err != nil {
  		return err
  	}
  	// TODO(dperny): currently the "name" index is unique, which means only one
  	// Resource of _any_ Kind can exist with that name. This isn't a problem
  	// right now, but the ideal case would be for names to be namespaced to the
  	// kind.
  	if tx.lookup(tableResource, indexName, strings.ToLower(r.Annotations.Name)) != nil {
  		return ErrNameConflict
  	}
  	return tx.create(tableResource, resourceEntry{r})
  }
docs: // CreateResource adds a new resource object to the store.
  // Returns ErrExist if the ID is already taken.
  // Returns ErrNameConflict if a Resource with this Name already exists
  // Returns ErrNoKind if the specified Kind does not exist