Skip to content

Commit dcae024

Browse files
Copilotmitchdenny
andauthored
Update KubernetesClient to v18.0.5 and fix breaking changes (#12071)
* Initial plan * Initial exploration and plan for KubernetesClient update Co-authored-by: mitchdenny <[email protected]> * Update KubernetesClient to v18.0.5 and fix breaking changes Co-authored-by: mitchdenny <[email protected]> * Add explicit KubernetesClient reference to test projects Co-authored-by: mitchdenny <[email protected]> * Remove NuGet.config changes - package now in internal feed Co-authored-by: mitchdenny <[email protected]> * Remove explicit KubernetesClient references from test projects Co-authored-by: mitchdenny <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: mitchdenny <[email protected]>
1 parent 5e9bc46 commit dcae024

File tree

10 files changed

+15
-10
lines changed

10 files changed

+15
-10
lines changed

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
<PackageVersion Include="Grpc.Net.ClientFactory" Version="2.71.0" />
9090
<PackageVersion Include="Grpc.Tools" Version="2.72.0" />
9191
<PackageVersion Include="Humanizer.Core" Version="2.14.1" />
92-
<PackageVersion Include="KubernetesClient" Version="17.0.14" />
92+
<PackageVersion Include="KubernetesClient" Version="18.0.5" />
9393
<PackageVersion Include="JsonPatch.Net" Version="3.3.0" />
9494
<PackageVersion Include="Markdig" Version="0.42.0" />
9595
<PackageVersion Include="Microsoft.AI.Foundry.Local" Version="0.2.0" />

src/Aspire.Hosting/Dcp/KubernetesService.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,12 @@ public Task<T> DeleteAsync<T>(string name, string? namespaceParameter = null, Ca
284284
watch: true,
285285
cancellationToken: restartCancellationToken);
286286

287-
return responseTask.WatchAsync<T, object>(null, restartCancellationToken);
287+
// TODO: KubernetesClient v18 marked WatchAsync extension method as obsolete.
288+
// The new pattern uses Watcher<T> directly, but requires significant refactoring.
289+
// This API still works in v18.x and will be updated in a future change.
290+
#pragma warning disable CS0618 // Type or member is obsolete
291+
return responseTask.WatchAsync<T, object>(onError: null, restartCancellationToken);
292+
#pragma warning restore CS0618 // Type or member is obsolete
288293
},
289294
RetryOnConnectivityAndConflictErrors,
290295
restartCancellationToken);

src/Aspire.Hosting/Dcp/Model/Container.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ internal static class ContainerFileSystemEntryType
434434
public const string OpenSSL = "openssl";
435435
}
436436

437-
internal sealed class ContainerStatus : V1Status
437+
internal sealed record ContainerStatus : V1Status
438438
{
439439
// Container name displayed in Docker
440440
[JsonPropertyName("containerName")]

src/Aspire.Hosting/Dcp/Model/ContainerExec.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ internal sealed class ContainerExecSpec
4747
public List<string>? Args { get; set; }
4848
}
4949

50-
internal sealed class ContainerExecStatus : V1Status
50+
internal sealed record ContainerExecStatus : V1Status
5151
{
5252
/// <summary>
5353
/// The current state of the container execution. See <see cref="ExecutableState"/> for possible values.

src/Aspire.Hosting/Dcp/Model/ContainerVolume.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ internal static class ContainerVolumeState
4040
public const string Ready = "Ready";
4141
}
4242

43-
internal sealed class ContainerVolumeStatus : V1Status
43+
internal sealed record ContainerVolumeStatus : V1Status
4444
{
4545
/// <summary>
4646
/// The current state of the container volume. See <see cref="ContainerVolumeState"/> for possible values.

src/Aspire.Hosting/Dcp/Model/Endpoint.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ internal sealed class EndpointSpec
2525
public int? Port { get; set; }
2626
}
2727

28-
internal sealed class EndpointStatus : V1Status
28+
internal sealed record EndpointStatus : V1Status
2929
{
3030
// Currently Endpoint has no status properties, but that may change in future.
3131
}

src/Aspire.Hosting/Dcp/Model/Executable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ internal static class ExecutionType
101101
public const string IDE = "IDE";
102102
}
103103

104-
internal sealed class ExecutableStatus : V1Status
104+
internal sealed record ExecutableStatus : V1Status
105105
{
106106
/// <summary>
107107
/// The execution ID is the identifier for the actual-state counterpart of the Executable.

src/Aspire.Hosting/Dcp/Model/ExecutableReplicaSet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ internal sealed class ExecutableReplicaSetSpec
5858
public ExecutableTemplate Template { get; set; } = new ExecutableTemplate();
5959
}
6060

61-
internal sealed class ExecutableReplicaSetStatus : V1Status
61+
internal sealed record ExecutableReplicaSetStatus : V1Status
6262
{
6363
// Total number of observed child executables
6464
[JsonPropertyName("observedReplicas")]

src/Aspire.Hosting/Dcp/Model/Network.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal sealed class ContainerNetworkSpec
2121
public bool? Persistent { get; set; }
2222
}
2323

24-
internal sealed class ContainerNetworkStatus : V1Status
24+
internal sealed record ContainerNetworkStatus : V1Status
2525
{
2626
// The current state of the network
2727
[JsonPropertyName("state")]

src/Aspire.Hosting/Dcp/Model/Service.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ internal sealed class ServiceSpec
2525
public string AddressAllocationMode { get; set; } = AddressAllocationModes.Localhost;
2626
}
2727

28-
internal sealed class ServiceStatus : V1Status
28+
internal sealed record ServiceStatus : V1Status
2929
{
3030
// The actual address the service is running on
3131
[JsonPropertyName("effectiveAddress")]

0 commit comments

Comments
 (0)