adds ignore-path command arguments to executor (#1622)

* adds ignore-path command

* add flag to README
This commit is contained in:
Jon Friesen
2021-04-13 14:29:51 -07:00
committed by GitHub
parent 0477900feb
commit d40a51f38f
5 changed files with 42 additions and 9 deletions
+7
View File
@@ -88,6 +88,12 @@ var RootCmd = &cobra.Command{
}
// Update ignored paths
util.UpdateInitialIgnoreList(opts.IgnoreVarRun)
for _, p := range opts.IgnorePaths {
util.AddToBaseIgnoreList(util.IgnoreListEntry{
Path: p,
PrefixMatchOnly: false,
})
}
}
return nil
},
@@ -185,6 +191,7 @@ func addKanikoOptionsFlags() {
RootCmd.PersistentFlags().BoolVarP(&opts.RunV2, "use-new-run", "", false, "Use the experimental run implementation for detecting changes without requiring file system snapshots.")
RootCmd.PersistentFlags().Var(&opts.Git, "git", "Branch to clone if build context is a git repository")
RootCmd.PersistentFlags().BoolVarP(&opts.CacheCopyLayers, "cache-copy-layers", "", false, "Caches copy layers")
RootCmd.PersistentFlags().VarP(&opts.IgnorePaths, "ignore-path", "", "Ignore these paths when taking a snapshot. Set it repeatedly for multiple paths.")
}
// addHiddenFlags marks certain flags as hidden from the executor help text