From 4141668382063c9d3b05e16d9b07206a03873bb8 Mon Sep 17 00:00:00 2001 From: Paul Lorenz Date: Wed, 13 Dec 2023 11:35:10 -0500 Subject: [PATCH] Cluster mode -> HA mode for consistency --- controller/api_impl/raft_router.go | 8 ++++---- controller/apierror/helpers.go | 8 ++++---- controller/apierror/messages.go | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/controller/api_impl/raft_router.go b/controller/api_impl/raft_router.go index 2ea1eabfd..a12319eea 100644 --- a/controller/api_impl/raft_router.go +++ b/controller/api_impl/raft_router.go @@ -105,7 +105,7 @@ func (r *RaftRouter) listMembers(n *network.Network, rc api.RequestContext) { }, http.StatusOK) } else { - rc.RespondWithApiError(apierror.NewNotRunningInClusterModeError()) + rc.RespondWithApiError(apierror.NewNotRunningInHAModeError()) } } @@ -138,7 +138,7 @@ func (r *RaftRouter) addMember(n *network.Network, rc api.RequestContext, params rc.RespondWithEmptyOk() } else { - rc.RespondWithApiError(apierror.NewNotRunningInClusterModeError()) + rc.RespondWithApiError(apierror.NewNotRunningInHAModeError()) } } @@ -158,7 +158,7 @@ func (r *RaftRouter) removeMember(n *network.Network, rc api.RequestContext, par rc.RespondWithEmptyOk() } else { - rc.RespondWithApiError(apierror.NewNotRunningInClusterModeError()) + rc.RespondWithApiError(apierror.NewNotRunningInHAModeError()) } } @@ -183,6 +183,6 @@ func (r *RaftRouter) transferLeadership(n *network.Network, rc api.RequestContex rc.RespondWithEmptyOk() } else { - rc.RespondWithApiError(apierror.NewNotRunningInClusterModeError()) + rc.RespondWithApiError(apierror.NewNotRunningInHAModeError()) } } diff --git a/controller/apierror/helpers.go b/controller/apierror/helpers.go index 0d8d93473..475733ca6 100644 --- a/controller/apierror/helpers.go +++ b/controller/apierror/helpers.go @@ -384,10 +384,10 @@ func NewTooManyUpdatesError() *errorz.ApiError { } } -func NewNotRunningInClusterModeError() *errorz.ApiError { +func NewNotRunningInHAModeError() *errorz.ApiError { return &errorz.ApiError{ - Code: ServerNotRunningInClusterModeCode, - Message: ServerNotRunningInClusterModeMessage, - Status: ServerNotRunningInClusterModeStatus, + Code: ServerNotRunningInHAModeCode, + Message: ServerNotRunningInHAModeMessage, + Status: ServerNotRunningInHAModeStatus, } } diff --git a/controller/apierror/messages.go b/controller/apierror/messages.go index 2c2d0396e..b4b69b695 100644 --- a/controller/apierror/messages.go +++ b/controller/apierror/messages.go @@ -199,9 +199,9 @@ const ( ServerTooManyRequestsMessage string = "Too many requests to alter state have been issued. Please slow your request rate or try again later." ServerTooManyRequestsStatus int = http.StatusTooManyRequests - ServerNotRunningInClusterModeCode string = "SERVER_NOT_RUNNING_IN_CLUSTER_MODE" - ServerNotRunningInClusterModeMessage string = "The server is not running in cluster mode. Cluster operations are not permitted" - ServerNotRunningInClusterModeStatus = http.StatusBadRequest + ServerNotRunningInHAModeCode string = "SERVER_NOT_RUNNING_IN_HA_MODE" + ServerNotRunningInHAModeMessage string = "The server is not running in HA mode. HA operations are not permitted" + ServerNotRunningInHAModeStatus = http.StatusBadRequest TransferLeadershipErrorCode string = "TRANSFER_LEADERSHIP_ERROR" TransferLeadershipErrorMessage string = "Error while attempting to transfer leadership"