Skip to content

Commit

Permalink
Merge branch 'main' into nik-remove-version-check-comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wirednkod authored Feb 22, 2023
2 parents a16f91e + 954a251 commit fdd2da8
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion backchannel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"

[dependencies]
axum = { version = "0.3.0", features = ["ws"] }
tokio = { version = "1.23", features = ["full"] }
tokio = { version = "1.24", features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version="0.3", features = ["env-filter"] }
tower = { version = "0.4", features = ["util", "timeout", "load-shed", "limit"] }
Expand Down
11 changes: 11 additions & 0 deletions javascript/packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,17 @@ async function test(
_opts: any,
) {
const opts = program.opts();

let extension = testFile.slice(testFile.lastIndexOf(".") + 1);

if (extension !== "zndsl") {
console.log(
`\n ${decorators.red(
"Error:",
)} File extension is not correct. Extension for tests should be '.zndsl'.\n`,
);
}

process.env.DEBUG = "zombie";
const inCI = process.env.RUN_IN_CONTAINER === "1";
// use `k8s` as default
Expand Down
24 changes: 20 additions & 4 deletions javascript/packages/orchestrator/src/providers/k8s/kubeClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ export class KubeClient extends Client {

async updateResource(
filename: string,
scopeNamespace?: string,
replacements: ReplaceMapping = {},
): Promise<void> {
const filePath = resolve(__dirname, `../../../static-configs/${filename}`);
Expand All @@ -368,8 +369,10 @@ export class KubeClient extends Client {
replacements[replaceKey],
);
}

await this.runCommand(["apply", "-f", "-"], { resourceDef, scoped: false });
const cmd = scopeNamespace
? ["-n", scopeNamespace, "apply", "-f", "-"]
: ["apply", "-f", "-"];
await this.runCommand(cmd, { resourceDef, scoped: false });
}

async copyFileToPod(
Expand Down Expand Up @@ -439,6 +442,15 @@ export class KubeClient extends Client {
}

async destroyNamespace() {
if (this.podMonitorAvailable) {
await this.runCommand(
["delete", "podmonitor", this.namespace, "-n", "monitoring"],
{
scoped: false,
},
);
}

await this.runCommand(["delete", "namespace", this.namespace], {
scoped: false,
});
Expand Down Expand Up @@ -534,13 +546,17 @@ export class KubeClient extends Client {
if (this.podMonitorAvailable) {
const [hr, min] = addMinutes(minutes, now);
let schedule = `${min} ${hr} * * *`;
await this.updateResource("job-delete-podmonitor.yaml", { schedule });
await this.updateResource(
"job-delete-podmonitor.yaml",
this.namespace,
{ schedule },
);
}

minutes += 1;
const [hr, min] = addMinutes(minutes, now);
const nsSchedule = `${min} ${hr} * * *`;
await this.updateResource("job-delete-namespace.yaml", {
await this.updateResource("job-delete-namespace.yaml", this.namespace, {
schedule: nsSchedule,
});
}
Expand Down

0 comments on commit fdd2da8

Please sign in to comment.