Only reload seal config when enable_multiseal is set, or is being disabled (#26166)

Fix reloading of seal configuration when a node gains leadership.

Verify that the in-memory seal generation information is stale and only reload
seal configuration when that is the case.

When reloading seal configuration, only do it when enable_multiseal is currently
set to true, or the new configuration is attempting to set it to true.
This commit is contained in:
Victor Rodriguez
2024-03-27 13:57:46 -04:00
committed by GitHub
parent 483e3e482c
commit ae31138aea
3 changed files with 73 additions and 41 deletions

View File

@@ -414,12 +414,12 @@ func TestReloadSeals(t *testing.T) {
testCommand.logger = corehelpers.NewTestLogger(t)
ctx := context.Background()
reloaded, err := testCommand.reloadSealsLocking(ctx, testCore, &testConfig)
reloaded, err := testCommand.reloadSealsOnSigHup(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}}}}
reloaded, err = testCommand.reloadSealsLocking(ctx, testCore, &testConfig)
reloaded, err = testCommand.reloadSealsOnSigHup(ctx, testCore, &testConfig)
require.NoError(t, err)
require.False(t, reloaded, "reloadSeals does not support Shamir seals")
}