Skip to content

Commit

Permalink
Merge pull request inspektor-gadget#2642 from inspektor-gadget/alban_…
Browse files Browse the repository at this point in the history
…metadata_update

Update gadgets metadata and keep them in sync
  • Loading branch information
alban authored Mar 25, 2024
2 parents 9e40ea6 + cf45769 commit ef25d34
Show file tree
Hide file tree
Showing 17 changed files with 96 additions and 34 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/inspektor-gadget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,18 @@ jobs:
with:
category: ig-linux-${{ matrix.platform }}

build-official-image-based-gadgets:
name: Build gadgets
# level: 1
needs: build-ig
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check if metadata files are updated
run: |
GADGET_BUILD_PARAMS="--update-metadata" make build-gadgets
git diff --exit-code HEAD --
build-gadget-container-deps:
# We only build this dependencies to check if they do not contain CWE.
name: Build gadget-container-deps
Expand Down
9 changes: 7 additions & 2 deletions gadgets/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,16 @@ all: build

build: $(GADGETS)

# GADGET_BUILD_PARAMS can be used to pass additional parameters e.g
# GADGET_BUILD_PARAMS="--update-metadata" make build
.PHONY: $(GADGETS)
$(GADGETS):
@echo "Building $@"
@sudo -E IG_EXPERIMENTAL=true $(IG) image build --builder-image $(BUILDER_IMAGE) \
-t $(GADGET_REPOSITORY)/$@:$(GADGET_TAG) $@
@sudo -E IG_EXPERIMENTAL=true $(IG) image build \
--builder-image $(BUILDER_IMAGE) \
-t $(GADGET_REPOSITORY)/$@:$(GADGET_TAG) \
$$GADGET_BUILD_PARAMS \
$@

.PHONY:
push: build
Expand Down
5 changes: 4 additions & 1 deletion gadgets/snapshot_process/gadget.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: snapshot process
description: Show running processes
homepageURL: https://inspektor-gadget.io/
documentationURL: https://inspektor-gadget.io/docs
sourceURL: https://github.com/inspektor-gadget/inspektor-gadget/
snapshotters:
processes:
structName: process_entry
Expand Down Expand Up @@ -31,7 +34,7 @@ structs:
attributes:
template: uid
- name: mntns_id
description: 'Mount namespace inode id'
description: Mount namespace inode id
attributes:
template: ns
ebpfParams:
Expand Down
3 changes: 3 additions & 0 deletions gadgets/snapshot_socket/gadget.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: snapshot socket
description: Show TCP and UDP sockets
homepageURL: https://inspektor-gadget.io/
documentationURL: https://inspektor-gadget.io/docs
sourceURL: https://github.com/inspektor-gadget/inspektor-gadget/
snapshotters:
sockets:
structName: socket_entry
Expand Down
5 changes: 4 additions & 1 deletion gadgets/top_file/gadget.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: file
name: top file
description: Periodically report read/write activity by file
homepageURL: https://inspektor-gadget.io/
documentationURL: https://inspektor-gadget.io/docs
sourceURL: https://github.com/inspektor-gadget/inspektor-gadget/
toppers:
file:
mapName: stats
Expand Down
9 changes: 6 additions & 3 deletions gadgets/trace_dns/gadget.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: dns
name: trace dns
description: trace dns requests and responses
homepageURL: https://inspektor-gadget.io/
documentationURL: https://inspektor-gadget.io/docs/latest/
sourceURL: https://github.com/inspektor-gadget/inspektor-gadget
tracers:
dns:
mapName: events
Expand Down Expand Up @@ -55,11 +58,11 @@ structs:
attributes:
width: 16
- name: netns
description: 'Network namespace inode id'
description: Network namespace inode id
attributes:
template: ns
- name: mntns_id
description: 'Mount namespace inode id'
description: Mount namespace inode id
attributes:
template: ns
- name: tid
Expand Down
3 changes: 3 additions & 0 deletions gadgets/trace_exec/gadget.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: trace exec
description: trace process executions
homepageURL: https://inspektor-gadget.io/
documentationURL: https://inspektor-gadget.io/docs
sourceURL: https://github.com/inspektor-gadget/inspektor-gadget/
tracers:
exec:
mapName: events
Expand Down
3 changes: 3 additions & 0 deletions gadgets/trace_malloc/gadget.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: trace malloc
description: use uprobe to trace malloc and free in libc.so
homepageURL: https://inspektor-gadget.io/
documentationURL: https://inspektor-gadget.io/docs
sourceURL: https://github.com/inspektor-gadget/inspektor-gadget/
tracers:
malloc:
mapName: events
Expand Down
3 changes: 3 additions & 0 deletions gadgets/trace_mount/gadget.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: trace mount
description: trace mount syscalls
homepageURL: https://inspektor-gadget.io/
documentationURL: https://inspektor-gadget.io/docs
sourceURL: https://github.com/inspektor-gadget/inspektor-gadget/
tracers:
mount:
mapName: events
Expand Down
8 changes: 6 additions & 2 deletions gadgets/trace_oomkill/gadget.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: oomkill
name: trace oomkill
description: trace OOM killer
homepageURL: https://inspektor-gadget.io/
documentationURL: https://inspektor-gadget.io/docs
sourceURL: https://github.com/inspektor-gadget/inspektor-gadget/
tracers:
oomkill:
mapName: events
Expand All @@ -20,8 +23,9 @@ structs:
attributes:
template: pid
- name: pages
attributes: {}
- name: mntns_id
description: 'Mount namespace inode id'
description: Mount namespace inode id
attributes:
template: ns
- name: timestamp
Expand Down
7 changes: 5 additions & 2 deletions gadgets/trace_open/gadget.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: open
name: trace open
description: trace open files
homepageURL: https://inspektor-gadget.io/
documentationURL: https://inspektor-gadget.io/docs
sourceURL: https://github.com/inspektor-gadget/inspektor-gadget/
tracers:
open:
mapName: events
Expand Down Expand Up @@ -41,7 +44,7 @@ structs:
width: 32
minWidth: 24
- name: mntns_id
description: 'Mount namespace inode id'
description: Mount namespace inode id
attributes:
template: ns
ebpfParams:
Expand Down
23 changes: 13 additions & 10 deletions gadgets/trace_signal/gadget.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: signal
name: trace signal
description: trace signal
homepageURL: https://inspektor-gadget.io/
documentationURL: https://inspektor-gadget.io/docs
sourceURL: https://github.com/inspektor-gadget/inspektor-gadget/
tracers:
signal:
mapName: events
Expand Down Expand Up @@ -32,24 +35,24 @@ structs:
attributes:
width: 5
- name: mntns_id
description: 'Mount namespace inode id'
description: Mount namespace inode id
attributes:
template: ns
ebpfParams:
filtered_pid:
key: pid
defaultValue: ""
description: Show only events generated by processes with this pid
target_signal:
key: signal
defaultValue: ""
description: Show only events generated by this signal
failed_only:
key: failed
defaultValue: "false"
description: Show only failed events
filtered_pid:
key: pid
defaultValue: ""
description: Show only events generated by processes with this pid
kill_only:
key: kill-only
alias: k
defaultValue: "false"
description: Show only events generated by kill family syscalls
target_signal:
key: signal
defaultValue: ""
description: Show only events generated by this signal
12 changes: 7 additions & 5 deletions gadgets/trace_sni/gadget.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: sni
name: trace sni
description: trace sni
homepageURL: https://inspektor-gadget.io/
documentationURL: https://inspektor-gadget.io/docs
sourceURL: https://github.com/inspektor-gadget/inspektor-gadget/
tracers:
sni:
mapName: events
structName: event_t

structs:
event_t:
fields:
Expand All @@ -30,15 +32,15 @@ structs:
attributes:
width: 30
- name: netns
description: 'Network namespace inode id'
description: Network namespace inode id
attributes:
template: ns
- name: mntns_id
description: 'Mount namespace inode id'
description: Mount namespace inode id
attributes:
template: ns
- name: tid
description: TID of the thread sending the request
attributes:
template: pid
hidden: true
template: pid
5 changes: 4 additions & 1 deletion gadgets/trace_tcp/gadget.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: tracetcp
name: trace tcp
description: monitor connect, accept and close events of TCP connections
homepageURL: https://inspektor-gadget.io/
documentationURL: https://inspektor-gadget.io/docs
sourceURL: https://github.com/inspektor-gadget/inspektor-gadget/
tracers:
tracetcp:
mapName: events
Expand Down
7 changes: 5 additions & 2 deletions gadgets/trace_tcpconnect/gadget.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: tcpconnect
name: trace tcpconnect
description: trace tcp connections
homepageURL: https://inspektor-gadget.io/
documentationURL: https://inspektor-gadget.io/docs
sourceURL: https://github.com/inspektor-gadget/inspektor-gadget/
tracers:
tcpconnect:
mapName: events
Expand Down Expand Up @@ -37,6 +40,6 @@ structs:
alignment: left
hidden: true
- name: mntns_id
description: 'Mount namespace inode id'
description: Mount namespace inode id
attributes:
template: ns
5 changes: 4 additions & 1 deletion gadgets/trace_tcpdrop/gadget.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: tcpdrop
name: trace tcpdrop
description: trace TCP packets dropped by the kernel
homepageURL: https://inspektor-gadget.io/
documentationURL: https://inspektor-gadget.io/docs
sourceURL: https://github.com/inspektor-gadget/inspektor-gadget/
tracers:
tcpdrop:
mapName: events
Expand Down
11 changes: 7 additions & 4 deletions gadgets/trace_tcpretrans/gadget.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: tcpretrans
name: trace tcpretrans
description: trace TCP retransmissions
homepageURL: https://inspektor-gadget.io/
documentationURL: https://inspektor-gadget.io/docs
sourceURL: https://github.com/inspektor-gadget/inspektor-gadget/
tracers:
tcpretrans:
mapName: events
Expand Down Expand Up @@ -49,17 +52,17 @@ structs:
alignment: left
ellipsis: end
- name: netns
description: 'Network namespace inode id'
description: Network namespace inode id
attributes:
template: ns
- name: type
description: 'Type of the retransmission, either RETRANS or LOSS'
description: Type of the retransmission, either RETRANS or LOSS
attributes:
width: 7
alignment: left
ellipsis: end
- name: mntns_id
description: 'Mount namespace inode id'
description: Mount namespace inode id
attributes:
template: ns
- name: state
Expand Down

0 comments on commit ef25d34

Please sign in to comment.