Fix bug with env vars containing = signs
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
"containers": [
|
"containers": [
|
||||||
{
|
{
|
||||||
"name": "porter",
|
"name": "porter",
|
||||||
"image": "gcr.io/google_containers/porter:91d46193649807d1340b46797774d8b2",
|
"image": "gcr.io/google_containers/porter:59ad46ed2c56ba50fa7f1dc176c07c37",
|
||||||
"env": [
|
"env": [
|
||||||
{
|
{
|
||||||
"name": "SERVE_PORT_80",
|
"name": "SERVE_PORT_80",
|
||||||
|
Binary file not shown.
@@ -33,7 +33,10 @@ const prefix = "SERVE_PORT_"
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
for _, vk := range os.Environ() {
|
for _, vk := range os.Environ() {
|
||||||
parts := strings.Split(vk, "=")
|
// Put everything before the first = sign in parts[0], and
|
||||||
|
// everything else in parts[1] (even if there are multiple =
|
||||||
|
// characters).
|
||||||
|
parts := strings.SplitN(vk, "=", 2)
|
||||||
key := parts[0]
|
key := parts[0]
|
||||||
value := parts[1]
|
value := parts[1]
|
||||||
if strings.HasPrefix(key, prefix) {
|
if strings.HasPrefix(key, prefix) {
|
||||||
|
Reference in New Issue
Block a user