Skip to content

Commit

Permalink
[agent-smith] don't scrub infringement (#20012)
Browse files Browse the repository at this point in the history
  • Loading branch information
iQQBot authored Jul 9, 2024
1 parent c295f82 commit b350d34
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/ee/agent-smith/pkg/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (agent *Smith) Penalize(ws InfringingWorkspace) ([]config.PenaltyKind, erro
for _, p := range penalty {
switch p {
case config.PenaltyStopWorkspace:
log.WithField("infringement", ws.Infringements).WithFields(owi).Info("stopping workspace")
log.WithField("infringement", log.TrustedValueWrap{Value: ws.Infringements}).WithFields(owi).Info("stopping workspace")
agent.metrics.penaltyAttempts.WithLabelValues(string(p)).Inc()
err := agent.stopWorkspace(ws.SupervisorPID, ws.InstanceID)
if err != nil {
Expand All @@ -345,7 +345,7 @@ func (agent *Smith) Penalize(ws InfringingWorkspace) ([]config.PenaltyKind, erro
}
return penalty, err
case config.PenaltyStopWorkspaceAndBlockUser:
log.WithField("infringement", ws.Infringements).WithFields(owi).Info("stopping workspace and blocking user")
log.WithField("infringement", log.TrustedValueWrap{Value: ws.Infringements}).WithFields(owi).Info("stopping workspace and blocking user")
agent.metrics.penaltyAttempts.WithLabelValues(string(p)).Inc()
err := agent.stopWorkspaceAndBlockUser(ws.SupervisorPID, ws.Owner, ws.WorkspaceID, ws.InstanceID)
if err != nil {
Expand All @@ -354,7 +354,7 @@ func (agent *Smith) Penalize(ws InfringingWorkspace) ([]config.PenaltyKind, erro
}
return penalty, err
case config.PenaltyLimitCPU:
log.WithField("infringement", ws.Infringements).WithFields(owi).Info("limiting CPU")
log.WithField("infringement", log.TrustedValueWrap{Value: ws.Infringements}).WithFields(owi).Info("limiting CPU")
agent.metrics.penaltyAttempts.WithLabelValues(string(p)).Inc()
err := agent.limitCPUUse(ws.Pod)
if err != nil {
Expand Down

0 comments on commit b350d34

Please sign in to comment.