I just took a quick peek into how Api URL overwriting is implemented here, in context of admission controller, and based on the code I see it won't work.
There is const with default URL defined (pointing to dev instance):
The problem is (and the fact that it works now well, querying production Monokle Cloud) is that it is not propagated, and extension uses default synchronizer:
To fix this, remoteUrl getter should just return overwrites:
get remotePolicyUrl() {
return process.env.MONOKLE_TEST_SERVER_URL ?? this.overwriteRemotePolicyUrl;
}
and pass a result to synchronizer initialization (to ApiHandler instance) - if empty string is passed it will still use default production API, if overwrite (or test env var) is used it will use this new URL.
I just took a quick peek into how Api URL overwriting is implemented here, in context of admission controller, and based on the code I see it won't work.
There is const with default URL defined (pointing to dev instance):
https://github.com/kubeshop/vscode-monokle/blob/924c8b68e9b6d31a51cda2924e3509f5ed7d7eb7/src/constants.ts#L9
And then there is global getter using it and overwrite config:
https://github.com/kubeshop/vscode-monokle/blob/924c8b68e9b6d31a51cda2924e3509f5ed7d7eb7/src/utils/globals.ts#L30-L32
The problem is (and the fact that it works now well, querying production Monokle Cloud) is that it is not propagated, and extension uses default synchronizer:
https://github.com/kubeshop/vscode-monokle/blob/924c8b68e9b6d31a51cda2924e3509f5ed7d7eb7/src/utils/synchronization.ts#L24-L25
Which in turn has it's own defaults (pointing to production instance), through ApiHandler util:
To fix this,
remoteUrl
getter should just return overwrites:and pass a result to synchronizer initialization (to ApiHandler instance) - if empty string is passed it will still use default production API, if overwrite (or test env var) is used it will use this new URL.