Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Gu <[email protected]>
  • Loading branch information
tylergu committed Nov 15, 2023
1 parent ca871e1 commit e042ce1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
14 changes: 12 additions & 2 deletions acto/checker/impl/health.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ def check(self, _: int, snapshot: Snapshot, __: Snapshot) -> OracleResult:
(dp['metadata']['name'], condition['type'], condition['status'],
condition['message']))

for daemonset in system_state['daemonset'].values():
if (daemonset['status']['desired_number_scheduled'] != daemonset['status'][
'number_ready']
or daemonset['status']['desired_number_scheduled'] != daemonset['status']['number_available']):
unhealthy_resources['daemonset'].append(
'%s desired_number_scheduled [%s] number_ready [%s]' %
(daemonset['metadata']['name'],
daemonset['status']['desired_number_scheduled'],
daemonset['status']['number_ready']))

# check Health of Pods
for pod in system_state['pod'].values():
if pod['status']['phase'] in ['Running', 'Completed', 'Succeeded']:
Expand All @@ -74,10 +84,10 @@ def check(self, _: int, snapshot: Snapshot, __: Snapshot) -> OracleResult:

# check Health of CRs
if system_state['custom_resource_status'] is not None and 'conditions' in system_state[
'custom_resource_status']:
'custom_resource_status']:
for condition in system_state['custom_resource_status']['conditions']:
if condition['type'] == 'Ready' and condition[
'status'] != 'True' and 'is forbidden' in condition['message'].lower():
'status'] != 'True' and 'is forbidden' in condition['message'].lower():
unhealthy_resources['cr'].append('%s condition [%s] status [%s] message [%s]' %
('CR status unhealthy', condition['type'],
condition['status'], condition['message']))
Expand Down
5 changes: 4 additions & 1 deletion data/anvil-fluent-controller/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
"seed_custom_resource": "data/anvil-fluent-controller/cr.yaml",
"kubernetes_version": "v1.26.3",
"diff_ignore_fields": [
"\\['metadata'\\]\\['annotations'\\]\\['anvil\\.dev\\\/lastRestartAt'\\]"
"\\['metadata'\\]\\['annotations'\\]\\['anvil\\.dev\\\/lastRestartAt'\\]",
"\\['daemonset_pods'\\]\\['test\\-cluster'\\]\\[.*\\]\\['metadata'\\]\\['labels'\\]\\['pod\\-template\\-generation'\\]",
"\\['daemonset_pods'\\]\\['test\\-cluster'\\]\\[.*\\]\\['spec'\\]\\['affinity'\\]",
"\\['metadata'\\]\\['annotations'\\]\\['deprecated\\.daemonset\\.template\\.generation'\\]"
],
"kubernetes_engine": {
"feature_gates": {
Expand Down

0 comments on commit e042ce1

Please sign in to comment.