Skip to content
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

Update kubernetes client #2038

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Proto.Cluster.Kubernetes/KubernetesClusterMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private Task<HttpOperationResponse<V1PodList>> GetListTask(string clusterName, b
Logger.Log(_config.DebugLogLevel, "[Cluster][KubernetesProvider] Starting to watch pods with {Selector}",
selector);

return _kubernetes.ListNamespacedPodWithHttpMessagesAsync(
return _kubernetes.CoreV1.ListNamespacedPodWithHttpMessagesAsync(
KubernetesExtensions.GetKubeNamespace(),
labelSelector: selector,
watch: watch,
Expand Down
2 changes: 1 addition & 1 deletion src/Proto.Cluster.Kubernetes/KubernetesExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ IDictionary<string, string> annotations
var expected = JsonSerializer.SerializeToDocument(pod);
var patch = old.CreatePatch(expected);

return kubernetes.PatchNamespacedPodAsync(new V1Patch(patch, V1Patch.PatchType.JsonPatch), podName,
return kubernetes.CoreV1.PatchNamespacedPodAsync(new V1Patch(patch, V1Patch.PatchType.JsonPatch), podName,
podNamespace);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Proto.Cluster.Kubernetes/KubernetesProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public async Task<DiagnosticsEntry[]> GetDiagnostics()
{
var selector = $"{LabelCluster}={_clusterName}";
using var client = _config.ClientFactory();
var res = await client.ListNamespacedPodWithHttpMessagesAsync(
var res = await client.CoreV1.ListNamespacedPodWithHttpMessagesAsync(
KubernetesExtensions.GetKubeNamespace(),
labelSelector: selector,
timeoutSeconds: _config.WatchTimeoutSeconds,
Expand Down Expand Up @@ -139,7 +139,7 @@ public async Task RegisterMemberInner()
Logger.LogInformation("[Cluster][KubernetesProvider] Registering service {PodName} on {PodIp}", _podName,
_address);

var pod = await kubernetes.ReadNamespacedPodAsync(_podName, KubernetesExtensions.GetKubeNamespace()).ConfigureAwait(false);
var pod = await kubernetes.CoreV1.ReadNamespacedPodAsync(_podName, KubernetesExtensions.GetKubeNamespace()).ConfigureAwait(false);

if (pod is null)
{
Expand Down Expand Up @@ -230,7 +230,7 @@ private async Task DeregisterMemberInner(Cluster cluster)

var kubeNamespace = KubernetesExtensions.GetKubeNamespace();

var pod = await kubernetes.ReadNamespacedPodAsync(_podName, kubeNamespace).ConfigureAwait(false);
var pod = await kubernetes.CoreV1.ReadNamespacedPodAsync(_podName, kubeNamespace).ConfigureAwait(false);

var labels = pod.Metadata.Labels
.Where(label => !label.Key.StartsWith(ProtoClusterPrefix, StringComparison.Ordinal))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<ItemGroup>
<PackageReference Include="JsonPatch.Net" Version="1.1.2" />
<PackageReference Include="KubernetesClient" Version="7.2.19" />
<PackageReference Include="KubernetesClient" Version="12.0.16" />
</ItemGroup>

<ItemGroup>
Expand Down