Skip to content
Snippets Groups Projects
Commit d499cb0c authored by Rhys Arkins's avatar Rhys Arkins
Browse files

fix(docker): skip sources containing variables

parent 03698c21
No related merge requests found
...@@ -7,6 +7,11 @@ module.exports = { ...@@ -7,6 +7,11 @@ module.exports = {
function splitImageParts(currentFrom) { function splitImageParts(currentFrom) {
let dockerRegistry; let dockerRegistry;
if (currentFrom.includes('${')) {
return {
skipReason: 'contains-variable',
};
}
const split = currentFrom.split('/'); const split = currentFrom.split('/');
if (split.length > 1 && split[0].includes('.')) { if (split.length > 1 && split[0].includes('.')) {
[dockerRegistry] = split; [dockerRegistry] = split;
...@@ -41,6 +46,7 @@ function getDep(currentFrom) { ...@@ -41,6 +46,7 @@ function getDep(currentFrom) {
const purl = getPurl(dep.dockerRegistry, dep.depName); const purl = getPurl(dep.dockerRegistry, dep.depName);
dep.purl = purl; dep.purl = purl;
if ( if (
dep.depName &&
(dep.depName === 'node' || dep.depName.endsWith('/node')) && (dep.depName === 'node' || dep.depName.endsWith('/node')) &&
dep.depName !== 'calico/node' dep.depName !== 'calico/node'
) { ) {
......
...@@ -87,6 +87,9 @@ services: ...@@ -87,6 +87,9 @@ services:
placement: placement:
constraints: [node.role == manager] constraints: [node.role == manager]
edplugins:
image: ${IMAGE:-synkodevelopers/edplugins}:${TAG:-latest}
networks: networks:
frontend: frontend:
backend: backend:
......
...@@ -80,5 +80,11 @@ Array [ ...@@ -80,5 +80,11 @@ Array [
"lineNumber": 79, "lineNumber": 79,
"purl": "pkg:docker/dockersamples/visualizer", "purl": "pkg:docker/dockersamples/visualizer",
}, },
Object {
"currentFrom": "\${IMAGE:-synkodevelopers/edplugins}:\${TAG:-latest}",
"lineNumber": 90,
"purl": "pkg:docker/undefined",
"skipReason": "contains-variable",
},
] ]
`; `;
...@@ -20,7 +20,7 @@ describe('lib/manager/docker-compose/extract', () => { ...@@ -20,7 +20,7 @@ describe('lib/manager/docker-compose/extract', () => {
it('extracts multiple image lines', () => { it('extracts multiple image lines', () => {
const res = extractPackageFile(yamlFile, config); const res = extractPackageFile(yamlFile, config);
expect(res.deps).toMatchSnapshot(); expect(res.deps).toMatchSnapshot();
expect(res.deps).toHaveLength(7); expect(res.deps).toHaveLength(8);
}); });
}); });
}); });
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment