Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
NetworkMode: ShareNetworkMode now prevents links from being created i…
Browse files Browse the repository at this point in the history
…n the docker-compose.yml
  • Loading branch information
svensp committed Jan 14, 2020
1 parent 16eb3af commit 1c6a803
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions app/Blueprint/Infrastructure/Service/NetworkMode/ForbidsLinks.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php namespace Rancherize\Blueprint\Infrastructure\Service\NetworkMode;

/**
* Interface ForbidsLInks
* @package Rancherize\Blueprint\Infrastructure\Service\NetworkMode
*/
interface ForbidsLinks
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Class ShareNetworkMode
* @package Rancherize\Blueprint\Infrastructure\Service\NetworkMode
*/
class ShareNetworkMode implements NetworkMode {
class ShareNetworkMode implements NetworkMode, ForbidsLinks {
/**
* @var Service
*/
Expand Down
5 changes: 5 additions & 0 deletions app/Blueprint/Infrastructure/Service/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use Closure;
use Rancherize\Blueprint\Infrastructure\Dockerfile\Dockerfile;
use Rancherize\Blueprint\Infrastructure\Service\NetworkMode\DefaultNetworkMode;
use Rancherize\Blueprint\Infrastructure\Service\NetworkMode\ForbidsLinks;
use Rancherize\Blueprint\Infrastructure\Service\NetworkMode\NetworkMode;

/**
Expand Down Expand Up @@ -375,6 +376,10 @@ public function getLinks(): array {
return [];
}

if($this->networkMode instanceof ForbidsLinks) {
return [];
}

return $this->links;
}

Expand Down

0 comments on commit 1c6a803

Please sign in to comment.