mirror of
https://github.com/argoproj/argo-cd.git
synced 2026-02-20 01:28:45 +01:00
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
This commit is contained in:
@@ -20,23 +20,29 @@ if #obj.status.conditions == 0 then
|
||||
end
|
||||
|
||||
local isEstablished
|
||||
local isTerminating
|
||||
local namesNotAccepted
|
||||
local hasViolations
|
||||
local conditionMsg = ""
|
||||
|
||||
for _, condition in pairs(obj.status.conditions) do
|
||||
|
||||
-- Check if CRD is terminating
|
||||
if condition.type == "Terminating" and condition.status == "True" then
|
||||
isTerminating = true
|
||||
conditionMsg = condition.message
|
||||
hs.status = "Progressing"
|
||||
hs.message = "CRD is terminating: " .. condition.message
|
||||
return hs
|
||||
end
|
||||
|
||||
-- Check if K8s has accepted names for this CRD
|
||||
if condition.type == "NamesAccepted" and condition.status == "False" then
|
||||
namesNotAccepted = true
|
||||
conditionMsg = condition.message
|
||||
hs.status = "Degraded"
|
||||
hs.message = "CRD names have not been accepted: " .. condition.message
|
||||
return hs
|
||||
end
|
||||
|
||||
-- Checking if CRD has violations
|
||||
if condition.type == "NonStructuralSchema" and condition.status == "True" then
|
||||
hs.status = "Degraded"
|
||||
hs.message = "Schema violations found: " .. condition.message
|
||||
return hs
|
||||
end
|
||||
|
||||
-- Checking if CRD is established
|
||||
@@ -44,25 +50,6 @@ for _, condition in pairs(obj.status.conditions) do
|
||||
isEstablished = true
|
||||
conditionMsg = condition.message
|
||||
end
|
||||
|
||||
-- Checking if CRD has violations
|
||||
if condition.type == "NonStructuralSchema" and condition.status == "True" then
|
||||
hasViolations = true
|
||||
conditionMsg = condition.message
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
if isTerminating then
|
||||
hs.status = "Progressing"
|
||||
hs.message = "CRD is terminating: " .. conditionMsg
|
||||
return hs
|
||||
end
|
||||
|
||||
if namesNotAccepted then
|
||||
hs.status = "Degraded"
|
||||
hs.message = "CRD names have not been accepted: " .. conditionMsg
|
||||
return hs
|
||||
end
|
||||
|
||||
if not isEstablished then
|
||||
@@ -71,12 +58,6 @@ if not isEstablished then
|
||||
return hs
|
||||
end
|
||||
|
||||
if hasViolations then
|
||||
hs.status = "Degraded"
|
||||
hs.message = "Schema violations found: " .. conditionMsg
|
||||
return hs
|
||||
end
|
||||
|
||||
hs.status = "Healthy"
|
||||
hs.message = "CRD is healthy"
|
||||
return hs
|
||||
@@ -47,15 +47,15 @@ status:
|
||||
reason: NoConflicts
|
||||
status: 'True'
|
||||
type: NamesAccepted
|
||||
- lastTransitionTime: '2024-05-19T23:35:28Z'
|
||||
message: the initial names have been accepted
|
||||
reason: InitialNamesAccepted
|
||||
status: 'True'
|
||||
type: Established
|
||||
- lastTransitionTime: '2024-10-26T19:44:57Z'
|
||||
message: 'spec.preserveUnknownFields: Invalid value: true: must be false'
|
||||
reason: Violations
|
||||
status: 'True'
|
||||
type: NonStructuralSchema
|
||||
- lastTransitionTime: '2024-05-19T23:35:28Z'
|
||||
message: the initial names have been accepted
|
||||
reason: InitialNamesAccepted
|
||||
status: 'True'
|
||||
type: Established
|
||||
storedVersions:
|
||||
- v1alpha1
|
||||
Reference in New Issue
Block a user