Skip to content

Commit b2e765d

Browse files
committed
Added optional target paramater for creating instance
This ensures the instance is created where the user intended when in clustering mode instead of where LXD allocates it!
1 parent dd1219a commit b2e765d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Endpoint/InstaceBase.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public function unfreeze($name, $timeout = 30, $force = true, $stateful = false,
255255
* @param bool $wait Wait for operation to finish
256256
* @return object
257257
*/
258-
public function create($name, array $options, $wait = false, array $requestHeaders = [])
258+
public function create($name, array $options, $wait = false, array $requestHeaders = [], string $target = "")
259259
{
260260
$source = $this->getSource($options);
261261

@@ -281,6 +281,10 @@ public function create($name, array $options, $wait = false, array $requestHeade
281281
"project"=>$this->client->getProject()
282282
];
283283

284+
if (!empty($target)) {
285+
$config["target"] = $target;
286+
}
287+
284288

285289
$response = $this->post($this->getEndpoint(), $opts, $config, $requestHeaders);
286290

0 commit comments

Comments
 (0)