Merge pull request #7555 from dirathea/plugins-k8s-caData-support

Plugins k8s ca data support
This commit is contained in:
Ben Lambert
2021-10-21 11:35:30 +02:00
committed by GitHub
9 changed files with 38 additions and 0 deletions
+2
View File
@@ -27,6 +27,8 @@ export interface AWSClusterDetails extends ClusterDetails {
export interface ClusterDetails {
// (undocumented)
authProvider: string;
// (undocumented)
caData?: string | undefined;
dashboardApp?: string;
dashboardUrl?: string;
name: string;
@@ -53,6 +53,7 @@ describe('ConfigClusterLocator', () => {
url: 'http://localhost:8080',
authProvider: 'serviceAccount',
skipTLSVerify: false,
caData: undefined,
},
]);
});
@@ -89,6 +90,7 @@ describe('ConfigClusterLocator', () => {
url: 'http://localhost:8080',
authProvider: 'serviceAccount',
skipTLSVerify: false,
caData: undefined,
},
{
name: 'cluster2',
@@ -96,6 +98,7 @@ describe('ConfigClusterLocator', () => {
url: 'http://localhost:8081',
authProvider: 'google',
skipTLSVerify: true,
caData: undefined,
},
]);
});
@@ -141,6 +144,7 @@ describe('ConfigClusterLocator', () => {
url: 'http://localhost:8080',
authProvider: 'aws',
skipTLSVerify: false,
caData: undefined,
},
{
assumeRole: 'SomeRole',
@@ -150,6 +154,7 @@ describe('ConfigClusterLocator', () => {
url: 'http://localhost:8081',
authProvider: 'aws',
skipTLSVerify: true,
caData: undefined,
},
{
assumeRole: 'SomeRole',
@@ -159,6 +164,7 @@ describe('ConfigClusterLocator', () => {
serviceAccountToken: undefined,
authProvider: 'aws',
skipTLSVerify: true,
caData: undefined,
},
]);
});
@@ -35,6 +35,7 @@ export class ConfigClusterLocator implements KubernetesClustersSupplier {
url: c.getString('url'),
serviceAccountToken: c.getOptionalString('serviceAccountToken'),
skipTLSVerify: c.getOptionalBoolean('skipTLSVerify') ?? false,
caData: c.getOptionalString('caData'),
authProvider: authProvider,
};
const dashboardUrl = c.getOptionalString('dashboardUrl');
@@ -50,6 +50,7 @@ export class GkeClusterLocator implements KubernetesClustersSupplier {
);
}
// TODO pass caData into the object
async getClusters(): Promise<GKEClusterDetails[]> {
const { projectId, region, skipTLSVerify } = this.options;
const request = {
@@ -54,6 +54,7 @@ describe('getCombinedClusterDetails', () => {
url: 'http://localhost:8080',
authProvider: 'serviceAccount',
skipTLSVerify: false,
caData: undefined,
},
{
name: 'cluster2',
@@ -61,6 +62,7 @@ describe('getCombinedClusterDetails', () => {
url: 'http://localhost:8081',
authProvider: 'google',
skipTLSVerify: false,
caData: undefined,
},
]);
});
@@ -31,6 +31,7 @@ export class KubernetesClientProvider {
name: clusterDetails.name,
server: clusterDetails.url,
skipTLSVerify: clusterDetails.skipTLSVerify,
caData: clusterDetails.caData,
};
// TODO configure
@@ -91,6 +91,7 @@ export interface ClusterDetails {
authProvider: string;
serviceAccountToken?: string | undefined;
skipTLSVerify?: boolean;
caData?: string | undefined;
/**
* Specifies the link to the Kubernetes dashboard managing this cluster.
* @remarks