Skip to content

Commit 060ed16

Browse files
author
jc
committed
Fixing k8s db bundled deployment
1 parent 930a0a6 commit 060ed16

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

src/cli/commands/k8s_db.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,25 @@ def _create_bundled(*, values_file: Path | None, wait: bool) -> None:
278278
sync.copy_config_files(progress_factory=Progress)
279279
console.ok("Config files copied")
280280

281+
# Step 1.6: Build and load PostgreSQL image
282+
console.info("Building PostgreSQL image...")
283+
from src.cli.deployment.helm_deployer.image_builder import ImageBuilder
284+
285+
image_builder = ImageBuilder(
286+
console=console,
287+
commands=commands,
288+
controller=controller,
289+
paths=paths,
290+
constants=constants,
291+
)
292+
293+
# Build images and load into cluster (Minikube/Kind)
294+
image_tag = image_builder.build_and_tag_images(
295+
progress_factory=Progress,
296+
registry=None, # Local cluster, no registry needed
297+
)
298+
console.ok(f"PostgreSQL image built and loaded: {image_tag}")
299+
281300
# Step 2: Deploy PostgreSQL
282301
# Try standalone bundled chart first, fallback to Bitnami
283302
standalone_chart_path = paths.postgres_standalone_chart
@@ -412,7 +431,7 @@ def _create_bundled(*, values_file: Path | None, wait: bool) -> None:
412431
namespace,
413432
"--create-namespace",
414433
"--timeout",
415-
"15m", # Increased for CI environments where K8s operations can be slow
434+
"10m",
416435
]
417436

418437
if values_file:

tests/e2e/test_copier_to_deployment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,7 +1100,7 @@ def test_08_kubernetes_deployment(self):
11001100
self.run_command(
11011101
["uv", "run", "api-forge-cli", "k8s", "db", "create", "--bundled"],
11021102
cwd=project_dir,
1103-
timeout=600, # 10 minutes for database creation in CI (K8s can be slow)
1103+
timeout=600, # 10 minutes - includes image build + Helm deployment
11041104
env=create_env,
11051105
)
11061106
print("✅ PostgreSQL database created and initialized")

0 commit comments

Comments
 (0)