What is the correct usage of client.Swarm.ListServicesAsync's parameters
What is the correct usage of client.Swarm.ListServicesAsync's parameters? The following code doesn't work. It's the same as this test code.
Output of dotnet --info:
.NET Core SDK (reflecting any global.json):
Version: 3.1.302
Commit: 41faccf259
Runtime Environment:
OS Name: ubuntu
OS Version: 18.04
OS Platform: Linux
RID: ubuntu.18.04-x64
Base Path: /usr/share/dotnet/sdk/3.1.302/
Host (useful for support):
Version: 3.1.6
Commit: 3acd9b0cd1
.NET Core SDKs installed:
3.1.302 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
What version of Docker.DotNet?:
3.125.4
Steps to reproduce the issue:
var client = new DockerClientConfiguration(new Uri("unix:///var/run/docker.sock")).CreateClient();
var parameters = new ServicesListParameters
{
Filters = new ServiceFilter
{
Id = "7lvmyvtec0hk2133xumjuyjxq"
}
};
//Throws exception
var r = await client.Swarm.ListServicesAsync(parameters);
What actually happened?: Throws this exception:
Docker API responded with status code=BadRequest, response={\"message\":\"json: cannot unmarshal string into Go value of type map[string]bool\"}
What did you expect to happen?: List of services, according to filters.
Any ideas? I have the same issue
https://github.com/docker/swarmkit/blob/ef128ab4f5d50ffe4851d937b2b296e55562d10f/api/control.proto#L393 looks like this is now supposed to be an array but we are treating it as a single string value in the dictionary https://github.com/dotnet/Docker.DotNet/blob/b13f78e6d037e474d63e89e1fc25ddf1220c85a8/src/Docker.DotNet/Models/ServiceFilter.cs#L7
Want to take a shot at submitting a fix here? We could just add an overload of properties that deal with List get/set and the current ones can just create an List with one entry and assign it. So no breaking changes
Any plans on fixing this issue?
I can use Linq when I get services, but direct filtering on Docker side would be better..
filtering on the Docker side would be great. any progress on this subject?
Want to take a shot at submitting a fix here? We could just add an overload of properties that deal with List get/set and the current ones can just create an List with one entry and assign it. So no breaking changes
@jterry75 , any movements here?
any updates?