Skip to content

Commit

Permalink
chore(pkg/driverbuilder): only copy kmod/bpf makefile if kmod/bpf bui…
Browse files Browse the repository at this point in the history
…ld was requested.

Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP committed Jul 6, 2023
1 parent 66f4f01 commit 5d82d5e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/driverbuilder/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,14 @@ func (bp *DockerBuildProcessor) Start(b *builder.Build) error {
files := []dockerCopyFile{
{"/driverkit/driverkit.sh", driverkitScript},
{"/driverkit/kernel.config", string(configDecoded)},
{"/driverkit/module-Makefile", bufKmodMakefile.String()},
{"/driverkit/bpf-Makefile", bufBpfMakefile.String()},
{"/driverkit/fill-driver-config.sh", bufFillDriverConfig.String()},
}
if c.BuildModule() {
files = append(files, dockerCopyFile{"/driverkit/module-Makefile", bufKmodMakefile.String()})
}
if c.BuildProbe() {
files = append(files, dockerCopyFile{"/driverkit/bpf-Makefile", bufBpfMakefile.String()})
}

var buf bytes.Buffer
err = tarWriterFiles(&buf, files)
Expand Down
7 changes: 7 additions & 0 deletions pkg/driverbuilder/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ func (bp *KubernetesBuildProcessor) buildModule(b *builder.Build) error {
"unlock.sh": deleteLock,
},
}
if c.BuildModule() {
cm.Data["module-Makefile"] = bufKmodMakefile.String()
}
if c.BuildProbe() {
cm.Data["bpf-Makefile"] = bufBpfMakefile.String()
}

// Construct environment variable array of corev1.EnvVar
var envs []corev1.EnvVar
// Add http_porxy and https_proxy environment variable
Expand Down

0 comments on commit 5d82d5e

Please sign in to comment.