Skip to content

Commit

Permalink
autopilot: undo bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed Aug 14, 2023
1 parent 4f161f6 commit bb525f9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 17 deletions.
1 change: 0 additions & 1 deletion api/autopilot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
13 changes: 0 additions & 13 deletions autopilot/autopilot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions internal/testing/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit bb525f9

Please sign in to comment.