File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 11- Fix reference docs for performance monitoring.
2+ - Fix bug where function configuration wil null values couldn't be deployed. (#1246 )
Original file line number Diff line number Diff 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' , {
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments