Skip to content
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

[CWS] cleanup last uses of jsonschema_description #15050

Merged
merged 1 commit into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
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
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