Updated formula regexp to support ?ref= syntax.
Added formulas docs for salt-masterless provisioner Signed-off-by: Andrew Cornies <acornies@gmail.com>
This commit is contained in:
parent
ecb825ee7a
commit
a704e1b6b1
|
@ -448,7 +448,7 @@ func validateFileConfig(path string, name string, required bool) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func hasValidFormulaURLs(s []string) bool {
|
func hasValidFormulaURLs(s []string) bool {
|
||||||
re := regexp.MustCompile(`^(.*).git\/\/[a-zA-Z0-9-_]+$`)
|
re := regexp.MustCompile(`^(.*).git\/\/[a-zA-Z0-9-_]+(\?.*)?$`)
|
||||||
|
|
||||||
for _, u := range s {
|
for _, u := range s {
|
||||||
if !re.MatchString(u) {
|
if !re.MatchString(u) {
|
||||||
|
|
|
@ -348,6 +348,7 @@ func TestProvisionerPrepare_ValidFormulaURLs(t *testing.T) {
|
||||||
config["formulas"] = []string{
|
config["formulas"] = []string{
|
||||||
"git::https://github.com/org/some-formula.git//example",
|
"git::https://github.com/org/some-formula.git//example",
|
||||||
"git@github.com:org/some-formula.git//example",
|
"git@github.com:org/some-formula.git//example",
|
||||||
|
"git::https://github.com/org/some-formula.git//example?ref=example",
|
||||||
}
|
}
|
||||||
|
|
||||||
err := p.Prepare(config)
|
err := p.Prepare(config)
|
||||||
|
|
|
@ -100,4 +100,9 @@ Optional:
|
||||||
- `guest_os_type` (string) - The target guest OS type, either "unix" or
|
- `guest_os_type` (string) - The target guest OS type, either "unix" or
|
||||||
"windows".
|
"windows".
|
||||||
|
|
||||||
|
- `formulas` (array of strings) - An array of git source formulas to be downloaded to the local
|
||||||
|
state tree prior to moving to the remote state tree. Note: `//directory` must be included in
|
||||||
|
the URL to download the appropriate formula directory. Example:
|
||||||
|
`git::https://github.com/saltstack-formulas/vault-formula.git//vault?ref=v1.2.3`
|
||||||
|
|
||||||
@include 'provisioners/common-config.mdx'
|
@include 'provisioners/common-config.mdx'
|
||||||
|
|
Loading…
Reference in New Issue