Skip to content

Consolidate trust logic into IsTrustedBuilder#2573

Open
runesoerensen wants to merge 3 commits into
buildpacks:mainfrom
runesoerensen:runesoerensen/consolidate-trusted-builder-logic
Open

Consolidate trust logic into IsTrustedBuilder#2573
runesoerensen wants to merge 3 commits into
buildpacks:mainfrom
runesoerensen:runesoerensen/consolidate-trusted-builder-logic

Conversation

@runesoerensen
Copy link
Copy Markdown
Contributor

@runesoerensen runesoerensen commented Apr 15, 2026

Summary

Consolidate all trust checking into IsTrustedBuilder so callers don't need to separately check IsKnownTrustedBuilder(), and use name.ParseReference for consistent reference matching across both known and user-configured builders.

  • IsTrustedBuilder now checks both known trusted builders and user-configured trusted builders
  • Uses name.ParseReference for consistent reference matching across both sources - entries without a tag match any tag in the repository, entries with a tag require an exact match
  • Remove now-unnecessary || IsKnownTrustedBuilder() calls from build.go, config_trusted_builder.go, and builder_inspect.go

Output

Before

$ pack builder inspect paketobuildpacks/builder-jammy-base:latest
...
Trusted: No

After

$ pack builder inspect paketobuildpacks/builder-jammy-base:latest
...
Trusted: Yes

Documentation

  • Should this change be documented?
    • No

Related

Resolves #2572

@github-actions github-actions Bot added this to the 0.41.0 milestone Apr 15, 2026
@github-actions github-actions Bot added the type/enhancement Issue that requests a new feature or improvement. label Apr 15, 2026
…ilders

Signed-off-by: Rune Soerensen <rsoerensen@salesforce.com>
Signed-off-by: Rune Soerensen <rsoerensen@salesforce.com>
@runesoerensen runesoerensen force-pushed the runesoerensen/consolidate-trusted-builder-logic branch from ad1df62 to 85e15fc Compare May 15, 2026 14:00
@runesoerensen runesoerensen marked this pull request as ready for review May 15, 2026 14:15
@runesoerensen runesoerensen requested review from a team as code owners May 15, 2026 14:15
@runesoerensen
Copy link
Copy Markdown
Contributor Author

runesoerensen commented May 16, 2026

@jjbustamante thanks for reviewing/merging #2571! This branch was based on that work, so I've rebased and marked the PR ready for review :)

h.AssertTrue(t, isTrusted)

// Known builder without tag should match any tag
isTrusted, err = bldr.IsTrustedBuilder(config.Config{}, "paketobuildpacks/builder-jammy-base:latest")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this test case reference: paketobuildpacks/builder-jammy-base?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/enhancement Issue that requests a new feature or improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trust checks are fragmented and known builders without a tag don't match tagged queries

2 participants