You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug VersionOperationsExtensions.GetCodeAsync throws an exception in AOT scenarios.
Kubernetes C# SDK Client Version 16.0.2
Server Kubernetes Version 1.26.1
Dotnet Runtime Version
net9
To Reproduce
Install KubernetesClient.Aot, and then try to query the version information from Kubernetes:
varconfig=KubernetesClientConfiguration.BuildConfigFromConfigFile(configFile);varkubernetes=newKubernetes(config);for(vari=0;i<maximumWaitSeconds&&!cancellationToken.IsCancellationRequested;i++){try{varcode=awaitkubernetes.Version.GetCodeAsync(cancellationToken);_logger.LogInformation($"Connected to API server, Kubernetes is running version: {code.Major}.{code.Minor}");returnkubernetes;}catch(HttpRequestExceptionex){_logger.LogWarning($"Failed to connect to Kubernetes API server; it might still be starting up: {ex}");if(i<maximumWaitSeconds-1){awaitTask.Delay(1000,cancellationToken);}}cancellationToken.ThrowIfCancellationRequested();}cancellationToken.ThrowIfCancellationRequested();
This results in the following exception:
System.ArgumentNullException: Value cannot be null. (Parameter 'jsonTypeInfo')
at System.Text.Json.ThrowHelper.ThrowArgumentNullException(String)
at System.Text.Json.JsonSerializer.Deserialize(Stream, JsonTypeInfo)
at k8s.KubernetesJson.Deserialize[TValue](Stream, JsonSerializerOptions )
at k8s.Kubernetes.CreateResultAsync[T](HttpRequestMessage, HttpResponseMessage, Nullable`1, CancellationToken)
at k8s.AbstractKubernetes.IVersionOperations_GetCodeWithHttpMessagesAsync[T](IReadOnlyDictionary`2, CancellationToken)
at k8s.AbstractKubernetes.k8s.IVersionOperations.GetCodeWithHttpMessagesAsync(IReadOnlyDictionary`2, CancellationToken)
at k8s.VersionOperationsExtensions.GetCodeAsync(IVersionOperations, CancellationToken )
at Redpoint.KubernetesManager.Services.DefaultKubernetesClientFactory.ConnectToClusterAsync(String, Int32, CancellationToken)
at Redpoint.KubernetesManager.Components.ControllerOnly.KubernetesClientComponent.OnStartedAsync(IContext context, IAssociatedData data, CancellationToken cancellationToken)
at Redpoint.KubernetesManager.Signalling.Executor.<>c__DisplayClass12_1.<<RaiseSignalAsync>b__1>d.MoveNext()
Expected behavior
AOT should work.
The text was updated successfully, but these errors were encountered:
Describe the bug
VersionOperationsExtensions.GetCodeAsync
throws an exception in AOT scenarios.Kubernetes C# SDK Client Version
16.0.2
Server Kubernetes Version
1.26.1
Dotnet Runtime Version
net9
To Reproduce
Install
KubernetesClient.Aot
, and then try to query the version information from Kubernetes:This results in the following exception:
Expected behavior
AOT should work.
The text was updated successfully, but these errors were encountered: