This repository has been archived by the owner on Nov 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add keepalive service for php commands
- Loading branch information
svensp
committed
Aug 20, 2019
1 parent
6bef99d
commit f453265
Showing
6 changed files
with
103 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php namespace Rancherize\Blueprint\Keepalive; | ||
|
||
use Rancherize\Blueprint\Infrastructure\Service\NetworkMode\ShareNetworkMode; | ||
use Rancherize\Blueprint\Infrastructure\Service\Service; | ||
|
||
/** | ||
* Class KeepaliveService | ||
* @package Rancherize\Blueprint\Keepalive | ||
*/ | ||
class KeepaliveService extends Service | ||
{ | ||
|
||
/** | ||
* @var Service | ||
*/ | ||
protected $targetService; | ||
|
||
/** | ||
* @param Service $targetService | ||
* @return KeepaliveService | ||
*/ | ||
public function setTargetService(Service $targetService): KeepaliveService | ||
{ | ||
$this->targetService = $targetService; | ||
return $this; | ||
} | ||
|
||
public function takeOver() | ||
{ | ||
$this->image = 'busybox'; | ||
$this->command = '/bin/sh'; | ||
$this->tty = true; | ||
$this->keepStdin = true; | ||
|
||
$this->copySidekicks($this->targetService); | ||
$this->targetService->resetSidekicks(); | ||
$this->copyLabels($this->targetService); | ||
$this->targetService->setNetworkMode( new ShareNetworkMode($this) ); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters