Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/commands/builder_inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func inspectBuilder(
builderInfo := writer.SharedBuilderInfo{
Name: imageName,
IsDefault: imageName == cfg.DefaultBuilder,
Trusted: isTrusted,
Trusted: isTrusted || bldr.IsKnownTrustedBuilder(imageName),
}

localInfo, localErr := inspector.InspectBuilder(imageName, true, client.WithDetectionOrderDepth(flags.Depth))
Expand Down
19 changes: 19 additions & 0 deletions internal/commands/builder_inspect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,25 @@ func testBuilderInspectCommand(t *testing.T, when spec.G, it spec.S) {
})
})

when("image is a known trusted builder", func() {
it("passes builder info with trusted true to the writer's `Print` method", func() {
builderWriter := newDefaultBuilderWriter()

command := commands.BuilderInspect(
logger,
config.Config{},
newDefaultBuilderInspector(),
newWriterFactory(returnsForWriter(builderWriter)),
)
command.SetArgs([]string{"heroku/builder:24"})

err := command.Execute()
assert.Nil(err)

assert.Equal(builderWriter.ReceivedBuilderInfo.Trusted, true)
})
})

when("default builder is configured and is the same as specified by the command", func() {
it("passes builder info with isDefault true to the writer's `Print` method", func() {
cfg.DefaultBuilder = "the/default-builder"
Expand Down
Loading