use caFile
Signed-off-by: Jesse Sanford <108698+jessesanford@users.noreply.github.com>
This commit is contained in:
parent
d627de14bc
commit
af1d23bc98
1 changed files with 22 additions and 10 deletions
|
@ -100,7 +100,7 @@ export const createKubernetesApply = (config: Config) => {
|
|||
{
|
||||
name: ctx.input.clusterName,
|
||||
cluster: {
|
||||
'certificate-authority-data': targetCluster.getOptionalString('caData'),
|
||||
'certificate-authority': targetCluster.getOptionalString('caFile'),
|
||||
server: targetCluster.getString('url'),
|
||||
'insecure-skip-tls-verify': !!targetCluster.getOptionalBoolean('skipTLSVerify'),
|
||||
},
|
||||
|
@ -116,15 +116,15 @@ export const createKubernetesApply = (config: Config) => {
|
|||
],
|
||||
};
|
||||
|
||||
if (!confFile.clusters[0].cluster["insecure-skip-tls-verify"]) {
|
||||
let caDataRaw = targetCluster.getOptionalString('caData')
|
||||
if (caDataRaw?.startsWith('-----BEGIN CERTIFICATE-----')) {
|
||||
caDataRaw = Buffer.from(targetCluster.getString('caData'), 'utf8').toString(
|
||||
'base64',
|
||||
);
|
||||
}
|
||||
confFile.clusters[0].cluster['certificate-authority-data'] = caDataRaw
|
||||
}
|
||||
//if (!confFile.clusters[0].cluster["insecure-skip-tls-verify"]) {
|
||||
// let caDataRaw = targetCluster.getOptionalString('caData')
|
||||
// if (caDataRaw?.startsWith('-----BEGIN CERTIFICATE-----')) {
|
||||
// caDataRaw = Buffer.from(targetCluster.getString('caData'), 'utf8').toString(
|
||||
// 'base64',
|
||||
// );
|
||||
// }
|
||||
// confFile.clusters[0].cluster['certificate-authority-data'] = caDataRaw
|
||||
//}
|
||||
|
||||
const confString = dumpYaml(confFile);
|
||||
const confFilePath = resolveSafeChildPath(ctx.workspacePath, 'config');
|
||||
|
@ -132,6 +132,18 @@ export const createKubernetesApply = (config: Config) => {
|
|||
encoding: 'utf8',
|
||||
mode: '600',
|
||||
});
|
||||
|
||||
await executeShellCommand({
|
||||
command: 'cat',
|
||||
args: [confFilePath],
|
||||
logStream: ctx.logStream,
|
||||
});
|
||||
|
||||
await executeShellCommand({
|
||||
command: 'cat',
|
||||
args: [manifestPath],
|
||||
logStream: ctx.logStream,
|
||||
});
|
||||
|
||||
if (obj.metadata.generateName !== undefined) {
|
||||
await executeShellCommand({
|
||||
|
|
Loading…
Reference in a new issue