chore: change templateCleanOMIName to templateCleanResourceName function

:
This commit is contained in:
Marin Salinas 2019-04-05 14:39:00 -06:00 committed by Megan Marsh
parent d2dec2f014
commit 04534d87ac
2 changed files with 3 additions and 3 deletions

View File

@ -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 "+

View File

@ -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,
}