Merge pull request #6782 from livetocode/feature/k8s-dashboard-links

provide access to the Kubernetes dashboard when viewing a specific resource
This commit is contained in:
Fredrik Adelöw
2021-09-20 14:17:30 +02:00
committed by GitHub
35 changed files with 972 additions and 40 deletions
+10 -3
View File
@@ -17,14 +17,21 @@ import { V1Service } from '@kubernetes/client-node';
// @public (undocumented)
export type AuthProviderType = 'google' | 'serviceAccount' | 'aws';
// Warning: (ae-missing-release-tag) "ClusterAttributes" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface ClusterAttributes {
dashboardApp?: string;
dashboardUrl?: string;
name: string;
}
// Warning: (ae-missing-release-tag) "ClusterObjects" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public (undocumented)
export interface ClusterObjects {
// (undocumented)
cluster: {
name: string;
};
cluster: ClusterAttributes;
// (undocumented)
errors: KubernetesFetchError[];
// (undocumented)
+33 -1
View File
@@ -32,8 +32,40 @@ export interface KubernetesRequestBody {
entity: Entity;
}
export interface ClusterAttributes {
/**
* Specifies the name of the Kubernetes cluster.
*/
name: string;
/**
* Specifies the link to the Kubernetes dashboard managing this cluster.
* @remarks
* Note that you should specify the app used for the dashboard
* using the dashboardApp property, in order to properly format
* links to kubernetes resources, otherwise it will assume that you're running the standard one.
* @see dashboardApp
*/
dashboardUrl?: string;
/**
* Specifies the app that provides the Kubernetes dashboard.
* This will be used for formatting links to kubernetes objects inside the dashboard.
* @remarks
* The supported dashboards are: standard, rancher, openshift, gke, aks, eks
* Note that it will default to the regular dashboard provided by the Kubernetes project (standard).
* Note that you can add your own formatter by registering it to the clusterLinksFormatters dictionary.
* @defaultValue standard
* @see dashboardUrl
* @example
* ```ts
* import { clusterLinksFormatters } from '@backstage/plugin-kubernetes';
* clusterLinksFormatters.myDashboard = (options) => ...;
* ```
*/
dashboardApp?: string;
}
export interface ClusterObjects {
cluster: { name: string };
cluster: ClusterAttributes;
resources: FetchResponse[];
errors: KubernetesFetchError[];
}