File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 14
14
)
15
15
16
16
def getAnarchySubject (project_id ):
17
- subject = list (filter (lambda x : x ["metadata" ]["annotations" ]["poolboy.gpte.redhat.com/resource-claim-name" ] == f"labs.ocp4.na- { project_id } " , anarchy_subject_list ["items" ]))
17
+ subject = list (filter (lambda x : project_id in x ["metadata" ]["annotations" ]["poolboy.gpte.redhat.com/resource-claim-name" ], anarchy_subject_list ["items" ]))
18
18
if len (subject ) > 0 :
19
19
return subject [0 ]
20
20
else :
Original file line number Diff line number Diff line change 24
24
current_state = subject ["anarchy_subject" ]["spec" ]["vars" ]["current_state" ]
25
25
desired_state = subject ["anarchy_subject" ]["spec" ]["vars" ]["desired_state" ]
26
26
27
- ocp_subsystem ["status" ] = "green" if current_state == desired_state else "yellow"
28
27
ocp_subsystem ["state" ] = current_state
29
- ocp_subsystem ["info" ] = "Working as expected" if current_state == desired_state else "Contact SRE team"
30
28
ocp_subsystem ["updated" ] = str (datetime .datetime .utcnow ().replace (tzinfo = datetime .timezone .utc , microsecond = 0 ).isoformat ())
31
29
ocp_subsystem ["access_urls" ] = [
32
30
{
37
35
}
38
36
]
39
37
38
+ if current_state == "provisioning" :
39
+ ocp_subsystem ["status" ] = "yellow"
40
+ ocp_subsystem ["info" ] = "Building cluster"
41
+ elif current_state == desired_state :
42
+ ocp_subsystem ["status" ] = "green"
43
+ ocp_subsystem ["info" ] = "Working as expected"
44
+ else :
45
+ ocp_subsystem ["status" ] = "yellow"
46
+ ocp_subsystem ["info" ] = "Contact SRE team"
47
+
40
48
status ["overall_status" ] = ocp_subsystem ["status" ]
41
49
status ["subsystems" ].append (ocp_subsystem )
42
50
You can’t perform that action at this time.
0 commit comments