Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Conditions to Status #387

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 32 additions & 3 deletions common/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,40 @@ const (
UpdatingState State = "Updating"
)

type Severity string

const (
// OKSeverity indicates normal operation.
OKSeverity Severity = "OK"
// WarningSeverity indicates the condition requires attention.
WarningSeverity Severity = "Warning"
// CriticalSeverity indicates the condition requires immediate attention
CriticalSeverity Severity = "Critical"
)

type Condition struct {
// LogEntry contains a link to the log entry created for this condition.
LogEntry Link
// Message contains the human-readable message for this condition.
Message string
// Severity contains the severity of this condition.
Severity Severity
// MessageId contains the identifier for the message
MessageID string
// OriginOfCondition contains a link to the resource or object that originated the condition
OriginOfCondition Link
// Resolution contains the recommended actions to resolve this condition
Resolution string
// Timestamp contains the time the condition was last changed
Timestamp string
}

// Status describes the status and health of a resource and its children.
type Status struct {
Health Health `json:"Health"`
HealthRollup Health `json:"HealthRollup"`
State State `json:"State"`
Health Health `json:"Health"`
HealthRollup Health `json:"HealthRollup"`
State State `json:"State"`
Conditions []Condition `json:"Conditions"`
}

// LocationType shall name the type of location in use.
Expand Down
Loading