Skip to content
This repository was archived by the owner on Apr 27, 2026. It is now read-only.

Commit 4b84794

Browse files
committed
Do not use parent as default resource init strategy.
1 parent 8b0660c commit 4b84794

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/Command/Environment/EnvironmentActivateCommand.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ protected function activateMultiple(array $environments, InputInterface $input,
6767
if ($resourcesInit === false) {
6868
return 1;
6969
}
70-
$resourcesInit = ($resourcesInit === null) ? 'parent' : $resourcesInit;
7170

7271
$count = count($environments);
7372
$processed = 0;
@@ -116,7 +115,7 @@ protected function activateMultiple(array $environments, InputInterface $input,
116115

117116
$hasGuaranteedCPU = $this->environmentHasGuaranteedCPU($environment);
118117
$question = "Are you sure you want to activate the environment " . $this->api()->getEnvironmentLabel($environment) . "?";
119-
if ($hasGuaranteedCPU && $this->config()->has('warnings.guaranteed_resources_msg')) {
118+
if ($resourcesInit === 'parent' && $hasGuaranteedCPU && $this->config()->has('warnings.guaranteed_resources_msg')) {
120119
$question = trim($this->config()->get('warnings.guaranteed_resources_msg'))
121120
. "\n\n" . "Are you sure you want to activate the environment " . $this->api()->getEnvironmentLabel($environment) . "?";
122121
}
@@ -128,7 +127,9 @@ protected function activateMultiple(array $environments, InputInterface $input,
128127
}
129128

130129
$params = [];
131-
$params['resources']['init'] = $resourcesInit;
130+
if ($resourcesInit !== null) {
131+
$params['resources']['init'] = $resourcesInit;
132+
}
132133

133134
$activities = [];
134135
/** @var Environment $environment */

src/Command/Environment/EnvironmentBranchCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ protected function execute(InputInterface $input, OutputInterface $output)
119119
if ($resourcesInit === false) {
120120
return 1;
121121
}
122-
$resourcesInit = ($resourcesInit === null) ? 'parent' : $resourcesInit;
123122

124123
$title = $input->getOption('title') !== null ? $input->getOption('title') : $branchName;
125124

@@ -176,8 +175,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
176175
if ($type !== null) {
177176
$params['type'] = $type;
178177
}
178+
if ($resourcesInit !== null) {
179+
$params['resources']['init'] = $resourcesInit;
180+
}
179181

180-
$params['resources']['init'] = $resourcesInit;
181182
$result = $parentEnvironment->runOperation('branch', 'POST', $params);
182183
$activities = $result->getActivities();
183184

0 commit comments

Comments
 (0)