Skip to content

Commit 276cba7

Browse files
author
Shichao Qiu
committed
update
1 parent 8341160 commit 276cba7

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/containerapp/azext_containerapp/containerapp_sessionpool_decorator.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff 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

174181
class SessionPoolCreateDecorator(SessionPoolPreviewDecorator):

0 commit comments

Comments
 (0)