@@ -402,8 +402,8 @@ func (b *SystemBackend) handleStorageRaftSnapshotRead() framework.OperationFunc
402402
403403func (b * SystemBackend ) handleStorageRaftAutopilotState () framework.OperationFunc {
404404 return func (ctx context.Context , req * logical.Request , d * framework.FieldData ) (* logical.Response , error ) {
405- raftBackend , ok := b .Core .underlyingPhysical .( * raft. RaftBackend )
406- if ! ok {
405+ raftBackend := b .Core .getRaftBackend ( )
406+ if raftBackend == nil {
407407 return logical .ErrorResponse ("raft storage is not in use" ), logical .ErrInvalidRequest
408408 }
409409
@@ -431,12 +431,12 @@ func (b *SystemBackend) handleStorageRaftAutopilotState() framework.OperationFun
431431
432432func (b * SystemBackend ) handleStorageRaftAutopilotConfigRead () framework.OperationFunc {
433433 return func (ctx context.Context , req * logical.Request , d * framework.FieldData ) (* logical.Response , error ) {
434- raftStorage , ok := b .Core .underlyingPhysical .( * raft. RaftBackend )
435- if ! ok {
434+ raftBackend := b .Core .getRaftBackend ( )
435+ if raftBackend == nil {
436436 return logical .ErrorResponse ("raft storage is not in use" ), logical .ErrInvalidRequest
437437 }
438438
439- config := raftStorage .AutopilotConfig ()
439+ config := raftBackend .AutopilotConfig ()
440440 if config == nil {
441441 return nil , nil
442442 }
@@ -456,8 +456,8 @@ func (b *SystemBackend) handleStorageRaftAutopilotConfigRead() framework.Operati
456456
457457func (b * SystemBackend ) handleStorageRaftAutopilotConfigUpdate () framework.OperationFunc {
458458 return func (ctx context.Context , req * logical.Request , d * framework.FieldData ) (* logical.Response , error ) {
459- raftStorage , ok := b .Core .underlyingPhysical .( * raft. RaftBackend )
460- if ! ok {
459+ raftBackend := b .Core .getRaftBackend ( )
460+ if raftBackend == nil {
461461 return logical .ErrorResponse ("raft storage is not in use" ), logical .ErrInvalidRequest
462462 }
463463
@@ -506,7 +506,7 @@ func (b *SystemBackend) handleStorageRaftAutopilotConfigUpdate() framework.Opera
506506 persist = true
507507 }
508508
509- effectiveConf := raftStorage .AutopilotConfig ()
509+ effectiveConf := raftBackend .AutopilotConfig ()
510510 effectiveConf .Merge (config )
511511
512512 if effectiveConf .CleanupDeadServers && effectiveConf .MinQuorum < 3 {
@@ -525,7 +525,7 @@ func (b *SystemBackend) handleStorageRaftAutopilotConfigUpdate() framework.Opera
525525 }
526526
527527 // Set the effectiveConfig
528- raftStorage .SetAutopilotConfig (effectiveConf )
528+ raftBackend .SetAutopilotConfig (effectiveConf )
529529
530530 return nil , nil
531531 }
0 commit comments