Skip to content

Commit 5a27d6a

Browse files
committed
fix: filter out failed network and database servers
1 parent 390acf4 commit 5a27d6a

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/Command/Database/CreateDatabaseServerCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ protected function perform(InputInterface $input, ConsoleOutput $output)
8080
private function determineNetwork(InputInterface $input, ConsoleOutput $output): array
8181
{
8282
$networkIdOrName = $this->getStringOption($input, 'network', true);
83-
$networks = $this->apiClient->getTeamNetworks($this->cliConfiguration->getActiveTeamId())->whereNotIn('status', 'deleting');
83+
$networks = $this->apiClient->getTeamNetworks($this->cliConfiguration->getActiveTeamId())->whereNotIn('status', ['deleting', 'failed']);
8484

8585
if ($networks->isEmpty() && !$output->confirm('Your team doesn\'t have any provisioned networks to create the database server on. Would you like to create one first? <fg=default>(Answering "<comment>no</comment>" will cancel the command.)</>')) {
8686
throw new CommandCancelledException();

src/Command/Project/InitializeProjectCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ private function addEnvironmentDatabaseNodes(array $environments, ConsoleOutput
180180
private function determineDatabaseServer(ConsoleOutput $output, string $region): ?array
181181
{
182182
$database = null;
183-
$databases = $this->apiClient->getDatabaseServers($this->cliConfiguration->getActiveTeamId())->where('region', $region)->whereNotIn('status', 'deleting');
183+
$databases = $this->apiClient->getDatabaseServers($this->cliConfiguration->getActiveTeamId())->where('region', $region)->whereNotIn('status', ['deleting', 'failed']);
184184

185185
if (!$databases->isEmpty() && $output->confirm('Would you like to use an existing database server for this project?')) {
186186
$database = (string) $output->choiceWithResourceDetails('Which database server would you like to use?', $databases);

0 commit comments

Comments
 (0)