From bb525f94b838de0ae06475aaf1f0fc0197d42d54 Mon Sep 17 00:00:00 2001 From: PJ Date: Mon, 14 Aug 2023 09:51:15 +0200 Subject: [PATCH] autopilot: undo bad merge --- api/autopilot.go | 1 - autopilot/autopilot.go | 13 ------------- internal/testing/cluster_test.go | 3 --- 3 files changed, 17 deletions(-) diff --git a/api/autopilot.go b/api/autopilot.go index 2b8b4a0d1..69adf0653 100644 --- a/api/autopilot.go +++ b/api/autopilot.go @@ -91,7 +91,6 @@ type ( // AutopilotStatusResponse is the response type for the /autopilot/status // endpoint. AutopilotStatusResponse struct { - Configured bool `json:"configured"` Migrating bool `json:"migrating"` MigratingLastStart ParamTime `json:"migratingLastStart"` Scanning bool `json:"scanning"` diff --git a/autopilot/autopilot.go b/autopilot/autopilot.go index 3178c8089..39a100039 100644 --- a/autopilot/autopilot.go +++ b/autopilot/autopilot.go @@ -593,13 +593,7 @@ func (ap *Autopilot) hostHandlerGET(jc jape.Context) { func (ap *Autopilot) statusHandlerGET(jc jape.Context) { migrating, mLastStart := ap.m.Status() scanning, sLastStart := ap.s.Status() - _, err := ap.bus.Autopilot(jc.Request.Context(), ap.id) - if err != nil && !strings.Contains(err.Error(), api.ErrAutopilotNotFound.Error()) { - jc.Error(err, http.StatusInternalServerError) - return - } jc.Encode(api.AutopilotStatusResponse{ - Configured: err == nil, Migrating: migrating, MigratingLastStart: api.ParamTime(mLastStart), Scanning: scanning, @@ -611,15 +605,8 @@ func (ap *Autopilot) statusHandlerGET(jc jape.Context) { func (ap *Autopilot) stateHandlerGET(jc jape.Context) { migrating, mLastStart := ap.m.Status() scanning, sLastStart := ap.s.Status() - _, err := ap.bus.Autopilot(jc.Request.Context(), ap.id) - if err != nil && !strings.Contains(err.Error(), api.ErrAutopilotNotFound.Error()) { - jc.Error(err, http.StatusInternalServerError) - return - } - jc.Encode(api.AutopilotStateResponse{ AutopilotStatusResponse: api.AutopilotStatusResponse{ - Configured: err == nil, Migrating: migrating, MigratingLastStart: api.ParamTime(mLastStart), Scanning: scanning, diff --git a/internal/testing/cluster_test.go b/internal/testing/cluster_test.go index 9b2f98bae..713c8b8ff 100644 --- a/internal/testing/cluster_test.go +++ b/internal/testing/cluster_test.go @@ -273,9 +273,6 @@ func TestNewTestCluster(t *testing.T) { if status.UptimeMS == 0 { t.Fatal("uptime should be set") } - if !status.Configured { - t.Fatal("autopilot should be configured") - } } // TestObjectEntries is an integration test that verifies objects are uploaded,