in azext_edge/edge/providers/orchestration/work.py [0:0]
def _process_extension_dependencies(self):
missing_exts = []
bad_provisioning_state = []
dependencies = self.ops_extension_dependencies
for ext in dependencies:
ext_attr = dependencies.get(ext)
if not ext_attr:
missing_exts.append(ext)
continue
ext_provisioning_state: str = ext_attr.get("properties", {}).get("provisioningState")
if ext_provisioning_state.lower() != PROVISIONING_STATE_SUCCESS.lower():
bad_provisioning_state.append(ext)
if missing_exts:
raise ValidationError(
"Foundational service(s) not detected on the cluster:\n\n"
+ "\n".join(missing_exts)
+ "\n\nInstance deployment will not continue. Please run 'az iot ops init'."
)
if bad_provisioning_state:
raise ValidationError(
"Foundational service(s) with non-successful provisioning state detected on the cluster:\n\n"
+ "\n".join(bad_provisioning_state)
+ "\n\nInstance deployment will not continue. Please run 'az iot ops init'."
)
# validate trust config in platform extension matches trust settings in create
platform_extension_config = dependencies[EXTENSION_TYPE_PLATFORM]["properties"]["configurationSettings"]
is_user_trust = platform_extension_config.get("installCertManager", "").lower() != "true"
if is_user_trust and not self._targets.trust_settings:
raise ValidationError(
"Cluster was enabled with user-managed trust configuration, "
"--trust-settings arguments are required to create an instance on this cluster."
)
elif not is_user_trust and self._targets.trust_settings:
raise ValidationError(
"Cluster was enabled with system cert-manager, "
"trust settings (--trust-settings) are not applicable to this cluster."
)