mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-08 08:57:45 +01:00
fix: update image reference to "@" in audit log when pushing & deleting images (#20348)
Signed-off-by: Shengwen Yu <yshengwen@vmware.com>
This commit is contained in:
parent
c80e9bf477
commit
2af02f3b25
@ -159,7 +159,7 @@ func (p *PushArtifactEvent) ResolveToAuditLog() (*model.AuditLog, error) {
|
|||||||
ResourceType: "artifact"}
|
ResourceType: "artifact"}
|
||||||
|
|
||||||
if len(p.Tags) == 0 {
|
if len(p.Tags) == 0 {
|
||||||
auditLog.Resource = fmt.Sprintf("%s:%s",
|
auditLog.Resource = fmt.Sprintf("%s@%s",
|
||||||
p.Artifact.RepositoryName, p.Artifact.Digest)
|
p.Artifact.RepositoryName, p.Artifact.Digest)
|
||||||
} else {
|
} else {
|
||||||
auditLog.Resource = fmt.Sprintf("%s:%s",
|
auditLog.Resource = fmt.Sprintf("%s:%s",
|
||||||
@ -222,7 +222,7 @@ func (d *DeleteArtifactEvent) ResolveToAuditLog() (*model.AuditLog, error) {
|
|||||||
Operation: rbac.ActionDelete.String(),
|
Operation: rbac.ActionDelete.String(),
|
||||||
Username: d.Operator,
|
Username: d.Operator,
|
||||||
ResourceType: "artifact",
|
ResourceType: "artifact",
|
||||||
Resource: fmt.Sprintf("%s:%s", d.Artifact.RepositoryName, d.Artifact.Digest)}
|
Resource: fmt.Sprintf("%s@%s", d.Artifact.RepositoryName, d.Artifact.Digest)}
|
||||||
return auditLog, nil
|
return auditLog, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user