Skip to content

Commit

Permalink
[CWS] cleanup last uses of jsonschema_description (#15050)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcacheux authored Jan 12, 2023
1 parent bac7670 commit a014b91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/cloud-workload-security/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The Cloud Workload Security (CWS) part of the Agent sends events to the backend.

### Editing files

To change the documentation of one of the fields in the schema, edit the correct field in `pkg/security/probe/serializers.go`. The documentation of a field is added through the `jsonschema_description` tag of the field.
To change the documentation of one of the fields in the schema, edit the correct field in `pkg/security/probe/serializers.go`. The documentation of a field is added through the commont of the field.

For example:

Expand Down
10 changes: 6 additions & 4 deletions pkg/security/probe/serializers.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ type ProcessSerializer struct {
// Indicator of environments variable truncation
EnvsTruncated bool `json:"envs_truncated,omitempty"`
// Indicates whether the process is considered a thread (that is, a child process that hasn't executed another program)
IsThread bool `json:"is_thread,omitempty" jsonschema_description:""`
IsThread bool `json:"is_thread,omitempty"`
// Indicates whether the process is a kworker
IsKworker bool `json:"is_kworker,omitempty" jsonschema_description:""`
IsKworker bool `json:"is_kworker,omitempty"`
}

// ContainerContextSerializer serializes a container context to JSON
Expand Down Expand Up @@ -490,8 +490,10 @@ type BindEventSerializer struct {
// ExitEventSerializer serializes an exit event to JSON
// easyjson:json
type ExitEventSerializer struct {
Cause string `json:"cause" jsonschema_description:"Cause of the process termination (one of EXITED, SIGNALED, COREDUMPED)"`
Code uint32 `json:"code" jsonschema_description:"Exit code of the process or number of the signal that caused the process to terminate"`
// Cause of the process termination (one of EXITED, SIGNALED, COREDUMPED)
Cause string `json:"cause"`
// Exit code of the process or number of the signal that caused the process to terminate
Code uint32 `json:"code"`
}

// MountEventSerializer serializes a mount event to JSON
Expand Down

0 comments on commit a014b91

Please sign in to comment.