diff --git a/command/operator_migrate.go b/command/operator_migrate.go index 6e26058949..fd9ac84282 100644 --- a/command/operator_migrate.go +++ b/command/operator_migrate.go @@ -184,6 +184,7 @@ func (c *OperatorMigrateCommand) migrate(config *migratorConfig) error { select { case err := <-doneCh: + cancelFunc() return err case <-c.ShutdownCh: c.UI.Output("==> Migration shutdown triggered\n") @@ -191,7 +192,6 @@ func (c *OperatorMigrateCommand) migrate(config *migratorConfig) error { <-doneCh return errAbort } - return nil } // migrateAll copies all keys in lexicographic order. diff --git a/command/server.go b/command/server.go index 2cdbb53cd9..2de6487af7 100644 --- a/command/server.go +++ b/command/server.go @@ -1842,7 +1842,6 @@ func (c *ServerCommand) storageMigrationActive(backend physical.Backend) bool { return true } } - return false } type StorageMigrationStatus struct { diff --git a/vault/token_store.go b/vault/token_store.go index 1b12f8eafc..da2d7efbb1 100644 --- a/vault/token_store.go +++ b/vault/token_store.go @@ -905,8 +905,6 @@ func (ts *TokenStore) create(ctx context.Context, entry *logical.TokenEntry) err default: return fmt.Errorf("cannot create a token of type %d", entry.Type) } - - return errors.New("unreachable code") } // Store is used to store an updated token entry without writing the