-
Notifications
You must be signed in to change notification settings - Fork 849
Update KubernetesClient #2435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Update KubernetesClient #2435
Conversation
I want to be clear -- this is still pretty early on. I'm looking for feedback from the GitHub Actions pipelines, once they're approved. |
maybe we can get rid of the KubernetesClient dependency in the AspNetCore.HealthChecks.UI, does not seem logical that the UI part needs a Kubernetes dependency. |
@vip32 I am trying to keep it as simple as possible. This repository is actively seeking new maintainers so I'm not trying to make anything too complicated so as to reduce the burden to review and maintain my change. |
Updating k8s client version will cause error |
@AntiPasha I figured I'd look into that once there was enough interest in this PR to at least approve the CI workflow to run. 👍 |
Ok, thank you. Faced with this problem when updated |
Hi @SeanKilleen , thanks for taking care of this! 🙏 Do you think you could update src/HealthChecks.UI/Core/HostedService/HealthCheckReportCollector.cs: @@ -1,4 +1,6 @@
+using System.Net.Http.Headers;
using System.Net.Http.Json;
+using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;
using HealthChecks.UI.Configuration;
@@ -134,7 +136,7 @@ internal sealed class HealthCheckReportCollector : IHealthCheckReportCollector,
// means you can't use _httpClient.GetAsync and have to use _httpClient.SendAsync
using var requestMessage = new HttpRequestMessage(HttpMethod.Get, absoluteUri);
- requestMessage.Headers.Authorization = new BasicAuthenticationHeaderValue(userInfoArr[0], userInfoArr[1]);
+ requestMessage.Headers.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes($"{userInfoArr[0]}:{userInfoArr[1]}")));
response = await _httpClient.SendAsync(requestMessage, HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false);
}
} TL;DR: This removes dependency on IdentityModel and fixes the build. Longer explanation: Previous KubernetesClient 15.0.1 had a transitive dependency on IdentityModel package. To makes things worse, the IdentityModel package is now decommissioned and removed from Nuget. Luckily, the source code for this single class is still available in the archive. |
@gleb-osokin I am happy to do that, but as I mentioned before, this repository is a bit dormant so I'm holding off on doing anything until someone approves the GitHub Actions to run, so that I can get better feedback from the official build system as I proceed. If I can't get someone to do that, the likelihood of this being merged is very slim, so I can't spend more time on it. |
What this PR does / why we need it: Updates KubernetesClient to the earliest version which is not impacted by a security vulnerability (which happens to be the latest version).
Which issue(s) this PR fixes: #2434
Please reference the issue this PR will close: #2434
Special notes for your reviewer:
Does this PR introduce a user-facing change?: No
Please make sure you've completed the relevant tasks for this PR, out of the following list: