Use config schema inline instead

Signed-off-by: Marcus Eide <eide@spotify.com>
This commit is contained in:
Marcus Eide
2021-05-07 15:39:39 +02:00
parent 7ee8ad08fd
commit bc551b5f46
2 changed files with 33 additions and 48 deletions
+33 -4
View File
@@ -14,14 +14,43 @@
* limitations under the License.
*/
import { ClusterLocatorMethod, CustomResource } from './src/types';
export interface Config {
kubernetes?: {
serviceLocatorMethod: {
type: 'multiTenant';
};
clusterLocatorMethods: ClusterLocatorMethod[];
customResources?: CustomResource[];
clusterLocatorMethods: Array<
| {
/** @visibility frontend */
type: 'gke';
/** @visibility frontend */
projectId: string;
/** @visibility frontend */
region?: string;
/** @visibility frontend */
skipTLSVerify?: boolean;
}
| {
/** @visibility frontend */
type: 'config';
clusters: Array<{
/** @visibility frontend */
url: string;
/** @visibility frontend */
name: string;
/** @visibility secret */
serviceAccountToken?: string;
/** @visibility frontend */
authProvider: 'aws' | 'google' | 'serviceAccount';
/** @visibility frontend */
skipTLSVerify?: boolean;
}>;
}
>;
customResources?: Array<{
group: string;
apiVersion: string;
plural: string;
}>;
};
}
@@ -19,50 +19,6 @@ import type {
KubernetesFetchError,
} from '@backstage/plugin-kubernetes-common';
export type ClusterLocatorMethod =
| ConfigClusterLocatorMethod
| GKEClusterLocatorMethod;
export interface ConfigClusterLocatorMethod {
/**
* @visibility frontend
*/
type: 'config';
clusters: {
/**
* @visibility frontend
*/
url: string;
/**
* @visibility frontend
*/
name: string;
/**
* @visibility secret
*/
serviceAccountToken: string | undefined;
/**
* @visibility frontend
*/
authProvider: 'aws' | 'google' | 'serviceAccount';
}[];
}
export interface GKEClusterLocatorMethod {
/**
* @visibility frontend
*/
type: 'gke';
/**
* @visibility frontend
*/
projectId: string;
/**
* @visibility frontend
*/
region?: string;
}
export interface CustomResource {
group: string;
apiVersion: string;