Skip to content

Commit 878fd5c

Browse files
committed
OCP: Add check for operator success
Signed-off-by: Zack Cerza <[email protected]>
1 parent 8748b67 commit 878fd5c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

must_triage/inspectors/ocp.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def inspect_yaml(path):
2222
except (yaml.scanner.ScannerError, yaml.parser.ParserError):
2323
result[path].append("Failed to parse YAML content")
2424
return result
25+
result[path].extend(OCP.operator_success(obj))
2526
pods = list()
2627
if obj['kind'].lower() == 'pod':
2728
pods.append(obj)
@@ -33,6 +34,20 @@ def inspect_yaml(path):
3334
result[path].extend(map(OCP.pod_ready, pods))
3435
return result
3536

37+
@staticmethod
38+
def operator_success(obj):
39+
result = list()
40+
if obj['kind'] != 'ClusterServiceVersion':
41+
return result
42+
status = obj['status']
43+
if status['phase'].lower() == 'succeeded':
44+
return result
45+
result.append(
46+
f"Operator phase is '{status['phase']}', "
47+
"not 'Succeeded' as expected"
48+
)
49+
return result
50+
3651
@staticmethod
3752
def pod_ready(obj):
3853
result = list()

0 commit comments

Comments
 (0)