diff --git a/docker_compose.py b/docker_compose.py index cfe9301..1fab5c6 100644 --- a/docker_compose.py +++ b/docker_compose.py @@ -129,7 +129,7 @@ def args_setup(description): parser.add_argument("compose_files", nargs="+") parser.add_argument("--output", "-o") parser.add_argument("--ignore", "-i", nargs="+", default=False) - parser.add_argument("--match-suffix", "-s", action="store_false") + parser.add_argument("--match-suffix", "-s", action="store_true") return parser if __name__ == "__main__": diff --git a/image_tags.py b/image_tags.py index 099ff22..56ca368 100644 --- a/image_tags.py +++ b/image_tags.py @@ -45,7 +45,7 @@ def replace(string, replacements): def compare(base, other, match_suffix=False, replacements=[("-","+"),]): - if match_suffix: + if match_suffix and "-" in base: suffix = base.split("-")[-1] if not other.endswith(suffix): return False diff --git a/show_updateable.py b/show_updateable.py index 278e3cc..7a9e0f6 100644 --- a/show_updateable.py +++ b/show_updateable.py @@ -31,16 +31,16 @@ def main(args): if not "base_images" in usage: continue for base in usage["base_images"]: - info = [{ + info = { "is_base_image": True, "path": usage["path"], "service_name": usage["service_name"] - }] + } if base in updates: updates[base]["usages"].append(info) else: log.info(f"find base image updates for {base}") - updates[base] = find_updates(base, info, args.match_suffix) + updates[base] = find_updates(base, [info], args.match_suffix) if args.output: with open(args.output, "w") as out: