diff --git a/src/api/Synapse.Api.Http/ClusterResourceController.cs b/src/api/Synapse.Api.Http/ClusterResourceController.cs index 4f0b26b6..39cdd0eb 100644 --- a/src/api/Synapse.Api.Http/ClusterResourceController.cs +++ b/src/api/Synapse.Api.Http/ClusterResourceController.cs @@ -174,7 +174,7 @@ public virtual async Task MonitorResourceUsingSSE(string name, Ca /// The expected resource version, if any, used for optimistic concurrency /// A /// A new - [HttpPatch("{namespace}/{name}")] + [HttpPatch("{name}")] [ProducesResponseType(typeof(Resource), (int)HttpStatusCode.OK)] [ProducesErrorResponseType(typeof(Neuroglia.ProblemDetails))] public virtual async Task PatchResource(string name, [FromBody] Patch patch, string? resourceVersion = null, CancellationToken cancellationToken = default) @@ -191,7 +191,7 @@ public virtual async Task PatchResource(string name, [FromBody] P /// The expected resource version, if any, used for optimistic concurrency /// A /// A new - [HttpPatch("{namespace}/{name}/status")] + [HttpPatch("{name}/status")] [ProducesResponseType(typeof(Resource), (int)HttpStatusCode.OK)] [ProducesErrorResponseType(typeof(Neuroglia.ProblemDetails))] public virtual async Task PatchResourceStatus(string name, [FromBody] Patch patch, string? resourceVersion = null, CancellationToken cancellationToken = default) diff --git a/src/core/Synapse.Core/Extensions/TaskDefinitionVersionMapExtensions.cs b/src/core/Synapse.Core/Extensions/TaskDefinitionVersionMapExtensions.cs index 4abd4bac..b8ba5ca3 100644 --- a/src/core/Synapse.Core/Extensions/TaskDefinitionVersionMapExtensions.cs +++ b/src/core/Synapse.Core/Extensions/TaskDefinitionVersionMapExtensions.cs @@ -26,14 +26,14 @@ public static class TaskDefinitionVersionMapExtensions /// /// An containing the s to get the latest of /// The latest - public static TaskDefinition GetLatest(this Map definitions) => definitions.OrderByDescending(kvp => SemVersion.Parse(kvp.Key, SemVersionStyles.Strict)).First().Value; + public static TaskDefinition GetLatest(this Map definitions) => definitions.OrderByDescending(kvp => SemVersion.Parse(kvp.Key, SemVersionStyles.Strict), SemVersion.PrecedenceComparer).First().Value; /// /// Gets the latest version of the /// /// An containing the s to get the latest of /// The latest version - public static string GetLatestVersion(this Map definitions) => definitions.OrderByDescending(kvp => SemVersion.Parse(kvp.Key, SemVersionStyles.Strict)).First().Key; + public static string GetLatestVersion(this Map definitions) => definitions.OrderByDescending(kvp => SemVersion.Parse(kvp.Key, SemVersionStyles.Strict), SemVersion.PrecedenceComparer).First().Key; /// /// Gets the specified version