Skip to content

[agent-smith] don't scrub infringement #20012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading