Skip to content

Commit

Permalink
Add warning when filtering all tags. (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbi08 authored Oct 5, 2024
1 parent 2e5d30b commit a4d5f01
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/watchers/providers/docker/Docker.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function getRegistries() {
* @param tags
* @returns {*}
*/
function getTagCandidates(container, tags) {
function getTagCandidates(container, tags, logContainer) {
let filteredTags = tags;

// Match include tag regex
Expand All @@ -58,6 +58,10 @@ function getTagCandidates(container, tags) {
filteredTags = filteredTags.filter((tag) => !excludeTagsRegex.test(tag));
}

if (filteredTags.length === 0) {
logContainer.warn('No tags found after filtering check you regex filters');
}

// Semver image -> find higher semver tag
if (container.image.tag.semver) {
// Keep semver only
Expand Down Expand Up @@ -503,7 +507,7 @@ class Docker extends Component {
const tags = await registryProvider.getTags(container.image);

// Get candidate tags (based on tag name)
const tagsCandidates = getTagCandidates(container, tags);
const tagsCandidates = getTagCandidates(container, tags, logContainer);

// Must watch digest? => Find local/remote digests on registry
if (container.image.digest.watch && container.image.digest.repo) {
Expand Down Expand Up @@ -667,7 +671,7 @@ class Docker extends Component {
containerReport.container = storeContainer.insertContainer(containerWithResult);
containerReport.changed = true;

// Found in DB? => update it
// Found in DB? => update it
} else {
containerReport.container = storeContainer.updateContainer(containerWithResult);
containerReport.changed = containerInDb.resultChanged(containerReport.container)
Expand Down

0 comments on commit a4d5f01

Please sign in to comment.