From 88582e2419eb63a4676b82458173c93dc70e562f Mon Sep 17 00:00:00 2001 From: Easton Crupper <65553218+ecrupper@users.noreply.github.com> Date: Fri, 17 May 2024 10:43:43 -0500 Subject: [PATCH] fix(pipeline): clone image flag for compiler (#561) --- command/pipeline/exec.go | 9 ++++++++- command/pipeline/validate.go | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/command/pipeline/exec.go b/command/pipeline/exec.go index dd2bddcd..20febd00 100644 --- a/command/pipeline/exec.go +++ b/command/pipeline/exec.go @@ -167,6 +167,13 @@ var CommandExec = &cli.Command{ Usage: "set the starlark execution step limit for compiling starlark pipelines", Value: 7500, }, + &cli.StringFlag{ + EnvVars: []string{"VELA_CLONE_IMAGE", "COMPILER_CLONE_IMAGE"}, + Name: "clone-image", + Usage: "the clone image to use for the injected clone step", + // renovate: image=target/vela-git + Value: "target/vela-git:v0.8.0@sha256:02de004ae9dbf184c70039cb9ce431c31d6e7580eb9e6ec64a97ebf108aa65cb", + }, // Environment Flags &cli.BoolFlag{ @@ -326,7 +333,7 @@ func exec(c *cli.Context) error { // set max template depth to minimum of 5 and provided value if local templates are not provided. // This prevents users from spamming SCM client.SetTemplateDepth(util.MinInt(c.Int("max-template-depth"), 5)) - logrus.Debugf("no local template files provided, setting max template depth to %d", client.TemplateDepth) + logrus.Debugf("no local template files provided, setting max template depth to %d", client.GetTemplateDepth()) } // execute the exec call for the pipeline configuration diff --git a/command/pipeline/validate.go b/command/pipeline/validate.go index 2bc7c9ae..aea6d949 100644 --- a/command/pipeline/validate.go +++ b/command/pipeline/validate.go @@ -154,6 +154,13 @@ var CommandValidate = &cli.Command{ Aliases: []string{"cgu"}, Usage: "github url, used by compiler, for pulling registry templates", }, + &cli.StringFlag{ + EnvVars: []string{"VELA_CLONE_IMAGE", "COMPILER_CLONE_IMAGE"}, + Name: "clone-image", + Usage: "the clone image to use for the injected clone step", + // renovate: image=target/vela-git + Value: "target/vela-git:v0.8.0@sha256:02de004ae9dbf184c70039cb9ce431c31d6e7580eb9e6ec64a97ebf108aa65cb", + }, }, CustomHelpTemplate: fmt.Sprintf(`%s EXAMPLES: @@ -257,7 +264,7 @@ func validate(c *cli.Context) error { // set max template depth to minimum of 5 and provided value if local templates are not provided. // This prevents users from spamming SCM client.SetTemplateDepth(util.MinInt(c.Int("max-template-depth"), 5)) - logrus.Debugf("no local template files provided, setting max template depth to %d", client.TemplateDepth) + logrus.Debugf("no local template files provided, setting max template depth to %d", client.GetTemplateDepth()) } // execute the validate local call for the pipeline configuration