-
-
Notifications
You must be signed in to change notification settings - Fork 400
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
Commented out lines in compose file disappear when starting/deploying container. #176
Comments
Noticed this too. |
I can't seem to reproduce it either anymore. It did disappear! Close this off for now and if it happens again i will re-open with example. Thanks! |
It's seams like that this is still an issue.
|
I can confirm that it's still happening. The lines disappear as soon as you start editing the stack. Edit to say that only certain comments will disappear, as the one provided in this comment. Commenting out the whole |
@louislam Can we re-open this issue please? The steps given by @marvint24 also are reproduceable on my end. |
Happens reliably when commenting out a label. |
was looking in to this because its really annoying. dockge/frontend/src/pages/Compose.vue Line 703 in 109222f
it can deal with comments at the start and end of an array but not in the middle label:
# comment at start of object
- label.on.container=true
# comment at middle of object
- label.on.container2=false
# comment at end of object would remove the middle comment but the start and end ones would stay leading to the front-end displaying label:
# comment at start of object
- label.on.container=true
- label.on.container2=false
# comment at end of object to be clear the comment is actually there in the file until you save/deploy it again after editing |
a work around for now is to do like so labels:
# comment at start of object
- label.on.container=true
- a # comment at middle of object
- label.on.container2=false
- b # comment at middle2 of object
- c # comment at middle3 of object
- d # comment at middle4 of object
- label.on.container3=false
# comment at end of object this should work fine for both labels and environment as the a,b,c,d values are just ignored if they are not used |
I can confirm the workaround @Robonau suggested, lines which are only a comment get removed when you edit the compose. And comments placed to the right of a compose parameter are left untouched. Also, upon editing the template the comments which do not get removed have their indentation changed like so (probably by design, but as they being comments I did not expect it to happen): An saved example compose excerpt:
When I edit it:
|
Bumping this issue, it's definitely something I've been dealing with for many months. I've started editing most of my compose files manually via terminal so Dockge doesn't remove the comment lines leading with (#). Interestingly, after I edit the files manually, Dockge refuses to show many of the comments. |
I've added a PR which hopefully sorts this issue out, as i lost quite a bit of work from my Traefik labels when i was commenting things out (trial and error) to see what was killing one of my dockers when setting up Keycloak. Either way, thanks for a fantastic app, I've completely moved away from Portainer now for my homelab and VPS as this is exactly what i wanted in a product; saving the endless docker compose down && docker compose up -d's when developing. |
🛡️ Security Policy
Description
I have created a new stack with Dockge and commented out some lines in the YAML with #
I then start/deploy the stack and it creates successfully and refreshed the page. The compose.yaml no longer shows me the commented out line, it disappears.
I then login to the host and nano compose.yaml and i can see the commented out line there but not in Dockge.
👟 Reproduction steps
Create stack and comment out line
Deploy/start stack
Refresh Page
Line disappears
👀 Expected behavior
The commented out line still to appear in my compose.yaml so i can reintroduce it if i want to.
😓 Actual Behavior
Commented out line disappears from Dockge GUI
Dockge Version
1.1.1.1
💻 Operating System and Arch
DietPI Debian
🌐 Browser
Firefox/Chrome
🐋 Docker Version
Docker 24.0.7
🟩 NodeJS Version
N/A
📝 Relevant log output
No response
The text was updated successfully, but these errors were encountered: