fix(postgres): skip unchanged authority in package audit
This commit is contained in:
1 parent
0f14378363
commit
72052fe186
1 file changed
+5
@@ -1,6 +1,7 @@
|
||||
package postgres
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
@@ -352,6 +353,10 @@ func auditReplace(ctx context.Context, q *postgresdb.Queries, p storepkg.Install
|
||||
if action != storepkg.ActionApproveUpdate && action != storepkg.ActionRollback {
|
||||
return nil
|
||||
}
|
||||
// An unchanged authority, including none at all, is not an approval.
|
||||
if bytes.Equal(current.AcceptedAuthority, accepted) {
|
||||
return nil
|
||||
}
|
||||
return insertAudit(ctx, q, "installed_packages", p.Name, "accept_authority", current.AcceptedAuthority, accepted, 0, p.OrgID)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user