Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions central/alert/datastore/internal/store/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion central/cluster/store/cluster/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion central/cluster/store/clusterhealth/postgres/gen.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package postgres

//go:generate pg-table-bindings-wrapper --type=storage.ClusterHealthStatus --references=storage.Cluster --search-category=CLUSTER_HEALTH --migration-seq 10 --migrate-from rocksdb
//go:generate pg-table-bindings-wrapper --type=storage.ClusterHealthStatus --references=storage.Cluster --search-category=CLUSTER_HEALTH
// To regenerate migration:
// --migration-seq 10 --migrate-from rocksdb
4 changes: 2 additions & 2 deletions central/cluster/store/clusterhealth/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions central/cve/cluster/datastore/store/postgres/full_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/stackrox/rox/pkg/postgres/pgutils"
pkgSchema "github.com/stackrox/rox/pkg/postgres/schema"
"github.com/stackrox/rox/pkg/set"
"github.com/stackrox/rox/pkg/uuid"
)

const (
Expand Down Expand Up @@ -57,7 +58,7 @@ func (s *fullStoreImpl) DeleteClusterCVEsForCluster(ctx context.Context, cluster
return err
}

_, err = tx.Exec(ctx, "DELETE FROM "+clusterCVEEdgeTable+" WHERE clusterid = $1", clusterID)
_, err = tx.Exec(ctx, "DELETE FROM "+clusterCVEEdgeTable+" WHERE clusterid = $1", uuid.FromStringOrNil(clusterID))
if err != nil {
return err
}
Expand Down Expand Up @@ -225,7 +226,7 @@ func copyFromClusterCVEEdges(ctx context.Context, tx pgx.Tx, cveType storage.CVE
obj.GetId(),
obj.GetIsFixable(),
obj.GetFixedBy(),
obj.GetClusterId(),
uuid.FromStringOrNil(obj.GetClusterId()),
obj.GetCveId(),
serialized,
})
Expand Down Expand Up @@ -283,7 +284,7 @@ func getCVEs(ctx context.Context, tx pgx.Tx, cveIDs []string) (map[string]*stora
func getClusterCVEEdgeIDs(ctx context.Context, tx pgx.Tx, cveType storage.CVE_CVEType, clusterIDs []string) (set.StringSet, error) {
defer metrics.SetPostgresOperationDurationTime(time.Now(), ops.GetMany, "ClusterCVEEdgeIDs")

rows, err := tx.Query(ctx, "select id FROM "+clusterCVEEdgeTable+" WHERE clusterid = ANY($1::text[]) and cveid in (select id from "+clusterCVEsTable+" where type = $2)", clusterIDs, cveType)
rows, err := tx.Query(ctx, "select id FROM "+clusterCVEEdgeTable+" WHERE clusterid = ANY($1::uuid[]) and cveid in (select id from "+clusterCVEsTable+" where type = $2)", clusterIDs, cveType)
if err != nil {
return nil, err
}
Expand Down
48 changes: 24 additions & 24 deletions central/deployment/store/postgres/store.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading