Skip to content

Commit

Permalink
[Identity] Fixing types on the Kubernetes manual test (#17910)
Browse files Browse the repository at this point in the history
* [Identity] Fixing types on the Kubernetes manual test

* string | unknown -> unknown

* awaiting L88
  • Loading branch information
sadasant authored Oct 1, 2021
1 parent 0456250 commit 0815972
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "tsc -p ."
},
"author": "",
"license": "ISC",
Expand All @@ -13,5 +14,8 @@
"@types/yargs": "15.0.3",
"@azure/identity": "2.0.0-beta.6",
"@azure/keyvault-secrets": "^4.0.2"
},
"devDependencies": {
"typescript": "^4.4.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const argv = yargs
.help()
.alias("help", "h").argv;

async function runCommand(command: string[], exitOnError = true) {
async function runCommand(command: string[], exitOnError = true): Promise<unknown> {
try {
if (argv.verbose) {
console.log(command);
Expand Down Expand Up @@ -85,7 +85,7 @@ async function main(): Promise<void> {
`image.repository=${argv.repository},image.name=${argv["image-name"]},image.tag=${argv["image-tag"]}`
];

runCommand(helm_install);
await runCommand(helm_install);

// get the name of the test pod
let podName = await runCommand([
Expand All @@ -96,7 +96,7 @@ async function main(): Promise<void> {
"--output=jsonpath='{.items[*].metadata.name}'"
]);

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

Expand All @@ -113,7 +113,7 @@ 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], false);
logs = await runCommand(["kubectl", "logs", "-f", podName as string], false);
if (!active_pods) break;
await sleep(30);
}
Expand Down

0 comments on commit 0815972

Please sign in to comment.