Skip to content

Commit 325fa2c

Browse files
committed
fix SA1131
1 parent 8f1f46b commit 325fa2c

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

src/KubernetesClient/IntstrIntOrString.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public override bool Equals(object obj)
5555

5656
public override int GetHashCode()
5757
{
58-
return (Value != null ? Value.GetHashCode() : 0);
58+
return Value != null ? Value.GetHashCode() : 0;
5959
}
6060
}
6161
}

src/KubernetesClient/Kubernetes.WebSocket.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,9 @@ protected async Task<WebSocket> StreamConnectAsync(Uri uri, string invocationId
346346
.ConfigureAwait(false);
347347
}
348348
catch (WebSocketException wse) when (wse.WebSocketErrorCode == WebSocketError.HeaderError ||
349-
(wse.InnerException is WebSocketException &&
350-
((WebSocketException)wse.InnerException).WebSocketErrorCode ==
351-
WebSocketError.HeaderError))
349+
wse.InnerException is WebSocketException &&
350+
((WebSocketException)wse.InnerException).WebSocketErrorCode ==
351+
WebSocketError.HeaderError)
352352
{
353353
// This usually indicates the server sent an error message, like 400 Bad Request. Unfortunately, the WebSocket client
354354
// class doesn't give us a lot of information about what went wrong. So, retry the connection.

src/KubernetesClient/ResourceQuantity.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public string CanonicalizeString(SuffixFormat suffixFormat)
139139
{
140140
if (suffixFormat == SuffixFormat.BinarySI)
141141
{
142-
if (-1024 < _unitlessValue && _unitlessValue < 1024)
142+
if (_unitlessValue > -1024 && _unitlessValue < 1024)
143143
{
144144
return Suffixer.AppendMaxSuffix(_unitlessValue, SuffixFormat.DecimalSI);
145145
}

src/KubernetesClient/WatcherDelegatingHandler.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
2020
{
2121
var originResponse = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
2222

23-
if (originResponse.IsSuccessStatusCode && request.Method == HttpMethod.Get) // all watches are GETs, so we can ignore others
23+
// all watches are GETs, so we can ignore others
24+
if (originResponse.IsSuccessStatusCode && request.Method == HttpMethod.Get)
2425
{
2526
string query = request.RequestUri.Query;
2627
int index = query.IndexOf("watch=true");

tests/KubernetesClient.Tests/AuthTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ private K8SConfiguration GetK8SConfiguration(string serverUri, string token, str
444444
var arguments = new string[] { };
445445
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
446446
{
447-
arguments = ($"/c echo {responseJson}").Split(" ");
447+
arguments = $"/c echo {responseJson}".Split(" ");
448448
}
449449

450450
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ||

0 commit comments

Comments
 (0)