From: Guillaume Tucker <gtucker@gtucker.io>
To: Nathan Chancellor <nathan@kernel.org>,
Nicolas Schier <nsc@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
Miguel Ojeda <ojeda@kernel.org>
Cc: "Onur Özkan" <work@onurozkan.dev>,
linux-doc@vger.kernel.org, workflows@vger.kernel.org,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] scripts: add --registry option to container tool
Date: Sun, 11 Oct 2026 23:13:12 +0200 [thread overview]
Message-ID: <b72d17f6-653d-4e11-ad07-b532bb83b20a@gtucker.io> (raw)
In-Reply-To: <06ee7c694c3e9716bff5c9b1b8e9dc95cc0b38d3.1791751900.git.gtucker@gtucker.io>
On 11/10/2026 10:54 pm, Guillaume Tucker wrote:
> Add a --registry / -R command line argument to the container tool to
> specify an altnerative image registry and support it in the TOML
> configuration file accordingly.
>
> This uses a mechanism based on regular expressions to parse the
> container registry and image names and construct the final one based
> on a set of priority rules. A registry can be included directly in an
> image name; an empty string means a local image. It can then be
> overridden by explicitly specifying a registry name via the CLI option
> or the TOML file, with the CLI option taking precedence as always.
>
> Signed-off-by: Guillaume Tucker <gtucker@gtucker.io>
> ---
> scripts/container | 126 ++++++++++++++++++++++++++++++++++++++++++----
> 1 file changed, 117 insertions(+), 9 deletions(-)
>
> diff --git a/scripts/container b/scripts/container
> index a3a55180d6ed..de72725656a8 100755
> --- a/scripts/container
> +++ b/scripts/container
[...]
> +@dataclasses.dataclass
> +class FullImageName(ImageParserMixin):
> + """Parsed image name including an optional registry"""
> + image: ImageName
> + registry: RegistryName = None
> + _regex = re.compile(
> + rf'^((?P<registry>{REGISTRY_REGEX})\/)?(?P<image>{IMAGE_REGEX})?$'
> + )
> +
> + @property
> + def name(self):
> + """Full name in registry/image:tag format with optional registry"""
> + return (
> + '/'.join((self.registry.registry, self.image.image))
> + if self.registry else self.image.image
> + )
> +
> + @classmethod
> + def from_name(cls, name):
> + if re_match := cls._regex.match(name):
> + fields = re_match.groupdict()
> + return FullImageName(
> + registry=RegistryName.from_fields(fields),
> + image=ImageName.from_fields(fields),
> + )
> + return None
> +
> +
As one would expect, Sashiko has some opinions about this:
https://sashiko.dev/#/patchset/06ee7c694c3e9716bff5c9b1b8e9dc95cc0b38d3.1791751900.git.gtucker%40gtucker.io
I would say that at least half of it is slightly bogus but I'll
address them in detail in due time. Also I've prepared some unit
tests to cover this logic and will send them as an RFC separately.
In the meantime, I'd be interested to know if anyone has some
feedback on the features themselves from a developer point of view.
Best wishes,
Guillaume
next prev parent reply other threads:[~2026-10-11 21:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-11 20:54 Guillaume Tucker
2026-10-11 20:54 ` [PATCH 2/2] Documentation: dev-tools: cover registry option in container.rst Guillaume Tucker
2026-10-12 21:48 ` Guillaume Tucker
2026-10-11 21:13 ` Guillaume Tucker [this message]
2026-10-12 21:31 ` [PATCH 1/2] scripts: add --registry option to container tool Guillaume Tucker
2026-11-05 4:29 ` Nathan Chancellor
2026-11-14 13:15 ` Guillaume Tucker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b72d17f6-653d-4e11-ad07-b532bb83b20a@gtucker.io \
--to=gtucker@gtucker.io \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=ojeda@kernel.org \
--cc=work@onurozkan.dev \
--cc=workflows@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®