@@ -123,6 +123,54 @@ def test_helm_template_renders_validator_registry_url_default_and_override(
123123 assert config ["master" ]["registry_url" ] == "http://platform-admin:8000"
124124
125125
126+ def test_helm_master_upload_registration_defaults_to_required () -> None :
127+ documents = _helm_template ("platform" , str (CHART ))
128+ config = yaml .safe_load (
129+ _document (documents , "ConfigMap" , "platform-config" )["data" ]["master.yaml" ]
130+ )
131+
132+ assert config ["master" ]["upload_require_registered_hotkey" ] is True
133+
134+
135+ def test_helm_master_upload_registration_can_be_disabled_for_local_runtime () -> None :
136+ documents = _helm_template (
137+ "platform" ,
138+ str (CHART ),
139+ "--set" ,
140+ "masterProxy.uploadRequireRegisteredHotkey=false" ,
141+ )
142+ config = yaml .safe_load (
143+ _document (documents , "ConfigMap" , "platform-config" )["data" ]["master.yaml" ]
144+ )
145+
146+ assert config ["master" ]["upload_require_registered_hotkey" ] is False
147+
148+
149+ def test_helm_production_policy_rejects_disabled_upload_registration () -> None :
150+ helm = shutil .which ("helm" )
151+ if helm is None :
152+ pytest .skip ("helm is not installed" )
153+
154+ result = subprocess .run (
155+ [
156+ helm ,
157+ "template" ,
158+ "platform" ,
159+ str (CHART ),
160+ "-f" ,
161+ str (PRODUCTION_VALUES ),
162+ "--set" ,
163+ "masterProxy.uploadRequireRegisteredHotkey=false" ,
164+ ],
165+ check = False ,
166+ capture_output = True ,
167+ text = True ,
168+ )
169+
170+ assert result .returncode != 0
171+ assert "masterProxy.uploadRequireRegisteredHotkey=true" in result .stderr
172+
173+
126174def test_helm_validator_deployment_uses_configured_image_pull_policy () -> None :
127175 helm = shutil .which ("helm" )
128176 if helm is None :
0 commit comments