Skip to content

Commit

Permalink
feat(cmx): cluster port expose wildcards (#56)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
emosbaugh and emosbaugh authored May 10, 2024
1 parent 2f01e36 commit d2774b2
Show file tree
Hide file tree
Showing 62 changed files with 198 additions and 156 deletions.
11 changes: 7 additions & 4 deletions archive-channel/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30587,7 +30587,7 @@ async function removeCluster(vendorPortalApi, clusterId) {
const http = await vendorPortalApi.client();
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}`;
const res = await http.del(uri);
if (res.message.statusCode != 200) {
if (res.message.statusCode != 201) {
throw new StatusError(`Failed to remove cluster: Server responded with ${res.message.statusCode}`, res.message.statusCode);
}
// discard the response body
Expand Down Expand Up @@ -30772,12 +30772,13 @@ async function getAddonDetails(vendorPortalApi, clusterId, addonId) {
}
throw new Error(`Add-on with id ${addonId} not found`);
}
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols, isWildcard) {
const http = await vendorPortalApi.client();
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}/port`;
const reqBody = {
port: port,
protocols: protocols
protocols: protocols,
is_wildcard: isWildcard
};
const res = await http.post(uri, JSON.stringify(reqBody));
if (res.message.statusCode != 201) {
Expand All @@ -30800,9 +30801,11 @@ async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
exposedPorts.push(exposedPort);
}
var portObj = {
addon_id: body.port.addon_id,
upstream_port: body.port.upstream_port,
hostname: body.port.hostname,
exposed_ports: exposedPorts
exposed_ports: exposedPorts,
is_wildcard: body.port.is_wildcard
};
return portObj;
}
Expand Down
2 changes: 1 addition & 1 deletion archive-channel/dist/index.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions archive-channel/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 archive-channel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@actions/core": "^1.10.0",
"esbuild-jest": "^0.5.0",
"replicated-lib": "^0.0.1-beta.14",
"replicated-lib": "^0.0.1-beta.15",
"ts-node": "^10.9.1"
},
"devDependencies": {
Expand Down
11 changes: 7 additions & 4 deletions archive-customer/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30586,7 +30586,7 @@ async function removeCluster(vendorPortalApi, clusterId) {
const http = await vendorPortalApi.client();
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}`;
const res = await http.del(uri);
if (res.message.statusCode != 200) {
if (res.message.statusCode != 201) {
throw new StatusError(`Failed to remove cluster: Server responded with ${res.message.statusCode}`, res.message.statusCode);
}
// discard the response body
Expand Down Expand Up @@ -30771,12 +30771,13 @@ async function getAddonDetails(vendorPortalApi, clusterId, addonId) {
}
throw new Error(`Add-on with id ${addonId} not found`);
}
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols, isWildcard) {
const http = await vendorPortalApi.client();
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}/port`;
const reqBody = {
port: port,
protocols: protocols
protocols: protocols,
is_wildcard: isWildcard
};
const res = await http.post(uri, JSON.stringify(reqBody));
if (res.message.statusCode != 201) {
Expand All @@ -30799,9 +30800,11 @@ async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
exposedPorts.push(exposedPort);
}
var portObj = {
addon_id: body.port.addon_id,
upstream_port: body.port.upstream_port,
hostname: body.port.hostname,
exposed_ports: exposedPorts
exposed_ports: exposedPorts,
is_wildcard: body.port.is_wildcard
};
return portObj;
}
Expand Down
2 changes: 1 addition & 1 deletion archive-customer/dist/index.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions archive-customer/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 archive-customer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@actions/core": "^1.10.0",
"esbuild-jest": "^0.5.0",
"replicated-lib": "^0.0.1-beta.14",
"replicated-lib": "^0.0.1-beta.15",
"ts-node": "^10.9.1"
},
"devDependencies": {
Expand Down
13 changes: 8 additions & 5 deletions create-cluster/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function run() {
const tags = core.getInput('tags');
const apiEndpoint = core.getInput('replicated-api-endpoint');
let kubeconfigPath = core.getInput('kubeconfig-path');
const exportKubeconfig = core.getInput('export-kubeconfig') === 'true';
const exportKubeconfig = core.getBooleanInput('export-kubeconfig');
const apiClient = new replicated_lib_1.VendorPortalApi();
apiClient.apiToken = apiToken;
if (apiEndpoint) {
Expand Down Expand Up @@ -30672,7 +30672,7 @@ async function removeCluster(vendorPortalApi, clusterId) {
const http = await vendorPortalApi.client();
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}`;
const res = await http.del(uri);
if (res.message.statusCode != 200) {
if (res.message.statusCode != 201) {
throw new StatusError(`Failed to remove cluster: Server responded with ${res.message.statusCode}`, res.message.statusCode);
}
// discard the response body
Expand Down Expand Up @@ -30857,12 +30857,13 @@ async function getAddonDetails(vendorPortalApi, clusterId, addonId) {
}
throw new Error(`Add-on with id ${addonId} not found`);
}
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols, isWildcard) {
const http = await vendorPortalApi.client();
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}/port`;
const reqBody = {
port: port,
protocols: protocols
protocols: protocols,
is_wildcard: isWildcard
};
const res = await http.post(uri, JSON.stringify(reqBody));
if (res.message.statusCode != 201) {
Expand All @@ -30885,9 +30886,11 @@ async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
exposedPorts.push(exposedPort);
}
var portObj = {
addon_id: body.port.addon_id,
upstream_port: body.port.upstream_port,
hostname: body.port.hostname,
exposed_ports: exposedPorts
exposed_ports: exposedPorts,
is_wildcard: body.port.is_wildcard
};
return portObj;
}
Expand Down
2 changes: 1 addition & 1 deletion create-cluster/dist/index.js.map

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions create-cluster/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 create-cluster/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@actions/core": "^1.10.0",
"esbuild-jest": "^0.5.0",
"replicated-lib": "^0.0.1-beta.14",
"replicated-lib": "^0.0.1-beta.15",
"ts-node": "^10.9.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion create-cluster/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async function run() {
const tags = core.getInput('tags');
const apiEndpoint = core.getInput('replicated-api-endpoint')
let kubeconfigPath = core.getInput('kubeconfig-path');
const exportKubeconfig = core.getInput('export-kubeconfig') === 'true';
const exportKubeconfig = core.getBooleanInput('export-kubeconfig');

const apiClient = new VendorPortalApi();
apiClient.apiToken = apiToken;
Expand Down
16 changes: 8 additions & 8 deletions create-customer/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ function run() {
const apiEndpoint = core.getInput('replicated-api-endpoint');
const expiresInDays = +(core.getInput('expires-in') || 0);
const entitlements = core.getInput('entitlements');
let isKotsInstallEnabled = undefined;
if (core.getInput('is-kots-install-enabled') !== '') {
isKotsInstallEnabled = core.getInput('is-kots-install-enabled') === 'true';
}
const isKotsInstallEnabled = core.getBooleanInput('is-kots-install-enabled');
const apiClient = new replicated_lib_1.VendorPortalApi();
apiClient.apiToken = apiToken;
if (apiEndpoint) {
Expand Down Expand Up @@ -30612,7 +30609,7 @@ async function removeCluster(vendorPortalApi, clusterId) {
const http = await vendorPortalApi.client();
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}`;
const res = await http.del(uri);
if (res.message.statusCode != 200) {
if (res.message.statusCode != 201) {
throw new StatusError(`Failed to remove cluster: Server responded with ${res.message.statusCode}`, res.message.statusCode);
}
// discard the response body
Expand Down Expand Up @@ -30797,12 +30794,13 @@ async function getAddonDetails(vendorPortalApi, clusterId, addonId) {
}
throw new Error(`Add-on with id ${addonId} not found`);
}
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols, isWildcard) {
const http = await vendorPortalApi.client();
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}/port`;
const reqBody = {
port: port,
protocols: protocols
protocols: protocols,
is_wildcard: isWildcard
};
const res = await http.post(uri, JSON.stringify(reqBody));
if (res.message.statusCode != 201) {
Expand All @@ -30825,9 +30823,11 @@ async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
exposedPorts.push(exposedPort);
}
var portObj = {
addon_id: body.port.addon_id,
upstream_port: body.port.upstream_port,
hostname: body.port.hostname,
exposed_ports: exposedPorts
exposed_ports: exposedPorts,
is_wildcard: body.port.is_wildcard
};
return portObj;
}
Expand Down
2 changes: 1 addition & 1 deletion create-customer/dist/index.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions create-customer/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 create-customer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@actions/core": "^1.10.0",
"esbuild-jest": "^0.5.0",
"replicated-lib": "^0.0.1-beta.14",
"replicated-lib": "^0.0.1-beta.15",
"ts-node": "^10.9.1"
},
"devDependencies": {
Expand Down
6 changes: 1 addition & 5 deletions create-customer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ async function run() {
const apiEndpoint = core.getInput('replicated-api-endpoint')
const expiresInDays: number = +(core.getInput('expires-in') || 0);
const entitlements = core.getInput('entitlements');

let isKotsInstallEnabled: boolean | undefined = undefined;
if (core.getInput('is-kots-install-enabled') !== '') {
isKotsInstallEnabled = core.getInput('is-kots-install-enabled') === 'true';
}
const isKotsInstallEnabled = core.getBooleanInput('is-kots-install-enabled');

const apiClient = new VendorPortalApi();
apiClient.apiToken = apiToken;
Expand Down
11 changes: 7 additions & 4 deletions create-object-store/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30651,7 +30651,7 @@ async function removeCluster(vendorPortalApi, clusterId) {
const http = await vendorPortalApi.client();
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}`;
const res = await http.del(uri);
if (res.message.statusCode != 200) {
if (res.message.statusCode != 201) {
throw new StatusError(`Failed to remove cluster: Server responded with ${res.message.statusCode}`, res.message.statusCode);
}
// discard the response body
Expand Down Expand Up @@ -30836,12 +30836,13 @@ async function getAddonDetails(vendorPortalApi, clusterId, addonId) {
}
throw new Error(`Add-on with id ${addonId} not found`);
}
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols, isWildcard) {
const http = await vendorPortalApi.client();
const uri = `${vendorPortalApi.endpoint}/cluster/${clusterId}/port`;
const reqBody = {
port: port,
protocols: protocols
protocols: protocols,
is_wildcard: isWildcard
};
const res = await http.post(uri, JSON.stringify(reqBody));
if (res.message.statusCode != 201) {
Expand All @@ -30864,9 +30865,11 @@ async function exposeClusterPort(vendorPortalApi, clusterId, port, protocols) {
exposedPorts.push(exposedPort);
}
var portObj = {
addon_id: body.port.addon_id,
upstream_port: body.port.upstream_port,
hostname: body.port.hostname,
exposed_ports: exposedPorts
exposed_ports: exposedPorts,
is_wildcard: body.port.is_wildcard
};
return portObj;
}
Expand Down
2 changes: 1 addition & 1 deletion create-object-store/dist/index.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions create-object-store/package-lock.json

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

Loading

0 comments on commit d2774b2

Please sign in to comment.