Official containers were showing in previous apps when installed, and never within installed apps

This commit is contained in:
Squidly271 2021-06-22 15:47:44 -04:00
parent 40b4017cec
commit 46a010721d
3 changed files with 7 additions and 4 deletions

Binary file not shown.

View File

@ -11,7 +11,7 @@ a9d4cd0e4e1f37cbe3806b952a96ddb1 ./ca_settings.page
6e48a62b91bdd066f023f46c6b491afd ./images/discord-gray.svg 6e48a62b91bdd066f023f46c6b491afd ./images/discord-gray.svg
8e7dc33512b8a78f28d7179a972c7c34 ./images/discord-hover.svg 8e7dc33512b8a78f28d7179a972c7c34 ./images/discord-hover.svg
54e46db492ddb033dfeb2827c5efd4a8 ./images/discord-white.svg 54e46db492ddb033dfeb2827c5efd4a8 ./images/discord-white.svg
13dfe950ed61efb6a567bfecb5506cbb ./include/exec.php f93e11b85fec2e64104996cc71bfce1b ./include/exec.php
d7f50413cbaac1c6cb9ceaaef48f270a ./include/helpers.php d7f50413cbaac1c6cb9ceaaef48f270a ./include/helpers.php
8f1129e0cdb994c6d1900192252433d8 ./include/paths.php 8f1129e0cdb994c6d1900192252433d8 ./include/paths.php
eb76c1b6ed3da5e5b393f22d2ec18430 ./javascript/libraries.js eb76c1b6ed3da5e5b393f22d2ec18430 ./javascript/libraries.js

View File

@ -1016,12 +1016,12 @@ if ( $caSettings['dockerRunning'] ) {
if ( !$filter || $filter == "docker" ) { if ( !$filter || $filter == "docker" ) {
foreach ($info as $installedDocker) { foreach ($info as $installedDocker) {
$installedName = $installedDocker['Name']; $installedName = $installedDocker['Name'];
$installedImage = $installedDocker['Image'];
if ( startsWith($installedImage,"library/") ) # official images are in DockerClient as library/mysql eg but template just shows mysql if ( startsWith($installedImage,"library/") ) # official images are in DockerClient as library/mysql eg but template just shows mysql
$installedImage = str_replace("library/","",$installedImage); $installedImage = str_replace("library/","",$installedImage);
foreach ($file as $template) { foreach ($file as &$template) {
if ( $installedName == $template['Name'] ) { if ( $installedName == $template['Name'] ) {
$template['testrepo'] = $installedImage;
if ( startsWith($installedImage,$template['Repository']) ) { if ( startsWith($installedImage,$template['Repository']) ) {
$template['Uninstall'] = true; $template['Uninstall'] = true;
$template['InstallPath'] = $template['Path']; $template['InstallPath'] = $template['Path'];
@ -1029,7 +1029,7 @@ if ( $caSettings['dockerRunning'] ) {
$template['UpdateAvailable'] = true; $template['UpdateAvailable'] = true;
} }
if ($template['Blacklist'] ) continue; if ($template['Blacklist'] ) continue;
$template['testrepo'] = $installedImage;
$displayed[] = $template; $displayed[] = $template;
break; break;
} }
@ -1047,6 +1047,7 @@ if ( $caSettings['dockerRunning'] ) {
$flag = false; $flag = false;
$containerID = false; $containerID = false;
foreach ($file as $templateDocker) { foreach ($file as $templateDocker) {
if ( $templateDocker['testrepo'] ) continue;
# use startsWith to eliminate any version tags (:latest) # use startsWith to eliminate any version tags (:latest)
if ( startsWith($templateDocker['Repository'], $testRepo) ) { if ( startsWith($templateDocker['Repository'], $testRepo) ) {
if ( $templateDocker['Name'] == $o['Name'] ) { if ( $templateDocker['Name'] == $o['Name'] ) {
@ -1092,6 +1093,7 @@ if ( $caSettings['dockerRunning'] ) {
# Without this, an app could appear to be shown in installed apps twice # Without this, an app could appear to be shown in installed apps twice
$fat32Fix[$searchResult]++; $fat32Fix[$searchResult]++;
if ($fat32Fix[$searchResult] > 1) continue; if ($fat32Fix[$searchResult] > 1) continue;
if ($o['testrepo']) continue;
$displayed[] = $o; $displayed[] = $o;
} }
} }
@ -1113,6 +1115,7 @@ if ( $caSettings['dockerRunning'] ) {
$flag = false; $flag = false;
foreach ($info as $installedDocker) { foreach ($info as $installedDocker) {
$installedImage = $installedDocker['Image']; $installedImage = $installedDocker['Image'];
$installedImage = str_replace("library/","",$installedImage);
$installedName = $installedDocker['Name']; $installedName = $installedDocker['Name'];
if ( startsWith($installedImage, $o['Repository']) ) { if ( startsWith($installedImage, $o['Repository']) ) {
if ( $installedName == $o['Name'] ) { if ( $installedName == $o['Name'] ) {