@@ -379,7 +379,7 @@ const createK8sChallenge53DeploymentForTeam = async ({ team, passcodeHash }) =>
379
379
apiVersion : 'apps/v1' ,
380
380
kind : 'Deployment' ,
381
381
metadata : {
382
- name : ' secret-challenge-53' ,
382
+ name : `t- ${ team } - secret-challenge-53` ,
383
383
namespace : `t-${ team } ` ,
384
384
labels : {
385
385
app : 'secret-challenge-53' ,
@@ -485,10 +485,11 @@ const createK8sChallenge53DeploymentForTeam = async ({ team, passcodeHash }) =>
485
485
486
486
try {
487
487
logger . info ( `Deploying Challenge 53 to namespace t-${ team } ` ) ;
488
- const response = await k8sAppsApi . createNamespacedDeployment (
489
- `t-${ team } ` ,
490
- deploymentChallenge53Config
491
- ) ;
488
+ const response = await k8sAppsApi . createNamespacedDeployment ( {
489
+ namespace : `t-${ team } ` ,
490
+ body : deploymentChallenge53Config ,
491
+ } ) ;
492
+
492
493
logger . info ( `Successfully created Challenge 53 deployment for team ${ team } ` ) ;
493
494
return response ;
494
495
} catch ( error ) {
@@ -503,13 +504,13 @@ const getChallenge53InstanceForTeam = async (team) => {
503
504
504
505
try {
505
506
const validatedTeamName = validateTeamName ( team ) ;
506
- const deploymentName = ' secret-challenge-53' ;
507
+ const deploymentName = `t- ${ validatedTeamName } - secret-challenge-53` ;
507
508
const namespace = `t-${ validatedTeamName } ` ;
508
509
509
510
logger . info ( `Checking Challenge 53 deployment ${ deploymentName } in namespace ${ namespace } ` ) ;
510
511
511
512
const res = await safeApiCall (
512
- ( ) => k8sAppsApi . readNamespacedDeployment ( deploymentName , namespace ) ,
513
+ ( ) => k8sAppsApi . readNamespacedDeployment ( { name : deploymentName , namespace : namespace } ) ,
513
514
`Check Challenge 53 deployment for team ${ team } `
514
515
) ;
515
516
@@ -540,7 +541,9 @@ const deleteChallenge53DeploymentForTeam = async (team) => {
540
541
logger . info ( `Deleting Challenge 53 deployment for team ${ team } ` ) ;
541
542
542
543
try {
543
- await k8sAppsApi . deleteNamespacedDeployment ( 'secret-challenge-53' , `t-${ team } ` ) ;
544
+ const validatedTeamName = validateTeamName ( team ) ;
545
+ const deploymentName = `t-${ validatedTeamName } -secret-challenge-53` ;
546
+ await k8sAppsApi . deleteNamespacedDeployment ( { name : deploymentName , namespace : `t-${ team } ` } ) ;
544
547
logger . info ( `Successfully deleted Challenge 53 deployment for team ${ team } ` ) ;
545
548
} catch ( error ) {
546
549
if ( error . statusCode === 404 ) {
@@ -2055,7 +2058,7 @@ const getJuiceShopInstances = () => {
2055
2058
allowWatchBookmarks : true ,
2056
2059
_continue : undefined ,
2057
2060
fieldSelector : undefined ,
2058
- labelSelector : 'app in (wrongsecrets, virtualdesktop)' ,
2061
+ labelSelector : 'app in (wrongsecrets, virtualdesktop, secret-challenge-53 )' ,
2059
2062
limit : 200 ,
2060
2063
} )
2061
2064
. catch ( ( error ) => {
0 commit comments