Skip to content

Commit f20fefb

Browse files
committed
Fix issue with vpc connector reset.
1 parent 0d527fa commit f20fefb

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

spec/fixtures.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ export const MINIMAL_V1_ENDPOINT: ManifestEndpoint = {
1919
minInstances: RESET_VALUE,
2020
serviceAccountEmail: RESET_VALUE,
2121
timeoutSeconds: RESET_VALUE,
22-
vpc: {
23-
connector: RESET_VALUE,
24-
egressSettings: RESET_VALUE,
25-
},
22+
vpc: RESET_VALUE,
2623
};
2724

2825
export const FULL_ENDPOINT: ManifestEndpoint = {

spec/v1/function-builder.spec.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import { expect } from "chai";
2424

2525
import * as functions from "../../src/v1";
26+
import { ResetValue } from "../../src/common/options";
2627

2728
describe("FunctionBuilder", () => {
2829
before(() => {
@@ -225,7 +226,11 @@ describe("FunctionBuilder", () => {
225226
.auth.user()
226227
.onCreate((user) => user);
227228

228-
expect(fn.__endpoint.vpc.connector).to.equal("test-connector");
229+
if (!(fn.__endpoint.vpc instanceof ResetValue)) {
230+
expect(fn.__endpoint.vpc.connector).to.equal("test-connector");
231+
} else {
232+
expect.fail("__endpoint.vpc unexpectedly set to RESET_VALUE");
233+
}
229234
});
230235

231236
it("should allow a vpcConnectorEgressSettings to be set", () => {
@@ -237,7 +242,11 @@ describe("FunctionBuilder", () => {
237242
.auth.user()
238243
.onCreate((user) => user);
239244

240-
expect(fn.__endpoint.vpc.egressSettings).to.equal("PRIVATE_RANGES_ONLY");
245+
if (!(fn.__endpoint.vpc instanceof ResetValue)) {
246+
expect(fn.__endpoint.vpc.egressSettings).to.equal("PRIVATE_RANGES_ONLY");
247+
} else {
248+
expect.fail("__endpoint.vpc unexpectedly set to RESET_VALUE");
249+
}
241250
});
242251

243252
it("should throw an error if user chooses an invalid vpcConnectorEgressSettings", () => {

0 commit comments

Comments
 (0)