mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-29 00:11:21 -05:00
reva-bump-2.42.1 (#2225)
This commit is contained in:
2
go.mod
2
go.mod
@@ -65,7 +65,7 @@ require (
|
||||
github.com/open-policy-agent/opa v1.12.3
|
||||
github.com/opencloud-eu/icap-client v0.0.0-20250930132611-28a2afe62d89
|
||||
github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20250724122329-41ba6b191e76
|
||||
github.com/opencloud-eu/reva/v2 v2.42.0
|
||||
github.com/opencloud-eu/reva/v2 v2.42.1
|
||||
github.com/opensearch-project/opensearch-go/v4 v4.6.0
|
||||
github.com/orcaman/concurrent-map v1.0.0
|
||||
github.com/pkg/errors v0.9.1
|
||||
|
||||
4
go.sum
4
go.sum
@@ -969,8 +969,8 @@ github.com/opencloud-eu/inotifywaitgo v0.0.0-20251111171128-a390bae3c5e9 h1:dIft
|
||||
github.com/opencloud-eu/inotifywaitgo v0.0.0-20251111171128-a390bae3c5e9/go.mod h1:JWyDC6H+5oZRdUJUgKuaye+8Ph5hEs6HVzVoPKzWSGI=
|
||||
github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20250724122329-41ba6b191e76 h1:vD/EdfDUrv4omSFjrinT8Mvf+8D7f9g4vgQ2oiDrVUI=
|
||||
github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20250724122329-41ba6b191e76/go.mod h1:pzatilMEHZFT3qV7C/X3MqOa3NlRQuYhlRhZTL+hN6Q=
|
||||
github.com/opencloud-eu/reva/v2 v2.42.0 h1:CWlXbNqUSduQ5Afi6XoegoJ/zyV0Vx5UoPKAZZmEAq4=
|
||||
github.com/opencloud-eu/reva/v2 v2.42.0/go.mod h1:pv+w23JG0/qJweZbTzNNev//YEvlUML1L/2iXgKGkkg=
|
||||
github.com/opencloud-eu/reva/v2 v2.42.1 h1:QUZOLSfAhb7bw+qsVSFMFY644rUz4/NtnOiJ0QQxj2o=
|
||||
github.com/opencloud-eu/reva/v2 v2.42.1/go.mod h1:pv+w23JG0/qJweZbTzNNev//YEvlUML1L/2iXgKGkkg=
|
||||
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
|
||||
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
|
||||
github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
|
||||
|
||||
@@ -34,7 +34,7 @@ var (
|
||||
// LatestTag is the latest released version plus the dev meta version.
|
||||
// Will be overwritten by the release pipeline
|
||||
// Needs a manual change for every tagged release
|
||||
LatestTag = "5.0.0+dev"
|
||||
LatestTag = "5.0.1+dev"
|
||||
|
||||
// Date indicates the build date.
|
||||
// This has been removed, it looks like you can only replace static strings with recent go versions
|
||||
|
||||
67
vendor/github.com/opencloud-eu/reva/v2/pkg/store/store.go
generated
vendored
67
vendor/github.com/opencloud-eu/reva/v2/pkg/store/store.go
generated
vendored
@@ -21,6 +21,7 @@ package store
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -32,6 +33,7 @@ import (
|
||||
"github.com/opencloud-eu/reva/v2/pkg/store/etcd"
|
||||
"github.com/opencloud-eu/reva/v2/pkg/store/memory"
|
||||
"go-micro.dev/v4/logger"
|
||||
"go-micro.dev/v4/store"
|
||||
microstore "go-micro.dev/v4/store"
|
||||
)
|
||||
|
||||
@@ -125,19 +127,33 @@ func Create(opts ...microstore.Option) microstore.Store {
|
||||
return *ocMemStore
|
||||
case TypeNatsJS:
|
||||
opts, ttl, natsOptions := natsConfig(options.Logger, options.Context, opts)
|
||||
return natsjs.NewStore(
|
||||
store := natsjs.NewStore(
|
||||
append(opts,
|
||||
natsjs.NatsOptions(natsOptions), // always pass in properly initialized default nats options
|
||||
natsjs.DefaultTTL(ttl))..., // nats needs a DefaultTTL option as it does not support per Write TTL
|
||||
)
|
||||
|
||||
err := updateNatsStore(opts, ttl, natsOptions)
|
||||
if err != nil {
|
||||
options.Logger.Logf(logger.ErrorLevel, "failed to update nats-js store: '%s'", err.Error())
|
||||
}
|
||||
|
||||
return store
|
||||
case TypeNatsJSKV:
|
||||
opts, ttl, natsOptions := natsConfig(options.Logger, options.Context, opts)
|
||||
return natsjskv.NewStore(
|
||||
store := natsjskv.NewStore(
|
||||
append(opts,
|
||||
natsjskv.NatsOptions(natsOptions), // always pass in properly initialized default nats options
|
||||
natsjskv.EncodeKeys(), // nats has restrictions on the key, we cannot use slashes
|
||||
natsjskv.DefaultTTL(ttl))..., // nats needs a DefaultTTL option as it does not support per Write TTL
|
||||
)
|
||||
|
||||
err := updateNatsStore(opts, ttl, natsOptions)
|
||||
if err != nil {
|
||||
options.Logger.Logf(logger.ErrorLevel, "failed to update nats-js-kv store: '%s'", err.Error())
|
||||
}
|
||||
|
||||
return store
|
||||
case TypeMemory, "mem", "": // allow existing short form and use as default
|
||||
return microstore.NewMemoryStore(opts...)
|
||||
default:
|
||||
@@ -146,13 +162,58 @@ func Create(opts ...microstore.Option) microstore.Store {
|
||||
}
|
||||
}
|
||||
|
||||
func updateNatsStore(opts []store.Option, ttl time.Duration, natsOptions nats.Options) error {
|
||||
options := store.Options{}
|
||||
for _, o := range opts {
|
||||
o(&options)
|
||||
}
|
||||
|
||||
bucketName := options.Database
|
||||
if bucketName == "" {
|
||||
return fmt.Errorf("bucket name (database) must be set")
|
||||
}
|
||||
|
||||
if len(options.Nodes) > 0 {
|
||||
natsOptions.Servers = options.Nodes
|
||||
}
|
||||
nc, err := natsOptions.Connect()
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not connect to nats: %w", err)
|
||||
}
|
||||
defer nc.Close()
|
||||
|
||||
js, err := nc.JetStream()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// NATS KV buckets are actually streams named "KV_<bucket_name>"
|
||||
info, err := js.StreamInfo("KV_" + bucketName)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get bucket info: %w", err)
|
||||
}
|
||||
|
||||
config := info.Config
|
||||
config.MaxAge = ttl
|
||||
|
||||
_, err = js.UpdateStream(&config)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to update bucket TTL: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func natsConfig(log logger.Logger, ctx context.Context, opts []microstore.Option) ([]microstore.Option, time.Duration, nats.Options) {
|
||||
|
||||
if mem, _ := ctx.Value(disablePersistanceContextKey{}).(bool); mem {
|
||||
opts = append(opts, natsjs.DefaultMemory())
|
||||
}
|
||||
|
||||
ttl, _ := ctx.Value(ttlContextKey{}).(time.Duration)
|
||||
ttl := time.Duration(0)
|
||||
if d, ok := ctx.Value(ttlContextKey{}).(time.Duration); ok {
|
||||
ttl = d
|
||||
}
|
||||
|
||||
// preparing natsOptions before the switch to reuse the same code
|
||||
natsOptions := nats.GetDefaultOptions()
|
||||
|
||||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@@ -1376,7 +1376,7 @@ github.com/opencloud-eu/icap-client
|
||||
# github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20250724122329-41ba6b191e76
|
||||
## explicit; go 1.18
|
||||
github.com/opencloud-eu/libre-graph-api-go
|
||||
# github.com/opencloud-eu/reva/v2 v2.42.0
|
||||
# github.com/opencloud-eu/reva/v2 v2.42.1
|
||||
## explicit; go 1.24.1
|
||||
github.com/opencloud-eu/reva/v2/cmd/revad/internal/grace
|
||||
github.com/opencloud-eu/reva/v2/cmd/revad/runtime
|
||||
|
||||
Reference in New Issue
Block a user