Skip to content

Commit b350d34

Browse files
authored
[agent-smith] don't scrub infringement (#20012)
1 parent c295f82 commit b350d34

File tree

1 file changed

+3
-3
lines changed
  • components/ee/agent-smith/pkg/agent

1 file changed

+3
-3
lines changed

components/ee/agent-smith/pkg/agent/agent.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ func (agent *Smith) Penalize(ws InfringingWorkspace) ([]config.PenaltyKind, erro
336336
for _, p := range penalty {
337337
switch p {
338338
case config.PenaltyStopWorkspace:
339-
log.WithField("infringement", ws.Infringements).WithFields(owi).Info("stopping workspace")
339+
log.WithField("infringement", log.TrustedValueWrap{Value: ws.Infringements}).WithFields(owi).Info("stopping workspace")
340340
agent.metrics.penaltyAttempts.WithLabelValues(string(p)).Inc()
341341
err := agent.stopWorkspace(ws.SupervisorPID, ws.InstanceID)
342342
if err != nil {
@@ -345,7 +345,7 @@ func (agent *Smith) Penalize(ws InfringingWorkspace) ([]config.PenaltyKind, erro
345345
}
346346
return penalty, err
347347
case config.PenaltyStopWorkspaceAndBlockUser:
348-
log.WithField("infringement", ws.Infringements).WithFields(owi).Info("stopping workspace and blocking user")
348+
log.WithField("infringement", log.TrustedValueWrap{Value: ws.Infringements}).WithFields(owi).Info("stopping workspace and blocking user")
349349
agent.metrics.penaltyAttempts.WithLabelValues(string(p)).Inc()
350350
err := agent.stopWorkspaceAndBlockUser(ws.SupervisorPID, ws.Owner, ws.WorkspaceID, ws.InstanceID)
351351
if err != nil {
@@ -354,7 +354,7 @@ func (agent *Smith) Penalize(ws InfringingWorkspace) ([]config.PenaltyKind, erro
354354
}
355355
return penalty, err
356356
case config.PenaltyLimitCPU:
357-
log.WithField("infringement", ws.Infringements).WithFields(owi).Info("limiting CPU")
357+
log.WithField("infringement", log.TrustedValueWrap{Value: ws.Infringements}).WithFields(owi).Info("limiting CPU")
358358
agent.metrics.penaltyAttempts.WithLabelValues(string(p)).Inc()
359359
err := agent.limitCPUUse(ws.Pod)
360360
if err != nil {

0 commit comments

Comments
 (0)