add no-normalize flag

Signed-off-by: Evedel <svbiriukov@gmail.com>
This commit is contained in:
Evedel
2023-06-11 15:19:14 +10:00
committed by Muayyad Alsadi
parent 57c527c2c9
commit bc9168b039
4 changed files with 20 additions and 5 deletions

View File

@ -1627,7 +1627,8 @@ class PodmanCompose:
compose.get("services", {}), set(args.profile)
)
compose["services"] = resolved_services
compose = normalize_final(compose, self.dirname)
if not args.no_normalize:
compose = normalize_final(compose, self.dirname)
self.merged_yaml = yaml.safe_dump(compose)
merged_json_b = json.dumps(compose, separators=(",", ":")).encode("utf-8")
self.yaml_hash = hashlib.sha256(merged_json_b).hexdigest()
@ -3082,6 +3083,9 @@ def compose_build_parse(parser):
@cmd_parse(podman_compose, "config")
def compose_config_parse(parser):
parser.add_argument(
"--no-normalize", help="Don't normalize compose model.", action="store_true"
)
parser.add_argument(
"--services", help="Print the service names, one per line.", action="store_true"
)