fix api-reports

Signed-off-by: goenning <me@goenning.net>
This commit is contained in:
goenning
2022-07-11 14:13:17 +01:00
parent 2b0ba754da
commit 1c752277c6
4 changed files with 44 additions and 16 deletions
+12 -13
View File
@@ -98,34 +98,24 @@ export interface DeploymentResources {
replicaSets: V1ReplicaSet[];
}
// Warning: (ae-missing-release-tag) "DetectedError" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
// @alpha
export interface DetectedError {
// (undocumented)
cluster: string;
// Warning: (ae-forgotten-export) The symbol "ErrorDetectableKind" needs to be exported by the entry point index.d.ts
//
// (undocumented)
kind: ErrorDetectableKind;
// (undocumented)
message: string[];
// (undocumented)
names: string[];
// Warning: (ae-forgotten-export) The symbol "ErrorSeverity" needs to be exported by the entry point index.d.ts
//
// (undocumented)
severity: ErrorSeverity;
}
// Warning: (ae-missing-release-tag) "DetectedErrorsByCluster" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
// @alpha
export type DetectedErrorsByCluster = Map<string, DetectedError[]>;
// Warning: (ae-missing-release-tag) "detectErrors" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
// @alpha
export const detectErrors: (
objects: ObjectsByEntityResponse,
) => DetectedErrorsByCluster;
@@ -142,6 +132,12 @@ export type EntityKubernetesContentProps = {
refreshIntervalMs?: number;
};
// @alpha
export type ErrorDetectableKind =
| 'Pod'
| 'Deployment'
| 'HorizontalPodAutoscaler';
// Warning: (ae-forgotten-export) The symbol "ErrorPanelProps" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "ErrorPanel" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -160,6 +156,9 @@ export const ErrorReporting: ({
detectedErrors,
}: ErrorReportingProps) => JSX.Element;
// @alpha
export type ErrorSeverity = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
// Warning: (ae-forgotten-export) The symbol "FormatClusterLinkOptions" needs to be exported by the entry point index.d.ts
// Warning: (ae-missing-release-tag) "formatClusterLink" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
@@ -21,8 +21,12 @@ import { detectErrorsInPods } from './pods';
import { detectErrorsInDeployments } from './deployments';
import { detectErrorsInHpa } from './hpas';
// For each cluster try to find errors in each of the object types provided
// returning a map of cluster names to errors in that cluster
/**
* For each cluster try to find errors in each of the object types provided
* returning a map of cluster names to errors in that cluster
*
* @alpha
*/
export const detectErrors = (
objects: ObjectsByEntityResponse,
): DetectedErrorsByCluster => {
@@ -14,5 +14,10 @@
* limitations under the License.
*/
export type { DetectedError, DetectedErrorsByCluster } from './types';
export type {
ErrorDetectableKind,
DetectedError,
DetectedErrorsByCluster,
ErrorSeverity,
} from './types';
export { detectErrors } from './error-detection';
@@ -21,17 +21,37 @@ import {
V1Pod,
} from '@kubernetes/client-node';
/**
* Severity of the error, where 10 is critical and 0 is very low.
*
* @alpha
*/
export type ErrorSeverity = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
export type ErrorDetectable = V1Pod | V1Deployment | V1HorizontalPodAutoscaler;
/**
* Kubernetes kinds that errors might be reported by the plugin
*
* @alpha
*/
export type ErrorDetectableKind =
| 'Pod'
| 'Deployment'
| 'HorizontalPodAutoscaler';
/**
* A list of errors keyed by Cluster name
*
* @alpha
*/
export type DetectedErrorsByCluster = Map<string, DetectedError[]>;
/**
* Represents an error found on a Kubernetes object
*
* @alpha
*/
export interface DetectedError {
severity: ErrorSeverity;
cluster: string;