func (r *Runner) addHost(c *cluster.Cluster, w http.ResponseWriter, q url.Values, ps httprouter.Params) (err error) { var instance *cluster.Instance if q.Get("vanilla") == "" { instance, err = c.AddHost() } else { instance, err = c.AddVanillaHost(args.RootFS) } if err != nil { return err } return json.NewEncoder(w).Encode(instance) }