From 0a62e316e082306b8491f58e7cfef28e24a6b184 Mon Sep 17 00:00:00 2001 From: Santhosh Date: Tue, 7 Feb 2023 18:13:03 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20set=20local=5Ffile=20bundleconfig?= =?UTF-8?q?=20to=20true=20if=20target=20prefix=20is=20file://=20(#823)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit set local file bundleconfig to true if target prefix is file:// Signed-off-by: Santhosh --- pkg/config/config.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index f808616..702d707 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -20,7 +20,10 @@ import ( "gopkg.in/yaml.v3" ) -const DefaultWebUIListenAddress = ":8080" +const ( + DefaultWebUIListenAddress = ":8080" + FilePrefix = "file://" +) type Install struct { Auto bool `yaml:"auto,omitempty"` @@ -53,11 +56,11 @@ type Config struct { type Bundles []Bundle type Bundle struct { - Repository string `yaml:"repository,omitempty"` - Rootfs string `yaml:"rootfs_path,omitempty"` - DB string `yaml:"db_path,omitempty"` - - Targets []string `yaml:"targets,omitempty"` + Repository string `yaml:"repository,omitempty"` + Rootfs string `yaml:"rootfs_path,omitempty"` + DB string `yaml:"db_path,omitempty"` + LocalFile bool `yaml:"local_file,omitempty"` + Targets []string `yaml:"targets,omitempty"` } const DefaultHeader = "#cloud-config" @@ -84,6 +87,9 @@ func (b Bundles) Options() (res [][]bundles.BundleOption) { if bundle.DB != "" { opts = append(opts, bundles.WithDBPath(bundle.DB)) } + if bundle.LocalFile { + opts = append(opts, bundles.WithLocalFile(true)) + } res = append(res, opts) } }