Skip to content

Commit

Permalink
new: properly use driverkit v0.15.0 builder images while building.
Browse files Browse the repository at this point in the history
Also, properly ship a static dbg-go!

Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP committed Sep 7, 2023
1 parent e315fc7 commit 4faa090
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
GO ?= go
output ?= dbg-go
TEST_FLAGS ?= -v -race -tags=test_all
LDFLAGS := -X github.com/falcosecurity/driverkit/pkg/driverbuilder/builder.defaultImageTag=v0.15.0

.PHONY: build
build: ${output}

.PHONY: ${output}
${output}:
$(GO) build -o $@
CGO_ENABLED=0 $(GO) build -ldflags '${LDFLAGS}' -o $@

.PHONY: clean
clean:
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,11 @@ Using `goreleaser`, multiple artifacts are attached to each github release; amon


> **NOTE:** all commands that require s3 write access, need a proper `--aws-profile` to be passed.
## Bumping driverkit

To bump driverkit, you just need:
```shell
go get github.com/falcosecurity/[email protected]
```
and then update Makefile LDFLAGS defaultImageTag to same version.
6 changes: 3 additions & 3 deletions pkg/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,19 @@ func buildConfig(client *s3utils.Client, opts Options, redirectErrorsF *os.File,
if ro.Output.Module != "" {
moduleName := filepath.Base(ro.Output.Module)
if client.HeadDriver(opts.Options, driverVersion, moduleName) {
logger.Info("output module already exists inside S3 bucket - skipping", "path", ro.Output.Module)
logger.Info("output module already exists inside S3 bucket - skipping")
ro.Output.Module = "" // disable module build
}
}
if ro.Output.Probe != "" {
probeName := filepath.Base(ro.Output.Probe)
if client.HeadDriver(opts.Options, driverVersion, probeName) {
logger.Info("output probe already exists inside S3 bucket - skipping", "path", ro.Output.Probe)
logger.Info("output probe already exists inside S3 bucket - skipping")
ro.Output.Probe = "" // disable probe build
}
}
if ro.Output.Module == "" && ro.Output.Probe == "" {
logger.Info("drivers already available on remote, skipping")
logger.Info("drivers already available on S3 bucket, skipping build")
return nil // nothing to do
}
}
Expand Down

0 comments on commit 4faa090

Please sign in to comment.