code: func (r *EtcdRegistry) CreateUnit(u *job.Unit) error {
  	if err := r.storeOrGetUnitFile(u.Unit); err != nil {
  		return err
  	}
  
  	jm := jobModel{
  		Name:     u.Name,
  		UnitHash: u.Unit.Hash(),
  	}
  	val, err := marshal(jm)
  	if err != nil {
  		return err
  	}
  
  	opts := &etcd.SetOptions{
  		// Since we support replacing units, just ignore previous
  		// job keys if they exist, this allows us to update the
  		// job object key with a new unit.
  		PrevExist: etcd.PrevIgnore,
  	}
  	key := r.prefixed(jobPrefix, u.Name, "object")
  	_, err = r.kAPI.Set(context.Background(), key, val, opts)
  	if err != nil {
  		return err
  	}
  
  	return r.SetUnitTargetState(u.Name, u.TargetState)
  }
docs: // CreateUnit attempts to store a Unit and its associated unit file in the registry