mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 06:26:57 +00:00
add image_tag to containers definition
Signed-off-by: Simon L <szaimen@e.mail.de>
This commit is contained in:
parent
2cf6c7401e
commit
c69a5d2065
4 changed files with 26 additions and 2 deletions
|
|
@ -96,6 +96,10 @@
|
||||||
"pattern": "^[A-Z_]+$"
|
"pattern": "^[A-Z_]+$"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"image_tag": {
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^[a-z0-9.-]+$"
|
||||||
|
},
|
||||||
"devices": {
|
"devices": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ class Container {
|
||||||
private bool $readOnlyRootFs;
|
private bool $readOnlyRootFs;
|
||||||
private array $tmpfs;
|
private array $tmpfs;
|
||||||
private bool $init;
|
private bool $init;
|
||||||
|
private string $imageTag;
|
||||||
private DockerActionManager $dockerActionManager;
|
private DockerActionManager $dockerActionManager;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
|
@ -56,6 +57,7 @@ class Container {
|
||||||
bool $readOnlyRootFs,
|
bool $readOnlyRootFs,
|
||||||
array $tmpfs,
|
array $tmpfs,
|
||||||
bool $init,
|
bool $init,
|
||||||
|
string $imageTag,
|
||||||
DockerActionManager $dockerActionManager
|
DockerActionManager $dockerActionManager
|
||||||
) {
|
) {
|
||||||
$this->identifier = $identifier;
|
$this->identifier = $identifier;
|
||||||
|
|
@ -78,6 +80,7 @@ class Container {
|
||||||
$this->readOnlyRootFs = $readOnlyRootFs;
|
$this->readOnlyRootFs = $readOnlyRootFs;
|
||||||
$this->tmpfs = $tmpfs;
|
$this->tmpfs = $tmpfs;
|
||||||
$this->init = $init;
|
$this->init = $init;
|
||||||
|
$this->imageTag = $imageTag;
|
||||||
$this->dockerActionManager = $dockerActionManager;
|
$this->dockerActionManager = $dockerActionManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -97,6 +100,10 @@ class Container {
|
||||||
return $this->restartPolicy;
|
return $this->restartPolicy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function GetImageTag() : string {
|
||||||
|
return $this->imageTag;
|
||||||
|
}
|
||||||
|
|
||||||
public function GetReadOnlySetting() : bool {
|
public function GetReadOnlySetting() : bool {
|
||||||
return $this->readOnlyRootFs;
|
return $this->readOnlyRootFs;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -277,6 +277,11 @@ class ContainerDefinitionFetcher
|
||||||
$init = $entry['init'];
|
$init = $entry['init'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$imageTag = '';
|
||||||
|
if (isset($entry['image_tag'])) {
|
||||||
|
$imageTag = $entry['image_tag'];
|
||||||
|
}
|
||||||
|
|
||||||
$containers[] = new Container(
|
$containers[] = new Container(
|
||||||
$entry['container_name'],
|
$entry['container_name'],
|
||||||
$displayName,
|
$displayName,
|
||||||
|
|
@ -298,6 +303,7 @@ class ContainerDefinitionFetcher
|
||||||
$readOnlyRootFs,
|
$readOnlyRootFs,
|
||||||
$tmpfs,
|
$tmpfs,
|
||||||
$init,
|
$init,
|
||||||
|
$imageTag,
|
||||||
$this->container->get(DockerActionManager::class)
|
$this->container->get(DockerActionManager::class)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,11 @@ class DockerActionManager
|
||||||
}
|
}
|
||||||
|
|
||||||
private function BuildImageName(Container $container) : string {
|
private function BuildImageName(Container $container) : string {
|
||||||
return $container->GetContainerName() . ':' . $this->GetCurrentChannel();
|
$tag = $container->GetImageTag();
|
||||||
|
if ($tag === '') {
|
||||||
|
$tag = $this->GetCurrentChannel();
|
||||||
|
}
|
||||||
|
return $container->GetContainerName() . ':' . $tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetContainerRunningState(Container $container) : IContainerState
|
public function GetContainerRunningState(Container $container) : IContainerState
|
||||||
|
|
@ -95,7 +99,10 @@ class DockerActionManager
|
||||||
|
|
||||||
public function GetContainerUpdateState(Container $container) : IContainerState
|
public function GetContainerUpdateState(Container $container) : IContainerState
|
||||||
{
|
{
|
||||||
$tag = $this->GetCurrentChannel();
|
$tag = $container->GetImageTag();
|
||||||
|
if ($tag === '') {
|
||||||
|
$tag = $this->GetCurrentChannel();
|
||||||
|
}
|
||||||
|
|
||||||
$runningDigests = $this->GetRepoDigestsOfContainer($container->GetIdentifier());
|
$runningDigests = $this->GetRepoDigestsOfContainer($container->GetIdentifier());
|
||||||
if ($runningDigests === null) {
|
if ($runningDigests === null) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue