mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-30 18:17:55 +00:00 
			
		
		
		
	Reload seals if necessary when a node gains leadership. (#26098)
As part of the process of becoming a leader node, check to see if the seal configuration needs to be reloaded. Reloading may be necessary if the seal generation information computed during start up is outdated. For example, a new node that has just joined the cluster will have incorrect seal generation information in memory, even if it has the correct seal configuration, since it did not have access to the stored seal generation information.
This commit is contained in:
		| @@ -412,14 +412,14 @@ func TestReloadSeals(t *testing.T) { | ||||
| 	_, testCommand := testServerCommand(t) | ||||
| 	testConfig := server.Config{SharedConfig: &configutil.SharedConfig{}} | ||||
|  | ||||
| 	_, err := testCommand.reloadSeals(context.Background(), testCore, &testConfig) | ||||
| 	if err == nil { | ||||
| 		t.Fatal("expected error, got nil") | ||||
| 	} | ||||
| 	testCommand.logger = corehelpers.NewTestLogger(t) | ||||
| 	ctx := context.Background() | ||||
| 	reloaded, err := testCommand.reloadSealsLocking(ctx, testCore, &testConfig) | ||||
| 	require.NoError(t, err) | ||||
| 	require.False(t, reloaded, "reloadSeals does not support Shamir seals") | ||||
|  | ||||
| 	testConfig = server.Config{SharedConfig: &configutil.SharedConfig{Seals: []*configutil.KMS{{Disabled: true}}}} | ||||
| 	_, err = testCommand.reloadSeals(context.Background(), testCore, &testConfig) | ||||
| 	if err == nil { | ||||
| 		t.Fatal("expected error, got nil") | ||||
| 	} | ||||
| 	reloaded, err = testCommand.reloadSealsLocking(ctx, testCore, &testConfig) | ||||
| 	require.NoError(t, err) | ||||
| 	require.False(t, reloaded, "reloadSeals does not support Shamir seals") | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Victor Rodriguez
					Victor Rodriguez