Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/ee/agent-smith/pkg/detector/discovery.go
2501 views
1
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package detector
6
7
import (
8
"context"
9
10
"github.com/gitpod-io/gitpod/agent-smith/pkg/common"
11
"github.com/prometheus/client_golang/prometheus"
12
)
13
14
// Process describes a process ont the node that might warant closer inspection
15
type Process struct {
16
Path string
17
CommandLine []string
18
Kind ProcessKind
19
Workspace *common.Workspace
20
}
21
22
// ProcessDetector discovers processes on the node
23
type ProcessDetector interface {
24
prometheus.Collector
25
26
// Discover starts the discovery process. The discovery process can send the same
27
// process multiple times.
28
DiscoverProcesses(ctx context.Context) (<-chan Process, error)
29
}
30
31
type ProcessKind int
32
33
const (
34
ProcessUnknown ProcessKind = iota
35
ProcessSandbox
36
ProcessSupervisor
37
ProcessUserWorkload
38
)
39
40