Skip to content

Conversation

@bege13mot
Copy link
Contributor

@bege13mot bege13mot commented Oct 17, 2019

@rhatdan
Copy link
Member

rhatdan commented Oct 21, 2019

@bege13mot You need sign all of your PRs
Also needs a rebase.

@bege13mot
Copy link
Contributor Author

@bege13mot You need sign all of your PRs
Also needs a rebase.

Thank you, I've signed all commits, but unfortunately, I'm not sure about rebasing. Could you please help a little bit with it?

@vrothberg
Copy link
Member

You need to rebase on the most recent commit on master. There are many ways to do that. I usually keep the upstream projects as a remote:

$ git remote add upstream [email protected]:containers/image.git
$ git remote update
# now can rebase our branch on top of upstream/master
$ git pull --rebase upstream master

@bege13mot
Copy link
Contributor Author

Thank you

@bege13mot
Copy link
Contributor Author

bege13mot commented Oct 22, 2019

Unfortunately, still can't pass the test:

cmd/skopeo/layers.go:145:28: not enough arguments in call to dest.PutManifest
	have (context.Context, []byte)
	want (context.Context, []byte, *digest.Digest)
cmd/skopeo/layers.go:149:20: not enough arguments in call to dest.Commit
	have (context.Context)
	want (context.Context, types.UnparsedImage)

@vrothberg
Copy link
Member

I restarted Travis. We had to update Skopeo to unblock the CI here.

@vrothberg
Copy link
Member

Commit eae61fa must be dropped from this PR.

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use more descriptive commit messages. "Fix ABC" is not enough to describe what's going on. "Fix" is a very generic (and overused) term. "Check all errors in ABC" would be more descriptive. Good commit messages are especially important for maintenance.

A more detailed review follows in a bit.

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for opening the PR, @bege13mot!

As mentioned before, the commit messages must be more descriptive and also explain/justify why certain changes are okay (e.g., dead-code removal). I dropped comments where I would like some further changes (e.g., log errors instead of ignoring). Also, I found a couple of changes that seem unrelated to golangci-lint. Please make sure that those are not part of this PR. We can address them in a separate PR.

@bege13mot
Copy link
Contributor Author

Hi @vrothberg ,
Thank you very much for your review.

@TomSweeneyRedHat
Copy link
Member

CI tests are not at all happy.

@bege13mot
Copy link
Contributor Author

CI tests are not at all happy.

Hi, it looks like an issue with containers/skopeo

/tmp/tmp.hP4WQEvbic/src/github.com/containers/skopeo/hack/make/validate-lint: line 14: golint: command not found
2055Makefile:175: recipe for target 'validate-local' failed

defer clientCertFile.Close()
defer func() {
err = clientCertFile.Close()
logrus.Debugf("error closing client cert CA: %v", err)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two copy&pasted errors here and below are incorrect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm not clear about these copy&pasted errors

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text of the 3 Debugf messages is the same (“closing client CA”), but only one of them actually closes a client CA; the other two should be updated to match what actually failed (client certificate/key file).

@mtrmac
Copy link
Collaborator

mtrmac commented Oct 23, 2019

Hi, it looks like an issue with containers/skopeo

/tmp/tmp.hP4WQEvbic/src/github.com/containers/skopeo/hack/make/validate-lint: line 14: golint: command not found
Makefile:175: recipe for target 'validate-local' failed

At a first glance, this looks like an issue in how this PR changes the environment for make test-skopeo to me.

@vrothberg
Copy link
Member

@bege13mot, can you rebase? We had some CI flakes that are fixed now.

One thing I just noticed now is that all commits are not signed with your real name but with the GitHub user which is in conflict with the contributing policies (https://github.com/containers/image/blob/master/CONTRIBUTING.md). My apologies for noticing that late.

@mtrmac
Copy link
Collaborator

mtrmac commented Nov 26, 2019

This is now very big, and likely enough to break if any other PR is merged. Maybe it would be more practical to split it into smaller PRs? (Definitely no need to split it artificially just because I said so now — but, if the rebase happens one commit at a time, maybe separate 10 unrelated commits into a separate PR.)

Ideally, of course, a rebased version would pass tests, be quickly reviewed, and immediately merged; splitting this is distinctly second best. Still, a possible option.

@vrothberg
Copy link
Member

I think something went wrong while rebasing since there are many older commits unrelated to this PR.

@vrothberg
Copy link
Member

Failures look legit:

package github.com/golangci/golangci-lint: no Go files in /gopath/src/github.com/golangci/golangci-lint

Makefile:58: recipe for target 'tools.timestamp' failed

@rhatdan
Copy link
Member

rhatdan commented Nov 27, 2019

@vrothberg @mtrmac Tests pass, is this ready to merge?
@bege13mot thanks for all of the work on this?

@vrothberg
Copy link
Member

@vrothberg @mtrmac Tests pass, is this ready to merge?
@bege13mot thanks for all of the work on this?

I'll do one final review now 👍

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just very minor nits left, and we're ready to merge. Thanks for the nice contribution and the long breath, @bege13mot !

Makefile Outdated

tools.timestamp: Makefile
@GO111MODULE="off" go get -u $(BUILDFLAGS) golang.org/x/lint/golint
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sudo sh -s -- -b $(go env GOPATH)/bin v1.21.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please drop sudo. It's not needed. We should also first check if golangci-lint isn't already installed and only install if needed. An example how to do that is in libpod: https://github.com/containers/libpod/blob/master/Makefile#L483

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, it isn't help.
`install: cannot create regular file '//golangci-lint': Permission denied``

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️

“help” or not, this project absolutely must not create files in the root directory of the user’s filesystem!

If using sudo here really has that effect, it must be removed, pretty much at any cost, up to and including not running golang-ci, if there were really no alternative.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix that. $(go env GOPATH) didn't evaluate here for some odd reason.

// deterministic behavior which is not guaranteed by maps.
for _, reg := range config.Registries {
others, _ := regMap[reg.Location]
others := regMap[reg.Location]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @mtrmac. We should address it.

layers, err := s.imageRef.transport.store.LayersByUncompressedDigest(info.Digest)
if err != nil {
return nil, -1, "", err
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's ignore the error here. It's really okay if there's an error here as we might need to lookup the compresssed digest. The log here could cause confusing noise.

Signed-off-by: bege13mot <[email protected]>
Signed-off-by: bege13mot <[email protected]>
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@rhatdan PTAL. Once this is merged, I'll tackle the install targets to make them consistent with Buildah, Podman etc.

@rhatdan
Copy link
Member

rhatdan commented Nov 27, 2019

LGTM

@rhatdan rhatdan merged commit d13a90f into containers:master Nov 27, 2019
mtrmac added a commit to mtrmac/image that referenced this pull request Dec 8, 2022
sockets.DialerFromEnvironment seems to implement an all_proxy
environment variable.

Either way, since containers#731 the
return value was ignored, making that code completely ineffective,
and noone has complained for three years.

So let's just drop it.

Signed-off-by: Miloslav Trmač <[email protected]>
mtrmac added a commit to mtrmac/image that referenced this pull request Oct 14, 2023
containers#731 introduced
a WaitGroup which is waited but never signaled, and a nonsensical
error reporting mechanism (where errors are pushed but don't terminate
future operations).

Instead, rely on PipeWriter.CloseWithError() to propagate failures
from the goroutine.

And move all of the body of the goroutine into a separate function,
so that we can use defer() to ensure CloseWithError() is _always_
called.

Signed-off-by: Miloslav Trmač <[email protected]>
mtrmac added a commit to mtrmac/image that referenced this pull request Oct 14, 2023
containers#731 introduced
a WaitGroup which is waited but never signaled, and a nonsensical
error reporting mechanism (where errors are pushed but don't terminate
future operations).

Instead, rely on PipeWriter.CloseWithError() to propagate failures
from the goroutine.

And move all of the body of the goroutine into a separate function,
so that we can use defer() to ensure CloseWithError() is _always_
called.

Signed-off-by: Miloslav Trmač <[email protected]>
mtrmac added a commit to mtrmac/image that referenced this pull request Oct 19, 2023
containers#731 introduced
a WaitGroup which is waited but never signaled, and a nonsensical
error reporting mechanism (where errors are pushed but don't terminate
future operations).

Instead, rely on PipeWriter.CloseWithError() to propagate failures
from the goroutine.

And move all of the body of the goroutine into a separate function,
so that we can use defer() to ensure CloseWithError() is _always_
called.

Signed-off-by: Miloslav Trmač <[email protected]>
mtrmac added a commit to mtrmac/image that referenced this pull request Oct 24, 2023
containers#731 introduced
a WaitGroup which is waited but never signaled, and a nonsensical
error reporting mechanism (where errors are pushed but don't terminate
future operations).

Instead, rely on PipeWriter.CloseWithError() to propagate failures
from the goroutine.

And move all of the body of the goroutine into a separate function,
so that we can use defer() to ensure CloseWithError() is _always_
called.

Signed-off-by: Miloslav Trmač <[email protected]>
kwilczynski pushed a commit to kwilczynski/image that referenced this pull request Jan 5, 2025
containers#731 introduced
a WaitGroup which is waited but never signaled, and a nonsensical
error reporting mechanism (where errors are pushed but don't terminate
future operations).

Instead, rely on PipeWriter.CloseWithError() to propagate failures
from the goroutine.

And move all of the body of the goroutine into a separate function,
so that we can use defer() to ensure CloseWithError() is _always_
called.

Signed-off-by: Miloslav Trmač <[email protected]>
kwilczynski pushed a commit to kwilczynski/image that referenced this pull request Jan 5, 2025
containers#731 introduced
a WaitGroup which is waited but never signaled, and a nonsensical
error reporting mechanism (where errors are pushed but don't terminate
future operations).

Instead, rely on PipeWriter.CloseWithError() to propagate failures
from the goroutine.

And move all of the body of the goroutine into a separate function,
so that we can use defer() to ensure CloseWithError() is _always_
called.

Signed-off-by: Miloslav Trmač <[email protected]>
kwilczynski pushed a commit to kwilczynski/image that referenced this pull request Jan 6, 2025
containers#731 introduced
a WaitGroup which is waited but never signaled, and a nonsensical
error reporting mechanism (where errors are pushed but don't terminate
future operations).

Instead, rely on PipeWriter.CloseWithError() to propagate failures
from the goroutine.

And move all of the body of the goroutine into a separate function,
so that we can use defer() to ensure CloseWithError() is _always_
called.

Signed-off-by: Miloslav Trmač <[email protected]>
kwilczynski pushed a commit to kwilczynski/image that referenced this pull request Jan 6, 2025
containers#731 introduced
a WaitGroup which is waited but never signaled, and a nonsensical
error reporting mechanism (where errors are pushed but don't terminate
future operations).

Instead, rely on PipeWriter.CloseWithError() to propagate failures
from the goroutine.

And move all of the body of the goroutine into a separate function,
so that we can use defer() to ensure CloseWithError() is _always_
called.

Signed-off-by: Miloslav Trmač <[email protected]>
kwilczynski pushed a commit to kwilczynski/image that referenced this pull request Jan 7, 2025
containers#731 introduced
a WaitGroup which is waited but never signaled, and a nonsensical
error reporting mechanism (where errors are pushed but don't terminate
future operations).

Instead, rely on PipeWriter.CloseWithError() to propagate failures
from the goroutine.

And move all of the body of the goroutine into a separate function,
so that we can use defer() to ensure CloseWithError() is _always_
called.

Signed-off-by: Miloslav Trmač <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants