Add caData support for kubernetes config

Signed-off-by: Aldira Putra Raharja <dira.thea@gmail.com>
This commit is contained in:
Aldira Putra Raharja
2021-10-11 21:51:01 +07:00
parent 89bcf90b66
commit bb8cea4a75
5 changed files with 11 additions and 0 deletions
@@ -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');
@@ -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
@@ -88,6 +88,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