Skip to content

Commit

Permalink
Merge pull request #298 from tighten/fix/tm-mssql-arm
Browse files Browse the repository at this point in the history
Changed the MSSQL image for one that works on M1
  • Loading branch information
mattstauffer authored May 30, 2023
2 parents e2dd015 + 43eb799 commit 2e304df
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 29 deletions.
2 changes: 1 addition & 1 deletion app/Services/MsSql.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class MsSql extends BaseService
protected static $category = Category::DATABASE;

protected $organization = 'mcr.microsoft.com';
protected $imageName = 'mssql/server';
protected $imageName = 'azure-sql-edge';
protected $dockerTagsClass = MicrosoftDockerTags::class;
protected $defaultPort = 1433;
protected $prompts = [
Expand Down
5 changes: 1 addition & 4 deletions app/Shell/MicrosoftDockerTags.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Shell;

use Illuminate\Support\Collection;
use Illuminate\Support\Str;

class MicrosoftDockerTags extends DockerTags
{
Expand All @@ -16,9 +15,7 @@ public function getTags(): Collection
{
return collect(json_decode($this->getTagsResponse(), true)['tags'])
->reverse()
->filter(function ($tag) {
return Str::contains($tag, '-GA-');
});
->values();
}

protected function tagsUrlTemplate(): string
Expand Down
25 changes: 1 addition & 24 deletions tests/Feature/MicrosoftDockerTagsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,6 @@

class MicrosoftDockerTagsTest extends TestCase
{
/** @test */
function it_gets_a_general_availability_release()
{
$dockerTags = app(MicrosoftDockerTags::class, ['service' => app(MsSql::class)]);
$this->assertStringContainsString('-GA-', $dockerTags->getLatestTag());
}

/** @test */
function it_ignores_tags_without_ga_string()
{
$mssql = app(MsSql::class);
$dockerTags = M::mock(MicrosoftDockerTags::class, [app(Client::class), $mssql])
->makePartial()
->shouldAllowMockingProtectedMethods();

$dockerTags->shouldReceive('getTagsResponse')->andReturn(new MicrosoftDockerTagsFakestream('abc'));

$tags = $dockerTags->getTags();

$this->assertEquals(2, $tags->count());
$this->assertStringContainsString('-GA-', $tags->first());
}

/** @test */
function it_reverses_tag_list()
{
Expand All @@ -44,6 +21,6 @@ function it_reverses_tag_list()

$dockerTags->shouldReceive('getTagsResponse')->andReturn(new MicrosoftDockerTagsFakestream('abc'));

$this->assertEquals('2024-GA-ubuntu-18.04', $dockerTags->getLatestTag());
$this->assertEquals('latest', $dockerTags->getLatestTag());
}
}

0 comments on commit 2e304df

Please sign in to comment.