Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pipeline): clone image flag for compiler #561

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion command/pipeline/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion command/pipeline/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
Loading