Skip to content

Commit

Permalink
chore: Update Docker Engine API to 27.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
HofmeisterAn committed Oct 29, 2024
1 parent fbe504f commit 048b570
Show file tree
Hide file tree
Showing 31 changed files with 313 additions and 331 deletions.
2 changes: 1 addition & 1 deletion src/Docker.DotNet.X509/CertificateCredentials.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override HttpMessageHandler GetHandler(HttpMessageHandler innerHandler)
_certificate
};

handler.ServerCertificateValidationCallback = this.ServerCertificateValidationCallback;
handler.ServerCertificateValidationCallback = ServerCertificateValidationCallback;

if (handler.ServerCertificateValidationCallback == null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Docker.DotNet.X509/RSAUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static X509Certificate2 GetCertFromPFXSecure(string pfxFilePath, SecureSt
public static X509Certificate2 GetCertFromPEMFiles(string certFilePath, string keyFilePath)
{
var cert = new X509Certificate2(certFilePath);
cert.PrivateKey = RSAUtil.ReadFromPemFile(keyFilePath);
cert.PrivateKey = ReadFromPemFile(keyFilePath);

Check warning on line 27 in src/Docker.DotNet.X509/RSAUtil.cs

View workflow job for this annotation

GitHub Actions / build

'X509Certificate2.PrivateKey' is obsolete: 'X509Certificate2.PrivateKey is obsolete. Use the appropriate method to get the private key, such as GetRSAPrivateKey, or use the CopyWithPrivateKey method to create a new instance with a private key.' (https://aka.ms/dotnet-warnings/SYSLIB0028)
return cert;
}

Expand Down
8 changes: 4 additions & 4 deletions src/Docker.DotNet/BinaryRequestContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ public BinaryRequestContent(Stream stream, string mimeType)
throw new ArgumentNullException(nameof(mimeType));
}

this._stream = stream;
this._mimeType = mimeType;
_stream = stream;
_mimeType = mimeType;
}

public HttpContent GetContent()
{
var data = new StreamContent(this._stream);
data.Headers.ContentType = new MediaTypeHeaderValue(this._mimeType);
var data = new StreamContent(_stream);
data.Headers.ContentType = new MediaTypeHeaderValue(_mimeType);
return data;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Docker.DotNet/DockerApiException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public class DockerApiException : Exception
public DockerApiException(HttpStatusCode statusCode, string responseBody)
: base($"Docker API responded with status code={statusCode}, response={responseBody}")
{
this.StatusCode = statusCode;
this.ResponseBody = responseBody;
StatusCode = statusCode;
ResponseBody = responseBody;
}
}
}
4 changes: 2 additions & 2 deletions src/Docker.DotNet/DockerApiResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ internal class DockerApiResponse

public DockerApiResponse(HttpStatusCode statusCode, string body)
{
this.StatusCode = statusCode;
this.Body = body;
StatusCode = statusCode;
Body = body;
}
}
}
18 changes: 9 additions & 9 deletions src/Docker.DotNet/Endpoints/ConfigsOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ internal class ConfigOperations : IConfigOperations

internal ConfigOperations(DockerClient client)
{
this._client = client;
_client = client;
}

async Task<IList<SwarmConfig>> IConfigOperations.ListConfigsAsync(CancellationToken cancellationToken)
{
var response = await this._client.MakeRequestAsync(this._client.NoErrorHandlers, HttpMethod.Get, "configs", cancellationToken).ConfigureAwait(false);
return this._client.JsonSerializer.DeserializeObject<IList<SwarmConfig>>(response.Body);
var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, "configs", cancellationToken).ConfigureAwait(false);
return _client.JsonSerializer.DeserializeObject<IList<SwarmConfig>>(response.Body);
}

async Task<SwarmCreateConfigResponse> IConfigOperations.CreateConfigAsync(SwarmCreateConfigParameters body, CancellationToken cancellationToken)
Expand All @@ -29,9 +29,9 @@ async Task<SwarmCreateConfigResponse> IConfigOperations.CreateConfigAsync(SwarmC
throw new ArgumentNullException(nameof(body));
}

var data = new JsonRequestContent<SwarmConfigSpec>(body.Config, this._client.JsonSerializer);
var response = await this._client.MakeRequestAsync(this._client.NoErrorHandlers, HttpMethod.Post, "configs/create", null, data, cancellationToken).ConfigureAwait(false);
return this._client.JsonSerializer.DeserializeObject<SwarmCreateConfigResponse>(response.Body);
var data = new JsonRequestContent<SwarmConfigSpec>(body.Config, _client.JsonSerializer);
var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Post, "configs/create", null, data, cancellationToken).ConfigureAwait(false);
return _client.JsonSerializer.DeserializeObject<SwarmCreateConfigResponse>(response.Body);
}

async Task<SwarmConfig> IConfigOperations.InspectConfigAsync(string id, CancellationToken cancellationToken)
Expand All @@ -41,8 +41,8 @@ async Task<SwarmConfig> IConfigOperations.InspectConfigAsync(string id, Cancella
throw new ArgumentNullException(nameof(id));
}

var response = await this._client.MakeRequestAsync(this._client.NoErrorHandlers, HttpMethod.Get, $"configs/{id}", cancellationToken).ConfigureAwait(false);
return this._client.JsonSerializer.DeserializeObject<SwarmConfig>(response.Body);
var response = await _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Get, $"configs/{id}", cancellationToken).ConfigureAwait(false);
return _client.JsonSerializer.DeserializeObject<SwarmConfig>(response.Body);
}

Task IConfigOperations.RemoveConfigAsync(string id, CancellationToken cancellationToken)
Expand All @@ -52,7 +52,7 @@ Task IConfigOperations.RemoveConfigAsync(string id, CancellationToken cancellati
throw new ArgumentNullException(nameof(id));
}

return this._client.MakeRequestAsync(this._client.NoErrorHandlers, HttpMethod.Delete, $"configs/{id}", cancellationToken);
return _client.MakeRequestAsync(_client.NoErrorHandlers, HttpMethod.Delete, $"configs/{id}", cancellationToken);
}
}
}
Loading

0 comments on commit 048b570

Please sign in to comment.