Skip to content

Commit abebb2c

Browse files
authored
fix conditional compilation for net 5.0+ (#834)
1 parent 199ec8b commit abebb2c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/KubernetesClient/Authentication/TokenFileAuth.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ public TokenFileAuth(string tokenFile)
1717
TokenFile = tokenFile;
1818
}
1919

20-
#if NETSTANDARD2_1_OR_GREATER
20+
#if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER
2121
public async Task<AuthenticationHeaderValue> GetAuthenticationHeaderAsync(CancellationToken cancellationToken)
2222
#else
2323
public Task<AuthenticationHeaderValue> GetAuthenticationHeaderAsync(CancellationToken cancellationToken)
2424
#endif
2525
{
2626
if (TokenExpiresAt < DateTime.UtcNow)
2727
{
28-
#if NETSTANDARD2_1_OR_GREATER
28+
#if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER
2929
token = await File.ReadAllTextAsync(TokenFile, cancellationToken)
3030
.ContinueWith(r => r.Result.Trim(), cancellationToken)
3131
.ConfigureAwait(false);
@@ -40,7 +40,7 @@ public Task<AuthenticationHeaderValue> GetAuthenticationHeaderAsync(Cancellation
4040
// < 10-8-1 minute.
4141
TokenExpiresAt = DateTime.UtcNow.AddMinutes(1);
4242
}
43-
#if NETSTANDARD2_1_OR_GREATER
43+
#if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER
4444
return new AuthenticationHeaderValue("Bearer", token);
4545
#else
4646
return Task.FromResult(new AuthenticationHeaderValue("Bearer", token));

0 commit comments

Comments
 (0)