Skip to content

Commit

Permalink
fix: allow to remove app on init stage or error (#235)
Browse files Browse the repository at this point in the history
Allow remove ExApp on initialization step or if error occurred.

Signed-off-by: Andrey Borysenko <andrey18106x@gmail.com>
  • Loading branch information
andrey18106 authored Feb 20, 2024
1 parent 071b763 commit b6a3fd2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/Controller/ExAppsPageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@ public function listApps(): JSONResponse {
}))[0]['releases'][0]['version'];
}

$appData['canUnInstall'] = !$appData['active'] && $appData['removable'] && !isset($appData['status']['type']);
$appData['canUnInstall'] = !$appData['active'] && $appData['removable'] && !isset($appData['status']['type'])
|| (isset($appData['status']['action']) && $appData['status']['action'] === 'init')
|| !empty($appData['status']['error']);

// fix licence vs license
if (isset($appData['license']) && !isset($appData['licence'])) {
Expand Down
4 changes: 2 additions & 2 deletions lib/DeployActions/DockerActions.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ public function resolveExAppUrl(
} else {
$exAppHost = $appId;
}
if (empty($deployConfig['haproxy_password'])) {
if (!isset($deployConfig['haproxy_password']) || $deployConfig['haproxy_password'] === '') {
$auth = [];
} else {
$auth = [self::APP_API_HAPROXY_USER, $deployConfig['haproxy_password']];
Expand Down Expand Up @@ -527,7 +527,7 @@ public function initGuzzleClient(DaemonConfig $daemonConfig): void {
} elseif ($daemonConfig->getProtocol() === 'https') {
$guzzleParams = $this->setupCerts($guzzleParams);
}
if (!empty($daemonConfig->getDeployConfig()['haproxy_password'])) {
if (isset($daemonConfig->getDeployConfig()['haproxy_password']) && $daemonConfig->getDeployConfig()['haproxy_password'] !== '') {
$guzzleParams['auth'] = [self::APP_API_HAPROXY_USER, $daemonConfig->getDeployConfig()['haproxy_password']];
}
$this->guzzleClient = new Client($guzzleParams);
Expand Down
2 changes: 2 additions & 0 deletions src/store/apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@ const mutations = {
console.debug('catching intermediate state deploying -> initializing')
// catching moment when app is deployed but initialization status not started yet
status.action = 'init'
app.canUnInstall = true
}
if (status.error !== '') {
app.error = status.error
app.canUnInstall = true
}
if (status.deploy === 100 && status.init === 100) {
app.active = true
Expand Down

0 comments on commit b6a3fd2

Please sign in to comment.