Skip to content
This repository was archived by the owner on Apr 27, 2026. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/Sandbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ class Sandbox

private ?string $persistentStoragePvcName = null;
private ?string $persistentStorageK8sManifest = null;
private ?bool $persistentStorageReady = null;
private ?string $persistentStorageK8sStorageClassName = null;

private ?SandboxCredentials $credentials = null;

Expand Down Expand Up @@ -198,6 +200,10 @@ public static function fromArray(array $in): self

$sandbox->persistentStoragePvcName = $in['persistentStorage']['pvcName'] ?? null;
$sandbox->persistentStorageK8sManifest = $in['persistentStorage']['k8sManifest'] ?? null;
$sandbox->persistentStorageReady = isset($in['persistentStorage']['ready'])
? (bool) $in['persistentStorage']['ready']
: null;
$sandbox->persistentStorageK8sStorageClassName = $in['persistentStorage']['k8sStorageClassName'] ?? null;

self::setPasswordOrCredentials($in, $sandbox);

Expand Down Expand Up @@ -719,6 +725,22 @@ public function removePersistentStorageK8sManifest(): Sandbox
return $this;
}

public function getPersistentStorageReady(): ?bool
{
return $this->persistentStorageReady;
}

public function getPersistentStorageK8sStorageClassName(): ?string
{
return $this->persistentStorageK8sStorageClassName;
}

public function setPersistentStorageK8sStorageClassName(?string $persistentStorageK8sStorageClassName): self
{
$this->persistentStorageK8sStorageClassName = $persistentStorageK8sStorageClassName;
return $this;
}

public function getCredentials(): ?SandboxCredentials
{
return $this->credentials;
Expand Down
4 changes: 4 additions & 0 deletions tests/SandboxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public function testGetters(): void
'persistentStorage' => [
'pvcName' => 'pvc-name',
'k8sManifest' => 'pvc-manifest',
'ready' => true,
'k8sStorageClassName' => 'storage-class',
],
]);

Expand Down Expand Up @@ -88,6 +90,8 @@ public function testGetters(): void
self::assertSame('databricks-cluster-id', $sandbox->getDatabricksClusterId());
self::assertSame('pvc-name', $sandbox->getPersistentStoragePvcName());
self::assertSame('pvc-manifest', $sandbox->getPersistentStorageK8sManifest());
self::assertTrue($sandbox->getPersistentStorageReady());
self::assertSame('storage-class', $sandbox->getPersistentStorageK8sStorageClassName());
}

public function testPasswordNullable(): void
Expand Down
Loading