From 61e5d4aeb4f6b12786fa0bd8adfd0e4aabdf7a3f Mon Sep 17 00:00:00 2001 From: Ian Eyberg Date: Thu, 24 Mar 2022 15:13:09 -0700 Subject: [PATCH] fixing pkg path for image create pkgs (#1302) * fixing pkg path for image create pkgs * mving pkg slug into mergeContainer Co-authored-by: Ian Eyberg --- cmd/cmd_image.go | 1 + cmd/cmd_pkg.go | 1 - cmd/flags_pkg.go | 7 +++++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/cmd_image.go b/cmd/cmd_image.go index 9487b2a1..e99fa8cc 100644 --- a/cmd/cmd_image.go +++ b/cmd/cmd_image.go @@ -77,6 +77,7 @@ func imageCreateCommandHandler(cmd *cobra.Command, args []string) { } mergeContainer := NewMergeConfigContainer(configFlags, globalFlags, nightlyFlags, nanosVersionFlags, buildImageFlags, providerFlags, pkgFlags) + err := mergeContainer.Merge(c) if err != nil { exitWithError(err.Error()) diff --git a/cmd/cmd_pkg.go b/cmd/cmd_pkg.go index 81404ed6..74536d51 100644 --- a/cmd/cmd_pkg.go +++ b/cmd/cmd_pkg.go @@ -446,7 +446,6 @@ func loadCommandHandler(cmd *cobra.Command, args []string) { runLocalInstanceFlags := NewRunLocalInstanceCommandFlags(flags) pkgFlags := NewPkgCommandFlags(flags) pkgFlags.Package = args[0] - pkgFlags.SluggedPackage = strings.ReplaceAll(args[0], ":", "_") c := api.NewConfig() diff --git a/cmd/flags_pkg.go b/cmd/flags_pkg.go index 418350c8..440eae88 100644 --- a/cmd/flags_pkg.go +++ b/cmd/flags_pkg.go @@ -6,11 +6,12 @@ import ( "os" "path" "path/filepath" - - "github.com/nanovms/ops/types" + "strings" "github.com/nanovms/ops/lepton" api "github.com/nanovms/ops/lepton" + "github.com/nanovms/ops/types" + "github.com/spf13/pflag" ) @@ -36,6 +37,8 @@ func (flags *PkgCommandFlags) MergeToConfig(c *types.Config) (err error) { return } + flags.SluggedPackage = strings.ReplaceAll(flags.Package, ":", "_") + packagePath := flags.PackagePath() if _, err := os.Stat(packagePath); os.IsNotExist(err) {