Skip to content

Commit

Permalink
Fixes for no leaking resources in k8s (#923)
Browse files Browse the repository at this point in the history
* fix permissions for delete cron

* don't let the network up on test/s fail
  • Loading branch information
pepoviola authored Apr 11, 2023
1 parent 1de1847 commit df85916
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 28 deletions.
30 changes: 4 additions & 26 deletions javascript/packages/orchestrator/src/test-runner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,34 +138,12 @@ export async function run(
console.log(
`\n\n\t${decorators.red("❌ One or more of your test failed...")}`,
);

switch (network.client.providerName) {
case "podman":
case "native":
console.log(`\n\t ${decorators.green("Deleting network")}`);
await network.stop();
break;
case "kubernetes":
if (inCI) {
// keep pods running for 30 mins.
console.log(
`\n\t${decorators.red(
"One or more test failed, we will keep the namespace up for 30 more minutes",
)}`,
);
await network.upsertCronJob(30);
} else {
console.log(`\n\t ${decorators.green("Deleting network")}`);
await network.stop();
}
break;
}
} else {
// All test passed, just remove the network
console.log(`\n\t ${decorators.green("Deleting network")}`);
await network.stop();
}

// All test passed, just remove the network
console.log(`\n\t ${decorators.green("Deleting network")}`);
await network.stop();

// show logs
console.log(
`\n\n\t${decorators.magenta(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ roleRef:
apiGroup: rbac.authorization.k8s.io
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
kind: RoleBinding
metadata:
name: delete-podmonitor-to-sa
subjects:
- kind: ServiceAccount
name: zombie-internal-kubectl
namespace: "{{namespace}}"
roleRef:
kind: ClusterRole
kind: Role
name: delete-podmonitors
apiGroup: rbac.authorization.k8s.io

0 comments on commit df85916

Please sign in to comment.