diff --git a/builder/osc/common/omi_config.go b/builder/osc/common/omi_config.go index 684f6fca4..5e7b520fd 100644 --- a/builder/osc/common/omi_config.go +++ b/builder/osc/common/omi_config.go @@ -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 "+ diff --git a/builder/osc/common/template_funcs.go b/builder/osc/common/template_funcs.go index 1b574f75b..78680c5c1 100644 --- a/builder/osc/common/template_funcs.go +++ b/builder/osc/common/template_funcs.go @@ -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, }