-
-
Notifications
You must be signed in to change notification settings - Fork 111
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
Don't json-encode array option fields #133
Don't json-encode array option fields #133
Conversation
Previously there was a check if the options field has the key `t` to avoid mistransforming the tags list. On build `extra_hosts` are passed as a JSON string and wouldn't be applied. We resolve this through checking for an array. Fixes apocas/dockerode#605
Published |
This requires docker-modem >= 3.0.1: apocas/docker-modem#133 Signed-off-by: Robert Günzler <robertg@balena.io>
This requires docker-modem >= 3.0.1: apocas/docker-modem#133 Signed-off-by: Robert Günzler <robertg@balena.io>
This requires docker-modem >= 3.0.2: apocas/docker-modem#133 apocas/docker-modem#134 Signed-off-by: Robert Günzler <robertg@balena.io>
This requires docker-modem >= 3.0.2: apocas/docker-modem#133 apocas/docker-modem#134 Signed-off-by: Robert Günzler <robertg@balena.io>
This requires docker-modem >= 3.0.2: apocas/docker-modem#133 apocas/docker-modem#134 Signed-off-by: Robert Günzler <robertg@balena.io>
This requires docker-modem >= 3.0.2: apocas/docker-modem#133 apocas/docker-modem#134 Signed-off-by: Robert Günzler <robertg@balena.io>
This requires docker-modem >= 3.0.2: apocas/docker-modem#133 apocas/docker-modem#134 Signed-off-by: Robert Günzler <robertg@balena.io>
This requires docker-modem >= 3.0.2: apocas/docker-modem#133 apocas/docker-modem#134 Signed-off-by: Robert Günzler <robertg@balena.io>
This requires docker-modem >= 3.0.2: apocas/docker-modem#133 apocas/docker-modem#134 Signed-off-by: Robert Günzler <robertg@balena.io>
This requires docker-modem >= 3.0.2: apocas/docker-modem#133 apocas/docker-modem#134 Signed-off-by: Robert Günzler <robertg@balena.io>
@robertgzr, it looks like this PR causes a Docker (balenaEngine) build error in some cases. If {
t: 'balena-secrets:latest',
volumes: [ '/var/lib/docker/tmp:/var/lib/docker/tmp:rw' ],
forcerm: true
} Then the query string produced by this Before this PR: 't=balena-secrets%3Alatest&volumes=%5B%22%2Fvar%2Flib%2Fdocker%2Ftmp%3A%2Fvar%2Flib%2Fdocker%2Ftmp%3Arw%22%5D&forcerm=true' i.e. the After this PR: 't=balena-secrets%3Alatest&volumes=%2Fvar%2Flib%2Fdocker%2Ftmp%3A%2Fvar%2Flib%2Fdocker%2Ftmp%3Arw&forcerm=true' i.e. the
This issue was originally reported by a balena CLI end user in balena-io/balena-cli/issues/2440 . The workaround is to downgrade and pin Of course, there was a good reason for the changes in this PR, related to the Note: You'll be thinking: Why didn't he add this comment to the relevant line of code under the the PR's "Files changed" tab? Well, I tried, but somehow GitHub did not allow me (no error, the comment button would just do nothing). |
@robertgzr, |
Most Docker API parameters take JSON values but some array parameters must be passed as multiple querystring parameters. Two known such parameters are `t` and `extrahosts` for the `/build` endpoint. There may be others. This changes Modem to behave in a similar way: encode values to JSON by default, except the known special cases. This properly fixes apocas/dockerode#605 and effectively reverts apocas#133 and apocas#134.
Most Docker API parameters take JSON values but some array parameters must be passed as multiple querystring parameters. Two known such parameters are `t` and `extrahosts` for the `/build` endpoint. There may be others. This changes Modem to behave in a similar way: encode values to JSON by default, except the known special cases. This properly fixes apocas/dockerode#605 and effectively reverts apocas#133 and apocas#134.
Most Docker API parameters take JSON values but some array parameters must be passed as multiple querystring parameters. Two known such parameters are `t` and `extrahosts` for the `/build` endpoint. There may be others. This changes Modem to behave in a similar way: encode values to JSON by default, except the known special cases. This properly fixes apocas/dockerode#605 and apocas#139 and effectively reverts apocas#133 and apocas#134.
Previously there was a check if the options field has the key
t
toavoid mistransforming the tags list. On build
extra_hosts
are passedas a JSON string and wouldn't be applied.
We resolve this through checking for an array.
Fixes apocas/dockerode#605