-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
cli: inconsistent precedence for registry flag #11144
cli: inconsistent precedence for registry flag #11144
Conversation
@risingspiral @alpeb I have a few questions before I proceed,
|
2274b2c
to
d837dc7
Compare
d837dc7
to
926ce87
Compare
@risingspiral @alpeb Can you please review and let me know if something else need to be done here. |
Hi @harsh020 Please take a look at the CI failure on this PR. It look like you may be missing a |
926ce87
to
0962686
Compare
@adleong Oh my! I think I changed
|
@adleong Hey, the
I have made no changes in the install cmd. Please correct me if I'm wrong but the error does not seem to be because of my changes, right? EDIT: Wait what just happened, suddenly the CI that was cancelled automatically passed! Am I missing something or the workflow was retriggered? |
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.
Looks great!
if override := os.Getenv(flags.EnvOverrideDockerRegistry); override != "" { | ||
vals["webhook"].(map[string]interface{})["image"].(map[string]interface{})["name"] = pkgcmd.RegistryOverride(regOrig, override) | ||
} | ||
// CLI flag overrides env variable | ||
if registry != "" { | ||
vals["webhook"].(map[string]interface{})["image"].(map[string]interface{})["name"] = pkgcmd.RegistryOverride(regOrig, registry) |
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.
It appears that the env var stopped working for the linkerd jaeger install
command:
$ LINKERD_DOCKER_REGISTRY=ENV bin/go-run cli jaeger install --ignore-cluster | grep image: | sort | uniq
image: cr.l5d.io/linkerd/jaeger-webhook:dev-09626867-alpeb
image: jaegertracing/all-in-one:1.31
image: otel/opentelemetry-collector:0.59.0
The reason is registry
in this line will always be non-empty, holding its default value pkgcmd.DefaultDockerRegistry
.
As for the previous CI failure, it was just a flake, I re-triggered the tests and they went through 😉
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.
The reason is registry in this line will always be non-empty, holding its default value
Oh! I assumed that that was what we expected (I donno why I assumed it, makes no sense). I have updated the PR, can you please have a look and let me know if I need to take a different approach? Moreover, I'm kind of new to Go so, pls do let me know if I am not following any convention here.
As for the previous CI failure, it was just a flake, I re-triggered the tests and they went through 😉
Thanks a lot! I was just amused by the possibility of auto-re-triggers!
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.
Thanks for the quick turnaround 👍
Can you actually leave the default value for the --registry
flag as it originally was? IMO those defaults should be static and independent of the environment. Maybe the same approach you had for multicluster/cmd/link.go
can work here as well? Just using this at the beginning:
if registry := os.Getenv(flags.EnvOverrideDockerRegistry); registry != "" {
opts.dockerRegistry = registry
}
and then inside render()
leave vals["webhook"].(map[string]interface{})["image"].(map[string]interface{})["name"] = pkgcmd.RegistryOverride(regOrig, registry)
regardless of registry
's content...
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.
Hey @alpeb, I think I'm a bit confused here. When you say don't replace default value in flag do you mean the default variable pkgcmd.DefaultDockerRegistry
(or specifically the value it holds) with some other variable. Because I am doing the same thing as I have done in multicluster/cmd/link.go
, here I have just introduces a new variable deafultRegistry
(in multicluster we had opts). Do you want me to not use this extra variable and replace the value in pkgcmd.DefaultDockerRegistry
itself (I was a bit skeptical about this as maybe it could have messed the global state).
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.
You're right, I take that back, you're doing the same for the link command. And it would require unwarranted added complexity to do it like I suggest.
0962686
to
7c8b201
Compare
Problem: Commands `jaeger install`, `multicluster link` give precedence to `LINKERD_DOCKER_REGISTRY` env var, whereas commands `install`, `upgrade` and `inject` give preference to `--register` flag. Solution: Make the commands consitent by giving precedence to `--register` flag in all commands. Fixes: linkerd#11115 Signed-off-by: Harsh Soni <[email protected]>
7c8b201
to
a434737
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.
Good job!
Problem: Commands `jaeger install`, `multicluster link` give precedence to `LINKERD_DOCKER_REGISTRY` env var, whereas commands `install`, `upgrade` and `inject` give preference to `--register` flag. Solution: Make the commands consitent by giving precedence to `--register` flag in all commands. Fixes: #11115 Signed-off-by: Harsh Soni <[email protected]>
This stable release fixes a regression introduced in stable-2.13.0 which resulted in proxies shedding load too aggressively while under moderate request load to a single service ([#11055]). In addition, it updates the base image for the `linkerd-cni` initcontainer to resolve a CVE in `libdb` ([#11196]), fixes a race condition in the Destination controller that could cause it to crash ([#11163]), as well as fixing a number of other issues. * Control Plane * Fixed a race condition in the destination controller that could cause it to panic ([#11169]; fixes [#11193]) * Improved the granularity of logging levels in the control plane ([#11147]) * Replaced incorrect `server_port_subscribers` gauge in the Destination controller's metrics with `server_port_subscribes` and `server_port_unsubscribes` counters ([#11206]; fixes [#10764]) * Proxy * Changed the default HTTP request queue capacities for the inbound and outbound proxies back to 10,000 requests ([#11198]; fixes [#11055]) * CLI * Updated extension CLI commands to prefer the `--registry` flag over the `LINKERD_DOCKER_REGISTRY` environment variable, making the precedence more consistent (thanks @harsh020!) (see [#11144]) * CNI * Updated `linkerd-cni` base image to resolve [CVE-2019-8457] in `libdb` ([#11196]) * Changed the CNI plugin installer to always run in 'chained' mode; the plugin will now wait until another CNI plugin is installed before appending its configuration ([#10849]) * Removed `hostNetwork: true` from linkerd-cni Helm chart templates ([#11158]; fixes [#11141]) (thanks @abhijeetgauravm!) * Multicluster * Fixed the `linkerd multicluster check` command failing in the presence of lots of mirrored services ([#10764]) [#10764]: #10764 [#10849]: #10849 [#11055]: #11055 [#11141]: #11141 [#11144]: #11144 [#11147]: #11147 [#11158]: #11158 [#11163]: #11163 [#11169]: #11169 [#11196]: #11196 [#11198]: #11198 [#11206]: #11206 [CVE-2019-8457]: https://avd.aquasec.com/nvd/2019/cve-2019-8457/
This stable release fixes a regression introduced in stable-2.13.0 which resulted in proxies shedding load too aggressively while under moderate request load to a single service ([#11055]). In addition, it updates the base image for the `linkerd-cni` initcontainer to resolve a CVE in `libdb` ([#11196]), fixes a race condition in the Destination controller that could cause it to crash ([#11163]), as well as fixing a number of other issues. * Control Plane * Fixed a race condition in the destination controller that could cause it to panic ([#11169]; fixes [#11193]) * Improved the granularity of logging levels in the control plane ([#11147]) * Replaced incorrect `server_port_subscribers` gauge in the Destination controller's metrics with `server_port_subscribes` and `server_port_unsubscribes` counters ([#11206]; fixes [#10764]) * Proxy * Changed the default HTTP request queue capacities for the inbound and outbound proxies back to 10,000 requests ([#11198]; fixes [#11055]) * CLI * Updated extension CLI commands to prefer the `--registry` flag over the `LINKERD_DOCKER_REGISTRY` environment variable, making the precedence more consistent (thanks @harsh020!) (see [#11144]) * CNI * Updated `linkerd-cni` base image to resolve [CVE-2019-8457] in `libdb` ([#11196]) * Changed the CNI plugin installer to always run in 'chained' mode; the plugin will now wait until another CNI plugin is installed before appending its configuration ([#10849]) * Removed `hostNetwork: true` from linkerd-cni Helm chart templates ([#11158]; fixes [#11141]) (thanks @abhijeetgauravm!) * Multicluster * Fixed the `linkerd multicluster check` command failing in the presence of lots of mirrored services ([#10764]) [#10764]: #10764 [#10849]: #10849 [#11055]: #11055 [#11141]: #11141 [#11144]: #11144 [#11147]: #11147 [#11158]: #11158 [#11163]: #11163 [#11169]: #11169 [#11196]: #11196 [#11198]: #11198 [#11206]: #11206 [CVE-2019-8457]: https://avd.aquasec.com/nvd/2019/cve-2019-8457/
This stable release fixes a regression introduced in stable-2.13.0 which resulted in proxies shedding load too aggressively while under moderate request load to a single service ([#11055]). In addition, it updates the base image for the `linkerd-cni` initcontainer to resolve a CVE in `libdb` ([#11196]), fixes a race condition in the Destination controller that could cause it to crash ([#11163]), as well as fixing a number of other issues. * Control Plane * Fixed a race condition in the destination controller that could cause it to panic ([#11169]; fixes [#11193]) * Improved the granularity of logging levels in the control plane ([#11147]) * Proxy * Changed the default HTTP request queue capacities for the inbound and outbound proxies back to 10,000 requests ([#11198]; fixes [#11055]) * CLI * Updated extension CLI commands to prefer the `--registry` flag over the `LINKERD_DOCKER_REGISTRY` environment variable, making the precedence more consistent (thanks @harsh020!) (see [#11144]) * CNI * Updated `linkerd-cni` base image to resolve [CVE-2019-8457] in `libdb` ([#11196]) * Changed the CNI plugin installer to always run in 'chained' mode; the plugin will now wait until another CNI plugin is installed before appending its configuration ([#10849]) * Removed `hostNetwork: true` from linkerd-cni Helm chart templates ([#11158]; fixes [#11141]) (thanks @abhijeetgauravm!) * Multicluster * Fixed the `linkerd multicluster check` command failing in the presence of lots of mirrored services ([#10764]) [#10764]: #10764 [#10849]: #10849 [#11055]: #11055 [#11141]: #11141 [#11144]: #11144 [#11147]: #11147 [#11158]: #11158 [#11163]: #11163 [#11169]: #11169 [#11196]: #11196 [#11198]: #11198 [CVE-2019-8457]: https://avd.aquasec.com/nvd/2019/cve-2019-8457/
Fixes: #11115
Problem:
Commands
jaeger install
,multicluster link
give precedence toLINKERD_DOCKER_REGISTRY
env var, whereas commandsinstall
,upgrade
andinject
give preference to--register
flag.Solution:
Make the commands consitent by giving precedence to
--register
flag in all commands.Tasks:
jaeger install
give precedence to--register
multicluster link
give precedence to--register