Skip to content

Commit

Permalink
Fix an error in cartridge.utils.version_is_at_least
Browse files Browse the repository at this point in the history
  • Loading branch information
yngvar-antonsson committed Dec 5, 2023
1 parent 5c83822 commit a189e06
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ Added
- ``cartridge.cfg`` option ``disable_raft_on_small_clusters`` to disable Raft
failover on clusters with less than 3 instances (default: ``true``).

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fixed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- An error with ``cartridge.utils.version_is_at_least`` parsing.

-------------------------------------------------------------------------------
[2.8.4] - 2023-10-31
-------------------------------------------------------------------------------
Expand Down
32 changes: 31 additions & 1 deletion cartridge/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,38 @@ end

local is_enterprise = (tarantool.package == 'Tarantool Enterprise')
local tnt_version = semver.parse(_TARANTOOL)

--- Check if Tarantool version is at least the given one.
-- Tarantool's version has format:
--
-- x.x.x-typen-commit-ghash
--
-- * x.x.x - major, middle, minor release numbers;
-- * typen - release type and its optional number: alpha1, beta5, rc10.
-- Optional;
-- * commit - commit count since the latest release. Optional;
-- * ghash - latest commit hash in format g<hash>. Optional.
--
-- @function
-- @local
--
-- @int id_major
-- @int id_middle
-- @int id_minor
-- @string[opt] rel_type
-- @int[opt=0] rel_num
-- @int[opt=0] id_commit
--
-- @treturn boolean
local function version_is_at_least(...)
return tnt_version >= semver.new(...)
local id_major, id_middle, id_minor, rel_type, rel_num, id_commit = ...
if rel_num == nil then
rel_num = 0
end
if id_commit == nil then
id_commit = 0
end
return tnt_version >= semver.new(id_major, id_middle, id_minor, rel_type, rel_num, id_commit)
end
local feature = {
ssl = (function()
Expand Down

0 comments on commit a189e06

Please sign in to comment.