File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,12 +5,12 @@ import (
55 "fmt"
66 "os"
77 "path/filepath"
8- "regexp"
98 "strings"
109
1110 "github.com/docker/cli/cli"
1211 "github.com/docker/cli/cli/command"
1312 "github.com/docker/cli/cli/trust"
13+ "github.com/docker/cli/internal/lazyregexp"
1414 "github.com/pkg/errors"
1515 "github.com/spf13/cobra"
1616 "github.com/theupdateframework/notary"
@@ -41,7 +41,7 @@ func newKeyGenerateCommand(dockerCli command.Streams) *cobra.Command {
4141}
4242
4343// key names can use lowercase alphanumeric + _ + - characters
44- var validKeyName = regexp . MustCompile (`^[a-z0-9][a-z0-9\_\-]*$` ).MatchString
44+ var validKeyName = lazyregexp . New (`^[a-z0-9][a-z0-9\_\-]*$` ).MatchString
4545
4646// validate that all of the key names are unique and are alphanumeric + _ + -
4747// and that we do not already have public key files in the target dir on disk
Original file line number Diff line number Diff line change @@ -6,13 +6,13 @@ import (
66 "io"
77 "os"
88 "path"
9- "regexp"
109 "strings"
1110
1211 "github.com/docker/cli/cli"
1312 "github.com/docker/cli/cli/command"
1413 "github.com/docker/cli/cli/command/image"
1514 "github.com/docker/cli/cli/trust"
15+ "github.com/docker/cli/internal/lazyregexp"
1616 "github.com/docker/cli/opts"
1717 "github.com/pkg/errors"
1818 "github.com/spf13/cobra"
@@ -45,7 +45,7 @@ func newSignerAddCommand(dockerCLI command.Cli) *cobra.Command {
4545 return cmd
4646}
4747
48- var validSignerName = regexp . MustCompile (`^[a-z0-9][a-z0-9\_\-]*$` ).MatchString
48+ var validSignerName = lazyregexp . New (`^[a-z0-9][a-z0-9\_\-]*$` ).MatchString
4949
5050func addSigner (ctx context.Context , dockerCLI command.Cli , options signerAddOptions ) error {
5151 signerName := options .signer
You can’t perform that action at this time.
0 commit comments