-
Notifications
You must be signed in to change notification settings - Fork 247
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
Move to golang 1.18 and later #1522
Conversation
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 👍
@@ -256,8 +256,9 @@ func TestCopyErrDstNotDir(t *testing.T) { | |||
// | |||
|
|||
// A. SRC specifies a file and DST (no trailing path separator) doesn't | |||
// exist. This should create a file with the name DST and copy the | |||
// contents of the source file into it. | |||
// |
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.
Extra blank line added in the middle of a paragraph. Happens several times below as well, and in meminfo_*.go
.
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.
This patch was done with:
$ find . -name *go -exec gofmt -s -w {} ; -print
Followed by make vendor-in-container.
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.
This patch was done with:
$ find . -name *go -exec gofmt -s -w {} ; -print
Okay, that would also modify sources in vendored dependencies, which we don't want to be doing.
Followed by make vendor-in-container.
The target doesn't touch vendored dependencies under tests/tools
, which I think is what this warning notification was focusing on. Maybe go get golang.org/x/sys && go mod vendor && go mod tidy
from there?
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.
This has not been resolved.
This modifies many files under |
3f23a3c
to
602f16b
Compare
@cevich Any idea on the vendor failure. Is this a matter of updating the golang inside of the VMs? |
That's strange...the fedora 37 VMs should be on 1.19...looking... |
...oh! This task is running in a container, that's where the version comes from. In vendor_task:
container:
image: golang
modules_cache:
fingerprint_script: cat go.sum
folder: $GOPATH/pkg/mod
build_script: make vendor
test_script: hack/tree_status.sh That's confusing. It means multiple files need to be updated to reflect a new version in CI. Ugg. Let me see if I can make this task follow the latest Fedora VM instead... |
...nvm, it seems you know what you're doing. |
This may also require a bump to the version of the linter installed in |
c210f33
to
79904c7
Compare
07174e4
to
e9121ae
Compare
e2a8747
to
0765cc7
Compare
@nalind Any idea what is going wrong now? |
When I ran it locally, "mount-image" (image-mount.bats:17) failed because |
Thanks for pointing to those files, which I have no idea where they came from. |
@@ -21,7 +21,8 @@ import ( | |||
// ├── d2 # opaque, 0750 | |||
// │ └── f1 # empty file, 0660 | |||
// └── d3 # 0700 | |||
// └── f1 # whiteout, 0000 | |||
// |
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.
Extra blank line inserted here for some reason.
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.
GO fmt is doing this I belive.
pkg/chunked/cache_linux.go
Outdated
@@ -398,7 +398,8 @@ func prepareMetadata(manifest []byte) ([]*internal.FileMetadata, error) { | |||
toc, err := unmarshalToc(manifest) | |||
if err != nil { | |||
// ignore errors here. They might be caused by a different manifest format. | |||
return nil, nil | |||
logrus.Debugf("could not unmasshal manifest: %v", err) |
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.
Typo: "unmasshal" should be "unmarshal".
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.
Fixed
@@ -149,7 +150,7 @@ func readEstargzChunkedManifest(blobStream ImageSourceSeekable, blobSize int64, | |||
// readZstdChunkedManifest reads the zstd:chunked manifest from the seekable stream blobStream. The blob total size must | |||
// be specified. | |||
// This function uses the io.github.containers.zstd-chunked. annotations when specified. | |||
func readZstdChunkedManifest(blobStream ImageSourceSeekable, blobSize int64, annotations map[string]string) ([]byte, int64, error) { | |||
func readZstdChunkedManifest(ctx context.Context, blobStream ImageSourceSeekable, blobSize int64, annotations map[string]string) ([]byte, int64, error) { |
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.
What's the reason behind adding the context argument here? It doesn't appear to be used.
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.
There was a linter that was complaining about it, so I added it and then had to nolint below. I can remove this, but I think we should start to use more of the linters for storage.
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.
-
decoder, err := zstd.NewReader(nil) //nolint:contextcheck
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 context check wants it passed in here, but I did not know the code well enough to add it. @giuseppe PTAL
// 03,1-3 <- this is gonna get parsed as [1,2,3] | ||
// 3,2,1 | ||
// 0-2,3,1 | ||
// |
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.
Extra blank line inserted.
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 go fmt is doing this.
Github.com is reporting security issues on older versions of golang. Signed-off-by: Daniel J Walsh <[email protected]>
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
Github.com is reporting security issues on older versions of golang.