Skip to content

Commit cc6e28e

Browse files
authored
Fix bug where function configuration with null couldn't be deployed. (#1246)
1 parent cf27ac6 commit cc6e28e

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
- Fix reference docs for performance monitoring.
2+
- Fix bug where function configuration wil null values couldn't be deployed. (#1246)

spec/runtime/manifest.spec.ts

+30
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,36 @@ describe('stackToWire', () => {
77
params.clearParams();
88
});
99

10+
it('converts stack with null values values', () => {
11+
const stack: ManifestStack = {
12+
endpoints: {
13+
v2http: {
14+
platform: 'gcfv2',
15+
entryPoint: 'v2http',
16+
labels: {},
17+
httpsTrigger: {},
18+
maxInstances: null,
19+
},
20+
},
21+
requiredAPIs: [],
22+
specVersion: 'v1alpha1',
23+
};
24+
const expected = {
25+
endpoints: {
26+
v2http: {
27+
platform: 'gcfv2',
28+
entryPoint: 'v2http',
29+
labels: {},
30+
httpsTrigger: {},
31+
maxInstances: null,
32+
},
33+
},
34+
requiredAPIs: [],
35+
specVersion: 'v1alpha1',
36+
};
37+
expect(stackToWire(stack)).to.deep.equal(expected);
38+
});
39+
1040
it('converts Expression types in endpoint options to CEL', () => {
1141
const intParam = params.defineInt('foo', { default: 11 });
1242
const stringParam = params.defineString('bar', {

src/runtime/manifest.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export function stackToWire(stack: ManifestStack): Object {
107107
for (const [key, val] of Object.entries(obj)) {
108108
if (val instanceof Expression) {
109109
obj[key] = val.toCEL();
110-
} else if (typeof val === 'object') {
110+
} else if (typeof val === 'object' && val !== null) {
111111
traverse(val);
112112
}
113113
}

0 commit comments

Comments
 (0)