Kubernetes use env var based secrets

pull/310/head
Frostebite 2021-12-29 20:52:21 +00:00
parent 06c3e2d4f9
commit 894df467c5
4 changed files with 1 additions and 37 deletions

18
dist/index.js vendored
View File

@ -1946,12 +1946,6 @@ class KubernetesJobSpecFactory {
claimName: pvcName, claimName: pvcName,
}, },
}, },
{
name: 'credentials',
secret: {
secretName,
},
},
], ],
containers: [ containers: [
{ {
@ -1980,11 +1974,6 @@ class KubernetesJobSpecFactory {
name: 'build-mount', name: 'build-mount',
mountPath: `/${mountdir}`, mountPath: `/${mountdir}`,
}, },
{
name: 'credentials',
mountPath: '/credentials',
readOnly: true,
},
], ],
lifecycle: { lifecycle: {
preStop: { preStop: {
@ -2405,17 +2394,10 @@ class CloudRunnerBuildCommandProcessor {
static ProcessCommands(commands, buildParameters) { static ProcessCommands(commands, buildParameters) {
return `echo "---" return `echo "---"
echo "start" echo "start"
${CloudRunnerBuildCommandProcessor.GetSecrets(buildParameters)}
${commands} ${commands}
echo "end--${buildParameters.logId}" echo "end--${buildParameters.logId}"
`; `;
} }
static GetSecrets(buildParameters) {
return buildParameters.cloudRunnerCluster === `k8s`
? `cd /credentials
for f in ; do cat $f | base echo $f; done`
: ``;
}
} }
exports.CloudRunnerBuildCommandProcessor = CloudRunnerBuildCommandProcessor; exports.CloudRunnerBuildCommandProcessor = CloudRunnerBuildCommandProcessor;

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -97,12 +97,6 @@ class KubernetesJobSpecFactory {
claimName: pvcName, claimName: pvcName,
}, },
}, },
{
name: 'credentials',
secret: {
secretName,
},
},
], ],
containers: [ containers: [
{ {
@ -132,11 +126,6 @@ class KubernetesJobSpecFactory {
name: 'build-mount', name: 'build-mount',
mountPath: `/${mountdir}`, mountPath: `/${mountdir}`,
}, },
{
name: 'credentials',
mountPath: '/credentials',
readOnly: true,
},
], ],
lifecycle: { lifecycle: {
preStop: { preStop: {

View File

@ -4,15 +4,8 @@ export class CloudRunnerBuildCommandProcessor {
public static ProcessCommands(commands: string, buildParameters: BuildParameters): string { public static ProcessCommands(commands: string, buildParameters: BuildParameters): string {
return `echo "---" return `echo "---"
echo "start" echo "start"
${CloudRunnerBuildCommandProcessor.GetSecrets(buildParameters)}
${commands} ${commands}
echo "end--${buildParameters.logId}" echo "end--${buildParameters.logId}"
`; `;
} }
static GetSecrets(buildParameters: BuildParameters) {
return buildParameters.cloudRunnerCluster === `k8s`
? `cd /credentials
for f in ; do cat $f | base echo $f; done`
: ``;
}
} }