Skip to content

Commit

Permalink
core: prevent duplicate audit logs for ReduceImage
Browse files Browse the repository at this point in the history
ReduceImage is an asynchronous operation. Previously, on positive flow we
logged a successful execution message on both 'execute' and 'end-action'
phases of the command. The former is incorrect and therefore dropped (we
typically log a message that says that the operation has started at this
point but we don't plan for another translation cycle so it's not added
as part of this change).

Bug-Url: https://bugzilla.redhat.com/2141437
Signed-off-by: Arik Hadas <ahadas@redhat.com>
  • Loading branch information
ahadas committed Nov 10, 2022
1 parent 53bf827 commit 55911c0
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,16 @@ protected Map<String, Pair<String, String>> getSharedLocks() {
@Override
public AuditLogType getAuditLogTypeValue() {
addAuditLogCustomValues();
return getSucceeded() ?
AuditLogType.USER_REDUCE_DISK_FINISHED_SUCCESS : AuditLogType.USER_REDUCE_DISK_FINISHED_FAILURE;
switch (getActionState()) {
case EXECUTE:
return getSucceeded() ?
AuditLogType.UNASSIGNED
: AuditLogType.USER_REDUCE_DISK_FINISHED_FAILURE;
default:
return getSucceeded() ?
AuditLogType.USER_REDUCE_DISK_FINISHED_SUCCESS
: AuditLogType.USER_REDUCE_DISK_FINISHED_FAILURE;
}
}

private void addAuditLogCustomValues() {
Expand Down

0 comments on commit 55911c0

Please sign in to comment.