Skip to content

Commit

Permalink
Merge pull request #36 from projectsyn/fix/commodore-helm-log-severity
Browse files Browse the repository at this point in the history
Change error log messages to warnings in commodore-helm
  • Loading branch information
simu authored Feb 24, 2022
2 parents 1ee65ce + 68a4feb commit a4b06be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
16 changes: 8 additions & 8 deletions src/commodore-helm/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,10 @@ describe('manager/commodore-helm/index', () => {
const res = await extractAllPackageFiles({}, ['class/defaults.yml']);
expect(res).toBeNull();
const errors = getLoggerErrors();
expect(errors.length).toBe(1);
const err0 = errors[0];
expect(err0.msg).toBe('Expected exactly two package files, aborting.');
if (errors.length > 0) {
console.log(errors);
}
expect(errors.length).toBe(0);
});
it('records an error for non-component repositories which have two package files', async () => {
const res = await extractAllPackageFiles({}, [
Expand All @@ -296,11 +297,10 @@ describe('manager/commodore-helm/index', () => {
]);
expect(res).toBeNull();
const errors = getLoggerErrors();
expect(errors.length).toBe(1);
const err0 = errors[0];
expect(err0.msg).toBe(
'Component repository has no `class/defaults.ya?ml`'
);
if (errors.length > 0) {
console.log(errors);
}
expect(errors.length).toBe(0);
});
it('extracts new and old standard Helm dependencies in the same file', async () => {
setGlobalConfig('7');
Expand Down
10 changes: 5 additions & 5 deletions src/commodore-helm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ export async function extractAllPackageFiles(
let defaults_file: string | null = null;

if (packageFiles.length != 2) {
logger.error(
logger.warn(
{ packageFiles },
'Expected exactly two package files, aborting.'
'Expected exactly two package files, skipping.'
);
return null;
}
Expand All @@ -148,14 +148,14 @@ export async function extractAllPackageFiles(
}

if (!fileContents.has('defaults') || !defaults_file) {
logger.error('Component repository has no `class/defaults.ya?ml`');
logger.warn('Repository has no `class/defaults.ya?ml`, skipping');
return null;
}

if (!componentName) {
logger.error(
logger.warn(
{ packageFiles },
'Unable to identify component name from package files'
'Unable to identify component name from package files, skipping'
);
return null;
}
Expand Down

0 comments on commit a4b06be

Please sign in to comment.