Skip to content

Commit

Permalink
adds ignore-list command
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Friesen committed Apr 7, 2021
1 parent 0477900 commit 5e1d585
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/executor/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ var RootCmd = &cobra.Command{
}
// Update ignored paths
util.UpdateInitialIgnoreList(opts.IgnoreVarRun)
for _, p := range opts.IgnorePaths {
util.AddToIgnoreList(util.IgnoreListEntry{
Path: p,
PrefixMatchOnly: false,
})
}
}
return nil
},
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions pkg/config/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ type KanikoOptions struct {
RunV2 bool
CacheCopyLayers bool
Git KanikoGitOptions
IgnorePaths multiArg
}

type KanikoGitOptions struct {
Expand Down

0 comments on commit 5e1d585

Please sign in to comment.