Skip to content

Commit

Permalink
fix: correct key variable assignment and trim whitespace in secrets i…
Browse files Browse the repository at this point in the history
…mport handler (#648)

Fixes #647

Signed-off-by: Nikolai Emil Damm <[email protected]>
  • Loading branch information
devantler authored Feb 21, 2025
1 parent 08ce130 commit 7d52f2c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ class KSailSecretsImportCommandHandler(KSailCluster config, string key, ISecretM
internal async Task<int> HandleAsync(CancellationToken cancellationToken)
{
Console.WriteLine($"► importing '{_key}' to '{_config.Spec.Project.SecretManager}'");
string key = File.ReadAllText(_key);
string key = _key;
if (File.Exists(key))
{
key = File.ReadAllText(key);
}
var ageKey = new AgeKey(key);
var ageKey = new AgeKey(key.Trim());
_ = await _secretManager.ImportKeyAsync(ageKey, cancellationToken).ConfigureAwait(false);
Console.WriteLine("✔ key imported");
return 0;
Expand Down

0 comments on commit 7d52f2c

Please sign in to comment.