Skip to content

Commit e6b616b

Browse files
joelanfordPer Goncalves da Silva
authored andcommitted
pkg/cache: add preferred pogreb database cache impl (#1278)
* declcfg: concurrently load and process files in WalkMetasFS Signed-off-by: Joe Lanford <[email protected]> * pkg/cache: add preferred pogreb database cache impl * refactoring to avoid code duplication Signed-off-by: Joe Lanford <[email protected]> * pkg/cache: memory efficient cache building Signed-off-by: Joe Lanford <[email protected]> * cmd/opm/serve: improve logging related to caches Signed-off-by: Joe Lanford <[email protected]> --------- Signed-off-by: Joe Lanford <[email protected]> Upstream-repository: operator-registry Upstream-commit: 5b5181b46f0ef7e7d8c4ed4c64db3fdd4f5db373
1 parent 9c66f94 commit e6b616b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+9183
-1077
lines changed

go.mod

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ require (
6161
github.com/Microsoft/go-winio v0.6.1 // indirect
6262
github.com/Microsoft/hcsshim v0.12.0-rc.3 // indirect
6363
github.com/NYTimes/gziphandler v1.1.1 // indirect
64+
github.com/akrylysov/pogreb v0.10.2 // indirect
6465
github.com/antlr/antlr4/runtime/Go/antlr/v4 v4.0.0-20230305170008-8188dc5388df // indirect
6566
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
6667
github.com/beorn7/perks v1.0.1 // indirect
@@ -200,6 +201,7 @@ require (
200201
github.com/spiffe/go-spiffe/v2 v2.2.0 // indirect
201202
github.com/stoewer/go-strcase v1.3.0 // indirect
202203
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
204+
github.com/tidwall/btree v1.7.0 // indirect
203205
github.com/ulikunitz/xz v0.5.11 // indirect
204206
github.com/vbatts/tar-split v0.11.5 // indirect
205207
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,8 @@ github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm
13571357
github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk=
13581358
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
13591359
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b/go.mod h1:1KcenG0jGWcpt8ov532z81sp/kMMUG485J2InIOyADM=
1360+
github.com/akrylysov/pogreb v0.10.2 h1:e6PxmeyEhWyi2AKOBIJzAEi4HkiC+lKyCocRGlnDi78=
1361+
github.com/akrylysov/pogreb v0.10.2/go.mod h1:pNs6QmpQ1UlTJKDezuRWmaqkgUE2TuU0YTWyqJZ7+lI=
13601362
github.com/alecthomas/assert/v2 v2.2.2/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
13611363
github.com/alecthomas/assert/v2 v2.3.0/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ=
13621364
github.com/alecthomas/kingpin/v2 v2.4.0/go.mod h1:0gyi0zQnjuFk8xrkNKamJoyUo382HRL7ATRpFZCw6tE=
@@ -2156,6 +2158,8 @@ github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8
21562158
github.com/substrait-io/substrait-go v0.4.2/go.mod h1:qhpnLmrcvAnlZsUyPXZRqldiHapPTXC3t7xFgDi3aQg=
21572159
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 h1:kdXcSzyDtseVEc4yCz2qF8ZrQvIDBJLl4S1c3GCXmoI=
21582160
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
2161+
github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI=
2162+
github.com/tidwall/btree v1.7.0/go.mod h1:twD9XRA5jj9VUQGELzDO4HPQTNJsoWWfYEL+EUQ2cKY=
21592163
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
21602164
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75 h1:6fotK7otjonDflCTK0BCfls4SPy3NcCVb5dqqmbRknE=
21612165
github.com/tmc/grpc-websocket-proxy v0.0.0-20220101234140-673ab2c3ae75/go.mod h1:KO6IkyS8Y3j8OdNO85qEYBsRPuteD+YciPomcXdrMnk=

staging/operator-registry/alpha/action/render.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import (
66
"encoding/json"
77
"errors"
88
"fmt"
9-
"io"
109
"os"
1110
"path/filepath"
1211
"sort"
@@ -17,7 +16,6 @@ import (
1716
"github.com/h2non/filetype"
1817
"github.com/h2non/filetype/matchers"
1918
"github.com/operator-framework/api/pkg/operators/v1alpha1"
20-
"github.com/sirupsen/logrus"
2119
"k8s.io/apimachinery/pkg/util/sets"
2220

2321
"github.com/operator-framework/operator-registry/alpha/declcfg"
@@ -26,6 +24,7 @@ import (
2624
"github.com/operator-framework/operator-registry/pkg/image"
2725
"github.com/operator-framework/operator-registry/pkg/image/containerdregistry"
2826
"github.com/operator-framework/operator-registry/pkg/lib/bundle"
27+
"github.com/operator-framework/operator-registry/pkg/lib/log"
2928
"github.com/operator-framework/operator-registry/pkg/registry"
3029
"github.com/operator-framework/operator-registry/pkg/sqlite"
3130
)
@@ -61,12 +60,6 @@ type Render struct {
6160
skipSqliteDeprecationLog bool
6261
}
6362

64-
func nullLogger() *logrus.Entry {
65-
logger := logrus.New()
66-
logger.SetOutput(io.Discard)
67-
return logrus.NewEntry(logger)
68-
}
69-
7063
func (r Render) Run(ctx context.Context) (*declcfg.DeclarativeConfig, error) {
7164
if r.skipSqliteDeprecationLog {
7265
// exhaust once with a no-op function.
@@ -119,7 +112,7 @@ func (r Render) createRegistry() (*containerdregistry.Registry, error) {
119112
// The containerd registry impl is somewhat verbose, even on the happy path,
120113
// so discard all logger logs. Any important failures will be returned from
121114
// registry methods and eventually logged as fatal errors.
122-
containerdregistry.WithLog(nullLogger()),
115+
containerdregistry.WithLog(log.Null()),
123116
)
124117
if err != nil {
125118
return nil, err

0 commit comments

Comments
 (0)