mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-30 17:23:29 -05:00
Add support for low-privileged user to run spark notebooks (#12883)
* Add support for low-privileged user to run spark notebooks * error * fix test
This commit is contained in:
@@ -173,14 +173,14 @@ export class ClusterController implements IClusterController {
|
||||
}
|
||||
}
|
||||
|
||||
public async getKnoxUsername(sqlLogin: string): Promise<string> {
|
||||
public async getKnoxUsername(defaultUsername: string): Promise<string> {
|
||||
// This all is necessary because prior to CU5 BDC deployments all had the same default username for
|
||||
// accessing the Knox gateway. But in the allowRunAsRoot setting was added and defaulted to false - so
|
||||
// if that exists and is false then we use the username instead.
|
||||
// Note that the SQL username may not necessarily be correct here either - but currently this is what
|
||||
// we're requiring to run Notebooks in a BDC
|
||||
const config = await this.getClusterConfig();
|
||||
return config.spec?.spec?.security?.allowRunAsRoot === false ? sqlLogin : DEFAULT_KNOX_USERNAME;
|
||||
return config.spec?.spec?.security?.allowRunAsRoot === false ? defaultUsername : DEFAULT_KNOX_USERNAME;
|
||||
}
|
||||
|
||||
public async getClusterConfig(promptConnect: boolean = false): Promise<any> {
|
||||
|
||||
Reference in New Issue
Block a user