mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-30 18:17:55 +00:00 
			
		
		
		
	plugins: Handle mount/enable for shadowed builtins (#17879)
* Allow mounting external plugins with same name/type as deprecated builtins * Add some go tests for deprecation status handling * Move timestamp storage to post-unseal * Add upgrade-aware deprecation shutdown and tests
This commit is contained in:
		| @@ -250,13 +250,6 @@ func TestSecretsEnableCommand_Run(t *testing.T) { | ||||
|  | ||||
| 		for _, b := range backends { | ||||
| 			expectedResult := 0 | ||||
| 			status, _ := builtinplugins.Registry.DeprecationStatus(b, consts.PluginTypeSecrets) | ||||
| 			allowDeprecated := os.Getenv(consts.VaultAllowPendingRemovalMountsEnv) | ||||
|  | ||||
| 			// Need to handle deprecated builtins specially | ||||
| 			if (status == consts.PendingRemoval && allowDeprecated == "") || status == consts.Removed { | ||||
| 				expectedResult = 2 | ||||
| 			} | ||||
|  | ||||
| 			ui, cmd := testSecretsEnableCommand(t) | ||||
| 			cmd.client = client | ||||
| @@ -264,6 +257,13 @@ func TestSecretsEnableCommand_Run(t *testing.T) { | ||||
| 			actualResult := cmd.Run([]string{ | ||||
| 				b, | ||||
| 			}) | ||||
|  | ||||
| 			// Need to handle deprecated builtins specially | ||||
| 			status, _ := builtinplugins.Registry.DeprecationStatus(b, consts.PluginTypeSecrets) | ||||
| 			if status == consts.PendingRemoval || status == consts.Removed { | ||||
| 				expectedResult = 2 | ||||
| 			} | ||||
|  | ||||
| 			if actualResult != expectedResult { | ||||
| 				t.Errorf("type: %s - got: %d, expected: %d - %s", b, actualResult, expectedResult, ui.OutputWriter.String()+ui.ErrorWriter.String()) | ||||
| 			} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Mike Palmiotto
					Mike Palmiotto