Fixed formatting issues
Signed-off-by: Mani Marothu <manikumar.1215@gmail.com>
This commit is contained in:
parent
b438ea8358
commit
9c8aaefadd
1 changed files with 11 additions and 10 deletions
|
@ -11,10 +11,10 @@ import fs from 'fs-extra';
|
|||
interface Cluster {
|
||||
name: string;
|
||||
cluster: {
|
||||
"server": string;
|
||||
"insecure-skip-tls-verify": boolean;
|
||||
"certificate-authority-data"?: string;
|
||||
"certificate-authority"?: string;
|
||||
server: string;
|
||||
'insecure-skip-tls-verify': boolean;
|
||||
'certificate-authority-data'?: string;
|
||||
'certificate-authority'?: string;
|
||||
};
|
||||
}
|
||||
interface Context {
|
||||
|
@ -150,7 +150,7 @@ export const createKubernetesApply = (config: Config) => {
|
|||
},
|
||||
},
|
||||
],
|
||||
}
|
||||
};
|
||||
if (!confFile.clusters[0].cluster['insecure-skip-tls-verify']) {
|
||||
let caDataRaw = targetCluster.getOptionalString('caData');
|
||||
if (caDataRaw?.startsWith('-----BEGIN CERTIFICATE-----')) {
|
||||
|
@ -158,13 +158,14 @@ export const createKubernetesApply = (config: Config) => {
|
|||
targetCluster.getString('caData'),
|
||||
'utf8',
|
||||
).toString('base64');
|
||||
};
|
||||
}
|
||||
confFile.clusters[0].cluster['certificate-authority-data'] =
|
||||
caDataRaw;
|
||||
if (
|
||||
(
|
||||
targetCluster.getOptionalString('caFile') &&
|
||||
!(targetCluster.getOptionalString('caFile')?.length === 0 || targetCluster.getOptionalString('caFile') === null)
|
||||
targetCluster.getOptionalString('caFile') &&
|
||||
!(
|
||||
targetCluster.getOptionalString('caFile')?.length === 0 ||
|
||||
targetCluster.getOptionalString('caFile') === null
|
||||
)
|
||||
) {
|
||||
confFile.clusters[0].cluster['certificate-authority'] =
|
||||
|
@ -230,4 +231,4 @@ function getClusterConfig(name: string, config: Config): Config {
|
|||
throw new Error(`Cluster with name ${name} not found`);
|
||||
}
|
||||
return clusters[0];
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue