Skip to content

Commit 3950809

Browse files
committed
Fix FortiOS mirror not resolving host secrets in the same namespace.
1 parent ddcf144 commit 3950809

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ES.Kubernetes.Reflector.Secrets/FortiMirror.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ private async Task OnEvent(WatcherEvent<V1Secret> e)
127127
string fortiPassword;
128128
try
129129
{
130-
var hostSecret = await _apiClient.ReadNamespacedSecretAsync(hostSecretId.Name, hostSecretId.Namespace);
130+
var hostSecret = await _apiClient.ReadNamespacedSecretAsync(hostSecretId.Name,
131+
string.IsNullOrWhiteSpace(hostSecretId.Namespace)
132+
? e.Item.Metadata.NamespaceProperty
133+
: hostSecretId.Namespace);
131134
if (hostSecret.Data is null || !hostSecret.Data.Keys.Any())
132135
{
133136
_logger.LogWarning("Cannot reflect {secretId} to {hostSecretId}. " +

0 commit comments

Comments
 (0)