Skip to content

Commit

Permalink
Add missing runtime capability (#393)
Browse files Browse the repository at this point in the history
  • Loading branch information
anjmao authored Nov 6, 2024
1 parent 8ceaf31 commit 37ce6e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions charts/kvisor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ agent:
- NET_ADMIN
- BPF
- PERFMON
- IPC_LOCK # Needed for mmap.
drop:
- ALL
seccompProfile:
Expand Down
4 changes: 3 additions & 1 deletion cmd/agent/daemon/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/castai/kvisor/pkg/ebpftracer/events"
"github.com/castai/kvisor/pkg/ebpftracer/signature"
"github.com/castai/kvisor/pkg/ebpftracer/types"
"github.com/castai/kvisor/pkg/kernel"
"github.com/castai/kvisor/pkg/logging"
"github.com/castai/kvisor/pkg/proc"
"github.com/castai/kvisor/pkg/processtree"
Expand Down Expand Up @@ -207,7 +208,8 @@ func (a *App) Run(ctx context.Context) error {
return errors.New("no configured exporters")
}

log.Infof("running kvisor agent, version=%s", a.cfg.Version)
kernelVersion, _ := kernel.CurrentKernelVersion()
log.Infof("running kvisor agent, version=%s, kernel_version=%s", a.cfg.Version, kernelVersion)
defer log.Infof("stopping kvisor agent, version=%s", a.cfg.Version)

if addr := a.cfg.PyroscopeAddr; addr != "" {
Expand Down
4 changes: 4 additions & 0 deletions pkg/kernel/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ type Version struct {
VersionCode int
}

func (v Version) String() string {
return fmt.Sprintf("%d.%d.%d", v.Major, v.Minor, v.Patch)
}

// KernelVersionFromReleaseString converts a release string with format
// 4.4.2[-1] to a kernel version number in LINUX_VERSION_CODE format.
// That is, for kernel "a.b.c", the version number will be (a<<16 + b<<8 + c)
Expand Down

0 comments on commit 37ce6e1

Please sign in to comment.