orleans icon indicating copy to clipboard operation
orleans copied to clipboard

NuGet package conflict for Microsoft.Orleans.Hosting.Kubernetes 3.4.x

Open rbitanga-manticore opened this issue 5 years ago • 2 comments

Microsoft.Orleans.Hosting.Kubernetes 3.4.2 does not work with KubernetesClient packages 3.0 or newer due to mismatched method signatures.

System.MissingMethodException: Method not found: 'System.Threading.Tasks.Task`1<k8s.Models.V1PodList> k8s.KubernetesExtensions.ListNamespacedPodAsync(k8s.IKubernetes, System.String, System.Nullable`1<Boolean>, System.String, System.String, System.String, System.Nullable`1<Int32>, System.String, System.Nullable`1<Int32>, System.Nullable`1<Boolean>, System.String, System.Threading.CancellationToken)'.
   at Orleans.Hosting.Kubernetes.KubernetesClusterAgent.OnRuntimeInitializeStart(CancellationToken cancellation)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine)
   at Orleans.Hosting.Kubernetes.KubernetesClusterAgent.OnRuntimeInitializeStart(CancellationToken cancellation)
   at Orleans.LifecycleExtensions.Observer.OnStart(CancellationToken ct)
   at Orleans.Runtime.SiloLifecycleSubject.MonitoredObserver.OnStart(CancellationToken ct)
   at Orleans.LifecycleSubject.OnStart(CancellationToken ct)
   at Orleans.Runtime.Scheduler.AsyncClosureWorkItem.Execute()
   at Orleans.Runtime.Silo.StartAsync(CancellationToken cancellationToken)
   at Orleans.Hosting.SiloHost.StartAsync(CancellationToken cancellationToken)
   at Orleans.Hosting.SiloHostedService.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
            var pods = await _client.ListNamespacedPodAsync(
                namespaceParameter: _podNamespace,
                labelSelector: _podLabelSelector,
                cancellationToken: cancellation);

should work with newer KubernetesClient packages when compiled locally but importing the NuGet package does not work. It looks like a string resourceVersionMatch argument was introduced in between string resourceVersion and int? timeoutSeconds in https://github.com/kubernetes-client/csharp/pull/505.

This shouldn't be an issue with 3.5.0 since that pulls in KubernetesClient 4.0.5 which is based off of Kubernetes 1.19. k8s 1.19 itself is supposed to reach the end of its support window after Aug. 2021 so there's potential for future package conflicts if there are incompatible changes again.

Is there any guidance for how to deal with future package conflicts? Will there be package updates for older Orleans releases as previous Kubernetes versions are no longer supported?

rbitanga-manticore avatar Jun 25 '21 06:06 rbitanga-manticore

Thanks for letting us know, @rbitanga-manticore. We usually don't backport fixes within a single major version, since they are all compatible. Would there be something preventing you from upgrading to Orleans 3.5.0?

I'm not sure what strategies we can take to deal with upstream API breaks, since they are out of our control. As a consumer, the only thing I can suggest is to avoid upgrading to those versions, but it's often not obvious which version will break the API.

As a side note, this is one reason why it's often better to have method overloads or methods which accept parameter objects, rather than methods which use many optional parameters: the former two wont break compatibility.

ReubenBond avatar Jul 06 '21 13:07 ReubenBond

Closing due to inactivity - feel free to open a new issue referencing this if you run into this issue.

ReubenBond avatar Aug 04 '21 15:08 ReubenBond