parent
adad25b50b
commit
df0b06a87a
|
@ -40,6 +40,7 @@ var FuncGens = map[string]interface{}{
|
|||
"packer_version": funcGenPackerVersion,
|
||||
"consul_key": funcGenConsul,
|
||||
"vault": funcGenVault,
|
||||
"sed": funcGenSed,
|
||||
|
||||
"replace": replace,
|
||||
"replace_all": replace_all,
|
||||
|
@ -266,6 +267,14 @@ func funcGenVault(ctx *Context) interface{} {
|
|||
}
|
||||
}
|
||||
|
||||
func funcGenSed(ctx *Context) interface{} {
|
||||
return func(expression string, inputString string) (string, error) {
|
||||
return "", errors.New("template function `sed` is deprecated " +
|
||||
"use `replace` or `replace_all` instead." +
|
||||
"Documentation: https://www.packer.io/docs/templates/engine.html")
|
||||
}
|
||||
}
|
||||
|
||||
func replace_all(old, new, src string) string {
|
||||
return strings.ReplaceAll(src, old, new)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue