Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Fix reference docs for performance monitoring.
- Fix bug where function configuration wil null values couldn't be deployed. (#1246)
30 changes: 30 additions & 0 deletions spec/runtime/manifest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,36 @@ describe('stackToWire', () => {
params.clearParams();
});

it('converts stack with null values values', () => {
const stack: ManifestStack = {
endpoints: {
v2http: {
platform: 'gcfv2',
entryPoint: 'v2http',
labels: {},
httpsTrigger: {},
maxInstances: null,
},
},
requiredAPIs: [],
specVersion: 'v1alpha1',
};
const expected = {
endpoints: {
v2http: {
platform: 'gcfv2',
entryPoint: 'v2http',
labels: {},
httpsTrigger: {},
maxInstances: null,
},
},
requiredAPIs: [],
specVersion: 'v1alpha1',
};
expect(stackToWire(stack)).to.deep.equal(expected);
});

it('converts Expression types in endpoint options to CEL', () => {
const intParam = params.defineInt('foo', { default: 11 });
const stringParam = params.defineString('bar', {
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export function stackToWire(stack: ManifestStack): Object {
for (const [key, val] of Object.entries(obj)) {
if (val instanceof Expression) {
obj[key] = val.toCEL();
} else if (typeof val === 'object') {
} else if (typeof val === 'object' && val !== null) {
traverse(val);
}
}
Expand Down