Beispiel #1
0
func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
	p := r.FormValue("project")
	env := r.FormValue("environment")
	comment := r.FormValue("comment")
	err := config.SetComment(h.ecl, p, env, comment)
	if err != nil {
		glog.Errorf("Failed to store comment for project=%s env=%s: %v", p, env, err)
		http.Error(w, err.Error(), http.StatusInternalServerError)
		return
	}
	http.Redirect(w, r, "/", http.StatusSeeOther)
}
Beispiel #2
0
func TestSetComment(t *testing.T) {
	err := config.SetComment(&MockEtcdClient{}, "test_project", "test_environment", "A comment")
	if err != nil {
		t.Fatalf("Can't set Comment %s", err)
	}
}