diff --git a/internal/commands/builder_inspect.go b/internal/commands/builder_inspect.go index 36fa93be9..04d014c45 100644 --- a/internal/commands/builder_inspect.go +++ b/internal/commands/builder_inspect.go @@ -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)) diff --git a/internal/commands/builder_inspect_test.go b/internal/commands/builder_inspect_test.go index 9e4189bf7..636ed289a 100644 --- a/internal/commands/builder_inspect_test.go +++ b/internal/commands/builder_inspect_test.go @@ -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"