From f0dd28d4e1cf23c08ad08c08f6f7104155dc3c13 Mon Sep 17 00:00:00 2001 From: Roger Johansson Date: Wed, 6 Sep 2023 14:50:05 +0200 Subject: [PATCH] update kubernetes client --- src/Proto.Cluster.Kubernetes/KubernetesClusterMonitor.cs | 2 +- src/Proto.Cluster.Kubernetes/KubernetesExtensions.cs | 2 +- src/Proto.Cluster.Kubernetes/KubernetesProvider.cs | 6 +++--- .../Proto.Cluster.Kubernetes.csproj | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Proto.Cluster.Kubernetes/KubernetesClusterMonitor.cs b/src/Proto.Cluster.Kubernetes/KubernetesClusterMonitor.cs index c3b11ef09e..ce5adbdcad 100644 --- a/src/Proto.Cluster.Kubernetes/KubernetesClusterMonitor.cs +++ b/src/Proto.Cluster.Kubernetes/KubernetesClusterMonitor.cs @@ -202,7 +202,7 @@ private Task> 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, diff --git a/src/Proto.Cluster.Kubernetes/KubernetesExtensions.cs b/src/Proto.Cluster.Kubernetes/KubernetesExtensions.cs index 4180b84030..9337035d94 100644 --- a/src/Proto.Cluster.Kubernetes/KubernetesExtensions.cs +++ b/src/Proto.Cluster.Kubernetes/KubernetesExtensions.cs @@ -49,7 +49,7 @@ IDictionary 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); } diff --git a/src/Proto.Cluster.Kubernetes/KubernetesProvider.cs b/src/Proto.Cluster.Kubernetes/KubernetesProvider.cs index 0e67e3f189..8279fd3983 100644 --- a/src/Proto.Cluster.Kubernetes/KubernetesProvider.cs +++ b/src/Proto.Cluster.Kubernetes/KubernetesProvider.cs @@ -45,7 +45,7 @@ public async Task 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, @@ -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) { @@ -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)) diff --git a/src/Proto.Cluster.Kubernetes/Proto.Cluster.Kubernetes.csproj b/src/Proto.Cluster.Kubernetes/Proto.Cluster.Kubernetes.csproj index 9342a7a1eb..2fb15e176f 100644 --- a/src/Proto.Cluster.Kubernetes/Proto.Cluster.Kubernetes.csproj +++ b/src/Proto.Cluster.Kubernetes/Proto.Cluster.Kubernetes.csproj @@ -7,7 +7,7 @@ - +