@@ -17,6 +17,7 @@ import (
17
17
"github.com/operator-framework/operator-registry/pkg/api"
18
18
health "github.com/operator-framework/operator-registry/pkg/api/grpc_health_v1"
19
19
"github.com/operator-framework/operator-registry/pkg/lib/log"
20
+ "github.com/operator-framework/operator-registry/pkg/registry"
20
21
"github.com/operator-framework/operator-registry/pkg/server"
21
22
"github.com/operator-framework/operator-registry/pkg/sqlite"
22
23
)
@@ -109,18 +110,22 @@ func runCmdFunc(cmd *cobra.Command, args []string) error {
109
110
logger .WithError (err ).Warn ("permissive mode enabled" )
110
111
}
111
112
112
- store , err := sqlite .NewSQLLiteQuerier (dbName )
113
+ var store registry.Query
114
+ store , err = sqlite .NewSQLLiteQuerier (dbName )
113
115
if err != nil {
114
- logger .Fatalf ("failed to load db: %s" , err )
116
+ logger .WithError (err ).Warnf ("failed to load db" )
117
+ }
118
+ if store == nil {
119
+ store = registry .NewEmptyQuerier ()
115
120
}
116
121
117
122
// sanity check that the db is available
118
123
tables , err := store .ListTables (context .TODO ())
119
124
if err != nil {
120
- logger .Fatalf ( "couldn't list tables in db, incorrect config: %s" , err )
125
+ logger .WithError ( err ). Warnf ( "couldn't list tables in db" )
121
126
}
122
127
if len (tables ) == 0 {
123
- logger .Fatal ("no tables found in db" )
128
+ logger .Warn ("no tables found in db" )
124
129
}
125
130
126
131
lis , err := net .Listen ("tcp" , ":" + port )
0 commit comments