Skip to content

Commit 8d64048

Browse files
authored
Merge pull request #229 from OWASP/small-fix
fix(#noticket): balancer query now continues when contianer is not yet found
2 parents 6e9a5c6 + dba43b7 commit 8d64048

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

wrongsecrets-balancer/src/kubernetes.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,8 @@ const deleteDesktopPodForTeam = async (team) => {
12981298
};
12991299
module.exports.deleteDesktopPodForTeam = deleteDesktopPodForTeam;
13001300

1301-
const getJuiceShopInstanceForTeamname = (teamname) =>
1301+
const getJuiceShopInstanceForTeamname = (teamname) => {
1302+
logger.info('checking readiness');
13021303
k8sAppsApi
13031304
.readNamespacedDeployment(`t-${teamname}-wrongsecrets`, `t-${teamname}`)
13041305
.then((res) => {
@@ -1309,8 +1310,12 @@ const getJuiceShopInstanceForTeamname = (teamname) =>
13091310
};
13101311
})
13111312
.catch((error) => {
1313+
if (error.response.body.message.contains('No such container')) {
1314+
return;
1315+
}
13121316
throw new Error(error.response.body.message);
13131317
});
1318+
};
13141319
module.exports.getJuiceShopInstanceForTeamname = getJuiceShopInstanceForTeamname;
13151320

13161321
const updateLastRequestTimestampForTeam = (teamname) => {

0 commit comments

Comments
 (0)