Skip to content

Commit 1f7af37

Browse files
fix(hint): explain that "--force" option exists (#746)
Fixes #624 When the `occ app_api:app:unregister` command fails to remove a container (e.g., because it was already deleted manually), users are now shown a helpful hint suggesting the `--force` option to continue unregistering. The hint includes the container name for easier manual verification/cleanup. Before: ``` Failed to remove ExApp my_ex_app container ``` After: ``` Failed to remove ExApp my_ex_app container Hint: If the container "nc_app_my_ex_app" was already removed manually, you can use the --force option to continue unregistering. ``` --------- Signed-off-by: Oleksander Piskun <[email protected]> Signed-off-by: Oleksandr Piskun <[email protected]> Co-authored-by: Anupam Kumar <[email protected]>
1 parent d3a4de2 commit 1f7af37

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Command/ExApp/Unregister.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
102102
if ($this->dockerActions->removeExApp($this->dockerActions->buildDockerUrl($daemonConfig), $exApp->getAppid(), removeData: $rmData)) {
103103
if (!$silent) {
104104
$output->writeln(sprintf('Failed to remove ExApp %s', $appId));
105+
$output->writeln('Hint: If the container was already removed manually, you can use the --force option to fully remove it from AppAPI.');
105106
}
106107
if (!$force) {
107108
return 1;
@@ -112,12 +113,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int
112113
}
113114
}
114115
} else {
116+
$containerName = $this->dockerActions->buildExAppContainerName($appId);
115117
$removeResult = $this->dockerActions->removeContainer(
116-
$this->dockerActions->buildDockerUrl($daemonConfig), $this->dockerActions->buildExAppContainerName($appId)
118+
$this->dockerActions->buildDockerUrl($daemonConfig), $containerName
117119
);
118120
if ($removeResult) {
119121
if (!$silent) {
120122
$output->writeln(sprintf('Failed to remove ExApp %s container', $appId));
123+
$output->writeln(sprintf('Hint: If the container "%s" was already removed manually, you can use the --force option to fully remove it from AppAPI.', $containerName));
121124
}
122125
if (!$force) {
123126
return 1;

0 commit comments

Comments
 (0)