Skip to content

Commit

Permalink
Merge pull request #178 from zoispag/bug/177-fix-redis-version-retrie…
Browse files Browse the repository at this point in the history
…ving

Fix tag retrieval for Redis
  • Loading branch information
mattstauffer committed Nov 11, 2020
2 parents 7a833fc + ce36510 commit 10795d6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/Services/BaseService.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ protected function buildParameters(): array

protected function shortNameWithVersion(): string
{
// Check if tag represents semantic version (v5.6.0, 5.7.4, or 8.0) and return major.minor
// (eg mysql5.7) or return the actual tag prefixed by a dash (eg redis-buster)
if (! preg_match('/v?(0|(?:[1-9]\d*))(?:\.(0|(?:[1-9]\d*))(?:\.(0|(?:[1-9]\d*)))?)/', $this->tag)) {
return $this->shortName() . "-{$this->tag}";
}

$version = trim($this->tag, 'v');
[$major, $minor] = explode('.', $version);

Expand Down

0 comments on commit 10795d6

Please sign in to comment.