Skip to content

Commit

Permalink
Updating regclient to v0.4.2
Browse files Browse the repository at this point in the history
Signed-off-by: Brandon Mitchell <git@bmitch.net>
  • Loading branch information
sudo-bmitch committed May 10, 2022
1 parent c627a72 commit b5b9992
Show file tree
Hide file tree
Showing 4 changed files with 393 additions and 600 deletions.
38 changes: 20 additions & 18 deletions cmd/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,31 @@ import (
"context"
"crypto/tls"
"fmt"
"math"
"net/http"
"net/http/httputil"
"net/url"

"github.com/boxboat/dockhand-lru-registry/pkg/common"
"github.com/boxboat/dockhand-lru-registry/pkg/lru"
"github.com/boxboat/dockhand-lru-registry/pkg/proxy"
"github.com/regclient/regclient/regclient"
"github.com/regclient/regclient"
"github.com/regclient/regclient/config"
"github.com/spf13/cobra"
"github.com/spf13/viper"
bolt "go.etcd.io/bbolt"
"math"
"net/http"
"net/http/httputil"
"net/url"
)

type ProxyArgs struct {
serverPort int
serverCert string
serverKey string
databaseDir string
registryHost string
registryScheme string
CleanupArgs proxy.CleanSettings
TargetDiskSizeByteString string
UseForwardedHeaders bool
serverPort int
serverCert string
serverKey string
databaseDir string
registryHost string
registryScheme string
CleanupArgs proxy.CleanSettings
TargetDiskSizeByteString string
UseForwardedHeaders bool
}

var (
Expand All @@ -57,9 +59,9 @@ func startProxy(ctx context.Context) {
registryTarget, err := url.Parse(fmt.Sprintf("%s://%s", proxyArgs.registryScheme, proxyArgs.registryHost))
common.ExitIfError(err)

tlsSetting := regclient.TLSDisabled
tlsSetting := config.TLSDisabled
if proxyArgs.registryScheme == "https" {
tlsSetting = regclient.TLSEnabled
tlsSetting = config.TLSEnabled
}

registryProxy := &proxy.Proxy{
Expand All @@ -69,9 +71,9 @@ func startProxy(ctx context.Context) {
RegistryHost: proxyArgs.registryHost,
RegistryProxy: httputil.NewSingleHostReverseProxy(registryTarget),
Cache: &lru.Cache{Db: db},
RegClient: regclient.NewRegClient(
RegClient: regclient.New(
regclient.WithConfigHost(
regclient.ConfigHost{
config.Host{
Name: proxyArgs.registryHost,
TLS: tlsSetting,
})),
Expand Down
10 changes: 6 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ module github.com/boxboat/dockhand-lru-registry
go 1.16

require (
github.com/docker/cli v20.10.15+incompatible // indirect
github.com/docker/docker v20.10.15+incompatible // indirect
github.com/go-co-op/gocron v1.6.2
github.com/kr/text v0.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/regclient/regclient v0.3.4
github.com/regclient/regclient v0.4.2
github.com/sirupsen/logrus v1.8.1
github.com/spf13/cobra v1.1.3
github.com/spf13/viper v1.7.1
github.com/spf13/cobra v1.3.0
github.com/spf13/viper v1.10.0
go.etcd.io/bbolt v1.3.5
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
)
Loading

0 comments on commit b5b9992

Please sign in to comment.