Fix: set default k8s working directory/build directory

Fix: k8s working directory must be absolute path
pull/273/head
Frostebite 2021-06-19 20:40:38 +01:00
parent a6371af293
commit 267abc7b12
3 changed files with 11 additions and 11 deletions

8
dist/index.js vendored
View File

@ -1475,7 +1475,7 @@ class Kubernetes {
name: 'main', name: 'main',
image, image,
command, command,
workingDir: workingDirectory, workingDir: `/${workingDirectory}`,
resources: { resources: {
requests: { requests: {
memory: this.buildParameters.remoteBuildMemory, memory: this.buildParameters.remoteBuildMemory,
@ -1596,7 +1596,7 @@ class Kubernetes {
git checkout $GITHUB_SHA; git checkout $GITHUB_SHA;
ls ls
echo "end"`, echo "end"`,
], '', '', [], []); ], 'data', 'data', [], []);
}); });
} }
runBuildJob() { runBuildJob() {
@ -1616,7 +1616,7 @@ class Kubernetes {
chmod -R +x /steps chmod -R +x /steps
/entrypoint.sh /entrypoint.sh
`, `,
], '', '', [], []); ], 'data', 'data', [], []);
}); });
} }
watchUntilPodRunning() { watchUntilPodRunning() {
@ -1664,7 +1664,7 @@ class Kubernetes {
} }
if (!didStreamAnyLogs) { if (!didStreamAnyLogs) {
throw new Error(JSON.stringify({ throw new Error(JSON.stringify({
message: 'Failed to stream any logs, listing namespace events', message: 'Failed to stream any logs, listing namespace events, check for an error with the container',
events: (yield this.kubeClient.listNamespacedEvent(this.namespace)).body.items events: (yield this.kubeClient.listNamespacedEvent(this.namespace)).body.items
.filter((x) => { .filter((x) => {
return x.involvedObject.name === this.podName || x.involvedObject.name === this.jobName; return x.involvedObject.name === this.podName || x.involvedObject.name === this.jobName;

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -255,7 +255,7 @@ class Kubernetes implements RemoteBuilderProviderInterface {
name: 'main', name: 'main',
image, image,
command, command,
workingDir: workingDirectory, workingDir: `/${workingDirectory}`,
resources: { resources: {
requests: { requests: {
memory: this.buildParameters.remoteBuildMemory, memory: this.buildParameters.remoteBuildMemory,
@ -387,8 +387,8 @@ class Kubernetes implements RemoteBuilderProviderInterface {
ls ls
echo "end"`, echo "end"`,
], ],
'', 'data',
'', 'data',
[], [],
[], [],
); );
@ -415,8 +415,8 @@ class Kubernetes implements RemoteBuilderProviderInterface {
/entrypoint.sh /entrypoint.sh
`, `,
], ],
'', 'data',
'', 'data',
[], [],
[], [],
); );
@ -470,7 +470,7 @@ class Kubernetes implements RemoteBuilderProviderInterface {
throw new Error( throw new Error(
JSON.stringify( JSON.stringify(
{ {
message: 'Failed to stream any logs, listing namespace events', message: 'Failed to stream any logs, listing namespace events, check for an error with the container',
events: (await this.kubeClient.listNamespacedEvent(this.namespace)).body.items events: (await this.kubeClient.listNamespacedEvent(this.namespace)).body.items
.filter((x) => { .filter((x) => {
return x.involvedObject.name === this.podName || x.involvedObject.name === this.jobName; return x.involvedObject.name === this.podName || x.involvedObject.name === this.jobName;