From 36aa99d7f164d4425e2571c801a8be3391383459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=AA=20de=20Souza=20Pinto?= Date: Tue, 10 Dec 2024 12:15:55 +0100 Subject: [PATCH] Bump eve-libs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bump eve-libs in order to incorporate a fix to work with some container registries. Signed-off-by: RenĂª de Souza Pinto --- pkg/pillar/go.mod | 2 +- pkg/pillar/go.sum | 4 ++-- .../github.com/lf-edge/eve-libs/nettrace/dial.go | 15 +++++++++++++++ .../lf-edge/eve-libs/zedUpload/azureutil/azure.go | 4 ++-- .../lf-edge/eve-libs/zedUpload/ociutil/oci.go | 4 +++- pkg/pillar/vendor/modules.txt | 2 +- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/pkg/pillar/go.mod b/pkg/pillar/go.mod index 9e5ee99d00..5c99a0977b 100644 --- a/pkg/pillar/go.mod +++ b/pkg/pillar/go.mod @@ -31,7 +31,7 @@ require ( github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.5.0 github.com/lf-edge/edge-containers v0.0.0-20240207093504-5dfda0619b80 github.com/lf-edge/eve-api/go v0.0.0-20241202084032-46c0a58dc84c - github.com/lf-edge/eve-libs v0.0.0-20240614221125-6913ec4213f9 + github.com/lf-edge/eve-libs v0.0.0-20241210085709-fc89dcac7f3c github.com/lf-edge/eve/pkg/kube/cnirpc v0.0.0-20240315102754-0f6d1f182e0d github.com/lf-edge/go-qemu v0.0.0-20231121152149-4c467eda0c56 github.com/linuxkit/linuxkit/src/cmd/linuxkit v0.0.0-20240507172735-6d37353ca1ee diff --git a/pkg/pillar/go.sum b/pkg/pillar/go.sum index 90d5043ef3..4aaee52b78 100644 --- a/pkg/pillar/go.sum +++ b/pkg/pillar/go.sum @@ -1434,8 +1434,8 @@ github.com/lf-edge/edge-containers v0.0.0-20240207093504-5dfda0619b80 h1:kiqB1Rk github.com/lf-edge/edge-containers v0.0.0-20240207093504-5dfda0619b80/go.mod h1:4yXdumKdTzF0URMtxOl8Xnzdxnoy1QR+2dzfOr4CIZY= github.com/lf-edge/eve-api/go v0.0.0-20241202084032-46c0a58dc84c h1:axc1BfKlb6MmvbxPhCMW427b+Wxn7u/5PxdqbvYmm6k= github.com/lf-edge/eve-api/go v0.0.0-20241202084032-46c0a58dc84c/go.mod h1:ot6MhAhBXapUDl/hXklaX4kY88T3uC4PTg0D2wD8DzA= -github.com/lf-edge/eve-libs v0.0.0-20240614221125-6913ec4213f9 h1:blXdD227+xDCsezw8gTlk5Kh0ONb5ZekkH4lLnV4J04= -github.com/lf-edge/eve-libs v0.0.0-20240614221125-6913ec4213f9/go.mod h1:bz9uyBFalnRnzXl6A4oAsO7CLJfW01ZR/sT0Frqa6o8= +github.com/lf-edge/eve-libs v0.0.0-20241210085709-fc89dcac7f3c h1:PN0cNV+Rwq6T358PYyuaFr3MU9xjUCPTHtUwepMACac= +github.com/lf-edge/eve-libs v0.0.0-20241210085709-fc89dcac7f3c/go.mod h1:32koNJxwKDrVL7rBLy35QzjIuMvGy6+BmLjf8Y38MQU= github.com/lf-edge/eve/pkg/kube/cnirpc v0.0.0-20240315102754-0f6d1f182e0d h1:tUBb9M6u42LXwHAYHyh22wJeUUQlTpDkXwRXalpRqbo= github.com/lf-edge/eve/pkg/kube/cnirpc v0.0.0-20240315102754-0f6d1f182e0d/go.mod h1:Nn3juMJJ1G8dyHOebdZyS4jOB/fuxAd5fIajBaWjHr8= github.com/lf-edge/go-qemu v0.0.0-20231121152149-4c467eda0c56 h1:LmFp0jbNSwPLuxJA+nQ+mMQrQ53ESkvHP4CVMqR0zrY= diff --git a/pkg/pillar/vendor/github.com/lf-edge/eve-libs/nettrace/dial.go b/pkg/pillar/vendor/github.com/lf-edge/eve-libs/nettrace/dial.go index 4442263bbd..1ff26b8782 100644 --- a/pkg/pillar/vendor/github.com/lf-edge/eve-libs/nettrace/dial.go +++ b/pkg/pillar/vendor/github.com/lf-edge/eve-libs/nettrace/dial.go @@ -106,7 +106,18 @@ func newTracedDialer(tracer tracerWithDial, log Logger, sourceIP net.IP, } } +// dial implement DialContext method of the net.Dialer interface. func (td *tracedDialer) dial(ctx context.Context, network, address string) (net.Conn, error) { + // Note that if the overall timeout to the http.Client is reached, this dial() method + // may simply be abandoned. You cannot expect any goroutine or defer to be reached. + // This matters in that this routine expects to set the following parameters: + // - dialTrace.DialTrace.CtxCloseAt + // - dialTrace.DialEndAt + // - dialTrace.ctxClosed + // + // Anything that expects those to be set, should *not* expect them to be set + // if http.Client times out. + // Prepare the original Dialer from the net package. var sourceAddr net.Addr if td.sourceIP != nil { @@ -146,6 +157,10 @@ func (td *tracedDialer) dial(ctx context.Context, network, address string) (net. dial.SourceIP = td.sourceIP.String() } td.tracer.publishTrace(dial) + + // if the http.Client.Timeout is reached, this will *not* return an error. + // It simply will be abandoned. Listening for a ctx.Done() or setting a defer() + // will not help either. conn, err := netDialer.DialContext(ctx, network, address) resolver.close() dial.justBegan = false diff --git a/pkg/pillar/vendor/github.com/lf-edge/eve-libs/zedUpload/azureutil/azure.go b/pkg/pillar/vendor/github.com/lf-edge/eve-libs/zedUpload/azureutil/azure.go index 27056688d1..d493c430e9 100644 --- a/pkg/pillar/vendor/github.com/lf-edge/eve-libs/zedUpload/azureutil/azure.go +++ b/pkg/pillar/vendor/github.com/lf-edge/eve-libs/zedUpload/azureutil/azure.go @@ -95,7 +95,7 @@ func newPipeline(accountName, accountKey string, httpClient *http.Client) (pipel } credential, err := azblob.NewSharedKeyCredential(accountName, accountKey) if err != nil { - return nil, fmt.Errorf("Invalid credentials with error: " + err.Error()) + return nil, fmt.Errorf("invalid credentials with error: %s", err.Error()) } p := azblob.NewPipeline(credential, azblob.PipelineOptions{ HTTPSender: sender, @@ -457,7 +457,7 @@ func GetAzureBlobMetaData(accountURL, accountName, accountKey, containerName, re func GenerateBlobSasURI(accountURL, accountName, accountKey, containerName, remoteFile string, httpClient *http.Client, duration time.Duration) (string, error) { credential, err := azblob.NewSharedKeyCredential(accountName, accountKey) if err != nil { - return "", fmt.Errorf("Invalid credentials with error: " + err.Error()) + return "", fmt.Errorf("invalid credentials with error: %s", err.Error()) } // Checking whether blob exists or not before generating SAS URI diff --git a/pkg/pillar/vendor/github.com/lf-edge/eve-libs/zedUpload/ociutil/oci.go b/pkg/pillar/vendor/github.com/lf-edge/eve-libs/zedUpload/ociutil/oci.go index 314594966f..be4cc17bd9 100644 --- a/pkg/pillar/vendor/github.com/lf-edge/eve-libs/zedUpload/ociutil/oci.go +++ b/pkg/pillar/vendor/github.com/lf-edge/eve-libs/zedUpload/ociutil/oci.go @@ -137,7 +137,9 @@ func PullBlob(registry, repo, hash, localFile, username, apiKey string, maxsize } size, err = layer.Size() if err != nil { - return 0, "", fmt.Errorf("could not get layer size %s: %v", ref.String(), err) + // Registry didn't reply correctly the HEAD request for size, fallback to the maxsize + size = maxsize + logrus.Errorf("could not get layer size %s: %v, trying maxsize %d ...", ref.String(), err, size) } } diff --git a/pkg/pillar/vendor/modules.txt b/pkg/pillar/vendor/modules.txt index f33c26f66e..9b558078b7 100644 --- a/pkg/pillar/vendor/modules.txt +++ b/pkg/pillar/vendor/modules.txt @@ -652,7 +652,7 @@ github.com/lf-edge/eve-api/go/logs github.com/lf-edge/eve-api/go/metrics github.com/lf-edge/eve-api/go/profile github.com/lf-edge/eve-api/go/register -# github.com/lf-edge/eve-libs v0.0.0-20240614221125-6913ec4213f9 +# github.com/lf-edge/eve-libs v0.0.0-20241210085709-fc89dcac7f3c ## explicit; go 1.20 github.com/lf-edge/eve-libs/depgraph github.com/lf-edge/eve-libs/nettrace