@@ -366,17 +366,20 @@ def test_defaults(self):
366366 assert opts .build_images is False
367367 assert opts .load_kind is False
368368 assert opts .helm_timeout == "15m"
369+ assert opts .helm_debug is False
369370 assert opts .dry_run is False
370371
371372 def test_custom_options (self ):
372373 opts = DeployOptions (
373374 build_images = True ,
374375 load_kind = True ,
375376 kind_cluster = "test-cluster" ,
377+ helm_debug = True ,
376378 dry_run = True ,
377379 )
378380 assert opts .build_images is True
379381 assert opts .kind_cluster == "test-cluster"
382+ assert opts .helm_debug is True
380383
381384
382385class TestImageBuilds :
@@ -544,6 +547,82 @@ def fake_run_logged(cmd, step, callback, **kwargs):
544547 ] in logged_commands
545548
546549
550+ class TestHelmInstall :
551+ def test_kind_deploy_does_not_enable_helm_debug_without_flag (self , monkeypatch , tmp_path ):
552+ logged_commands : list [list [str ]] = []
553+
554+ def fake_run_logged (cmd , step , callback , ** kwargs ):
555+ logged_commands .append (cmd )
556+ return MagicMock (returncode = 0 , stdout = "" , stderr = "" )
557+
558+ monkeypatch .setattr ("nv_config_manager_installer.deployer._run_logged" , fake_run_logged )
559+
560+ config = _make_config ()
561+ config .cluster .airgapped = True
562+ deployer = Deployer (
563+ config ,
564+ DeployOptions (load_kind = True , chart_dir = "deploy/helm" ),
565+ RecordingCallback (),
566+ )
567+ deployer ._values_file = tmp_path / "values-generated.yaml"
568+ deployer ._values_file .write_text ("global: {}\n " )
569+
570+ deployer ._helm_install ()
571+
572+ helm_cmd = next (
573+ cmd for cmd in logged_commands if cmd [:3 ] == ["helm" , "upgrade" , "--install" ]
574+ )
575+ assert "--debug" not in helm_cmd
576+
577+ def test_helm_debug_can_be_enabled_without_kind (self , monkeypatch , tmp_path ):
578+ logged_commands : list [list [str ]] = []
579+
580+ def fake_run_logged (cmd , step , callback , ** kwargs ):
581+ logged_commands .append (cmd )
582+ return MagicMock (returncode = 0 , stdout = "" , stderr = "" )
583+
584+ monkeypatch .setattr ("nv_config_manager_installer.deployer._run_logged" , fake_run_logged )
585+
586+ config = _make_config ()
587+ config .cluster .airgapped = True
588+ deployer = Deployer (
589+ config ,
590+ DeployOptions (helm_debug = True , chart_dir = "deploy/helm" ),
591+ RecordingCallback (),
592+ )
593+ deployer ._values_file = tmp_path / "values-generated.yaml"
594+ deployer ._values_file .write_text ("global: {}\n " )
595+
596+ deployer ._helm_install ()
597+
598+ helm_cmd = next (
599+ cmd for cmd in logged_commands if cmd [:3 ] == ["helm" , "upgrade" , "--install" ]
600+ )
601+ assert "--debug" in helm_cmd
602+
603+ def test_helm_debug_stays_off_by_default (self , monkeypatch , tmp_path ):
604+ logged_commands : list [list [str ]] = []
605+
606+ def fake_run_logged (cmd , step , callback , ** kwargs ):
607+ logged_commands .append (cmd )
608+ return MagicMock (returncode = 0 , stdout = "" , stderr = "" )
609+
610+ monkeypatch .setattr ("nv_config_manager_installer.deployer._run_logged" , fake_run_logged )
611+
612+ config = _make_config ()
613+ config .cluster .airgapped = True
614+ deployer = Deployer (config , DeployOptions (chart_dir = "deploy/helm" ), RecordingCallback ())
615+ deployer ._values_file = tmp_path / "values-generated.yaml"
616+ deployer ._values_file .write_text ("global: {}\n " )
617+
618+ deployer ._helm_install ()
619+
620+ helm_cmd = next (
621+ cmd for cmd in logged_commands if cmd [:3 ] == ["helm" , "upgrade" , "--install" ]
622+ )
623+ assert "--debug" not in helm_cmd
624+
625+
547626class TestContentHashing :
548627 def test_deterministic_hash (self ):
549628 with tempfile .TemporaryDirectory () as d :
0 commit comments