Parameters
A Gadget can expose parameters to the client from the eBPF program. Inspektor Gadget provides the mechanism to expose the parameters as CLI flags to the user and allow to set them from the configuration file.
- Define a constant. It's important to use
const volatile
for the verifier to remove dead code.
const volatile bool myparam = false;
- Mark the constant as a parameter.
GADGET_PARAM(myparam);
- Provide additional information for the param on the metadata file:
params:
ebpf:
myparam:
key: my-param
defaultValue: "false"
description: Description for the param