Merge pull request #97 from crazy-max/fix-get-buildkit-version
Some checks failed
ci / main () (push) Has been cancelled
ci / main (latest) (push) Has been cancelled
ci / main (v0.4.1) (push) Has been cancelled
ci / multi (push) Has been cancelled
ci / error (push) Has been cancelled
ci / debug (push) Has been cancelled
ci / install (push) Has been cancelled
ci / use (false) (push) Has been cancelled
ci / use (true) (push) Has been cancelled
ci / driver (image=moby/buildkit:latest) (push) Has been cancelled
ci / driver (image=moby/buildkit:master
network=host
) (push) Has been cancelled
ci / docker-driver (push) Has been cancelled
ci / endpoint (push) Has been cancelled
ci / config (push) Has been cancelled
ci / with-qemu (, all) (push) Has been cancelled
ci / with-qemu (, arm64,riscv64,arm) (push) Has been cancelled
ci / with-qemu (latest, all) (push) Has been cancelled
ci / with-qemu (latest, arm64,riscv64,arm) (push) Has been cancelled
ci / with-qemu (v0.4.1, all) (push) Has been cancelled
ci / with-qemu (v0.4.1, arm64,riscv64,arm) (push) Has been cancelled
Some checks failed
ci / main () (push) Has been cancelled
ci / main (latest) (push) Has been cancelled
ci / main (v0.4.1) (push) Has been cancelled
ci / multi (push) Has been cancelled
ci / error (push) Has been cancelled
ci / debug (push) Has been cancelled
ci / install (push) Has been cancelled
ci / use (false) (push) Has been cancelled
ci / use (true) (push) Has been cancelled
ci / driver (image=moby/buildkit:latest) (push) Has been cancelled
ci / driver (image=moby/buildkit:master
network=host
) (push) Has been cancelled
ci / docker-driver (push) Has been cancelled
ci / endpoint (push) Has been cancelled
ci / config (push) Has been cancelled
ci / with-qemu (, all) (push) Has been cancelled
ci / with-qemu (, arm64,riscv64,arm) (push) Has been cancelled
ci / with-qemu (latest, all) (push) Has been cancelled
ci / with-qemu (latest, arm64,riscv64,arm) (push) Has been cancelled
ci / with-qemu (v0.4.1, all) (push) Has been cancelled
ci / with-qemu (v0.4.1, arm64,riscv64,arm) (push) Has been cancelled
Fix `docker: invalid reference format`
This commit is contained in:
@@ -23,7 +23,7 @@ describe('getVersion', () => {
|
||||
silent: true
|
||||
})
|
||||
.then(res => {
|
||||
return !res.stdout.includes(' ') && res.exitCode == 0;
|
||||
return !res.stdout.trim().includes(' ') && res.exitCode == 0;
|
||||
});
|
||||
}
|
||||
(isDaemonRunning() ? it : it.skip)(
|
||||
@@ -55,7 +55,7 @@ describe('inspect', () => {
|
||||
silent: true
|
||||
})
|
||||
.then(res => {
|
||||
return !res.stdout.includes(' ') && res.exitCode == 0;
|
||||
return !res.stdout.trim().includes(' ') && res.exitCode == 0;
|
||||
});
|
||||
}
|
||||
(isDaemonRunning() ? it : it.skip)(
|
||||
|
10
dist/index.js
generated
vendored
10
dist/index.js
generated
vendored
@@ -72,7 +72,7 @@ function getVersion() {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
throw new Error(res.stderr.trim());
|
||||
}
|
||||
return parseVersion(res.stdout);
|
||||
return parseVersion(res.stdout.trim());
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -227,24 +227,24 @@ function getBuildKitVersion(containerID) {
|
||||
.then(bkitimage => {
|
||||
if (bkitimage.exitCode == 0 && bkitimage.stdout.length > 0) {
|
||||
return exec
|
||||
.getExecOutput(`docker`, ['run', '--rm', bkitimage.stdout, '--version'], {
|
||||
.getExecOutput(`docker`, ['run', '--rm', bkitimage.stdout.trim(), '--version'], {
|
||||
ignoreReturnCode: true,
|
||||
silent: true
|
||||
})
|
||||
.then(bkitversion => {
|
||||
if (bkitversion.exitCode == 0 && bkitversion.stdout.length > 0) {
|
||||
return `${bkitimage.stdout} => ${bkitversion.stdout}`;
|
||||
return `${bkitimage.stdout.trim()} => ${bkitversion.stdout.trim()}`;
|
||||
}
|
||||
else if (bkitversion.stderr.length > 0) {
|
||||
core.warning(bkitversion.stderr.trim());
|
||||
}
|
||||
return bkitversion.stdout;
|
||||
return bkitversion.stdout.trim();
|
||||
});
|
||||
}
|
||||
else if (bkitimage.stderr.length > 0) {
|
||||
core.warning(bkitimage.stderr.trim());
|
||||
}
|
||||
return bkitimage.stdout;
|
||||
return bkitimage.stdout.trim();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -42,7 +42,7 @@ export async function getVersion(): Promise<string> {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
throw new Error(res.stderr.trim());
|
||||
}
|
||||
return parseVersion(res.stdout);
|
||||
return parseVersion(res.stdout.trim());
|
||||
});
|
||||
}
|
||||
|
||||
@@ -196,21 +196,21 @@ export async function getBuildKitVersion(containerID: string): Promise<string> {
|
||||
.then(bkitimage => {
|
||||
if (bkitimage.exitCode == 0 && bkitimage.stdout.length > 0) {
|
||||
return exec
|
||||
.getExecOutput(`docker`, ['run', '--rm', bkitimage.stdout, '--version'], {
|
||||
.getExecOutput(`docker`, ['run', '--rm', bkitimage.stdout.trim(), '--version'], {
|
||||
ignoreReturnCode: true,
|
||||
silent: true
|
||||
})
|
||||
.then(bkitversion => {
|
||||
if (bkitversion.exitCode == 0 && bkitversion.stdout.length > 0) {
|
||||
return `${bkitimage.stdout} => ${bkitversion.stdout}`;
|
||||
return `${bkitimage.stdout.trim()} => ${bkitversion.stdout.trim()}`;
|
||||
} else if (bkitversion.stderr.length > 0) {
|
||||
core.warning(bkitversion.stderr.trim());
|
||||
}
|
||||
return bkitversion.stdout;
|
||||
return bkitversion.stdout.trim();
|
||||
});
|
||||
} else if (bkitimage.stderr.length > 0) {
|
||||
core.warning(bkitimage.stderr.trim());
|
||||
}
|
||||
return bkitimage.stdout;
|
||||
return bkitimage.stdout.trim();
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user