File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed
Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ export class OneCLI {
2929 /**
3030 * Fetch the raw container configuration from OneCLI.
3131 */
32- getContainerConfig = ( ) : Promise < ContainerConfig > => {
33- return this . containerClient . getContainerConfig ( ) ;
32+ getContainerConfig = ( agent ?: string ) : Promise < ContainerConfig > => {
33+ return this . containerClient . getContainerConfig ( agent ) ;
3434 } ;
3535
3636 /**
Original file line number Diff line number Diff line change @@ -16,8 +16,10 @@ export class ContainerClient {
1616 /**
1717 * Fetch the raw container configuration from OneCLI.
1818 */
19- getContainerConfig = async ( ) : Promise < ContainerConfig > => {
20- const url = `${ this . baseUrl } /api/container-config` ;
19+ getContainerConfig = async ( agent ?: string ) : Promise < ContainerConfig > => {
20+ const url = agent
21+ ? `${ this . baseUrl } /api/container-config?agent=${ encodeURIComponent ( agent ) } `
22+ : `${ this . baseUrl } /api/container-config` ;
2123
2224 try {
2325 const headers : Record < string , string > = { } ;
@@ -60,11 +62,12 @@ export class ContainerClient {
6062 args : string [ ] ,
6163 options ?: ApplyContainerConfigOptions ,
6264 ) : Promise < boolean > => {
63- const { combineCaBundle = true , addHostMapping = true } = options ?? { } ;
65+ const { combineCaBundle = true , addHostMapping = true , agent } =
66+ options ?? { } ;
6467
6568 let config : ContainerConfig ;
6669 try {
67- config = await this . getContainerConfig ( ) ;
70+ config = await this . getContainerConfig ( agent ) ;
6871 } catch {
6972 return false ;
7073 }
Original file line number Diff line number Diff line change @@ -18,4 +18,9 @@ export interface ApplyContainerConfigOptions {
1818 * @default true
1919 */
2020 addHostMapping ?: boolean ;
21+
22+ /**
23+ * Agent identifier to fetch config for. Uses the default agent if omitted.
24+ */
25+ agent ?: string ;
2126}
You can’t perform that action at this time.
0 commit comments