Skip to content

Conversation

tkw1536
Copy link

@tkw1536 tkw1536 commented Jun 7, 2021

This PR accumulates various fixes to make forego work with the latest nginx-proxy image on both the debian and alpine image. These are:

  1. It reverts 51d9f6d, which causes problems on alpine because the sh shell does not support all required features.
  2. It moves the shell to be used into a separate variable named osShell so that the shell can be customized at forego build time. For example:
go build -ldflags "-X main.osShell=sh" -o forego

can be used to make forego always use sh as opposed to bash.

  1. It protects the env map against concurrent accesses, these occur when a process crashes immediately on startup.
  2. Various minor fixes or stylistic go improvements

tkw1536 added 9 commits June 7, 2021 12:53
When multiple processes were immediatly crashing on startup, the
environment map was written concurrently in multiple goroutines. This
caused forego to crash in certain situations.

To protect against this behavior, this commit protects multiple
concurrent accesses by using a sync.Map instead.
This commit removes variables that are not used.
This commit moves the shell command to be used when executing commands
into a variable, allowing it to be customized at build time using a
command like:

go build -ldflags "-X main.osShell=my-fancy-shell" -o forego
@buchdag
Copy link
Member

buchdag commented Jun 8, 2021

Very nice work, thank you 👍

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.

2 participants