Skip to content

Commit ac21da7

Browse files
committed
pkg/api/seccomp: add comments for exported functions
Signed-off-by: Markus Lehtonen <[email protected]>
1 parent 3aff986 commit ac21da7

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

pkg/api/seccomp.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
rspec "github.com/opencontainers/runtime-spec/specs-go"
2121
)
2222

23+
// FromOCILinuxSeccomp converts an seccomp configuration from an OCI runtime spec.
2324
func FromOCILinuxSeccomp(o *rspec.LinuxSeccomp) *LinuxSeccomp {
2425
var errno *OptionalUInt32
2526
if o.DefaultErrnoRet != nil {
@@ -47,6 +48,7 @@ func FromOCILinuxSeccomp(o *rspec.LinuxSeccomp) *LinuxSeccomp {
4748
}
4849
}
4950

51+
// FromOCILinuxSyscalls converts seccomp syscalls configuration from an OCI runtime spec.
5052
func FromOCILinuxSyscalls(o []rspec.LinuxSyscall) []*LinuxSyscall {
5153
syscalls := make([]*LinuxSyscall, len(o))
5254

@@ -67,6 +69,7 @@ func FromOCILinuxSyscalls(o []rspec.LinuxSyscall) []*LinuxSyscall {
6769
return syscalls
6870
}
6971

72+
// FromOCILinuxSeccompArgs converts seccomp syscall args from an OCI runtime spec.
7073
func FromOCILinuxSeccompArgs(o []rspec.LinuxSeccompArg) []*LinuxSeccompArg {
7174
args := make([]*LinuxSeccompArg, len(o))
7275

@@ -82,6 +85,7 @@ func FromOCILinuxSeccompArgs(o []rspec.LinuxSeccompArg) []*LinuxSeccompArg {
8285
return args
8386
}
8487

88+
// ToOCILinuxSyscalls converts seccomp syscalls configuration to an OCI runtime spec.
8589
func ToOCILinuxSyscalls(o []*LinuxSyscall) []rspec.LinuxSyscall {
8690
syscalls := make([]rspec.LinuxSyscall, len(o))
8791

@@ -103,6 +107,7 @@ func ToOCILinuxSyscalls(o []*LinuxSyscall) []rspec.LinuxSyscall {
103107
return syscalls
104108
}
105109

110+
// ToOCILinuxSeccompArgs converts seccomp syscall args to an OCI runtime spec.
106111
func ToOCILinuxSeccompArgs(o []*LinuxSeccompArg) []rspec.LinuxSeccompArg {
107112
args := make([]rspec.LinuxSeccompArg, len(o))
108113

0 commit comments

Comments
 (0)