updating
This commit is contained in:
+10
-3
@@ -37,14 +37,21 @@ namespace LCU.Webapps.Marketing.SPIT
|
||||
private static IDictionary<string, string> LoadPlainTextSpeechSecrets()
|
||||
{
|
||||
var configValues = new Dictionary<string, string>();
|
||||
var secretMappings = new[]
|
||||
{
|
||||
(Path: "/vault/secrets/speech-api-key", Key: "Primary:SpeechApiKey"),
|
||||
(Path: "/vault/secrets/speech-endpoint", Key: "Primary:SpeechEndpoint"),
|
||||
};
|
||||
|
||||
AddSecretValue(configValues, "/vault/secrets/speech-api-key.json", "Primary:SpeechApiKey");
|
||||
AddSecretValue(configValues, "/vault/secrets/speech-endpoint.json", "Primary:SpeechEndpoint");
|
||||
foreach (var secretMapping in secretMappings)
|
||||
{
|
||||
TryAddSecretValue(configValues, secretMapping.Path, secretMapping.Key);
|
||||
}
|
||||
|
||||
return configValues;
|
||||
}
|
||||
|
||||
private static void AddSecretValue(IDictionary<string, string> configValues, string path, string key)
|
||||
private static void TryAddSecretValue(IDictionary<string, string> configValues, string path, string key)
|
||||
{
|
||||
if (!File.Exists(path))
|
||||
{
|
||||
|
||||
+2
-2
@@ -28,7 +28,7 @@
|
||||
path: /spec/template/spec/containers/0/volumeMounts/-
|
||||
value:
|
||||
name: spit-secrets
|
||||
mountPath: /vault/secrets/speech-api-key.json
|
||||
mountPath: /vault/secrets/speech-api-key
|
||||
readOnly: true
|
||||
subPath: speech-api-key
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
path: /spec/template/spec/containers/0/volumeMounts/-
|
||||
value:
|
||||
name: spit-secrets
|
||||
mountPath: /vault/secrets/speech-endpoint.json
|
||||
mountPath: /vault/secrets/speech-endpoint
|
||||
readOnly: true
|
||||
subPath: speech-endpoint
|
||||
|
||||
|
||||
Reference in New Issue
Block a user