/** * Severity of the error, where 10 is critical and 0 is very low. * * @public */ export type ErrorSeverity = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; /** * A list of errors keyed by Cluster name * * @public */ export type DetectedErrorsByCluster = Map; /** * A reference to a Kubernetes object * * @public */ export interface ResourceRef { name: string; namespace: string; kind: string; apiGroup: string; } /** * Represents an error found on a Kubernetes object * * @public */ export interface DetectedError { type: string; severity: ErrorSeverity; message: string; proposedFix?: ProposedFix; sourceRef: ResourceRef; occurrenceCount: number; } /** @public */ export type ProposedFix = LogSolution | DocsSolution | EventsSolution; /** @public */ export interface ProposedFixBase { errorType: string; rootCauseExplanation: string; actions: string[]; } /** @public */ export interface LogSolution extends ProposedFixBase { type: 'logs'; container: string; } /** @public */ export interface DocsSolution extends ProposedFixBase { type: 'docs'; docsLink: string; } /** @public */ export interface EventsSolution extends ProposedFixBase { type: 'events'; podName: string; } /** @public */ export interface ErrorMapper { detectErrors: (resource: T) => DetectedError[]; }