Clean up code

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
Francesco Torchia 2024-04-09 10:25:32 +02:00
parent ebc7d81c02
commit 074efb4bc3
No known key found for this signature in database
GPG Key ID: E6D011B7415D4393
1 changed files with 1 additions and 7 deletions

View File

@ -278,13 +278,7 @@ export default {
}
for (const resource of resources) {
if (!resource) {
return STATES_ENUM.UNHEALTHY;
}
}
for (const resource of resources) {
if (resource.status.conditions?.find((c) => c.status !== 'True') || resource.metadata.state?.error) {
if (!resource || resource.status.conditions?.find((c) => c.status !== 'True') || resource.metadata.state?.error) {
return STATES_ENUM.UNHEALTHY;
}
}