Skip to content

Commit

Permalink
update kubernetes client (#2038)
Browse files Browse the repository at this point in the history
  • Loading branch information
rogeralsing authored Sep 6, 2023
1 parent 32fc17b commit cdd0329
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
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

0 comments on commit cdd0329

Please sign in to comment.