Skip to content

Commit

Permalink
process: Add a function to access K8sResourceWatcher
Browse files Browse the repository at this point in the history
Add a function that returns K8sResourceWatcher. This makes it easier for
users of the process package to associate process information with
Kubernetes resources.

Signed-off-by: Michi Mutsuzaki <[email protected]>
  • Loading branch information
michi-covalent authored and jrfastab committed Aug 27, 2023
1 parent 7f907d5 commit 00eebba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/process/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,3 +355,9 @@ func AddCloneEvent(event *tetragonAPI.MsgCloneEvent) error {
func Get(execId string) (*ProcessInternal, error) {
return procCache.get(execId)
}

// GetK8s returns K8sResourceWatcher. You must call InitCache before calling this function to ensure
// that k8s has been initialized.
func GetK8s() watcher.K8sResourceWatcher {
return k8s
}

0 comments on commit 00eebba

Please sign in to comment.