-
Notifications
You must be signed in to change notification settings - Fork 472
feat: align the argument types for k8s context #4213
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Ah indeed some of the types are not reflected into the TracingPolicy API, @olsajiri since you created that page, I imagine you based yourself on
tetragon/pkg/generictypes/generictypes.go
Lines 81 to 132 in 27c9abe
| var genericStringToType = map[string]int{ | |
| "string": GenericStringType, | |
| "int": GenericIntType, | |
| "uint64": GenericU64Type, | |
| "unsigned long": GenericU64Type, | |
| "ulong": GenericU64Type, | |
| "uint32": GenericU32Type, | |
| "sint64": GenericS64Type, | |
| "int64": GenericS64Type, | |
| "long": GenericS64Type, | |
| "sint32": GenericS32Type, | |
| "int32": GenericS32Type, | |
| "skb": GenericSkbType, | |
| "sock": GenericSockType, | |
| "size_t": GenericSizeType, | |
| "char_buf": GenericCharBuffer, | |
| "char_iovec": GenericCharIovec, | |
| "filename": GenericFilenameType, | |
| "file": GenericFileType, | |
| "path": GenericPathType, | |
| "fd": GenericFdType, | |
| "cred": GenericCredType, | |
| "const_buf": GenericConstBuffer, | |
| "nop": GenericNopType, | |
| "bpf_attr": GenericBpfAttr, | |
| "perf_event": GenericPerfEvent, | |
| "bpf_map": GenericBpfMap, | |
| "user_namespace": GenericUserNamespace, | |
| "capability": GenericCapability, | |
| "kiocb": GenericKiocb, | |
| "iov_iter": GenericIovIter, | |
| "load_info": GenericLoadModule, | |
| "module": GenericKernelModule, | |
| "syscall64": GenericSyscall64, | |
| "sint16": GenericS16Type, | |
| "int16": GenericS16Type, | |
| "uint16": GenericU16Type, | |
| "sint8": GenericS8Type, | |
| "int8": GenericS8Type, | |
| "uint8": GenericU8Type, | |
| "kernel_cap_t": GenericKernelCap, | |
| "cap_inheritable": GenericCapInheritable, | |
| "cap_permitted": GenericCapPermitted, | |
| "cap_effective": GenericCapEffective, | |
| "linux_binprm": GenericLinuxBinprmType, | |
| "data_loc": GenericDataLoc, | |
| "net_device": GenericNetDev, | |
| "sockaddr": GenericSockaddrType, | |
| "socket": GenericSocketType, | |
| "dentry": GenericDentryType, | |
| "bpf_prog": GenericBpfProgType, | |
| } |
Do you know why we have this difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So apparently instead of just deleting it from the docs we should either:
- document that these types are only supported in non-k8s context
- add support for k8s context, I don't think it should be too hard, it's just some plumbing missing
Will try to support those types for k8s context. Actually, I'm not sure what the non-k8s context means. I run it with the local Docker container, but clearly it requires the tracepoints policy YAML file, and those types are rejected since they violate the protobuf. |
Cool! I think it's the better option here.
Yeah previously they weren't validated because of a bug but indeed now they should be validated against the CRD so it should be rejected anyway. |
cc62287 to
4cb9382
Compare
Signed-off-by: Keming <[email protected]>
4cb9382 to
4ad4362
Compare
Fixes N/A
Description
Update the argument types doc according to pkg/k8s/apis/cilium.io/v1alpha1/types.go
Changelog