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:
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package flag
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
@@ -24,6 +25,7 @@ import (
|
||||
|
||||
fv1 "github.com/fission/fission/pkg/apis/core/v1"
|
||||
flagkey "github.com/fission/fission/pkg/fission-cli/flag/key"
|
||||
"github.com/fission/fission/pkg/fission-cli/util"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -198,6 +200,7 @@ var (
|
||||
SpecDelete = Flag{Type: Bool, Name: flagkey.SpecDelete, Usage: "Allow apply to delete resources that no longer exist in the specification"}
|
||||
SpecDry = Flag{Type: Bool, Name: flagkey.SpecDry, Usage: "View the generated specs"}
|
||||
SpecValidation = Flag{Type: String, Name: flagkey.SpecValidate, Usage: "Turns server side validations of Fission objects on/off"}
|
||||
SpecIgnore = Flag{Type: String, Name: flagkey.SpecIgnore, Usage: fmt.Sprintf("File containing specs to be ingored inside --specdir, defaults to %v", util.SPEC_IGNORE_FILE)}
|
||||
|
||||
SupportOutput = Flag{Type: String, Name: flagkey.SupportOutput, Short: "o", Usage: "Output directory to save dump archive/files", DefaultValue: flagkey.DefaultSpecOutputDir}
|
||||
SupportNoZip = Flag{Type: Bool, Name: flagkey.SupportNoZip, Usage: "Save dump information into multiple files instead of single zip file"}
|
||||
|
||||
@@ -151,6 +151,7 @@ const (
|
||||
SpecDelete = "delete"
|
||||
SpecDry = "dry"
|
||||
SpecValidate = "validation"
|
||||
SpecIgnore = "specignore"
|
||||
|
||||
SupportOutput = Output
|
||||
SupportNoZip = "nozip"
|
||||
|
||||
Reference in New Issue
Block a user