From 4ca87fa124784c6c80c43a9707de8f41488820f4 Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Thu, 20 Aug 2026 23:49:00 +0100 Subject: [PATCH 1/4] build: bump Go to 1.27 --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 53ea37f..25409b4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/qubesome/cli -go 1.25.0 +go 1.27.0 require ( github.com/cyphar/filepath-securejoin v0.7.0 From 552bbebfe2c8563f0e0c1b573ef003b873a6fae0 Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Thu, 20 Aug 2026 23:49:21 +0100 Subject: [PATCH 2/4] build: go fix ./... Signed-off-by: Paulo Gomes --- internal/command/command.go | 2 +- internal/flatpak/flatpak.go | 9 +- internal/images/images.go | 6 +- .../runners/util/container/redact_test.go | 1 - internal/types/workload.go | 5 +- internal/types/workload_test.go | 220 +++++++++--------- 6 files changed, 113 insertions(+), 130 deletions(-) diff --git a/internal/command/command.go b/internal/command/command.go index dc02888..0c75f76 100644 --- a/internal/command/command.go +++ b/internal/command/command.go @@ -26,5 +26,5 @@ type App interface { Usage(format string) Exit(code int) - Printf(format string, a ...interface{}) (n int, err error) + Printf(format string, a ...any) (n int, err error) } diff --git a/internal/flatpak/flatpak.go b/internal/flatpak/flatpak.go index df042bd..b435708 100644 --- a/internal/flatpak/flatpak.go +++ b/internal/flatpak/flatpak.go @@ -5,6 +5,7 @@ import ( "fmt" "os" "os/exec" + "slices" "github.com/qubesome/cli/internal/command" "github.com/qubesome/cli/internal/files" @@ -39,13 +40,7 @@ func Run(opts ...command.Option[Options]) error { return fmt.Errorf("profile has no flatpaks") } - allowed := false - for _, name := range prof.Flatpaks { - if name == o.Name { - allowed = true - break - } - } + allowed := slices.Contains(prof.Flatpaks, o.Name) if !allowed { return fmt.Errorf("flatpak %q is not allowed for profile %q", o.Name, o.Profile) diff --git a/internal/images/images.go b/internal/images/images.go index 84b03a9..ae4e3b5 100644 --- a/internal/images/images.go +++ b/internal/images/images.go @@ -29,16 +29,14 @@ func Run(opts ...command.Option[Options]) error { func Pull(bin string, cfg *types.Config, wg *sync.WaitGroup) error { switch cfg.WorkloadPullMode { case types.Background: - wg.Add(1) - go func() { + wg.Go(func() { if exp, _ := pullExpired(); exp { err := PullAll(bin, cfg) if err != nil { slog.Error("error pulling images", "error", err) } } - wg.Done() - }() + }) case types.OnDemand: // no-op as images will be pull when needed. } diff --git a/internal/runners/util/container/redact_test.go b/internal/runners/util/container/redact_test.go index f5be3a6..a3fe1b3 100644 --- a/internal/runners/util/container/redact_test.go +++ b/internal/runners/util/container/redact_test.go @@ -46,7 +46,6 @@ func TestRedactEnvArgs(t *testing.T) { } for _, tc := range tests { - tc := tc t.Run(tc.name, func(t *testing.T) { t.Parallel() diff --git a/internal/types/workload.go b/internal/types/workload.go index 04bcb93..0435158 100644 --- a/internal/types/workload.go +++ b/internal/types/workload.go @@ -77,9 +77,8 @@ func (w Workload) ApplyProfile(p *Profile) EffectiveWorkload { e := EffectiveWorkload{ Profile: p, Workload: w, - } - e.Name = fmt.Sprintf("%s-%s", w.Name, p.Name) + Name: fmt.Sprintf("%s-%s", w.Name, p.Name)} e.Workload.HostAccess.Camera = w.HostAccess.Camera && p.Camera e.Workload.HostAccess.Microphone = w.HostAccess.Microphone && p.Microphone @@ -111,7 +110,7 @@ func (w Workload) ApplyProfile(p *Profile) EffectiveWorkload { paths := make([]string, 0, len(w.HostAccess.Paths)) for _, path := range w.HostAccess.Paths { - src := strings.Split(path, ":")[0] + src, _, _ := strings.Cut(path, ":") if pathAllowed(src, p.HostAccess.Paths) { paths = append(paths, path) } diff --git a/internal/types/workload_test.go b/internal/types/workload_test.go index 112e5da..3ccce68 100644 --- a/internal/types/workload_test.go +++ b/internal/types/workload_test.go @@ -20,7 +20,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Camera: true}, }, profile: &Profile{ - HostAccess: HostAccess{Camera: true}, + Camera: true, }, want: EffectiveWorkload{ Name: "-", @@ -28,7 +28,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Camera: true}, }, Profile: &Profile{ - HostAccess: HostAccess{Camera: true}, + Camera: true, }, }, }, @@ -38,7 +38,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Camera: false}, }, profile: &Profile{ - HostAccess: HostAccess{Camera: true}, + Camera: true, }, want: EffectiveWorkload{ Name: "-", @@ -46,7 +46,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Camera: false}, }, Profile: &Profile{ - HostAccess: HostAccess{Camera: true}, + Camera: true, }, }, }, @@ -56,7 +56,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Camera: true}, }, profile: &Profile{ - HostAccess: HostAccess{Camera: false}, + Camera: false, }, want: EffectiveWorkload{ Name: "-", @@ -64,7 +64,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Camera: false}, }, Profile: &Profile{ - HostAccess: HostAccess{Camera: false}, + Camera: false, }, }, }, @@ -74,7 +74,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Camera: false}, }, profile: &Profile{ - HostAccess: HostAccess{Camera: false}, + Camera: false, }, want: EffectiveWorkload{ Name: "-", @@ -82,7 +82,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Camera: false}, }, Profile: &Profile{ - HostAccess: HostAccess{Camera: false}, + Camera: false, }, }, }, @@ -92,7 +92,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Dbus: true}, }, profile: &Profile{ - HostAccess: HostAccess{Dbus: true}, + Dbus: true, }, want: EffectiveWorkload{ Name: "-", @@ -100,7 +100,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Dbus: true}, }, Profile: &Profile{ - HostAccess: HostAccess{Dbus: true}, + Dbus: true, }, }, }, @@ -110,7 +110,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Dbus: false}, }, profile: &Profile{ - HostAccess: HostAccess{Dbus: true}, + Dbus: true, }, want: EffectiveWorkload{ Name: "-", @@ -118,7 +118,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Dbus: false}, }, Profile: &Profile{ - HostAccess: HostAccess{Dbus: true}, + Dbus: true, }, }, }, @@ -128,7 +128,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Dbus: true}, }, profile: &Profile{ - HostAccess: HostAccess{Dbus: false}, + Dbus: false, }, want: EffectiveWorkload{ Name: "-", @@ -136,7 +136,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Dbus: false}, }, Profile: &Profile{ - HostAccess: HostAccess{Dbus: false}, + Dbus: false, }, }, }, @@ -146,7 +146,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Dbus: false}, }, profile: &Profile{ - HostAccess: HostAccess{Dbus: false}, + Dbus: false, }, want: EffectiveWorkload{ Name: "-", @@ -154,7 +154,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Dbus: false}, }, Profile: &Profile{ - HostAccess: HostAccess{Dbus: false}, + Dbus: false, }, }, }, @@ -164,7 +164,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Microphone: true}, }, profile: &Profile{ - HostAccess: HostAccess{Microphone: true}, + Microphone: true, }, want: EffectiveWorkload{ Name: "-", @@ -172,7 +172,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Microphone: true}, }, Profile: &Profile{ - HostAccess: HostAccess{Microphone: true}, + Microphone: true, }, }, }, @@ -182,7 +182,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Microphone: false}, }, profile: &Profile{ - HostAccess: HostAccess{Microphone: true}, + Microphone: true, }, want: EffectiveWorkload{ Name: "-", @@ -190,7 +190,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Microphone: false}, }, Profile: &Profile{ - HostAccess: HostAccess{Microphone: true}, + Microphone: true, }, }, }, @@ -200,7 +200,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Microphone: true}, }, profile: &Profile{ - HostAccess: HostAccess{Microphone: false}, + Microphone: false, }, want: EffectiveWorkload{ Name: "-", @@ -208,7 +208,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Microphone: false}, }, Profile: &Profile{ - HostAccess: HostAccess{Microphone: false}, + Microphone: false, }, }, }, @@ -218,7 +218,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Microphone: false}, }, profile: &Profile{ - HostAccess: HostAccess{Microphone: false}, + Microphone: false, }, want: EffectiveWorkload{ Name: "-", @@ -226,7 +226,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Microphone: false}, }, Profile: &Profile{ - HostAccess: HostAccess{Microphone: false}, + Microphone: false, }, }, }, @@ -236,7 +236,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Speakers: true}, }, profile: &Profile{ - HostAccess: HostAccess{Speakers: true}, + Speakers: true, }, want: EffectiveWorkload{ Name: "-", @@ -244,7 +244,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Speakers: true}, }, Profile: &Profile{ - HostAccess: HostAccess{Speakers: true}, + Speakers: true, }, }, }, @@ -254,7 +254,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Speakers: false}, }, profile: &Profile{ - HostAccess: HostAccess{Speakers: true}, + Speakers: true, }, want: EffectiveWorkload{ Name: "-", @@ -262,7 +262,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Speakers: false}, }, Profile: &Profile{ - HostAccess: HostAccess{Speakers: true}, + Speakers: true, }, }, }, @@ -272,7 +272,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Speakers: true}, }, profile: &Profile{ - HostAccess: HostAccess{Speakers: false}, + Speakers: false, }, want: EffectiveWorkload{ Name: "-", @@ -280,7 +280,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Speakers: false}, }, Profile: &Profile{ - HostAccess: HostAccess{Speakers: false}, + Speakers: false, }, }, }, @@ -290,7 +290,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Speakers: false}, }, profile: &Profile{ - HostAccess: HostAccess{Speakers: false}, + Speakers: false, }, want: EffectiveWorkload{ Name: "-", @@ -298,7 +298,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Speakers: false}, }, Profile: &Profile{ - HostAccess: HostAccess{Speakers: false}, + Speakers: false, }, }, }, @@ -308,7 +308,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{VarRunUser: true}, }, profile: &Profile{ - HostAccess: HostAccess{VarRunUser: true}, + VarRunUser: true, }, want: EffectiveWorkload{ Name: "-", @@ -316,7 +316,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{VarRunUser: true}, }, Profile: &Profile{ - HostAccess: HostAccess{VarRunUser: true}, + VarRunUser: true, }, }, }, @@ -326,7 +326,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{VarRunUser: false}, }, profile: &Profile{ - HostAccess: HostAccess{VarRunUser: true}, + VarRunUser: true, }, want: EffectiveWorkload{ Name: "-", @@ -334,7 +334,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{VarRunUser: false}, }, Profile: &Profile{ - HostAccess: HostAccess{VarRunUser: true}, + VarRunUser: true, }, }, }, @@ -344,7 +344,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{VarRunUser: true}, }, profile: &Profile{ - HostAccess: HostAccess{VarRunUser: false}, + VarRunUser: false, }, want: EffectiveWorkload{ Name: "-", @@ -352,7 +352,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{VarRunUser: false}, }, Profile: &Profile{ - HostAccess: HostAccess{VarRunUser: false}, + VarRunUser: false, }, }, }, @@ -362,7 +362,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{VarRunUser: false}, }, profile: &Profile{ - HostAccess: HostAccess{VarRunUser: false}, + VarRunUser: false, }, want: EffectiveWorkload{ Name: "-", @@ -370,7 +370,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{VarRunUser: false}, }, Profile: &Profile{ - HostAccess: HostAccess{VarRunUser: false}, + VarRunUser: false, }, }, }, @@ -382,9 +382,7 @@ func Test_ApplyProfile(t *testing.T) { }, }, profile: &Profile{ - HostAccess: HostAccess{ - USBDevices: []string{}, - }, + USBDevices: []string{}, }, want: EffectiveWorkload{ Name: "-", @@ -394,9 +392,7 @@ func Test_ApplyProfile(t *testing.T) { }, }, Profile: &Profile{ - HostAccess: HostAccess{ - USBDevices: []string{}, - }, + USBDevices: []string{}, }, }, }, @@ -412,11 +408,9 @@ func Test_ApplyProfile(t *testing.T) { }, }, profile: &Profile{ - HostAccess: HostAccess{ - USBDevices: []string{ - "Foo", - "FooBar", - }, + USBDevices: []string{ + "Foo", + "FooBar", }, }, want: EffectiveWorkload{ @@ -429,11 +423,9 @@ func Test_ApplyProfile(t *testing.T) { }, }, Profile: &Profile{ - HostAccess: HostAccess{ - USBDevices: []string{ - "Foo", - "FooBar", - }, + USBDevices: []string{ + "Foo", + "FooBar", }, }, }, @@ -444,7 +436,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Gpus: "all"}, }, profile: &Profile{ - HostAccess: HostAccess{Gpus: "all"}, + Gpus: "all", }, want: EffectiveWorkload{ Name: "-", @@ -452,7 +444,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Gpus: "all"}, }, Profile: &Profile{ - HostAccess: HostAccess{Gpus: "all"}, + Gpus: "all", }, }, }, @@ -462,7 +454,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Gpus: ""}, }, profile: &Profile{ - HostAccess: HostAccess{Gpus: "all"}, + Gpus: "all", }, want: EffectiveWorkload{ Name: "-", @@ -470,7 +462,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Gpus: ""}, }, Profile: &Profile{ - HostAccess: HostAccess{Gpus: "all"}, + Gpus: "all", }, }, }, @@ -480,7 +472,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Gpus: "all"}, }, profile: &Profile{ - HostAccess: HostAccess{Gpus: ""}, + Gpus: "", }, want: EffectiveWorkload{ Name: "-", @@ -488,7 +480,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Gpus: ""}, }, Profile: &Profile{ - HostAccess: HostAccess{Gpus: ""}, + Gpus: "", }, }, }, @@ -498,7 +490,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Gpus: ""}, }, profile: &Profile{ - HostAccess: HostAccess{Gpus: ""}, + Gpus: "", }, want: EffectiveWorkload{ Name: "-", @@ -506,7 +498,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Gpus: ""}, }, Profile: &Profile{ - HostAccess: HostAccess{Gpus: ""}, + Gpus: "", }, }, }, @@ -516,7 +508,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Privileged: true}, }, profile: &Profile{ - HostAccess: HostAccess{Privileged: true}, + Privileged: true, }, want: EffectiveWorkload{ Name: "-", @@ -524,7 +516,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Privileged: true}, }, Profile: &Profile{ - HostAccess: HostAccess{Privileged: true}, + Privileged: true, }, }, }, @@ -534,7 +526,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Privileged: false}, }, profile: &Profile{ - HostAccess: HostAccess{Privileged: true}, + Privileged: true, }, want: EffectiveWorkload{ Name: "-", @@ -542,7 +534,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Privileged: false}, }, Profile: &Profile{ - HostAccess: HostAccess{Privileged: true}, + Privileged: true, }, }, }, @@ -552,7 +544,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Privileged: true}, }, profile: &Profile{ - HostAccess: HostAccess{Privileged: false}, + Privileged: false, }, want: EffectiveWorkload{ Name: "-", @@ -560,7 +552,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Privileged: false}, }, Profile: &Profile{ - HostAccess: HostAccess{Privileged: false}, + Privileged: false, }, }, }, @@ -570,7 +562,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Privileged: false}, }, profile: &Profile{ - HostAccess: HostAccess{Privileged: false}, + Privileged: false, }, want: EffectiveWorkload{ Name: "-", @@ -578,7 +570,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Privileged: false}, }, Profile: &Profile{ - HostAccess: HostAccess{Privileged: false}, + Privileged: false, }, }, }, @@ -588,7 +580,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Network: ""}, }, profile: &Profile{ - HostAccess: HostAccess{Network: ""}, + Network: "", }, want: EffectiveWorkload{ Name: "-", @@ -596,7 +588,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Network: ""}, }, Profile: &Profile{ - HostAccess: HostAccess{Network: ""}, + Network: "", }, }, }, @@ -606,7 +598,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Network: ""}, }, profile: &Profile{ - HostAccess: HostAccess{Network: "none"}, + Network: "none", }, want: EffectiveWorkload{ Name: "-", @@ -614,7 +606,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Network: "none"}, }, Profile: &Profile{ - HostAccess: HostAccess{Network: "none"}, + Network: "none", }, }, }, @@ -624,7 +616,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Network: "none"}, }, profile: &Profile{ - HostAccess: HostAccess{Network: ""}, + Network: "", }, want: EffectiveWorkload{ Name: "-", @@ -632,7 +624,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Network: "none"}, }, Profile: &Profile{ - HostAccess: HostAccess{Network: ""}, + Network: "", }, }, }, @@ -642,7 +634,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Network: "foo"}, }, profile: &Profile{ - HostAccess: HostAccess{Network: "foo"}, + Network: "foo", }, want: EffectiveWorkload{ Name: "-", @@ -650,7 +642,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Network: "foo"}, }, Profile: &Profile{ - HostAccess: HostAccess{Network: "foo"}, + Network: "foo", }, }, }, @@ -660,7 +652,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Network: ""}, }, profile: &Profile{ - HostAccess: HostAccess{Network: "foo"}, + Network: "foo", }, want: EffectiveWorkload{ Name: "-", @@ -668,7 +660,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Network: "foo"}, }, Profile: &Profile{ - HostAccess: HostAccess{Network: "foo"}, + Network: "foo", }, }, }, @@ -678,7 +670,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Network: "foo"}, }, profile: &Profile{ - HostAccess: HostAccess{Network: ""}, + Network: "", }, want: EffectiveWorkload{ Name: "-", @@ -686,7 +678,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Network: ""}, }, Profile: &Profile{ - HostAccess: HostAccess{Network: ""}, + Network: "", }, }, }, @@ -696,7 +688,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Network: "none"}, }, profile: &Profile{ - HostAccess: HostAccess{Network: "foo"}, + Network: "foo", }, want: EffectiveWorkload{ Name: "-", @@ -704,7 +696,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Network: "none"}, }, Profile: &Profile{ - HostAccess: HostAccess{Network: "foo"}, + Network: "foo", }, }, }, @@ -822,7 +814,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{CapsAdd: []string{"FOO"}}, }, profile: &Profile{ - HostAccess: HostAccess{CapsAdd: []string{}}, + CapsAdd: []string{}, }, want: EffectiveWorkload{ Name: "-", @@ -830,7 +822,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{CapsAdd: []string{}}, }, Profile: &Profile{ - HostAccess: HostAccess{CapsAdd: []string{}}, + CapsAdd: []string{}, }, }, }, @@ -840,7 +832,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{CapsAdd: []string{"FOO"}}, }, profile: &Profile{ - HostAccess: HostAccess{CapsAdd: []string{"FOO"}}, + CapsAdd: []string{"FOO"}, }, want: EffectiveWorkload{ Name: "-", @@ -848,7 +840,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{CapsAdd: []string{"FOO"}}, }, Profile: &Profile{ - HostAccess: HostAccess{CapsAdd: []string{"FOO"}}, + CapsAdd: []string{"FOO"}, }, }, }, @@ -858,7 +850,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{CapsAdd: []string{"FOO"}}, }, profile: &Profile{ - HostAccess: HostAccess{CapsAdd: []string{"FOOB"}}, + CapsAdd: []string{"FOOB"}, }, want: EffectiveWorkload{ Name: "-", @@ -866,7 +858,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{CapsAdd: []string{}}, }, Profile: &Profile{ - HostAccess: HostAccess{CapsAdd: []string{"FOOB"}}, + CapsAdd: []string{"FOOB"}, }, }, }, @@ -876,7 +868,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{CapsAdd: []string{"foo"}}, }, profile: &Profile{ - HostAccess: HostAccess{CapsAdd: []string{"foo"}}, + CapsAdd: []string{"foo"}, }, want: EffectiveWorkload{ Name: "-", @@ -884,7 +876,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{CapsAdd: []string{"foo"}}, }, Profile: &Profile{ - HostAccess: HostAccess{CapsAdd: []string{"foo"}}, + CapsAdd: []string{"foo"}, }, }, }, @@ -894,7 +886,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{CapsAdd: []string{"bar"}}, }, profile: &Profile{ - HostAccess: HostAccess{CapsAdd: []string{"foo", "bar"}}, + CapsAdd: []string{"foo", "bar"}, }, want: EffectiveWorkload{ Name: "-", @@ -902,7 +894,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{CapsAdd: []string{"bar"}}, }, Profile: &Profile{ - HostAccess: HostAccess{CapsAdd: []string{"foo", "bar"}}, + CapsAdd: []string{"foo", "bar"}, }, }, }, @@ -912,7 +904,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{CapsAdd: []string{"bar"}}, }, profile: &Profile{ - HostAccess: HostAccess{CapsAdd: []string{"foo"}}, + CapsAdd: []string{"foo"}, }, want: EffectiveWorkload{ Name: "-", @@ -920,7 +912,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{CapsAdd: []string{}}, }, Profile: &Profile{ - HostAccess: HostAccess{CapsAdd: []string{"foo"}}, + CapsAdd: []string{"foo"}, }, }, }, @@ -930,7 +922,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Devices: []string{"/foo"}}, }, profile: &Profile{ - HostAccess: HostAccess{Devices: []string{}}, + Devices: []string{}, }, want: EffectiveWorkload{ Name: "-", @@ -938,7 +930,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Devices: []string{}}, }, Profile: &Profile{ - HostAccess: HostAccess{Devices: []string{}}, + Devices: []string{}, }, }, }, @@ -948,7 +940,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Devices: []string{}}, }, profile: &Profile{ - HostAccess: HostAccess{Devices: []string{"/foo"}}, + Devices: []string{"/foo"}, }, want: EffectiveWorkload{ Name: "-", @@ -956,7 +948,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Devices: []string{}}, }, Profile: &Profile{ - HostAccess: HostAccess{Devices: []string{"/foo"}}, + Devices: []string{"/foo"}, }, }, }, @@ -966,7 +958,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Devices: []string{"/foo"}}, }, profile: &Profile{ - HostAccess: HostAccess{Devices: []string{"/foo"}}, + Devices: []string{"/foo"}, }, want: EffectiveWorkload{ Name: "-", @@ -974,7 +966,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Devices: []string{"/foo"}}, }, Profile: &Profile{ - HostAccess: HostAccess{Devices: []string{"/foo"}}, + Devices: []string{"/foo"}, }, }, }, @@ -984,7 +976,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Devices: []string{"/foo/"}}, }, profile: &Profile{ - HostAccess: HostAccess{Devices: []string{"/foo"}}, + Devices: []string{"/foo"}, }, want: EffectiveWorkload{ Name: "-", @@ -992,7 +984,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Devices: []string{"/foo/"}}, }, Profile: &Profile{ - HostAccess: HostAccess{Devices: []string{"/foo"}}, + Devices: []string{"/foo"}, }, }, }, @@ -1002,7 +994,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Devices: []string{"/foo"}}, }, profile: &Profile{ - HostAccess: HostAccess{Devices: []string{"/foob"}}, + Devices: []string{"/foob"}, }, want: EffectiveWorkload{ Name: "-", @@ -1010,7 +1002,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Devices: []string{}}, }, Profile: &Profile{ - HostAccess: HostAccess{Devices: []string{"/foob"}}, + Devices: []string{"/foob"}, }, }, }, @@ -1020,7 +1012,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Devices: []string{"/foo"}}, }, profile: &Profile{ - HostAccess: HostAccess{Devices: []string{"/foo"}}, + Devices: []string{"/foo"}, }, want: EffectiveWorkload{ Name: "-", @@ -1028,7 +1020,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Devices: []string{"/foo"}}, }, Profile: &Profile{ - HostAccess: HostAccess{Devices: []string{"/foo"}}, + Devices: []string{"/foo"}, }, }, }, @@ -1038,7 +1030,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Devices: []string{"/bar"}}, }, profile: &Profile{ - HostAccess: HostAccess{Devices: []string{"/foo", "/bar"}}, + Devices: []string{"/foo", "/bar"}, }, want: EffectiveWorkload{ Name: "-", @@ -1046,7 +1038,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Devices: []string{"/bar"}}, }, Profile: &Profile{ - HostAccess: HostAccess{Devices: []string{"/foo", "/bar"}}, + Devices: []string{"/foo", "/bar"}, }, }, }, @@ -1056,7 +1048,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Devices: []string{"/bar"}}, }, profile: &Profile{ - HostAccess: HostAccess{Devices: []string{"/foo"}}, + Devices: []string{"/foo"}, }, want: EffectiveWorkload{ Name: "-", @@ -1064,7 +1056,7 @@ func Test_ApplyProfile(t *testing.T) { HostAccess: HostAccess{Devices: []string{}}, }, Profile: &Profile{ - HostAccess: HostAccess{Devices: []string{"/foo"}}, + Devices: []string{"/foo"}, }, }, }, From 94ff41ec7daeaf11098cc2a2fb7a069b1e5da0d7 Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Thu, 20 Aug 2026 23:52:11 +0100 Subject: [PATCH 3/4] test: make container runner lookup deterministic --- internal/files/binaries_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/files/binaries_test.go b/internal/files/binaries_test.go index 4881061..239ed0e 100644 --- a/internal/files/binaries_test.go +++ b/internal/files/binaries_test.go @@ -8,6 +8,8 @@ import ( ) func TestContainerRunnerBinary(t *testing.T) { + t.Setenv("PATH", t.TempDir()) + tests := []struct { in string want string From c3dfaac7cba2fb8e7340e6fad2dad08a3fee773e Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Thu, 20 Aug 2026 23:53:11 +0100 Subject: [PATCH 4/4] build: Bump golangci-lint to v2.13.0 Signed-off-by: Paulo Gomes --- hack/base.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/base.mk b/hack/base.mk index e2531dd..858fcd4 100644 --- a/hack/base.mk +++ b/hack/base.mk @@ -1,5 +1,5 @@ # renovate: datasource=github-tags depName=golangci/golangci-lint -GOLANGCI_VERSION ?= v2.12.2 +GOLANGCI_VERSION ?= v2.13.0 # renovate: datasource=github-tags depName=protocolbuffers/protobuf PROTOC_VERSION ?= v35.1 TOOLS_BIN := $(shell mkdir -p build/tools && realpath build/tools)