Skip to content

Commit

Permalink
Cluster mode -> HA mode for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
plorenz committed Dec 13, 2023
1 parent d84f3b4 commit 4141668
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions controller/api_impl/raft_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}

Expand Down Expand Up @@ -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())
}
}

Expand All @@ -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())
}
}

Expand All @@ -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())
}
}
8 changes: 4 additions & 4 deletions controller/apierror/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}
6 changes: 3 additions & 3 deletions controller/apierror/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4141668

Please sign in to comment.