Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAML custom tags !reset and !override are parsed and substituted by Dockge instead of compose #448

Open
2 tasks done
A-VI opened this issue Mar 14, 2024 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@A-VI
Copy link

A-VI commented Mar 14, 2024

⚠️ Please verify that this bug has NOT been reported before.

  • I checked and didn't find similar issue

🛡️ Security Policy

Description

The custom YAML tags !reset and !override are wrongly parsed and replaced with their parsed value editing the YAML file, and furthermore this happens before compose reads them, leading at best to different compose config with respect to the meant stack definition or at worst to entirely invalid compose configs.
These tags are useful to overwrite extended services' attributes from other stacks, and this bug not only prevents their use but also have the user to revert the wrongly parsed value(s) and perform compose up manually from outside Dockge every time, being Dockge unsafe to use on the stacks that use these tags.

👟 Reproduction steps

  1. Use a !reset or !override tag in a stack, as shown in the compose documentation
  2. Deploy the stack

👀 Expected behavior

The custom YAML tags are left as they are written in the plain YAML file, like

ports: !reset null

so that compose can correctly interpret them. This syntax is valid and should not cause any error.

😓 Actual Behavior

The tagget YAML values are actually parsed and substituted with the parsed value, and this happens before Compose has the chance to interpret them, leading to incorrect compose config result. This can be seen from the errors generated when deploying a stack containing for example ports: !reset null, which leads to the error

validating ~/docker/myproject/compose.yaml: services.myservice.ports must be a list

because the ports attribute has been rendered as ports: "null", while the same results in a compose config that has no ports: attribute.

Dockge Version

1.4.2

💻 Operating System and Arch

Ubuntu 22

🌐 Browser

Safari macOS

🐋 Docker Version

Docker Engine - Community v25.0.4

🟩 NodeJS Version

No response

📝 Relevant log output

[GETSERVICESTATUSLIST] ERROR: Error: Process exited with code 15
at ChildProcess.done (/app/node_modules/.pnpm/promisify-child-process@4.1.2/node_modules/promisify-child-process/i ndex.cjs:70:19)
at ChildProcess.emit (node:events:514:28) at ChildProcess.emit (node:domain:489:12)
at maybeClose (node:internal/child_process:1091:16)
at ChildProcess._handle.onexit (node:internal/child_process:302:5) {
code: 15, signal: null, stdout: '',
stderr: 'validating ~/docker/myproject/compose.yaml: services.myproject.ports must be a list\n
(node:34) [TAG_RESOLVE_FAILED] YAMLWarning: Unresolved tag: reset at line 9, column 12:
ports: !reset null
@A-VI A-VI added the bug Something isn't working label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant