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

x-services parsing error #208

Open
2 tasks done
lvillis opened this issue Nov 29, 2023 · 3 comments
Open
2 tasks done

x-services parsing error #208

lvillis opened this issue Nov 29, 2023 · 3 comments
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@lvillis
Copy link

lvillis commented Nov 29, 2023

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

  • I checked and didn't find similar issue

🛡️ Security Policy

Description

As shown in the figure below, the name set in x-services will become a1 when referenced in the service. At the same time, the parameters set by x-services are not displayed on the front end.

image
image

👟 Reproduction steps

Using x-services..

👀 Expected behavior

x-services parsed correctly.

😓 Actual Behavior

x-services parsed error.

Dockge Version

1.2.0

💻 Operating System and Arch

RockyLinux9.2

🌐 Browser

Google Chrome 119.0.6045.124

🐋 Docker Version

No response

🟩 NodeJS Version

No response

📝 Relevant log output

No response

@lvillis lvillis added the bug Something isn't working label Nov 29, 2023
@syko9000
Copy link
Contributor

syko9000 commented Dec 7, 2023

It must be the yaml parser being used... it supports Fragments as you can see the port number in the first case

Screenshot 2023-12-07 at 3 41 13 PM

But doesn't seem to support YAML merge types, or at least not fully.

Screenshot 2023-12-07 at 3 42 13 PM

Both work correctly as far as docker is concerned.

However, I named the fragment &ports and the parser/serializer renamed my fragment to &a1.

Edit: the json version of the parsed file still contains the << which is awkward but could be mitigated with a
this.ports ?? this["<<"].ports or the like but you'd have to do that for all possible fields 😞

Screenshot 2023-12-07 at 4 01 02 PM

@syko9000
Copy link
Contributor

syko9000 commented Dec 7, 2023

Apparently the parse and parseDocument functions can take a second argument of { merge: true }. That does collapse the << into the object above so that the UI can read it properly... but then it saves the document in its merged form and not it's fragmented form. So, no super easy solution.

@louislam
Copy link
Owner

louislam commented Dec 8, 2023

Two way binding for this syntax is almost impossible.

I think the interactive editor should be disabled when this syntax is detected in the yaml file.

@louislam louislam added the wontfix This will not be worked on label Dec 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants