-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
consul/connect: fix regression where client connect images ignored #9624
Conversation
Spot check every combination. From lowest to highest precedence:
|
76bc2ea
to
c488a91
Compare
c488a91
to
5e5f460
Compare
Nomad v1.0.0 introduced a regression where the client configurations for `connect.sidecar_image` and `connect.gateway_image` would be ignored despite being set. This PR restores that functionality. There was a missing layer of interpolation that needs to occur for these parameters. Since Nomad 1.0 now supports dynamic envoy versioning through the ${NOMAD_envoy_version} psuedo variable, we basically need to first interpolate ${connect.sidecar_image} => envoyproxy/envoy:v${NOMAD_envoy_version} then use Consul at runtime to resolve to a real image, e.g. envoyproxy/envoy:v${NOMAD_envoy_version} => envoyproxy/envoy:v1.16.0 Of course, if the version of Consul is too old to provide an envoy version preference, we then need to know to fallback to the old version of envoy that we used before. envoyproxy/envoy:v${NOMAD_envoy_version} => envoyproxy/envoy:v1.11.2@sha256:a7769160c9c1a55bb8d07a3b71ce5d64f72b1f665f10d81aa1581bc3cf850d09 Beyond that, we also need to continue to support jobs that set the sidecar task themselves, e.g. sidecar_task { config { image: "custom/envoy" } } which itself could include teh pseudo envoy version variable.
5e5f460
to
f0f6f3a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -96,6 +105,54 @@ func TestEnvoyVersionHook_tweakImage(t *testing.T) { | |||
}) | |||
} | |||
|
|||
func TestEnvoyVersionHook_interpolateImage(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solid test coverage here 👍
consul/connect: fix regression where client connect images ignored
We are running Nomad v1.0.2 |
Hi @HarryHarcourt! I think you want: client {
meta {
"connect.sidecar_image" = "artifactory.standard.com/docker/envoy:1.11.2"
}
} But if that doesn't work for you please open a new issue. By the way, the |
Confirmed that this works. |
@HarryHarcourt its just the standard nomad "client" configuration. Not specific plugins or drivers around them.
Please ignore our templating lol |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Nomad v1.0.0 introduced a regression where the client configurations
for
connect.sidecar_image
andconnect.gateway_image
would beignored despite being set. This PR restores that functionality.
There was a missing layer of interpolation that needs to occur for
these parameters. Since Nomad 1.0 now supports dynamic envoy versioning
through the ${NOMAD_envoy_version} psuedo variable, we basically need
to first interpolate
then use Consul at runtime to resolve to a real image, e.g.
Of course, if the version of Consul is too old to provide an envoy
version preference, we then need to know to fallback to the old
version of envoy that we used before.
Beyond that, we also need to continue to support jobs that set the
sidecar task themselves, e.g.
which itself could include the pseudo envoy version variable.
Fixes #9618