-
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
Merged
alpeb
merged 1 commit into
linkerd:main
from
harsh020:inconsitent-precedent-for-registry-cmd
Jul 28, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:The reason is
registry
in this line will always be non-empty, holding its default valuepkgcmd.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.
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.
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 formulticluster/cmd/link.go
can work here as well? Just using this at the beginning:and then inside
render()
leavevals["webhook"].(map[string]interface{})["image"].(map[string]interface{})["name"] = pkgcmd.RegistryOverride(regOrig, registry)
regardless ofregistry
'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 inmulticluster/cmd/link.go
, here I have just introduces a new variabledeafultRegistry
(in multicluster we had opts). Do you want me to not use this extra variable and replace the value inpkgcmd.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.