Skip to content

Commit 518d35b

Browse files
committed
add buildAirgapAutomatically
1 parent 1a0cee2 commit 518d35b

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

pacts/npm_consumer-vp_service.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
"body": {
1919
"channels": [
2020
{
21+
"buildAirgapAutomatically": true,
2122
"channelSlug": "stable",
2223
"id": "1234abcd",
2324
"name": "Stable",
2425
"releaseSequence": 1
2526
},
2627
{
28+
"buildAirgapAutomatically": false,
2729
"channelSlug": "beta",
2830
"id": "5678efgh",
2931
"name": "Beta",

src/channels.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ describe("findChannelDetailsInOutput", () => {
1515
appName: "relmatrix",
1616
channelSlug: "stable",
1717
name: "Stable",
18-
releaseSequence: 1
18+
releaseSequence: 1,
19+
buildAirgapAutomatically: true
1920
},
2021
{
2122
id: "channelid2",
@@ -24,7 +25,8 @@ describe("findChannelDetailsInOutput", () => {
2425
appName: "relmatrix",
2526
channelSlug: "ci-reliability-matrix",
2627
name: "ci-reliability-matrix",
27-
releaseSequence: 2
28+
releaseSequence: 2,
29+
buildAirgapAutomatically: false
2830
}
2931
];
3032
const channelSlug = "ci-reliability-matrix";
@@ -41,8 +43,8 @@ describe("ChannelsService", () => {
4143
test("should return channel", () => {
4244
const expectedChannels = {
4345
channels: [
44-
{ id: "1234abcd", name: "Stable", channelSlug: "stable", releaseSequence: 1 },
45-
{ id: "5678efgh", name: "Beta", channelSlug: "beta", releaseSequence: 2 }
46+
{ id: "1234abcd", name: "Stable", channelSlug: "stable", releaseSequence: 1, buildAirgapAutomatically: true },
47+
{ id: "5678efgh", name: "Beta", channelSlug: "beta", releaseSequence: 2, buildAirgapAutomatically: false }
4648
]
4749
};
4850

src/channels.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export class Channel {
66
id: string;
77
slug: string;
88
releaseSequence?: number;
9+
buildAirgapAutomatically?: boolean;
910
}
1011

1112
export const exportedForTesting = {
@@ -98,10 +99,10 @@ export async function archiveChannel(vendorPortalApi: VendorPortalApi, appSlug:
9899
async function findChannelDetailsInOutput(channels: any[], { slug, name }: ChannelIdentifier): Promise<Channel> {
99100
for (const channel of channels) {
100101
if (slug && channel.channelSlug == slug) {
101-
return { name: channel.name, id: channel.id, slug: channel.channelSlug, releaseSequence: channel.releaseSequence };
102+
return { name: channel.name, id: channel.id, slug: channel.channelSlug, releaseSequence: channel.releaseSequence, buildAirgapAutomatically: channel.buildAirgapAutomatically };
102103
}
103104
if (name && channel.name == name) {
104-
return { name: channel.name, id: channel.id, slug: channel.channelSlug, releaseSequence: channel.releaseSequence };
105+
return { name: channel.name, id: channel.id, slug: channel.channelSlug, releaseSequence: channel.releaseSequence, buildAirgapAutomatically: channel.buildAirgapAutomatically };
105106
}
106107
}
107108
return Promise.reject({ channel: null, reason: `Could not find channel with slug ${slug} or name ${name}` });

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ export { getApplicationDetails } from "./applications";
33
export { Channel, createChannel, getChannelDetails, archiveChannel } from "./channels";
44
export { ClusterVersion, createCluster, createClusterWithLicense, pollForStatus, getKubeconfig, removeCluster, upgradeCluster, getClusterVersions, createAddonObjectStore, pollForAddonStatus, exposeClusterPort } from "./clusters";
55
export { KubernetesDistribution, archiveCustomer, createCustomer, getUsedKubernetesDistributions } from "./customers";
6-
export { Release, CompatibilityResult, createRelease, createReleaseFromChart, promoteRelease, reportCompatibilityResult } from "./releases";
6+
export { Release, CompatibilityResult, createRelease, createReleaseFromChart, promoteRelease, reportCompatibilityResult, pollForAirgapReleaseStatus } from "./releases";

0 commit comments

Comments
 (0)