File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
src/containerapp/azext_containerapp Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -165,10 +165,17 @@ def get_environment_client(self):
165165 return ManagedEnvironmentClient
166166
167167 def set_up_probes (self ):
168- probes_def = None
169- if self .get_argument_probe_yaml () is not None :
170- probes_def = load_yaml_file (self .get_argument_probe_yaml ())
171- return probes_def .get ('probes' )
168+ probes_def = load_yaml_file (self .get_argument_probe_yaml ())
169+ if not isinstance (probes_def , dict ) or 'probes' not in probes_def :
170+ raise ValidationError ("The probe YAML file is not properly formatted. It must be a dictionary containing a 'probes' key." )
171+
172+ probes_list = probes_def .get ('probes' )
173+ if probes_list is None :
174+ return []
175+ if not isinstance (probes_list , list ):
176+ raise ValidationError ("The 'probes' key in the probe YAML file must be associated with a list of probes." )
177+
178+ return probes_list
172179
173180
174181class SessionPoolCreateDecorator (SessionPoolPreviewDecorator ):
You can’t perform that action at this time.
0 commit comments