@@ -157,12 +157,12 @@ const getJuiceShopInstanceForTeamname = async (teamname) => {
157
157
( ) => k8sAppsApi . readNamespacedDeployment ( { name : deploymentName , namespace : namespace } ) ,
158
158
`Check deployment for team ${ teamname } `
159
159
) ;
160
- if ( ! res || ! res . body ) {
160
+ if ( ! res ) {
161
161
logger . info ( `No deployment found for team ${ teamname } ` ) ;
162
162
return undefined ;
163
163
}
164
164
165
- const deployment = res . body ;
165
+ const deployment = res ;
166
166
167
167
if (
168
168
Object . prototype . hasOwnProperty . call ( deployment , 'metadata' ) &&
@@ -199,7 +199,7 @@ const createConfigmapForTeam = async (team) => {
199
199
} ,
200
200
} ;
201
201
return k8sCoreApi . createNamespacedConfigMap ( { namespace : 't-' + team , body : configmap } ) . catch ( ( error ) => {
202
- throw new Error ( error . response . body . message ) ;
202
+ throw new Error ( error . response . message ) ;
203
203
} ) ;
204
204
} ;
205
205
@@ -217,7 +217,7 @@ const createSecretsfileForTeam = async (team) => {
217
217
} ,
218
218
} ;
219
219
return k8sCoreApi . createNamespacedSecret ( { namespace : 't-' + team , body : secret } ) . catch ( ( error ) => {
220
- throw new Error ( error . response . body . message ) ;
220
+ throw new Error ( error . response . message ) ;
221
221
} ) ;
222
222
} ;
223
223
@@ -239,7 +239,7 @@ const createChallenge33SecretForTeam = async (team) => {
239
239
} ,
240
240
} ;
241
241
return k8sCoreApi . createNamespacedSecret ( { namespace : 't-' + team , body : secret } ) . catch ( ( error ) => {
242
- throw new Error ( error . response . body . message ) ;
242
+ throw new Error ( error . response . message ) ;
243
243
} ) ;
244
244
} ;
245
245
@@ -314,7 +314,7 @@ const getSealedSecretsPublicKey = async () => {
314
314
{ name : 'sealed-secrets-key' ,
315
315
namespace : 'kube-system' }
316
316
) ;
317
- return response . body . data [ 'tls.crt' ] ;
317
+ return response . data [ 'tls.crt' ] ;
318
318
} catch ( error ) {
319
319
logger . error ( 'Failed to get Sealed Secrets public key:' , error . body || error ) ;
320
320
throw new Error ( `Failed to get public key: ${ error . message } ` ) ;
@@ -1862,7 +1862,7 @@ const deleteNamespaceForTeam = async (team) => {
1862
1862
const deletePodForTeam = async ( team ) => {
1863
1863
const res = await k8sCoreApi . listNamespacedPod ( { namespace : `t-${ team } ` , pretty : true , allowWatchBookmarks : true , _continue : undefined , fieldSelector : undefined , labelSelector : `app=wrongsecrets,team=${ team } ,deployment-context=${ get ( 'deploymentContext' ) } ` } ) ;
1864
1864
1865
- const pods = res . body . items ;
1865
+ const pods = res . items ;
1866
1866
1867
1867
if ( pods . length !== 1 ) {
1868
1868
throw new Error ( `Unexpected number of pods ${ pods . length } ` ) ;
@@ -1876,7 +1876,7 @@ const deletePodForTeam = async (team) => {
1876
1876
const deleteDesktopPodForTeam = async ( team ) => {
1877
1877
const res = await k8sCoreApi . listNamespacedPod ( { namespace : `t-${ team } ` , pretty : true , allowWatchBookmarks : true , _continue : undefined , fieldSelector : undefined , labelSelector : `app=virtualdesktop,team=${ team } ,deployment-context=${ get ( 'deploymentContext' ) } ` } ) ;
1878
1878
1879
- const pods = res . body . items ;
1879
+ const pods = res . items ;
1880
1880
1881
1881
if ( pods . length !== 1 ) {
1882
1882
throw new Error ( `Unexpected number of pods ${ pods . length } ` ) ;
0 commit comments