-
Notifications
You must be signed in to change notification settings - Fork 68
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
[YUNIKORN-2541] Upgrade golang.org/x/net for CVEs #135
Closed
Closed
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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.
Don't change these, leave these as they are the replace below will force the later version. Those we can update without the system touching them. The indirect ones are managed by the go module system.
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.
Done. Thanks for the feedback!
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.
Hi @targetoee,
We don't manually change indirect dependency.
However,
golang.org/x/sys v0.18.0 // indirect
could be kept since it was resovled by 'go mod tidy' after upgrade to golang.org/x/net v0.23.0.Here is our previous discussion for indirect/replace directives
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.
Hi @wilfred-s, I still think we have a valid reason(Fix CVE) to update the automatically generated dependencies that were updated by 'go mod tidy'.
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.
I think it's reasonable even though the dependencies will propagate to downstream packages.
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.
Except it doesn't work like that. The purpose of 'go mod tidy' is to remove redundant information and 'tidy up' dependencies. We should never be committing any go.mod / go.sum changes which go against what 'go mod tidy' produces, otherwise every other user will have to undo work that it performs every time. Those dependencies are indirect, and therefore not our responsibility. Instead we use replacements to ensure that our own builds are forced to use newer versions. Please do as Wilfred asks and leave these alone.
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.
Let me explain my thoughts step by step,
We changed ‘replace' directive to 'golang.org/x/net v0.23.0' first.
Then run 'go mod tidy' and it will automatilcally update 'golang.org/x/sys' to v0.18.0. (The minimum required version)
Below is the tidy result:
Since 'replace' directive take higher precedence than indirect dependencies, we should also change the 'replace' directive to 'golang.org/x/sys v0.18.0'. (Otherwise Go will use the outdated version)
So the correct change for this PR is:
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.
Ok, I think I understand now. 'Go mod tidy' updated the indirect version so you are updating the replacement to match. I think that's fine.