Skip to content

Commit

Permalink
Fix bug where function configuration with null couldn't be deployed. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
taeold committed Sep 29, 2022
1 parent cf27ac6 commit cc6e28e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -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
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
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

0 comments on commit cc6e28e

Please sign in to comment.