From 36021568c81e2cb4bbe5b66a15e89879f8097f3e Mon Sep 17 00:00:00 2001 From: Tushar Verma Date: Fri, 7 Aug 2026 16:38:04 +0530 Subject: [PATCH] storage/pkg/config: cover driver options being dropped mid-chain GetGraphDriverOptions builds one list across every driver section, but each test here sets a single field on a fresh OptionsConfig, so a branch that ends the chain early is invisible. 5d9d814bc3 fixed btrfs.min_space returning instead of appending and the package passed before and after. Putting that line back today still gives ok for the existing tests; this one fails with Expected to find "overlay.mountopt=nodev", got [btrfs.min_space=100] Signed-off-by: Tushar Verma --- storage/pkg/config/config_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/storage/pkg/config/config_test.go b/storage/pkg/config/config_test.go index c1d7d67e4d..960e2635d9 100644 --- a/storage/pkg/config/config_test.go +++ b/storage/pkg/config/config_test.go @@ -187,3 +187,27 @@ func TestZfsOptions(t *testing.T) { t.Fatalf("Expected to find size %q, got %v", s100, doptions) } } + +// Options set in different driver sections must all survive one call. Every +// other test here sets a single field on a fresh OptionsConfig, so a branch +// that ends the chain early goes unnoticed: 5d9d814bc3 fixed btrfs.min_space +// returning instead of appending, and this package passed either way. +func TestCombinedDriverOptions(t *testing.T) { + var options OptionsConfig + options.Btrfs.MinSpace = s100 + options.Overlay.MountOpt = nodev + options.Vfs.IgnoreChownErrors = trueString + options.Zfs.Name = foobar + + doptions := GetGraphDriverOptions(options) + for _, want := range []string{ + "btrfs.min_space=" + s100, + "overlay.mountopt=" + nodev, + "vfs.ignore_chown_errors=" + trueString, + "zfs.fsname=" + foobar, + } { + if !searchOptions(doptions, want) { + t.Fatalf("Expected to find %q, got %v", want, doptions) + } + } +}