chore: change templateCleanOMIName to templateCleanResourceName function

:
pull/7459/head
Marin Salinas 7 years ago committed by Megan Marsh
parent d2dec2f014
commit 04534d87ac

@ -50,7 +50,7 @@ func (c *OMIConfig) Prepare(accessConfig *AccessConfig, ctx *interpolate.Context
errs = append(errs, fmt.Errorf("omi_name must be between 3 and 128 characters long"))
}
if c.OMIName != templateCleanOMIName(c.OMIName) {
if c.OMIName != templateCleanResourceName(c.OMIName) {
errs = append(errs, fmt.Errorf("OMIName should only contain "+
"alphanumeric characters, parentheses (()), square brackets ([]), spaces "+
"( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs "+

@ -18,7 +18,7 @@ func isalphanumeric(b byte) bool {
return false
}
func templateCleanOMIName(s string) string {
func templateCleanResourceName(s string) string {
allowed := []byte{'(', ')', '[', ']', ' ', '.', '/', '-', '\'', '@', '_'}
b := []byte(s)
newb := make([]byte, len(b))
@ -33,5 +33,5 @@ func templateCleanOMIName(s string) string {
}
var TemplateFuncs = template.FuncMap{
"clean_omi_name": templateCleanOMIName,
"clean_resource_name": templateCleanResourceName,
}

Loading…
Cancel
Save