Commit Graph
333 Commits
Author SHA1 Message Date
Tonis Tiigi a3147eba54 vendor: update buildkit to v0.30.0-rc1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-05-06 15:06:54 -07:00
Sebastiaan van Stijn a3512c1cfa util/ocilayout: replace regex for matching windows drive-letters
follow-up to bf34a4cbed, which changed the
isWindowsDrivePath function to use a regex for matching the trailing slash.

This reverts it back to te previous implementation to avoid a regex, but
adds a check for the colon to be followed by a forward-slash, which is
faster, and avoids the overhead of `regex.MustCompile` during init.

    BenchmarkRegex-11    39056917      32.45 ns/op     0 B/op    0 allocs/op
    BenchmarkManual-11   1000000000     0.2476 ns/op   0 B/op    0 allocs/op

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2026-05-04 12:07:18 +02:00
CrazyMax bf34a4cbed ocilayout: narrow Windows drive path detection
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-04-27 10:19:01 +02:00
CrazyMax dcf533e756 build: fix oci-layout named context serialization
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-04-23 12:26:02 +02:00
CrazyMax 2d58ee6f98 ocilayout: handle Windows paths in local OCI layout refs
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-04-22 11:38:34 +02:00
CrazyMax 4f89a2407a gitutil: use BuildKit urlutil.RedactCredentials for remote URLs
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-04-09 15:04:37 +02:00
CrazyMax 720f91fdd4 gitutil: migrate to BuildKit GitCLI API
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-04-09 14:57:38 +02:00
Tonis Tiigi a57372e966 policy: add HTTP PGP signature verification builtin
Add verify_http_pgp_signature Rego builtin for HTTP sources using
pgpsign with checksum-request/response flow through policy resolution.
Wire sourcemeta HTTP checksum request/response conversion and add tests.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-26 15:39:46 -07:00
Tõnis TiigiandGitHub a0a8f63cd5 Merge pull request #3730 from crazy-max/history-mv-buildname
history: move BuildName to util/history
2026-03-19 16:55:45 -07:00
Tõnis TiigiandGitHub 771e0de740 Merge pull request #3732 from tonistiigi/imagetools-manifest-regex
imagetools: use regex for manifest template matching
2026-03-18 18:25:27 -07:00
Tonis Tiigi 78439e263b imagetools: use regex for manifest template matching
Allow optional whitespace inside the {{.Manifest}} template
delimiters when detecting whole-manifest format strings.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-17 17:46:01 -07:00
Tonis Tiigi e4f6e373af imagetools: share ingester across concurrent copies
Reuse a single ingester per target repository when imagetools create
copies multiple manifests in parallel.

This lets the pushing ingester serialize same-digest pushes and avoids
racing duplicate blob uploads against registries to work around bug in
Registry v3.0.0 (and possibly others).

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-17 17:18:55 -07:00
CrazyMax b272a37d46 history: move BuildName to util/history
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-17 23:49:53 +01:00
CrazyMax c4e9dfcad9 bundle: use all node content stores during export
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-17 11:08:18 +01:00
Tonis Tiigi 863398c789 imagetools: pass referrer filter opts to oci-layout path
FetchReferrers accepted FetchReferrersOpt but dropped them
when resolving OCI layout referrers. Forward the options and
apply ArtifactTypes filtering so callers can narrow results
consistently for both registry and local layout sources.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-12 23:15:01 -07:00
Tonis Tiigi 6eb48d9c8c imagetools: fix oci-layout index update when blob exists
When pushing to an OCI layout where the top-level descriptor
blob already existed, pushOCILayout returned early without
updating index.json or writing pending referrers. Restructure
the control flow so the blob-exists case skips only the write
but still updates the index and flushes referrers.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-12 22:54:35 -07:00
Tonis Tiigi 3e5c05cb1f imagetools: support oci-layout referrers
Handle OCI layout referrers via subject-annotated index entries and add
integration coverage for copying signed attestations through oci-layout.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-12 22:45:01 -07:00
Tonis Tiigi 9894189361 imagetools: support oci-layout refs
Add oci-layout:// source and target support to imagetools create and
inspect while keeping merge, filter, and referrer logic shared.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-03-12 22:45:01 -07:00
CrazyMax 2ed4ece865 build: reuse build session for policy source resolution
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-04 17:21:20 +01:00
Tonis Tiigi 4880756a0f policy: simplify recursive material resolution
Unify root/material unknown resolution with recursive Input traversal.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-26 09:14:25 -08:00
Tonis Tiigi b62fc30524 build: resolve policy files from context state and unified FS
Support remote context policy files via resolved context state and cwd:// override.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-23 16:22:19 -08:00
Tonis Tiigi 10c5f00efa sourcemeta: unblock concurrent resolver open waiters
Prevent concurrent ResolveSourceMetadata calls from hanging while
waiting for resolver initialization.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-20 08:56:41 -08:00
Tonis Tiigi 5c3551beeb policy: add GitHub attestation verification
Add github_attestation and github_release_attestation policy support.
Fetch GitHub attestation bundles (including bundle_url .json.sn decode)
and verify against input.http.checksum.

Wire source metadata resolver progress through resolver options and add
ResolveState support for policy HTTP attestation fetches.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-20 08:56:40 -08:00
Tonis Tiigi dce5289722 policy: separate sourcemetaresolver utility to reusable pkg
Turn the current utility used by policy helper commands that
allows getting gateway.Client lazily into reusable package.

This is preparation for using this utility also in the policy
verification, outside of commands.

Only expose SourceMetaResolver as other methods of gateway client
are not needed atm by any callers.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-13 13:59:33 -08:00
CrazyMaxandGitHub 53882aec96 Merge pull request #3649 from tonistiigi/update-buildkit-dev
vendor: update buildkit to v0.28-dev-9836771d0c5b
2026-02-12 10:06:45 +01:00
Tonis Tiigi a5b712b275 confutil: fix toml rewriting in new package
Seems marshalling the typed struct causes empty fields
e.g. gcpolicy = [] that (old versions of?) BuildKit do no allow.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-11 21:47:11 -08:00
CrazyMax 7899695fa6 history: don't import build package
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-02-11 10:29:47 +01:00
Tonis Tiigi 9d803b0d87 vendor: update buildkit to v0.28-dev-9836771d0c5b
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-02-10 11:59:30 -08:00
Tõnis TiigiandGitHub 32e47355af Merge pull request #3627 from tonistiigi/imagetools-auth
imagetools: use dockerconfig for auth
2026-02-03 13:14:33 -05:00
Tonis Tiigi 87c77aca7b imagetools: avoid trying to load attestations inline references
When creating resulting image index it is wasteful
to check for attestations for the descriptors in original
index what were already attestation for subject manifest.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-28 08:28:29 -08:00
Tonis Tiigi 27dde04ab5 imagetools: use dockerconfig for auth
Enables fallback for DHI and Scout registries and
repo/scope specific credentials like supported for builds.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-26 10:15:14 -08:00
Tonis Tiigi e254cf1985 auth: create new authorizer for imagetools
Based on containerd Authorizer.

Removed unused RefreshToken, fixed error handling.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-26 10:14:21 -08:00
Tonis Tiigi f764c6f025 dockerconfig: add fallback for loading DHI and Scout credentials
These are also Docker managed registries with same users.

Fall back to main hostname if not logged in to exact domain.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-16 12:45:05 -08:00
Tonis Tiigi 9f1daffb32 policy: implement policy support for bake
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-14 09:34:23 -08:00
Tonis Tiigi c5154b3169 update linters for go1.25 base version
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-09 18:54:15 -08:00
Tõnis Tiigi 37e283ceb0 auth: add option to load docker config for specific repo/scope
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2026-01-07 11:45:04 -08:00
Jonathan A. Sternberg fdfba3014d tests: add integration tests for dap build
This adds integration tests for the `dap build` command to test various
behavior associated with the command. We start the build and the
integration test acts as a dap client to send requests and check that
the output is what we expect.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-12-17 10:56:30 -06:00
Sebastiaan van Stijn 18dc2e088a vendor: github.com/moby/moby/api v1.52.0, moby/client v0.1.0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-11-12 01:30:02 +01:00
Tonis Tiigi 79b6474639 imagetools: add sigstore bundle v3 to supported referrer formats
This was added after the initial version was written.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-11-05 14:00:05 -08:00
Tonis Tiigi e13cd5c9df imagetools: support for creating attestations/signatures
Persist attestation manifest and any manifest cosign-based
signatures when creating new images.

When creating index from single-arch manifests where attestation
manifest is not inlined, it can be loaded from referrers API.
Note that for this to work the attestation manifest needs to be
in artifact type when image was built.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit aab8171f824d13d703e869107e1720ad71d24bff)
2025-11-05 12:59:27 -08:00
CrazyMax 7652057da2 docker-container: write github actions payload to container for provenance
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-10-24 10:52:49 +02:00
Tonis Tiigi ba4935585c imagetools: silence warning for empty-type meditype used in artifacts
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-10-02 10:43:33 -07:00
CrazyMax 7eefa86662 test: use temp dir for TestGit
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-09-29 10:54:39 +02:00
Tonis Tiigi f448f3e22b imagetools: add platforms filter to imagetools create
Allows specifying platforms that should be included
in the new image, making it possible to reduce platforms
of existing multi-arch image. Previously the individual
image manifests needed to be used as sources, but that
dropped their related attestation manifests.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-09-23 08:10:11 -07:00
Tonis Tiigi 4ad48f7737 imagetools: variables name refactor
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2025-09-22 09:25:48 -07:00
CrazyMax 0beb1b3f2b lint: gopls fixes
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-09-09 22:07:37 +02:00
Tõnis TiigiandGitHub 9a07004534 Merge pull request #3290 from thaJeztah/fix_lint
fix some linting issues
2025-07-10 08:30:29 -07:00
CrazyMaxandGitHub a007368729 Merge pull request #3291 from crazy-max/chore-rm-comment
otelutil: remove unrelated comment
2025-07-03 14:33:49 +02:00
CrazyMax 84e03159a6 otelutil: remove unrelated comment
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-07-03 13:50:50 +02:00
Sebastiaan van Stijn 1205802f63 util/otelutil: change uses of deprecated instrumentation.Library
While the interface's signature uses the deprecated "Library" type,
and upstream documents it as "needed for backward compatibility";
https://github.com/open-telemetry/opentelemetry-go/blob/0f7f1d0bad21aba18feaadc0171c53705fbda419/sdk/trace/span.go#L62-L65

The Library type is now an alias for Scope, so using the non-deprecated
type still satisfies the interface;
https://github.com/open-telemetry/opentelemetry-go/blob/0f7f1d0bad21aba18feaadc0171c53705fbda419/sdk/instrumentation/library.go#L6-L9

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-07-03 13:40:29 +02:00