forked from falcosecurity/driverkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathredhat.go
49 lines (38 loc) · 990 Bytes
/
redhat.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package builder
import (
_ "embed"
"github.com/falcosecurity/driverkit/pkg/kernelrelease"
)
//go:embed templates/redhat.sh
var redhatTemplate string
// TargetTypeRedhat identifies the redhat target.
const TargetTypeRedhat Type = "redhat"
// redhat is a driverkit target.
type redhat struct {
}
func init() {
BuilderByTarget[TargetTypeRedhat] = &redhat{}
}
type redhatTemplateData struct {
commonTemplateData
KernelPackage string
}
func (v *redhat) Name() string {
return TargetTypeRedhat.String()
}
func (v *redhat) TemplateScript() string {
return redhatTemplate
}
func (v *redhat) URLs(kr kernelrelease.KernelRelease) ([]string, error) {
return nil, nil
}
func (v *redhat) MinimumURLs() int {
// We don't need any url
return 0
}
func (v *redhat) TemplateData(c Config, kr kernelrelease.KernelRelease, _ []string) interface{} {
return redhatTemplateData{
commonTemplateData: c.toTemplateData(v, kr),
KernelPackage: kr.Fullversion + kr.FullExtraversion,
}
}