Skip to content

Commit

Permalink
Account for empty yaml value
Browse files Browse the repository at this point in the history
  • Loading branch information
jen-huang committed Mar 17, 2020
1 parent fc6ef12 commit c18b8d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ describe('Ingest Manager - storedDatasourceToAgentDatasource', () => {
value:
'- namespace: mockNamespace\n #disabledProp: ["test"]\n anotherProp: test\n- namespace: mockNamespace2\n #disabledProp: ["test2"]\n anotherProp: test2',
},
barVar4: {
type: 'yaml',
value: '',
},
},
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export const storedDatasourceToAgentDatasource = (
(acc, [configName, { type: configType, value: configValue }]) => {
if (configValue !== undefined) {
if (configType === 'yaml') {
acc[configName] = safeLoad(configValue);
if (configValue.trim()) {
acc[configName] = safeLoad(configValue);
}
} else {
acc[configName] = configValue;
}
Expand Down

0 comments on commit c18b8d9

Please sign in to comment.