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

Changed array to map #336

Merged
merged 4 commits into from
Feb 11, 2024

Conversation

Dashboy1998
Copy link
Contributor

Context

Docker Documentation doesn't support var="value" but rather:

  • var: "value"

  • var: value

  • var=value
    It is worth noting that you can do "var=value" but it's not mentioned

  • People keep using quotes in array declaration of environmental variables. Changes array to map which docker compose supports the use of quotes

  • Currently - SERVER_NAME="World of Pals" appears as "World of Pals"

  • Currently - SERVER_NAME=World of Pals appears as World of Pals

Choices

  • By switching to a map SERVER_NAME: "World of Pals" appears as World of Pals
  • SERVER_NAME: World of Pals appears as World of Pals
  • Using maps also aligns our docker compose to be more align with k8s folder yamls as those tend to use maps (Ideally this would be in spell check somehow)

Test instructions

  1. Start the container
  2. Verify using quotes does not add quotes around variables docker exec -it palworld-server bash -c 'echo $SERVER_NAME'

Checklist before requesting a review

  • I have performed a self-review of my code
  • I've added documentation about this change to the README.
  • I've not introduced breaking changes.

@thijsvanloef
Copy link
Owner

I have some doubts about changing arrays to map, as this moves away from the way the .env file and docker run expect the values.

@Dashboy1998
Copy link
Contributor Author

Dashboy1998 commented Feb 9, 2024

I have some doubts about changing arrays to map, as this moves away from the way the .env file and docker run expect the values.

They'll never be able to be the same. While Docker's documentation suggests env can have quotes it appears to not be the case as the quotes appear in the values.

Docker run expects quotes with spaces (Our docker run doesn't actually run because of the spacing).

Docker runs supports -e SERVER_DESCRIPTION="palworld-server-docker by Thijs van Loef" and -e "SERVER_DESCRIPTION=palworld-server-docker by Thijs van Loef"

The yaml also supports "SERVER_DESCRIPTION=palworld-server-docker by Thijs van Loef".

However the env does not support either.

Copy link
Owner

@thijsvanloef thijsvanloef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thijsvanloef thijsvanloef merged commit 952cb78 into thijsvanloef:main Feb 11, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants