Skip to content

Commit

Permalink
fix: export missing function createClusterWithLicense
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Mar 13, 2024
1 parent 909ec63 commit cb4b37b
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
15 changes: 8 additions & 7 deletions dist/clusters.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const configuration_1 = require("./configuration");
const _1 = require(".");
const clusters_1 = require("./clusters");
const mockttp = require("mockttp");
describe('ClusterService', () => {
Expand Down Expand Up @@ -32,7 +33,7 @@ describe('ClusterService', () => {
const apiClient = new configuration_1.VendorPortalApi();
apiClient.apiToken = "abcd1234";
apiClient.endpoint = globalThis.provider.mockService.baseUrl;
return (0, clusters_1.createCluster)(apiClient, "cluster1", "kind", "v1.25.1", "10m").then(cluster => {
return (0, _1.createCluster)(apiClient, "cluster1", "kind", "v1.25.1", "10m").then(cluster => {
expect(cluster.name).toEqual(expectedCluster.cluster.name);
expect(cluster.id).toEqual(expectedCluster.cluster.id);
expect(cluster.status).toEqual(expectedCluster.cluster.status);
Expand Down Expand Up @@ -75,7 +76,7 @@ describe('ClusterService with tags', () => {
apiClient.apiToken = "abcd1234";
apiClient.endpoint = globalThis.provider.mockService.baseUrl;
const tags = [{ key: "foo", value: "bar" }];
return (0, clusters_1.createCluster)(apiClient, "cluster1", "kind", "v1.25.1", "10m", undefined, undefined, undefined, undefined, undefined, undefined, tags)
return (0, _1.createCluster)(apiClient, "cluster1", "kind", "v1.25.1", "10m", undefined, undefined, undefined, undefined, undefined, undefined, tags)
.then(cluster => {
expect(cluster.name).toEqual(expectedCluster.cluster.name);
expect(cluster.id).toEqual(expectedCluster.cluster.id);
Expand Down Expand Up @@ -121,7 +122,7 @@ describe('ClusterService with nodegroups', () => {
apiClient.apiToken = "abcd1234";
apiClient.endpoint = globalThis.provider.mockService.baseUrl;
const nodegroups = [{ name: "foo", node_count: 3, instance_type: "r1.medium", disk_gib: 100 }];
return (0, clusters_1.createCluster)(apiClient, "cluster1", "eks", "v1.29", "10m", undefined, undefined, undefined, undefined, undefined, nodegroups)
return (0, _1.createCluster)(apiClient, "cluster1", "eks", "v1.29", "10m", undefined, undefined, undefined, undefined, undefined, nodegroups)
.then(cluster => {
expect(cluster.name).toEqual(expectedCluster.cluster.name);
expect(cluster.id).toEqual(expectedCluster.cluster.id);
Expand Down Expand Up @@ -159,7 +160,7 @@ describe('ClusterService with license_id', () => {
const apiClient = new configuration_1.VendorPortalApi();
apiClient.apiToken = "abcd1234";
apiClient.endpoint = globalThis.provider.mockService.baseUrl;
return (0, clusters_1.createClusterWithLicense)(apiClient, "cluster1", "embedded-cluster", "", "license1", "10m")
return (0, _1.createClusterWithLicense)(apiClient, "cluster1", "embedded-cluster", "", "license1", "10m")
.then(cluster => {
expect(cluster.name).toEqual(expectedCluster.cluster.name);
expect(cluster.id).toEqual(expectedCluster.cluster.id);
Expand All @@ -182,7 +183,7 @@ describe('upgradeCluster', () => {
const expectedUpgradeResponse = {};
await mockServer.forPost("/cluster/1234abcd/upgrade").thenReply(200, JSON.stringify(expectedUpgradeResponse));
await mockServer.forGet("/cluster/1234abcd").thenReply(200, JSON.stringify({ cluster: { id: "1234abcd", status: "upgrading" } }));
const cluster = await (0, clusters_1.upgradeCluster)(apiClient, "1234abcd", "latest");
const cluster = await (0, _1.upgradeCluster)(apiClient, "1234abcd", "latest");
expect(cluster.id).toEqual("1234abcd");
expect(cluster.status).toEqual("upgrading");
});
Expand Down Expand Up @@ -211,7 +212,7 @@ describe('pollForCluster', () => {
await mockServer.forGet(`/cluster/1234abcd`).thenReply(200, JSON.stringify({
cluster: Object.assign(Object.assign({}, responseCluster), { status: "running" }),
}));
const cluster = await (0, clusters_1.pollForStatus)(apiClient, "1234abcd", "running", 1, 10);
const cluster = await (0, _1.pollForStatus)(apiClient, "1234abcd", "running", 1, 10);
expect(cluster).toEqual(expectedCluster);
});
test('should still fail on 404', async () => {
Expand All @@ -223,6 +224,6 @@ describe('pollForCluster', () => {
cluster: Object.assign(Object.assign({}, responseCluster), { status: "provisioning" }),
}));
await mockServer.forGet(`/cluster/${responseCluster.id}`).thenReply(404);
await expect((0, clusters_1.pollForStatus)(apiClient, "1234abcd", "running", 1, 10)).rejects.toThrow(clusters_1.StatusError);
await expect((0, _1.pollForStatus)(apiClient, "1234abcd", "running", 1, 10)).rejects.toThrow(clusters_1.StatusError);
});
});
2 changes: 1 addition & 1 deletion dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export { VendorPortalApi } from './configuration';
export { getApplicationDetails } from './applications';
export { Channel, createChannel, getChannelDetails, archiveChannel } from './channels';
export { ClusterVersion, createCluster, pollForStatus, getKubeconfig, removeCluster, upgradeCluster, getClusterVersions } from './clusters';
export { ClusterVersion, createCluster, createClusterWithLicense, pollForStatus, getKubeconfig, removeCluster, upgradeCluster, getClusterVersions } from './clusters';
export { KubernetesDistribution, archiveCustomer, createCustomer, getUsedKubernetesDistributions } from './customers';
export { Release, CompatibilityResult, createRelease, createReleaseFromChart, promoteRelease, reportCompatibilityResult } from './releases';
3 changes: 2 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "replicated-lib",
"version": "0.0.1-beta.11",
"version": "0.0.1-beta.12",
"description": "Can interact with the vendor portal api!",
"scripts": {
"build": "rm -rf dist && tsc --build",
Expand Down
3 changes: 2 additions & 1 deletion src/clusters.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { VendorPortalApi } from "./configuration";
import { Cluster, StatusError, createCluster, upgradeCluster, pollForStatus, createClusterWithLicense } from "./clusters";
import { createCluster, createClusterWithLicense, upgradeCluster, pollForStatus } from ".";
import { Cluster, StatusError } from "./clusters";
import * as mockttp from 'mockttp';

describe('ClusterService', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export {VendorPortalApi} from './configuration'
export {getApplicationDetails} from './applications'
export {Channel, createChannel, getChannelDetails, archiveChannel} from './channels'
export {ClusterVersion, createCluster, pollForStatus, getKubeconfig, removeCluster, upgradeCluster, getClusterVersions} from './clusters'
export {ClusterVersion, createCluster, createClusterWithLicense, pollForStatus, getKubeconfig, removeCluster, upgradeCluster, getClusterVersions} from './clusters'
export {KubernetesDistribution, archiveCustomer, createCustomer, getUsedKubernetesDistributions} from './customers'
export {Release, CompatibilityResult, createRelease, createReleaseFromChart, promoteRelease, reportCompatibilityResult} from './releases'

0 comments on commit cb4b37b

Please sign in to comment.