Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Identity] We had an extra type issue that slipped through our last PR #18103

Merged
merged 4 commits into from
Oct 11, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.js
*.js.map
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ const argv = yargs
.help()
.alias("help", "h").argv;

async function runCommand(command: string[], exitOnError = true): Promise<unknown> {
function runCommand(command: string[], exitOnError = true): string | null {
console.log("Running command:", command);
try {
if (argv.verbose) {
console.log(command);
Expand All @@ -61,11 +62,12 @@ async function runCommand(command: string[], exitOnError = true): Promise<unknow
}
return child;
} catch (e) {
console.log("Error: " + e);
if (exitOnError) {
console.log("Error: " + e);
process.exit(1);
}
return e;
return null;
}
}

Expand All @@ -85,18 +87,22 @@ async function main(): Promise<void> {
`image.repository=${argv.repository},image.name=${argv["image-name"]},image.tag=${argv["image-tag"]}`
];

await runCommand(helm_install);
runCommand(helm_install);

// get the name of the test pod
let podName = await runCommand([
let podName = runCommand([
"kubectl",
"get",
"pods",
"--selector=job-name=" + JOB_NAME,
"--output=jsonpath='{.items[*].metadata.name}'"
]);

if (typeof podName === "string" && podName[0] == "'") {
if (typeof podName !== "string") {
sadasant marked this conversation as resolved.
Show resolved Hide resolved
throw new Error("Missing pod name.");
sadasant marked this conversation as resolved.
Show resolved Hide resolved
}

if (podName[0] == "'") {
podName = podName.slice(1, -1);
}

Expand All @@ -113,7 +119,11 @@ async function main(): Promise<void> {
for (let x = 0; x < 10; ++x) {
// kubectl will return '' when there are no active pods
let active_pods = runCommand(count_active_pods);
logs = await runCommand(["kubectl", "logs", "-f", podName as string], false);
const result = runCommand(["kubectl", "logs", "-f", podName], false);
if (result === null) {
break;
}
logs = result;
if (!active_pods) break;
await sleep(30);
}
Expand Down