Skip to content

Commit

Permalink
feat: Update specgen configuration to Docker Engine API 27.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
HofmeisterAn committed Oct 28, 2024
1 parent 81faf5d commit fbe504f
Show file tree
Hide file tree
Showing 92 changed files with 433 additions and 256 deletions.
3 changes: 1 addition & 2 deletions src/Docker.DotNet/DockerPipeStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ public override void CloseWrite()
const int ERROR_IO_PENDING = 997;
if (Marshal.GetLastWin32Error() == ERROR_IO_PENDING)
{
int written;
if (GetOverlappedResult(_stream.SafePipeHandle, ref overlapped, out written, 1) == 0)
if (GetOverlappedResult(_stream.SafePipeHandle, ref overlapped, out var _, 1) == 0)
{
Marshal.ThrowExceptionForHR(Marshal.GetHRForLastWin32Error());
}
Expand Down
2 changes: 1 addition & 1 deletion src/Docker.DotNet/Endpoints/IImageOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public interface IImageOperations
/// <exception cref="ArgumentNullException">One or more of the inputs was <see langword="null"/>.</exception>
/// <exception cref="DockerApiException">The input is invalid or the daemon experienced an error.</exception>
/// <exception cref="HttpRequestException">The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout.</exception>
[ObsoleteAttribute("This method does not wait for build to complete. Use new BuildImageFromDockerfileAsync(contents, parameters, authConfigs, headers, progress, cancellationToken, instead.)", false)]
[Obsolete("This method does not wait for build to complete. Use new BuildImageFromDockerfileAsync(contents, parameters, authConfigs, headers, progress, cancellationToken, instead.)", false)]
Task<Stream> BuildImageFromDockerfileAsync(Stream contents, ImageBuildParameters parameters, CancellationToken cancellationToken = default(CancellationToken));

/// <summary>
Expand Down
1 change: 0 additions & 1 deletion src/Docker.DotNet/Endpoints/IVolumeOperations.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Docker.DotNet.Models;
using System.Threading;
Expand Down
3 changes: 1 addition & 2 deletions src/Docker.DotNet/Endpoints/StreamUtil.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using System.Diagnostics;
using System.IO;
using System.Net.Http;
using System.Text;
Expand Down Expand Up @@ -48,7 +47,7 @@ internal static async Task MonitorResponseForMessagesAsync<T>(Task<HttpResponseM
{
using (var response = await responseTask)
{
await MonitorStreamForMessagesAsync<T>(response.Content.ReadAsStreamAsync(), client, cancel, progress);
await MonitorStreamForMessagesAsync(response.Content.ReadAsStreamAsync(), client, cancel, progress);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/Docker.DotNet/Endpoints/VolumeOperations.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Docker.DotNet.Models;
using System;
using System.IO;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
Expand Down
4 changes: 2 additions & 2 deletions src/Docker.DotNet/Microsoft.Net.Http.Client/HttpConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private string SerializeRequest(HttpRequestMessage request)
builder.Append(request.Version.ToString(2));
builder.Append("\r\n");

builder.Append(request.Headers.ToString());
builder.Append(request.Headers);

if (request.Content != null)
{
Expand All @@ -79,7 +79,7 @@ private string SerializeRequest(HttpRequestMessage request)
request.Content.Headers.ContentLength = contentLength.Value;
}

builder.Append(request.Content.Headers.ToString());
builder.Append(request.Content.Headers);
if (!contentLength.HasValue)
{
// Add header for chunked mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ private async Task TunnelThroughProxyAsync(HttpRequestMessage request, Stream tr
if ((int)connectResponse.StatusCode < 200 || 300 <= (int)connectResponse.StatusCode)
{
transport.Dispose();
throw new HttpRequestException("Failed to negotiate the proxy tunnel: " + connectResponse.ToString());
throw new HttpRequestException("Failed to negotiate the proxy tunnel: " + connectResponse);
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions src/Docker.DotNet/Models/AppArmorOpts.Generated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Runtime.Serialization;

namespace Docker.DotNet.Models
{
[DataContract]
public class AppArmorOpts // (swarm.AppArmorOpts)
{
[DataMember(Name = "Mode", EmitDefaultValue = false)]
public string Mode { get; set; }
}
}
11 changes: 11 additions & 0 deletions src/Docker.DotNet/Models/AttestationProperties.Generated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Runtime.Serialization;

namespace Docker.DotNet.Models
{
[DataContract]
public class AttestationProperties // (image.AttestationProperties)
{
[DataMember(Name = "For", EmitDefaultValue = false)]
public string For { get; set; }
}
}
6 changes: 6 additions & 0 deletions src/Docker.DotNet/Models/BindOptions.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@ public class BindOptions // (mount.BindOptions)

[DataMember(Name = "CreateMountpoint", EmitDefaultValue = false)]
public bool CreateMountpoint { get; set; }

[DataMember(Name = "ReadOnlyNonRecursive", EmitDefaultValue = false)]
public bool ReadOnlyNonRecursive { get; set; }

[DataMember(Name = "ReadOnlyForceRecursive", EmitDefaultValue = false)]
public bool ReadOnlyForceRecursive { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/Docker.DotNet/Models/BlkioStatEntry.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Docker.DotNet.Models
{
[DataContract]
public class BlkioStatEntry // (types.BlkioStatEntry)
public class BlkioStatEntry // (container.BlkioStatEntry)
{
[DataMember(Name = "major", EmitDefaultValue = false)]
public ulong Major { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Docker.DotNet/Models/BlkioStats.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Docker.DotNet.Models
{
[DataContract]
public class BlkioStats // (types.BlkioStats)
public class BlkioStats // (container.BlkioStats)
{
[DataMember(Name = "io_service_bytes_recursive", EmitDefaultValue = false)]
public IList<BlkioStatEntry> IoServiceBytesRecursive { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Docker.DotNet/Models/CPUStats.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Docker.DotNet.Models
{
[DataContract]
public class CPUStats // (types.CPUStats)
public class CPUStats // (container.CPUStats)
{
[DataMember(Name = "cpu_usage", EmitDefaultValue = false)]
public CPUUsage CPUUsage { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Docker.DotNet/Models/CPUUsage.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Docker.DotNet.Models
{
[DataContract]
public class CPUUsage // (types.CPUUsage)
public class CPUUsage // (container.CPUUsage)
{
[DataMember(Name = "total_usage", EmitDefaultValue = false)]
public ulong TotalUsage { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Docker.DotNet/Models/Commit.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Docker.DotNet.Models
{
[DataContract]
public class Commit // (types.Commit)
public class Commit // (system.Commit)
{
[DataMember(Name = "ID", EmitDefaultValue = false)]
public string ID { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public CommitContainerChangesParameters(Config Config)
public IList<string> Cmd { get; set; }

[DataMember(Name = "Healthcheck", EmitDefaultValue = false)]
public HealthConfig Healthcheck { get; set; }
public HealthcheckConfig Healthcheck { get; set; }

[DataMember(Name = "ArgsEscaped", EmitDefaultValue = false)]
public bool ArgsEscaped { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion src/Docker.DotNet/Models/Config.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class Config // (container.Config)
public IList<string> Cmd { get; set; }

[DataMember(Name = "Healthcheck", EmitDefaultValue = false)]
public HealthConfig Healthcheck { get; set; }
public HealthcheckConfig Healthcheck { get; set; }

[DataMember(Name = "ArgsEscaped", EmitDefaultValue = false)]
public bool ArgsEscaped { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Docker.DotNet.Models
{
[DataContract]
public class ContainerExecInspectResponse // (types.ContainerExecInspect)
public class ContainerExecInspectResponse // (container.ExecInspect)
{
[DataMember(Name = "ID", EmitDefaultValue = false)]
public string ExecID { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ public class ContainerPathStatParameters // (main.ContainerPathStatParameters)
{
[QueryStringParameter("path", true)]
public string Path { get; set; }

[QueryStringParameter("noOverwriteDirNonDir", false, typeof(BoolQueryStringConverter))]
public bool? AllowOverwriteDirWithFile { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Docker.DotNet.Models
{
[DataContract]
public class ContainerPathStatResponse // (types.ContainerPathStat)
public class ContainerPathStatResponse // (container.PathStat)
{
[DataMember(Name = "name", EmitDefaultValue = false)]
public string Name { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ public class ContainerRestartParameters // (main.ContainerRestartParameters)
{
[QueryStringParameter("t", false)]
public uint? WaitBeforeKillSeconds { get; set; }

[QueryStringParameter("signal", false)]
public string Signal { get; set; }
}
}
5 changes: 4 additions & 1 deletion src/Docker.DotNet/Models/ContainerSpec.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class ContainerSpec // (swarm.ContainerSpec)
public long? StopGracePeriod { get; set; }

[DataMember(Name = "Healthcheck", EmitDefaultValue = false)]
public HealthConfig Healthcheck { get; set; }
public HealthcheckConfig Healthcheck { get; set; }

[DataMember(Name = "Hosts", EmitDefaultValue = false)]
public IList<string> Hosts { get; set; }
Expand Down Expand Up @@ -86,5 +86,8 @@ public class ContainerSpec // (swarm.ContainerSpec)

[DataMember(Name = "Ulimits", EmitDefaultValue = false)]
public IList<Ulimit> Ulimits { get; set; }

[DataMember(Name = "OomScoreAdj", EmitDefaultValue = false)]
public long OomScoreAdj { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Docker.DotNet.Models
{
[DataContract]
public class ContainerStatsResponse // (types.StatsJSON)
public class ContainerStatsResponse // (container.StatsResponse)
{
public ContainerStatsResponse()
{
Expand Down
3 changes: 3 additions & 0 deletions src/Docker.DotNet/Models/ContainerStopParameters.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ public class ContainerStopParameters // (main.ContainerStopParameters)
{
[QueryStringParameter("t", false)]
public uint? WaitBeforeKillSeconds { get; set; }

[QueryStringParameter("signal", false)]
public string Signal { get; set; }
}
}
14 changes: 14 additions & 0 deletions src/Docker.DotNet/Models/ContainerdInfo.Generated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Runtime.Serialization;

namespace Docker.DotNet.Models
{
[DataContract]
public class ContainerdInfo // (system.ContainerdInfo)
{
[DataMember(Name = "Address", EmitDefaultValue = false)]
public string Address { get; set; }

[DataMember(Name = "Namespaces", EmitDefaultValue = false)]
public ContainerdNamespaces Namespaces { get; set; }
}
}
14 changes: 14 additions & 0 deletions src/Docker.DotNet/Models/ContainerdNamespaces.Generated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Runtime.Serialization;

namespace Docker.DotNet.Models
{
[DataContract]
public class ContainerdNamespaces // (system.ContainerdNamespaces)
{
[DataMember(Name = "Containers", EmitDefaultValue = false)]
public string Containers { get; set; }

[DataMember(Name = "Plugins", EmitDefaultValue = false)]
public string Plugins { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
namespace Docker.DotNet.Models
{
[DataContract]
public class ContainersPruneResponse // (types.ContainersPruneReport)
public class ContainersPruneResponse // (container.PruneReport)
{
[DataMember(Name = "ContainersDeleted", EmitDefaultValue = false)]
public IList<string> ContainersDeleted { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public CreateContainerParameters(Config Config)
public IList<string> Cmd { get; set; }

[DataMember(Name = "Healthcheck", EmitDefaultValue = false)]
public HealthConfig Healthcheck { get; set; }
public HealthcheckConfig Healthcheck { get; set; }

[DataMember(Name = "ArgsEscaped", EmitDefaultValue = false)]
public bool ArgsEscaped { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@
namespace Docker.DotNet.Models
{
[DataContract]
public class NetworkCreate // (types.NetworkCreate)
public class CreateOptions // (network.CreateOptions)
{
[DataMember(Name = "CheckDuplicate", EmitDefaultValue = false)]
public bool CheckDuplicate { get; set; }

[DataMember(Name = "Driver", EmitDefaultValue = false)]
public string Driver { get; set; }

[DataMember(Name = "Scope", EmitDefaultValue = false)]
public string Scope { get; set; }

[DataMember(Name = "EnableIPv6", EmitDefaultValue = false)]
public bool EnableIPv6 { get; set; }
public bool? EnableIPv6 { get; set; }

[DataMember(Name = "IPAM", EmitDefaultValue = false)]
public IPAM IPAM { get; set; }
Expand Down
27 changes: 27 additions & 0 deletions src/Docker.DotNet/Models/Descriptor.Generated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Collections.Generic;
using System.Runtime.Serialization;

namespace Docker.DotNet.Models
{
[DataContract]
public class Descriptor // (v1.Descriptor)
{
[DataMember(Name = "mediaType", EmitDefaultValue = false)]
public string MediaType { get; set; }

[DataMember(Name = "digest", EmitDefaultValue = false)]
public string Digest { get; set; }

[DataMember(Name = "size", EmitDefaultValue = false)]
public long Size { get; set; }

[DataMember(Name = "urls", EmitDefaultValue = false)]
public IList<string> URLs { get; set; }

[DataMember(Name = "annotations", EmitDefaultValue = false)]
public IDictionary<string, string> Annotations { get; set; }

[DataMember(Name = "platform", EmitDefaultValue = false)]
public Platform Platform { get; set; }
}
}
5 changes: 2 additions & 3 deletions src/Docker.DotNet/Models/EmptyStruct.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

namespace Docker.DotNet.Models
{
/// <summary>
/// In go something like map[string]struct{} has no correct match so we create
/// the empty type here that can be used for something like IDictionary<string, EmptyStruct>;
/// In go something like map[string]struct{} has no correct match so we create the
/// empty type here that can be used for something like IDictionary&lt;string, EmptyStruct&gt;.
/// </summary>
public struct EmptyStruct
{
Expand Down
2 changes: 1 addition & 1 deletion src/Docker.DotNet/Models/EndpointResource.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Docker.DotNet.Models
{
[DataContract]
public class EndpointResource // (types.EndpointResource)
public class EndpointResource // (network.EndpointResource)
{
[DataMember(Name = "Name", EmitDefaultValue = false)]
public string Name { get; set; }
Expand Down
13 changes: 8 additions & 5 deletions src/Docker.DotNet/Models/EndpointSettings.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ public class EndpointSettings // (network.EndpointSettings)
[DataMember(Name = "Aliases", EmitDefaultValue = false)]
public IList<string> Aliases { get; set; }

[DataMember(Name = "MacAddress", EmitDefaultValue = false)]
public string MacAddress { get; set; }

[DataMember(Name = "DriverOpts", EmitDefaultValue = false)]
public IDictionary<string, string> DriverOpts { get; set; }

[DataMember(Name = "NetworkID", EmitDefaultValue = false)]
public string NetworkID { get; set; }

Expand All @@ -39,10 +45,7 @@ public class EndpointSettings // (network.EndpointSettings)
[DataMember(Name = "GlobalIPv6PrefixLen", EmitDefaultValue = false)]
public long GlobalIPv6PrefixLen { get; set; }

[DataMember(Name = "MacAddress", EmitDefaultValue = false)]
public string MacAddress { get; set; }

[DataMember(Name = "DriverOpts", EmitDefaultValue = false)]
public IDictionary<string, string> DriverOpts { get; set; }
[DataMember(Name = "DNSNames", EmitDefaultValue = false)]
public IList<string> DNSNames { get; set; }
}
}
Loading

0 comments on commit fbe504f

Please sign in to comment.