Fix crash in tf kubernetes dashboard check
@@ -15,7 +15,8 @@ class AKSDashboardDisabled(BaseResourceCheck):
addon_profile = conf.get('addon_profile', [None])[0]
self.evaluated_keys = ['addon_profile']
if addon_profile and isinstance(addon_profile, dict):
- if addon_profile.get('kube_dashboard') and addon_profile['kube_dashboard'][0].get('enabled', [False])[0]:
+ dashboard = addon_profile.get('kube_dashboard', [[]])[0]
+ if isinstance(dashboard, dict) and dashboard[0].get('enabled', [False])[0]:
self.evaluated_keys = ['addon_profile/kube_dashboard', 'addon_profile/kube_dashboard/[0]/enabled']
return CheckResult.FAILED
return CheckResult.PASSED
