Skip to content

Commit d2774b2

Browse files
authored
feat(cmx): cluster port expose wildcards (#56)
* feat(cmx): cluster port expose wildcards * update replicated-lib * Automated commit of npm build result and updated readme files --------- Co-authored-by: emosbaugh <[email protected]>
1 parent 2f01e36 commit d2774b2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+198
-156
lines changed

archive-channel/dist/index.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30587,7 +30587,7 @@ async function removeCluster(vendorPortalApi, clusterId) {
3058730587
const http = await vendorPortalApi.client();
3058830588
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}`;
3058930589
const res = await http.del(uri);
30590-
if (res.message.statusCode != 200) {
30590+
if (res.message.statusCode != 201) {
3059130591
throw new StatusError(`Failed to remove cluster: Server responded with ${res.message.statusCode}`, res.message.statusCode);
3059230592
}
3059330593
// discard the response body
@@ -30772,12 +30772,13 @@ async function getAddonDetails(vendorPortalApi, clusterId, addonId) {
3077230772
}
3077330773
throw new Error(`Add-on with id ${addonId} not found`);
3077430774
}
30775-
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
30775+
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols, isWildcard) {
3077630776
const http = await vendorPortalApi.client();
3077730777
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}/port`;
3077830778
const reqBody = {
3077930779
port: port,
30780-
protocols: protocols
30780+
protocols: protocols,
30781+
is_wildcard: isWildcard
3078130782
};
3078230783
const res = await http.post(uri, JSON.stringify(reqBody));
3078330784
if (res.message.statusCode != 201) {
@@ -30800,9 +30801,11 @@ async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
3080030801
exposedPorts.push(exposedPort);
3080130802
}
3080230803
var portObj = {
30804+
addon_id: body.port.addon_id,
3080330805
upstream_port: body.port.upstream_port,
3080430806
hostname: body.port.hostname,
30805-
exposed_ports: exposedPorts
30807+
exposed_ports: exposedPorts,
30808+
is_wildcard: body.port.is_wildcard
3080630809
};
3080730810
return portObj;
3080830811
}

archive-channel/dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

archive-channel/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

archive-channel/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dependencies": {
1515
"@actions/core": "^1.10.0",
1616
"esbuild-jest": "^0.5.0",
17-
"replicated-lib": "^0.0.1-beta.14",
17+
"replicated-lib": "^0.0.1-beta.15",
1818
"ts-node": "^10.9.1"
1919
},
2020
"devDependencies": {

archive-customer/dist/index.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30586,7 +30586,7 @@ async function removeCluster(vendorPortalApi, clusterId) {
3058630586
const http = await vendorPortalApi.client();
3058730587
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}`;
3058830588
const res = await http.del(uri);
30589-
if (res.message.statusCode != 200) {
30589+
if (res.message.statusCode != 201) {
3059030590
throw new StatusError(`Failed to remove cluster: Server responded with ${res.message.statusCode}`, res.message.statusCode);
3059130591
}
3059230592
// discard the response body
@@ -30771,12 +30771,13 @@ async function getAddonDetails(vendorPortalApi, clusterId, addonId) {
3077130771
}
3077230772
throw new Error(`Add-on with id ${addonId} not found`);
3077330773
}
30774-
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
30774+
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols, isWildcard) {
3077530775
const http = await vendorPortalApi.client();
3077630776
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}/port`;
3077730777
const reqBody = {
3077830778
port: port,
30779-
protocols: protocols
30779+
protocols: protocols,
30780+
is_wildcard: isWildcard
3078030781
};
3078130782
const res = await http.post(uri, JSON.stringify(reqBody));
3078230783
if (res.message.statusCode != 201) {
@@ -30799,9 +30800,11 @@ async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
3079930800
exposedPorts.push(exposedPort);
3080030801
}
3080130802
var portObj = {
30803+
addon_id: body.port.addon_id,
3080230804
upstream_port: body.port.upstream_port,
3080330805
hostname: body.port.hostname,
30804-
exposed_ports: exposedPorts
30806+
exposed_ports: exposedPorts,
30807+
is_wildcard: body.port.is_wildcard
3080530808
};
3080630809
return portObj;
3080730810
}

archive-customer/dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

archive-customer/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

archive-customer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dependencies": {
1515
"@actions/core": "^1.10.0",
1616
"esbuild-jest": "^0.5.0",
17-
"replicated-lib": "^0.0.1-beta.14",
17+
"replicated-lib": "^0.0.1-beta.15",
1818
"ts-node": "^10.9.1"
1919
},
2020
"devDependencies": {

create-cluster/dist/index.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function run() {
4141
const tags = core.getInput('tags');
4242
const apiEndpoint = core.getInput('replicated-api-endpoint');
4343
let kubeconfigPath = core.getInput('kubeconfig-path');
44-
const exportKubeconfig = core.getInput('export-kubeconfig') === 'true';
44+
const exportKubeconfig = core.getBooleanInput('export-kubeconfig');
4545
const apiClient = new replicated_lib_1.VendorPortalApi();
4646
apiClient.apiToken = apiToken;
4747
if (apiEndpoint) {
@@ -30672,7 +30672,7 @@ async function removeCluster(vendorPortalApi, clusterId) {
3067230672
const http = await vendorPortalApi.client();
3067330673
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}`;
3067430674
const res = await http.del(uri);
30675-
if (res.message.statusCode != 200) {
30675+
if (res.message.statusCode != 201) {
3067630676
throw new StatusError(`Failed to remove cluster: Server responded with ${res.message.statusCode}`, res.message.statusCode);
3067730677
}
3067830678
// discard the response body
@@ -30857,12 +30857,13 @@ async function getAddonDetails(vendorPortalApi, clusterId, addonId) {
3085730857
}
3085830858
throw new Error(`Add-on with id ${addonId} not found`);
3085930859
}
30860-
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
30860+
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols, isWildcard) {
3086130861
const http = await vendorPortalApi.client();
3086230862
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}/port`;
3086330863
const reqBody = {
3086430864
port: port,
30865-
protocols: protocols
30865+
protocols: protocols,
30866+
is_wildcard: isWildcard
3086630867
};
3086730868
const res = await http.post(uri, JSON.stringify(reqBody));
3086830869
if (res.message.statusCode != 201) {
@@ -30885,9 +30886,11 @@ async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
3088530886
exposedPorts.push(exposedPort);
3088630887
}
3088730888
var portObj = {
30889+
addon_id: body.port.addon_id,
3088830890
upstream_port: body.port.upstream_port,
3088930891
hostname: body.port.hostname,
30890-
exposed_ports: exposedPorts
30892+
exposed_ports: exposedPorts,
30893+
is_wildcard: body.port.is_wildcard
3089130894
};
3089230895
return portObj;
3089330896
}

create-cluster/dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

create-cluster/package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

create-cluster/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dependencies": {
1515
"@actions/core": "^1.10.0",
1616
"esbuild-jest": "^0.5.0",
17-
"replicated-lib": "^0.0.1-beta.14",
17+
"replicated-lib": "^0.0.1-beta.15",
1818
"ts-node": "^10.9.1"
1919
},
2020
"devDependencies": {

create-cluster/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async function run() {
2424
const tags = core.getInput('tags');
2525
const apiEndpoint = core.getInput('replicated-api-endpoint')
2626
let kubeconfigPath = core.getInput('kubeconfig-path');
27-
const exportKubeconfig = core.getInput('export-kubeconfig') === 'true';
27+
const exportKubeconfig = core.getBooleanInput('export-kubeconfig');
2828

2929
const apiClient = new VendorPortalApi();
3030
apiClient.apiToken = apiToken;

create-customer/dist/index.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,7 @@ function run() {
3131
const apiEndpoint = core.getInput('replicated-api-endpoint');
3232
const expiresInDays = +(core.getInput('expires-in') || 0);
3333
const entitlements = core.getInput('entitlements');
34-
let isKotsInstallEnabled = undefined;
35-
if (core.getInput('is-kots-install-enabled') !== '') {
36-
isKotsInstallEnabled = core.getInput('is-kots-install-enabled') === 'true';
37-
}
34+
const isKotsInstallEnabled = core.getBooleanInput('is-kots-install-enabled');
3835
const apiClient = new replicated_lib_1.VendorPortalApi();
3936
apiClient.apiToken = apiToken;
4037
if (apiEndpoint) {
@@ -30612,7 +30609,7 @@ async function removeCluster(vendorPortalApi, clusterId) {
3061230609
const http = await vendorPortalApi.client();
3061330610
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}`;
3061430611
const res = await http.del(uri);
30615-
if (res.message.statusCode != 200) {
30612+
if (res.message.statusCode != 201) {
3061630613
throw new StatusError(`Failed to remove cluster: Server responded with ${res.message.statusCode}`, res.message.statusCode);
3061730614
}
3061830615
// discard the response body
@@ -30797,12 +30794,13 @@ async function getAddonDetails(vendorPortalApi, clusterId, addonId) {
3079730794
}
3079830795
throw new Error(`Add-on with id ${addonId} not found`);
3079930796
}
30800-
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
30797+
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols, isWildcard) {
3080130798
const http = await vendorPortalApi.client();
3080230799
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}/port`;
3080330800
const reqBody = {
3080430801
port: port,
30805-
protocols: protocols
30802+
protocols: protocols,
30803+
is_wildcard: isWildcard
3080630804
};
3080730805
const res = await http.post(uri, JSON.stringify(reqBody));
3080830806
if (res.message.statusCode != 201) {
@@ -30825,9 +30823,11 @@ async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
3082530823
exposedPorts.push(exposedPort);
3082630824
}
3082730825
var portObj = {
30826+
addon_id: body.port.addon_id,
3082830827
upstream_port: body.port.upstream_port,
3082930828
hostname: body.port.hostname,
30830-
exposed_ports: exposedPorts
30829+
exposed_ports: exposedPorts,
30830+
is_wildcard: body.port.is_wildcard
3083130831
};
3083230832
return portObj;
3083330833
}

create-customer/dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

create-customer/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

create-customer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dependencies": {
1515
"@actions/core": "^1.10.0",
1616
"esbuild-jest": "^0.5.0",
17-
"replicated-lib": "^0.0.1-beta.14",
17+
"replicated-lib": "^0.0.1-beta.15",
1818
"ts-node": "^10.9.1"
1919
},
2020
"devDependencies": {

create-customer/src/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ async function run() {
1414
const apiEndpoint = core.getInput('replicated-api-endpoint')
1515
const expiresInDays: number = +(core.getInput('expires-in') || 0);
1616
const entitlements = core.getInput('entitlements');
17-
18-
let isKotsInstallEnabled: boolean | undefined = undefined;
19-
if (core.getInput('is-kots-install-enabled') !== '') {
20-
isKotsInstallEnabled = core.getInput('is-kots-install-enabled') === 'true';
21-
}
17+
const isKotsInstallEnabled = core.getBooleanInput('is-kots-install-enabled');
2218

2319
const apiClient = new VendorPortalApi();
2420
apiClient.apiToken = apiToken;

create-object-store/dist/index.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30651,7 +30651,7 @@ async function removeCluster(vendorPortalApi, clusterId) {
3065130651
const http = await vendorPortalApi.client();
3065230652
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}`;
3065330653
const res = await http.del(uri);
30654-
if (res.message.statusCode != 200) {
30654+
if (res.message.statusCode != 201) {
3065530655
throw new StatusError(`Failed to remove cluster: Server responded with ${res.message.statusCode}`, res.message.statusCode);
3065630656
}
3065730657
// discard the response body
@@ -30836,12 +30836,13 @@ async function getAddonDetails(vendorPortalApi, clusterId, addonId) {
3083630836
}
3083730837
throw new Error(`Add-on with id ${addonId} not found`);
3083830838
}
30839-
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
30839+
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols, isWildcard) {
3084030840
const http = await vendorPortalApi.client();
3084130841
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}/port`;
3084230842
const reqBody = {
3084330843
port: port,
30844-
protocols: protocols
30844+
protocols: protocols,
30845+
is_wildcard: isWildcard
3084530846
};
3084630847
const res = await http.post(uri, JSON.stringify(reqBody));
3084730848
if (res.message.statusCode != 201) {
@@ -30864,9 +30865,11 @@ async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
3086430865
exposedPorts.push(exposedPort);
3086530866
}
3086630867
var portObj = {
30868+
addon_id: body.port.addon_id,
3086730869
upstream_port: body.port.upstream_port,
3086830870
hostname: body.port.hostname,
30869-
exposed_ports: exposedPorts
30871+
exposed_ports: exposedPorts,
30872+
is_wildcard: body.port.is_wildcard
3087030873
};
3087130874
return portObj;
3087230875
}

create-object-store/dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

create-object-store/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)