File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -64,9 +64,15 @@ namespace SourcePlusPlus {
6464
6565 probeConfig . skywalking . collector . backend_service = getConfigValueString ( "SW_COLLECTOR_BACKEND_SERVICE" ,
6666 probeConfig . skywalking . collector . backend_service , `${ probeConfig . spp . host } :${ probeConfig . spp . grpc_port } ` ) ;
67- probeConfig . skywalking . agent . authentication = probeConfig . spp . authentication . tenant_id ?
68- `${ probeConfig . spp . authentication . client_id } :${ probeConfig . spp . authentication . client_secret } :${ probeConfig . spp . authentication . tenant_id } `
69- : `${ probeConfig . spp . authentication . client_id } :${ probeConfig . spp . authentication . client_secret } ` ;
67+
68+ let authTenantId = probeConfig . spp ?. authentication ?. tenant_id ;
69+ let authClientId = probeConfig . spp ?. authentication ?. client_id ;
70+ let authClientSecret = probeConfig . spp ?. authentication ?. client_secret ;
71+ if ( authTenantId && authClientId && authClientSecret ) {
72+ probeConfig . skywalking . agent . authentication = `${ authClientId } :${ authClientSecret } :${ authTenantId } ` ;
73+ } else if ( authClientId && authClientSecret ) {
74+ probeConfig . skywalking . agent . authentication = `${ authClientId } :${ authClientSecret } ` ;
75+ }
7076
7177 // Copy given config
7278 Object . assign ( probeConfig , config ) ;
You can’t perform that action at this time.
0 commit comments