chore: change templateCleanOMIName to templateCleanResourceName function
:
This commit is contained in:
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…
Reference in New Issue