Skip to content

Commit

Permalink
proto: Reserve removed field numbers
Browse files Browse the repository at this point in the history
There are some gaps in EventType and GetEventsResponse field numbers
because some fields got removed from these events. Mark these field
numbers as reserved to avoid accidentally re-using them.

Move process_lsm field number from 13 to 28 since the field number 13
has already been used in the past. It's still safe to change the field
number for process_lsm since we haven't released the process_lsm APIs
[^1].

[^1]: #2566

Suggested-by: Lorenz Bauer <[email protected]>
Signed-off-by: Michi Mutsuzaki <[email protected]>
  • Loading branch information
michi-covalent committed Jul 24, 2024
1 parent 13b6862 commit 96ba401
Show file tree
Hide file tree
Showing 10 changed files with 185 additions and 173 deletions.
4 changes: 2 additions & 2 deletions api/v1/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions api/v1/tetragon/codegen/helpers/helpers.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

106 changes: 54 additions & 52 deletions api/v1/tetragon/events.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions api/v1/tetragon/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ import "google/protobuf/field_mask.proto";
// NOTE: EventType constants must be in sync with the numbers used in the
// GetEventsResponse event oneof.
enum EventType {
UNDEF = 0;
reserved 2 to 4, 6 to 8, 13 to 26;
UNDEF = 0;

PROCESS_EXEC = 1;
PROCESS_EXIT = 5;
PROCESS_KPROBE = 9;
PROCESS_TRACEPOINT = 10;
PROCESS_LOADER = 11;
PROCESS_UPROBE = 12;
PROCESS_LSM = 13;
PROCESS_THROTTLE = 27;
PROCESS_LSM = 28;

TEST = 40000;
RATE_LIMIT_INFO = 40001;
Expand Down Expand Up @@ -169,6 +170,7 @@ message ProcessThrottle {
}

message GetEventsResponse {
reserved 2 to 4, 6 to 8, 13 to 26;
// The type-specific fields of an event.
//
// NOTE: Numbers must stay in sync with enum EventType.
Expand All @@ -186,8 +188,8 @@ message GetEventsResponse {
ProcessTracepoint process_tracepoint = 10;
ProcessLoader process_loader = 11;
ProcessUprobe process_uprobe = 12;
ProcessLsm process_lsm = 13;
ProcessThrottle process_throttle = 27;
ProcessLsm process_lsm = 28;

Test test = 40000;
RateLimitInfo rate_limit_info = 40001;
Expand Down
Loading

0 comments on commit 96ba401

Please sign in to comment.