Skip to content

Commit

Permalink
Merge pull request #471 from serverlessworkflow/fix-cluster-resource-…
Browse files Browse the repository at this point in the history
…patch

Fixed the ClusterResourceController by removing `namespace` path parameter from patch actions
  • Loading branch information
cdavernas authored Dec 17, 2024
2 parents 05d0a43 + 9c2786f commit d7f3452
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/api/Synapse.Api.Http/ClusterResourceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public virtual async Task<IActionResult> MonitorResourceUsingSSE(string name, Ca
/// <param name="resourceVersion">The expected resource version, if any, used for optimistic concurrency</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/></param>
/// <returns>A new <see cref="IActionResult"/></returns>
[HttpPatch("{namespace}/{name}")]
[HttpPatch("{name}")]
[ProducesResponseType(typeof(Resource), (int)HttpStatusCode.OK)]
[ProducesErrorResponseType(typeof(Neuroglia.ProblemDetails))]
public virtual async Task<IActionResult> PatchResource(string name, [FromBody] Patch patch, string? resourceVersion = null, CancellationToken cancellationToken = default)
Expand All @@ -191,7 +191,7 @@ public virtual async Task<IActionResult> PatchResource(string name, [FromBody] P
/// <param name="resourceVersion">The expected resource version, if any, used for optimistic concurrency</param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/></param>
/// <returns>A new <see cref="IActionResult"/></returns>
[HttpPatch("{namespace}/{name}/status")]
[HttpPatch("{name}/status")]
[ProducesResponseType(typeof(Resource), (int)HttpStatusCode.OK)]
[ProducesErrorResponseType(typeof(Neuroglia.ProblemDetails))]
public virtual async Task<IActionResult> PatchResourceStatus(string name, [FromBody] Patch patch, string? resourceVersion = null, CancellationToken cancellationToken = default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public static class TaskDefinitionVersionMapExtensions
/// </summary>
/// <param name="definitions">An <see cref="IEnumerable{T}"/> containing the <see cref="TaskDefinition"/>s to get the latest of</param>
/// <returns>The latest <see cref="TaskDefinition"/></returns>
public static TaskDefinition GetLatest(this Map<string, TaskDefinition> definitions) => definitions.OrderByDescending(kvp => SemVersion.Parse(kvp.Key, SemVersionStyles.Strict)).First().Value;
public static TaskDefinition GetLatest(this Map<string, TaskDefinition> definitions) => definitions.OrderByDescending(kvp => SemVersion.Parse(kvp.Key, SemVersionStyles.Strict), SemVersion.PrecedenceComparer).First().Value;

/// <summary>
/// Gets the latest version of the <see cref="TaskDefinition"/>
/// </summary>
/// <param name="definitions">An <see cref="IEnumerable{T}"/> containing the <see cref="TaskDefinition"/>s to get the latest of</param>
/// <returns>The latest version</returns>
public static string GetLatestVersion(this Map<string, TaskDefinition> definitions) => definitions.OrderByDescending(kvp => SemVersion.Parse(kvp.Key, SemVersionStyles.Strict)).First().Key;
public static string GetLatestVersion(this Map<string, TaskDefinition> definitions) => definitions.OrderByDescending(kvp => SemVersion.Parse(kvp.Key, SemVersionStyles.Strict), SemVersion.PrecedenceComparer).First().Key;

/// <summary>
/// Gets the specified <see cref="TaskDefinition"/> version
Expand Down

0 comments on commit d7f3452

Please sign in to comment.