From 3b5e84cfc00c8b1f49a1f914075fc5f12631ad95 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Tue, 10 Sep 2024 08:10:00 +0000 Subject: [PATCH] chore: remove remote-repo-dir option --- envbuilder.go | 4 ++-- options/defaults.go | 3 --- options/defaults_test.go | 1 - options/options.go | 12 ------------ 4 files changed, 2 insertions(+), 18 deletions(-) diff --git a/envbuilder.go b/envbuilder.go index 934c51e3..07b34807 100644 --- a/envbuilder.go +++ b/envbuilder.go @@ -148,7 +148,7 @@ func Run(ctx context.Context, opts options.Options) error { if err != nil { return fmt.Errorf("git clone options: %w", err) } - cloneOpts.Path = opts.RemoteRepoDir + cloneOpts.Path = magicDir.Join("repo") endStage := startStage("📦 Remote repo build mode enabled, cloning %s to %s for build context...", newColor(color.FgCyan).Sprintf(opts.GitURL), @@ -927,7 +927,7 @@ func RunCacheProbe(ctx context.Context, opts options.Options) (v1.Image, error) if err != nil { return nil, fmt.Errorf("git clone options: %w", err) } - cloneOpts.Path = opts.RemoteRepoDir + cloneOpts.Path = magicDir.Join("repo") endStage := startStage("📦 Remote repo build mode enabled, cloning %s to %s for build context...", newColor(color.FgCyan).Sprintf(opts.GitURL), diff --git a/options/defaults.go b/options/defaults.go index df3d436c..220480d8 100644 --- a/options/defaults.go +++ b/options/defaults.go @@ -59,9 +59,6 @@ func (o *Options) SetDefaults() { if o.WorkspaceFolder == "" { o.WorkspaceFolder = DefaultWorkspaceFolder(o.GitURL) } - if o.RemoteRepoDir == "" { - o.RemoteRepoDir = magicdir.Default.Join("repo") - } if o.BinaryPath == "" { o.BinaryPath = "/.envbuilder/bin/envbuilder" } diff --git a/options/defaults_test.go b/options/defaults_test.go index 8c9946f6..4387c084 100644 --- a/options/defaults_test.go +++ b/options/defaults_test.go @@ -85,7 +85,6 @@ func TestOptions_SetDefaults(t *testing.T) { GitURL: "", WorkspaceFolder: options.EmptyWorkspaceDir, MagicDirBase: "/.envbuilder", - RemoteRepoDir: "/.envbuilder/repo", BinaryPath: "/.envbuilder/bin/envbuilder", } diff --git a/options/options.go b/options/options.go index a0058cd3..5b2586c7 100644 --- a/options/options.go +++ b/options/options.go @@ -157,10 +157,6 @@ type Options struct { // working on the same repository. RemoteRepoBuildMode bool - // RemoteRepoDir is the destination directory for the cloned repo when using - // remote repo build mode. - RemoteRepoDir string - // BinaryPath is the path to the local envbuilder binary when // attempting to probe the build cache. This is only relevant when // GetCachedImage is true. @@ -459,14 +455,6 @@ func (o *Options) CLI() serpent.OptionSet { "be used to improving cache utilization when multiple users are building " + "working on the same repository.", }, - { - Flag: "remote-repo-dir", - Env: WithEnvPrefix("REMOTE_REPO_DIR"), - Value: serpent.StringOf(&o.RemoteRepoDir), - // Default: magicdir.Default.Join("repo"), // TODO: reinstate once legacy opts are removed. - Hidden: true, - Description: "Specify the destination directory for the cloned repo when using remote repo build mode.", - }, { Flag: "verbose", Env: WithEnvPrefix("VERBOSE"),