containers / podlet

Generate Podman Quadlet files from a Podman command, compose file, or existing object
https://crates.io/crates/podlet
Mozilla Public License 2.0
322 stars 10 forks source link

escape newlines in `Environment=` values #32

Closed frotinybo closed 6 months ago

frotinybo commented 6 months ago

Hello,

I've tried to convert the compose file from the github invidious project. I had an issue with the following section :

 INVIDIOUS_CONFIG: |
    db:
      dbname: invidious
      user: kemal
      password: kemal
      host: invidious-db
      port: 5432
    check_tables: true

Translated in the podlet output as :

Environment="INVIDIOUS_CONFIG=db: dbname: invidious user: kemal password: kemal host: invidious-db port: 5432 check_tables: true"

The output file is not accepted by systemd/quadlet. I had to change the section in the .container file to :

Environment="INVIDIOUS_CONFIG= db:\n dbname: invidious\n user: kemal\n password: kemal\n host: invidious-db\n port: 5432\n check_tables: true\n"