Commit 4e57230e authored by Philip Laine's avatar Philip Laine Committed by Brad Davidson

Bump spegel to v0.0.18-k3s4

Signed-off-by: 's avatarPhilip Laine <philip.laine@gmail.com> Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com> (cherry picked from commit 26feb25c) Signed-off-by: 's avatarBrad Davidson <brad.davidson@rancher.com>
parent da998e09
......@@ -20,11 +20,13 @@ replace (
github.com/opencontainers/runc => github.com/k3s-io/runc v1.1.12-k3s1
github.com/opencontainers/runtime-spec => github.com/opencontainers/runtime-spec v1.0.3-0.20220909204839-494a5a6aca78
github.com/opencontainers/selinux => github.com/opencontainers/selinux v1.10.1
github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.18.0
github.com/prometheus/common => github.com/prometheus/common v0.45.0
github.com/quic-go/qtls-go1-20 => github.com/quic-go/qtls-go1-20 v0.3.3
github.com/quic-go/quic-go => github.com/quic-go/quic-go v0.38.2
github.com/rancher/wrangler => github.com/rancher/wrangler v1.1.1-0.20230818201331-3604a6be798d
github.com/ugorji/go => github.com/ugorji/go v1.2.11
github.com/xenitab/spegel => github.com/k3s-io/spegel v0.0.17-0.20240109004735-9466a5529330 // k3s-main
github.com/xenitab/spegel => github.com/k3s-io/spegel v0.0.18-k3s4 // k3s-main
go.etcd.io/etcd/api/v3 => github.com/k3s-io/etcd/api/v3 v3.5.9-k3s1
go.etcd.io/etcd/client/pkg/v3 => github.com/k3s-io/etcd/client/pkg/v3 v3.5.9-k3s1
go.etcd.io/etcd/client/v2 => github.com/k3s-io/etcd/client/v2 v2.305.9-k3s1
......@@ -98,7 +100,7 @@ require (
github.com/cloudnativelabs/kube-router/v2 v2.0.0-00010101000000-000000000000
github.com/containerd/aufs v1.0.0
github.com/containerd/cgroups/v3 v3.0.2
github.com/containerd/containerd v1.7.11
github.com/containerd/containerd v1.7.13
github.com/containerd/fuse-overlayfs-snapshotter v1.0.5
github.com/containerd/stargz-snapshotter v0.14.4-0.20230913082252-7275d45b185c
github.com/containerd/zfs v1.1.0
......@@ -156,8 +158,8 @@ require (
go.etcd.io/etcd/etcdutl/v3 v3.5.9
go.etcd.io/etcd/server/v3 v3.5.10
go.uber.org/zap v1.26.0
golang.org/x/crypto v0.17.0
golang.org/x/net v0.19.0
golang.org/x/crypto v0.18.0
golang.org/x/net v0.20.0
golang.org/x/sync v0.6.0
golang.org/x/sys v0.16.0
google.golang.org/grpc v1.60.1
......@@ -235,7 +237,7 @@ require (
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multiaddr v0.12.0 // indirect
github.com/multiformats/go-multiaddr v0.12.2 // indirect
github.com/multiformats/go-multiaddr-dns v0.3.1 // indirect
github.com/multiformats/go-multiaddr-fmt v0.1.0 // indirect
github.com/multiformats/go-multibase v0.2.0 // indirect
......@@ -249,7 +251,7 @@ require (
github.com/polydawn/refmt v0.89.0 // indirect
github.com/quic-go/qpack v0.4.0 // indirect
github.com/quic-go/qtls-go1-20 v0.3.3 // indirect
github.com/quic-go/quic-go v0.38.0 // indirect
github.com/quic-go/quic-go v0.38.2 // indirect
github.com/quic-go/webtransport-go v0.5.3 // indirect
github.com/raulk/go-watchdog v1.3.0 // indirect
github.com/slok/go-http-metrics v0.10.0 // indirect
......@@ -392,7 +394,7 @@ require (
github.com/josharian/intern v1.0.0 // indirect
github.com/josharian/native v1.1.0 // indirect
github.com/karrick/godirwalk v1.17.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
github.com/kylelemons/godebug v1.1.0 // indirect
github.com/libopenstorage/openstorage v1.0.0 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
......@@ -440,9 +442,9 @@ require (
github.com/pierrec/lz4 v2.6.0+incompatible // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/pquerna/cachecontrol v0.1.0 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_golang v1.19.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rs/xid v1.5.0 // indirect
github.com/rubiojr/go-vhd v0.0.0-20200706105327-02e210299021 // indirect
......@@ -485,8 +487,8 @@ require (
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/term v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.16.1 // indirect
......@@ -497,7 +499,7 @@ require (
google.golang.org/genproto v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/gcfg.v1 v1.2.3 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
......
......@@ -43,7 +43,7 @@ func (s *selfBootstrapper) Run(_ context.Context, id string) error {
return nil
}
func (s *selfBootstrapper) GetAddress() (*peer.AddrInfo, error) {
func (s *selfBootstrapper) Get() (*peer.AddrInfo, error) {
return peer.AddrInfoFromString(s.id)
}
......@@ -68,7 +68,7 @@ func (c *agentBootstrapper) Run(_ context.Context, _ string) error {
return nil
}
func (c *agentBootstrapper) GetAddress() (*peer.AddrInfo, error) {
func (c *agentBootstrapper) Get() (*peer.AddrInfo, error) {
if c.server == "" || c.token == "" {
return nil, errors.New("cannot get addresses without server and token")
}
......@@ -131,7 +131,7 @@ func (s *serverBootstrapper) Run(_ context.Context, id string) error {
return nil
}
func (s *serverBootstrapper) GetAddress() (addrInfo *peer.AddrInfo, err error) {
func (s *serverBootstrapper) Get() (addrInfo *peer.AddrInfo, err error) {
if s.controlConfig.Runtime.Core == nil {
return nil, errors.New("runtime core not ready")
}
......@@ -187,10 +187,10 @@ func (c *chainingBootstrapper) Run(ctx context.Context, id string) error {
return merr.NewErrors(errs...)
}
func (c *chainingBootstrapper) GetAddress() (*peer.AddrInfo, error) {
func (c *chainingBootstrapper) Get() (*peer.AddrInfo, error) {
errs := merr.Errors{}
for _, b := range c.bootstrappers {
addr, err := b.GetAddress()
addr, err := b.Get()
if err == nil {
return addr, nil
}
......
......@@ -96,7 +96,6 @@ const (
resolveLatestTag = false
resolveRetries = 0
resolveTimeout = time.Second * 5
registryScheme = "https"
registryNamespace = "k8s.io"
defaultRouterPort = "5001"
)
......@@ -188,12 +187,12 @@ func (c *Config) Start(ctx context.Context, nodeConfig *config.Node) error {
libp2p.Identity(p2pKey),
libp2p.Peerstore(ps),
libp2p.PrivateNetwork(c.PSK),
libp2p.PrometheusRegisterer(metrics.DefaultRegisterer),
}
router, err := routing.NewP2PRouter(ctx, routerAddr, c.Bootstrapper, c.RegistryPort, registryScheme, opts...)
router, err := routing.NewP2PRouter(ctx, routerAddr, c.Bootstrapper, c.RegistryPort, opts...)
if err != nil {
return errors.Wrap(err, "failed to create p2p router")
}
go router.Run(ctx)
caCert, err := os.ReadFile(c.ServerCAFile)
if err != nil {
......@@ -202,7 +201,14 @@ func (c *Config) Start(ctx context.Context, nodeConfig *config.Node) error {
localAddr := net.JoinHostPort(c.InternalAddress, c.RegistryPort)
client := clientaccess.GetHTTPClient(caCert, c.ClientCertFile, c.ClientKeyFile)
metrics.Register()
reg := registry.NewRegistry(ociClient, router, localAddr, resolveRetries, resolveTimeout, resolveLatestTag, client.Transport)
registryOpts := []registry.Option{
registry.WithLocalAddress(localAddr),
registry.WithResolveLatestTag(resolveLatestTag),
registry.WithResolveRetries(resolveRetries),
registry.WithResolveTimeout(resolveTimeout),
registry.WithTransport(client.Transport),
}
reg := registry.NewRegistry(ociClient, router, registryOpts...)
regSvr := reg.Server(":"+c.RegistryPort, logr.FromContextOrDiscard(ctx))
// Close router on shutdown
......@@ -225,7 +231,7 @@ func (c *Config) Start(ctx context.Context, nodeConfig *config.Node) error {
// Wait up to 5 seconds for the p2p network to find peers. This will return
// immediately if the node is bootstrapping from itself.
wait.PollImmediateWithContext(ctx, time.Second, resolveTimeout, func(_ context.Context) (bool, error) {
return router.HasMirrors()
return router.Ready()
})
return nil
......@@ -235,7 +241,7 @@ func (c *Config) Start(ctx context.Context, nodeConfig *config.Node) error {
func (c *Config) peerInfo() http.HandlerFunc {
return http.HandlerFunc(func(resp http.ResponseWriter, req *http.Request) {
client, _, _ := net.SplitHostPort(req.RemoteAddr)
info, err := c.Bootstrapper.GetAddress()
info, err := c.Bootstrapper.Get()
if err != nil {
http.Error(resp, "Internal Error", http.StatusInternalServerError)
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment