Dedupe the several "containerd.io/uncompressed" constants and literals
into `github.com/containerd/containerd/labels.LabelUncompressed`
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Multiple calls to GetCacheContext may occur from multiple threads;
however they should only occur when dealing with an ImmutableRef.
For this case we still need to perform a lock to prevent data race
warnings; however in reality the linkMap will be unused.
Signed-off-by: Alex Couture-Beil <alex@earthly.dev>
All messages returned by os.Open are guaranteed to return a PathError.
However, as these error messages are printed, they include the temporary
directory for the mounted reference which is not useful to the caller.
On an error, we can restore the filename in the PathError to the
requested filename, as also seen in os.DirFS.
Signed-off-by: Justin Chadwell <me@jedevc.com>
The trace logs now also include the pointer value of the ref, which
serves as its "ID" amongst all the refs for the underlying record.
They also now include equal{Mutable,Immutable} IDs, which are otherwise
hard to determine with the Usage API.
Finally, LazyStackTrace now has a MarshalText method which returns the
same value as the existing String method. This allows it to work with
custom logrus hooks that rely on marshaling the fields.
Signed-off-by: Erik Sipsma <erik@sipsma.dev>
Nydus-snapshotter/converter does not record image's blobs digest on
nydus image anymore since it is easy to overflow annotations' limiitations
of Containerd. Nydus-snapshotter now relies on Containerd to GC.
Signed-off-by: Changwei Ge <gechangwei@bytedance.com>
Factorize code that check for an overlay mount type by using a function
instead.
This will allow supporting other overlay-based mount types more easily
in the future (for example fuse-overlayfs).
Signed-off-by: Alexis Murzeau <amubtdx@gmail.com>
When trying to use S3 cache with anonymous credentials (for example, for importing publicly available layers), the cache is not used.
Solution: enable anonymous credentials
According to the API documentation:
"If using the `NewFromConfig` constructor you'll need to explicitly set
the `Credentials` member to nil, if the external config resolved a
credential provider."
Signed-off-by: Yurii Rashkovskii <yrashk@gmail.com>
Port https://github.com/moby/moby/blob/v23.0.1/daemon/oci_linux.go#L430-L460
> // Get the set of mount flags that are set on the mount that contains the given
> // path and are locked by CL_UNPRIVILEGED. This is necessary to ensure that
> // bind-mounting "with options" will not fail with user namespaces, due to
> // kernel restrictions that require user namespace mounts to preserve
> // CL_UNPRIVILEGED locked flags.
Fix issue 3098
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
```
newDesc.Annotations = nil
for _, k := range addAnnotations {
newDesc.Annotations[k] = desc.Annotations[k]
}
```
The codes may cause buildkitd panic: assignment to entry in nil map
Signed-off-by: Yan Song <imeoer@linux.alibaba.com>
In older BuildKit versions snapshotID was not always set if record
was not created with GetByBlob method. Old code defaulted to cache
record ID in that case but that broke with the metadata interface
refactor.
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
By default account name is parsed from request uri host (account url)
but when product style url is disabled, account name is not part of the
host. This new attribute allows to specify the account name in such case.
Also return error if account name is empty.
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>