mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-22 11:46:37 +02:00
feat: new git flags
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
This commit is contained in:
@@ -175,6 +175,9 @@ func addKanikoOptionsFlags() {
|
||||
RootCmd.PersistentFlags().VarP(&opts.Labels, "label", "", "Set metadata for an image. Set it repeatedly for multiple labels.")
|
||||
RootCmd.PersistentFlags().BoolVarP(&opts.SkipUnusedStages, "skip-unused-stages", "", false, "Build only used stages if defined to true. Otherwise it builds by default all stages, even the unnecessaries ones until it reaches the target stage / end of Dockerfile")
|
||||
RootCmd.PersistentFlags().BoolVarP(&opts.RunV2, "use-new-run", "", false, "Experimental run command to detect file system changes. This new run command does no rely on snapshotting to detect changes.")
|
||||
RootCmd.PersistentFlags().StringVarP(&opts.Git.Branch, "git-branch", "", "", "Branch to clone if build context is a git repository")
|
||||
RootCmd.PersistentFlags().BoolVarP(&opts.Git.SingleBranch, "git-single-branch", "", false, "Whether to clone a single branch")
|
||||
RootCmd.PersistentFlags().BoolVarP(&opts.Git.RecurseSubmodules, "git-recurse-submodules", "", false, "Whether to clone recursing submodules")
|
||||
}
|
||||
|
||||
// addHiddenFlags marks certain flags as hidden from the executor help text
|
||||
@@ -266,7 +269,11 @@ func resolveSourceContext() error {
|
||||
opts.SrcContext = opts.Bucket
|
||||
}
|
||||
}
|
||||
contextExecutor, err := buildcontext.GetBuildContext(opts.SrcContext)
|
||||
contextExecutor, err := buildcontext.GetBuildContext(opts.SrcContext, buildcontext.BuildOptions{
|
||||
GitBranch: opts.Git.Branch,
|
||||
GitSingleBranch: opts.Git.SingleBranch,
|
||||
GitRecurseSubmodules: opts.Git.RecurseSubmodules,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user