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