Skip to content

Commit

Permalink
prefix tls flags with "tls-"
Browse files Browse the repository at this point in the history
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
  • Loading branch information
Adphi committed Oct 8, 2023
1 parent 12b5e9e commit 0977e07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cmd/artifact-registry/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ func main() {
cmd.Flags().BoolVar(&insecure, "insecure", insecure, "disable backend registry client tls verification")
cmd.Flags().BoolVar(&tagPerArtifact, "tag-artifacts", tagPerArtifact, "tag artifacts manifests")
cmd.Flags().StringVar(&clientCA, "client-ca", "", "tls client certificate authority")
cmd.Flags().StringVar(&cert, "cert", "", "tls certificate")
cmd.Flags().StringVar(&key, "key", "", "tls key")
cmd.Flags().StringVar(&cert, "tls-cert", "", "tls certificate")
cmd.Flags().StringVar(&key, "tls-key", "", "tls key")
if err := cmd.Execute(); err != nil {
logrus.Fatal(err)
}
Expand Down Expand Up @@ -162,6 +162,7 @@ func run(ctx context.Context, opts ...storage.Option) error {
if err := packages.Init(ctx, router, domain); err != nil {
return err
}
router.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {})

s := http.Server{
BaseContext: func(lis net.Listener) context.Context {
Expand Down
4 changes: 3 additions & 1 deletion pkg/packages/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ func Init(ctx context.Context, r *mux.Router, domain string) error {
for _, v := range subs {
v.Use(mdlw)
for _, vv := range p.Routes() {
v.Path(vv.Path).Methods(vv.Method).HandlerFunc(vv.Handler)
if err := v.Path(vv.Path).Methods(vv.Method).HandlerFunc(vv.Handler).GetError(); err != nil {
return fmt.Errorf("%s: %q: %w", k, vv.Path, err)
}
}
}
}
Expand Down

0 comments on commit 0977e07

Please sign in to comment.