From 53ed958805457ab838d93caacd20c0e28100501a Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 6 Aug 2025 16:55:22 +0200 Subject: [PATCH] cli/command: remove AddTrustSigningFlags it was only used internally in a single location, so inline the code where it's used. Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 8c2292797807ae6c7a324984a406e09d66a8ca48) Signed-off-by: Sebastiaan van Stijn --- cli/command/image/push.go | 2 +- cli/command/trust.go | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/cli/command/image/push.go b/cli/command/image/push.go index cd79ff9289..1ef31aedd7 100644 --- a/cli/command/image/push.go +++ b/cli/command/image/push.go @@ -57,7 +57,7 @@ func NewPushCommand(dockerCli command.Cli) *cobra.Command { flags := cmd.Flags() flags.BoolVarP(&opts.all, "all-tags", "a", false, "Push all tags of an image to the repository") flags.BoolVarP(&opts.quiet, "quiet", "q", false, "Suppress verbose output") - command.AddTrustSigningFlags(flags, &opts.untrusted, dockerCli.ContentTrustEnabled()) + flags.BoolVar(&opts.untrusted, "disable-content-trust", !dockerCli.ContentTrustEnabled(), "Skip image signing") // Don't default to DOCKER_DEFAULT_PLATFORM env variable, always default to // pushing the image as-is. This also avoids forcing the platform selection diff --git a/cli/command/trust.go b/cli/command/trust.go index 65f2408585..c802a14e1f 100644 --- a/cli/command/trust.go +++ b/cli/command/trust.go @@ -8,8 +8,3 @@ import ( func AddTrustVerificationFlags(fs *pflag.FlagSet, v *bool, trusted bool) { fs.BoolVar(v, "disable-content-trust", !trusted, "Skip image verification") } - -// AddTrustSigningFlags adds "signing" flags to the provided flagset -func AddTrustSigningFlags(fs *pflag.FlagSet, v *bool, trusted bool) { - fs.BoolVar(v, "disable-content-trust", !trusted, "Skip image signing") -}