diff --git a/pkg/server/server.go b/pkg/server/server.go index 81ac8959b9..5f5d790618 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -43,6 +43,11 @@ func (s *RegistryServer) GetBundle(ctx context.Context, req *api.GetBundleReques if err != nil { return nil, err } + // if the value of the `bundle` field in the OperatorBundle table is NULL, return an + // empty Bundle struct + if bundleString == "" { + return new(api.Bundle), nil + } entry := ®istry.ChannelEntry{ PackageName: req.GetPkgName(), ChannelName: req.GetChannelName(), diff --git a/pkg/sqlite/query.go b/pkg/sqlite/query.go index ed0ba7782f..2baf7c11a0 100644 --- a/pkg/sqlite/query.go +++ b/pkg/sqlite/query.go @@ -113,7 +113,7 @@ func (s *SQLQuerier) GetBundle(ctx context.Context, pkgName, channelName, csvNam } if !rows.Next() { - return "", fmt.Errorf("no bundle found for csv %s", csvName) + return "", fmt.Errorf("no entry found for csv %s", csvName) } var bundleStringSQL sql.NullString if err := rows.Scan(&bundleStringSQL); err != nil {