File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -74,12 +74,12 @@ export class CloudAuth implements Authenticator {
7474 const output = result . stdout . toString ( ) ;
7575 const resultObj = JSON . parse ( output ) ;
7676
77- let tokenPathKey = config [ 'token-key' ] ;
77+ const tokenPathKeyInConfig = config [ 'token-key' ] ;
78+ const expiryPathKeyInConfig = config [ 'expiry-key' ] ;
7879
79- let expiryPathKey = config [ 'expiry-key' ] ;
8080 // Format in file is {<query>}, so slice it out and add '$'
81- tokenPathKey = '$' + tokenPathKey . slice ( 1 , - 1 ) ;
82- expiryPathKey = '$' + expiryPathKey . slice ( 1 , - 1 ) ;
81+ const tokenPathKey = '$' + tokenPathKeyInConfig . slice ( 1 , - 1 ) ;
82+ const expiryPathKey = '$' + expiryPathKeyInConfig . slice ( 1 , - 1 ) ;
8383
8484 config [ 'access-token' ] = jsonpath . query ( resultObj , tokenPathKey ) ;
8585 config . expiry = jsonpath . query ( resultObj , expiryPathKey ) ;
Original file line number Diff line number Diff line change @@ -643,6 +643,7 @@ describe('KubeConfig', () => {
643643 'cmd-path' : 'echo' ,
644644 'cmd-args' : `'${ responseStr } '` ,
645645 'token-key' : '{.token.accessToken}' ,
646+ 'expiry-key' : '{.token.token_expiry}' ,
646647 } ,
647648 } ,
648649 } as User ) ;
@@ -666,6 +667,7 @@ describe('KubeConfig', () => {
666667 'cmd-path' : 'echo' ,
667668 'cmd-args' : `'${ responseStr } '` ,
668669 'token-key' : '{.token.accessToken}' ,
670+ 'expiry-key' : '{.token.token_expiry}' ,
669671 } ,
670672 } ,
671673 } as User ) ;
@@ -689,6 +691,7 @@ describe('KubeConfig', () => {
689691 'cmd-path' : 'echo' ,
690692 'cmd-args' : `'${ responseStr } '` ,
691693 'token-key' : '{.token.accessToken}' ,
694+ 'expiry-key' : '{.token.token_expiry}' ,
692695 } ,
693696 } ,
694697 } as User ) ;
You can’t perform that action at this time.
0 commit comments