feature: Added '--specignore' option to pass file containing specs to be ignored for fission spec commands (#2239)

- New flag `--specignore` has been added for command fission spec [list | validate | apply | destroy]
- This flag is optional.
- The default spec ignore file name is `.specignore`, if the flag is not used
- The spec ignore file existence will be checked in the `--specdir` path
- If spec ignore file is passed to the flag, with a name other than .specignore and if it does not exist in the `--specdir` path then an error will be returned.
- `--specdir` will be the root path against which the patterns will be evaluated
- The behaviour of the spec ignore file will be similar to .gitignore (only for yml and yaml files). For reference: http://git-scm.com/docs/gitignore
This commit is contained in:
Pradeep Lakshmi Narasimha
2021-10-29 13:26:42 +05:30
committed by GitHub
parent 8fb311b739
commit a5fb5b9901
19 changed files with 103 additions and 24 deletions
+2 -1
View File
@@ -66,6 +66,7 @@ func (opts *ApplySubCommand) do(input cli.Input) error {
func (opts *ApplySubCommand) run(input cli.Input) error {
specDir := util.GetSpecDir(input)
specIgnore := util.GetSpecIgnore(input)
deleteResources := input.Bool(flagkey.SpecDelete)
watchResources := input.Bool(flagkey.SpecWatch)
@@ -111,7 +112,7 @@ func (opts *ApplySubCommand) run(input cli.Input) error {
for {
// read all specs
fr, err := ReadSpecs(specDir)
fr, err := ReadSpecs(specDir, specIgnore)
if err != nil {
return errors.Wrap(err, "error reading specs")
}