mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Allow KubeApi connect directly to remote k8s (#3766)
* allow KubeApi to connect directly to remote k8s Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * backward compat Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> * backward compat Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
1 parent
7bd0fed997
commit
3262b13926
4 files changed
+93
-5
No files matched your search
@@ -19,10 +19,36 @@
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import { KubeApi } from "../kube-api";
|
||||
import { Pod } from "../endpoints/pods.api";
|
||||
import { forRemoteCluster, KubeApi } from "../kube-api";
|
||||
import { KubeJsonApi } from "../kube-json-api";
|
||||
import { KubeObject } from "../kube-object";
|
||||
|
||||
describe("forRemoteCluster", () => {
|
||||
it("builds api client", async (done) => {
|
||||
const api = forRemoteCluster({
|
||||
cluster: {
|
||||
server: "https://127.0.0.1:6443"
|
||||
},
|
||||
user: {
|
||||
token: "daa"
|
||||
}
|
||||
}, Pod);
|
||||
|
||||
(fetch as any).mockResponse(async (request: any) => {
|
||||
expect(request.url).toEqual("https://127.0.0.1:6443/api/v1/pods");
|
||||
|
||||
done();
|
||||
|
||||
return {
|
||||
body: ""
|
||||
};
|
||||
});
|
||||
|
||||
await api.list();
|
||||
});
|
||||
});
|
||||
|
||||
describe("KubeApi", () => {
|
||||
let request: KubeJsonApi;
|
||||
|
||||
|
||||
Reference in new issue
Block a user