Skip to content

Commit 576a6a0

Browse files
kunal.behbudzadeDeln0r
authored andcommitted
server: allow non-admin maintenance status
Signed-off-by: kunal.behbudzade <kunal.behbudzade@btsgrp.com> Signed-off-by: Ian Chechin <ian00chechin@gmail.com>
1 parent 2286051 commit 576a6a0

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

server/etcdserver/api/v3rpc/maintenance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ func (ams *authMaintenanceServer) Alarm(ctx context.Context, ar *pb.AlarmRequest
364364
}
365365

366366
func (ams *authMaintenanceServer) Status(ctx context.Context, ar *pb.StatusRequest) (*pb.StatusResponse, error) {
367-
if err := ams.isPermitted(ctx); err != nil {
367+
if err := ams.requireAuthInfo(ctx); err != nil {
368368
return nil, togRPCError(err)
369369
}
370370

tests/common/maintenance_auth_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func TestStatusWithRootAuth(t *testing.T) {
166166
}
167167

168168
func TestStatusWithUserAuth(t *testing.T) {
169-
testStatusWithAuth(t, false, true, WithAuth("user0", "user0Pass"))
169+
testStatusWithAuth(t, false, false, WithAuth("user0", "user0Pass"))
170170
}
171171

172172
func testStatusWithAuth(t *testing.T, expectConnectionError, expectOperationError bool, opts ...config.ClientOption) {

0 commit comments

Comments
 (0)