From 04534d87acacfe1cda018e3734d6d3c29c5287ae Mon Sep 17 00:00:00 2001 From: Marin Salinas Date: Fri, 5 Apr 2019 14:39:00 -0600 Subject: [PATCH] chore: change templateCleanOMIName to templateCleanResourceName function : --- builder/osc/common/omi_config.go | 2 +- builder/osc/common/template_funcs.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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, }