github.com/buildpacks/pack@v0.33.3-0.20240516162812-884dd1837311/internal/commands/trust_builder.go (about)

     1  package commands
     2  
     3  import (
     4  	"github.com/spf13/cobra"
     5  
     6  	"github.com/buildpacks/pack/internal/config"
     7  	"github.com/buildpacks/pack/pkg/logging"
     8  )
     9  
    10  // Deprecated: Use `config trusted-builders add` instead
    11  func TrustBuilder(logger logging.Logger, cfg config.Config, cfgPath string) *cobra.Command {
    12  	cmd := &cobra.Command{
    13  		Use:     "trust-builder <builder-name>",
    14  		Args:    cobra.ExactArgs(1),
    15  		Short:   "Trust builder",
    16  		Long:    "Trust builder.\n\nWhen building with this builder, all lifecycle phases will be run in a single container using the builder image.",
    17  		Example: "pack trust-builder cnbs/sample-stack-run:bionic",
    18  		Hidden:  true,
    19  		RunE: logError(logger, func(cmd *cobra.Command, args []string) error {
    20  			deprecationWarning(logger, "trust-builder", "config trusted-builders add")
    21  			return addTrustedBuilder(args, logger, cfg, cfgPath)
    22  		}),
    23  	}
    24  
    25  	AddHelpFlag(cmd, "trust-builder")
    26  	return cmd
    27  }